Documentation
¶
Overview ¶
The gpio package provides two modules that simulate buttons and switches respectively, using the GPIO pins of the Raspberry Pi. Used pins of Raspberry Pi needs to be wired to respective pads/connections on the DUT.
E.g. this module can be used to pull down the reset line of the DUT.
Index ¶
Constants ¶
View Source
const DefaultButtonPressDuration = 500 * time.Millisecond
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Button ¶
type Button struct {
Pin Pin // Raw BCM2835/BCM2711 pin number
ActiveLow bool // If set, the idle state is high, and low when pressed. Default is false
Backend string // For future use. Name of the backend to use. Default and fallback is "devmem"
// contains filtered or unexported fields
}
A Button simulates a button press by changing the state of a GPIO pin.
type Switch ¶
type Switch struct {
// Raw BCM2835/BCM2711 pin number
Pin Pin
// Initial state of the switch: "on" or "off" (case insensitive). Default and fallback is "off".
Initial string
// If true, the switch is active low (switch on means gpio pin low). Default is false.
ActiveLow bool
// For future use. Name of the backend to use. Default is "devmem"
Backend string
// contains filtered or unexported fields
}
A Switch simulates an on/off switch by changing the state of a GPIO pin. By default, the switch is off and off means the pin is low.
Click to show internal directories.
Click to hide internal directories.