CC26xx 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

§ TimerIntNumberGet()

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

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