1.10.21.11 1.11.21.11 1.12.22.11 1.13.20.11 1.14.15.11 1.15.16.11 1.16.22.11 1.17.18.11 1.18.18.11 1.19.18.11 1.20.22.11 1.21.23.11 1.22.25.11 1.23.23.11 1.24.20.11 1.27.22.11 1.34.20.11 1.35.13.11 SPIx_ErrorGet Function

C

/* x = SPI instance number */

/* SPI slave mode */
SPI_SLAVE_ERROR SPIx_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 SPIx_Initialize() should have been called.

Parameters

None.

Returns

SPI_SLAVE_ERROR - SPI Slave Errors

Example

void SPIEventHandler(uintptr_t context )
{
    if (SPI1_ErrorGet() == SPI_SLAVE_ERROR_NONE)
    {
        nBytesAvailable = SPI1_ReadCountGet();
        
        nBytesRead = SPI1_Read(APP_RxData, nBytesAvailable);
    }
    else
    {
        // Handle error
    }
    
}

SPI1_CallbackRegister(SPIEventHandler, (uintptr_t) 0);

Remarks

None.