NotePublic/Software/Applications/I2C/Linux_下_I2C_工具.md

13 lines
344 B
Markdown
Raw Normal View History

# Linux 下 I2C 工具
```bash
# 检测 I2C 设备
i2cdetect -y -r <bus num>
# 设置 I2C 设备寄存器值
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]]
# Dump I2C 设备寄存器
i2cdump -f -y <bus num> <dev addr> [b/w/W/s/i/c]
```