SC200L How to detect gpiochip by gpio pin

Hi everyone
I’m coding to control gpio using gpiod library
In the dev folder i see 6 gpiochipx files from gpiochip0 to gpiochip5
So how do i know which file to open to use for gpio pin, for example gpio89
Thanks

Hi,
You can control the gpios in gpiochip160
For gpio89, you can do as follows:
cd /sys/class/gpio/
echo 249 > export
cd gpio249
echo out > direction
echo 1 > value
echo 0 > value

Dear Zheng
i use “echo 249 > export” common and get Permission denied
Then I use the su command and it works.
I checked the export file is not grant permission. How to grant permissions for export file

image

Hi,
The method I provide is just for quick testing and needs root permission.
The better way is to export GPIO in rc file.
What’s the Android version you are using

Thanks

Dear Zheng
I am using Android version 12
Does that mean I need to edit some files and recompile the operating system?