User`s manual

RX62N Group, RX621 Group 4. Library Reference
4.2.22. C Bus Interface
1) R_IIC_Create
Synopsis
I²C channel setup.
Prototype
bool R_IIC_Create(
uint8_t data1,
// Channel selection
uint32_t data2,
// Channel configuration
uint32_t data3,
// Detection configuration
uint16_t data4,
// Slave address
uint16_t data5,
// Slave address
uint16_t data6,
// Slave address
uint32_t data7,
// Transfer rate control
uint32_t data8
// Rise and fall time correction
);
Description (1/3)
Set up the selected I²C channel.
[data1]
Select channel IICn (where n = 0 or 1).
[data2]
Configure the channel. If multiple selections are required, use "|" to separate each selection.
The default settings are shown in bold.
Bus mode selection
PDL_IIC_MODE_IIC or
PDL_IIC_MODE_IIC_FMP or
PDL_IIC_MODE_SMBUS
Choose between I²C Bus,
I²C Bus with Fast-mode Plus (for data rate > 400 kbps) or
SMBus mode.
Internal reference clock
PDL_IIC_INT_PCLK_DIV_1 or
PDL_IIC_INT_PCLK_DIV_2 or
PDL_IIC_INT_PCLK_DIV_4 or
PDL_IIC_INT_PCLK_DIV_8 or
PDL_IIC_INT_PCLK_DIV_16 or
PDL_IIC_INT_PCLK_DIV_32 or
PDL_IIC_INT_PCLK_DIV_64 or
PDL_IIC_INT_PCLK_DIV_128
The reference clock source, used inside the I²C module.
Timeout detection control
PDL_IIC_TIMEOUT_DISABLE or
PDL_IIC_TIMEOUT_LOW or
PDL_IIC_TIMEOUT_HIGH or
PDL_IIC_TIMEOUT_BOTH
Disable timeout detection, or enable for SCL stuck at a
low level
high level or
both low and high level.
Timeout mode
PDL_IIC_TIMEOUT_LONG or
PDL_IIC_TIMEOUT_SHORT
Select 16-bit (long) or
14-bit (short) mode.
SDA output delay count
PDL_IIC_SDA_DELAY_0 or
PDL_IIC_SDA_DELAY_1 or
PDL_IIC_SDA_DELAY_2 or
PDL_IIC_SDA_DELAY_3 or
PDL_IIC_SDA_DELAY_4 or
PDL_IIC_SDA_DELAY_5 or
PDL_IIC_SDA_DELAY_6 or
PDL_IIC_SDA_DELAY_7
Select the number of cycles for the SDA output delay
counter.
SDA output delay clock source
PDL_IIC_SDA_DELAY_DIV_1 or
PDL_IIC_SDA_DELAY_DIV_2
Select the clock source (internal reference clock ÷ 1 or ÷ 2)
for the SDA output delay counter.
R20UT0084EE0112 Rev.1.12 Page 4-187
July. 16, 2014