summaryrefslogtreecommitdiffhomepage
path: root/digital/dev2/doc/gpio.txt
diff options
context:
space:
mode:
authorNicolas Schodet2010-07-01 21:52:10 +0200
committerNicolas Schodet2010-07-01 21:52:10 +0200
commitbb2e0fc1fbe21b2ef4128fa666922df63768acd4 (patch)
tree459d9e9a30e1559327997d1bb946ec27cccc76ab /digital/dev2/doc/gpio.txt
parentae5bd4f87a9d9405520b8d365c293bea6eda9dbf (diff)
digital/dev2/doc: document dev2 usage, closes #132
Diffstat (limited to 'digital/dev2/doc/gpio.txt')
-rw-r--r--digital/dev2/doc/gpio.txt39
1 files changed, 39 insertions, 0 deletions
diff --git a/digital/dev2/doc/gpio.txt b/digital/dev2/doc/gpio.txt
new file mode 100644
index 00000000..1a8b478f
--- /dev/null
+++ b/digital/dev2/doc/gpio.txt
@@ -0,0 +1,39 @@
+==========================================
+ dev2 gpio - General Purpose Input Output
+==========================================
+
+The gpio module provides eight I/O to be controlled by the host.
+
+Do not forget to select an output using the control script!
+
+Controlling ouput
+=================
+
+Use the control script to set outputs and directions.
+
+ dev2ctl.py --gpio *DDR* *PORT*
+
+DDR and PORT have the same meaning as the corresponding AVR registers. Each
+parameter is an eight bit value, with each bit corresponding to one I/O port.
+
+ - if DDR bit is 0, corresponding port is an input, use PORT to activate a
+ pull-up,
+ - if DDR bit is 1, corresponding port is an output, use PORT to select the
+ output value.
+
+For example:
+
+ dev2ctl.py --gpio 0xc 0xa
+
+ - ports 0, 4, 5, 6, 7 will be input with no pull-up,
+ - port 1 will be input with pull-up,
+ - port 2 will be output with value 0,
+ - port 3 will be output with value 1.
+
+Reading input
+=============
+
+To read inputs, use a serial monitor (minicom, picocom, gtkterm, screen,
+socat...). For each character sent to the console, input port current state
+will be echoed back.
+