Documentation ¶
Overview ¶
Package raspi contains the Gobot adaptor for the Raspberry Pi.
For further information refer to raspi README: https://github.com/hybridgroup/gobot/blob/master/platforms/raspi/README.md
Index ¶
- type Adaptor
- func (r *Adaptor) Connect() (err error)
- func (r *Adaptor) DigitalPin(pin string, dir string) (sysfsPin sysfs.DigitalPinner, err error)
- func (r *Adaptor) DigitalRead(pin string) (val int, err error)
- func (r *Adaptor) DigitalWrite(pin string, val byte) (err error)
- func (r *Adaptor) Finalize() (err error)
- func (r *Adaptor) GetConnection(address int, bus int) (connection i2c.Connection, err error)
- func (r *Adaptor) GetDefaultBus() int
- func (r *Adaptor) GetSpiConnection(busNum, chipNum, mode, bits int, maxSpeed int64) (connection spi.Connection, err error)
- func (r *Adaptor) GetSpiDefaultBits() int
- func (r *Adaptor) GetSpiDefaultBus() int
- func (r *Adaptor) GetSpiDefaultChip() int
- func (r *Adaptor) GetSpiDefaultMaxSpeed() int64
- func (r *Adaptor) GetSpiDefaultMode() int
- func (r *Adaptor) Name() string
- func (r *Adaptor) PWMPin(pin string) (raspiPWMPin sysfs.PWMPinner, err error)
- func (r *Adaptor) PwmWrite(pin string, val byte) (err error)
- func (r *Adaptor) ServoWrite(pin string, angle byte) (err error)
- func (r *Adaptor) SetName(n string)
- type PWMPin
- func (p *PWMPin) DutyCycle() (duty uint32, err error)
- func (p *PWMPin) Enable(e bool) (err error)
- func (p *PWMPin) Export() error
- func (p *PWMPin) InvertPolarity(invert bool) (err error)
- func (p *PWMPin) Period() (period uint32, err error)
- func (p *PWMPin) Polarity() (polarity string, err error)
- func (p *PWMPin) SetDutyCycle(duty uint32) (err error)
- func (p *PWMPin) SetPeriod(period uint32) (err error)
- func (p *PWMPin) Unexport() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adaptor ¶ added in v1.0.0
type Adaptor struct { PiBlasterPeriod uint32 // contains filtered or unexported fields }
Adaptor is the Gobot Adaptor for the Raspberry Pi
func (*Adaptor) Connect ¶ added in v1.0.0
Connect starts connection with board and creates digitalPins and pwmPins adaptor maps
func (*Adaptor) DigitalPin ¶ added in v1.5.0
DigitalPin returns matched digitalPin for specified values
func (*Adaptor) DigitalRead ¶ added in v1.0.0
DigitalRead reads digital value from pin
func (*Adaptor) DigitalWrite ¶ added in v1.0.0
DigitalWrite writes digital value to specified pin
func (*Adaptor) GetConnection ¶ added in v1.2.0
GetConnection returns an i2c connection to a device on a specified bus. Valid bus number is [0..1] which corresponds to /dev/i2c-0 through /dev/i2c-1.
func (*Adaptor) GetDefaultBus ¶ added in v1.2.0
GetDefaultBus returns the default i2c bus for this platform
func (*Adaptor) GetSpiConnection ¶ added in v1.7.0
func (r *Adaptor) GetSpiConnection(busNum, chipNum, mode, bits int, maxSpeed int64) (connection spi.Connection, err error)
GetSpiConnection returns an spi connection to a device on a specified bus. Valid bus number is [0..1] which corresponds to /dev/spidev0.0 through /dev/spidev0.1.
func (*Adaptor) GetSpiDefaultBits ¶ added in v1.12.0
GetSpiDefaultBits returns the default spi number of bits for this platform.
func (*Adaptor) GetSpiDefaultBus ¶ added in v1.7.0
GetSpiDefaultBus returns the default spi bus for this platform.
func (*Adaptor) GetSpiDefaultChip ¶ added in v1.12.0
GetSpiDefaultChip returns the default spi chip for this platform.
func (*Adaptor) GetSpiDefaultMaxSpeed ¶ added in v1.7.0
GetSpiDefaultMaxSpeed returns the default spi bus for this platform.
func (*Adaptor) GetSpiDefaultMode ¶ added in v1.7.0
GetSpiDefaultMode returns the default spi mode for this platform.
func (*Adaptor) PWMPin ¶ added in v1.5.0
PWMPin returns a raspi.PWMPin which provides the sysfs.PWMPinner interface
func (*Adaptor) ServoWrite ¶ added in v1.0.0
ServoWrite writes a servo signal to the specified pin
type PWMPin ¶ added in v1.5.0
type PWMPin struct {
// contains filtered or unexported fields
}
PWMPin is the Raspberry Pi implementation of the PWMPinner interface. It uses Pi Blaster.
func (*PWMPin) InvertPolarity ¶ added in v1.5.0
InvertPolarity does not do anything when using PiBlaster
func (*PWMPin) SetDutyCycle ¶ added in v1.5.0
SetDutyCycle writes the duty cycle to the pin