9
FWA-2112 User Manual
C
ha
pte
r 1
Lin
ux
P
latf
orm
S
oft
w
are
G
uid
e I
ntr
od
uc
tio
n
6.
Confirm IO expander device appears on the smbus.
Scan the devices on smbus which is got in step 3, and set smbus I/O expander
appears at 0x23.
IO expander device address is 0x23 (16-bit address) in this system. Please note
device address might be different due to hardware configuration and product SKU,
please contact Advantech FAE if you have problem with this device address.
For FWA-2112, device address is defined as below:
Now smbus number and device address of IO expander is ready, which will be used
in following controls.
1.3.2.2
I2c Raw Command to Control
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.
1.
Set pins to output mode, this need be done once every time Linux booted.
Here “8” is smbus number and “0x23” is device address. “0x06” and “0x07” are offset
and “0x00” is value, combined to set GPIO pin 0 to pin 15 to output mode. “0x00” is
hex of binary “0000 0000”, which means pin 0 to 7 and pin 8 to 15 is set to bit “0” (out
-
put mode). Please note pin number could be different due to hardware configuration,
product SKU, please contact Advantech FAE if you have problem with this pin map
-
ping.
# i2cdetect -y 8
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- 08 -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- 18 -- -- -- -- -- -- --
20: -- -- -- 23 -- -- -- -- -- -- -- -- -- -- -- --
30: 30 31 -- -- 34 35 36 -- -- -- -- -- -- -- -- --
40: -- -- -- -- 44 -- -- -- -- -- -- -- -- -- -- --
50: 50 -- -- -- -- -- 56 -- 58 -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- 71 -- -- -- -- -- --
Address (16-bit)
Usage
0x23
IO Expander
# sudo i2cset -y 8 0x23 0x06 0x00
# sudo i2cset -y 8 0x23 0x07 0x00