I am working on porting the open-source project OpenROV for Raspberry Pi. (The project is developed for BeagleBone.) The only significant challenge of the port is changing the software's references to GPIO1_0 (aka GPIO32) to a pin that is open on the Raspberry Pi's header (I'm thinking GPIO18). The original code is as follows:
#!/bin/sh
# GPIO1_0 equals equals /sys/class/gpio32 (32 + 0)
#see http://ninjablocks.com/blog/2012/1/20/setting-up-gpio-on-the-beaglebone.htm l
back_to_normal() {
sleep 1
#set GPIO1_0 to HIGH
echo "high" > /sys/class/gpio/gpio32/direction
}
reset() {
sleep 1
#prepare gpio
echo "32" > /sys/class/gpio/export
echo "out" >/sys/class/gpio/gpio32/direction
echo 7 > /sys/kernel/debug/omap_mux/gpmc_ad0
#set GPIO1_0 to low
echo "low" > /sys/class/gpio/gpio32/direction
back_to_normal
}
echo Initiating arduino reset 1>&2
reset &
Of course, I could just go through and change very reference to 32 to 18, but this would require additional work with every update. Instead, is there some way to create a dummy GPIO32 that automatically redirects commands to GPIO18?