CC3200 Peripheral Driver Library User's Guide  1.2.0
Interrupt_api

Functions

tBoolean IntMasterEnable (void)
 
tBoolean IntMasterDisable (void)
 
void IntVTableBaseSet (unsigned long ulVtableBase)
 
void IntRegister (unsigned long ulInterrupt, void(*pfnHandler)(void))
 
void IntUnregister (unsigned long ulInterrupt)
 
void IntPriorityGroupingSet (unsigned long ulBits)
 
unsigned long IntPriorityGroupingGet (void)
 
void IntPrioritySet (unsigned long ulInterrupt, unsigned char ucPriority)
 
long IntPriorityGet (unsigned long ulInterrupt)
 
void IntEnable (unsigned long ulInterrupt)
 
void IntDisable (unsigned long ulInterrupt)
 
void IntPendSet (unsigned long ulInterrupt)
 
void IntPendClear (unsigned long ulInterrupt)
 
void IntPriorityMaskSet (unsigned long ulPriorityMask)
 
unsigned long IntPriorityMaskGet (void)
 

Detailed Description

Function Documentation

void IntDisable ( unsigned long  ulInterrupt)

Disables an interrupt.

Parameters
ulInterruptspecifies the interrupt to be disabled.

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.

Returns
None.
void IntEnable ( unsigned long  ulInterrupt)

Enables an interrupt.

Parameters
ulInterruptspecifies the interrupt to be enabled.

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.

Returns
None.
tBoolean IntMasterDisable ( void  )

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.

Note
Previously, this function had no return value. As such, it was possible to include interrupt.h and call this function without having included hw_types.h. Now that the return is a tBoolean, a compiler error will occur in this case. The solution is to include hw_types.h before including interrupt.h.
Returns
Returns true if interrupts were already disabled when the function was called or false if they were initially enabled.
tBoolean IntMasterEnable ( void  )

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.

Note
Previously, this function had no return value. As such, it was possible to include interrupt.h and call this function without having included hw_types.h. Now that the return is a tBoolean, a compiler error will occur in this case. The solution is to include hw_types.h before including interrupt.h.
Returns
Returns true if interrupts were disabled when the function was called or false if they were initially enabled.
void IntPendClear ( unsigned long  ulInterrupt)

Unpends an interrupt.

Parameters
ulInterruptspecifies the interrupt to be unpended.

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.

Returns
None.
void IntPendSet ( unsigned long  ulInterrupt)

Pends an interrupt.

Parameters
ulInterruptspecifies the interrupt to be pended.

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.

Returns
None.
long IntPriorityGet ( unsigned long  ulInterrupt)

Gets the priority of an interrupt.

Parameters
ulInterruptspecifies the interrupt in question.

This function gets the priority of an interrupt. See IntPrioritySet() for a definition of the priority value.

Returns
Returns the interrupt priority, or -1 if an invalid interrupt was specified.
unsigned long 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
The number of bits of preemptable priority.
void IntPriorityGroupingSet ( unsigned long  ulBits)

Sets the priority grouping of the interrupt controller.

Parameters
ulBitsspecifies the number of bits of preemptable priority.

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 CC3200 , three bits are available for hardware interrupt prioritization and therefore priority grouping values of three through seven have the same effect.

Returns
None.
unsigned long IntPriorityMaskGet ( void  )

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), so any prioritization must be performed in those bits.

Returns
Returns the value of the interrupt priority level mask.
void IntPriorityMaskSet ( unsigned long  ulPriorityMask)

Sets the priority masking level

Parameters
ulPriorityMaskis the priority level that will be masked.

This function sets the interrupt priority masking level so that all interrupts at the specified or lesser priority level is 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), so any prioritization must be performed in those bits.

Returns
None.
void IntPrioritySet ( unsigned long  ulInterrupt,
unsigned char  ucPriority 
)

Sets the priority of an interrupt.

Parameters
ulInterruptspecifies the interrupt in question.
ucPriorityspecifies the priority of the 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), 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.

The parameter ucPriority can be any one of the following -INT_PRIORITY_LVL_0 -INT_PRIORITY_LVL_1 -INT_PRIORITY_LVL_2 -INT_PRIORITY_LVL_3 -INT_PRIORITY_LVL_4 -INT_PRIORITY_LVL_5 -INT_PRIORITY_LVL_6 -INT_PRIORITY_LVL_7

Returns
None.
void IntRegister ( unsigned long  ulInterrupt,
void(*)(void)  pfnHandler 
)

Registers a function to be called when an interrupt occurs.

Parameters
ulInterruptspecifies the interrupt in question.
pfnHandleris a pointer to the function to be called.

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.

Returns
None.
void IntUnregister ( unsigned long  ulInterrupt)

Unregisters the function to be called when an interrupt occurs.

Parameters
ulInterruptspecifies the interrupt in question.

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.

See also
IntRegister() for important information about registering interrupt handlers.
Returns
None.
void IntVTableBaseSet ( unsigned long  ulVtableBase)

Sets the NVIC VTable base.

Parameters
ulVtableBasespecifies the new base address of VTable

This function is used to specify a new base address for the VTable. This function must be called before using IntRegister() for registering any interrupt handler.

Returns
None.