chiark / gitweb /
Fixed a minor formatting issue in gpio readall
[wiringPi.git] / gpio / gpio.1
index ba0183f63c61a04fccd180f8894719ef2655c797..e816e22abc67fb9ab2b7a5c4f64eb1a6d2aaa5de 100644 (file)
@@ -1,4 +1,4 @@
-.TH "GPIO" "14 June 2012" "Command-Line access to Raspberry Pi and PiFace GPIO"
+.TH "GPIO" "21st October 2012" "Command-Line access to Raspberry Pi and PiFace GPIO"
 
 .SH NAME
 gpio \- Command-line access to Raspberry Pi and PiFace GPIO
@@ -9,14 +9,17 @@ gpio \- Command-line access to Raspberry Pi and PiFace GPIO
 .PP
 .B gpio
 .B [ \-g ]
-.B read/write/pwm/mode ...
+.B read/write/wb/pwm/mode ...
 .PP
 .B gpio
 .B [ \-p ]
-.B read/write/mode
+.B read/write/wb
 .B ...
 .PP
 .B gpio
+.B readall
+.PP
+.B gpio
 .B unexportall/exports
 .PP
 .B gpio
@@ -35,7 +38,7 @@ group value
 range
 .PP
 .B gpio
-.B load \ i2c/spi
+.B load \ i2c/spi ...
 .PP
 .B gpio
 .B gbr
@@ -54,6 +57,9 @@ converters on the Gertboard. It's designed for simple testing and
 diagnostic purposes, but can be used in shell scripts for general if
 somewhat slow control of the GPIO pins.
 
+It can also control the IO's on the PiFace IO board and load the SPI and I2C
+kernel modules if required.
+
 Additionally, it can be used to set the exports in the \fI/sys/class/gpio\fR
 system directory to allow subsequent programs to use the \fR/sys/class/gpio\fR
 interface without needing to be run as root.
@@ -62,31 +68,46 @@ interface without needing to be run as root.
 
 .TP
 .B \-v
-Output the current version
+Output the current version including the board revision of the Raspberry Pi.
 
 .TP
 .B \-g
 Use the BCM_GPIO pins numbers rather than wiringPi pin numbers.
+\fINOTE:\fR The BCM_GPIO pin numbers are always used with the 
+export and edge commands.
 
 .TP
 .B \-p
 Use the PiFace interface board and its corresponding pin numbers.
 
 .TP
-.B read
+.B read <pin>
 Read the digital value of the given pin and print 0 or 1 to represent the
 respective logic levels.
 
 .TP
-.B write
-Write the given value (0 or 1) to the pin.
+.B write <pin> <value>
+Write the given value (0 or 1) to the pin. You need to set the pin
+to output mode first.
+
+.TP
+.B wb <value>
+Write the given byte to the 8 main GPIO pins. You can prefix it with 0x
+to specify a hexadecimal number. You need to set pins to output mode
+first.
+
+.TP
+.B readall
+Output a table of all GPIO pins values. The values represent the actual values read
+if the pin is in input mode, or the last value written if the pin is in output
+mode.
 
 .TP
-.B pwm
+.B pwm <pin> <value>
 Write a PWM value (0-1023) to the given pin.
 
 .TP
-.B mode
+.B mode <pin> <mode>
 Set a pin into \fIinput\fR, \fIoutput\fR or \fIpwm\fR mode. Can also
 use the literals \fIup\fR, \fIdown\fR or \fItri\fR to set the internal
 pull-up, pull-down or tristate (off) controls.
@@ -147,9 +168,18 @@ Change the PWM mode to balanced (the default) or mark:space ratio (traditional)
 Change the PWM range register. The default is 1024.
 
 .TP
-.B load i2c/spi
-This loads the i2c or the spi drivers into the system and changes the permissions on
-the associated /dev/ entries so that the current user has access to them.
+.B load i2c [baudrate]
+This loads the i2c or drivers into the kernel and changes the permissions
+on the associated /dev/ entries so that the current user has access to
+them. Optionally it will set the I2C baudrate to that supplied (or as
+close as the Pi can manage) The default speed is 100Kb/sec.
+
+.TP
+.B load spi [buffer size in KB]
+This loads the the spi drivers into the kernel and changes the permissions
+on the associated /dev/ entries so that the current user has access to
+them. Optionally it will set the SPI buffer size to that supplied. The
+default is 4KB.
 
 .TP
 .B gbr
@@ -167,7 +197,7 @@ SPI digital to analogue converter.
 The board jumpers need to be in-place to do this operation.
 
 
-.SH "WiringPi vs. GPIO Pin numbering"
+.SH "WiringPi vs. BCM_GPIO Pin numbering"
 
 .PP
 .TS
@@ -197,6 +227,12 @@ _
 20     -       31
 .TE
 
+Note that "r1" and "r2" above refers to the board revision. Normally
+wiringPi detects the correct board revision with use for it's own
+numbering scheme, but if you are using a Revision 2 board with some
+of the pins which change numbers between revisions you will need
+to alter your software.
+
 .SH FILES
 
 .TP 2.2i
@@ -238,10 +274,15 @@ Gordon Henderson
 
 .SH "REPORTING BUGS"
 
-Report bugs to <projects@drogon.net>
+Please report bugs to <projects@drogon.net>
 
 .SH COPYRIGHT
 
 Copyright (c) 2012 Gordon Henderson
 This is free software; see the source for copying conditions. There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+.SH TRADEMARKS AND ACKNOWLEDGEMENTS
+
+Raspberry Pi is a trademark of the Raspberry Pi Foundation. See
+http://raspberrypi.org/ for full details.