1.1.8.4.11 DRV_SPI_TransferStatusGet Function

C

DRV_SPI_TRANSFER_EVENT DRV_SPI_TransferStatusGet(const DRV_SPI_TRANSFER_HANDLE transferHandle)

Summary

Returns transfer add request status.

Description

This function can be used to poll the status of the queued transfer request if the application doesn't prefer to use the event handler (callback) function to get notified.

Precondition

Either DRV_SPI_ReadTransferAdd or DRV_SPI_WriteTransferAdd or DRV_SPI_WriteReadTransferAdd function must have been called and a valid transfer handle must have been returned.

Parameters

ParamDescription
transferHandleHandle of the transfer request of which status has to be obtained.

Returns

One of the elements of the enum "DRV_SPI_TRANSFER_EVENT".

Example

// myAppObj is an application specific object.
MY_APP_OBJ myAppObj;

uint8_t mybuffer[MY_BUFFER_SIZE];
DRV_SPI_TRANSFER_HANDLE transferHandle;
DRV_SPI_TRANSFER_EVENT event;

// mySPIHandle is the handle returned by the DRV_SPI_Open function.

DRV_SPI_ReadTransferAdd( mySPIhandle, myBuffer, MY_RECEIVE_SIZE, &transferHandle);

if(transferHandle == DRV_SPI_TRANSFER_HANDLE_INVALID)
{
    // Error handling here
}

//Check the status of the transfer request
//This call can be used to wait until the transfer is completed.
event = DRV_SPI_TransferStatusGet(transferHandle);

Remarks

None.