#!/bin/sh
#
# This file is used to setup the gpio pins: per application.
#
# export gpio pins 13, 45, and 46
echo 13 > /sys/class/gpio/export
echo 45 > /sys/class/gpio/export
echo 46 > /sys/class/gpio/export

#allow setup time
sleep 1

# set gpio45/status LED as output
echo out > /sys/class/gpio/gpio45/direction

# set gpio46/pushbutton as input
echo in > /sys/class/gpio/gpio46/direction

# set gpio13 as output with value 1, keeping USB disabled.
# Do one-step setup
echo high > /sys/class/gpio/gpio13/direction

# turn on status LED
echo 1 > /sys/class/gpio/gpio45/value
