2020-09-10 14:02:16 +08:00
|
|
|
# Linux 下 I2C 工具
|
|
|
|
|
|
|
|
```bash
|
|
|
|
# 检测 I2C 设备
|
2020-09-10 14:32:29 +08:00
|
|
|
i2cdetect -y -r <bus num>
|
2020-09-10 14:02:16 +08:00
|
|
|
# 设置 I2C 设备寄存器值
|
2020-09-10 14:32:29 +08:00
|
|
|
i2cset -f -y <bus num> <dev addr> <reg addr> <value>...[c/b/w/i/s]
|
|
|
|
# 读取 I2C 设备寄存器的值
|
|
|
|
i2cget -f -y <bus num> <dev addr> [reg addr[b/w/c]]
|
2020-09-10 14:02:16 +08:00
|
|
|
# Dump I2C 设备寄存器
|
2020-09-10 14:32:29 +08:00
|
|
|
i2cdump -f -y <bus num> <dev addr> [b/w/W/s/i/c]
|
2020-09-10 14:02:16 +08:00
|
|
|
```
|