Documentation ¶
Overview ¶
Package gpiotest is meant to be used to test drivers using fake Pins.
Index ¶
- type Pin
- 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) 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 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 }
Pin implements gpio.Pin.
Modify its members to simulate hardware events.
Click to show internal directories.
Click to hide internal directories.