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 (c *Adaptor) Connect() error
- func (c *Adaptor) DefaultI2cBus() int
- func (c *Adaptor) Finalize() error
- func (c *Adaptor) Name() string
- func (c *Adaptor) PWMPin(id string) (gobot.PWMPinner, error)
- func (c *Adaptor) PwmWrite(pin string, val byte) (err error)
- func (c *Adaptor) ServoWrite(pin string, angle byte) (err error)
- func (c *Adaptor) SetName(n string)
- type PWMPin
- func (p *PWMPin) DutyCycle() (uint32, error)
- func (p *PWMPin) Enabled() (bool, error)
- func (p *PWMPin) Export() error
- func (p *PWMPin) Period() (uint32, error)
- func (p *PWMPin) Polarity() (bool, error)
- func (p *PWMPin) SetDutyCycle(duty uint32) error
- func (p *PWMPin) SetEnabled(e bool) error
- func (p *PWMPin) SetPeriod(period uint32) error
- func (p *PWMPin) SetPolarity(bool) (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 ¶
type Adaptor struct { *adaptors.DigitalPinsAdaptor *adaptors.I2cBusAdaptor *adaptors.SpiBusAdaptor PiBlasterPeriod uint32 // contains filtered or unexported fields }
Adaptor is the Gobot Adaptor for the Raspberry Pi
func NewAdaptor ¶
NewAdaptor creates a Raspi Adaptor
Optional parameters:
adaptors.WithGpiodAccess(): use character device gpiod driver instead of sysfs (still used by default) adaptors.WithSpiGpioAccess(sclk, nss, mosi, miso): use GPIO's instead of /dev/spidev#.# adaptors.WithGpiosActiveLow(pin's): invert the pin behavior adaptors.WithGpiosPullUp/Down(pin's): sets the internal pull resistor adaptors.WithGpiosOpenDrain/Source(pin's): sets the output behavior adaptors.WithGpioDebounce(pin, period): sets the input debouncer adaptors.WithGpioEventOnFallingEdge/RaisingEdge/BothEdges(pin, handler): activate edge detection
func (*Adaptor) DefaultI2cBus ¶
DefaultI2cBus returns the default i2c bus for this platform. This overrides the base function due to the revision dependency.
func (*Adaptor) ServoWrite ¶
ServoWrite writes a servo signal to the specified pin
type PWMPin ¶
type PWMPin struct {
// contains filtered or unexported fields
}
PWMPin is the Raspberry Pi implementation of the PWMPinner interface. It uses Pi Blaster.
func (*PWMPin) SetDutyCycle ¶
SetDutyCycle writes the duty cycle to the pin
func (*PWMPin) SetEnabled ¶
SetEnabled do nothing for PiBlaster
func (*PWMPin) SetPolarity ¶
SetPolarity does not do anything when using PiBlaster