User`s manual

RX62N Group, RX621 Group 4. Library Reference
8) R_IIC_Control
Synopsis
I²C channel control.
Prototype
bool R_IIC_Control(
uint8_t data1,
// Channel selection
uint8_t data2
// Control options
);
Description
Modify the operation of the selected I²C channel.
[data1]
Select channel IICn (where n = 0 or 1).
[data2]
Control the channel. If multiple selections are required, use "|" to separate each selection.
Stop generation
PDL_IIC_STOP
Issue a Stop condition.
NACK generation
PDL_IIC_NACK
Set the Acknowledge bit to the NACK state.
Pin control
PDL_IIC_SDA_LOW or
PDL_IIC_SDA_HI_Z
Set the SDA pin to low level or high-impedance.
PDL_IIC_SCL_LOW or
PDL_IIC_SCL_HI_Z
Set the SCL pin to low level or high-impedance.
Extra clock cycle generation
PDL_IIC_CYCLE_SCL
Generate an extra clock cycle on the SCL pin. This can be used in
Master mode to try and unlock a slave device that is holding the SDA
signal low.
Reset control
PDL_IIC_RESET
Carry out an internal reset of the I²C module (the settings are
preserved).
Return value
True if all parameters are valid, exclusive and achievable; otherwise false.
Category
I²C
Reference
R_IIC_Create
Remarks
None.
Program example
/* RPDL definitions */
#include "r_pdl_iic.h"
/* RPDL device-specific definitions */
#include "r_pdl_definitions.h"
void func(void)
{
/* Issue a Stop condition on channel 0 */
R_IIC_Control(
0,
PDL_IIC_STOP
);
}
R20UT0084EE0112 Rev.1.12 Page 4-201
July. 16, 2014