h6. [[Hardware Abstraction Layer]] h6(. » [[HAL Device API]] h6((. » [[List of HAL devices]] h6(((. » GPIO interface h5. (HALDeviceComms_GPIO) h4. Device API API version 0 is tailored towards OMAP3 machines and exists only to report basic information about the hardware that the OS is running on. <pre> struct gpiodevice { struct device dev; int boardtype; int revision; }; </pre> 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. <pre> struct gpiodevice { struct device dev; int Ports; int Number; struct onepin *Enumerate(struct gpiodevice *, int *carryon); int SetDataBits(struct gpiodevice *, int bits); int ClearDataBits(struct gpiodevice *, int bits); void ToggleDataBits(struct gpiodevice *, int bits); int ReadDataBits(struct gpiodevice *); int DataDirection(struct gpiodevice *, int pins, int dir); enum ReadMode(struct gpiodevice *, int pin); enum WriteMode(struct gpiodevice *, int pin, enum useage); int PullControl(struct gpiodevice *, int pins, int enable); int PullDirection(struct gpiodevice *, int pins, int up); void EdgeControl(struct gpiodevice *, int pins, int *enable, int *edge, int *risehigh); int EdgePollStatus(struct gpiodevice *, int collect); }; </pre> 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 h4. Support in RISC OS 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. h4. Known implementations |_<. 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 | h6. Information sources: Kernel.Hdr.HALDevice, ThirdParty.TankStage.HWSupport.GPIO.hdr.GPIODevice in CVS