Android14上使用libgpiod[gpioinfo gpioget gpioset ...]
环境
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.5 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.5 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
tool下载
https://github.com/technexion-android/platform_external_libgpiod.git https://github.com/technexion-android/platform_external_libgpiod.git%C2%A0android/external$ tree platform_external_libgpiod/
platform_external_libgpiod/
├── Android.bp
├── COPYING
├── include
│ ├── gpiod.h
│ └── linux
│ └── gpio.h
├── README
└── src
├── lib
│ ├── config.h
│ ├── core.c
│ ├── ctxless.c
│ ├── helpers.c
│ ├── iter.c
│ └── misc.c
└── tools
├── gpiodetect.c
├── gpiofind.c
├── gpioget.c
├── gpioinfo.c
├── gpiomon.c
├── gpioset.c
├── tools-common.c
└── tools-common.h5 directories, 19 files
tool编译
source build/envsetup.sh
lunch rk3576_u-userdebugmmm external/platform_external_libgpiod/
放到板子
adb push out\target\product\rk3576_u\system\lib64\libgpiod.so /data/local/tmp
adb push out\target\product\rk3576_u\system\bin\gpiodetect /data/local/tmp
adb push out\target\product\rk3576_u\system\bin\gpiofind /data/local/tmp
adb push out\target\product\rk3576_u\system\bin\gpioget /data/local/tmp
adb push out\target\product\rk3576_u\system\bin\gpioinfo /data/local/tmp
adb push out\target\product\rk3576_u\system\bin\gpiomon /data/local/tmp
adb push out\target\product\rk3576_u\system\bin\gpioset /data/local/tmp
export LD_LIBRARY_PATH=/data/local/tmp
export PATH=/data/local/tmp:$PATH
设置环境
export LD_LIBRARY_PATH=/data/local/tmp
export PATH=/data/local/tmp:$PATH
gpiodetect
rk3576_u:/ # gpiodetect
gpi