Documentation ¶
Overview ¶
Package gpiotest is meant to be used to test drivers using fake Pins.
Index ¶
- type LogPinIO
- func (p *LogPinIO) In(pull gpio.Pull, edge gpio.Edge) error
- func (p *LogPinIO) Out(l gpio.Level) error
- func (p *LogPinIO) PWM(duty gpio.Duty, f physic.Frequency) error
- func (p *LogPinIO) Pull() gpio.Pull
- func (p *LogPinIO) Read() gpio.Level
- func (p *LogPinIO) Real() gpio.PinIO
- func (p *LogPinIO) WaitForEdge(timeout time.Duration) bool
- type Pin
- func (p *Pin) DefaultPull() gpio.Pull
- func (p *Pin) Function() string
- func (p *Pin) Halt() error
- func (p *Pin) In(pull gpio.Pull, edge gpio.Edge) error
- func (p *Pin) Name() string
- func (p *Pin) Number() int
- func (p *Pin) Out(l gpio.Level) error
- func (p *Pin) PWM(duty gpio.Duty, f physic.Frequency) error
- func (p *Pin) Pull() gpio.Pull
- func (p *Pin) Read() gpio.Level
- func (p *Pin) String() string
- func (p *Pin) WaitForEdge(timeout time.Duration) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogPinIO ¶
LogPinIO logs when its state changes.
type Pin ¶
type Pin struct { N string // Should be immutable Num int // Should be immutable Fn string // Should be immutable sync.Mutex // Grab the Mutex before modifying the members to keep it concurrent safe L gpio.Level // Used for both input and output P gpio.Pull EdgesChan chan gpio.Level // Use it to fake edges D gpio.Duty // PWM duty F physic.Frequency // PWM period }
Pin implements gpio.PinIO.
Modify its members to simulate hardware events.
Click to show internal directories.
Click to hide internal directories.