Share via


Client Driver Bus Requests

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

Windows Mobile Not SupportedWindows Embedded CE Supported

8/28/2008

A Secure Digital (SD) client driver uses bus requests to send commands to and receive responses from an SD card. A bus request contains information the SD card stack uses to:

  • Control the sending of commands to an SD card.
  • Control the transmission or reception of any data associated with a command.

The SDBusRequest function provides a client driver with the ability to send bus requests to a card asynchronously. The parameters used for the synchronous and asynchronous functions are broadly similar. The CommandCodeparameter is the command, as defined by the SD specification, that is to be sent to the card. The CommandArgument parameter is the 32-bit optional argument, as defined by the SD specifications, for the current command.

All SD commands, except CMD0, cause the card to send a response. Some commands also cause the card to send data. Other commands cause the card to prepare to receive data.

The TransferClassparameter indicates to SDBusRequest whichcategory the current command falls into. The following list shows these categories:

  • SD_COMMANDindicates a command or response transfer.
  • SD_READindicates a command, response, or data read transfer.
  • SD_WRITE indicates a command, response, or data write transfer.

The ResponseTypeparameter indicates the expected SD response type for the command.

Data is transferred to the SD card in blocks. The size and number of these blocks is required for a bus transaction. The pBlockBufferparameter points to a buffer that has sufficient storage for the specified number of blocks.

Some command types require special handling in the bus driver. A client driver can indicate these special cases using bus request flags.

The synchronous and asynchronous bus request functions contain the optional Flagsparameter. The Flagsparameter allows a Secure Digital (SD) client driver to indicate that the request requires some special handling in the bus driver, specific to the command type. If the bus driver does not require and special handling, this parameter should be set to zero .

See Also

Reference

SDBusRequest

Concepts

Secure Digital Card Client Driver
Synchronous Bus Requests
Asynchronous Bus Requests