NVIC register definitions, IRQ numbers, and HAL interrupt control API for STM32F4. More...


Go to the source code of this file.
Functions | |
| int8_t | hal_enable_interrupt (IRQn_Type interrupt) |
| Enable a specific interrupt. | |
| int8_t | hal_disable_interrupt (IRQn_Type interrupt) |
| Disable a specific interrupt. | |
| void | hal_clear_interrupt_flag (IRQn_Type interrupt) |
| Clear the pending flag of a specific interrupt. | |
| void | hal_interrupt_attach_callback (IRQn_Type interrupt, void(*callback)(void)) |
| Attach a callback function to a specific interrupt. | |
| void | hal_interrupt_detach_callback (IRQn_Type interrupt) |
| Detach a callback function from a specific interrupt. | |
| void | hal_handle_interrupt (IRQn_Type interrupt) |
| Central interrupt handler function. | |
| void | hal_set_interrupt_priority (IRQn_Type interrupt, uint8_t priority) |
| Set priority for a specific interrupt. | |
| uint8_t | hal_get_interrupt_priority (IRQn_Type interrupt) |
| Get priority for a specific interrupt. | |
| int | hal_is_interrupt_pending (IRQn_Type interrupt) |
| Check if a specific interrupt is pending. | |
| void | hal_enable_global_interrupts (uint32_t state) |
| Enable global interrupts. | |
| uint32_t | hal_disable_global_interrupts (void) |
| Disable global interrupts. | |
| void | hal_clear_all_pending_interrupts (void) |
| Clear all pending interrupts. | |
NVIC register definitions, IRQ numbers, and HAL interrupt control API for STM32F4.
This header provides:
The definitions are tailored for the STM32F4 series but are based on the ARM Cortex-M4 NVIC architecture. All register mappings match the reference manual.
| void hal_clear_all_pending_interrupts | ( | void | ) |
Clear all pending interrupts.
| void hal_clear_interrupt_flag | ( | IRQn_Type | interrupt | ) |
Clear the pending flag of a specific interrupt.
| interrupt | IRQ number. |
| uint32_t hal_disable_global_interrupts | ( | void | ) |
Disable global interrupts.
| int8_t hal_disable_interrupt | ( | IRQn_Type | interrupt | ) |
Disable a specific interrupt.
| interrupt | IRQ number. |
| [in] | interrupt | Interrupt number to disable |
| SUCCESS | Interrupt disabled successfully |
| FAILURE | Invalid interrupt number (Cortex-M internal interrupt) |
Disables the specified interrupt in the NVIC by setting the corresponding bit in the ICER (Interrupt Clear Enable Register).
< Indicates failed operation.
< Indicates successful operation.
| void hal_enable_global_interrupts | ( | uint32_t | state | ) |
Enable global interrupts.
| state | Optional state flag. |
| int8_t hal_enable_interrupt | ( | IRQn_Type | interrupt | ) |
Enable a specific interrupt.
| interrupt | IRQ number. |
| [in] | interrupt | Interrupt number to enable |
| SUCCESS | Interrupt enabled successfully |
| FAILURE | Invalid interrupt number (Cortex-M internal interrupt) |
Enables the specified interrupt in the NVIC by setting the corresponding bit in the ISER (Interrupt Set Enable Register).
< Indicates failed operation.
< Indicates successful operation.
| uint8_t hal_get_interrupt_priority | ( | IRQn_Type | interrupt | ) |
Get priority for a specific interrupt.
| interrupt | IRQ number. |
| void hal_handle_interrupt | ( | IRQn_Type | interrupt | ) |
Central interrupt handler function.
| interrupt | IRQ number that occurred. |
Central interrupt handler function.
| [in] | interrupt | Interrupt number to handle |
This function should be called from the actual interrupt service routine (ISR) to invoke the user-registered callback function. It performs bounds checking and NULL pointer verification before invoking the callback.
| void hal_interrupt_attach_callback | ( | IRQn_Type | interrupt, |
| void(* | callback )(void) ) |
Attach a callback function to a specific interrupt.
| interrupt | IRQ number. |
| callback | Function pointer to be called when interrupt occurs. |
Attach a callback function to a specific interrupt.
| [in] | interrupt | Interrupt number to attach to |
| [in] | callback | Function pointer to be called when interrupt occurs |
Registers a callback function for the specified interrupt. The callback will be invoked when the interrupt occurs and is handled by hal_handle_interrupt().
| void hal_interrupt_detach_callback | ( | IRQn_Type | interrupt | ) |
Detach a callback function from a specific interrupt.
| interrupt | IRQ number. |
Detach a callback function from a specific interrupt.
| [in] | interrupt | Interrupt number to detach from |
Removes any previously registered callback for the specified interrupt.
| int hal_is_interrupt_pending | ( | IRQn_Type | interrupt | ) |
Check if a specific interrupt is pending.
| interrupt | IRQ number. |
| void hal_set_interrupt_priority | ( | IRQn_Type | interrupt, |
| uint8_t | priority ) |
Set priority for a specific interrupt.
| interrupt | IRQ number. |
| priority | Priority value. |