Showing changes from revision #12 to #13:
Added | Removed | Changed
API version 0 is tailored towards OMAP3 machines and exists only to report basic information about the hardware that the OS is running on.
struct gpiodevice { struct device dev; int boardtype; int revision; };
The boardtype and revision entries are opaque values used to indicate the type and revision of the board that the OS is running on. This is to allow the GPIO manager module to provide the relevant features to the user.
For API version 0, the dev.Activate, dev.Deactivate, dev.Reset and dev.Sleep entries are dummy entries and don’t need to be used.
API version 1 is universal, although only OMAP3, OMAP4, OMAP5 and Raspberry Pi boards are currently enabled.
struct gpiodevice { struct device dev; int ports; Ports; int number; Number; struct onepin *Enumerate(struct gpiodevice *, int enumerate; *carryon); int setdatabits; SetDataBits(struct gpiodevice *, int bits); int cleardatabits; ClearDataBits(struct gpiodevice *, int bits); void ToggleDataBits(struct gpiodevice *, int toggledatabits; bits); int readdatabits; ReadDataBits(struct gpiodevice *); int datadirection; DataDirection(struct gpiodevice *, int pins, int dir); enum ReadMode(struct gpiodevice *, int readmode; pin); enum WriteMode(struct gpiodevice *, int writemode; pin, enum useage); int pullcontrol; PullControl(struct gpiodevice *, int pins, int enable); int pulldirection; PullDirection(struct gpiodevice *, int pins, int up); void EdgeControl(struct gpiodevice *, int edgecontrol; pins, int *enable, int *edge, int *risehigh); int edgepollstatus; EdgePollStatus(struct gpiodevice *, int collect); };
ports returns the number of GPIO ports on the board
number returns the number of this 32 bit wide device
enumerate call to list the GPIO ports capabilities
setdatabits:- call to set a 32 bit field of data
cleardatabits:- call to clear a 32 bit field of data
toggledatabits:- call to toggle a 32 bit field of data bits
readdatabits:- call to return a 32 bit field of data
datadirection:- call to set or read a 32 bit field of data
readmode:- call to read the mode of a single GPIO pin
writemode:- call to write the mode of a single GPIO pin
pullcontrol:- call to set or read a 32 bit field of data
pulldirection:- call to set or read a 32 bit field of data
edgecontrol:- call to set or read a 32 bit field of data
edgepollstatus:- call to read a 32 bit field of data
There is currently no support for this HAL device in RISC OS. It is only exposed by the HAL to allow third-party programs to make use of the GPIO hardware.
Device ID | Description | Implemented in |
---|---|---|
HALDeviceID_GPIO_OMAP3 | OMAP3 GPIO interface | HAL.OMAP3.s.GPIO |
HALDeviceID_GPIO_OMAP4 | OMAP4 GPIO interface | HAL.OMAP4.s.GPIO |
HALDeviceID_GPIO_OMAP5 | OMAP5 GPIO interface | HAL.OMAP5.s.GPIO |
HALDeviceID_GPIO_BCM2835 | BCM2835 GPIO interface | HAL.BCM2835.s.GPIO |