User`s manual
RX62N Group, RX621 Group 4. Library Reference
Category
I²C
Reference
R_IIC_Create, R_IIC_GetStatus, R_IIC_MasterReceiveLast
Remarks
•
If a callback function is specified, reception interrupts are used.
Please see the notes on callback function usage in §6.
•
If the previous transfer did not issue a Stop condition, a Repeated Start condition shall be
generated.
•
The last byte to be read shall be completed with a NACK signal.
•
If no callback function is specified, this function will operate in polling mode.
The status flags will be used to manage the data reception.
If the I²C channel’s control registers are directly modified by the user, this function may lock up.
If an error occurs during this polling process, the function will terminate.
•
If the DMAC or DTC is used, use R_IIC_MasterReceiveLast to complete the transfer.
•
Use R_IIC_GetStatus to determine if the transfer was successful.
•
False will be returned if the DMAC channel has not been allocated using R_DMAC_Create.
•
Using PDL_IIC_10_BIT_SLAVE_ADDRESS in Polling mode.
Program example
/* RPDL definitions */
#include "r_pdl_iic.h"
/* RPDL device-specific definitions */
#include "r_pdl_definitions.h"
volatile uint8_t data_array[5];
void func(void)
{
/* Read 5 bytes from device 0xAA on channel 1, using polling */
R_IIC_MasterReceive(
1,
PDL_NO_DATA,
0xAA,
data_array,
5,
PDL_NO_FUNC,
0
);
}
R20UT0084EE0112 Rev.1.12 Page 4-196
July. 16, 2014