CC26xx Driver Library
[interrupt] Interrupt

Functions

static bool IntMasterEnable (void)
 Enables the processor interrupt. More...
 
static bool IntMasterDisable (void)
 Disables the processor interrupt. More...
 
void IntRegister (uint32_t ui32Interrupt, void(*pfnHandler)(void))
 Registers a function to be called when an interrupt occurs. More...
 
void IntUnregister (uint32_t ui32Interrupt)
 Unregisters the function to be called when an interrupt occurs. More...
 
void IntPriorityGroupingSet (uint32_t ui32Bits)
 Sets the priority grouping of the interrupt controller. More...
 
uint32_t IntPriorityGroupingGet (void)
 Gets the priority grouping of the interrupt controller. More...
 
void IntPrioritySet (uint32_t ui32Interrupt, uint8_t ui8Priority)
 Sets the priority of an interrupt. More...
 
int32_t IntPriorityGet (uint32_t ui32Interrupt)
 Gets the priority of an interrupt. More...
 
void IntEnable (uint32_t ui32Interrupt)
 Enables an interrupt. More...
 
void IntDisable (uint32_t ui32Interrupt)
 Disables an interrupt. More...
 
void IntPendSet (uint32_t ui32Interrupt)
 Pends an interrupt. More...
 
bool IntPendGet (uint32_t ui32Interrupt)
 Query whether an interrupt is pending. More...
 
void IntPendClear (uint32_t ui32Interrupt)
 Unpends an interrupt. More...
 
static void IntPriorityMaskSet (uint32_t ui32PriorityMask)
 Sets the priority masking level. More...
 
static uint32_t IntPriorityMaskGet (void)
 Gets the priority masking level. More...
 

Detailed Description

Function Documentation

void IntDisable ( uint32_t  ui32Interrupt)

Disables an interrupt.

The specified interrupt is disabled in the interrupt controller. Other enables for the interrupt (such as at the peripheral level) are unaffected by this function.

Parameters
ui32Interruptspecifies the interrupt to be disabled.
Returns
None

Definition at line 381 of file interrupt.c.

Referenced by CRYPTOAesEcbStatus(), CRYPTOAesLoadKey(), CRYPTOCcmAuthEncrypt(), CRYPTOCcmAuthEncryptStatus(), CRYPTOCcmInvAuthDecrypt(), CRYPTOCcmInvAuthDecryptStatus(), CRYPTOIntUnregister(), FlashIntUnregister(), FlashsafeIntUnregister(), I2CIntUnregister(), I2SIntUnregister(), IOCIntUnregister(), SSIIntUnregister(), TimerIntUnregister(), TRNGIntUnregister(), UARTIntUnregister(), uDMAIntUnregister(), and WatchdogIntUnregister().

void IntEnable ( uint32_t  ui32Interrupt)

Enables an interrupt.

The specified interrupt is enabled in the interrupt controller. Other enables for the interrupt (such as at the peripheral level) are unaffected by this function.

Parameters
ui32Interruptspecifies the interrupt to be enabled.
Returns
None

Definition at line 321 of file interrupt.c.

Referenced by CRYPTOAesEcb(), CRYPTOCcmAuthEncrypt(), CRYPTOCcmInvAuthDecrypt(), CRYPTOIntRegister(), FlashIntRegister(), FlashsafeIntRegister(), I2CIntRegister(), I2SIntRegister(), IOCIntRegister(), SSIIntRegister(), TimerIntRegister(), TRNGIntRegister(), UARTIntRegister(), uDMAIntRegister(), and WatchdogIntRegister().

static bool IntMasterDisable ( void  )
inlinestatic

Disables the processor interrupt.

Prevents the processor from receiving interrupts. This does not affect the set of interrupts enabled in the interrupt controller; it just gates the single interrupt from the controller to the processor.

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

Definition at line 159 of file interrupt.h.

Here is the call graph for this function:

static bool IntMasterEnable ( void  )
inlinestatic

Enables the processor interrupt.

Allows the processor to respond to interrupts. This does not affect the set of interrupts enabled in the interrupt controller; it just gates the single interrupt from the controller to the processor.

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

Definition at line 137 of file interrupt.h.

Here is the call graph for this function:

void IntPendClear ( uint32_t  ui32Interrupt)

Unpends an interrupt.

The specified interrupt is unpended in the interrupt controller. This will cause 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.

Parameters
ui32Interruptspecifies the interrupt to be unpended.
Returns
None

Definition at line 537 of file interrupt.c.

Referenced by CRYPTOAesEcb(), CRYPTOCcmAuthEncrypt(), and CRYPTOCcmInvAuthDecrypt().

bool IntPendGet ( uint32_t  ui32Interrupt)

Query whether an interrupt is pending.

This function will check whether the specified interrupt is pending in the interrupt controller. The interrupt must have been enabled for it to be called, so an interrupt can very well be pending waiting to be enabled or waiting for an interrupt of higher priority to be done executing.

Note
This function does not support the lower 16 IRQ vectors which are hardware defined for the System CPU.
Parameters
ui32Interruptspecifies the interrupt to be queried.
Returns
Returns:
  • true : Specified interrupt is pending.
  • false : Specified interrupt is not pending.

Definition at line 494 of file interrupt.c.

void IntPendSet ( uint32_t  ui32Interrupt)

Pends an interrupt.

The specified interrupt is pended in the interrupt controller. This will cause the interrupt controller to execute the corresponding interrupt handler at the next available time, based on the current interrupt state priorities. For example, if called by a higher priority interrupt handler, the specified interrupt handler will not be called until after the current interrupt handler has completed execution. The interrupt must have been enabled for it to be called.

Parameters
ui32Interruptspecifies the interrupt to be pended.
Returns
None

Definition at line 441 of file interrupt.c.

int32_t IntPriorityGet ( uint32_t  ui32Interrupt)

Gets the priority of an interrupt.

This function gets the priority of an interrupt.

Parameters
ui32Interruptspecifies the interrupt in question.
Returns
Returns the interrupt priority:

Definition at line 301 of file interrupt.c.

uint32_t IntPriorityGroupingGet ( void  )

Gets the priority grouping of the interrupt controller.

This function returns the split between preemptable priority levels and subpriority levels in the interrupt priority specification.

Returns
Returns the number of bits of preemptable priority.

Definition at line 241 of file interrupt.c.

void IntPriorityGroupingSet ( uint32_t  ui32Bits)

Sets the priority grouping of the interrupt controller.

This function specifies the split between preemptable priority levels and subpriority levels in the interrupt priority specification. The range of the grouping values are dependent upon the hardware implementation; on the CC26xx family, three bits are available for hardware interrupt prioritization and therefore priority grouping values of three through seven have the same effect.

Parameters
ui32Bitsspecifies the number of bits of preemptable priority.
Returns
None

Definition at line 222 of file interrupt.c.

static uint32_t IntPriorityMaskGet ( void  )
inlinestatic

Gets the priority masking level.

This function gets the current setting of the interrupt priority masking level. The value returned is the priority level such that all interrupts of that and lesser priority are masked. A value of 0 means that priority masking is disabled.

Smaller numbers correspond to higher interrupt priorities. So for example a priority level mask of 4 will allow interrupts of priority level 0-3, and interrupts with a numerical priority of 4 and greater will be blocked.

The hardware priority mechanism will only look at the upper N bits of the priority level (where N is 3 for the CC26xx family), so any prioritization must be performed in those bits.

Returns
Returns the value of the interrupt priority level mask.

Definition at line 434 of file interrupt.h.

Here is the call graph for this function:

static void IntPriorityMaskSet ( uint32_t  ui32PriorityMask)
inlinestatic

Sets the priority masking level.

This function sets the interrupt priority masking level so that all interrupts at the specified or lesser priority level are masked. This can be used to globally disable a set of interrupts with priority below a predetermined threshold. A value of 0 disables priority masking.

Smaller numbers correspond to higher interrupt priorities. So for example a priority level mask of 4 will allow interrupts of priority level 0-3, and interrupts with a numerical priority of 4 and greater will be blocked.

The hardware priority mechanism will only look at the upper N bits of the priority level (where N is 3 for the CC26xx family), so any prioritization must be performed in those bits.

Parameters
ui32PriorityMaskis the priority level that will be masked.
Returns
None.

Definition at line 408 of file interrupt.h.

Here is the call graph for this function:

void IntPrioritySet ( uint32_t  ui32Interrupt,
uint8_t  ui8Priority 
)

Sets the priority of an interrupt.

This function is used to set the priority of an interrupt. 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; priority 0 is the highest interrupt priority.

The hardware priority mechanism will only look at the upper N bits of the priority level (where N is 3 for cc26xx), so any prioritization must be performed in those bits. The remaining bits can be used to sub-prioritize the interrupt sources, and may be used by the hardware priority mechanism on a future part. This arrangement allows priorities to migrate to different NVIC implementations without changing the gross prioritization of the interrupts.

Parameters
ui32Interruptspecifies the interrupt in question.
ui8Priorityspecifies the priority of the interrupt.
Returns
None

Definition at line 276 of file interrupt.c.

void IntRegister ( uint32_t  ui32Interrupt,
void(*)(void)  pfnHandler 
)

Registers a function to be called when an interrupt occurs.

This function is used to specify the handler function to be called when the given interrupt is asserted to the processor. When the interrupt occurs, if it is enabled (via IntEnable()), the handler function will be called in interrupt context. Since the handler function can preempt other code, care must be taken to protect memory or peripherals that are accessed by the handler and other non-handler code.

Note
The use of this function (directly or indirectly via a peripheral driver interrupt register function) moves the interrupt vector table from flash to SRAM. Therefore, care must be taken when linking the application to ensure that the SRAM vector table is located at the beginning of SRAM; otherwise NVIC will not look in the correct portion of memory for the vector table (it requires the vector table be on a 1 kB memory alignment). Normally, the SRAM vector table is so placed via the use of linker scripts.
Parameters
ui32Interruptspecifies the interrupt in question.
pfnHandleris a pointer to the function to be called.
Returns
None.

Definition at line 155 of file interrupt.c.

Referenced by CRYPTOIntRegister(), FlashIntRegister(), FlashsafeIntRegister(), I2CIntRegister(), I2SIntRegister(), IOCIntRegister(), SSIIntRegister(), SysTickIntRegister(), TimerIntRegister(), TRNGIntRegister(), UARTIntRegister(), uDMAIntRegister(), and WatchdogIntRegister().

void IntUnregister ( uint32_t  ui32Interrupt)

Unregisters the function to be called when an interrupt occurs.

This function is used to indicate that no handler should be called when the given interrupt is asserted to the processor. The interrupt source will be automatically disabled (via IntDisable()) if necessary.

Parameters
ui32Interruptspecifies the interrupt in question.
Returns
None.
See also
IntRegister() for important information about registering interrupt handlers.

Definition at line 203 of file interrupt.c.

Referenced by CRYPTOIntUnregister(), FlashIntUnregister(), FlashsafeIntUnregister(), I2CIntUnregister(), I2SIntUnregister(), IOCIntUnregister(), SSIIntUnregister(), SysTickIntUnregister(), TimerIntUnregister(), TRNGIntUnregister(), UARTIntUnregister(), uDMAIntUnregister(), and WatchdogIntUnregister().

Here is the call graph for this function:

Macro Definition Documentation

#define INT_PRI_LEVEL0   0x00000000

Definition at line 108 of file interrupt.h.

#define INT_PRI_LEVEL1   0x00000020

Definition at line 109 of file interrupt.h.

#define INT_PRI_LEVEL2   0x00000040

Definition at line 110 of file interrupt.h.

#define INT_PRI_LEVEL3   0x00000060

Definition at line 111 of file interrupt.h.

#define INT_PRI_LEVEL4   0x00000080

Definition at line 112 of file interrupt.h.

#define INT_PRI_LEVEL5   0x000000A0

Definition at line 113 of file interrupt.h.

#define INT_PRI_LEVEL6   0x000000C0

Definition at line 114 of file interrupt.h.

#define INT_PRI_LEVEL7   0x000000E0

Definition at line 115 of file interrupt.h.

Referenced by IntPrioritySet().

#define INT_PRIORITY_MASK   0x000000E0

Definition at line 107 of file interrupt.h.