1.8.7.45 1.25.6.45 1.26.5.45 1.27.5.45 1.28.6.45 1.36.7.43 1.41.5.45 1.42.3.45 FLEXCOMx_SPI_ErrorGet Function

C

/* x = FLEXCOM instance number */

/* SPI slave mode */

FLEXCOM_SPI_SLAVE_ERROR  FLEXCOMx_SPI_ErrorGet(void)

Summary

Returns the status of SPI transfer

Description

This function returns the error status of the last SPI transfer. Applicaiton must check the status of a transfer in the application callback and take appropriate action in case there is an error during the data transfer. Calling this API clears the error status flags.

Precondition

The FLEXCOMx_SPI_Initialize() should have been called

Parameters

None.

Returns

FLEXCOM_SPI_SLAVE_ERROR - SPI Slave Errors

Example

void SPIEventHandler(uintptr_t context )
{
    if (FLEXCOM0_SPI_ErrorGet() == FLEXCOM_SPI_SLAVE_ERROR_NONE)
    {
        nBytesAvailable = FLEXCOM0_SPI_ReadCountGet();
        
        nBytesRead = FLEXCOM0_SPI_Read(APP_RxData, nBytesAvailable);
    }
    else
    {
        // Handle error
    }
    
}

FLEXCOM0_SPI_CallbackRegister(SPIEventHandler, (uintptr_t) 0);

Remarks

None.