CC26xx Driver Library
timer.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include "../inc/hw_ints.h"
#include "../inc/hw_types.h"
#include "../inc/hw_memmap.h"
#include "../inc/hw_gpt.h"
#include "interrupt.h"
#include "debug.h"

Macros

#define TIMER_CFG_ONE_SHOT   0x00000021
 
#define TIMER_CFG_ONE_SHOT_UP   0x00000031
 
#define TIMER_CFG_PERIODIC   0x00000022
 
#define TIMER_CFG_PERIODIC_UP   0x00000032
 
#define TIMER_CFG_SPLIT_PAIR   0x04000000
 
#define TIMER_CFG_A_ONE_SHOT   0x00000021
 
#define TIMER_CFG_A_ONE_SHOT_UP   0x00000031
 
#define TIMER_CFG_A_PERIODIC   0x00000022
 
#define TIMER_CFG_A_PERIODIC_UP   0x00000032
 
#define TIMER_CFG_A_CAP_COUNT   0x00000003
 
#define TIMER_CFG_A_CAP_COUNT_UP   0x00000013
 
#define TIMER_CFG_A_CAP_TIME   0x00000007
 
#define TIMER_CFG_A_CAP_TIME_UP   0x00000017
 
#define TIMER_CFG_A_PWM   0x0000000A
 
#define TIMER_CFG_B_ONE_SHOT   0x00002100
 
#define TIMER_CFG_B_ONE_SHOT_UP   0x00003100
 
#define TIMER_CFG_B_PERIODIC   0x00002200
 
#define TIMER_CFG_B_PERIODIC_UP   0x00003200
 
#define TIMER_CFG_B_CAP_COUNT   0x00000300
 
#define TIMER_CFG_B_CAP_COUNT_UP   0x00001300
 
#define TIMER_CFG_B_CAP_TIME   0x00000700
 
#define TIMER_CFG_B_CAP_TIME_UP   0x00001700
 
#define TIMER_CFG_B_PWM   0x00000A00
 
#define TIMER_TIMB_DMA   0x00002000
 
#define TIMER_TIMB_MATCH   0x00000800
 
#define TIMER_CAPB_EVENT   0x00000400
 
#define TIMER_CAPB_MATCH   0x00000200
 
#define TIMER_TIMB_TIMEOUT   0x00000100
 
#define TIMER_TIMA_DMA   0x00000020
 
#define TIMER_TIMA_MATCH   0x00000010
 
#define TIMER_CAPA_EVENT   0x00000004
 
#define TIMER_CAPA_MATCH   0x00000002
 
#define TIMER_TIMA_TIMEOUT   0x00000001
 
#define TIMER_EVENT_POS_EDGE   0x00000000
 
#define TIMER_EVENT_NEG_EDGE   0x00000404
 
#define TIMER_EVENT_BOTH_EDGES   0x00000C0C
 
#define TIMER_A   0x000000FF
 
#define TIMER_B   0x0000FF00
 
#define TIMER_BOTH   0x0000FFFF
 
#define TIMER_0A_SYNC   0x00000001
 
#define TIMER_0B_SYNC   0x00000002
 
#define TIMER_1A_SYNC   0x00000004
 
#define TIMER_1B_SYNC   0x00000008
 
#define TIMER_2A_SYNC   0x00000010
 
#define TIMER_2B_SYNC   0x00000020
 
#define TIMER_3A_SYNC   0x00000040
 
#define TIMER_3B_SYNC   0x00000080
 
#define TIMER_MATCHUPDATE_NEXTCYCLE   0x00000000
 
#define TIMER_MATCHUPDATE_TIMEOUT   0x00000001
 
#define TIMER_INTERVALLOAD_NEXTCYCLE   0x00000000
 
#define TIMER_INTERVALLOAD_TIMEOUT   0x00000001
 

Functions

static void TimerEnable (uint32_t ui32Base, uint32_t ui32Timer)
 Enables the timer(s). More...
 
static void TimerDisable (uint32_t ui32Base, uint32_t ui32Timer)
 Disables the timer(s). 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...
 
static void TimerEventControl (uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Event)
 Controls the event type. 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...
 
static void TimerPrescaleSet (uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Value)
 Set the timer prescale value. More...
 
static uint32_t TimerPrescaleGet (uint32_t ui32Base, uint32_t ui32Timer)
 Get the timer prescale value. More...
 
static void TimerPrescaleMatchSet (uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Value)
 Set the timer prescale match value. More...
 
static uint32_t TimerPrescaleMatchGet (uint32_t ui32Base, uint32_t ui32Timer)
 Get the timer prescale match value. More...
 
static void TimerLoadSet (uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Value)
 Sets the timer load value. More...
 
static uint32_t TimerLoadGet (uint32_t ui32Base, uint32_t ui32Timer)
 Gets the timer load value. More...
 
static uint32_t TimerValueGet (uint32_t ui32Base, uint32_t ui32Timer)
 Gets the current timer value. More...
 
static void TimerMatchSet (uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Value)
 Sets the timer match value. More...
 
static uint32_t TimerMatchGet (uint32_t ui32Base, uint32_t ui32Timer)
 Gets the timer match value. 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...
 
static void TimerIntEnable (uint32_t ui32Base, uint32_t ui32IntFlags)
 Enables individual timer interrupt sources. More...
 
static void TimerIntDisable (uint32_t ui32Base, uint32_t ui32IntFlags)
 Disables individual timer interrupt sources. More...
 
static uint32_t TimerIntStatus (uint32_t ui32Base, bool bMasked)
 Gets the current interrupt status. More...
 
static void TimerIntClear (uint32_t ui32Base, uint32_t ui32IntFlags)
 Clears timer interrupt sources. More...
 
static void TimerSynchronize (uint32_t ui32Base, uint32_t ui32Timers)
 Synchronizes the counters in a set of timers. More...
 
static void TimerCcpCombineEnable (uint32_t ui32Base)
 Enables AND'ing of the CCP outputs from Timer A and Timer B. More...
 
static void TimerCcpCombineDisable (uint32_t ui32Base)
 Disables AND'ing of the CCP outputs from Timer A and Timer B. 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...