board

package
v0.0.0-...-afa3a06 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Board

type Board struct {
	// contains filtered or unexported fields
}

Board is the configuration of a board

func NewBoard

func NewBoard(name string, chips map[string]*chip, pins PinsMap, typeTxt string) *Board

NewBoard creates a new board with given objects

func NewBoardType2i

func NewBoardType2i(adaptor i2c.Connector, address uint8, name string) *Board

NewBoardType2i creates a new board of type 2 with 8 inputs (negotiated read).

func NewBoardType2io

func NewBoardType2io(adaptor i2c.Connector, address uint8, name string) *Board

NewBoardType2io creates a new board of type 2 with 4 inputs (negotiated read) and 4 outputs. Pin 0..3 are output and 4..7 are input pins.

func NewBoardType2o

func NewBoardType2o(adaptor i2c.Connector, address uint8, name string) *Board

NewBoardType2o creates a new board of type 2 with 8 outputs.

func (*Board) GetPinNumbers

func (b *Board) GetPinNumbers() (pinNumbers boardpin.PinNumbers)

GetPinNumbers gets all pins of board

func (*Board) GetPinNumbersOfType

func (b *Board) GetPinNumbersOfType(pinTypes ...boardpin.PinType) (pinNumbers boardpin.PinNumbers)

GetPinNumbersOfType gets board pins of given types

func (*Board) GobotDevices

func (b *Board) GobotDevices() []gobot.Device

GobotDevices gets all gobot devices of the board

func (*Board) ReadValue

func (b *Board) ReadValue(boardPinNr uint8) (value uint8, err error)

ReadValue reads the value of the given pin of board

func (*Board) ShowBoardConfig

func (b *Board) ShowBoardConfig()

ShowBoardConfig prints all information of the board

func (*Board) String

func (b *Board) String() string

func (*Board) WriteValue

func (b *Board) WriteValue(boardPinNr uint8, value uint8) (err error)

WriteValue sets the given pin of board to the given value

type DriverOperations

type DriverOperations interface {
	gobot.Driver
	Command(string) (command func(map[string]interface{}) interface{})
}

DriverOperations is an interface for interact with gobot driver for chip

type PinsMap

type PinsMap map[uint8]*boardpin.Pin

PinsMap is a map of all pins on a board, the key is the board pin number

Jump to

Keyboard shortcuts

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