Copyright 2017. All rights reserved. Advantech Co. Ltd.
Page 35
i2c-2 i2c i915 gmbus misc I2C adapter
i2c-0 i2c i915 gmbus dpb I2C adapter
i2c-5 smbus SMBus I801 adapter at f040 SMBus adapter
*Please note the bus number could be different due to different hardware configuration,
kernel version and driver of other devices.
Step 2
: Confirm IO expander device appears on the smbus.
Scan the devices on smbus which is got in step 1, and smbus I/O expander appears at 0x20
# i2cdetect -y 5
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- 08 -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- 18 -- -- -- -- -- -- --
20:
20
-- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: 30 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- 44 -- -- -- -- -- -- -- -- -- -- --
50: 50 -- -- -- -- -- 56 -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
IO expander device address is 0x20 (7-bit address) in this system.
*Please note device address might be different due to hardware configuration and product
SKU.
3.7.1.1
I2c raw command to control led
Here shows how to control LEDs using i2c raw command, it will use smbus number and
device address of IO expander located in previous chapter.
Step 1
: Set pins to output mode, this need be done once every time Linux booted.
# i2cset -y 5 0x20 0x03 0xfc
Here “5” is smbus number and “0x20” is device address. “0x03” is offset and “0xfc” is value,
combined to set GPIO pin 0 and pin 1 to output mode. “0xfc” is hex of binary “1111 1100”,
which means pin 0 and 1 is set to bit “0” (output mode).
*Please note pin number could be different due to hardware configuration, product SKU.
For FWA-T011-4CA1S, pin mapping are defined as below.
PIN
LED Name
Usage