SimpleLink MCU SDK Driver APIs
tidrivers_msp43x_3_01_01_03
|
Timer driver interface for MSP432 devices.
===========================================================================
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.
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) |
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 struct _TimerMSP432_HWAttr 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:
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.
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 | ) |
TimerMSP432_Object timerMSP432Objects[] |
const uint8_t Timer_count |
Timer_FxnTable TimerMSP432_Timer_A_fxnTable |
Timer_FxnTable TimerMSP432_Timer32_fxnTable |