| 5 - I2C Operations
Tip:
0 is the I2C bus number.
Result:
Figure 5-4 Example Output
In this figure, the detected devices are
0x29
,
0x48
,
0x5c
,
0x68
, and
0x70
.
3. Execute the following command to read register content:
i2cget -f -y 0 0x5c 0x0f
Tip:
◦
0
: I2C bus number
◦
0x5c
: I2C device address
◦
0x0f
: Memory address
Result:
Figure 5-5 Example Output
The register content is
0xb1
in this output.
4. Execute the following command to write register data:
i2cset -y 0 0x5c 0x11 0x10
Tip:
◦
0
: I2C bus number.
◦
0x5c
: I2C device address.
◦
0x11
: Memory address.
◦
0x10
: The content to be written in the register.
5. Execute the following to read all register values:
i2cdump -y 0 0x5c
© 2018-2022 StarFive Technology
All rights reserved
18
StarFive