hal

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FanUnitStandard = iota
	FanUnitSmart
)
View Source
const (
	PowerPoeOrUsbC = iota
	PowerPoe802at
)
View Source
const (
	LedTop = iota
	LedEdge
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ComputeBladeHal

type ComputeBladeHal interface {
	Close() error
	// SetFanSpeed sets the fan speed in percent
	SetFanSpeed(speed uint8) error
	// GetFanSpeed returns the current fan speed in percent (based on moving average)
	GetFanRPM() (float64, error)
	// SetStealthMode enables/disables stealth mode of the blade (turning on/off the LEDs)
	SetStealthMode(enabled bool) error
	// SetLEDs sets the color of the LEDs
	SetLed(idx uint, color LedColor) error
	// GetPowerStatus returns the current power status of the blade
	GetPowerStatus() (PowerStatus, error)
	// GetEdgeButtonPressChan returns a channel emitting edge button press events
	WaitForEdgeButtonPress(ctx context.Context) error
}

ComputeBladeHal abstracts hardware details of the Compute Blade and provides a simple interface

func NewCm4Hal

func NewCm4Hal(opts ComputeBladeHalOpts) (ComputeBladeHal, error)

type ComputeBladeHalMock

type ComputeBladeHalMock struct {
	mock.Mock
}

ComputeBladeMock implements a mock for the ComputeBladeHal interface

func (*ComputeBladeHalMock) Close

func (m *ComputeBladeHalMock) Close() error

func (*ComputeBladeHalMock) GetFanRPM

func (m *ComputeBladeHalMock) GetFanRPM() (float64, error)

func (*ComputeBladeHalMock) GetPowerStatus

func (m *ComputeBladeHalMock) GetPowerStatus() (PowerStatus, error)

func (*ComputeBladeHalMock) SetFanSpeed

func (m *ComputeBladeHalMock) SetFanSpeed(percent uint8) error

func (*ComputeBladeHalMock) SetLed

func (m *ComputeBladeHalMock) SetLed(idx uint, color LedColor) error

func (*ComputeBladeHalMock) SetStealthMode

func (m *ComputeBladeHalMock) SetStealthMode(enabled bool) error

func (*ComputeBladeHalMock) WaitForEdgeButtonPress

func (m *ComputeBladeHalMock) WaitForEdgeButtonPress(ctx context.Context) error

type ComputeBladeHalOpts

type ComputeBladeHalOpts struct {
	FanUnit FanUnit
}

type ComputeModule

type ComputeModule uint8

type FanUnit

type FanUnit uint8

type LedColor

type LedColor struct {
	Red   uint8
	Green uint8
	Blue  uint8
}

type PowerStatus

type PowerStatus uint8

func (PowerStatus) String

func (p PowerStatus) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL