Data Structures | Typedefs | Enumerations | Functions | Variables
TimerCC32XX.h File Reference

Detailed Description

Timer driver interface for CC32XX devices.


Operation

This driver implements half and full width general purpose timers for the CC32XX device. For CC32XX devices, the system clock is 80 MHz and a 16-bit timer has 24-bits of resolution. The desired period may not always be achieved due to hardware limitations, such as the aforementioned. The timer resolution is limited to 12.5ns due to the 80 MHz clock. A timer period no greater than 209,714us can be achieved when operating in 16-bit mode. Similarly, a period no greater than 53,687,090us can be achieved when operating in 32-bit mode. The same time contraints apply to the 16-bit timer when attempting to use a frequency less than 5 hertz. For additional details, refer to the device's technical reference manual.

Resource Allocation

Each general purpose timer block contains two timers, Timer A and Timer B, that can be configured to operate independently; or concatenated to operate as one 32-bit timer. This behavior is managed through a set of resource allocation APIs. For example, the TimerCC32XX_allocateTimerResource API will allocate a timer for exclusive use. Any attempt to allocate this resource in the future will result in a false value being returned from the allocation API. To free a timer resource, the TimerCC32XX_freeTimerResource is used.

#include <stdbool.h>
#include <stdint.h>
#include <ti/drivers/Timer.h>
#include <ti/drivers/Power.h>
#include <ti/drivers/dpl/HwiP.h>
#include <ti/drivers/dpl/SemaphoreP.h>

Go to the source code of this file.

Data Structures

struct  TimerCC32XX_HWAttrs_
 TimerCC32XX Hardware Attributes. More...
 
struct  TimerCC32XX_Object_
 TimerCC32XX_Object. More...
 

Typedefs

typedef enum TimerCC32XX_SubTimer_ TimerCC32XX_SubTimer
 
typedef struct TimerCC32XX_HWAttrs_ TimerCC32XX_HWAttrs
 TimerCC32XX Hardware Attributes. More...
 
typedef struct TimerCC32XX_Object_ TimerCC32XX_Object
 TimerCC32XX_Object. More...
 

Enumerations

enum  TimerCC32XX_SubTimer_ { TimerCC32XX_timer16A = 0x0001, TimerCC32XX_timer16B = 0x0002, TimerCC32XX_timer32 = 0x0003 }
 

Functions

bool TimerCC32XX_allocateTimerResource (uint32_t baseAddress, TimerCC32XX_SubTimer subTimer)
 Function to allocate a timer peripheral. More...
 
void TimerCC32XX_freeTimerResource (uint32_t baseAddress, TimerCC32XX_SubTimer subTimer)
 Function to de-allocate a timer peripheral. More...
 

Variables

const Timer_FxnTable TimerCC32XX_fxnTable
 

Typedef Documentation

§ TimerCC32XX_SubTimer

§ TimerCC32XX_HWAttrs

TimerCC32XX Hardware Attributes.

Timer hardware attributes that tell the TimerCC32XX driver specific hardware configurations and interrupt/priority settings.

A sample structure is shown below:

const TimerCC32XX_HWAttrs timerCC32XXHWAttrs[] =
{
{
.baseAddress = TIMERA0_BASE,
.subTimer = TimerCC32XX_timer32,
.intNum = INT_TIMERA0A,
.intPriority = ~0
},
{
.baseAddress = TIMERA1_BASE,
.subTimer = TimerCC32XX_timer16A,
.intNum = INT_TIMERA1A,
.intPriority = ~0
},
{
.baseAddress = TIMERA1_BASE,
.subTimer = TimerCC32XX_timer16B,
.intNum = INT_TIMERA1B,
.intPriority = ~0
}
};

§ TimerCC32XX_Object

TimerCC32XX_Object.

The application must not access any member variables of this structure!

Enumeration Type Documentation

§ TimerCC32XX_SubTimer_

Enumerator
TimerCC32XX_timer16A 

Half width timer A

TimerCC32XX_timer16B 

Half width timer B

TimerCC32XX_timer32 

Full width timer

Function Documentation

§ TimerCC32XX_allocateTimerResource()

bool TimerCC32XX_allocateTimerResource ( uint32_t  baseAddress,
TimerCC32XX_SubTimer  subTimer 
)

Function to allocate a timer peripheral.

This function is intended to be used by any driver which implements a timer hardware peripheral. Calling this function will enable power to the timer peripheral specified by the parameter, baseAddress.

Parameters
baseAddressThe base address of a timer hardware peripheral.
subTimerThe TimerCC32XX_subTimer to be allocated.
Returns
A bool returning true if the timer resource was successfully allocated. If the base address is not valid or if the resource is not available, false is returned.
See also
TimerCC32XX_freeTimerResource()

§ TimerCC32XX_freeTimerResource()

void TimerCC32XX_freeTimerResource ( uint32_t  baseAddress,
TimerCC32XX_SubTimer  subTimer 
)

Function to de-allocate a timer peripheral.

This function is intended to be used by any driver which implements a timer hardware peripheral. Calling this function will disable power to the timer peripheral specified by the parameter, baseAddress, if and only if the timer peripheral is no longer in use.

Precondition
A successful call to TimerCC32XX_allocateTimerResource() using the baseAddress and subTimer must have been made prior to calling this API.
Parameters
baseAddressThe base address of a timer hardware peripheral.
subTimerThe TimerCC32XX_subTimer to be freed.
See also
TimerCC32XX_allocateTimerResource()

Variable Documentation

§ TimerCC32XX_fxnTable

const Timer_FxnTable TimerCC32XX_fxnTable
Copyright 2017, Texas Instruments Incorporated