AM263x MCU+ SDK  08.05.00
sdl_interrupt.h File Reference

Introduction

This file contains the API prototypes for configuring interrupt support for the ARM Cortex-R5 and VIM.

The following is the recommended calling sequence for this API:

  1. Call Intc_Init() to initialize the interrupt support
  2. For each interrupt you wish to enable... a. Call Intc_IntSetSrcType() to set interrupt type (level or pulse) b. Call Intc_IntPrioritySet() to set the interrupt priority (0-15) and mapping (IRQ or FIQ) c. Call Intc_IntRegister() to register the interrupt d. Call Intc_IntEnable() to enable the interrupt
  3. Call Intc_SystemEnable() to enable the R5 IRQ and FIQ interrupts

When an interrupt occurs, control goes to the ISR given as a parameter in the Intc_IntRegister() call for that specific interrupt. The pending interrupt is automatically cleared and acknowledged in the VIM.

Other calls available: o Call Intc_IntUnregister() to unregister a previously registered interrupt o Call Intc_IntDisable() to disable a previously enabled interrupt o Call Intc_SystemDisable() to disable the R5 IRQ and FIQ interrupts

Go to the source code of this file.

Data Structures

struct  SDL_R5ExptnHandlers
 Structure containing the Exception Handlers. If application does not want register an exception handler then below handlers can be assigned to 'NULL' value. In such case, default handler will be used which have the infinite loop. More...
 

Macros

#define EXCEPTION_R5_RESET   (0U)
 List of Exceptions in R5. These exceptions are interrupts from 0 to 6 in Vector table. More...
 
#define EXCEPTION_R5_UNDEF_INSTR   (1U)
 Exception for Undefined Instruction. More...
 
#define EXCEPTION_R5_SW_INTR   (2U)
 Exception for Software interrupt. More...
 
#define EXCEPTION_R5_ABORT_PREFETCH   (3U)
 Exception for Abort (prefetch) More...
 
#define EXCEPTION_R5_ABORT_DATA   (4U)
 Exception for Abort (data) More...
 
#define EXCEPTION_R5_IRQ   (5U)
 Exception for IRQ. More...
 
#define EXCEPTION_R5_FIQ   (6U)
 Exception for FIQ. More...
 

Typedefs

typedef void(* IntrFuncPtr) (void *ptr)
 
typedef void(* exptnHandlerPtr) (void *ptr)
 

Functions

 __attribute__ ((interrupt("UNDEF"), section(".text.hwi"), aligned(32))) void undefInstructionExptnHandler(void)
 
 __attribute__ ((interrupt("SWI"), section(".text.hwi"), aligned(32))) void swIntrExptnHandler(void)
 
 __attribute__ ((interrupt("ABORT"), section(".text.hwi"), aligned(32))) void prefetchAbortExptnHandler(void)
 
 __attribute__ ((interrupt("IRQ"), section(".text.hwi"), aligned(32))) void irqExptnHandler(void)
 
 __attribute__ ((interrupt("FIQ"), section(".text.hwi"), aligned(32))) void fiqExptnHandler(void)
 
void Intc_SystemEnable (void)
 This function enables the Cortex-R5's IRQ and FIQ interrupts. More...
 
uintptr_t Intc_SystemDisable (void)
 This function disables the Cortex-R5's IRQ and FIQ interrupts. More...
 
void Intc_SystemRestore (uintptr_t cookie)
 This function enables the Cortex-R5's IRQ and FIQ interrupts This can be called after Intc_SystemDisable() to restore system IRQ/FIQ. More...
 
void Intc_InitExptnHandlers (SDL_R5ExptnHandlers *handlers)
 This function initializes exception handlers for various exceptions. More...
 
void Intc_RegisterExptnHandlers (const SDL_R5ExptnHandlers *handlers)
 This function registers handlers for various exceptions. More...
 

Macro Definition Documentation

◆ EXCEPTION_R5_RESET

#define EXCEPTION_R5_RESET   (0U)

List of Exceptions in R5. These exceptions are interrupts from 0 to 6 in Vector table.

Exception for RESET

◆ EXCEPTION_R5_UNDEF_INSTR

#define EXCEPTION_R5_UNDEF_INSTR   (1U)

Exception for Undefined Instruction.

◆ EXCEPTION_R5_SW_INTR

#define EXCEPTION_R5_SW_INTR   (2U)

Exception for Software interrupt.

◆ EXCEPTION_R5_ABORT_PREFETCH

#define EXCEPTION_R5_ABORT_PREFETCH   (3U)

Exception for Abort (prefetch)

◆ EXCEPTION_R5_ABORT_DATA

#define EXCEPTION_R5_ABORT_DATA   (4U)

Exception for Abort (data)

◆ EXCEPTION_R5_IRQ

#define EXCEPTION_R5_IRQ   (5U)

Exception for IRQ.

◆ EXCEPTION_R5_FIQ

#define EXCEPTION_R5_FIQ   (6U)

Exception for FIQ.

Typedef Documentation

◆ IntrFuncPtr

typedef void(* IntrFuncPtr) (void *ptr)

◆ exptnHandlerPtr

typedef void(* exptnHandlerPtr) (void *ptr)

Function Documentation

◆ __attribute__() [1/5]

__attribute__ ( (interrupt("UNDEF"), section(".text.hwi"), aligned(32))  )

◆ __attribute__() [2/5]

__attribute__ ( (interrupt("SWI"), section(".text.hwi"), aligned(32))  )

◆ __attribute__() [3/5]

__attribute__ ( (interrupt("ABORT"), section(".text.hwi"), aligned(32))  )

◆ __attribute__() [4/5]

__attribute__ ( (interrupt("IRQ"), section(".text.hwi"), aligned(32))  )

◆ __attribute__() [5/5]

__attribute__ ( (interrupt("FIQ"), section(".text.hwi"), aligned(32))  )

◆ Intc_SystemEnable()

void Intc_SystemEnable ( void  )

This function enables the Cortex-R5's IRQ and FIQ interrupts.

◆ Intc_SystemDisable()

uintptr_t Intc_SystemDisable ( void  )

This function disables the Cortex-R5's IRQ and FIQ interrupts.

Returns
cookie IRQ and FIQ enable status(CPSR register value)

◆ Intc_SystemRestore()

void Intc_SystemRestore ( uintptr_t  cookie)

This function enables the Cortex-R5's IRQ and FIQ interrupts This can be called after Intc_SystemDisable() to restore system IRQ/FIQ.

Parameters
cookieMask to enable IRQ and FIQ

◆ Intc_InitExptnHandlers()

void Intc_InitExptnHandlers ( SDL_R5ExptnHandlers handlers)

This function initializes exception handlers for various exceptions.

Parameters
handlersReference Exception handlers list. Refer struct SDL_R5ExptnHandlers

◆ Intc_RegisterExptnHandlers()

void Intc_RegisterExptnHandlers ( const SDL_R5ExptnHandlers handlers)

This function registers handlers for various exceptions.

Parameters
handlersException handlers list. Refer struct SDL_R5ExptnHandlers