General-Purpose I/O (GPIO) Drivers


This section describes how to write a driver for a general-purpose I/O (GPIO) controller, and how to write a driver for a peripheral device that connects to GPIO pins on this controller. A GPIO controller driver configures GPIO pins to function as low-bandwidth data I/O channels and as inputs for device interrupts. A peripheral device driver can transfer data to or from a set of GPIO I/O pins, and can logically connect an interrupt service routine (ISR) to a GPIO interrupt pin. Starting with Windows 8, the GPIO framework extension (GpioClx) simplifies the task of writing GPIO controller drivers, and provides driver support for peripheral devices that connect to GPIO pins.

Where Applicable

A GPIO controller driver handles I/O requests to read or write to groups of GPIO pins. Typically, these pins are used to communicate with peripheral devices that are attached to computer motherboards or that are embedded in mobile devices, such as smart phones. A peripheral device that transfers data over a serial or parallel bus might, in addition, connect to GPIO pins that receive interrupt requests from the device or that send data to or from the device.

Developer Audience

This section is intended for use by C/C++ programmers. Before you use this section, you should understand basic driver development. For more information, see Getting Started with Windows Drivers.

Run-Time Requirements

At build time, the kernel-mode driver framework (KMDF) driver for a GPIO controller statically links to the GpioClx stub library, Msgpioclxstub.lib. At run time, this stub library dynamically links the driver to the GpioClx kernel-mode driver, Msgpioclx.sys. The KMDF or user-mode driver framework (UMDF) driver for a peripheral device that physically connects to one or more GPIO pins on this controller can send I/O requests to a set of GPIO I/O pins, or can logically connect an ISR to a GPIO interrupt pin. The GPIO framework extension is available starting with Windows 8.

Design Guide

Describes how to design a GPIO controller driver that uses the GPIO framework extension. Additionally describes how the driver for a peripheral device can use GPIO pins to communicate with the device.


Describes the structures, methods, and event callback functions that are defined by the GPIO framework extension to support GPIO controller drivers. Additionally describes the GPIO-specific I/O control requests (IOCTLs) that peripheral device drivers use to communicate with devices that connect to GPIO pins.




Send comments about this topic to Microsoft

© 2014 Microsoft