
Rev.1.00 May 22 2012
REJ09B0566
3BLibrary Reference
R_MTU_CreateChannel
4
4.2.7 Multi Function Timer
Remarks (2/2) • A callback function is executed by the interrupt processing function. This means that no other interrupt
can be processed until the callback function has completed.
• If the requested period is not a multiple of the minimum period, the actual time period will be more than
the requested time period.
Program example
/* PDL definitions */
#include “r_pdl_cmt.h”
/* PDL device-specific definitions */
#include “r_pdl_definitions.h”
void func(void)
{
/* Configure CMT channel 0 for 10µs operation */
R_CMT_Create(
0,
PDL_CMT_PERIOD,
10E-6,
PDL_NO_FUNC,
0
);
/* Configure CMT channel 1 for 1KHz operation */
R_CMT_Create(
1,
PDL_CMT_FREQUENCY,
1E3,
PDL_NO_FUNC,
0
);
/* Configure CMT channel 2 using register values */
R_CMT_Create(
2,
PDL_CMT_PCLK_DIV_32,
0x55AA,
PDL_NO_FUNC,
0
);
}
Kommentare zu diesen Handbüchern