Copyright 2017. All rights reserved. Advantech Co. Ltd.
Page 34
echo "capture user define button event"> /tmp/usrdefbtn.event
3.7
Software Defined LED
There are 5 LEDs provided on the FWA-T011-4CA1S, and some LEDs can use software to
defined and control , The LEDs are controlled by the IO expander located at smbus, thus the
i2c bus/device for IO expander need to be located first then control LEDs.
For FWA-T011-4CA1S, LEDs are defined as below.
No.
(Left to Right)
LED Name
Software
Controllable
Pin
1
Power led
No
2
Storage led
No
3
4G LTE led
No
4
WiFi led
No
5
SW Defined led
Yes
0,1 (Red/Green)
Green and red LED could be combined to show orange.
For more details about LED Defined , please refer to the FWA-T011 User’s Manual.
There are two interfaces to control LEDs through same hardware path. One is i2c raw
commands which only depends on kernel’s i2c driver, however it requests a user space i2c
tool.
The other interface is kernel’s GPIO sysfs which provide file interface in user space, however,
it have to re-compile kernel if configuring kernel to enable it. Some modern Linux
distribution enabled GPIO sysfs by default like Ubuntu, and some are not like
Fedora/CentOS. Please check CONFIG_GPIO_SYSFS and CONFIG_GPIO_ICH in kernel config
to confirm if GPIO sysfs is enabled. For more details about kernel config and compile, please
refer to
https://kernelnewbies.org/KernelBuild
3.7.1
Locate i2c bus of IO expander
Step 1
: Scan smbus in system by i2cdetect.
Here shows system smbus adapter is located at bus 5.
# i2cdetect -l
i2c-3 i2c DPDDC-B I2C adapter
i2c-1 i2c i915 gmbus dpc I2C adapter
i2c-4 i2c DPDDC-C I2C adapter