User`s manual
RX62N Group, RX621 Group 5. Usage Examples
eeprom_data_array_1,
(uint8_t *)&RIIC0.ICDRT,
6,
PDL_NO_DATA
);
/* Set up a DTC channel for IIC reception */
R_DTC_Create(
PDL_DTC_NORMAL | \
PDL_DTC_SOURCE_ADDRESS_FIXED | PDL_DTC_DESTINATION_ADDRESS_PLUS | \
PDL_DTC_SIZE_8 | \
PDL_DTC_IRQ_COMPLETE | \
PDL_DTC_TRIGGER_ICRXI0,
dtc_iic0_rx_transfer_data,
(uint8_t *)&RIIC0.ICDRR,
data_storage,
4,
PDL_NO_DATA
);
/* Select I²C mode at 100kHz, 300ns rise time, 200ns fall time */
R_IIC_Create(
0,
PDL_IIC_MODE_IIC | PDL_IIC_INT_PCLK_DIV_8,
0,
0,
0,
0,
100E3,
(300 << 16) | 200
);
/* Enable the DTC */
R_DTC_Control(
PDL_DTC_START,
PDL_NO_PTR,
PDL_NO_PTR,
PDL_NO_PTR,
PDL_NO_DATA,
PDL_NO_DATA
);
/* Write the data into the EEPROM */
write_eeprom_data();
/* Prepare the next data for the EEPROM */
R_DTC_Control(
PDL_DTC_UPDATE_SOURCE | PDL_DTC_UPDATE_COUNT,
dtc_iic0_tx_transfer_data,
eeprom_data_array_2,
PDL_NO_PTR,
8,
PDL_NO_DATA
);
/* Write the data into the EEPROM */
write_eeprom_data();
/* Clear the data storage area */
for (i = 0; i < 20; i++) data_storage[i] = 0x00;
/* Reset the EEPROM sub-address to 0, using polling */
R_IIC_MasterSend(
0,
PDL_IIC_STOP_DISABLE,
EEPROM_ADDRESS,
eeprom_data_array_1,
1,
R20UT0084EE0112 Rev.1.12 Page 5-56
July. 16, 2014