![]() |
![]() |
|
MSP430™CapTIvateSoftwareLibraryAPIGuide
1_70_00_03
|
Timer based communication time-out management. More...
Data Structures | |
| struct | tFunctionTimer |
Macros | |
| #define | HWREG16(x) (*((volatile uint16_t *)((uint16_t)x))) |
| #define | TIMER__CCR0_VECTOR (TIMER0_A0_VECTOR) |
| #define | TIMER__CCR1_VECTOR (TIMER0_A1_VECTOR) |
| #define | FUNCTIONTIMER__PERIPHERAL (TIMER_A0_BASE) |
| #define | FUNCTIONTIMER__CLOCK (TASSEL__ACLK) |
| #define | FUNCTIONTIMER__DIVIDER (ID__1) |
| #define | FUNCTIONTIMER__EXDIVIDER (TAIDEX_0) |
| #define | FUNCTIONTIMER__LPM_CLEAR (LPM3_bits) |
Enumerations | |
| enum | tFunctionTimerSelection { eTimerDelayedFunction_A, eTimerDelayedFunction_B } |
| enumerates the available function delays. More... | |
Functions | |
| void | Timer_startDelayedFunctionTimer (const tFunctionTimer *pFunctionTimer) |
| void | Timer_stopDelayedFunctionTimer (void) |
| This function stops the Timer_A. More... | |
| void | Timer_scheduleDelayedFunction (uint8_t ui8Function) |
| void | Timer_cancelDelayedFunction (uint8_t ui8Function) |
| __interrupt void | FunctionTimer_A_ISR (void) |
| __interrupt void | FunctionTimer_B_ISR (void) |
Variables | |
| const tFunctionTimer * | g_pFunctionTimer |
Timer based communication time-out management.
The function timer provides a mechanism to call a function in the foreground (from an ISR) after a specified delay, specified in timer cycles. One Timer_A instance is required. Up to two delayed functions may be registered at the same time (Function A and Function B) with each having a different delay. A Timer_A instance with at least a CCR0 and CCR1 unit is required.
This is the function timer module definitions file. The function timer provides a mechanism to call a function in the foreground (from an ISR) after a specified delay, specified in timer cycles. One Timer_A instance is required. Up to two delayed functions may be registered at the same time (Function A and Function B) with each having a different delay. A Timer_A instance with at least a CCR0 and CCR1 unit is required.
| #define HWREG16 | ( | x | ) | (*((volatile uint16_t *)((uint16_t)x))) |
| #define TIMER__CCR0_VECTOR (TIMER0_A0_VECTOR) |
| #define TIMER__CCR1_VECTOR (TIMER0_A1_VECTOR) |
| #define FUNCTIONTIMER__PERIPHERAL (TIMER_A0_BASE) |
| #define FUNCTIONTIMER__CLOCK (TASSEL__ACLK) |
Referenced by Timer_startDelayedFunctionTimer().
| #define FUNCTIONTIMER__DIVIDER (ID__1) |
Referenced by Timer_startDelayedFunctionTimer().
| #define FUNCTIONTIMER__EXDIVIDER (TAIDEX_0) |
Referenced by Timer_startDelayedFunctionTimer().
| #define FUNCTIONTIMER__LPM_CLEAR (LPM3_bits) |
Referenced by FunctionTimer_A_ISR(), and FunctionTimer_B_ISR().
| void Timer_startDelayedFunctionTimer | ( | const tFunctionTimer * | pFunctionTimer | ) |
This function registers the tFunctionTimer configuration structure with the module, so that the module knows the delays and function pointers. It then starts the Timer_A instance counting in continuous mode.
| pFunctionTimer | is a pointer to the function timer configuration structure to use. |
References FUNCTIONTIMER__CLOCK, FUNCTIONTIMER__DIVIDER, FUNCTIONTIMER__EXDIVIDER, FUNCTIONTIMER__PERIPHERAL, HWREG16, and Timer_stopDelayedFunctionTimer().
Referenced by I2CSlave_openPort().
| void Timer_stopDelayedFunctionTimer | ( | void | ) |
This function stops the Timer_A.
References FUNCTIONTIMER__PERIPHERAL, and HWREG16.
Referenced by I2CSlave_closePort(), and Timer_startDelayedFunctionTimer().
| void Timer_scheduleDelayedFunction | ( | uint8_t | ui8Function | ) |
This function starts the delay for the passed function (A or B), which will then be called after the expiration of the delay.
| ui8Function | specifies the function to schedule (A or B). |
References eTimerDelayedFunction_A, eTimerDelayedFunction_B, FUNCTIONTIMER__PERIPHERAL, HWREG16, tFunctionTimer::ui16FunctionDelay_A, and tFunctionTimer::ui16FunctionDelay_B.
Referenced by I2CSlave_setRequestFlag().
| void Timer_cancelDelayedFunction | ( | uint8_t | ui8Function | ) |
This function cancels a scheduled function if the delay has not already expired. If the delay has expired, this function has no effect.
| ui8Function | specifies the function to cancel (A or B). |
References eTimerDelayedFunction_A, eTimerDelayedFunction_B, FUNCTIONTIMER__PERIPHERAL, and HWREG16.
Referenced by I2CSlave_setRequestFlag().
| __interrupt void FunctionTimer_A_ISR | ( | void | ) |
References FUNCTIONTIMER__LPM_CLEAR, FUNCTIONTIMER__PERIPHERAL, HWREG16, and tFunctionTimer::pbFunction_A.
| __interrupt void FunctionTimer_B_ISR | ( | void | ) |
References FUNCTIONTIMER__LPM_CLEAR, FUNCTIONTIMER__PERIPHERAL, HWREG16, and tFunctionTimer::pbFunction_B.
| const tFunctionTimer* g_pFunctionTimer |
const g_pFunctionTimer stores a pointer to the current tFunctionTimer instance associated with this module. The memory pointed to by this variable must not be modified between when Timer_startDelayedFunctionTimer() is called and Timer_stopDelayedFunctionTimer() is called.