G4 EXTI public API.
More...
#include <stddef.h>
#include <stdint.h>
#include "stm32g474xx.h"
Go to the source code of this file.
◆ PHAL_EXTI_Trigger_t
GPIO edge or edges that generate an EXTI interrupt.
| Enumerator |
|---|
| PHAL_EXTI_TRIGGER_RISING | |
| PHAL_EXTI_TRIGGER_FALLING | |
| PHAL_EXTI_TRIGGER_BOTH | |
◆ PHAL_EXTI_callback()
| void PHAL_EXTI_callback |
( |
GPIO_TypeDef * | bank, |
|
|
uint8_t | pin ) |
|
extern |
Weak callback invoked for each pending GPIO EXTI line.
Called from an EXTI interrupt handler. Keep overrides short and non-blocking. For both-edge triggers, sample the GPIO input to determine its current level. The default implementation does nothing.
- Parameters
-
| bank | GPIO port that generated the interrupt |
| pin | Pin number, 0-15 |
◆ PHAL_EXTI_deinit()
| bool PHAL_EXTI_deinit |
( |
GPIO_TypeDef * | bank, |
|
|
uint8_t | pin ) |
Disable a configured GPIO EXTI line.
The line is disabled only when its current SYSCFG route matches bank/pin. A shared NVIC interrupt is disabled when no GPIO EXTI lines in its group remain enabled.
- Parameters
-
| bank | GPIO port containing the input pin |
| pin | Pin number, 0-15 |
- Returns
- true if the route matched and the line was disabled; false otherwise
◆ PHAL_EXTI_init()
Configure GPIO EXTI lines from a configuration table.
Configure the corresponding GPIO pins as inputs separately with PHAL_GPIO_init(). Only pins 0-15 can be used, and each pin number can be routed from one GPIO port at a time. Configuring a line selects its port, trigger edge, interrupt mask, and shared NVIC interrupt. Entries are all validated before any line is changed; duplicate pin numbers are rejected. The IRQ priority is set from each entry's irq_priority. Lines 0-4 each have a separate IRQ; lines 5-9 share EXTI9_5_IRQn and lines 10-15 share EXTI15_10_IRQn. Entries sharing a vector must specify the same priority, including any already-enabled sibling lines. Priorities must fit the device's implemented NVIC priority bits.
- Parameters
-
| config | Array of line configurations; may be nullptr when config_len is zero |
| config_len | Number of entries in config |
- Returns
- true if every configuration is valid and applied; false otherwise