I want to know how to check the function configuration corresponding to gpio, and what functional status each gpio is reused into?
You can use the command: cat /sys/kernel/debug/gpio to check the status of gpio. Or use the command: cat /sys/kernel/debug/pinctrl/pinctrl-rockchip-pinctrl/pinmux-pins to view all gpio information
So how do I control the output value of gpio? My usage scenario is to control the gpio52 pin to output high level
- echo 52 > /sys/class/gpio/export // Apply to export the corresponding gpio
- echo out > /sys/class/gpio/gpio52/direction //Set the corresponding gpio as the output direction
- echo 1 > /sys/class/gpio/gpio52/value // Set output high level
- cat /sys/class/gpio/gpio52/value // Get the current status value of gpio
- echo 52 > /sys/class/gpio/unexport //Release the requested gpio