Changes between Version 19 and Version 20 of gpio
- Timestamp:
- 04/07/2021 06:22:31 PM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
gpio
v19 v20 398 398 cat /sys/kernel/debug/gpio 399 399 }}} 400 * to determine the Linux GPIO for a specific offset of a controller you can look for GPIO controller devices that match the bus address of the controller you are interested in. For example if you are trying to find the Linux gpio for the 3rd gpio of an i2c based GPIO controller on i2c0@0x23: 401 {{{#!bash 402 bus="0-0023" 403 for i in $(ls -1d /sys/class/gpio/gpiochip*); do \ 404 [ "$1" = "$(basename $(readlink $i/device))" ] && base=$(cat $i/base); 405 done 406 gpio=$((base+3)) 407 }}} 400 408 * to export a GPIO that is available to userspace (ie provided by a gpio controller, not in-use by a kernel driver, and not already exported): 401 409 {{{#!bash