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) 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) Func() pin.Func
- 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) SetFunc(f pin.Func) error
- func (p *Pin) String() string
- func (p *Pin) SupportedFuncs() []pin.Func
- 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 { // These should be immutable. N string Num int Fn string // TODO(maruel): pin.Func in v4. // Grab the Mutex before accessing the following members. sync.Mutex 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.
func (*Pin) SupportedFuncs ¶
SupportedFuncs implements pin.PinFunc.
Click to show internal directories.
Click to hide internal directories.