Rev.1.00 2007.11.1
REC10B0002-0100
69
__GetTimerRegister
Synopsis
<Get timer register value>
Boolean __GetTimerRegister(unsigned long data1, unsigned int *data2)
data1 Setup data
data2 Pointer to the buffer in which register value is stored
Description
Gets the counter value of a specified timer.
[data]
For data, the following definition values can be set.
RAPI_TIMER_A0 Selects timer A channel 0.
RAPI_TIMER_A1 Selects timer A channel 1.
RAPI_TIMER_A2 Selects timer A channel 2.
RAPI_TIMER_A3 Selects timer A channel 3.
RAPI_TIMER_A4 Selects timer A channel 4.
RAPI_TIMER_B0 Selects timer B channel 0.
RAPI_TIMER_B1 Selects timer B channel 1.
RAPI_TIMER_B2 Selects timer B channel 2.
RAPI_TIMER_B3 Selects timer B channel 3.
RAPI_TIMER_B4 Selects timer B channel 4.
RAPI_TIMER_B5 Selects timer B channel 5.
[data2]
Specify a pointer to the array in which the acquired register value is stored.
The content of the array is described below.
• When using timer A (RAPI_TIMER_A0 to RAPI_TIMER_A4 specified)
[0]: Store the value of timer Ai mode register (i = 0–4).
[1]: Store the value of timer Ai register (i = 0–4).
[2]: Store the value of the up/down flag register.
[3]: Store the value of the one-shot start flag register.
[4]: Store the value of the trigger select register.
[5]: Store the value of the time-clock prescaler reset flag register.
[6]: Store the value of the count start flag register.
• When using timer B (RAPI_TIMER_B0 to RAPI_TIMER_B5 specified)
[0]: Store the value of timer Bi mode register (i = 0–5).
[1]: Store the value of timer Bi register (i = 0–5).
[2]: Store the value of the time-clock prescaler reset flag register.
[3]: Store the value of the count start flag register.
Return value
If the timer specification is incorrect, RAPI_FALSE is returned; otherwise, RAPI_TRUE
is returned.
Functionality
Timer (register manipulation)