Share via


Secure Digital Card Bus Driver

Other versions of this page are also available for the following:

Windows Mobile Not SupportedWindows Embedded CE Supported

8/28/2008

The Secure Digital (SD) card bus driver abstracts the physical implementation of the host controller to provide the client driver with a simple method of sending commands to a card regardless of bus topology. If a client driver must know the details regarding the physical connection of a card for performance reasons, it is able to query the bus driver for this information.

The bus driver is responsible for managing client drivers and, to some degree, host controller drivers. The bus driver exposes a set of services specific to client drivers and a set of services specific to host controller drivers. Both services are designed to minimize complex driver operations, such as client driver loading and unloading, SD Card interrogation and identification, client driver bus requests, and I/O cancellation. These operations are handled by the bus driver.

When a card is inserted into the bus driver, it initiates a set of actions to determine the type of the card and load the appropriate client driver. The SD bus driver loads client drivers using the ActivateDeviceEx function.

Due to the layered architecture of the SD card stack, the bus driver is the only driver that the client driver must interface with. The bus driver presents an abstraction of the SD protocol to the client driver. This abstraction hides all operation of the lower level host controller hardware from the client driver. Because this abstraction is purely software based, a client driver can operate on any hardware platform for which the SD bus driver exists and a compatible host controller driver has been written.

The bus driver provides simultaneous access for multiple client drivers in a thread-safe manner. The bus driver provides the proper serialization and synchronization even if the client drivers are controlling cards in separate slots or controlling separate functions on a multi-function card.

**** Applies to Windows Embedded CE 6.0 R2** **

Through the introduction of a new and enhanced SD bus implementation, the operating system now supports up to version 2.0 of the SD Card Physical Layer Specification. Along with the new SD bus, new interfaces have also been created. For additional information on new interfaces and values associated with version 2.0 of the SD bus, see Secure Digital Card Driver Structures, SDSetCardFeature, and SDCardInfoQuery.

Note

When you are building a new image you need to set the image flag IMGSDBUS2 equal to 1 in order to use the new bus (sdbus2.dll) and map the 2.0 bits to the OEMDrivers package. When IMGSDBUS2 is set to 1, the sdbus2.dll is picked up during the makeimg process and is renamed to sdbus.dll in the generated image. You can map the 2.0 bits to the package by adding the following line to the oem.cpm.csv file: CE_MODULES_SDBUS2, OEMDrivers

Source code for the SD bus can be found in the following directories:

  • SD 1.1 bus - %_WINCEROOT%\Public\Common\OAK\Drivers\SDCard\SDBusdriver
  • SD 2.0 bus - %_WINCEROOT%\Public\Common\OAK\Drivers\SDCard\SDBus

See Also

Reference

ActivateDeviceEx

Concepts

Secure Digital Card Driver Development Concepts