Software Defined Led; Locate I2C Bus Of Io Expander - Advantech FWA-T011 Getting Started Manual

Quickstart linux image
Hide thumbs Also See for FWA-T011:
Table of Contents

Advertisement

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.
LED Name
(Left to Right)
1
Power led
2
Storage led
3
4G LTE led
4
WiFi led
5
SW Defined led
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-1 i2c
i915 gmbus dpc
i2c-4 i2c
DPDDC-C
Copyright 2017. All rights reserved. Advantech Co. Ltd.
Software
Pin
Controllable
No
No
No
No
Yes
0,1 (Red/Green)
I2C adapter
I2C adapter
I2C adapter
Page 34

Advertisement

Table of Contents
loading

Table of Contents