GPIO CPU definitions for the STM32 family. More...
GPIO CPU definitions for the STM32 family.
Definition in file cpu_gpio.h.
#include <stdint.h>#include "cpu.h"
Include dependency graph for cpu_gpio.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
| #define | GPIO_UNDEF (0xffffffff) |
| Definition of a fitting UNDEF value. | |
| #define | GPIO_PIN(x, y) ((GPIOA_BASE + (x << 10)) | y) |
| Define a CPU specific GPIO pin generator macro. | |
| #define | GPIO_MODE(io, pr, ot) ((io << 0) | (pr << 2) | (ot << 4)) |
| Generate GPIO mode bitfields. More... | |
| enum | |
| Available GPIO ports. | |
| enum | gpio_af_t { GPIO_AF_OUT_PP = 0xb , GPIO_AF_OUT_OD = 0xf , GPIO_AF0 = 0 , GPIO_AF1 , GPIO_AF2 , GPIO_AF3 , GPIO_AF4 , GPIO_AF5 , GPIO_AF6 , GPIO_AF7 , GPIO_AF8 , GPIO_AF9 , GPIO_AF10 , GPIO_AF11 , GPIO_AF12 , GPIO_AF13 , GPIO_AF14 , GPIO_AF15 , GPIO_AF_UNDEF } |
| Available MUX values for configuring a pin's alternate function. More... | |
| void | gpio_init_af (gpio_t pin, gpio_af_t af) |
| Configure the alternate function for the given pin. More... | |
| void | gpio_init_analog (gpio_t pin) |
| Configure the given pin to be used as ADC input. More... | |
| #define GPIO_MODE | ( | io, | |
| pr, | |||
| ot | |||
| ) | ((io << 0) | (pr << 2) | (ot << 4)) |
Generate GPIO mode bitfields.
We use 5 bit to encode the mode:
Definition at line 172 of file cpu_gpio.h.
| enum gpio_af_t |
Available MUX values for configuring a pin's alternate function.
Definition at line 93 of file cpu_gpio.h.
Configure the alternate function for the given pin.
| [in] | pin | pin to configure |
| [in] | af | alternate function to use |
| void gpio_init_analog | ( | gpio_t | pin | ) |
Configure the given pin to be used as ADC input.
| [in] | pin | pin to configure |