/dev/gpioclear /dev/gpioctl /dev/gpioedge /dev/gpioset /dev/gpiostatus
The control file gpioctl accepts commands to set individual bits in the edge detect registers. Each control message has three space-separated fields:
reg pin value
where reg is a single character denoting a register, pin a bit within it, and val the value (0 or 1) for that bit. Valid choices for reg are: d (GPDR), r (GRER), f (GFER), and a (GAFR). For example, the control message
d 10 1
sets bit 10 (following the handbook's bit-numbering conventions) in the GPIO pin direction register GPDR.
The read-only file gpiostatus shows the names and values (in hexadecimal) of all GPIO registers.
The remaining data files allow bits to be read by Sys->read requests and set by Sys->write requests. When read, each file returns the value of a given register as a single 8 digit hexadecimal number: gpioset and gpioclear both give the value of the level register, GPLR; and gpioedge gives the value of the edge dectect register, GEDR. Each write request should present a single number in textual form, which is assumed to be hexadecimal by default. The value is written to a GPIO register: gpioset corresponds to GPSR, gpioclear corresponds to GPCR, and gpioedge corresponds to GEDR.
/man/3/gpio(3) | Rev: Thu Feb 15 14:43:36 GMT 2007 |