Documentation ¶
Overview ¶
Package chip contains the Gobot adaptor for the CHIP
For further information refer to the chip README: https://github.com/hybridgroup/gobot/blob/master/platforms/chip/README.md
Index ¶
- type ChipAdaptor
- func (c *ChipAdaptor) Connect() (errs []error)
- func (c *ChipAdaptor) DigitalRead(pin string) (val int, err error)
- func (c *ChipAdaptor) DigitalWrite(pin string, val byte) (err error)
- func (c *ChipAdaptor) Finalize() (errs []error)
- func (c *ChipAdaptor) I2cRead(address int, size int) (data []byte, err error)
- func (c *ChipAdaptor) I2cStart(address int) (err error)
- func (c *ChipAdaptor) I2cWrite(address int, data []byte) (err error)
- func (c *ChipAdaptor) Name() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChipAdaptor ¶
type ChipAdaptor struct {
// contains filtered or unexported fields
}
func NewChipAdaptor ¶
func NewChipAdaptor(name string) *ChipAdaptor
NewChipAdaptor creates a ChipAdaptor with the specified name
func (*ChipAdaptor) Connect ¶
func (c *ChipAdaptor) Connect() (errs []error)
Connect initializes the board
func (*ChipAdaptor) DigitalRead ¶
func (c *ChipAdaptor) DigitalRead(pin string) (val int, err error)
DigitalRead reads digital value from the specified pin. Valids pins are XIO-P0 through XIO-P7 (pins 13-20 on header 14).
func (*ChipAdaptor) DigitalWrite ¶
func (c *ChipAdaptor) DigitalWrite(pin string, val byte) (err error)
DigitalWrite writes digital value to the specified pin. Valids pins are XIO-P0 through XIO-P7 (pins 13-20 on header 14).
func (*ChipAdaptor) Finalize ¶
func (c *ChipAdaptor) Finalize() (errs []error)
Finalize closes connection to board and pins
func (*ChipAdaptor) I2cRead ¶
func (c *ChipAdaptor) I2cRead(address int, size int) (data []byte, err error)
I2cRead returns value from i2c device using specified size
func (*ChipAdaptor) I2cStart ¶
func (c *ChipAdaptor) I2cStart(address int) (err error)
I2cStart starts an i2c device in specified address. This assumes that the bus used is /dev/i2c-1, which corresponds to pins labeled TWI1-SDA and TW1-SCK (pins 9 and 11 on header 13).
func (*ChipAdaptor) I2cWrite ¶
func (c *ChipAdaptor) I2cWrite(address int, data []byte) (err error)
I2cWrite writes data to i2c device
func (*ChipAdaptor) Name ¶
func (c *ChipAdaptor) Name() string
Name returns the name of the ChipAdaptor