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

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

Collaboration diagram for GPIO Defines:

Modules

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

Macros

#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 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 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 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 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 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 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 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 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 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 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 GPIO_LCKK   (1 << 16)
 

Functions

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...
 
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...
 

Detailed Description

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

Version
1.0.0
Date
1 July 2012

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 220 of file l1/gpio.h.

◆ GPIO_AFR_MASK

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

Definition at line 221 of file l1/gpio.h.

◆ GPIO_AFRH

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

Definition at line 141 of file l1/gpio.h.

◆ GPIO_AFRL

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

Definition at line 132 of file l1/gpio.h.

◆ GPIO_BSRR

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

Definition at line 114 of file l1/gpio.h.

◆ GPIO_IDR

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

Definition at line 96 of file l1/gpio.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 212 of file l1/gpio.h.

◆ GPIO_LCKR

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

Definition at line 123 of file l1/gpio.h.

◆ GPIO_MODE

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

Definition at line 151 of file l1/gpio.h.

◆ GPIO_MODE_MASK

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

Definition at line 152 of file l1/gpio.h.

◆ GPIO_MODER

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

Definition at line 60 of file l1/gpio.h.

◆ GPIO_ODR

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

Definition at line 105 of file l1/gpio.h.

◆ GPIO_OSPEED

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

Definition at line 174 of file l1/gpio.h.

◆ GPIO_OSPEED_MASK

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

Definition at line 175 of file l1/gpio.h.

◆ GPIO_OSPEEDR

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

Definition at line 78 of file l1/gpio.h.

◆ GPIO_OTYPER

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

Definition at line 69 of file l1/gpio.h.

◆ GPIO_PUPD

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

Definition at line 187 of file l1/gpio.h.

◆ GPIO_PUPD_MASK

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

Definition at line 188 of file l1/gpio.h.

◆ GPIO_PUPDR

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

Definition at line 87 of file l1/gpio.h.

◆ GPIOA_AFRH

#define GPIOA_AFRH   GPIO_AFRH(GPIOA)

Definition at line 142 of file l1/gpio.h.

◆ GPIOA_AFRL

#define GPIOA_AFRL   GPIO_AFRL(GPIOA)

Definition at line 133 of file l1/gpio.h.

◆ GPIOA_BSRR

#define GPIOA_BSRR   GPIO_BSRR(GPIOA)

Definition at line 115 of file l1/gpio.h.

◆ GPIOA_IDR

#define GPIOA_IDR   GPIO_IDR(GPIOA)

Definition at line 97 of file l1/gpio.h.

◆ GPIOA_LCKR

#define GPIOA_LCKR   GPIO_LCKR(GPIOA)

Definition at line 124 of file l1/gpio.h.

◆ GPIOA_MODER

#define GPIOA_MODER   GPIO_MODER(GPIOA)

Definition at line 61 of file l1/gpio.h.

◆ GPIOA_ODR

#define GPIOA_ODR   GPIO_ODR(GPIOA)

Definition at line 106 of file l1/gpio.h.

◆ GPIOA_OSPEEDR

#define GPIOA_OSPEEDR   GPIO_OSPEEDR(GPIOA)

Definition at line 79 of file l1/gpio.h.

◆ GPIOA_OTYPER

#define GPIOA_OTYPER   GPIO_OTYPER(GPIOA)

Definition at line 70 of file l1/gpio.h.

◆ GPIOA_PUPDR

#define GPIOA_PUPDR   GPIO_PUPDR(GPIOA)

Definition at line 88 of file l1/gpio.h.

◆ GPIOB_AFRH

#define GPIOB_AFRH   GPIO_AFRH(GPIOB)

Definition at line 143 of file l1/gpio.h.

◆ GPIOB_AFRL

#define GPIOB_AFRL   GPIO_AFRL(GPIOB)

Definition at line 134 of file l1/gpio.h.

◆ GPIOB_BSRR

#define GPIOB_BSRR   GPIO_BSRR(GPIOB)

Definition at line 116 of file l1/gpio.h.

◆ GPIOB_IDR

#define GPIOB_IDR   GPIO_IDR(GPIOB)

Definition at line 98 of file l1/gpio.h.

◆ GPIOB_LCKR

#define GPIOB_LCKR   GPIO_LCKR(GPIOB)

Definition at line 125 of file l1/gpio.h.

◆ GPIOB_MODER

#define GPIOB_MODER   GPIO_MODER(GPIOB)

Definition at line 62 of file l1/gpio.h.

◆ GPIOB_ODR

#define GPIOB_ODR   GPIO_ODR(GPIOB)

Definition at line 107 of file l1/gpio.h.

◆ GPIOB_OSPEEDR

#define GPIOB_OSPEEDR   GPIO_OSPEEDR(GPIOB)

Definition at line 80 of file l1/gpio.h.

◆ GPIOB_OTYPER

#define GPIOB_OTYPER   GPIO_OTYPER(GPIOB)

Definition at line 71 of file l1/gpio.h.

◆ GPIOB_PUPDR

#define GPIOB_PUPDR   GPIO_PUPDR(GPIOB)

Definition at line 89 of file l1/gpio.h.

◆ GPIOC_AFRH

#define GPIOC_AFRH   GPIO_AFRH(GPIOC)

Definition at line 144 of file l1/gpio.h.

◆ GPIOC_AFRL

#define GPIOC_AFRL   GPIO_AFRL(GPIOC)

Definition at line 135 of file l1/gpio.h.

◆ GPIOC_BSRR

#define GPIOC_BSRR   GPIO_BSRR(GPIOC)

Definition at line 117 of file l1/gpio.h.

◆ GPIOC_IDR

#define GPIOC_IDR   GPIO_IDR(GPIOC)

Definition at line 99 of file l1/gpio.h.

◆ GPIOC_LCKR

#define GPIOC_LCKR   GPIO_LCKR(GPIOC)

Definition at line 126 of file l1/gpio.h.

◆ GPIOC_MODER

#define GPIOC_MODER   GPIO_MODER(GPIOC)

Definition at line 63 of file l1/gpio.h.

◆ GPIOC_ODR

#define GPIOC_ODR   GPIO_ODR(GPIOC)

Definition at line 108 of file l1/gpio.h.

◆ GPIOC_OSPEEDR

#define GPIOC_OSPEEDR   GPIO_OSPEEDR(GPIOC)

Definition at line 81 of file l1/gpio.h.

◆ GPIOC_OTYPER

#define GPIOC_OTYPER   GPIO_OTYPER(GPIOC)

Definition at line 72 of file l1/gpio.h.

◆ GPIOC_PUPDR

#define GPIOC_PUPDR   GPIO_PUPDR(GPIOC)

Definition at line 90 of file l1/gpio.h.

◆ GPIOD_AFRH

#define GPIOD_AFRH   GPIO_AFRH(GPIOD)

Definition at line 145 of file l1/gpio.h.

◆ GPIOD_AFRL

#define GPIOD_AFRL   GPIO_AFRL(GPIOD)

Definition at line 136 of file l1/gpio.h.

◆ GPIOD_BSRR

#define GPIOD_BSRR   GPIO_BSRR(GPIOD)

Definition at line 118 of file l1/gpio.h.

◆ GPIOD_IDR

#define GPIOD_IDR   GPIO_IDR(GPIOD)

Definition at line 100 of file l1/gpio.h.

◆ GPIOD_LCKR

#define GPIOD_LCKR   GPIO_LCKR(GPIOD)

Definition at line 127 of file l1/gpio.h.

◆ GPIOD_MODER

#define GPIOD_MODER   GPIO_MODER(GPIOD)

Definition at line 64 of file l1/gpio.h.

◆ GPIOD_ODR

#define GPIOD_ODR   GPIO_ODR(GPIOD)

Definition at line 109 of file l1/gpio.h.

◆ GPIOD_OSPEEDR

#define GPIOD_OSPEEDR   GPIO_OSPEEDR(GPIOD)

Definition at line 82 of file l1/gpio.h.

◆ GPIOD_OTYPER

#define GPIOD_OTYPER   GPIO_OTYPER(GPIOD)

Definition at line 73 of file l1/gpio.h.

◆ GPIOD_PUPDR

#define GPIOD_PUPDR   GPIO_PUPDR(GPIOD)

Definition at line 91 of file l1/gpio.h.

◆ GPIOE_AFRH

#define GPIOE_AFRH   GPIO_AFRH(GPIOE)

Definition at line 146 of file l1/gpio.h.

◆ GPIOE_AFRL

#define GPIOE_AFRL   GPIO_AFRL(GPIOE)

Definition at line 137 of file l1/gpio.h.

◆ GPIOE_BSRR

#define GPIOE_BSRR   GPIO_BSRR(GPIOE)

Definition at line 119 of file l1/gpio.h.

◆ GPIOE_IDR

#define GPIOE_IDR   GPIO_IDR(GPIOE)

Definition at line 101 of file l1/gpio.h.

◆ GPIOE_LCKR

#define GPIOE_LCKR   GPIO_LCKR(GPIOE)

Definition at line 128 of file l1/gpio.h.

◆ GPIOE_MODER

#define GPIOE_MODER   GPIO_MODER(GPIOE)

Definition at line 65 of file l1/gpio.h.

◆ GPIOE_ODR

#define GPIOE_ODR   GPIO_ODR(GPIOE)

Definition at line 110 of file l1/gpio.h.

◆ GPIOE_OSPEEDR

#define GPIOE_OSPEEDR   GPIO_OSPEEDR(GPIOE)

Definition at line 83 of file l1/gpio.h.

◆ GPIOE_OTYPER

#define GPIOE_OTYPER   GPIO_OTYPER(GPIOE)

Definition at line 74 of file l1/gpio.h.

◆ GPIOE_PUPDR

#define GPIOE_PUPDR   GPIO_PUPDR(GPIOE)

Definition at line 92 of file l1/gpio.h.

◆ GPIOH_AFRH

#define GPIOH_AFRH   GPIO_AFRH(GPIOH)

Definition at line 147 of file l1/gpio.h.

◆ GPIOH_AFRL

#define GPIOH_AFRL   GPIO_AFRL(GPIOH)

Definition at line 138 of file l1/gpio.h.

◆ GPIOH_BSRR

#define GPIOH_BSRR   GPIO_BSRR(GPIOH)

Definition at line 120 of file l1/gpio.h.

◆ GPIOH_IDR

#define GPIOH_IDR   GPIO_IDR(GPIOH)

Definition at line 102 of file l1/gpio.h.

◆ GPIOH_LCKR

#define GPIOH_LCKR   GPIO_LCKR(GPIOH)

Definition at line 129 of file l1/gpio.h.

◆ GPIOH_MODER

#define GPIOH_MODER   GPIO_MODER(GPIOH)

Definition at line 66 of file l1/gpio.h.

◆ GPIOH_ODR

#define GPIOH_ODR   GPIO_ODR(GPIOH)

Definition at line 111 of file l1/gpio.h.

◆ GPIOH_OSPEEDR

#define GPIOH_OSPEEDR   GPIO_OSPEEDR(GPIOH)

Definition at line 84 of file l1/gpio.h.

◆ GPIOH_OTYPER

#define GPIOH_OTYPER   GPIO_OTYPER(GPIOH)

Definition at line 75 of file l1/gpio.h.

◆ GPIOH_PUPDR

#define GPIOH_PUPDR   GPIO_PUPDR(GPIOH)

Definition at line 93 of file l1/gpio.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.