Documentation ¶
Index ¶
- Variables
- func Color(r, g, b int) colorful.Color
- func ColorToPhilipsHueHSB(color colorful.Color) (uint16, uint8, uint8)
- func Shutdown()
- func Startup()
- type ADC
- type SoftwareSPI
- func (o *SoftwareSPI) Close() error
- func (o *SoftwareSPI) ReceiveByte() (byte, error)
- func (o *SoftwareSPI) ReceiveData(len int) ([]uint8, error)
- func (o *SoftwareSPI) TransferAndReceiveByte(data byte) (byte, error)
- func (o *SoftwareSPI) TransferAndReceiveData(dataBuffer []uint8) error
- func (o *SoftwareSPI) Write(data []byte) (n int, err error)
- type TemperatureReader
- type WS2801
Constants ¶
This section is empty.
Variables ¶
var BLACK = colorful.Color{R: 0.0, G: 0.0, B: 0.0}
BLACK is a pure blue integer representation
var BLUE = colorful.Color{R: 0.0, G: 0.0, B: 1.0}
BLUE is a pure blue integer representation
var GREEN = colorful.Color{R: 0.0, G: 1.0, B: 0.0}
GREEN is a pure green integer representation
var RED = colorful.Color{R: 1.0, G: 0.0, B: 0.0}
RED is a pure red integer representation
var StubI2CBus *stubembd.StubI2CBus
StubSPIBus can be set to a mock object for testing purposes
var StubSPIBus *stubembd.StubSPIBus
StubSPIBus can be set to a mock object for testing purposes
Functions ¶
func ColorToPhilipsHueHSB ¶
Types ¶
type ADC ¶
ADC provdes an interface for communicating with an ADS1x15 analog to digital converter chip
func NewADS1115 ¶
NewADS1115 creates an abstracted ADC based on the ADS1115 I2C chip
func NewMCP3008 ¶
NewADS1115 creates an abstracted ADC based on the MCP3008 SPI chip
type SoftwareSPI ¶
type SoftwareSPI struct {
// contains filtered or unexported fields
}
func NewSoftwareSPI ¶
func NewSoftwareSPI(clk, mosi int) *SoftwareSPI
func (*SoftwareSPI) Close ¶
func (o *SoftwareSPI) Close() error
Close releases the resources associated with the bus.
func (*SoftwareSPI) ReceiveByte ¶
func (o *SoftwareSPI) ReceiveByte() (byte, error)
ReceiveByte receives a byte data.
func (*SoftwareSPI) ReceiveData ¶
func (o *SoftwareSPI) ReceiveData(len int) ([]uint8, error)
ReceiveData receives data of length len into a slice.
func (*SoftwareSPI) TransferAndReceiveByte ¶
func (o *SoftwareSPI) TransferAndReceiveByte(data byte) (byte, error)
TransferAndReceiveByte transmits a byte data and receives a byte.
func (*SoftwareSPI) TransferAndReceiveData ¶
func (o *SoftwareSPI) TransferAndReceiveData(dataBuffer []uint8) error
TransferAndReceiveData transmits data in a buffer(slice) and receives into it.
type TemperatureReader ¶
type TemperatureReader interface { // GetTemperatureReading reads the tempearature from the requested probe GetTemperatureReading(probe int32) (*models.TemperatureReading, error) // GetNumProbes returns the number of configured temperature probes GetNumProbes() int32 // Close closes communication with the underlying hardware Close() }
TemperatureReader provides an interface to read temperature values from the physical temperature probes
func NewTemperatureReader ¶
func NewTemperatureReader() TemperatureReader
NewTemperatureReader provides an abstracted interface to the temperature probes
type WS2801 ¶
type WS2801 interface { GetPixels() []byte GetColors() ([]*colorful.Color, error) GetNumPixels() int32 Close() error Off() error Update() error SetPixelRGB(n int32, r uint8, g uint8, b uint8) error SetPixelColor(n int32, color colorful.Color) error SetAllPixels(color colorful.Color) error }
WS2801 privdes an interface for communicating with an LED strip which uses the WS2801 chip
func NewGrillLightController ¶
func NewGrillLightController() WS2801
NewGrillLightController provides an abstracted interface to the LED strands