Documentation ¶
Index ¶
- func SetFakeTemp(probe int32, analog int32)
- type StubI2CBus
- func (o *StubI2CBus) Close() error
- func (o *StubI2CBus) ReadByte(addr byte) (value byte, err error)
- func (o *StubI2CBus) ReadByteFromReg(addr, reg byte) (value byte, err error)
- func (o *StubI2CBus) ReadBytes(addr byte, num int) (value []byte, err error)
- func (o *StubI2CBus) ReadFromReg(addr, reg byte, value []byte) error
- func (o *StubI2CBus) ReadWordFromReg(addr, reg byte) (value uint16, err error)
- func (o *StubI2CBus) Reset()
- func (o *StubI2CBus) WriteByte(addr, value byte) error
- func (o *StubI2CBus) WriteByteToReg(addr, reg, value byte) error
- func (o *StubI2CBus) WriteBytes(addr byte, value []byte) error
- func (o *StubI2CBus) WriteToReg(addr, reg byte, value []byte) error
- func (o *StubI2CBus) WriteWordToReg(addr, reg byte, value uint16) error
- type StubSPIBus
- func (o *StubSPIBus) Close() error
- func (o *StubSPIBus) ReceiveByte() (byte, error)
- func (o *StubSPIBus) ReceiveData(data int) ([]byte, error)
- func (o *StubSPIBus) Reset()
- func (o *StubSPIBus) TransferAndReceiveByte(data byte) (byte, error)
- func (o *StubSPIBus) TransferAndReceiveData(data []byte) error
- func (o *StubSPIBus) Write(data []byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetFakeTemp ¶
Types ¶
type StubI2CBus ¶
type StubI2CBus struct {
CloseCallCount, WriteToRegCallCount, ReadFromRegCallCount int
ReadFromRegReturnValues [][]int
}
StubI2CBus provides a stub of embd.I2CBus
func (*StubI2CBus) Close ¶
func (o *StubI2CBus) Close() error
Close releases the resources associated with the bus.
func (*StubI2CBus) ReadByte ¶
func (o *StubI2CBus) ReadByte(addr byte) (value byte, err error)
ReadByte reads a byte from the given address.
func (*StubI2CBus) ReadByteFromReg ¶
func (o *StubI2CBus) ReadByteFromReg(addr, reg byte) (value byte, err error)
ReadByteFromReg reads a byte from the given address and register.
func (*StubI2CBus) ReadBytes ¶
func (o *StubI2CBus) ReadBytes(addr byte, num int) (value []byte, err error)
ReadBytes reads a slice of bytes from the given address.
func (*StubI2CBus) ReadFromReg ¶
func (o *StubI2CBus) ReadFromReg(addr, reg byte, value []byte) error
ReadFromReg reads n (len(value)) bytes from the given address and register.
func (*StubI2CBus) ReadWordFromReg ¶
func (o *StubI2CBus) ReadWordFromReg(addr, reg byte) (value uint16, err error)
ReadU16FromReg reads a unsigned 16 bit integer from the given address and register.
func (*StubI2CBus) Reset ¶
func (o *StubI2CBus) Reset()
ResetCallCounts resets the call counts of all embd.SPIBus interface methods
func (*StubI2CBus) WriteByte ¶
func (o *StubI2CBus) WriteByte(addr, value byte) error
WriteByte writes a byte to the given address.
func (*StubI2CBus) WriteByteToReg ¶
func (o *StubI2CBus) WriteByteToReg(addr, reg, value byte) error
WriteByteToReg writes a byte to the given address and register.
func (*StubI2CBus) WriteBytes ¶
func (o *StubI2CBus) WriteBytes(addr byte, value []byte) error
WriteBytes writes a slice bytes to the given address.
func (*StubI2CBus) WriteToReg ¶
func (o *StubI2CBus) WriteToReg(addr, reg byte, value []byte) error
WriteToReg writes len(value) bytes to the given address and register.
func (*StubI2CBus) WriteWordToReg ¶
func (o *StubI2CBus) WriteWordToReg(addr, reg byte, value uint16) error
WriteU16ToReg
type StubSPIBus ¶
type StubSPIBus struct {
CloseCallCount, ReceiveByteCallCount, ReceiveDataCallCount,
TransferAndReceiveByteCallCount, TransferAndReceiveDataCallCount, WriteCallCount int
// contains filtered or unexported fields
}
StubSPIBus provides a stub of embd.SPIBus
func NewStubSPIBus ¶
func NewStubSPIBus(channel byte) *StubSPIBus
NewStubSPIBus creates a new stubbed SPIBus
func (*StubSPIBus) ReceiveByte ¶
func (o *StubSPIBus) ReceiveByte() (byte, error)
ReceiveByte - See embd.SPIBus
func (*StubSPIBus) ReceiveData ¶
func (o *StubSPIBus) ReceiveData(data int) ([]byte, error)
ReceiveData - See embd.SPIBus
func (*StubSPIBus) Reset ¶
func (o *StubSPIBus) Reset()
ResetCallCounts resets the call counts of all embd.SPIBus interface methods
func (*StubSPIBus) TransferAndReceiveByte ¶
func (o *StubSPIBus) TransferAndReceiveByte(data byte) (byte, error)
TransferAndReceiveByte - See embd.SPIBus
func (*StubSPIBus) TransferAndReceiveData ¶
func (o *StubSPIBus) TransferAndReceiveData(data []byte) error
TransferAndReceiveData - See embd.SPIBus