| 5 - I2C Operations
5.1.2. Configuring dts File
7 channels of I2C bus are supported: i2c0 to i2c6.
The DTSI file,
jh7110-visionfive-v2.dtsi
, is under
/linux/arch/riscv/boot/dts/starfive
.
The following is the default setting. You can configure the unoccupied GPIOs as required.
Figure 5-2 Example File Content
Note:
The I2C GPIO pin number is the number indicated in the
Pin Name
. For more details about the GPIO Pin Name, see the
in this document. The pin names of the I2C GPIO are listed as follows:
•
GPIO58 (I2C SDA)
•
GPIO57 (I2C SCL)
5.2. Debugging I2C GPIO
Perform the following steps to debug I2C:
1. Execute the following command to scan the bus:
i2cdetect -l
Result:
Figure 5-3 Example Output
2. Execute the following command to detect the device:
i2cdetect -y -r 0
17
© 2018-2022 StarFive Technology
All rights reserved
StarFive