Download Renesas Embedded Application Programming Interface User`s
Transcript
Library Reference
4
4.2.2
Description (3/3)
Timer MTU2
__SetInputCapturePin
• Selectable parameters when RAPI_MTU2_5 is specified:
(Capture channel)
Specify one from { RAPI_MTU2_5U, RAPI_MTU2_5V,
RAPI_MTU2_5W }.
(Capture edge)
Specify one from { RAPI_RISING_CAP_5,
RAPI_FALLING_CAP_5, RAPI_BOTH_CAP_5,
RAPI_TCNT1_CAP }.
(Interrupt enable)
Specify one from { RAPI_CAPTURE_ENA,
RAPI_CAPTURE_DIS }
The default value is RAPI_CAPTURE_DIS.
(Interrupt priority level)
Specify one from { RAPI_TIMER_INT_LV_0,
RAPI_TIMER_INT_LV_1, RAPI_TIMER_INT_LV_2,
RAPI_TIMER_INT_LV_3, RAPI_TIMER_INT_LV_4,
RAPI_TIMER_INT_LV_5, RAPI_TIMER_INT_LV_6,
RAPI_TIMER_INT_LV_7, RAPI_TIMER_INT_LV_8,
RAPI_TIMER_INT_LV_9, RAPI_TIMER_INT_LV_10,
RAPI_TIMER_INT_LV_11, RAPI_TIMER_INT_LV_12,
RAPI_TIMER_INT_LV_13, RAPI_TIMER_INT_LV_14,
RAPI_TIMER_INT_LV_15 }.
The default value is RAPI_TIMER_INT_LV_0.
[func]
For func, specify a pointer to callback function. If this pointer is not specified, set RAPI_NULL.
Return value
If the specification of timer is invalid, RAPI_FALSE is returned; otherwise, RAPI_TRUE is
returned.
Category
Timer MTU2 (input capture mode)
Reference
__EnableInputCapture, __DestroyInputCapture, __GetCaptureValue
Remark
If an undefined value is specified in the first 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 TGRA for MTU2 channel 0 as input capture pin */
__SetInputCapturePin( RAPI_MTU2_0 | RAPI_TIOCA |
RAPI_RISING_CAP_0 | RAPI_CAPTURE_ENA |
RAPI_TIMER_INT_LV_3, TimerIntFunc);
}
Rev.1.01 Aug. 27, 2008
REJ10J1906-0101
4-84