HomeCore 0.1.3 (07b5544)
Bare-metal personal computer firmware for Cortex-M
Loading...
Searching...
No Matches

Pin configuration, output, and input on GPIO ports. More...

Collaboration diagram for GPIO:

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...
 

Detailed Description

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
See also
GPIO ports for the Drivers, their configuration, and tests.

Enumeration Type Documentation

◆ gpio_mode_t

Pin configuration for gpio_ops_t::configure.

Enumerator
GPIO_INPUT 

Floating input.

GPIO_INPUT_PULL_UP 

Input with the internal pull-up resistor.

GPIO_INPUT_PULL_DOWN 

Input with the internal pull-down resistor.

GPIO_OUTPUT 

Push-pull output at the lowest speed, initially low.