![]() |
S32 SDK
|
The S32 SDK Interrupt Manager provides a set of API/services to configure the Interrupt Controller (NVIC).
The Nested-Vectored Interrupt Controller (NVIC) module implements a relocatable vector table supporting many external interrupts, a single non-maskable interrupt (NMI), and priority levels. The NVIC contains the address of the function to execute for a particular handler. The address is fetched via the instruction port allowing parallel register stacking and look-up. The first sixteen entries are allocated to internal sources with the others mapping to MCU-defined interrupts.
The Interrupt Manager provides a set of APIs so that the application can enable or disable an interrupt for a specific device and also set priority, and other features. Additionally, it provides a way to update the vector table for a specific device interrupt handler.
Each chip has its own set of supported interrupt names defined in the chip-specific header file (see IRQn_Type).
This is an example to enable/disable an interrupt for the ADC0_IRQn:
Typedefs | |
typedef void(* | isr_t) (void) |
Interrupt handler type. More... | |
Functions | |
void | DefaultISR (void) |
Default ISR. More... | |
Interrupt manager APIs | |
void | INT_SYS_InstallHandler (IRQn_Type irqNumber, const isr_t newHandler, isr_t *const oldHandler) |
Installs an interrupt handler routine for a given IRQ number. More... | |
void | INT_SYS_EnableIRQ (IRQn_Type irqNumber) |
Enables an interrupt for a given IRQ number. More... | |
void | INT_SYS_DisableIRQ (IRQn_Type irqNumber) |
Disables an interrupt for a given IRQ number. More... | |
void | INT_SYS_EnableIRQGlobal (void) |
Enables system interrupt. More... | |
void | INT_SYS_DisableIRQGlobal (void) |
Disable system interrupt. More... | |
void | INT_SYS_SetPriority (IRQn_Type irqNumber, uint8_t priority) |
Set Interrupt Priority. More... | |
uint8_t | INT_SYS_GetPriority (IRQn_Type irqNumber) |
Get Interrupt Priority. More... | |
typedef void(* isr_t) (void) |
Interrupt handler type.
Definition at line 66 of file interrupt_manager.h.
void DefaultISR | ( | void | ) |
Default ISR.
void INT_SYS_DisableIRQ | ( | IRQn_Type | irqNumber | ) |
Disables an interrupt for a given IRQ number.
This function disables the individual interrupt for a specified IRQ number.
irqNumber | IRQ number |
Definition at line 168 of file interrupt_manager.c.
void INT_SYS_DisableIRQGlobal | ( | void | ) |
Disable system interrupt.
This function disables the global interrupt by calling the core API.
Definition at line 218 of file interrupt_manager.c.
void INT_SYS_EnableIRQ | ( | IRQn_Type | irqNumber | ) |
Enables an interrupt for a given IRQ number.
This function enables the individual interrupt for a specified IRQ number.
irqNumber | IRQ number |
Definition at line 141 of file interrupt_manager.c.
void INT_SYS_EnableIRQGlobal | ( | void | ) |
Enables system interrupt.
This function enables the global interrupt by calling the core API.
Definition at line 195 of file interrupt_manager.c.
uint8_t INT_SYS_GetPriority | ( | IRQn_Type | irqNumber | ) |
Get Interrupt Priority.
The function gets the priority of an interrupt.
irqNumber | Interrupt number. |
Definition at line 269 of file interrupt_manager.c.
void INT_SYS_InstallHandler | ( | IRQn_Type | irqNumber, |
const isr_t | newHandler, | ||
isr_t *const | oldHandler | ||
) |
Installs an interrupt handler routine for a given IRQ number.
This function lets the application register/replace the interrupt handler for a specified IRQ number. See a chip-specific reference manual for details and the startup_<SoC>.s file for each chip family to find out the default interrupt handler for each device.
irqNumber | IRQ number |
newHandler | New interrupt handler routine address pointer |
oldHandler | Pointer to a location to store current interrupt handler |
Definition at line 98 of file interrupt_manager.c.
void INT_SYS_SetPriority | ( | IRQn_Type | irqNumber, |
uint8_t | priority | ||
) |
Set Interrupt Priority.
The function sets the priority of an interrupt.
irqNumber | Interrupt number. |
priority | Priority to set. |
Definition at line 236 of file interrupt_manager.c.