Renesas M16C/62P Group Computer Hardware User Manual


 
Rev.1.00 2007.11.1
REC10B0002-0100
65
__SetTimerRegister
Synopsis
<Set timer register>
Boolean __SetTimerRegister(unsigned long data1, unsigned int *data2)
data1 Setup data 1
data2 Pointer to the buffer in which register value is stored
Description
Sets the registers of a specified timer.
[data1]
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.
[data2]
The content of a pointer to the buffer in which the register value is stored must be specified
as described below. The value is set in each register in order of buffer pointer elements.
• When using timer A (RAPI_TIMER_A0 to RAPI_TIMER_A4 specified)
[0]: Specify the set value for the timer Ai mode register (i = 0–4).
[1]: Specify the set value for the timer Ai register (i = 0–4).
[2]: Specify the set value for the up/down flag register.
[3]: Specify the set value for the one-shot start flag register.
[4]: Specify the set value for the trigger select register.
[5]: Specify the set value for the time-clock prescaler reset register.
[6]: Specify the set value for the count start flag register.
• When using timer B (RAPI_TIMER_B0 to RAPI_TIMER_B5)
[0]: Specify the set value for the timer Bi mode register (i = 0–5).
[1]: Specify the set value for the timer Bi register (i = 0–5).
[3]: Specify the set value for the time-clock prescaler reset register.
[4]: Specify the set value for 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)
Reference
__EnableTimerRegister, __ClearTimerRegister, __GetTimerRegister
Remark