Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotInitialized = errors.New("cannot send code: device is not initialized. make sure to initialize the device first") ErrCleanWOInitialized = errors.New("cannot cleanup a non-initialized device") ErrCleanup = errors.New("failed to cleanup: could not close rpio") ErrInitialize = errors.New("failed to initialize device: could not open rpio") ErrNonArm = errors.New("unsupported architecture: this library only works on the raspberry pi (arm)") )
Functions ¶
This section is empty.
Types ¶
type HardwareOutput ¶ added in v1.1.0
type HardwareOutput interface { Kind() HardwareOutputKind Low() error High() error }
type HardwareOutputCharacterdev ¶ added in v1.1.0
func NewCharacterDev ¶ added in v1.1.0
func NewCharacterDev(devicePath string, pinNumber int) (HardwareOutputCharacterdev, error)
func (HardwareOutputCharacterdev) High ¶ added in v1.1.0
func (self HardwareOutputCharacterdev) High() error
func (HardwareOutputCharacterdev) Kind ¶ added in v1.1.0
func (self HardwareOutputCharacterdev) Kind() HardwareOutputKind
func (HardwareOutputCharacterdev) Low ¶ added in v1.1.0
func (self HardwareOutputCharacterdev) Low() error
type HardwareOutputKind ¶ added in v1.1.0
type HardwareOutputKind uint8
const ( HardwareOutputRpi HardwareOutputKind = iota HardwareOutputCdev )
type HardwareOutputRaspberryPi ¶ added in v1.1.0
type HardwareOutputRaspberryPi struct {
Pin rpio.Pin
}
func NewRaspberryPi ¶ added in v1.1.0
func NewRaspberryPi(pinNumber uint) (HardwareOutputRaspberryPi, error)
func (HardwareOutputRaspberryPi) High ¶ added in v1.1.0
func (self HardwareOutputRaspberryPi) High() error
func (HardwareOutputRaspberryPi) Kind ¶ added in v1.1.0
func (self HardwareOutputRaspberryPi) Kind() HardwareOutputKind
func (HardwareOutputRaspberryPi) Low ¶ added in v1.1.0
func (self HardwareOutputRaspberryPi) Low() error
type RFDevice ¶
type RFDevice struct { Output HardwareOutput TxEnabled bool TxProto uint8 TxRepeat uint8 TxLength uint8 TxPulseLength uint16 }
func NewRF ¶
func NewRF(hardware HardwareOutput, protocolIndex uint8, repeat uint8, pulseLength uint16, length uint8) RFDevice
Initializes the GPIO device Provide a pin number, a protocol, how often the signal should be sent, the pulse length and the data length The pin number will be the `BCM / bcm2835` pin, not the physical one
Click to show internal directories.
Click to hide internal directories.