1.1.7.4.14 DRV_SDSPI_CommandStatusGet Function

C

DRV_SDSPI_COMMAND_STATUS DRV_SDSPI_CommandStatusGet
(
    const DRV_HANDLE handle,
    const DRV_SDSPI_COMMAND_HANDLE commandHandle
)

Summary

Gets the current status of the command. For synchronous mode, the command status is only used by the file system.

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_SDSPI_COMMAND_HANDLE_INVALID 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_SDSPI_Initialize routine must have been called.

The DRV_SDSPI_Open must have been called to obtain a valid opened device handle.

A read or write request must have been submitted to the SDSPI driver.

Parameters

ParamDescription
handleA valid open-instance handle, returned from the driver's open routine
commandHandleHandle to the command whose status is to be known.

Returns

A DRV_SDSPI_COMMAND_STATUS value describing the current status of the command.

DRV_SDSPI_COMMAND_ERROR_UNKNOWN if the client handle or the command handle is not valid.

Example

None.

Remarks

This API may not be used in applications using the SDSPI Driver in synchronous mode.