Download Renesas Embedded Application Programming Interface User`s
Transcript
Library Reference
4
4.2.2
Description (3/3)
Timer MTU2
__CreateOutputCompare
• Selectable parameters when RAPI_MTU2_3 or RAPI_MTU2_4 is specified:
(Count source)
Specify one from { RAPI_MP1, RAPI_MP4, RAPI_MP16,
RAPI_MP64, RAPI_MP256_34, RAPI_MP1024_34,
RAPI_EXTER_TCLKA_3, RAPI_EXTER_TCLKB_3 }.
The default value is RAPI_MP1.
(Count edge)
Specify one from { RAPI_RISING_EDGE,
RAPI_FALLING_EDGE, RAPI_BOTH_EDGE }.
The default value is RAPI_RISING_EDGE.
Note:
When RAPI_MP1 is specified for the count source,
count edge is fixed to its default value.
(Count clearing source)
Specify one from { RAPI_TCNT_CLEAR_TGRA,
RAPI_TCNT_CLEAR_TGRB, RAPI_TCNT_CLEAR_TGRC,
RAPI_TCNT_CLEAR_TGRD }.
The default value is RAPI_TCNT_CLEAR_DIS.
(A/D converter start
request)
Specify one from { RAPI_AD_START_REQ,
RAPI_NO_AD_START_REQ }.
The default value is RAPI_NO_AD_START_REQ.
• Parameters when synchronous operation is specified:
When setting synchronous operation for any channels 0 to 4, specify RAPI_TIMER_SYNC.
When not setting synchronous operation (each channel operates independently),
specify RAPI_TIMER_NO_SYNC.
The default value is RAPI_TIMER_NO_SYNC.
Return value
If the specification of timer is invalid, RAPI_FALSE is returned; otherwise, RAPI_TRUE is
returned.
Category
Timer MTU2 (output compare mode)
Reference
__CreatePWM
Remark
If an undefined value is specified in the argument, operation of the API cannot be guaranteed.
Program example
#include "rapi_timer_sh_7125.h"
/* Declaration of callback function */
void TimerIntFunc( void );
void func( void )
{
/* Setting MTU2 channel 0 for output compare mode */
__CreateOutputCompare( RAPI_MTU2_0 | RAPI_MP_4 |
RAPI_FALLING_EDGE | RAPI_TCNT_CLEAR_TGRA |
RAPI_TIMER_NO_SYNC );
}
Rev.1.01 Aug. 27, 2008
REJ10J1906-0101
4-90