User`s manual
RX62N Group, RX621 Group 4. Library Reference
Reference
R_MTU2_ControlChannel
Remarks
•
Either this function or R_MTU2_ControlChannel must be used to start the timers.
•
The Stop operation is executed at the start of this function.
The Start operation is executed at the end.
Therefore, both options can be selected together with other changes in one function call.
•
The register access enable operation is executed at the start of this function.
The register access disable operation is executed at the end.
Therefore, both options can be selected together with other changes in one function call.
Program example
/* RPDL definitions */
#include "r_pdl_mtu2.h"
/* RPDL device-specific definitions */
#include "r_pdl_definitions.h"
void func(void)
{
/* Allocate a copy of the structure for the selected channel */
R_MTU2_ControlUnit_structure unit0_parameters;
/* Set the control options for unit 0 */
unit0_parameters.data2 = PDL_MTU2_START_CH_0 | PDL_MTU2_START_CH_1;
unit0_parameters.data3 = PDL_MTU2_OUT_P_PHASE_ALL_HIGH_LOW;
unit0_parameters.data6 = PDL_MTU2_DEAD_TIME_ENABLE;
unit0_parameters.data7 = PDL_MTU2_REGISTER_DEAD_TIME |
PDL_MTU2_REGISTER_CYCLE_DATA;
unit0_parameters.data8 = 0xFFDD;
unit0_parameters.data9 = 0x0100;
/* Modify the operation of unit 0 */
R_MTU2_ControlUnit(
0,
&unit0_parameters
);
}
R20UT0084EE0112 Rev.1.12 Page 4-109
July. 16, 2014