i2c
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| i2c [2018/08/03 05:27] – 外部编辑 127.0.0.1 | i2c [2025/10/14 06:22] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| 固件内置了i2ctools软件包 | 固件内置了i2ctools软件包 | ||
| - | 等待添加 | + | ===1. 用i2cdetect -l 命令来列出所有I2C总线=== |
| + | <code bash> | ||
| + | root@Widora:/# | ||
| + | i2c-0 | ||
| + | </ | ||
| + | |||
| + | ===2. 用i2cdetect -F 0 来查看I2C 0号总线启用的功能=== | ||
| + | <code bash> | ||
| + | root@Widora:/# | ||
| + | Functionalities implemented by / | ||
| + | I2C yes | ||
| + | SMBus Quick Command | ||
| + | SMBus Send Byte yes | ||
| + | SMBus Receive Byte yes | ||
| + | SMBus Write Byte yes | ||
| + | SMBus Read Byte yes | ||
| + | SMBus Write Word yes | ||
| + | SMBus Read Word yes | ||
| + | SMBus Process Call yes | ||
| + | SMBus Block Write yes | ||
| + | SMBus Block Read no | ||
| + | SMBus Block Process Call no | ||
| + | SMBus PEC yes | ||
| + | I2C Block Write yes | ||
| + | I2C Block Read yes | ||
| + | </ | ||
| + | |||
| + | ===3. 查看I2C 0号总线上挂载的设备=== | ||
| + | <code bash> | ||
| + | root@Widora:/# | ||
| + | | ||
| + | 00: -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
| + | 10: -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- -- | ||
| + | 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
| + | 30: -- -- -- -- UU -- -- -- -- -- -- -- -- -- -- -- | ||
| + | 40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- -- | ||
| + | 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
| + | 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
| + | 70: -- -- -- -- -- -- -- -- | ||
| + | </ | ||
| + | 其中标识为UU的设备(地址分别为0x1a和0x34)表示内核已经加载了相应的驱动,而地址为0x48的I2C设备尚未被内核所驱动。 | ||
| + | |||
| + | ===4. 在sysfs文件中可查看已被内核驱动的I2C设备的名称=== | ||
| + | <code bash> | ||
| + | root@Widora:/# | ||
| + | 0-001a | ||
| + | root@Widora:/# | ||
| + | wm8960 | ||
| + | root@Widora:/# | ||
| + | codec_wm8960 | ||
| + | </ | ||
| + | |||
| + | ===5. 用i2cdump -y 0 0x48 W 命令来读取地址为0x48的I2C设备(LM75温度传感器)所有寄存器中的内容=== | ||
| + | <code bash> | ||
| + | root@Widora:/# | ||
| + | | ||
| + | 00: 1e 00 4b 00 ff ff ff ff 1e 00 4b 00 ff ff ff ff ? | ||
| + | 10: 1e 00 4b 00 ff ff ff ff 1e 00 4b 00 ff ff ff ff ? | ||
| + | 20: 1e 00 4b 00 ff ff ff ff 1e 00 4b 00 ff ff ff ff ? | ||
| + | 30: 1e 00 4b 00 ff ff ff ff 1e 00 4b 00 ff ff ff ff ? | ||
| + | 40: 1e 00 4b 00 ff ff ff ff 1e 00 4b 00 ff ff ff ff ? | ||
| + | 50: 1e 00 4b 00 ff ff ff ff 1e 00 4b 00 ff ff ff ff ? | ||
| + | 60: 1e 00 4b 00 ff ff ff ff 1e 00 4b 00 ff ff ff ff ? | ||
| + | </ | ||
| + | |||
| + | ===6. 用i2cget -y 0 0x48 0 w 命令来读取地址为0x48的I2C设备0号寄存器中的内容=== | ||
i2c.1533274052.txt.gz · Last modified: (external edit)
