#! /bin/sh

# The gpio(1) cmd seems to fail while sys/class works
#gpio export 26 out  # GPIO-26 defaults to low state
#gpio write 26 1     # Set to high for normal operation
#gpio write 26 0 && gpio write 26 1  # Force a MCU reset
#
NUM=26
HIGH=1
LOW=0
SYSC=/sys/class/gpio

# Reset (from custom device tree, input) GPIO for output
[ -e ${SYSC}/gpio${NUM} ] || echo $NUM >${SYSC}/export && sleep 1
echo out >${SYSC}/gpio${NUM}/direction
echo $HIGH >${SYSC}/gpio${NUM}/value
echo $LOW >${SYSC}/gpio${NUM}/value && echo $HIGH >${SYSC}/gpio${NUM}/value
