User`s manual
RX62N Group, RX621 Group 4. Library Reference
7) R_IIC_SlaveSend
Synopsis
Write data to a master device.
Prototype
bool R_IIC_SlaveSend(
uint8_t data1,
// Channel selection
uint8_t * data2,
// Data start address
uint16_t data3
// Data count
);
Description
Transmit data on the specified channel.
[data1]
Select channel IICn (where n = 0 or 1).
[data2]
The start address of the data to be sent.
[data3]
The number of bytes available to be sent.
Return value
True if all parameters are valid, exclusive and achievable; otherwise false.
If this function is not called from the R_IIC_SlaveMonitor callback function, it will complete when a
stop condition is detected.
Category
I²C
Reference
R_IIC_SlaveMonitor
Remarks
•
Use this function in conjunction with R_IIC_SlaveMonitor.
•
If the master requires more data than is supplied, and polling or interrupt-based transfers are
used, this function shall loop back to the start of the data. The transmitted byte count will also be
reset to 0.
Program example
/* RPDL definitions */
#include "r_pdl_iic.h"
/* RPDL device-specific definitions */
#include "r_pdl_definitions.h"
const uint8_t data_array[5] = {0x23, 0x48, 0x59, 0x60, 0xFE};
void func(void)
{
/* Assign 5 bytes to be read by a master on channel 0 */
R_IIC_SlaveSend(
0,
data_array,
5
);
}
R20UT0084EE0112 Rev.1.12 Page 4-200
July. 16, 2014