/* SPI2 interrupt handler. Clear the SPI interrupt flag and execute the callback function.  */
void SPI2IntHandler(void)
/* SPI2 interrupt handler. Clear the SPI interrupt flag and execute the callback function.  */
void SPI2IntHandler(void)
{
    unsigned long ulEventFlags;
    unsigned long ulBase = SPI2_BASE;
    ulEventFlags = xHWREG(ulBase + SPI_CNTRL) & SPI_CNTRL_IF;
    ulEventFlags |= xHWREG(ulBase + SPI_CNTRL2) & SPI_CNTRL2_SLV_START_INTSTS;
    xHWREG(ulBase + SPI_CNTRL) |= SPI_CNTRL_IF;
    xHWREG(ulBase + SPI_CNTRL2) |= SPI_CNTRL2_SLV_START_INTSTS;
    if(g_pfnSPIHandlerCallbacks[2])
    {
        g_pfnSPIHandlerCallbacks[2](0, 0, ulEventFlags, 0);
    }
}