Data Structures | Typedefs | Functions | Variables
TimerMSP432.h File Reference

Detailed Description

Timer driver interface for MSP432 devices.

===========================================================================

Operation

The Timer implementation for MSP432 leverages two different hardware peripherals: Timer_A and Timer32. For each hardware instance, the configuration of clock dividers and prescalars is taken care of in the TimerMSP432_open function. This function will examine the provided period and clock resource and intelligently calculate the best clock divider for the period and clock source combination.

Resource Allocation

Each Timer instantiation can only be associated with one exclusive hardware Timer. For example, if a Timer is declared that uses Timer_A1, no other Timer instance can leverage Timer_A1 without introducing unreliable behavior. This behavior is managed through a set of simple resource allocation APIs. For example, the TimerMSP432_allocateTimerResource API will accept a Timer's base address and "allocate" that 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 release and "free" the timer resource, the TimerMSP432_freeTimerResource is used.


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

Go to the source code of this file.

Data Structures

struct  _TimerMSP432_HWAttr
 TimerMSP432 Hardware Attributes. More...
 
struct  TimerMSP432_Object
 TimerMSP432 Object Driver specific structure that takes care of various driver parameters such as hardware interrupts and callbacks. The application should not modify any members of this structure. More...
 

Typedefs

typedef struct _TimerMSP432_HWAttr TimerMSP432_HWAttrs
 TimerMSP432 Hardware Attributes. More...
 
typedef struct TimerMSP432_Object TimerMSP432_Object
 TimerMSP432 Object Driver specific structure that takes care of various driver parameters such as hardware interrupts and callbacks. The application should not modify any members of this structure. More...
 

Functions

bool TimerMSP432_allocateTimerResource (uint32_t timerBase)
 
void TimerMSP432_close (Timer_Handle handle)
 
void TimerMSP432_freeTimerResource (uint32_t timerBase)
 
void TimerMSP432_init (Timer_Handle handle)
 
Timer_Handle TimerMSP432_open (Timer_Handle handle, Timer_Params *params)
 
int_fast16_t TimerMSP432_Timer_A_control (Timer_Handle handle, uint_fast16_t cmd, void *arg)
 
uint32_t TimerMSP432_Timer_A_getCount (Timer_Handle handle)
 
int32_t TimerMSP432_Timer_A_start (Timer_Handle handle)
 
void TimerMSP432_Timer_A_stop (Timer_Handle handle)
 
int_fast16_t TimerMSP432_Timer32_control (Timer_Handle handle, uint_fast16_t cmd, void *arg)
 
uint32_t TimerMSP432_Timer32_getCount (Timer_Handle handle)
 
int32_t TimerMSP432_Timer32_start (Timer_Handle handle)
 
void TimerMSP432_Timer32_stop (Timer_Handle handle)
 

Variables

TimerMSP432_Object timerMSP432Objects []
 
const uint8_t Timer_count
 
Timer_FxnTable TimerMSP432_Timer_A_fxnTable
 
Timer_FxnTable TimerMSP432_Timer32_fxnTable
 

Typedef Documentation

§ TimerMSP432_HWAttrs

TimerMSP432 Hardware Attributes.

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

A sample structure is shown below:

const TimerMSP432_HWAttrs timerMSP432HWAttrs[] =
{
{
.timerBaseAddress = TIMER32_0_BASE,
.clockSource = TIMER_A_CLOCKSOURCE_SMCLK,
.intNum = INT_T32_INT1,
.intPriority = ~0
}
};

§ TimerMSP432_Object

TimerMSP432 Object Driver specific structure that takes care of various driver parameters such as hardware interrupts and callbacks. The application should not modify any members of this structure.

Function Documentation

§ TimerMSP432_allocateTimerResource()

bool TimerMSP432_allocateTimerResource ( uint32_t  timerBase)

§ TimerMSP432_close()

void TimerMSP432_close ( Timer_Handle  handle)

§ TimerMSP432_freeTimerResource()

void TimerMSP432_freeTimerResource ( uint32_t  timerBase)

§ TimerMSP432_init()

void TimerMSP432_init ( Timer_Handle  handle)

§ TimerMSP432_open()

Timer_Handle TimerMSP432_open ( Timer_Handle  handle,
Timer_Params params 
)

§ TimerMSP432_Timer_A_control()

int_fast16_t TimerMSP432_Timer_A_control ( Timer_Handle  handle,
uint_fast16_t  cmd,
void *  arg 
)

§ TimerMSP432_Timer_A_getCount()

uint32_t TimerMSP432_Timer_A_getCount ( Timer_Handle  handle)

§ TimerMSP432_Timer_A_start()

int32_t TimerMSP432_Timer_A_start ( Timer_Handle  handle)

§ TimerMSP432_Timer_A_stop()

void TimerMSP432_Timer_A_stop ( Timer_Handle  handle)

§ TimerMSP432_Timer32_control()

int_fast16_t TimerMSP432_Timer32_control ( Timer_Handle  handle,
uint_fast16_t  cmd,
void *  arg 
)

§ TimerMSP432_Timer32_getCount()

uint32_t TimerMSP432_Timer32_getCount ( Timer_Handle  handle)

§ TimerMSP432_Timer32_start()

int32_t TimerMSP432_Timer32_start ( Timer_Handle  handle)

§ TimerMSP432_Timer32_stop()

void TimerMSP432_Timer32_stop ( Timer_Handle  handle)

Variable Documentation

§ timerMSP432Objects

TimerMSP432_Object timerMSP432Objects[]

§ Timer_count

const uint8_t Timer_count

§ TimerMSP432_Timer_A_fxnTable

Timer_FxnTable TimerMSP432_Timer_A_fxnTable

§ TimerMSP432_Timer32_fxnTable

Timer_FxnTable TimerMSP432_Timer32_fxnTable
Copyright 2017, Texas Instruments Incorporated