Share via


SDSynchronousBusRequestEx (Windows Embedded CE 6.0)

1/6/2010

This function synchronously issues a bus request to an SD device. SDSynchronousBusRequestEx is the extension of SDSynchronousBusRequest and is for use with direct memory access (DMA).

Syntax

SD_API_STATUS SDSynchronousBusRequestEx(
  SD_DEVICE_HANDLE hDevice, 
  UCHAR Command,
  DWORD Argument,
  SD_TRANSFER_CLASS TransferClass,
  SD_RESPONSE_TYPE ResponseType,
  PSD_COMMAND_RESPONSE pResponse,
  ULONG NumBlocks,
  ULONG BlockSize,
  PUCHAR pBuffer,
  DWORD Flags,
  DWORD cbSize,
  PPHYS_BUFF_LIST pPhysBuffList
);

Parameters

  • hHandle
    [in] Handle to an SD bus device.
  • Command
    [in] SD command to be sent to the device.
  • Argument
    [in] 32-bit argument specific to the command.
  • TransferClass
    [in] Specifies whether the transaction will read data (SD_READ), write data (SD_WRITE) or is command only (SD_COMMAND).
  • ResponseType
    [in] Specifies the type of response expected to the command.
  • pResponse
    [out] Pointer to an SD_COMMAND_RESPONSE structure to hold the response from the SD device.
  • NumBlocks
    [in] Specifies the number of data blocks provided to send or receive data. Can be set to zero if TransferClass is SD_COMMAND.
  • BlockSize
    [in] Specifies the size of the data blocks provided to send or receive data. Can be set to zero if TransferClass is SD_COMMAND.
  • pBuffer
    [in, out] Pointer to buffer for sending or receiving data. Can be set to NULL if TransferClassis SD_COMMAND.
  • Flags
    [in] Optional. Bus request flags. The following table shows the possible values for Flags.

    Value Description

    SD_AUTO_ISSUE_CMD12

    Informs the bus driver to issue the CMD12 SD command to stop transmission after the bus request completes. This flag should only be used in conjunction to a CMD18 or CMD25 bus request, which requires a CMD12 to instruct the card to stop transmission. The client driver should not use this option on any other command type.

    SD_SDIO_AUTO_IO_ABORT

    Informs the bus driver to perform the abort I/O procedure, using CMD52, for the I/O function receiving the request. The abort procedure is used in conjunction with CMD53 when the number of blocks in the command argument is set to zero. This value in the command argument instructs the I/O function to transmit or receive data until an I/O abort is issued. The client driver should not use this option on any other command type.

    SD_BUS_REQUEST_PHYS_BUFFER

    Informs the bus driver that a request using DMA has been issued. If this flag is not set then cbSize and pPhysBuffList will be ignored.

  • cbSize
    Size, in bytes, of the PHYS_BUFF_LIST structure. This parameter is only valid when SD_BUS_REQUEST_PHYS_BUFFER is set in Flags.
  • pPhysBuffList
    Pointer to a PHYS_BUFF_LIST structure. This parameter is only valid when SD_BUS_REQUEST_PHYS_BUFFER is set in Flags.

Return Value

A return value of type SD_API_STATUS indicates the success or failure of the transaction initiation.

Remarks

If a card is set to application command (ACMD) mode using CMD13, the client driver must issue the next command for ACMD mode. The client driver should not call other SD APIs while in ACMD mode as these APIs may send commands to the card that can be mis-interpreted as ACMD commands.

Requirements

Header sdcardddk.h
Library sdcardlib.lib
Windows Embedded CE Windows Embedded CE 6.0 R2

See Also

Reference

Secure Digital Card Driver Functions