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

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

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.
  • System exceptions:
    • INT_NMI_FAULT
    • INT_HARD_FAULT
    • INT_SVCALL
    • INT_PENDSV
    • INT_SYSTICK
  • Interrupts:
    • INT_CPUIRQ0
    • INT_CPUIRQ1
    • INT_CPUIRQ2
    • INT_CPUIRQ3
    • INT_CPUIRQ4
    • INT_GPIO_COMB
    • INT_LRFD_IRQ0
    • INT_LRFD_IRQ1
    • INT_DMA_DONE_COMB
    • INT_AES_COMB
    • INT_SPI0_COMB
    • INT_UART0_COMB
    • INT_I2C0_IRQ
    • INT_LGPT0_COMB
    • INT_LGPT1_COMB
    • INT_ADC_COMB
    • INT_CPUIRQ16
    • INT_LGPT2_COMB
    • INT_LGPT3_COMB
handleris a pointer to the function to register as interrupt handler.
Returns
None.
See also
IntUnregister(), IntEnable()

Referenced by SPIRegisterInt(), SysTickRegisterInt(), and uDMARegisterInt().

§ 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(), SysTickUnregisterInt(), and uDMAUnregisterInt().

§ 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
On Cortex M0+, changing interrupt priorities dynamically is not supported. In order to change the priority of an interrupt, after it has been enabled, the following steps must be followed:
  • Disable the interrupt whose priority needs to be changed
  • Change the priority
  • Re-enable the interrupt This is taken care of by the IntSetPriority function.
It is possible to lose an interrupt while its priority is being changed, since that interrupt needs to be disabled to be able change its priority.
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.
  • System exceptions:
    • INT_SVCALL
    • INT_PENDSV
    • INT_SYSTICK
  • Interrupts:
    • INT_CPUIRQ0
    • INT_CPUIRQ1
    • INT_CPUIRQ2
    • INT_CPUIRQ3
    • INT_CPUIRQ4
    • INT_GPIO_COMB
    • INT_LRFD_IRQ0
    • INT_LRFD_IRQ1
    • INT_DMA_DONE_COMB
    • INT_AES_COMB
    • INT_SPI0_COMB
    • INT_UART0_COMB
    • INT_I2C0_IRQ
    • INT_LGPT0_COMB
    • INT_LGPT1_COMB
    • INT_ADC_COMB
    • INT_CPUIRQ16
    • INT_LGPT2_COMB
    • INT_LGPT3_COMB
priorityspecifies the priority of the interrupt.
Returns
None

References ASSERT, INT_PRI_LEVEL3, INT_PRIORITY_MASK, IntDisable(), IntEnable(), 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 IntSetPriority(), SPIRegisterInt(), and uDMARegisterInt().

§ 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 IntSetPriority(), SPIUnregisterInt(), and uDMAUnregisterInt().

§ 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().

Referenced by TempDiodeGetTemp().

§ 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().

Referenced by TempDiodeGetTemp().