User`s manual
RX62N Group, RX621 Group 5. Usage Examples
2) Reception
I²C channel 1 will be configured for Master operation and used to read four bytes from a slave device.
Figure 5-28: The bus activity, showing 4 bytes being transmitted by the EEPROM
/* Read data from the EEPROM, using polling */
if (R_IIC_MasterReceive(
0,
PDL_NO_DATA,
EEPROM_ADDRESS,
data_storage,
4,
PDL_NO_FUNC,
0
) == false)
{
/* Read the channel and transfer status */
R_IIC_GetStatus(
0,
&status_flags,
PDL_NO_PTR,
&RxChars
);
/* Review the flags and transmit count to decide on the next action */
}
Figure 5-29: An example of reading data from the EEPROM
S
Slave address
A
Data
A
P
R
Data
A
Data
A
Data
A
R20UT0084EE0112 Rev.1.12 Page 5-49
July. 16, 2014