SDBusRequestEx (Compact 2013)
3/26/2014
This function asynchronously issues a bus request to an SD device. Upon completion of the bus request, the callback function passed in pCallback is called. SDBusRequestEx is the extension of SDBusRequest and is for use with direct memory access (DMA).
Syntax
SD_API_STATUS SDBusRequestEx(
SD_DEVICE_HANDLE hDevice,
UCHAR Command,
ULONG Argument,
SD_TRANSFER_CLASS TransferClass,
SD_RESPONSE_TYPE ResponseType,
ULONG NumBlocks,
ULONG BlockSize,
PUCHAR pBuffer,
PSD_BUS_REQUEST_CALLBACK pCallback,
DWORD RequestParam,
PSD_BUS_REQUEST *ppRequest,
DWORD Flags,
DWORD cbSize,
PPHYS_BUFF_LIST pPhysBuffList
);
Parameters:
- hDevice
[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] Type of response expected to the command.
- NumBlocks
[in] Number of data blocks provided to send or receive data. Can be zero if TransferClass is SD_COMMAND.
- BlockSize
[in] Specifies the size of the data blocks provided to send or receive data. Can be zero if TransferClassis SD_COMMAND.
- pBuffer
[in, out] Pointer to a buffer for sending or receiving data. Can be NULL if TransferClassis SD_COMMAND.
- pCallback
[in] Pointer to a callback routine.
- RequestParameter
[in] Parameter to be passed to the callback routine.
- ppRequest
[out] Pointer to a pointer to a bus request structure. This structure is allocated by the bus driver and must be freed later with SDFreeBusRequest.
Flags
[in] Optional. Bus request flags. This parameter can be set to SD_AUTO_ISSUE_CMD12 or SD_SDIO_AUTO_IO_ABORT to issue CMD12 or perform I/O abort respectively. An additional value for use with DMA isSD_BUS_REQUEST_PHYS_BUFFER. 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. Upon completion of the transaction, further status from the SD device will be contained in the CommandResponse member of ppRequest.
Remarks
The client device driver must not make any blocking calls within the completion callback routine. The following are blocking function calls:
- SDSynchronousBusRequest
- SDSetCardFeature
- SDCardInfoQuery with a query type of SD_INFO_CARD_STATUS
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 |