Browse Source

merge and fix the remote repo

Pat Beirne 2 years ago
parent
commit
75b03a3846
4 changed files with 281 additions and 27 deletions
  1. 95 0
      LICENSE
  2. 130 0
      README.md
  3. 40 17
      opio
  4. 16 10
      opio.1

+ 95 - 0
LICENSE

@@ -0,0 +1,95 @@
+Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License
+By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.
+
+Section 1 – Definitions.
+
+Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.
+Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.
+BY-NC-SA Compatible License means a license listed at creativecommons.org/compatiblelicenses, approved by Creative Commons as essentially the equivalent of this Public License.
+Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
+Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements.
+Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.
+License Elements means the license attributes listed in the name of a Creative Commons Public License. The License Elements of this Public License are Attribution, NonCommercial, and ShareAlike.
+Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License.
+Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.
+Licensor means the individual(s) or entity(ies) granting rights under this Public License.
+NonCommercial means not primarily intended for or directed towards commercial advantage or monetary compensation. For purposes of this Public License, the exchange of the Licensed Material for other material subject to Copyright and Similar Rights by digital file-sharing or similar means is NonCommercial provided there is no payment of monetary compensation in connection with the exchange.
+Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.
+Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.
+You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning.
+Section 2 – Scope.
+
+License grant.
+Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
+reproduce and Share the Licensed Material, in whole or in part, for NonCommercial purposes only; and
+produce, reproduce, and Share Adapted Material for NonCommercial purposes only.
+Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.
+Term. The term of this Public License is specified in Section 6(a).
+Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material.
+Downstream recipients.
+Offer from the Licensor – Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.
+Additional offer from the Licensor – Adapted Material. Every recipient of Adapted Material from You automatically receives an offer from the Licensor to exercise the Licensed Rights in the Adapted Material under the conditions of the Adapter’s License You apply.
+No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.
+No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i).
+Other rights.
+
+Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.
+Patent and trademark rights are not licensed under this Public License.
+To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties, including when the Licensed Material is used other than for NonCommercial purposes.
+Section 3 – License Conditions.
+
+Your exercise of the Licensed Rights is expressly made subject to the following conditions.
+
+Attribution.
+
+If You Share the Licensed Material (including in modified form), You must:
+
+retain the following if it is supplied by the Licensor with the Licensed Material:
+identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);
+a copyright notice;
+a notice that refers to this Public License;
+a notice that refers to the disclaimer of warranties;
+a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
+indicate if You modified the Licensed Material and retain an indication of any previous modifications; and
+indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License.
+You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.
+If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable.
+ShareAlike.
+In addition to the conditions in Section 3(a), if You Share Adapted Material You produce, the following conditions also apply.
+
+The Adapter’s License You apply must be a Creative Commons license with the same License Elements, this version or later, or a BY-NC-SA Compatible License.
+You must include the text of, or the URI or hyperlink to, the Adapter's License You apply. You may satisfy this condition in any reasonable manner based on the medium, means, and context in which You Share Adapted Material.
+You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, Adapted Material that restrict exercise of the rights granted under the Adapter's License You apply.
+Section 4 – Sui Generis Database Rights.
+
+Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:
+
+for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database for NonCommercial purposes only;
+if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material, including for purposes of Section 3(b); and
+You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database.
+For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
+Section 5 – Disclaimer of Warranties and Limitation of Liability.
+
+Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.
+To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.
+The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.
+Section 6 – Term and Termination.
+
+This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.
+Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates:
+
+automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or
+upon express reinstatement by the Licensor.
+For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.
+For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.
+Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
+Section 7 – Other Terms and Conditions.
+
+The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.
+Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.
+Section 8 – Interpretation.
+
+For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.
+To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.
+No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.
+Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.

+ 130 - 0
README.md

@@ -0,0 +1,130 @@
+% OPIO(1) opio v2.1
+% Pat Beirne <patb@pbeirne.com>
+% Oct 2021
+
+# NAME
+opio - Control GPIO pins on OrangePi. A replacement for WiringPi
+
+# SYNOPSIS
+**opio** [-2] readall {or status} 
+
+**opio** [-2] readallx {or statusx}
+
+**opio** [-2] exports
+
+**opio** leds
+
+**opio** mode *pin* [ in | out | alt ]
+
+**opio** [ -d ] read *pin*
+
+**opio** [ -d ] write *pin* [ 1 | 0 | on | off ]
+
+# DESCRIPTION
+**opio** allows access to the GPIO pins of OrangePi single-board computers. This version is designed speciifically for the
+
+- OrangePi i96
+- OrangePi 2G-iot
+
+Running **opio** without any parameters will show its usage. **opio** requires 'su' permissions, so must be run as 'root' or via 'sudo'.
+
+# COMMANDS
+**readall** or **status**
+: Displays the state of the gpio pins in a grid format. The list includes all the pins used in the on-board 40 pin connector. For each pin, the listing shows the gpio pin number, its alternate function, its i96 pin name, its current _mode_ and _value_, and the corresponding pin number on the 40 pin connector.
+
+**readallx** or **statusx**
+: Creates a similar chart, but includes the RDA pin names and Linux device driver names. 
+
+**leds** 
+: Creates a smaller chart, for the interesting I/O pins which are _not_ part of the 40 pin connector. On the i96 board, there are 3 LEDs which can be controlled via **opio**
+
+**exports**
+: Print a list of current entries in /sys/class/gpio, indicating which pins have been exported (prepared for read/write). If a gpio pin exists on the 40 pin connector, the pin number is listed.
+
+**mode**
+: Sets the _mode_ for a pin as either 'in', 'out' or 'alternate-function'. Normally **opio** will create an export for this gpio pin, and then set the direction. If you set the 'alt' function, the export will be removed. With the **-d** option, the export is not created, but the 'in'/'out'/'alt' _mode_ setting will still be done.
+
+- **mode** with a pin number and no set-mode request, will simply return the current _mode_ (in, out, alt, in\*, alt\*).
+
+**read**
+: Returns the current _value_ (1/0) of the gpio pin, if possible. If the pin is in 'alt' _mode_, it is changed to 'in' before the _value_ is read.
+
+**write**
+: Attempts to write the given _value_ into the given pin. If the pin is in 'alt' _mode_, it is changed to 'out' before the _value_ is asserted.
+
+# OPTIONS
+**-d**
+: Use low-level access to control the pins. Without the **-d** option, **opio** tries to use the 'export' gpio mechanism (at /sys/class/gpio). The **-d** option only applies to **mode, read** and **write**
+
+**-2**
+: Use the pin assignments for the OrangePi-2G-iot. The default is to use the pins for the OrangePi-i96. If you wish to make this option persistent, create a file named /etc/OrangePi_2G_IOT.
+
+## Mode
+The microcontroller used on these boards presents i/o pins which can be set to 'general usage' GPIO as 'input' or 'output, or alternatively, set to operate in a specific way (uart, i2c, i2s, pcm, etc). **opio** refers the the current _mode_ of each pin one of these: either GPIO 'in', GPIO 'out', or 'alt'ernate function. 
+
+The 'in\*' or 'out\*' are marked with an asterisk to indicate that the pin is in GPIO _mode_, but _not_ listed in the current 'export' list.
+
+As a convenience, the **read** and **write** commands will automatically set the _mode_ on the GPIO pin and create an export. So, generally, the **mode** command is only *required* if you wish to change a pin back to its 'alt' function.
+
+# HERITAGE
+This program is styled after the **gpio** program written by Gordon Henderson for the Raspberry Pi.
+Unlike the original **gpio** program, this one does not implement:
+
+- export...........exports are created automatically by **mode, read** and **write**
+- pwm, clk.........this microcontroller does not have PWM or CLK type pins
+- aread, awrite....these boards have not connected and ADC/DAC pins
+
+# NUMBERING
+There are 4 naming schemes used to identify pins in these boards. **opio** uses exclusively the Linux gpio device driver numbers, the first on this list:
+
+- Linux gpio numbers (from /sys/class/gpio)
+- I/O connector pin numbers (1-40)
+- RDA microcontroller pin names (like GPIOA_C23)
+- i96 pin names (like GPIOB)
+
+You can explore the correspondence between these naming schemes with **opio readall** and **opio readallx**
+
+# HIGH LEVEL/LOW LEVEL ACCESS
+Normally, **opio** will access the GPIO pins through the Linux gpio device driver, and the corresponding files at `/sys/class/gpio`. This is _high level_ access.
+
+If you wish to bypass the Linux gpio driver, add the `-d` option to the **opio** command line and the reads/writes will be done at a _low level_, directly on the machine's registers.
+
+The commands **readall, readallx** and **leds** are always done using _low level_ access. The **exports** command is always done with _high level_ commands.
+
+Be careful about making changed with the **-d** option. Some linux gpio drivers will cache the direction and value, so changes you make with the **-d** option may not be reflected in the export folder.
+
+# EXAMPLES
+
+display a chart of the pin assignments of the 40 pin connector:
+
+    opio readall     
+
+list the currently 'exported' pins: 
+
+    opio exports
+
+
+set gpio 15 to an output; also create an export for gpio15
+...then flash the pin (gpio15 Linux number): 
+
+    opio mode 15 out    
+    opio write 15 on
+    sleep 2
+    opio write 15 off   
+
+set gpio 15 to an output; do *not* create an export
+
+    opio -d mode 15 out 
+
+write to gpio15 pin, bypassing the export mechanism
+
+    opio -d write 15 on  
+
+
+**NOTE** The more recent /dev/gpio driver is not yet available on these boards, since they're running the 3.xx kernels.
+
+**NOTE** The 2G-IOT board uses the I2C1 bus to communicate with the modem chip. This is i2c-0 in the kernel, and is pins 3 & 5 on the 40 pin connector. Do not use these pins to connect to peripherals. And do not use **opio** to modify the _mode_ of these pins.
+
+**NOTE** The 2G-IOT board uses the I2C3 bus to communicate with the LCD. If you are using an LCD in the socket, do _not_ change the mode on pins 38 & 40.
+
+**NOTE** To create a man page, run `pandoc README.md -s -t man -o opio.1`

+ 40 - 17
opio

@@ -1,5 +1,4 @@
 #!/usr/bin/python3
-# TODO: add board detection /var/local (but check /etc and /usr/local/etc as well)
 """
   This is a clone of the 'gpio/WiringPi' project, written specifically for the
   OrangePi i96.
@@ -53,19 +52,21 @@ from mmap import mmap
 from struct import pack, unpack
 import os, sys, argparse, pathlib, re, logging
 
-
+VERSION = "2.1"
 
 ############ board specific
 
 class Board:
-  def __init__(self,full_name,short_name):
+  def __init__(self,full_name,short_name,config_file):
     self.name = full_name
     self.short_name = short_name
+    self.config_file = config_file
   def __repr__(self):
     return self.name
 
-board_i96 = Board("OrangePi i96",  "OrangePi i96")
-board_2g = Board("OrangePi 2G-IOT","OrgPi 2G-iot")
+board_i96 = Board("OrangePi i96",  "OrangePi i96", "/etc/OrangePi-i96")
+board_2g = Board("OrangePi 2G-IOT","OrgPi 2G-iot", "/etc/OrangePi-2g-iot")
+
 
 # pins, arranged according to i96 connector
 # i96 label, rda_port number, pio number, rda special function
@@ -225,8 +226,6 @@ cpu_rda = Cpu("RDA8810")
 cpu_rda.IOMUX_ADDRESSES = (RDA_PORTA_IOMUX, RDA_PORTB_IOMUX, RDA_PORTD_IOMUX, RDA_PORTC_IOMUX)
 
 cpu = cpu_rda
-board = board_i96
-#board = board_2g
 
 GPIO_PER_PORT = 32
 
@@ -248,11 +247,10 @@ def mem_set(address, bitmask, value):
       data = unpack("<L",mem[address:address+4])[0] 
       logging.debug("mem_set: current data is {} mask is {} value is {}".format(hex(data),hex(bitmask),value))
       if value:
-        logging.debug("!! wtf? value is {} {} {}".format(value,bool(value),type(value)))
         data |= bitmask
       else:
         data &= ~bitmask
-      logging.debug("mem_set: resulting data is {} ~mask is {} {}".format(hex(data),hex(~bitmask),hex(data & ~bitmask)))
+      logging.debug("mem_set: resulting data is {}".format(hex(data)))
       mem[address:address+4] = pack("<L",data)
   except PermissionError:
     print("failed to open /dev/mem.....you must execute this script as root")
@@ -381,7 +379,7 @@ PORTC_IOBASE = 0x11a08000
 PORTD_IOBASE = 0x20932000
 IOBASE_ADDRESSES = (PORTA_IOBASE, PORTB_IOBASE, PORTD_IOBASE, PORTC_IOBASE)
 
-IO_DIR = 0   # [0=out,1=in] +0 direct access, +4 for the clr-reg, +8 for the set-reg 
+IO_DIR = 0   # [0=out,1=in] +0 direct access, +4 = clr-reg(out), +8 = set-reg(in) 
 IO_DATA = 0xc # +0 direct access, +4 for set-reg, +8 for clr-reg
 
 def low_level_read(gpio, address_offset):
@@ -407,6 +405,30 @@ def low_level_set_mode(gpio, mode):
 def low_level_get_mode(gpio):
   return low_level_read(gpio, IO_DIR)  
 
+######################### detect board ###################
+# the 2gio has the B3 pin pulled up
+# the i96 board leaves the B3 pin floating
+B3 = 35
+board = board_i96
+
+def board_auto_sense(args):
+  global board
+  if args.cmd in {"readll","readallx","status","statusx","leds","exports"}:
+    if pathlib.Path(board_2g.config_file).exists() or args.op2giot:
+      board = board_2g
+    elif pathlib.Path(board_i96.config_file).exists() or args.i96:
+      board = board_i96
+    else:
+      low_level_set_mode(B3, "out")
+      low_level_write(B3, IO_DATA, 1)
+      low_level_set_mode(B3, "in")
+      a = low_level_read(B3, IO_DATA)
+      low_level_set_mode(B3, "out")
+      low_level_write(B3, IO_DATA, 0)
+      low_level_set_mode(B3, "in")
+      b = low_level_read(B3, IO_DATA)
+      board = board_2g if b else board_i96
+      print("Board auto-detect found {}. To skip auto-detect, create a file named {}".format(board.short_name,board.config_file))
 
 ########################### actions #######################
 
@@ -559,19 +581,18 @@ args = None
 if __name__ == "__main__":
   #logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
   #logging.basicConfig(stream=sys.stderr, level=logging.INFO)
-  parser = argparse.ArgumentParser()
-  parser.add_argument('-v','--version', action='version', version='gpio 2.0\n   python rewrite by Pat Beirne')
+  parser = argparse.ArgumentParser(description = "Access GPIO on the OrangePi RDA boards")
+  parser.add_argument('-v','--version', action='version', 
+   version="opio "+VERSION+" -- python rewrite of gpio; by Pat Beirne")
   parser.add_argument('cmd',help="one of: read, write, mode, readall, readallx")
   parser.add_argument('gpio',nargs='?',type=int,help="gpio number 0...126")
   parser.add_argument('extra',nargs='?')
   parser.add_argument('-d',"--direct",help="use low-level access",action="store_true")
-  parser.add_argument('-2',"--op2giot",help="configure for OrangePi 2G-iot",action="store_true")
+  parser.add_argument('-2',"--op2giot",help="configure for OrangePi 2G-iot [disable auto-detect]",action="store_true")
+  parser.add_argument('-9',"--i96",help="configure for OrangePi i96 [disable auto-detect]",action="store_true")
   args = parser.parse_args()
 
-  if pathlib.Path('/etc/OrangePi_2G_IOT').exists():
-    board = board_2g
-  if args.op2giot:
-    board = board_2g
+  board_auto_sense(args)
  
   switcher = {"readall":do_readall, 
          "readallx":do_readallx,
@@ -581,6 +602,8 @@ if __name__ == "__main__":
          "mode":do_mode,
          "read":do_read,
          "write":do_write,
+         "in":do_read,
+         "out":do_write,
          "exports":do_exports}
   f = switcher.get(args.cmd)
   if not f:

+ 16 - 10
opio.1

@@ -1,6 +1,6 @@
 .\" Automatically generated by Pandoc 2.9.2.1
 .\"
-.TH "OPIO" "1" "Aug 2021" "opio v1.0" ""
+.TH "OPIO" "1" "Oct 2021" "opio v2.1" ""
 .hy
 .SH NAME
 .PP
@@ -8,9 +8,9 @@ opio - Control GPIO pins on OrangePi.
 A replacement for WiringPi
 .SH SYNOPSIS
 .PP
-\f[B]opio\f[R] [-2] readall
+\f[B]opio\f[R] [-2] readall {or status}
 .PP
-\f[B]opio\f[R] [-2] readallx
+\f[B]opio\f[R] [-2] readallx {or statusx}
 .PP
 \f[B]opio\f[R] [-2] exports
 .PP
@@ -36,7 +36,7 @@ Running \f[B]opio\f[R] without any parameters will show its usage.
 via `sudo'.
 .SH COMMANDS
 .TP
-\f[B]readall\f[R]
+\f[B]readall\f[R] or \f[B]status\f[R]
 Displays the state of the gpio pins in a grid format.
 The list includes all the pins used in the on-board 40 pin connector.
 For each pin, the listing shows the gpio pin number, its alternate
@@ -44,8 +44,9 @@ function, its i96 pin name, its current \f[I]mode\f[R] and
 \f[I]value\f[R], and the corresponding pin number on the 40 pin
 connector.
 .TP
-\f[B]readallx\f[R]
-Creates a similar chart, but includes the RDA pin names.
+\f[B]readallx\f[R] or \f[B]statusx\f[R]
+Creates a similar chart, but includes the RDA pin names and Linux device
+driver names.
 .TP
 \f[B]leds\f[R]
 Creates a smaller chart, for the interesting I/O pins which are
@@ -54,8 +55,8 @@ On the i96 board, there are 3 LEDs which can be controlled via
 \f[B]opio\f[R]
 .TP
 \f[B]exports\f[R]
-Print a list of entries in /sys/class/gpio, indicating which pins have
-been exported (prepared for read/write).
+Print a list of current entries in /sys/class/gpio, indicating which
+pins have been exported (prepared for read/write).
 If a gpio pin exists on the 40 pin connector, the pin number is listed.
 .TP
 \f[B]mode\f[R]
@@ -66,6 +67,7 @@ then set the direction.
 If you set the `alt' function, the export will be removed.
 With the \f[B]-d\f[R] option, the export is not created, but the
 `in'/`out'/`alt' \f[I]mode\f[R] setting will still be done.
+.IP \[bu] 2
 \f[B]mode\f[R] with a pin number and no set-mode request, will simply
 return the current \f[I]mode\f[R] (in, out, alt, in*, alt*).
 .TP
@@ -155,8 +157,9 @@ The \f[B]exports\f[R] command is always done with \f[I]high level\f[R]
 commands.
 .PP
 Be careful about making changed with the \f[B]-d\f[R] option.
-Some linux gpio drivers will direction and value, so changes you make
-with the \f[B]-d\f[R] option may not be reflected in the export folder.
+Some linux gpio drivers will cache the direction and value, so changes
+you make with the \f[B]-d\f[R] option may not be reflected in the export
+folder.
 .SH EXAMPLES
 .PP
 display a chart of the pin assignments of the 40 pin connector:
@@ -217,5 +220,8 @@ pins.
 the LCD.
 If you are using an LCD in the socket, do \f[I]not\f[R] change the mode
 on pins 38 & 40.
+.PP
+\f[B]NOTE\f[R] To create a man page, run
+\f[C]pandoc README.md -s -o opio.1\f[R]
 .SH AUTHORS
 Pat Beirne <patb@pbeirne.com>.