Hardware Dev Center

SPB Controller Drivers

An SPB controller is a device that controls a simple peripheral bus (SPB) and that transfers data to and from the peripheral devices that are connected to the SPB. The hardware vendor for an SPB controller provides an SPB controller driver to manage the hardware functions in the controller.

In this section


SPB Controller Driver Overview

Starting with Windows 8, the SPB framework extension (SpbCx) simplifies the development of controller drivers for simple peripheral buses (SPBs). SpbCx is a system-supplied extension to the Kernel-Mode Driver Framework (KMDF). The hardware vendor for the SPB controller device supplies a controller driver to perform all hardware-specific driver operations. This driver communicates with SpbCx to perform operations that are specific to SPB controllers, and communicates directly with KMDF to perform generic driver operations.

SPB Framework Extension (SpbCx)

Starting with Windows 8, the SPB framework extension (SpbCx) is a system-supplied extension to the Kernel-Mode Driver Framework (KMDF). SpbCx works together with an SPB controller driver to perform I/O operations on peripheral devices that are connected to a simple peripheral bus (SPB), such as I²C or SPI.

SpbCx Interfaces

The SPB framework extension (SpbCx) has two interfaces. The first is an I/O request interface through which SpbCx accepts I/O requests that clients (peripheral drivers) of the SPB controller send to peripheral devices that are attached to the bus. The second interface is a device driver interface (DDI) through which SpbCx communicates with the SPB controller driver.

I/O Transfer Sequences

The SPB framework extension (SpbCx) supports I/O transfer sequences. An I/O transfer sequence is an ordered set of bus transfers (read and write operations) that is performed as a single, atomic bus operation. All of the transfers in an I/O transfer sequence access the same target device on the bus.

Handling Client-Implemented Sequences

The optional EvtSpbControllerLock and EvtSpbControllerUnlock event callback functions perform complementary operations. The EvtSpbControllerLock function is a handler for IOCTL_SPB_LOCK_CONTROLLER requests. The EvtSpbControllerUnlock function is a handler for IOCTL_SPB_UNLOCK_CONTROLLER requests. A client (that is, the driver for a peripheral device on the bus) sends these requests to start and end I/O transfer sequences. Most SPB controller drivers do not support IOCTL_SPB_LOCK_CONTROLLER and IOCTL_SPB_UNLOCK_CONTROLLER requests and, therefore, do not implement EvtSpbControllerLock and EvtSpbControllerUnlock functions.

Using the SPB_TRANSFER_LIST Structure for Custom IOCTLs

If your simple peripheral bus (SPB) controller driver supports one or more custom I/O control (IOCTL) requests, use the SPB_TRANSFER_LIST structure to describe the read and write buffers in these requests. This structure provides a uniform way to describe the buffers in a request, and avoids the buffer-copying overhead associated with METHOD_BUFFERED I/O operations.


Some buses, such as SPI, enable read and write transfers to simultaneously occur between the bus controller and a device on the bus. To support these full-duplex transfers, the definition of the simple peripheral bus (SPB) I/O request interface includes, as an option, the IOCTL_SPB_FULL_DUPLEX I/O control code (IOCTL). Only SPB controller drivers for bus controllers that implement full-duplex transfers in hardware should support the IOCTL_SPB_FULL_DUPLEX IOCTL.

How to Get the Connection Settings for a Device

If your SPB controller driver registers an EvtSpbTargetConnect callback function, the SPB framework extension (SpbCx) calls this function when a client (peripheral driver) of the controller sends an IRP_MJ_CREATE request to open a logical connection to a target device on the bus. In response to the EvtSpbTargetConnect callback, the SPB controller driver should call the SpbTargetGetConnectionParameters method to get the connection settings for the target device. The SPB controller driver stores these settings and uses them later to access the device in response to I/O requests from the client.




Send comments about this topic to Microsoft

© 2015 Microsoft