This is my understanding of I2C on the RTL872x chip:
- There are two groups of I2C pins, corresponding to two hardware I2C peripherals
-
I2C0/LP_I2Cgroup- SCL: PA_25 / PA_31 / PB_5
- SDA: PA_26 / PB_0 / PB_6
-
USI_I2Cgroup- SCL: PA_23 / PB_20 / PB_24
- SDA: PA_24 / PB_21 / PB_25
-
- Within a group, you can choose one pin for SCL and one pin for SDA. Pins will not work across groups as they are physically connected to different I2C peripherals.
- The USI peripheral is a multi-function serial peripheral that can be configured for either I2C, SPI or UART, hence it has different code for using it as I2C.
You can refer to the pinmux document for the various pin functions.
For pin configuration, you can refer to the examples for configuration using Mbed API or Pinmux_config.
For using the USI_I2C peripheral, the peripheral HAL header file shows how to use it.