Renesas M16C/62P Group Computer Hardware User Manual


 
Rev.1.00 2007.11.1
REC10B0002-0100
51
RAPI_FALLING Selects the falling edge of TA
iIN
pin input signal as active edge.
• Specifiable definition values when timer A is used (RAPI_TIMER_A0 to
RAPI_TIMER_A4 specified)
(Count source) Specify one from { RAPI_F1, RAPI_F2, RAPI_F32, RAPI_FC32 }.
The default value is RAPI_F2.
(Operating states set) Specify one from { RAPI_TIMER_ON, RAPI_TIMER_OFF }. The
default value is RAPI_TIMER_OFF.
(Count start condition) Specify one from { RAPI_TG_TAIS, RAPI_TG_TAIIN,
RAPI_EV_TIMER_AJ, RAPI_EV_TIMER_AK,
RAPI_EV_TIMER_B2 }. The default value is RAPI_TG_TAIIN.
(Pulse output facility) Specify one from { RAPI_PULSE_ON, RAPI_PULSE_OFF }. The
default value is RAPI_PULSE_OFF.
(Modulator) Specify one from { RAPI_PWM_16, RAPI_PWM_8 }. The default
value is RAPI_PWM_16.
(TA
iIN
pin input) Specify one from { RAPI_RISING, RAPI_FALLING }. The default
value is RAPI_FALLING. The active edge of TA
iIN
pin input can only
be set when RAPI_TG_TAIIN is selected.
[data2]
Specify the interrupt priority level (07) to be set in the interrupt control register.
[data3]
Specify a pointer to the 16-bit variable in which the set value for the timer register is
stored.
For 16-bit PWM, specify the value of ‘n’ in “high-level width n/f
j
, period 65535/f
j
” in
16 bits.
For 8-bit PWM, specify the values of ‘n’ and ‘m’ in “high-level width n (m + 1)/f,
period 255 (m + 1)/f
j
” in the 8 high-order bits and the 8 low-order bits, respectively.
Return value
If the timer specification is incorrect, RAPI_FALSE is returned; otherwise, RAPI_TRUE
is returned.
Functionality
Timer (pulse width modulation mode (PWM mode))
Reference
__EnablePulseWidthModulationMode, __DestroyPulseWidthModulationMode
Remark
If an undefined value is specified in the first argument, operation of the API cannot
be guaranteed.
Program example
#include "rapi_timer_m16c_62p.h"
void TimerIntFunc( void ){}