CC13xx Driver Library
timer.c File Reference
#include "timer.h"

Functions

static uint32_t TimerIntNumberGet (uint32_t ui32Base)
 Gets the timer interrupt number. More...
 
void TimerConfigure (uint32_t ui32Base, uint32_t ui32Config)
 Configures the timer(s). More...
 
void TimerLevelControl (uint32_t ui32Base, uint32_t ui32Timer, bool bInvert)
 Controls the output level. More...
 
void TimerStallControl (uint32_t ui32Base, uint32_t ui32Timer, bool bStall)
 Controls the stall handling. More...
 
void TimerWaitOnTriggerControl (uint32_t ui32Base, uint32_t ui32Timer, bool bWait)
 Controls the wait on trigger handling. More...
 
void TimerIntRegister (uint32_t ui32Base, uint32_t ui32Timer, void(*pfnHandler)(void))
 Registers an interrupt handler for the timer interrupt in the dynamic interrupt table. More...
 
void TimerIntUnregister (uint32_t ui32Base, uint32_t ui32Timer)
 Unregisters an interrupt handler for the timer interrupt in the dynamic interrupt table. More...
 
void TimerMatchUpdateMode (uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Mode)
 Sets the Match Register Update mode. More...
 
void TimerIntervalLoadMode (uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Mode)
 Sets the Interval Load mode. More...
 

Function Documentation

static uint32_t TimerIntNumberGet ( uint32_t  ui32Base)
static

Gets the timer interrupt number.

Given a timer base address, this function returns the corresponding interrupt number.

Parameters
ui32Baseis the base address of the timer module.
Returns
Returns a timer interrupt number, or -1 if ui32Base is invalid.

Referenced by TimerIntRegister(), and TimerIntUnregister().

80 {
81  uint32_t ui32Int;
82 
83  // Loop through the table that maps timer base addresses to interrupt
84  // numbers.
85  switch(ui32Base)
86  {
87  case GPT0_BASE :
88  ui32Int = INT_GPT0A;
89  break;
90  case GPT1_BASE :
91  ui32Int = INT_GPT1A;
92  break;
93  case GPT2_BASE :
94  ui32Int = INT_GPT2A;
95  break;
96  case GPT3_BASE :
97  ui32Int = INT_GPT3A;
98  break;
99  default :
100  ui32Int = 0x0;
101  }
102 
103  // Return the interrupt number or (-1) if not base address is not matched.
104  return (ui32Int);
105 }