jacdac.gpio
Submodules
Package Contents
Classes
Access to General Purpose Input/Output (GPIO) pins on a board. |
- class jacdac.gpio.GPIOClient(bus: jacdac.bus.Bus, role: str, *, missing_state_value: bytes | None = None)
Bases:
jacdac.bus.SensorClient
- Access to General Purpose Input/Output (GPIO) pins on a board.
The pins are indexed 0 … num_pins-1.
The indexing does not correspond to hardware pin names, nor labels on the board (see get_pin_info command for that),
and should not be exposed to the user.
Implements a client for the GPIO service.
- property state: bytes | None
For every pin set to Input* the corresponding bit in digital_values will be 1 if and only if the pin is high. For other pins, the bit is 0. This is normally streamed at low-ish speed, but it’s also automatically reported whenever a digital input pin changes value (throttled to ~100Hz). The analog values can be read with the ADC service.,