stubembd

package
v0.0.0-...-13dad8c Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetFakeTemp

func SetFakeTemp(probe int32, analog int32)

Types

type StubI2CBus

type StubI2CBus struct {
	CloseCallCount, WriteToRegCallCount, ReadFromRegCallCount int
	ReadFromRegReturnValues                                   [][]int
}

StubI2CBus provides a stub of embd.I2CBus

func NewStubI2CBus

func NewStubI2CBus() *StubI2CBus

NewStubI2CBus creates a new stubbed SPIBus

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) Close

func (o *StubSPIBus) Close() error

Close - See embd.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

func (*StubSPIBus) Write

func (o *StubSPIBus) Write(data []byte) (int, error)

Write - See embd.SPIBus

Jump to

Keyboard shortcuts

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