|
GPS Device
|
Public functions to interact with the GPIO peripheral. More...

Functions | |
| void | gpio_init (GPIO_CFG_ts *gpio_cfg) |
| Initializes a GPIO pin according to the given configuration. | |
| void | gpio_deinit (GPIO_REGDEF_ts const *gpio_port) |
| Deinitializes a GPIO port by resetting its registers to reset values. | |
| void | gpio_write (GPIO_REGDEF_ts *gpio_port, uint8_t gpio_pin, PIN_STATUS_te pin_status) |
| Drives a GPIO output pin high or low. | |
| PIN_STATUS_te | gpio_read (GPIO_REGDEF_ts const *gpio_port, uint8_t gpio_pin) |
| Reads the current logic level of a GPIO input pin. | |
| void | gpio_clear_interrupt (EXTI_LINES_te exti_line) |
| Clears the EXTI pending flag for the given interrupt line. | |
| void | gpio_get_name (GPIO_REGDEF_ts const *gpio_port, char *name) |
| Returns the name string of a GPIO port (e.g. "GPIOA"). | |
Public functions to interact with the GPIO peripheral.
| void gpio_init | ( | GPIO_CFG_ts * | gpio_cfg | ) |
Initializes a GPIO pin according to the given configuration.
Enables the peripheral clock for the port, then configures output type, speed, pull mode, alternate function, and pin mode. For interrupt mode, also configures SYSCFG EXTICR, EXTI IMR, RTSR/FTSR, and enables the corresponding NVIC interrupt line.
| [in] | gpio_cfg | Pointer to the GPIO configuration structure. |
Definition at line 29 of file stm32f401re_gpio.c.


| void gpio_deinit | ( | GPIO_REGDEF_ts const * | gpio_port | ) |
Deinitializes a GPIO port by resetting its registers to reset values.
Triggers an RCC peripheral reset for the given port and then disables its peripheral clock.
| [in] | gpio_port | Pointer to the GPIO port instance to deinitialize. |
Definition at line 103 of file stm32f401re_gpio.c.

| void gpio_write | ( | GPIO_REGDEF_ts * | gpio_port, |
| uint8_t | gpio_pin, | ||
| PIN_STATUS_te | pin_status ) |
Drives a GPIO output pin high or low.
| [in] | gpio_port | Pointer to the GPIO port instance. |
| [in] | gpio_pin | Pin number to write (0–15). |
| [in] | pin_status | HIGH to drive the pin high, LOW to drive it low. |
Definition at line 127 of file stm32f401re_gpio.c.

| PIN_STATUS_te gpio_read | ( | GPIO_REGDEF_ts const * | gpio_port, |
| uint8_t | gpio_pin ) |
Reads the current logic level of a GPIO input pin.
| [in] | gpio_port | Pointer to the GPIO port instance. |
| [in] | gpio_pin | Pin number to read (0–15). |
Definition at line 139 of file stm32f401re_gpio.c.

| void gpio_clear_interrupt | ( | EXTI_LINES_te | exti_line | ) |
Clears the EXTI pending flag for the given interrupt line.
Must be called at the end of an EXTI interrupt handler to acknowledge the interrupt and prevent immediate re-entry. Writes 1 to the EXTI_PR bit for exti_line (write-1-to-clear).
| [in] | exti_line | The EXTI line number corresponding to the GPIO pin. |
Definition at line 145 of file stm32f401re_gpio.c.
| void gpio_get_name | ( | GPIO_REGDEF_ts const * | gpio_port, |
| char * | name ) |
Returns the name string of a GPIO port (e.g. "GPIOA").
Writes a null-terminated string of the form "GPIOx" into name. The caller must ensure name points to a buffer of at least GPIO_NAME_LEN + 1 bytes.
| [in] | gpio_port | Pointer to the GPIO port instance. |
| [out] | name | Pointer to the destination buffer. |
Returns the name string of a GPIO port (e.g. "GPIOA").
Definition at line 150 of file stm32f401re_gpio.c.
