Skip to main content

Module pin

Module pin 

Source
Expand description

The GPIO pin model: levels, pull and drive configuration, interrupt edges, and active polarity.

A GPIO pin is the simplest interface on a board: one line that is either high or low. The logic that still has to be right is the meaning of that level. A button wired to ground through a pull-up reads low when pressed; a relay board sold as “active low” switches on when its input is driven low. Treating “pressed” or “on” as if it always meant a high level is a classic inversion bug. This module carries the small set of GPIO concepts so that mapping is written down once rather than scattered through call sites.

Enums§

Direction
Whether a pin reads its line (input) or drives it (output).
Drive
How an output pin drives its two states.
Edge
The signal transition that triggers a pin interrupt.
Level
The physical voltage level on a pin.
Polarity
Whether a signal is asserted by a high or a low physical level.
Pull
The internal pull resistor applied to an input pin.