|
HomeCore 0.1.3 (07b5544)
Bare-metal personal computer firmware for Cortex-M
|
Pin configuration, output, and input on GPIO ports. More...
Data Structures | |
| struct | gpio_ops_t |
| Operations a GPIO port driver provides; every one is required. More... | |
| struct | gpio_port_t |
| A GPIO port: driver operations bound to one port instance. More... | |
Enumerations | |
| enum | gpio_mode_t { GPIO_INPUT , GPIO_INPUT_PULL_UP , GPIO_INPUT_PULL_DOWN , GPIO_OUTPUT } |
| Pin configuration for gpio_ops_t::configure. More... | |
Pin configuration, output, and input on GPIO ports.
Each GPIO port is a device in soc.yaml, enabled by the boards that use it. Other drivers refer to a port through a gpio property and receive a gpio_port_t, which pairs the port driver's operations with the port instance. The port driver enables the port's clock in its init function.
Operations are for thread context: they read-modify-write configuration registers without masking interrupts, so interrupt handlers must not configure pins. Setting an output is a single register write on every current port driver.
| Driver | Compatible | Pins per port |
|---|---|---|
| STM32F4 | st,stm32f4-gpio | 16 |
| STM32F1 | st,stm32f1-gpio | 16 |
| enum gpio_mode_t |
Pin configuration for gpio_ops_t::configure.