Charles.Forsyth20060303-partialeea662d19 years agoHistory
94 lines · 1.7 KB · Text
RawDownload
.TH GPIO 3 SA1100.SH NAMEgpio \- access to GPIO registers.SH SYNOPSIS.B bind -a.B #G.B /dev.PP.nf.B /dev/gpioclear.B /dev/gpioctl.B /dev/gpioedge.B /dev/gpioset.B /dev/gpiostatus.fi.SH DESCRIPTION.PPThe GPIO interfaceserves a one-level directory with five filesthat give access to the GPIO registers in the SA1100.See the SA1100 handbook for details of the functionof the various registers..PPThe control file.B gpioctlaccepts commands to set individual bits in the edge detectregisters.Each control message has three space-separated fields:.IP.EX.I "reg pin value".EE.LPwhere.I regis a single characterdenoting a register,.I pina bit within it, and.I valthe value (0 or 1) for that bit.Valid choices for.I regare:.B d(GPDR),.B r(GRER),.B f(GFER),and.B a(GAFR).For example, the control message.IP.EXd 10 1.EE.LPsets bit 10 (following the handbook's bit-numbering conventions) in the GPIO pindirection register GPDR..PPThe read-only file.B gpiostatusshows the names and values (in hexadecimal) of all GPIO registers..PPThe remaining data filesallow bits to be read by.B Sys->readrequestsand set by.B Sys->writerequests.When read, each file returns the value of a givenregister as a single 8 digit hexadecimal number:.B gpiosetand.B gpioclearboth give the value of the level register, GPLR;and.B gpioedgegives the value of the edge dectect register, GEDR.Each write requestshould present a single number in textual form, whichis assumed to be hexadecimal by default.The value is written to a GPIO register:.B gpiosetcorresponds to GPSR,.B gpioclearcorresponds to GPCR, and.B gpioedgecorresponds to GEDR..SH SOURCE.B /os/sa1100/devgpio.c