beautypg.com

Renesas M16C/62P Group User Manual

Page 43

background image

Rev.1.00 2007.11.1
REC10B0002-0100

41

(Count source)

Specify one from { RAPI_F1, RAPI_F2, RAPI_F8, 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.

(Pulse output state)

Specify one from { RAPI_PULSE_ON, RAPI_PULSE_OFF }. The

default value is RAPI_PULSE_OFF.

(Gate facility)

Specify one from { RAPI_GATE_L, RAPI_GATE_H }. If omitted,

“No gate facility” is set.

Specifiable definition values when timer B is used (RAPI_TIMER_B0 to

RAPI_TIMER_B5 specified)

(Count source)

Specify one from { RAPI_F1, RAPI_F2, RAPI_F8, 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.

[data2]

Specify the interrupt priority level (0–7) to be set in the interrupt control register.

[data3]

Specify the value to be set in the timer register in 16 bits.

[data4]

Specify

0.

Return value

If the timer specification is incorrect, RAPI_FALSE is returned; otherwise, RAPI_TRUE

is returned.

Functionality

Timer (timer mode)

Reference

__EnableTimer

,

__DestroyTimer

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 ){}

void func( void )
{
/* Set up timer A0 as timer mode */
__CreateTimer(

RAPI_TIMER_A0|RAPI_TIMER_ON|RAPI_F8,

5,

0x80,

0,

TimerIntFunc );

}