User`s manual

RX62N Group, RX621 Group 5. Usage Examples
/* Prepare the next data */
R_DMAC_Control(
2,
PDL_DMAC_SUSPEND | PDL_DMAC_ENABLE | \
PDL_DMAC_UPDATE_DESTINATION | PDL_DMAC_UPDATE_COUNT,
PDL_NO_PTR,
&data_storage[5],
5,
PDL_NO_DATA,
PDL_NO_DATA,
PDL_NO_DATA,
PDL_NO_DATA
);
/* Read data from the EEPROM on channel 1, using the DMAC */
read_eeprom_data();
}
static void write_eeprom_data(void)
{
bus_busy = true;
/* Send data to the EEPROM on channel 1, using the DMAC */
R_IIC_MasterSend(
0,
PDL_IIC_DMAC_TRIGGER_ENABLE,
EEPROM_ADDRESS,
PDL_NO_PTR,
0,
PDL_NO_FUNC,
0
);
while (bus_busy == true);
/* Wait for 5ms while the EEPROM updates */
R_CMT_CreateOneShot(
0,
0,
5E-3,
PDL_NO_FUNC,
0
);
}
static void read_eeprom_data(void)
{
bus_busy = true;
/* Read data from the EEPROM on channel 1, using the DMAC */
R_IIC_MasterReceive(
0,
PDL_IIC_DMAC_TRIGGER_ENABLE,
EEPROM_ADDRESS,
PDL_NO_PTR,
0,
PDL_NO_FUNC,
0
);
while (bus_busy == true);
}
R20UT0084EE0112 Rev.1.12 Page 5-53
July. 16, 2014