FWA-2112 User Manual
12
New add PCA9548 device. And you will see new i2c busses 9~16 refer to PCA9548
channel 1 ~ 8.
4.
Add IO expander device to gpio sysfs.
“i2c-16” is target to smbus number 16 and “0x23” is device address. “pca9555” is
name of this IO expander.
5.
GPIO base-port file under /sys/class/gpio (gpiochip342) appears after device
are added. However there might be several other gpio base port file, so it’s nec
-
essary to locate which gpio base-port file.
Check gpio port files can get gpio base and pins.
Please note gpio numbers like 342 depends on kernel and hardware platform, thus it
could be different.
6.
Expose the GPIO pins and set it to output mode.
# sudo echo pca9555 0x23 > /sys/bus/i2c/devices/i2c-16/new_device
# for L in `ls /sys/class/gpio/gpio*/label`; do echo $L; cat $L; done
/sys/class/gpio/gpiochip342/label
pca9555
/sys/class/gpio/gpiochip358/label
INTC3000:00
# cat /sys/class/gpio/gpiochip342/base
342
# cat /sys/class/gpio/gpiochip342/ngpio
16
# echo 342 > /sys/class/gpio/export
# echo 343 > /sys/class/gpio/export
# echo 344 > /sys/class/gpio/export
# echo 345 > /sys/class/gpio/export
# echo 346 > /sys/class/gpio/export
# echo 347 > /sys/class/gpio/export
# echo 348 > /sys/class/gpio/export
# echo 349 > /sys/class/gpio/export
# echo 350 > /sys/class/gpio/export
# echo 351 > /sys/class/gpio/export
# echo 352 > /sys/class/gpio/export
# echo 353 > /sys/class/gpio/export
# echo 354 > /sys/class/gpio/export
# echo 355 > /sys/class/gpio/export
# echo 356 > /sys/class/gpio/export
# echo 357 > /sys/class/gpio/export
# echo out > /sys/class/gpio/gpio342/direction
# echo out > /sys/class/gpio/gpio343/direction
# echo out > /sys/class/gpio/gpio344/direction
# echo out > /sys/class/gpio/gpio345/direction
# echo out > /sys/class/gpio/gpio346/direction