CC35xxDriverLibrary
[interrupt.h] Interrupt
Collaboration diagram for [interrupt.h] Interrupt:

Macros

#define INT_PRIORITY_MASK   0x000000F0
 
#define INT_PRI_LEVEL0   0x00000000
 
#define INT_PRI_LEVEL1   0x00000010
 
#define INT_PRI_LEVEL2   0x00000020
 
#define INT_PRI_LEVEL3   0x00000030
 
#define INT_PRI_LEVEL4   0x00000040
 
#define INT_PRI_LEVEL5   0x00000050
 
#define INT_PRI_LEVEL6   0x00000060
 
#define INT_PRI_LEVEL7   0x00000070
 
#define INT_PRI_LEVEL8   0x00000080
 
#define INT_PRI_LEVEL9   0x00000090
 
#define INT_PRI_LEVEL10   0x000000A0
 
#define INT_PRI_LEVEL11   0x000000B0
 
#define INT_PRI_LEVEL12   0x000000C0
 
#define INT_PRI_LEVEL13   0x000000D0
 
#define INT_PRI_LEVEL14   0x000000E0
 
#define INT_PRI_LEVEL15   0x000000F0
 

Functions

void IntRegister (uint32_t intNum, void(*handler)(void))
 Registers a function as an interrupt handler in the dynamic vector table. More...
 
void IntUnregister (uint32_t intNum)
 Unregisters an interrupt handler in the dynamic vector table. More...
 
void IntSetPriority (uint32_t intNum, uint8_t priority)
 Sets the priority of an interrupt. More...
 
int32_t IntGetPriority (uint32_t intNum)
 Gets the priority of an interrupt. More...
 
void IntEnable (uint32_t intNum)
 Enables an interrupt or system exception. More...
 
void IntDisable (uint32_t intNum)
 Disables an interrupt or system exception. More...
 
void IntSetPend (uint32_t intNum)
 Pends an interrupt. More...
 
bool IntGetPend (uint32_t intNum)
 Checks if an interrupt is pending. More...
 
void IntClearPend (uint32_t intNum)
 Unpends an interrupt. More...
 
__STATIC_INLINE bool IntEnableMaster (void)
 Enables the CPU interrupt. More...
 
__STATIC_INLINE bool IntDisableMaster (void)
 Disables the CPU interrupts with configurable priority. More...
 

Detailed Description

Macro Definition Documentation

§ INT_PRIORITY_MASK

#define INT_PRIORITY_MASK   0x000000F0

Referenced by IntGetPriority(), and IntSetPriority().

§ INT_PRI_LEVEL0

#define INT_PRI_LEVEL0   0x00000000

§ INT_PRI_LEVEL1

#define INT_PRI_LEVEL1   0x00000010

§ INT_PRI_LEVEL2

#define INT_PRI_LEVEL2   0x00000020

§ INT_PRI_LEVEL3

#define INT_PRI_LEVEL3   0x00000030

§ INT_PRI_LEVEL4

#define INT_PRI_LEVEL4   0x00000040

§ INT_PRI_LEVEL5

#define INT_PRI_LEVEL5   0x00000050

§ INT_PRI_LEVEL6

#define INT_PRI_LEVEL6   0x00000060

§ INT_PRI_LEVEL7

#define INT_PRI_LEVEL7   0x00000070

§ INT_PRI_LEVEL8

#define INT_PRI_LEVEL8   0x00000080

§ INT_PRI_LEVEL9

#define INT_PRI_LEVEL9   0x00000090

§ INT_PRI_LEVEL10

#define INT_PRI_LEVEL10   0x000000A0

§ INT_PRI_LEVEL11

#define INT_PRI_LEVEL11   0x000000B0

§ INT_PRI_LEVEL12

#define INT_PRI_LEVEL12   0x000000C0

§ INT_PRI_LEVEL13

#define INT_PRI_LEVEL13   0x000000D0

§ INT_PRI_LEVEL14

#define INT_PRI_LEVEL14   0x000000E0

§ INT_PRI_LEVEL15

#define INT_PRI_LEVEL15   0x000000F0

Referenced by IntSetPriority().

Function Documentation

§ IntRegister()

void IntRegister ( uint32_t  intNum,
void(*)(void)  handler 
)

Registers a function as an interrupt handler in the dynamic vector table.

Note
Only use this function if you want to use the dynamic vector table (in SRAM)!

This function writes a function pointer to the dynamic interrupt vector table in SRAM to register the function as an interrupt handler (ISR). When the corresponding interrupt occurs, and it has been enabled (see IntEnable()), the function pointer is fetched from the dynamic vector table, and the System CPU will execute the interrupt handler.

Note
The first call to this function (directly or indirectly via a peripheral driver interrupt register function) copies the interrupt vector table from Flash to SRAM. NVIC uses the static vector table (in Flash) until this function is called.
Parameters
intNumspecifies the index in the vector table to modify.
handleris a pointer to the function to register as interrupt handler.
Returns
None.
See also
IntUnregister(), IntEnable()

Registers a function as an interrupt handler in the dynamic vector table.

Interrupt vector table is placed at ".ramVecs" defined in the linker file provided by Texas Instruments.

Note
See interrupt.c for compiler specific implementation!

References ASSERT, HWREG, NUM_INTERRUPTS, and SCB.

Referenced by SPIRegisterInt(), and SysTickRegisterInt().

§ IntUnregister()

void IntUnregister ( uint32_t  intNum)

Unregisters an interrupt handler in the dynamic vector table.

This function removes an interrupt handler from the dynamic vector table and replaces it with the default interrupt handler IntDefaultHandler().

Note
Remember to disable the interrupt before removing its interrupt handler from the vector table.
Parameters
intNumspecifies the index in the vector table to modify.
Returns
None.
See also
IntRegister(), IntDisable()

References ASSERT, IntDefaultHandler(), and NUM_INTERRUPTS.

Referenced by SPIUnregisterInt(), and SysTickUnregisterInt().

§ IntSetPriority()

void IntSetPriority ( uint32_t  intNum,
uint8_t  priority 
)

Sets the priority of an interrupt.

This function sets the priority of an interrupt, including system exceptions. When multiple interrupts are asserted simultaneously, the ones with the highest priority are processed before the lower priority interrupts. Smaller numbers correspond to higher interrupt priorities thus priority 0 is the highest interrupt priority.

Warning
This function does not support setting priority of interrupt vectors one through three which are:
  • 1: Reset handler
  • 2: NMI handler
  • 3: Hard fault handler
Parameters
intNumspecifies the index in the vector table to change priority for.
priorityspecifies the priority of the interrupt.
Returns
None

References ASSERT, INT_PRI_LEVEL15, INT_PRIORITY_MASK, NUM_INTERRUPTS, NVIC, and SCB.

§ IntGetPriority()

int32_t IntGetPriority ( uint32_t  intNum)

Gets the priority of an interrupt.

This function gets the priority of an interrupt.

Warning
This function does not support getting priority of interrupt vectors one through three which are:
  • 1: Reset handler
  • 2: NMI handler
  • 3: Hard fault handler
Parameters
intNumspecifies the index in the vector table to read priority of.
Returns
Returns the interrupt priority:

References ASSERT, INT_PRIORITY_MASK, NUM_INTERRUPTS, NVIC, and SCB.

§ IntEnable()

void IntEnable ( uint32_t  intNum)

Enables an interrupt or system exception.

This function enables the specified interrupt in the interrupt controller.

Note
If a fault condition occurs while the corresponding system exception is disabled, the fault is treated as a Hard Fault.
Parameters
intNumspecifies the index in the vector table to enable.
Returns
None
See also
IntDisable()

References ASSERT, INT_SYSTICK, NUM_INTERRUPTS, NVIC, SysTick, and SysTick_CTRL_TICKINT_Msk.

Referenced by SPIRegisterInt().

§ IntDisable()

void IntDisable ( uint32_t  intNum)

Disables an interrupt or system exception.

This function disables the specified interrupt in the interrupt controller.

Parameters
intNumspecifies the index in the vector table to disable.
Returns
None
See also
IntEnable()

References ASSERT, INT_SYSTICK, NUM_INTERRUPTS, NVIC, SysTick, and SysTick_CTRL_TICKINT_Msk.

Referenced by SPIUnregisterInt().

§ IntSetPend()

void IntSetPend ( uint32_t  intNum)

Pends an interrupt.

This function pends the specified interrupt in the interrupt controller. This causes the interrupt controller to execute the corresponding interrupt handler at the next available time, based on the current interrupt state priorities.

This interrupt controller automatically clears the pending interrupt once the interrupt handler is executed.

Parameters
intNumspecifies the index in the vector table to pend.
Returns
None
See also
IntEnable()

References ASSERT, INT_NMI_FAULT, INT_PENDSV, INT_SYSTICK, NUM_INTERRUPTS, NVIC, SCB, SCB_ICSR_NMIPENDSET_Msk, SCB_ICSR_PENDSTSET_Msk, and SCB_ICSR_PENDSVSET_Msk.

§ IntGetPend()

bool IntGetPend ( uint32_t  intNum)

Checks if an interrupt is pending.

This function checks the interrupt controller to see if an interrupt is pending.

The interrupt must be enabled in order for the corresponding interrupt handler to be executed, so an interrupt can be pending waiting to be enabled or waiting for an interrupt of higher priority to be done executing.

Note
This function does not support reading pending status for system exceptions (vector table indexes <16).
Parameters
intNumspecifies the index in the vector table to check pending status for.
  • See IntSetPend() for list of valid arguments (except system exceptions).
Returns
Returns:
  • true : Specified interrupt is pending.
  • false : Specified interrupt is not pending.

References ASSERT, NUM_INTERRUPTS, and NVIC.

§ IntClearPend()

void IntClearPend ( uint32_t  intNum)

Unpends an interrupt.

This function unpends the specified interrupt in the interrupt controller. This causes any previously generated interrupts that have not been handled yet (due to higher priority interrupts or the interrupt no having been enabled yet) to be discarded.

Note
It is not possible to unpend the NMI because it takes effect immediately when being pended.
Parameters
intNumspecifies the index in the vector table to unpend.
  • See IntSetPend() for list of valid arguments (except NMI).
Returns
None

References ASSERT, INT_PENDSV, INT_SYSTICK, NUM_INTERRUPTS, NVIC, SCB, SCB_ICSR_PENDSTCLR_Msk, and SCB_ICSR_PENDSVCLR_Msk.

§ IntEnableMaster()

__STATIC_INLINE bool IntEnableMaster ( void  )

Enables the CPU interrupt.

Allows the CPU to respond to interrupts.

Returns
Returns:
  • true : Interrupts were disabled and are now enabled.
  • false : Interrupts were already enabled when the function was called.

References __enable_irq(), and __get_PRIMASK().

§ IntDisableMaster()

__STATIC_INLINE bool IntDisableMaster ( void  )

Disables the CPU interrupts with configurable priority.

Prevents the CPU from receiving interrupts except NMI and hard fault. This does not affect the set of interrupts enabled in the interrupt controller; it just gates the interrupt from the interrupt controller to the CPU.

Returns
Returns:
  • true : Interrupts were already disabled when the function was called.
  • false : Interrupts were enabled and are now disabled.

References __disable_irq(), and __get_PRIMASK().