19#ifndef PERIPH_CPU_GPIO_LL_H
20#define PERIPH_CPU_GPIO_LL_H
24#include "periph_cpu.h"
34#if !defined(CPU_FAM_STM32F1)
36# define HAVE_GPIO_LL_PREPARE_SWITCH_DIR
39#define HAVE_GPIO_PULL_STRENGTH_T
47#define HAVE_GPIO_DRIVE_STRENGTH_T
62#if defined(GPIO_OSPEEDR_OSPEED0) || defined(GPIO_OSPEEDER_OSPEEDR0) \
63 || defined(GPIO_OSPEEDER_OSPEED0) || defined(GPIO_OSPEEDR_OSPEEDR0)
64# define STM32_HAS_OSPEED 1
66# define STM32_HAS_OSPEED 0
69#define HAVE_GPIO_SLEW_T
86#define HAVE_GPIO_IRQ_TRIG_T
105 GPIO_TRIGGER_LEVEL = 0x4,
114 GPIOX_MODER_INPUT = 0x0,
115 GPIOX_MODER_OUTPUT = 0x1,
116 GPIOX_MODER_AF = 0x2,
117 GPIOX_MODER_ANALOG = 0x3,
123#define GPIO_STATE_T_OPEN_DRAIN_FLAG 0x4
127#define GPIO_STATE_T_MODER_Msk 0x3
129#define HAVE_GPIO_STATE_T
139#define HAVE_GPIO_PULL_T
147#define HAVE_GPIO_CONF_T
gpio_irq_trig_t
Definition of possible IRQ triggers.
@ GPIO_TRIGGER_EDGE_FALLING
edge triggered IRQ on falling flanks only
@ GPIO_TRIGGER_LEVEL_HIGH
level triggered IRQ on high input
@ GPIO_TRIGGER_EDGE_RISING
edge triggered IRQ on rising flanks only
@ GPIO_TRIGGER_EDGE_BOTH
edge triggered IRQ on falling AND rising flanks
@ GPIO_TRIGGER_LEVEL_LOW
level triggered IRQ on low input
gpio_pull_t
Enumeration of pull resistor configurations.
gpio_pull_strength_t
Enumeration of pull resistor values.
gpio_state_t
Enumeration of GPIO states (direction)
gpio_slew_t
Enumeration of slew rate settings.
gpio_drive_strength_t
Enumeration of drive strength options.
typedef gpio_conf_t
GPIO pin configuration.
@ GPIO_FLOATING
No pull ups nor pull downs enabled.
@ GPIO_PULL_KEEP
Keep the signal at current logic level with pull up/down resistors.
@ GPIO_PULL_DOWN
Pull down resistor enabled.
@ GPIO_PULL_UP
Pull up resistor enabled.
@ GPIO_PULL_WEAKEST
Use the weakest (highest Ohm value) resistor.
@ GPIO_PULL_WEAK
Use a weak pull resistor.
@ GPIO_PULL_STRONG
Use a strong pull resistor.
@ GPIO_PULL_STRONGEST
Use the strongest pull resistor.
@ GPIO_OUTPUT_OPEN_SOURCE
Use pin as output in open emitter configuration.
@ GPIO_USED_BY_PERIPHERAL
The GPIO pin is used by a peripheral.
@ GPIO_OUTPUT_OPEN_DRAIN
Use pin as output in open collector configuration.
@ GPIO_OUTPUT_PUSH_PULL
Use pin as output in push-pull configuration.
@ GPIO_DISCONNECT
Disconnect pin from all peripherals.
@ GPIO_INPUT
Use pin as input.
@ GPIO_SLEW_SLOWEST
let the output voltage level rise/fall as slow as possible
@ GPIO_SLEW_FAST
let the output voltage level rise/fall fast
@ GPIO_SLEW_SLOW
let the output voltage level rise/fall slowly
@ GPIO_SLEW_FASTEST
let the output voltage level rise/fall as fast as possible
@ GPIO_DRIVE_STRONG
Use a strong drive strength.
@ GPIO_DRIVE_WEAK
Use a weak drive strength.
@ GPIO_DRIVE_STRONGEST
Use the strongest drive strength.
@ GPIO_DRIVE_WEAKEST
Use the weakest drive strength.
GPIO pin configuration for STM32 MCUs.
gpio_pull_t pull
Pull resistor configuration.
gpio_state_t state
State of the pin.
bool initial_value
Initial value of the output.
gpio_slew_t slew_rate
Configure the slew rate of outputs.