I2CDETECT(8) I2CDETECT(8)
NAME
i2cdetect - detect I2C chips
SYNOPSIS
i2cdetect [-y] [-a] [-q|-r] i2cbus [first last]
i2cdetect -F i2cbus
i2cdetect -V
i2cdetect -l
DEscRIPTION
i2cdetect is a userspace program to scan an I2C bus for devices. It outputs a table with the list of detected devices on the specified bus.
i2cbus indicates the number or name of the I2C bus to be scanned, and should correspond to one of the busses listed by i2cdetect -l. The optional parameters first and last restrict the scanning range (default: from 0x03 to 0x77).
i2cdetect can also be used to query the functionalities of an I2C bus (see option -F.)
i2cdetect 는 I2C 버스장치를 스캔하기 위한 유저공간 프로그램이다
지정된 버스에 감지장치의 목록과 테이블을 출력한다. I2C 버스는 검색한 I2C 버스의 이름이나 숫자를 표시하고 i2cdetect -l 명령어를 통해서 리스트가 나타난다.
※ 보통 I2C 장치는 커널드라이버가 컨트롤하며 유저공간에서 /dev 인터페이스를 통해 어댑터에 있는 모든 디바이스를 접근하며 i2c-dev 모듈이 필요하다.
등록된 i2c 어댑터는 0번부터 시작하며 어떤 번호가 매겨져있는지는 /sys/class/i2c-dev 를 통해서 확인가능하다.
아니면 i2cdetect -l 명령어를 통해서 시스템내에 존재하는 모든 i2c 어댑터의 리스트들을 확인가능하다.
i2cdetect 는 i2c-tools 패키지의 일부분이다.
[root@localhost i2c-tools-3.0.2]# i2cdetect -l
i2c-0 smbus SMBus I801 adapter at 0400 SMBus adapter
/sys/class/i2c-dev 디렉토리를 확인해보면 i2cdetect -l 을 통해서 얻어진 결과값이랑 같으며 아댑터번호는 동적으로 할당된다.
[root@i2c-dev]# i2cdetect -l
i2c-0 smbus SMBus2 AMD8111 adapter at cc00 SMBus adapter
i2c-1 smbus SMBus AMD8111 adapter at 10e0 SMBus adapter
[root@dec-dev]# pwd
/sys/class/i2c-dev
[root@i2c-dev]# ls -al
합계 0
drwxr-xr-x 4 root root 0 2010-11-18 15:12 .
drwxr-xr-x 30 root root 0 2010-11-18 15:12 ..
drwxr-xr-x 3 root root 0 2010-11-18 15:12 i2c-0
drwxr-xr-x 3 root root 0 2010-11-18 15:12 i2c-1
[root@localhost i2c-0]# ls -al
합계 0
drwxr-xr-x 3 root root 0 2010-11-18 15:12 .
drwxr-xr-x 4 root root 0 2010-11-18 15:12 ..
-r--r--r-- 1 root root 4096 2010-11-18 15:12 dev
lrwxrwxrwx 1 root root 0 2010-11-18 15:12 device -> ../../../devices/pci0000:00/0000:00:07.2
-r--r--r-- 1 root root 4096 2010-11-18 15:13 name
drwxr-xr-x 2 root root 0 2010-11-18 15:13 power
lrwxrwxrwx 1 root root 0 2010-11-18 15:17 subsystem -> ../../i2c-dev
-rw-r--r-- 1 root root 4096 2010-11-18 15:13 uevent
WARNING
This program can confuse your I2C bus, cause data loss and worse!
INTERPRETING THE OUTPUT
Each cell in the output table will contain one of the following symbols:
· "--". The address was probed but no chip answered.
· "UU". Probing was skipped, because this address is currently in use by a driver. This strongly suggests that there is a chip at this address.
· An address number in hexadecimal, e.g. "2d" or "4e". A chip was found at this address.
OPTIONS
-y Disable interactive mode. By default, i2cdetect will wait for a confirmation from the user before messing with the I2C bus. When this flag is used, it will perform the opera-
tion directly. This is mainly meant to be used in scripts.
-a Force scanning of non-regular addresses. Not recommended.
-q Use SMBus "quick write" commands for probing (by default, the command used is the one believed to be the safest for each address). Not recommended. This is known to corrupt
the Atmel AT24RF08 EEPROM found on many IBM Thinkpad laptops.
-r Use SMBus "read byte" commands for probing (by default, the command used is the one believed to be the safest for each address). Not recommended. This is known to lock SMBus
on various write-only chips (most notably clock chips at address 0x69).
-F Display the list of functionalities implemented by the adapter and exit.
-V Display the version and exit.
-l Output a list of installed busses.
SEE ALSO
i2cdump(8), sensors-detect(8)
AUTHOR
Frodo Looijaard, Mark D. Studebaker and Jean Delvare
This manual page was originally written by Aurelien Jarno <aurel32@debian.org>, for the Debian GNU/Linux system.
April 2008 I2CDETECT(8)