SimpleLink MCU SDK Driver APIs  tidrivers_msp43x_3_01_01_03
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>
Include dependency graph for TimerMSP432.h:
This graph shows which files directly or indirectly include this file:

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)
 
void 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)
 
void 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 Hardware Attributes.

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

A sample structure is shown below:

1 const TimerMSP432_HWAttrs timerMSP432HWAttrs[] =
2 {
3  {
4  .timerBaseAddress = TIMER32_0_BASE,
5  .clockSource = TIMER_A_CLOCKSOURCE_SMCLK,
6  .intNum = INT_T32_INT1,
7  .intPriority = ~0
8  }
9 };

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

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)
void 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)
void TimerMSP432_Timer32_start ( Timer_Handle  handle)
void TimerMSP432_Timer32_stop ( Timer_Handle  handle)

Variable Documentation

TimerMSP432_Object timerMSP432Objects[]
const uint8_t Timer_count
Timer_FxnTable TimerMSP432_Timer_A_fxnTable
Timer_FxnTable TimerMSP432_Timer32_fxnTable
Copyright 2016, Texas Instruments Incorporated