← 返回命令列表

Linux command

i2cdetect 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Example

i2cdetect -l

Scan devices

i2cdetect -y 1

Scan using SMBus quick write

i2cdetect -y -q 1

Scan using SMBus read byte

i2cdetect -y -r 1

Scan all addresses

i2cdetect -y -a 1

Display adapter functionality

i2cdetect -F 1

说明

i2cdetect scans I2C buses to detect connected devices. It's commonly used for debugging I2C hardware, identifying device addresses, and verifying hardware connections on embedded systems and single-board computers. The output is a grid showing addresses 0x00-0x7f. Detected devices show their address, while empty positions show "--". Addresses marked "UU" are in use by a kernel driver. On Raspberry Pi and similar boards, I2C is often used for sensors, displays, and other peripherals. Common devices include: - 0x27/0x3f - LCD displays - 0x48-0x4f - Temperature sensors - 0x50-0x57 - EEPROMs - 0x68 - Real-time clocks

参数

-l
List available I2C buses
-y
Disable interactive mode (no confirmation prompt)
-a
Scan all addresses (0x00-0x7f instead of 0x03-0x77)
-q
Use SMBus quick write commands for probing
-r
Use SMBus read byte commands for probing
-F
Display functionality of the adapter

FAQ

What is the i2cdetect command used for?

i2cdetect scans I2C buses to detect connected devices. It's commonly used for debugging I2C hardware, identifying device addresses, and verifying hardware connections on embedded systems and single-board computers. The output is a grid showing addresses 0x00-0x7f. Detected devices show their address, while empty positions show "--". Addresses marked "UU" are in use by a kernel driver. On Raspberry Pi and similar boards, I2C is often used for sensors, displays, and other peripherals. Common devices include: - 0x27/0x3f - LCD displays - 0x48-0x4f - Temperature sensors - 0x50-0x57 - EEPROMs - 0x68 - Real-time clocks

How do I run a basic i2cdetect example?

Run `i2cdetect -l` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -l do in i2cdetect?

List available I2C buses