User`s manual
RX62N Group, RX621 Group 4. Library Reference
4) R_IIC_MasterReceive
Synopsis
Read data from a slave device.
Prototype
bool R_IIC_MasterReceive(
uint8_t data1,
// Channel selection
uint16_t data2,
// Channel configuration
uint16_t data3,
// Slave address
uint8_t * data4,
// Data start address
uint16_t data5,
// Receive threshold
void * func,
// Callback function
uint8_t data6
// Interrupt priority level
);
Description
Read data over an I²C channel and store it.
[data1]
Select channel IICn (where n = 0 or 1).
[data2]
Configure the channel.
The default setting is shown in bold. Specify PDL_NO_DATA to use the defaults.
•
Slave address size override
PDL_IIC_10_BIT_SLAVE_ADDRESS
Specify this option if 10-bit address mode is to be
used instead of 7-bit mode when the slave address is
≤ FFh.
•
DMAC / DTC trigger control
PDL_IIC_DMAC_DTC_TRIGGER_DISABLE or
PDL_IIC_DMAC_TRIGGER_ENABLE or
PDL_IIC_DTC_TRIGGER_ENABLE
Disable or enable activation of the DMAC or
DTC when a data byte is received.
[data3]
The address of the slave device.
[data4]
The start address of the storage area for the expected data.
Specify PDL_NO_PTR if no data shall be processed by this function e.g. if the DMAC or DTC shall
be used to process the received data.
[data5]
The number of bytes that must be received before the function completes or the callback function is
called.
If the DMAC or DTC shall be used to handle the received data, specify PDL_NO_DATA.
[func]
Specify PDL_NO_FUNC or a callback function name, depending on the required transfer method.
Transfer method
Parameter
Polling
PDL_NO_FUNC. This function will continue until the required number of
bytes has been received (or another event occurs).
Interrupts
The function to be called when bus activity has stopped.
DMAC
Either the function to be called when each byte is received, or
PDL_NO_FUNC if the callback function specified in R_DMAC_Create will be
used.
DTC
The function to be called at the interval specified in R_DTC_Create.
[data6]
The interrupt priority level. Select between 1 (lowest priority) and 15 (highest priority).
This parameter will be ignored if PDL_NO_FUNC is specified for parameter func.
Return value
True if all parameters are valid, exclusive and achievable; otherwise false.
R20UT0084EE0112 Rev.1.12 Page 4-195
July. 16, 2014