CC26xx Driver Library
interrupt.c File Reference
#include "interrupt.h"

Functions

static void IntDefaultHandler (void)
 The default interrupt handler. 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...
 

Variables

static const uint32_t g_pui32Priority []
 
static const uint32_t g_pui32Regs []
 
void(* g_pfnRAMVectors [NUM_INTERRUPTS])(void)
 

Function Documentation

static void IntDefaultHandler ( void  )
static

The default interrupt handler.

This is the default interrupt handler for all interrupts. It simply loops forever so that the system state is preserved for observation by a debugger. Since interrupts should be disabled before unregistering the corresponding handler, this should never be called.

Returns
None

Referenced by IntUnregister().

112 {
113  // Go into an infinite loop.
114  while(1)
115  {
116  }
117 }

Variable Documentation

void(* g_pfnRAMVectors[NUM_INTERRUPTS])(void)

Referenced by IntRegister(), and IntUnregister().

const uint32_t g_pui32Priority[]
static
Initial value:
=
{
NVIC_APINT_PRIGROUP_0_8, NVIC_APINT_PRIGROUP_1_7, NVIC_APINT_PRIGROUP_2_6,
NVIC_APINT_PRIGROUP_3_5, NVIC_APINT_PRIGROUP_4_4, NVIC_APINT_PRIGROUP_5_3,
NVIC_APINT_PRIGROUP_6_2, NVIC_APINT_PRIGROUP_7_1
}

This is a mapping between priority grouping encodings and the number of preemption priority bits.

Referenced by IntPriorityGroupingGet(), and IntPriorityGroupingSet().

const uint32_t g_pui32Regs[]
static
Initial value:
=
{
0, NVIC_SYS_PRI1, NVIC_SYS_PRI2, NVIC_SYS_PRI3, NVIC_PRI0, NVIC_PRI1,
NVIC_PRI2, NVIC_PRI3, NVIC_PRI4, NVIC_PRI5, NVIC_PRI6, NVIC_PRI7,
NVIC_PRI8, NVIC_PRI9, NVIC_PRI10, NVIC_PRI11, NVIC_PRI12, NVIC_PRI13
}

This is a mapping between interrupt number and the register that contains the priority encoding for that interrupt.

Referenced by IntPriorityGet(), and IntPrioritySet().