libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
GPIO Defines

Defined Constants and Types for the STM32G0xx General Purpose I/O More...

Collaboration diagram for GPIO Defines:

Modules

 GPIO Output Pin Speed
 
 GPIO Pin Identifiers
 
 GPIO Port IDs
 
 GPIO Pin Direction and Analog/Digital Mode
 
 GPIO Output Pin Driver Type
 
 GPIO Output Pin Pullup
 
 Alternate Function Pin Selection
 

Macros

#define GPIO_BRR(port)   MMIO32((port) + 0x28)
 
#define GPIOA_BRR   GPIO_BRR(GPIOA)
 
#define GPIOB_BRR   GPIO_BRR(GPIOB)
 
#define GPIOC_BRR   GPIO_BRR(GPIOC)
 
#define GPIOD_BRR   GPIO_BRR(GPIOD)
 
#define GPIOE_BRR   GPIO_BRR(GPIOE)
 
#define GPIOF_BRR   GPIO_BRR(GPIOF)
 
#define GPIO_LCKK   (1 << 16)
 
#define GPIO_MODER(port)   MMIO32((port) + 0x00)
 
#define GPIOA_MODER   GPIO_MODER(GPIOA)
 
#define GPIOB_MODER   GPIO_MODER(GPIOB)
 
#define GPIOC_MODER   GPIO_MODER(GPIOC)
 
#define GPIOD_MODER   GPIO_MODER(GPIOD)
 
#define GPIOE_MODER   GPIO_MODER(GPIOE)
 
#define GPIOF_MODER   GPIO_MODER(GPIOF)
 
#define GPIOG_MODER   GPIO_MODER(GPIOG)
 
#define GPIOH_MODER   GPIO_MODER(GPIOH)
 
#define GPIO_OTYPER(port)   MMIO32((port) + 0x04)
 
#define GPIOA_OTYPER   GPIO_OTYPER(GPIOA)
 
#define GPIOB_OTYPER   GPIO_OTYPER(GPIOB)
 
#define GPIOC_OTYPER   GPIO_OTYPER(GPIOC)
 
#define GPIOD_OTYPER   GPIO_OTYPER(GPIOD)
 
#define GPIOE_OTYPER   GPIO_OTYPER(GPIOE)
 
#define GPIOF_OTYPER   GPIO_OTYPER(GPIOF)
 
#define GPIOG_OTYPER   GPIO_OTYPER(GPIOG)
 
#define GPIOH_OTYPER   GPIO_OTYPER(GPIOH)
 
#define GPIO_OSPEEDR(port)   MMIO32((port) + 0x08)
 
#define GPIOA_OSPEEDR   GPIO_OSPEEDR(GPIOA)
 
#define GPIOB_OSPEEDR   GPIO_OSPEEDR(GPIOB)
 
#define GPIOC_OSPEEDR   GPIO_OSPEEDR(GPIOC)
 
#define GPIOD_OSPEEDR   GPIO_OSPEEDR(GPIOD)
 
#define GPIOE_OSPEEDR   GPIO_OSPEEDR(GPIOE)
 
#define GPIOF_OSPEEDR   GPIO_OSPEEDR(GPIOF)
 
#define GPIOG_OSPEEDR   GPIO_OSPEEDR(GPIOG)
 
#define GPIOH_OSPEEDR   GPIO_OSPEEDR(GPIOH)
 
#define GPIO_PUPDR(port)   MMIO32((port) + 0x0c)
 
#define GPIOA_PUPDR   GPIO_PUPDR(GPIOA)
 
#define GPIOB_PUPDR   GPIO_PUPDR(GPIOB)
 
#define GPIOC_PUPDR   GPIO_PUPDR(GPIOC)
 
#define GPIOD_PUPDR   GPIO_PUPDR(GPIOD)
 
#define GPIOE_PUPDR   GPIO_PUPDR(GPIOE)
 
#define GPIOF_PUPDR   GPIO_PUPDR(GPIOF)
 
#define GPIOG_PUPDR   GPIO_PUPDR(GPIOG)
 
#define GPIOH_PUPDR   GPIO_PUPDR(GPIOH)
 
#define GPIO_IDR(port)   MMIO32((port) + 0x10)
 
#define GPIOA_IDR   GPIO_IDR(GPIOA)
 
#define GPIOB_IDR   GPIO_IDR(GPIOB)
 
#define GPIOC_IDR   GPIO_IDR(GPIOC)
 
#define GPIOD_IDR   GPIO_IDR(GPIOD)
 
#define GPIOE_IDR   GPIO_IDR(GPIOE)
 
#define GPIOF_IDR   GPIO_IDR(GPIOF)
 
#define GPIOG_IDR   GPIO_IDR(GPIOG)
 
#define GPIOH_IDR   GPIO_IDR(GPIOH)
 
#define GPIO_ODR(port)   MMIO32((port) + 0x14)
 
#define GPIOA_ODR   GPIO_ODR(GPIOA)
 
#define GPIOB_ODR   GPIO_ODR(GPIOB)
 
#define GPIOC_ODR   GPIO_ODR(GPIOC)
 
#define GPIOD_ODR   GPIO_ODR(GPIOD)
 
#define GPIOE_ODR   GPIO_ODR(GPIOE)
 
#define GPIOF_ODR   GPIO_ODR(GPIOF)
 
#define GPIOG_ODR   GPIO_ODR(GPIOG)
 
#define GPIOH_ODR   GPIO_ODR(GPIOH)
 
#define GPIO_BSRR(port)   MMIO32((port) + 0x18)
 
#define GPIOA_BSRR   GPIO_BSRR(GPIOA)
 
#define GPIOB_BSRR   GPIO_BSRR(GPIOB)
 
#define GPIOC_BSRR   GPIO_BSRR(GPIOC)
 
#define GPIOD_BSRR   GPIO_BSRR(GPIOD)
 
#define GPIOE_BSRR   GPIO_BSRR(GPIOE)
 
#define GPIOF_BSRR   GPIO_BSRR(GPIOF)
 
#define GPIOG_BSRR   GPIO_BSRR(GPIOG)
 
#define GPIOH_BSRR   GPIO_BSRR(GPIOH)
 
#define GPIO_LCKR(port)   MMIO32((port) + 0x1c)
 
#define GPIOA_LCKR   GPIO_LCKR(GPIOA)
 
#define GPIOB_LCKR   GPIO_LCKR(GPIOB)
 
#define GPIOC_LCKR   GPIO_LCKR(GPIOC)
 
#define GPIOD_LCKR   GPIO_LCKR(GPIOD)
 
#define GPIOE_LCKR   GPIO_LCKR(GPIOE)
 
#define GPIOF_LCKR   GPIO_LCKR(GPIOF)
 
#define GPIOG_LCKR   GPIO_LCKR(GPIOG)
 
#define GPIOH_LCKR   GPIO_LCKR(GPIOH)
 
#define GPIO_AFRL(port)   MMIO32((port) + 0x20)
 
#define GPIOA_AFRL   GPIO_AFRL(GPIOA)
 
#define GPIOB_AFRL   GPIO_AFRL(GPIOB)
 
#define GPIOC_AFRL   GPIO_AFRL(GPIOC)
 
#define GPIOD_AFRL   GPIO_AFRL(GPIOD)
 
#define GPIOE_AFRL   GPIO_AFRL(GPIOE)
 
#define GPIOF_AFRL   GPIO_AFRL(GPIOF)
 
#define GPIOG_AFRL   GPIO_AFRL(GPIOG)
 
#define GPIOH_AFRL   GPIO_AFRL(GPIOH)
 
#define GPIO_AFRH(port)   MMIO32((port) + 0x24)
 
#define GPIOA_AFRH   GPIO_AFRH(GPIOA)
 
#define GPIOB_AFRH   GPIO_AFRH(GPIOB)
 
#define GPIOC_AFRH   GPIO_AFRH(GPIOC)
 
#define GPIOD_AFRH   GPIO_AFRH(GPIOD)
 
#define GPIOE_AFRH   GPIO_AFRH(GPIOE)
 
#define GPIOF_AFRH   GPIO_AFRH(GPIOF)
 
#define GPIOG_AFRH   GPIO_AFRH(GPIOG)
 
#define GPIOH_AFRH   GPIO_AFRH(GPIOH)
 
#define GPIO_MODE(n, mode)   ((mode) << (2 * (n)))
 
#define GPIO_MODE_MASK(n)   (0x3 << (2 * (n)))
 
#define GPIO_OSPEED(n, speed)   ((speed) << (2 * (n)))
 
#define GPIO_OSPEED_MASK(n)   (0x3 << (2 * (n)))
 
#define GPIO_PUPD(n, pupd)   ((pupd) << (2 * (n)))
 
#define GPIO_PUPD_MASK(n)   (0x3 << (2 * (n)))
 
#define GPIO_LCKK   (1 << 16)
 
#define GPIO_AFR(n, af)   ((af) << ((n) * 4))
 
#define GPIO_AFR_MASK(n)   (0xf << ((n) * 4))
 
#define GPIOI_MODER   GPIO_MODER(GPIOI)
 
#define GPIOJ_MODER   GPIO_MODER(GPIOJ)
 
#define GPIOK_MODER   GPIO_MODER(GPIOK)
 
#define GPIOI_OTYPER   GPIO_OTYPER(GPIOI)
 
#define GPIOJ_OTYPER   GPIO_OTYPER(GPIOJ)
 
#define GPIOK_OTYPER   GPIO_OTYPER(GPIOK)
 
#define GPIOI_OSPEEDR   GPIO_OSPEEDR(GPIOI)
 
#define GPIOJ_OSPEEDR   GPIO_OSPEEDR(GPIOJ)
 
#define GPIOK_OSPEEDR   GPIO_OSPEEDR(GPIOK)
 
#define GPIOI_PUPDR   GPIO_PUPDR(GPIOI)
 
#define GPIOJ_PUPDR   GPIO_PUPDR(GPIOJ)
 
#define GPIOK_PUPDR   GPIO_PUPDR(GPIOK)
 
#define GPIOI_IDR   GPIO_IDR(GPIOI)
 
#define GPIOJ_IDR   GPIO_IDR(GPIOJ)
 
#define GPIOK_IDR   GPIO_IDR(GPIOK)
 
#define GPIOI_ODR   GPIO_ODR(GPIOI)
 
#define GPIOJ_ODR   GPIO_ODR(GPIOJ)
 
#define GPIOK_ODR   GPIO_ODR(GPIOK)
 
#define GPIOI_BSRR   GPIO_BSRR(GPIOI)
 
#define GPIOJ_BSRR   GPIO_BSRR(GPIOJ)
 
#define GPIOK_BSRR   GPIO_BSRR(GPIOK)
 
#define GPIOI_LCKR   GPIO_LCKR(GPIOI)
 
#define GPIOJ_LCKR   GPIO_LCKR(GPIOJ)
 
#define GPIOK_LCKR   GPIO_LCKR(GPIOK)
 
#define GPIOI_AFRL   GPIO_AFRL(GPIOI)
 
#define GPIOJ_AFRL   GPIO_AFRL(GPIOJ)
 
#define GPIOK_AFRL   GPIO_AFRL(GPIOK)
 
#define GPIOI_AFRH   GPIO_AFRH(GPIOI)
 
#define GPIOJ_AFRH   GPIO_AFRH(GPIOJ)
 
#define GPIOK_AFRH   GPIO_AFRH(GPIOK)
 

Functions

void gpio_set (uint32_t gpioport, uint16_t gpios)
 Set a Group of Pins Atomic. More...
 
void gpio_clear (uint32_t gpioport, uint16_t gpios)
 Clear a Group of Pins Atomic. More...
 
uint16_t gpio_get (uint32_t gpioport, uint16_t gpios)
 Read a Group of Pins. More...
 
void gpio_toggle (uint32_t gpioport, uint16_t gpios)
 Toggle a Group of Pins. More...
 
uint16_t gpio_port_read (uint32_t gpioport)
 Read from a Port. More...
 
void gpio_port_write (uint32_t gpioport, uint16_t data)
 Write to a Port. More...
 
void gpio_port_config_lock (uint32_t gpioport, uint16_t gpios)
 Lock the Configuration of a Group of Pins. More...
 
void gpio_mode_setup (uint32_t gpioport, uint8_t mode, uint8_t pull_up_down, uint16_t gpios)
 Set GPIO Pin Mode. More...
 
void gpio_set_output_options (uint32_t gpioport, uint8_t otype, uint8_t speed, uint16_t gpios)
 Set GPIO Output Options. More...
 
void gpio_set_af (uint32_t gpioport, uint8_t alt_func_num, uint16_t gpios)
 Set GPIO Alternate Function Selection. More...
 

Detailed Description

Defined Constants and Types for the STM32G0xx General Purpose I/O

Version
1.0.0

LGPL License Terms libopencm3 License

Author
© 2011 Fergus Noble fergu.nosp@m.snob.nosp@m.le@gm.nosp@m.ail..nosp@m.com
© 2012 Ken Sarkies ksark.nosp@m.ies@.nosp@m.inter.nosp@m.node.nosp@m..on.n.nosp@m.et

Macro Definition Documentation

◆ GPIO_AFR

#define GPIO_AFR (   n,
  af 
)    ((af) << ((n) * 4))

Definition at line 243 of file gpio_common_f234.h.

◆ GPIO_AFR_MASK

#define GPIO_AFR_MASK (   n)    (0xf << ((n) * 4))

Definition at line 244 of file gpio_common_f234.h.

◆ GPIO_AFRH

#define GPIO_AFRH (   port)    MMIO32((port) + 0x24)

Definition at line 161 of file gpio_common_f234.h.

◆ GPIO_AFRL

#define GPIO_AFRL (   port)    MMIO32((port) + 0x20)

Definition at line 150 of file gpio_common_f234.h.

◆ GPIO_BRR

#define GPIO_BRR (   port)    MMIO32((port) + 0x28)

Definition at line 42 of file g0/gpio.h.

◆ GPIO_BSRR

#define GPIO_BSRR (   port)    MMIO32((port) + 0x18)

Definition at line 128 of file gpio_common_f234.h.

◆ GPIO_IDR

#define GPIO_IDR (   port)    MMIO32((port) + 0x10)

Definition at line 106 of file gpio_common_f234.h.

◆ GPIO_LCKK [1/2]

#define GPIO_LCKK   (1 << 16)

Definition at line 45 of file gpio_common_all.h.

◆ GPIO_LCKK [2/2]

#define GPIO_LCKK   (1 << 16)

Definition at line 235 of file gpio_common_f234.h.

◆ GPIO_LCKR

#define GPIO_LCKR (   port)    MMIO32((port) + 0x1c)

Definition at line 139 of file gpio_common_f234.h.

◆ GPIO_MODE

#define GPIO_MODE (   n,
  mode 
)    ((mode) << (2 * (n)))

Definition at line 173 of file gpio_common_f234.h.

◆ GPIO_MODE_MASK

#define GPIO_MODE_MASK (   n)    (0x3 << (2 * (n)))

Definition at line 174 of file gpio_common_f234.h.

◆ GPIO_MODER

#define GPIO_MODER (   port)    MMIO32((port) + 0x00)

Definition at line 62 of file gpio_common_f234.h.

◆ GPIO_ODR

#define GPIO_ODR (   port)    MMIO32((port) + 0x14)

Definition at line 117 of file gpio_common_f234.h.

◆ GPIO_OSPEED

#define GPIO_OSPEED (   n,
  speed 
)    ((speed) << (2 * (n)))

Definition at line 197 of file gpio_common_f234.h.

◆ GPIO_OSPEED_MASK

#define GPIO_OSPEED_MASK (   n)    (0x3 << (2 * (n)))

Definition at line 198 of file gpio_common_f234.h.

◆ GPIO_OSPEEDR

#define GPIO_OSPEEDR (   port)    MMIO32((port) + 0x08)

Definition at line 84 of file gpio_common_f234.h.

◆ GPIO_OTYPER

#define GPIO_OTYPER (   port)    MMIO32((port) + 0x04)

Definition at line 73 of file gpio_common_f234.h.

◆ GPIO_PUPD

#define GPIO_PUPD (   n,
  pupd 
)    ((pupd) << (2 * (n)))

Definition at line 210 of file gpio_common_f234.h.

◆ GPIO_PUPD_MASK

#define GPIO_PUPD_MASK (   n)    (0x3 << (2 * (n)))

Definition at line 211 of file gpio_common_f234.h.

◆ GPIO_PUPDR

#define GPIO_PUPDR (   port)    MMIO32((port) + 0x0c)

Definition at line 95 of file gpio_common_f234.h.

◆ GPIOA_AFRH

#define GPIOA_AFRH   GPIO_AFRH(GPIOA)

Definition at line 162 of file gpio_common_f234.h.

◆ GPIOA_AFRL

#define GPIOA_AFRL   GPIO_AFRL(GPIOA)

Definition at line 151 of file gpio_common_f234.h.

◆ GPIOA_BRR

#define GPIOA_BRR   GPIO_BRR(GPIOA)

Definition at line 43 of file g0/gpio.h.

◆ GPIOA_BSRR

#define GPIOA_BSRR   GPIO_BSRR(GPIOA)

Definition at line 129 of file gpio_common_f234.h.

◆ GPIOA_IDR

#define GPIOA_IDR   GPIO_IDR(GPIOA)

Definition at line 107 of file gpio_common_f234.h.

◆ GPIOA_LCKR

#define GPIOA_LCKR   GPIO_LCKR(GPIOA)

Definition at line 140 of file gpio_common_f234.h.

◆ GPIOA_MODER

#define GPIOA_MODER   GPIO_MODER(GPIOA)

Definition at line 63 of file gpio_common_f234.h.

◆ GPIOA_ODR

#define GPIOA_ODR   GPIO_ODR(GPIOA)

Definition at line 118 of file gpio_common_f234.h.

◆ GPIOA_OSPEEDR

#define GPIOA_OSPEEDR   GPIO_OSPEEDR(GPIOA)

Definition at line 85 of file gpio_common_f234.h.

◆ GPIOA_OTYPER

#define GPIOA_OTYPER   GPIO_OTYPER(GPIOA)

Definition at line 74 of file gpio_common_f234.h.

◆ GPIOA_PUPDR

#define GPIOA_PUPDR   GPIO_PUPDR(GPIOA)

Definition at line 96 of file gpio_common_f234.h.

◆ GPIOB_AFRH

#define GPIOB_AFRH   GPIO_AFRH(GPIOB)

Definition at line 163 of file gpio_common_f234.h.

◆ GPIOB_AFRL

#define GPIOB_AFRL   GPIO_AFRL(GPIOB)

Definition at line 152 of file gpio_common_f234.h.

◆ GPIOB_BRR

#define GPIOB_BRR   GPIO_BRR(GPIOB)

Definition at line 44 of file g0/gpio.h.

◆ GPIOB_BSRR

#define GPIOB_BSRR   GPIO_BSRR(GPIOB)

Definition at line 130 of file gpio_common_f234.h.

◆ GPIOB_IDR

#define GPIOB_IDR   GPIO_IDR(GPIOB)

Definition at line 108 of file gpio_common_f234.h.

◆ GPIOB_LCKR

#define GPIOB_LCKR   GPIO_LCKR(GPIOB)

Definition at line 141 of file gpio_common_f234.h.

◆ GPIOB_MODER

#define GPIOB_MODER   GPIO_MODER(GPIOB)

Definition at line 64 of file gpio_common_f234.h.

◆ GPIOB_ODR

#define GPIOB_ODR   GPIO_ODR(GPIOB)

Definition at line 119 of file gpio_common_f234.h.

◆ GPIOB_OSPEEDR

#define GPIOB_OSPEEDR   GPIO_OSPEEDR(GPIOB)

Definition at line 86 of file gpio_common_f234.h.

◆ GPIOB_OTYPER

#define GPIOB_OTYPER   GPIO_OTYPER(GPIOB)

Definition at line 75 of file gpio_common_f234.h.

◆ GPIOB_PUPDR

#define GPIOB_PUPDR   GPIO_PUPDR(GPIOB)

Definition at line 97 of file gpio_common_f234.h.

◆ GPIOC_AFRH

#define GPIOC_AFRH   GPIO_AFRH(GPIOC)

Definition at line 164 of file gpio_common_f234.h.

◆ GPIOC_AFRL

#define GPIOC_AFRL   GPIO_AFRL(GPIOC)

Definition at line 153 of file gpio_common_f234.h.

◆ GPIOC_BRR

#define GPIOC_BRR   GPIO_BRR(GPIOC)

Definition at line 45 of file g0/gpio.h.

◆ GPIOC_BSRR

#define GPIOC_BSRR   GPIO_BSRR(GPIOC)

Definition at line 131 of file gpio_common_f234.h.

◆ GPIOC_IDR

#define GPIOC_IDR   GPIO_IDR(GPIOC)

Definition at line 109 of file gpio_common_f234.h.

◆ GPIOC_LCKR

#define GPIOC_LCKR   GPIO_LCKR(GPIOC)

Definition at line 142 of file gpio_common_f234.h.

◆ GPIOC_MODER

#define GPIOC_MODER   GPIO_MODER(GPIOC)

Definition at line 65 of file gpio_common_f234.h.

◆ GPIOC_ODR

#define GPIOC_ODR   GPIO_ODR(GPIOC)

Definition at line 120 of file gpio_common_f234.h.

◆ GPIOC_OSPEEDR

#define GPIOC_OSPEEDR   GPIO_OSPEEDR(GPIOC)

Definition at line 87 of file gpio_common_f234.h.

◆ GPIOC_OTYPER

#define GPIOC_OTYPER   GPIO_OTYPER(GPIOC)

Definition at line 76 of file gpio_common_f234.h.

◆ GPIOC_PUPDR

#define GPIOC_PUPDR   GPIO_PUPDR(GPIOC)

Definition at line 98 of file gpio_common_f234.h.

◆ GPIOD_AFRH

#define GPIOD_AFRH   GPIO_AFRH(GPIOD)

Definition at line 165 of file gpio_common_f234.h.

◆ GPIOD_AFRL

#define GPIOD_AFRL   GPIO_AFRL(GPIOD)

Definition at line 154 of file gpio_common_f234.h.

◆ GPIOD_BRR

#define GPIOD_BRR   GPIO_BRR(GPIOD)

Definition at line 46 of file g0/gpio.h.

◆ GPIOD_BSRR

#define GPIOD_BSRR   GPIO_BSRR(GPIOD)

Definition at line 132 of file gpio_common_f234.h.

◆ GPIOD_IDR

#define GPIOD_IDR   GPIO_IDR(GPIOD)

Definition at line 110 of file gpio_common_f234.h.

◆ GPIOD_LCKR

#define GPIOD_LCKR   GPIO_LCKR(GPIOD)

Definition at line 143 of file gpio_common_f234.h.

◆ GPIOD_MODER

#define GPIOD_MODER   GPIO_MODER(GPIOD)

Definition at line 66 of file gpio_common_f234.h.

◆ GPIOD_ODR

#define GPIOD_ODR   GPIO_ODR(GPIOD)

Definition at line 121 of file gpio_common_f234.h.

◆ GPIOD_OSPEEDR

#define GPIOD_OSPEEDR   GPIO_OSPEEDR(GPIOD)

Definition at line 88 of file gpio_common_f234.h.

◆ GPIOD_OTYPER

#define GPIOD_OTYPER   GPIO_OTYPER(GPIOD)

Definition at line 77 of file gpio_common_f234.h.

◆ GPIOD_PUPDR

#define GPIOD_PUPDR   GPIO_PUPDR(GPIOD)

Definition at line 99 of file gpio_common_f234.h.

◆ GPIOE_AFRH

#define GPIOE_AFRH   GPIO_AFRH(GPIOE)

Definition at line 166 of file gpio_common_f234.h.

◆ GPIOE_AFRL

#define GPIOE_AFRL   GPIO_AFRL(GPIOE)

Definition at line 155 of file gpio_common_f234.h.

◆ GPIOE_BRR

#define GPIOE_BRR   GPIO_BRR(GPIOE)

Definition at line 47 of file g0/gpio.h.

◆ GPIOE_BSRR

#define GPIOE_BSRR   GPIO_BSRR(GPIOE)

Definition at line 133 of file gpio_common_f234.h.

◆ GPIOE_IDR

#define GPIOE_IDR   GPIO_IDR(GPIOE)

Definition at line 111 of file gpio_common_f234.h.

◆ GPIOE_LCKR

#define GPIOE_LCKR   GPIO_LCKR(GPIOE)

Definition at line 144 of file gpio_common_f234.h.

◆ GPIOE_MODER

#define GPIOE_MODER   GPIO_MODER(GPIOE)

Definition at line 67 of file gpio_common_f234.h.

◆ GPIOE_ODR

#define GPIOE_ODR   GPIO_ODR(GPIOE)

Definition at line 122 of file gpio_common_f234.h.

◆ GPIOE_OSPEEDR

#define GPIOE_OSPEEDR   GPIO_OSPEEDR(GPIOE)

Definition at line 89 of file gpio_common_f234.h.

◆ GPIOE_OTYPER

#define GPIOE_OTYPER   GPIO_OTYPER(GPIOE)

Definition at line 78 of file gpio_common_f234.h.

◆ GPIOE_PUPDR

#define GPIOE_PUPDR   GPIO_PUPDR(GPIOE)

Definition at line 100 of file gpio_common_f234.h.

◆ GPIOF_AFRH

#define GPIOF_AFRH   GPIO_AFRH(GPIOF)

Definition at line 167 of file gpio_common_f234.h.

◆ GPIOF_AFRL

#define GPIOF_AFRL   GPIO_AFRL(GPIOF)

Definition at line 156 of file gpio_common_f234.h.

◆ GPIOF_BRR

#define GPIOF_BRR   GPIO_BRR(GPIOF)

Definition at line 48 of file g0/gpio.h.

◆ GPIOF_BSRR

#define GPIOF_BSRR   GPIO_BSRR(GPIOF)

Definition at line 134 of file gpio_common_f234.h.

◆ GPIOF_IDR

#define GPIOF_IDR   GPIO_IDR(GPIOF)

Definition at line 112 of file gpio_common_f234.h.

◆ GPIOF_LCKR

#define GPIOF_LCKR   GPIO_LCKR(GPIOF)

Definition at line 145 of file gpio_common_f234.h.

◆ GPIOF_MODER

#define GPIOF_MODER   GPIO_MODER(GPIOF)

Definition at line 68 of file gpio_common_f234.h.

◆ GPIOF_ODR

#define GPIOF_ODR   GPIO_ODR(GPIOF)

Definition at line 123 of file gpio_common_f234.h.

◆ GPIOF_OSPEEDR

#define GPIOF_OSPEEDR   GPIO_OSPEEDR(GPIOF)

Definition at line 90 of file gpio_common_f234.h.

◆ GPIOF_OTYPER

#define GPIOF_OTYPER   GPIO_OTYPER(GPIOF)

Definition at line 79 of file gpio_common_f234.h.

◆ GPIOF_PUPDR

#define GPIOF_PUPDR   GPIO_PUPDR(GPIOF)

Definition at line 101 of file gpio_common_f234.h.

◆ GPIOG_AFRH

#define GPIOG_AFRH   GPIO_AFRH(GPIOG)

Definition at line 168 of file gpio_common_f234.h.

◆ GPIOG_AFRL

#define GPIOG_AFRL   GPIO_AFRL(GPIOG)

Definition at line 157 of file gpio_common_f234.h.

◆ GPIOG_BSRR

#define GPIOG_BSRR   GPIO_BSRR(GPIOG)

Definition at line 135 of file gpio_common_f234.h.

◆ GPIOG_IDR

#define GPIOG_IDR   GPIO_IDR(GPIOG)

Definition at line 113 of file gpio_common_f234.h.

◆ GPIOG_LCKR

#define GPIOG_LCKR   GPIO_LCKR(GPIOG)

Definition at line 146 of file gpio_common_f234.h.

◆ GPIOG_MODER

#define GPIOG_MODER   GPIO_MODER(GPIOG)

Definition at line 69 of file gpio_common_f234.h.

◆ GPIOG_ODR

#define GPIOG_ODR   GPIO_ODR(GPIOG)

Definition at line 124 of file gpio_common_f234.h.

◆ GPIOG_OSPEEDR

#define GPIOG_OSPEEDR   GPIO_OSPEEDR(GPIOG)

Definition at line 91 of file gpio_common_f234.h.

◆ GPIOG_OTYPER

#define GPIOG_OTYPER   GPIO_OTYPER(GPIOG)

Definition at line 80 of file gpio_common_f234.h.

◆ GPIOG_PUPDR

#define GPIOG_PUPDR   GPIO_PUPDR(GPIOG)

Definition at line 102 of file gpio_common_f234.h.

◆ GPIOH_AFRH

#define GPIOH_AFRH   GPIO_AFRH(GPIOH)

Definition at line 169 of file gpio_common_f234.h.

◆ GPIOH_AFRL

#define GPIOH_AFRL   GPIO_AFRL(GPIOH)

Definition at line 158 of file gpio_common_f234.h.

◆ GPIOH_BSRR

#define GPIOH_BSRR   GPIO_BSRR(GPIOH)

Definition at line 136 of file gpio_common_f234.h.

◆ GPIOH_IDR

#define GPIOH_IDR   GPIO_IDR(GPIOH)

Definition at line 114 of file gpio_common_f234.h.

◆ GPIOH_LCKR

#define GPIOH_LCKR   GPIO_LCKR(GPIOH)

Definition at line 147 of file gpio_common_f234.h.

◆ GPIOH_MODER

#define GPIOH_MODER   GPIO_MODER(GPIOH)

Definition at line 70 of file gpio_common_f234.h.

◆ GPIOH_ODR

#define GPIOH_ODR   GPIO_ODR(GPIOH)

Definition at line 125 of file gpio_common_f234.h.

◆ GPIOH_OSPEEDR

#define GPIOH_OSPEEDR   GPIO_OSPEEDR(GPIOH)

Definition at line 92 of file gpio_common_f234.h.

◆ GPIOH_OTYPER

#define GPIOH_OTYPER   GPIO_OTYPER(GPIOH)

Definition at line 81 of file gpio_common_f234.h.

◆ GPIOH_PUPDR

#define GPIOH_PUPDR   GPIO_PUPDR(GPIOH)

Definition at line 103 of file gpio_common_f234.h.

◆ GPIOI_AFRH

#define GPIOI_AFRH   GPIO_AFRH(GPIOI)

Definition at line 101 of file gpio_common_f24.h.

◆ GPIOI_AFRL

#define GPIOI_AFRL   GPIO_AFRL(GPIOI)

Definition at line 96 of file gpio_common_f24.h.

◆ GPIOI_BSRR

#define GPIOI_BSRR   GPIO_BSRR(GPIOI)

Definition at line 86 of file gpio_common_f24.h.

◆ GPIOI_IDR

#define GPIOI_IDR   GPIO_IDR(GPIOI)

Definition at line 76 of file gpio_common_f24.h.

◆ GPIOI_LCKR

#define GPIOI_LCKR   GPIO_LCKR(GPIOI)

Definition at line 91 of file gpio_common_f24.h.

◆ GPIOI_MODER

#define GPIOI_MODER   GPIO_MODER(GPIOI)

Definition at line 56 of file gpio_common_f24.h.

◆ GPIOI_ODR

#define GPIOI_ODR   GPIO_ODR(GPIOI)

Definition at line 81 of file gpio_common_f24.h.

◆ GPIOI_OSPEEDR

#define GPIOI_OSPEEDR   GPIO_OSPEEDR(GPIOI)

Definition at line 66 of file gpio_common_f24.h.

◆ GPIOI_OTYPER

#define GPIOI_OTYPER   GPIO_OTYPER(GPIOI)

Definition at line 61 of file gpio_common_f24.h.

◆ GPIOI_PUPDR

#define GPIOI_PUPDR   GPIO_PUPDR(GPIOI)

Definition at line 71 of file gpio_common_f24.h.

◆ GPIOJ_AFRH

#define GPIOJ_AFRH   GPIO_AFRH(GPIOJ)

Definition at line 102 of file gpio_common_f24.h.

◆ GPIOJ_AFRL

#define GPIOJ_AFRL   GPIO_AFRL(GPIOJ)

Definition at line 97 of file gpio_common_f24.h.

◆ GPIOJ_BSRR

#define GPIOJ_BSRR   GPIO_BSRR(GPIOJ)

Definition at line 87 of file gpio_common_f24.h.

◆ GPIOJ_IDR

#define GPIOJ_IDR   GPIO_IDR(GPIOJ)

Definition at line 77 of file gpio_common_f24.h.

◆ GPIOJ_LCKR

#define GPIOJ_LCKR   GPIO_LCKR(GPIOJ)

Definition at line 92 of file gpio_common_f24.h.

◆ GPIOJ_MODER

#define GPIOJ_MODER   GPIO_MODER(GPIOJ)

Definition at line 57 of file gpio_common_f24.h.

◆ GPIOJ_ODR

#define GPIOJ_ODR   GPIO_ODR(GPIOJ)

Definition at line 82 of file gpio_common_f24.h.

◆ GPIOJ_OSPEEDR

#define GPIOJ_OSPEEDR   GPIO_OSPEEDR(GPIOJ)

Definition at line 67 of file gpio_common_f24.h.

◆ GPIOJ_OTYPER

#define GPIOJ_OTYPER   GPIO_OTYPER(GPIOJ)

Definition at line 62 of file gpio_common_f24.h.

◆ GPIOJ_PUPDR

#define GPIOJ_PUPDR   GPIO_PUPDR(GPIOJ)

Definition at line 72 of file gpio_common_f24.h.

◆ GPIOK_AFRH

#define GPIOK_AFRH   GPIO_AFRH(GPIOK)

Definition at line 103 of file gpio_common_f24.h.

◆ GPIOK_AFRL

#define GPIOK_AFRL   GPIO_AFRL(GPIOK)

Definition at line 98 of file gpio_common_f24.h.

◆ GPIOK_BSRR

#define GPIOK_BSRR   GPIO_BSRR(GPIOK)

Definition at line 88 of file gpio_common_f24.h.

◆ GPIOK_IDR

#define GPIOK_IDR   GPIO_IDR(GPIOK)

Definition at line 78 of file gpio_common_f24.h.

◆ GPIOK_LCKR

#define GPIOK_LCKR   GPIO_LCKR(GPIOK)

Definition at line 93 of file gpio_common_f24.h.

◆ GPIOK_MODER

#define GPIOK_MODER   GPIO_MODER(GPIOK)

Definition at line 58 of file gpio_common_f24.h.

◆ GPIOK_ODR

#define GPIOK_ODR   GPIO_ODR(GPIOK)

Definition at line 83 of file gpio_common_f24.h.

◆ GPIOK_OSPEEDR

#define GPIOK_OSPEEDR   GPIO_OSPEEDR(GPIOK)

Definition at line 68 of file gpio_common_f24.h.

◆ GPIOK_OTYPER

#define GPIOK_OTYPER   GPIO_OTYPER(GPIOK)

Definition at line 63 of file gpio_common_f24.h.

◆ GPIOK_PUPDR

#define GPIOK_PUPDR   GPIO_PUPDR(GPIOK)

Definition at line 73 of file gpio_common_f24.h.

Function Documentation

◆ gpio_clear()

void gpio_clear ( uint32_t  gpioport,
uint16_t  gpios 
)

Clear a Group of Pins Atomic.

Clear one or more pins of the given GPIO port to 0 in an atomic operation.

Parameters
[in]gpioportUnsigned int32. Port identifier GPIO Port IDs
[in]gpiosUnsigned int16. Pin identifiers GPIO Pin Identifiers If multiple pins are to be changed, use bitwise OR '|' to separate them.

Definition at line 56 of file gpio_common_all.c.

References GPIO_BSRR.

◆ gpio_get()

uint16_t gpio_get ( uint32_t  gpioport,
uint16_t  gpios 
)

Read a Group of Pins.

Parameters
[in]gpioportUnsigned int32. Port identifier GPIO Port IDs
[in]gpiosUnsigned int16. Pin identifiers GPIO Pin Identifiers If multiple pins are to be read, use bitwise OR '|' to separate them.
Returns
Unsigned int16 value of the pin values. The bit position of the pin value returned corresponds to the pin number.

Definition at line 71 of file gpio_common_all.c.

References gpio_port_read().

Here is the call graph for this function:

◆ gpio_mode_setup()

void gpio_mode_setup ( uint32_t  gpioport,
uint8_t  mode,
uint8_t  pull_up_down,
uint16_t  gpios 
)

Set GPIO Pin Mode.

Sets the Pin Direction and Analog/Digital Mode, and Output Pin Pullup, for a set of GPIO pins on a given GPIO port.

Parameters
[in]gpioportUnsigned int32. Port identifier GPIO Port IDs
[in]modeUnsigned int8. Pin mode GPIO Pin Direction and Analog/Digital Mode
[in]pull_up_downUnsigned int8. Pin pullup/pulldown configuration GPIO Output Pin Pullup
[in]gpiosUnsigned int16. Pin identifiers GPIO Pin Identifiers If multiple pins are to be set, use bitwise OR '|' to separate them.

Definition at line 89 of file gpio_common_f0234.c.

References GPIO_MODE, GPIO_MODER, GPIO_PUPD, and GPIO_PUPDR.

◆ gpio_port_config_lock()

void gpio_port_config_lock ( uint32_t  gpioport,
uint16_t  gpios 
)

Lock the Configuration of a Group of Pins.

The configuration of one or more pins of the given GPIO port is locked. There is no mechanism to unlock these via software. Unlocking occurs at the next reset.

Parameters
[in]gpioportUnsigned int32. Port identifier GPIO Port IDs
[in]gpiosUnsigned int16. Pin identifiers GPIO Pin Identifiers If multiple pins are to be locked, use bitwise OR '|' to separate them.

Definition at line 132 of file gpio_common_all.c.

References GPIO_LCKK, and GPIO_LCKR.

◆ gpio_port_read()

uint16_t gpio_port_read ( uint32_t  gpioport)

Read from a Port.

Read the current value of the given GPIO port. Only the lower 16 bits contain valid pin data.

Parameters
[in]gpioportUnsigned int32. Port identifier GPIO Port IDs
Returns
Unsigned int16. The value held in the specified GPIO port.

Definition at line 102 of file gpio_common_all.c.

References GPIO_IDR.

Referenced by gpio_get().

Here is the caller graph for this function:

◆ gpio_port_write()

void gpio_port_write ( uint32_t  gpioport,
uint16_t  data 
)

Write to a Port.

Write a value to the given GPIO port.

Parameters
[in]gpioportUnsigned int32. Port identifier GPIO Port IDs
[in]dataUnsigned int16. The value to be written to the GPIO port.

Definition at line 115 of file gpio_common_all.c.

References GPIO_ODR.

◆ gpio_set()

void gpio_set ( uint32_t  gpioport,
uint16_t  gpios 
)

Set a Group of Pins Atomic.

Set one or more pins of the given GPIO port to 1 in an atomic operation.

Parameters
[in]gpioportUnsigned int32. Port identifier GPIO Port IDs
[in]gpiosUnsigned int16. Pin identifiers GPIO Pin Identifiers If multiple pins are to be changed, use bitwise OR '|' to separate them.

Definition at line 41 of file gpio_common_all.c.

References GPIO_BSRR.

◆ gpio_set_af()

void gpio_set_af ( uint32_t  gpioport,
uint8_t  alt_func_num,
uint16_t  gpios 
)

Set GPIO Alternate Function Selection.

Set the alternate function mapping number for each pin. Most pins have alternate functions associated with them. When set to AF mode, a pin may be used for one of its allocated alternate functions selected by the number given here. To determine the number to be used for the desired function refer to the individual datasheet for the particular device. A table is given under the Pin Selection chapter.

Note that a number of pins may be set but only with a single AF number. In practice this would rarely be useful as each pin is likely to require a different number.

Parameters
[in]gpioportUnsigned int32. Port identifier GPIO Port IDs
[in]alt_func_numUnsigned int8. Pin alternate function number Alternate Function Pin Selection
[in]gpiosUnsigned int16. Pin identifiers GPIO Pin Identifiers If multiple pins are to be set, use bitwise OR '|' to separate them.

Definition at line 178 of file gpio_common_f0234.c.

References GPIO_AFR, GPIO_AFRH, and GPIO_AFRL.

◆ gpio_set_output_options()

void gpio_set_output_options ( uint32_t  gpioport,
uint8_t  otype,
uint8_t  speed,
uint16_t  gpios 
)

Set GPIO Output Options.

When the pin is set to output mode, this sets the configuration (analog/digital and open drain/push pull) and speed, for a set of GPIO pins on a given GPIO port.

Parameters
[in]gpioportUnsigned int32. Port identifier GPIO Port IDs
[in]otypeUnsigned int8. Pin output type GPIO Output Pin Driver Type
[in]speedUnsigned int8. Pin speed GPIO Output Pin Speed
[in]gpiosUnsigned int16. Pin identifiers GPIO Pin Identifiers If multiple pins are to be set, use bitwise OR '|' to separate them.

Definition at line 132 of file gpio_common_f0234.c.

References GPIO_OSPEED, GPIO_OSPEEDR, and GPIO_OTYPER.

◆ gpio_toggle()

void gpio_toggle ( uint32_t  gpioport,
uint16_t  gpios 
)

Toggle a Group of Pins.

Toggle one or more pins of the given GPIO port. The toggling is not atomic, but the non-toggled pins are not affected.

Parameters
[in]gpioportUnsigned int32. Port identifier GPIO Port IDs
[in]gpiosUnsigned int16. Pin identifiers GPIO Pin Identifiers If multiple pins are to be changed, use bitwise OR '|' to separate them.

Definition at line 87 of file gpio_common_all.c.

References GPIO_BSRR, and GPIO_ODR.