21#ifndef PERIPH_CPU_GPIO_H
22#define PERIPH_CPU_GPIO_H
37typedef uint32_t gpio_t;
44#define GPIO_UNDEF (0xffffffff)
49#if defined(CPU_FAM_STM32MP1)
50#define GPIO_PIN(x, y) ((GPIOA_BASE + (x << 12)) | y)
52#define GPIO_PIN(x, y) ((GPIOA_BASE + (x << 10)) | y)
110#ifndef CPU_FAM_STM32F0
125#ifdef CPU_FAM_STM32F1
136#define GPIO_MODE(mode, cnf, odr) (mode | (cnf << 2) | (odr << 4))
144#define HAVE_GPIO_MODE_T
160#define HAVE_GPIO_PP_T
176#define GPIO_MODE(io, pr, ot) ((io << 0) | (pr << 2) | (ot << 4))
183#define HAVE_GPIO_MODE_T
201#define HAVE_GPIO_FLANK_T
@ GPIO_OUT
select GPIO MASK as output
@ GPIO_IN
select GPIO MASK as input
gpio_af_t
Available MUX values for configuring a pin's alternate function.
@ GPIO_AF1
use alternate function 1
@ GPIO_AF2
use alternate function 2
@ GPIO_AF5
use alternate function 5
@ GPIO_AF15
use alternate function 15
@ GPIO_AF4
use alternate function 4
@ GPIO_AF8
use alternate function 8
@ GPIO_AF6
use alternate function 6
@ GPIO_AF10
use alternate function 10
@ GPIO_AF9
use alternate function 9
@ GPIO_AF14
use alternate function 14
@ GPIO_AF3
use alternate function 3
@ GPIO_AF_UNDEF
an UNDEF value definition, e.g.
@ GPIO_AF0
use alternate function 0
@ GPIO_AF12
use alternate function 12
@ GPIO_AF7
use alternate function 7
@ GPIO_AF13
use alternate function 13
@ GPIO_AF11
use alternate function 11
#define GPIO_MODE(io, pr, ot)
Generate GPIO mode bitfields.
void gpio_init_af(gpio_t pin, gpio_af_t af)
Configure the alternate function for the given pin.
void gpio_init_analog(gpio_t pin)
Configure the given pin to be used as ADC input.
gpio_af_t
Override alternative GPIO mode options.
@ GPIO_AF_OUT_OD
alternate function output - open-drain
@ GPIO_AF_OUT_PP
alternate function output - push-pull
gpio_mode_t
Available pin modes.