Linux deployment, 1 i2c driver, 2 detect i2c device – Artesyn COMX-P2020 BSP User Guide (July 2014) User Manual

Page 99: 1 i2c driver 7.2 detect i2c device, Chapter 7

Advertising
background image

Chapter 7

COMX-P2020 BSP User Guide (6806800L84B)

99

Linux Deployment

7.1

I2C Driver

The Linux has already included the driver of I2C bus. The device can be accessed through the
file: /dev/i2c-0 /dev/i2c-1

[root@COMX-P2020 /]# ls /dev/i2c*

/dev/i2c-0 /dev/i2c-1

7.2

Detect I2C Device

The application "i2cdetect" can be used to detect the devices on the i2c bus.

To Detect the devices on I2C bus 0:

[root@COMX-P2020 /]# /usr/sbin/i2cdetect 0

WARNING! This program can confuse your I2C bus, cause data loss and

worse!

I will probe file /dev/i2c-0.

I will probe address range 0x03-0x77.

Continue? [Y/n] y

0 1 2 3 4 5 6 7 8 9 a b c d e f

00: -- -- -- -- -- -- -- -- -- -- -- -- --

10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

50: 50 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

70: 70 -- -- -- -- -- -- --

[root@COMX-P2020 /]#

To Detect the devices on I2C bus 1:
[root@COMX-P2020 /]# /usr/sbin/i2cdetect 1

WARNING! This program can confuse your I2C bus, cause data loss

and worse!

I will probe file /dev/i2c-1.

I will probe address range 0x03-0x77.

Continue? [Y/n] y

0 1 2 3 4 5 6 7 8 9 a b c d e f

00: -- -- -- -- -- -- -- -- -- -- -- -- --

10: -- -- -- -- -- -- -- -- -- -- -- 1b -- -- -- --

Advertising