STM32 RTOS 0.2.3
Bare-metal preemptive RTOS for STM32F446RE
Loading...
Searching...
No Matches

General-purpose I/O ports A to H. More...

Collaboration diagram for GPIO:

Data Structures

struct  GpioRegisters_t
 GPIO port register block. More...

Typedefs

typedef struct GpioRegisters_t GpioRegisters_t
 GPIO port register block.

Base addresses (AHB1)

#define GPIOA_BASE   (0x40020000UL)
 GPIOA.
#define GPIOB_BASE   (0x40020400UL)
 GPIOB.
#define GPIOC_BASE   (0x40020800UL)
 GPIOC.
#define GPIOD_BASE   (0x40020C00UL)
 GPIOD.
#define GPIOE_BASE   (0x40021000UL)
 GPIOE.
#define GPIOF_BASE   (0x40021400UL)
 GPIOF.
#define GPIOG_BASE   (0x40021800UL)
 GPIOG.
#define GPIOH_BASE   (0x40021C00UL)
 GPIOH.

Port instances

#define GPIOA   ((GpioRegisters_t *)GPIOA_BASE)
 Port A.
#define GPIOB   ((GpioRegisters_t *)GPIOB_BASE)
 Port B.
#define GPIOC   ((GpioRegisters_t *)GPIOC_BASE)
 Port C.
#define GPIOD   ((GpioRegisters_t *)GPIOD_BASE)
 Port D.
#define GPIOE   ((GpioRegisters_t *)GPIOE_BASE)
 Port E.
#define GPIOF   ((GpioRegisters_t *)GPIOF_BASE)
 Port F.
#define GPIOG   ((GpioRegisters_t *)GPIOG_BASE)
 Port G.
#define GPIOH   ((GpioRegisters_t *)GPIOH_BASE)
 Port H.

MODER values

#define GPIO_MODE_INPUT   (0x0U)
 Input.
#define GPIO_MODE_OUTPUT   (0x1U)
 General-purpose output.
#define GPIO_MODE_AF   (0x2U)
 Alternate function.
#define GPIO_MODE_ANALOG   (0x3U)
 Analog.

OTYPER values

#define GPIO_OTYPE_PP   (0x0U)
 Push-pull.
#define GPIO_OTYPE_OD   (0x1U)
 Open-drain.

OSPEEDR values

#define GPIO_OSPEED_LOW   (0x0U)
 Low speed.
#define GPIO_OSPEED_MEDIUM   (0x1U)
 Medium speed.
#define GPIO_OSPEED_FAST   (0x2U)
 Fast speed.
#define GPIO_OSPEED_HIGH   (0x3U)
 High speed.

PUPDR values

#define GPIO_PUPD_NONE   (0x0U)
 No pull.
#define GPIO_PUPD_UP   (0x1U)
 Pull-up.
#define GPIO_PUPD_DOWN   (0x2U)
 Pull-down.

Non-zero reset values

Every other GPIO register resets to 0 (IDR excepted).

The exceptions are the SWD/JTAG pins: PA13 (SWDIO), PA14 (SWCLK), PA15 (JTDI), PB3 (SWO) and PB4 (NJTRST). GPIOA_OSPEEDR is 0 on the F446, unlike the F401/F411 (0x0C000000); checked against ST's F446 SVD.

#define GPIOA_MODER_RESET   (0xA8000000U)
 PA13-15 in AF mode.
#define GPIOA_PUPDR_RESET   (0x64000000U)
 PA13/PA15 pull-up, PA14 pull-down.
#define GPIOB_MODER_RESET   (0x00000280U)
 PB3/PB4 in AF mode.
#define GPIOB_OSPEEDR_RESET   (0x000000C0U)
 PB3 high speed.
#define GPIOB_PUPDR_RESET   (0x00000100U)
 PB4 pull-up.

Detailed Description

General-purpose I/O ports A to H.

Macro Definition Documentation

◆ GPIOA_BASE

#define GPIOA_BASE   (0x40020000UL)

GPIOA.

Definition at line 21 of file gpio_reg.h.

◆ GPIOB_BASE

#define GPIOB_BASE   (0x40020400UL)

GPIOB.

Definition at line 22 of file gpio_reg.h.

◆ GPIOC_BASE

#define GPIOC_BASE   (0x40020800UL)

GPIOC.

Definition at line 23 of file gpio_reg.h.

◆ GPIOD_BASE

#define GPIOD_BASE   (0x40020C00UL)

GPIOD.

Definition at line 24 of file gpio_reg.h.

◆ GPIOE_BASE

#define GPIOE_BASE   (0x40021000UL)

GPIOE.

Definition at line 25 of file gpio_reg.h.

◆ GPIOF_BASE

#define GPIOF_BASE   (0x40021400UL)

GPIOF.

Definition at line 26 of file gpio_reg.h.

◆ GPIOG_BASE

#define GPIOG_BASE   (0x40021800UL)

GPIOG.

Definition at line 27 of file gpio_reg.h.

◆ GPIOH_BASE

#define GPIOH_BASE   (0x40021C00UL)

GPIOH.

Definition at line 28 of file gpio_reg.h.

◆ GPIOA

#define GPIOA   ((GpioRegisters_t *)GPIOA_BASE)

Port A.

Definition at line 48 of file gpio_reg.h.

Referenced by extiPortSelector(), gpioPortResetValues(), and rccGpioClockBit().

◆ GPIOB

#define GPIOB   ((GpioRegisters_t *)GPIOB_BASE)

Port B.

Definition at line 49 of file gpio_reg.h.

Referenced by extiPortSelector(), gpioPortResetValues(), and rccGpioClockBit().

◆ GPIOC

#define GPIOC   ((GpioRegisters_t *)GPIOC_BASE)

Port C.

Definition at line 50 of file gpio_reg.h.

Referenced by extiPortSelector(), and rccGpioClockBit().

◆ GPIOD

#define GPIOD   ((GpioRegisters_t *)GPIOD_BASE)

Port D.

Definition at line 51 of file gpio_reg.h.

Referenced by extiPortSelector(), and rccGpioClockBit().

◆ GPIOE

#define GPIOE   ((GpioRegisters_t *)GPIOE_BASE)

Port E.

Definition at line 52 of file gpio_reg.h.

Referenced by extiPortSelector(), and rccGpioClockBit().

◆ GPIOF

#define GPIOF   ((GpioRegisters_t *)GPIOF_BASE)

Port F.

Definition at line 53 of file gpio_reg.h.

Referenced by extiPortSelector(), and rccGpioClockBit().

◆ GPIOG

#define GPIOG   ((GpioRegisters_t *)GPIOG_BASE)

Port G.

Definition at line 54 of file gpio_reg.h.

Referenced by extiPortSelector(), and rccGpioClockBit().

◆ GPIOH

#define GPIOH   ((GpioRegisters_t *)GPIOH_BASE)

Port H.

Definition at line 55 of file gpio_reg.h.

Referenced by extiPortSelector(), and rccGpioClockBit().

◆ GPIO_MODE_INPUT

#define GPIO_MODE_INPUT   (0x0U)

Input.

Definition at line 60 of file gpio_reg.h.

◆ GPIO_MODE_OUTPUT

#define GPIO_MODE_OUTPUT   (0x1U)

General-purpose output.

Definition at line 61 of file gpio_reg.h.

◆ GPIO_MODE_AF

#define GPIO_MODE_AF   (0x2U)

Alternate function.

Definition at line 62 of file gpio_reg.h.

◆ GPIO_MODE_ANALOG

#define GPIO_MODE_ANALOG   (0x3U)

Analog.

Definition at line 63 of file gpio_reg.h.

Referenced by gpioInit().

◆ GPIO_OTYPE_PP

#define GPIO_OTYPE_PP   (0x0U)

Push-pull.

Definition at line 68 of file gpio_reg.h.

◆ GPIO_OTYPE_OD

#define GPIO_OTYPE_OD   (0x1U)

Open-drain.

Definition at line 69 of file gpio_reg.h.

Referenced by gpioInit().

◆ GPIO_OSPEED_LOW

#define GPIO_OSPEED_LOW   (0x0U)

Low speed.

Definition at line 74 of file gpio_reg.h.

◆ GPIO_OSPEED_MEDIUM

#define GPIO_OSPEED_MEDIUM   (0x1U)

Medium speed.

Definition at line 75 of file gpio_reg.h.

◆ GPIO_OSPEED_FAST

#define GPIO_OSPEED_FAST   (0x2U)

Fast speed.

Definition at line 76 of file gpio_reg.h.

◆ GPIO_OSPEED_HIGH

#define GPIO_OSPEED_HIGH   (0x3U)

High speed.

Definition at line 77 of file gpio_reg.h.

Referenced by gpioInit().

◆ GPIO_PUPD_NONE

#define GPIO_PUPD_NONE   (0x0U)

No pull.

Definition at line 82 of file gpio_reg.h.

◆ GPIO_PUPD_UP

#define GPIO_PUPD_UP   (0x1U)

Pull-up.

Definition at line 83 of file gpio_reg.h.

◆ GPIO_PUPD_DOWN

#define GPIO_PUPD_DOWN   (0x2U)

Pull-down.

Definition at line 84 of file gpio_reg.h.

Referenced by gpioInit().

◆ GPIOA_MODER_RESET

#define GPIOA_MODER_RESET   (0xA8000000U)

PA13-15 in AF mode.

Definition at line 94 of file gpio_reg.h.

Referenced by gpioPortResetValues().

◆ GPIOA_PUPDR_RESET

#define GPIOA_PUPDR_RESET   (0x64000000U)

PA13/PA15 pull-up, PA14 pull-down.

Definition at line 95 of file gpio_reg.h.

Referenced by gpioPortResetValues().

◆ GPIOB_MODER_RESET

#define GPIOB_MODER_RESET   (0x00000280U)

PB3/PB4 in AF mode.

Definition at line 96 of file gpio_reg.h.

Referenced by gpioPortResetValues().

◆ GPIOB_OSPEEDR_RESET

#define GPIOB_OSPEEDR_RESET   (0x000000C0U)

PB3 high speed.

Definition at line 97 of file gpio_reg.h.

Referenced by gpioPortResetValues().

◆ GPIOB_PUPDR_RESET

#define GPIOB_PUPDR_RESET   (0x00000100U)

PB4 pull-up.

Definition at line 98 of file gpio_reg.h.

Referenced by gpioPortResetValues().

Typedef Documentation

◆ GpioRegisters_t

typedef struct GpioRegisters_t GpioRegisters_t

GPIO port register block.

Every register is rw unless noted.