Interrupt Manager (Interrupt)

Detailed Description

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.

Overview

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.

Interrupt Names

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...
 
void INT_SYS_ClearPending (IRQn_Type irqNumber)
 Clear Pending Interrupt. More...
 
void INT_SYS_SetPending (IRQn_Type irqNumber)
 Set Pending Interrupt. More...
 
uint32_t INT_SYS_GetPending (IRQn_Type irqNumber)
 Get Pending Interrupt. More...
 

Typedef Documentation

typedef void(* isr_t) (void)

Interrupt handler type.

Definition at line 79 of file interrupt_manager.h.

Function Documentation

void DefaultISR ( void  )

Default ISR.

void INT_SYS_ClearPending ( IRQn_Type  irqNumber)

Clear Pending Interrupt.

The function clears the pending bit of a peripheral interrupt or a directed interrupt to this CPU (if available).

Parameters
irqNumberIRQ number
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.

Parameters
irqNumberIRQ number

Definition at line 180 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 231 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.

Parameters
irqNumberIRQ number

Definition at line 152 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 208 of file interrupt_manager.c.

uint32_t INT_SYS_GetPending ( IRQn_Type  irqNumber)

Get Pending Interrupt.

The function gets the pending bit of a peripheral interrupt or a directed interrupt to this CPU (if available).

Parameters
irqNumberIRQ number
Returns
pending Pending status 0/1
uint8_t INT_SYS_GetPriority ( IRQn_Type  irqNumber)

Get Interrupt Priority.

The function gets the priority of an interrupt.

Parameters
irqNumberInterrupt number.
Returns
priority Priority of the interrupt.

Definition at line 313 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.

Note
This method is applicable only if interrupt vector is copied in RAM.
Parameters
irqNumberIRQ number
newHandlerNew interrupt handler routine address pointer
oldHandlerPointer to a location to store current interrupt handler

Definition at line 98 of file interrupt_manager.c.

void INT_SYS_SetPending ( IRQn_Type  irqNumber)

Set Pending Interrupt.

The function configures the pending bit of a peripheral interrupt.

Parameters
irqNumberIRQ number
void INT_SYS_SetPriority ( IRQn_Type  irqNumber,
uint8_t  priority 
)

Set Interrupt Priority.

The function sets the priority of an interrupt.

Parameters
irqNumberInterrupt number.
priorityPriority to set.

Definition at line 249 of file interrupt_manager.c.