50 #define GPIO_PORT_NUMBERING_ALPHABETIC 1
55 #if _GPIO_PORT_A_PIN_COUNT
56 # define GPIO_PORT_0 0
59 #if _GPIO_PORT_B_PIN_COUNT
60 # define GPIO_PORT_1 1
63 #if _GPIO_PORT_C_PIN_COUNT
64 # define GPIO_PORT_2 2
67 #if _GPIO_PORT_D_PIN_COUNT
68 # define GPIO_PORT_3 3
71 #if _GPIO_PORT_E_PIN_COUNT
72 # define GPIO_PORT_4 4
75 #if _GPIO_PORT_F_PIN_COUNT
76 # define GPIO_PORT_6 6
79 #if _GPIO_PORT_G_PIN_COUNT
80 # define GPIO_PORT_7 7
83 #if _GPIO_PORT_H_PIN_COUNT
84 # define GPIO_PORT_8 8
87 #if _GPIO_PORT_I_PIN_COUNT
88 # define GPIO_PORT_9 9
91 #if _GPIO_PORT_J_PIN_COUNT
92 # define GPIO_PORT_10 10
95 #if _GPIO_PORT_K_PIN_COUNT
96 # define GPIO_PORT_11 11
143 return GPIO_PortInGet(port);
148 return GPIO_PortOutGet(port);
153 GPIO_PortOutSet(port, mask);
158 GPIO_PortOutClear(port, mask);
163 GPIO_PortOutToggle(port, mask);
168 GPIO->P[port].DOUT = value;
188 return GPIO_PORT_VALID(num);
#define GPIO
GPIO register bank.
static uint8_t gpio_get_pin_num(gpio_t pin)
Extract the pin number from a gpio_t
static void * gpio_port_unpack_addr(gpio_port_t port)
Extract a data pointer that was packed by gpio_port_pack_addr.
static void gpio_ll_set(gpio_port_t port, uword_t mask)
Perform an reg |= mask operation on the I/O register of the port.
gpio_port_t gpio_port(uword_t num)
Get the gpio_port_t value of the port number num.
static gpio_port_t gpio_port_pack_addr(void *addr)
Pack a pointer into a gpio_port_t.
static uword_t gpio_ll_read(gpio_port_t port)
Get the current input value of all GPIO pins of the given port as bitmask.
static gpio_port_t gpio_get_port(gpio_t pin)
Extract the gpio_port_t from a gpio_t
uword_t gpio_port_num(gpio_port_t port)
Get the number of the GPIO port port refers to.
static bool is_gpio_port_num_valid(uint_fast8_t num)
Check if the given number is a valid argument for gpio_port.
static uword_t gpio_ll_read_output(gpio_port_t port)
Get the current output value of all GPIO pins of the given port as bitmask.
static void gpio_ll_clear(gpio_port_t port, uword_t mask)
Perform an reg &= ~mask operation on the I/O register of the port.
static void gpio_ll_toggle(gpio_port_t port, uword_t mask)
Perform an reg ^= mask operation on the I/O register of the port.
static void gpio_ll_write(gpio_port_t port, uword_t state)
Perform a masked write operation on the I/O register of the port.
uintptr_t gpio_port_t
GPIO port type.
uint< NUM > _t uword_t
Word sized unsigned integer.
Shared CPU specific definitions for the STM32 family.