summaryrefslogtreecommitdiff
path: root/packages/robostix-module/files/robostix.init
diff options
context:
space:
mode:
Diffstat (limited to 'packages/robostix-module/files/robostix.init')
-rwxr-xr-xpackages/robostix-module/files/robostix.init53
1 files changed, 53 insertions, 0 deletions
diff --git a/packages/robostix-module/files/robostix.init b/packages/robostix-module/files/robostix.init
new file mode 100755
index 0000000000..9bbd1d9e7c
--- /dev/null
+++ b/packages/robostix-module/files/robostix.init
@@ -0,0 +1,53 @@
+#!/bin/sh
+#
+# Start the robostix
+#
+
+start() {
+ echo "Starting robostix..."
+
+ # Make sure ttyS2 is setup
+ echo "AF2 in" > /proc/gpio/GPIO46
+ echo "AF1 out" > /proc/gpio/GPIO47
+
+ # Turn on the robostix '245
+ echo "GPIO out clear" > /proc/gpio/GPIO72
+
+ # Turn on the robostix Power
+ echo "GPIO out set" > /proc/gpio/GPIO70
+
+ # load driver
+ /sbin/modprobe robostix
+
+ # Take the robostix out of reset
+ echo "GPIO out set" > /proc/gpio/GPIO73
+
+}
+stop() {
+ echo "Stopping robostix..."
+
+ # Put the robostix into reset
+ echo "GPIO out clear" > /proc/gpio/GPIO73
+}
+restart() {
+ stop
+ start
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ restart
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart}"
+ exit 1
+esac
+
+exit $?
+