15#define GPIO_PERIPHERAL_SIZE 0x3FF
20#define GPIO_CONFIG_DEFAULT \
28#define GPIO_CONFIG_INPUT \
151typedef struct GPIOpin {
155 void (*
set)(
struct GPIOpin *);
GPIO_Speed speed
Pin output speed | (default GPIO_SPEED_HIGH)
GPIO_PUPD pupd
Pin pull-up/pull-down | (default GPIO_PUPD_NONE)
void(* updateConfig)(struct GPIOpin *, GPIO_Config *)
GPIO_Mode mode
Pin I/O direction | (default GPIO_MODE_OUTPUT)
GPIO_AF afr
Pin alternate function | (default GPIO_AF0)
GPIO_TypeDef * port
GPIO port in which the pin is located.
GPIO_Config config
Configuration parameters for the pin.
void(* toggle)(struct GPIOpin *)
GPIO_Type type
Pin output type | (default GPIO_TYPE_PUSHPULL)
GPIO_Pin pin
Actual location of the pin within GPIO port.
void(* set)(struct GPIOpin *)
void(* reset)(struct GPIOpin *)
GPIO_AF
GPIO alternate function enum.
void GPIOpin_toggle(GPIOpin_t *)
Toggle the selected GPIO pin.
void GPIOpin_updateConfig(GPIOpin_t *, GPIO_Config *)
Update GPIO pin configuration.
GPIO_PUPD
GPIO pull-up/pull-down enum.
GPIOpin_t GPIOpin_init(GPIO_TypeDef *, GPIO_Pin, GPIO_Config *)
Initialiser for a GPIO peripheral pin interface.
GPIO_Speed
GPIO speed enum.
void GPIOpin_set(GPIOpin_t *)
Set the selected GPIO pin.
void GPIOpin_reset(GPIOpin_t *)
Clear the selected GPIO pin.
@ GPIO_AF5
SPI1/2/3/4/5/6.
@ GPIO_AF10
OTG_FS, OTG_HS.
@ GPIO_AF9
CAN1/CAN2, LTDC, TIM12..14.
@ GPIO_AF12
FMC, SDIO, OTG_HS.
@ GPIO_PUPD_PULLUP
Pull-up | (default for PA15, PA13, PB4)
@ GPIO_PUPD_PULLDOWN
Pull-down | (default for PB14)
@ GPIO_PUPD_NONE
No pull-up, pull-down | (default for all not specified)
@ GPIO_SPEED_LOW
Low speed output | (default for all not specified)
@ GPIO_SPEED_MEDIUM
Medium speed output |.
@ GPIO_SPEED_VERYHIGH
Very high speed output | (default for PA13, PB3)
@ GPIO_SPEED_HIGH
High speed output |.
@ GPIO_TYPE_PUSHPULL
Push pull (reset state)
@ GPIO_TYPE_OPENDRAIN
Open drain.
@ GPIO_MODE_AF
Alternate function mode.
@ GPIO_MODE_ANALOG
Analog mode.
@ GPIO_MODE_INPUT
Input mode (reset state)
@ GPIO_MODE_OUTPUT
General purpose output mode.
Struct definition for GPIO configuration.
Struct definition for a GPIO pin.
CMSIS STM32F439xx Device Peripheral Access Layer Header File.