1.1.6.4.8 DRV_SDMMC_CommandStatus Function

C

DRV_SDMMC_COMMAND_STATUS DRV_SDMMC_CommandStatus (
    const DRV_HANDLE handle,
    const DRV_SDMMC_COMMAND_HANDLE commandHandle
);

Summary

Gets the current status of the command.

Description

This routine gets the current status of the command. The application must use this routine where the status of a scheduled command needs to be polled on. The function may return DRV_SDMMC_COMMAND_ERROR_UNKNOWN in a case where the command handle has expired. A command handle expires when the internal buffer object is re-assigned to another read or write request. It is recommended that this function be called regularly in order to track the command status correctly.

The application can alternatively register an event handler to receive read or write operation completion events.

Preconditions

The DRV_SDMMC_Initialize routine must have been called. The DRV_SDMMC_Open must have been called to obtain a valid opened device handle.

Parameters

ParamDescription
handleA valid open-instance handle, returned from the driver's open routine

Returns

A DRV_SDMMC_COMMAND_STATUS value describing the current status of the command.

Returns DRV_SDMMC_COMMAND_ERROR_UNKNOWN if the client handle or the command handle is not valid.

Example

DRV_HANDLE handle; // Returned from DRV_SDMMC_Open
DRV_SDMMC_COMMAND_HANDLE commandHandle;
DRV_SDMMC_COMMAND_STATUS status;

status = DRV_SDMMC_CommandStatus(handle, commandHandle);
if(status == DRV_SDMMC_COMMAND_COMPLETED)
{
    // Operation Done
}

Remarks

This routine will not block for hardware access and will immediately return the current status.