|
STM32 RTOS 0.2.3
Bare-metal preemptive RTOS for STM32F446RE
|
GPIO driver: pin configuration and digital I/O. More...
Go to the source code of this file.
Data Structures | |
| struct | GpioResetValues_t |
| Power-on values of the GPIO registers that are not zero on every port. More... | |
Macros | |
| #define | GPIO_AF_MAX (15U) |
| Highest alternate-function number (AF0-AF15). | |
Typedefs | |
| typedef enum GpioPin_e | GpioPin_e |
| Pin number within a port. | |
| typedef enum GpioPinState_e | GpioPinState_e |
| Logic level of a pin. | |
| typedef struct GpioResetValues_t | GpioResetValues_t |
| Power-on values of the GPIO registers that are not zero on every port. | |
Enumerations | |
| enum | GpioPin_e { GPIO_PIN_0 = 0 , GPIO_PIN_1 = 1 , GPIO_PIN_2 = 2 , GPIO_PIN_3 = 3 , GPIO_PIN_4 = 4 , GPIO_PIN_5 = 5 , GPIO_PIN_6 = 6 , GPIO_PIN_7 = 7 , GPIO_PIN_8 = 8 , GPIO_PIN_9 = 9 , GPIO_PIN_10 = 10 , GPIO_PIN_11 = 11 , GPIO_PIN_12 = 12 , GPIO_PIN_13 = 13 , GPIO_PIN_14 = 14 , GPIO_PIN_15 = 15 } |
| Pin number within a port. More... | |
| enum | GpioPinState_e { GPIO_PIN_RESET = 0 , GPIO_PIN_SET = 1 } |
| Logic level of a pin. More... | |
Functions | |
| GpioResetValues_t | gpioPortResetValues (const GpioRegisters_t *port) |
| Look up a port's power-on MODER, OSPEEDR and PUPDR values. | |
| DRIVER_MUST_CHECK DriverStatus_e | gpioInit (GpioRegisters_t *port, GpioPin_e pin, uint32_t mode, uint32_t otype, uint32_t ospeed, uint32_t pupd) |
| Configure a pin's mode, output type, speed and pull. | |
| void | gpioDeinit (GpioRegisters_t *port, GpioPin_e pin) |
| Return a pin to its power-on configuration. | |
| void | gpioDeinitToReset (GpioRegisters_t *port, GpioPin_e pin, GpioResetValues_t reset) |
| gpioDeinit() with the reset values supplied by the caller. | |
| DRIVER_MUST_CHECK DriverStatus_e | gpioSetAlternateFunction (GpioRegisters_t *port, GpioPin_e pin, uint32_t af) |
| Select a pin's alternate function in AFRL/AFRH. | |
| void | gpioWritePin (GpioRegisters_t *port, GpioPin_e pin, GpioPinState_e level) |
| Drive a pin high or low with one atomic BSRR write. | |
| GpioPinState_e | gpioReadPin (const GpioRegisters_t *port, GpioPin_e pin) |
| Read a pin's input level from IDR. | |
| void | gpioTogglePin (GpioRegisters_t *port, GpioPin_e pin) |
| Invert a pin's output level. | |
GPIO driver: pin configuration and digital I/O.
Typical use, an output on PA5 (the NUCLEO's LD2):
For an alternate function, call gpioSetAlternateFunction() before gpioInit() so the function is selected before MODER switches the pin.
Definition in file gpio.h.