//***************************************************************************** // //! DMA software interrupt handler //! //! \param None //! //! This function //! 1. Invoked when DMA operation is complete //! //! \return None. // //***************************************************************************** void DmaSwIntHandler(void) { unsigned long uiIntStatus; iDone = 1; uiIntStatus = MAP_uDMAIntStatus(); MAP_uDMAIntClear(uiIntStatus); }
/* * ======== SPICC3200DMA_hwiFxn ======== * ISR for the SPI when we use the DMA is used. */ void SPICC3200DMA_hwiFxn(uintptr_t arg) { SPI_Transaction *msg; SPICC3200DMA_Object *object = ((SPI_Handle)arg)->object; SPICC3200DMA_HWAttrs const *hwAttrs = ((SPI_Handle)arg)->hwAttrs; uint32_t intCode = 0; DebugP_log1("SPI:(%p) interrupt context start", hwAttrs->baseAddr); intCode = MAP_SPIIntStatus(hwAttrs->baseAddr, false); if (intCode & SPI_INT_DMATX) { /* DMA finished transfering; clear & disable interrupt */ MAP_SPIIntDisable(hwAttrs->baseAddr, SPI_INT_DMATX); MAP_SPIIntClear(hwAttrs->baseAddr, SPI_INT_DMATX); } /* Determine if the TX & RX DMA channels have completed */ if ((object->transaction) && (MAP_uDMAChannelIsEnabled(hwAttrs->rxChannelIndex) == false) && (MAP_uDMAIntStatus() & (1 << hwAttrs->rxChannelIndex))) { MAP_SPIDisable(hwAttrs->baseAddr); MAP_SPICSDisable(hwAttrs->baseAddr); MAP_SPIIntDisable(hwAttrs->baseAddr, SPI_INT_DMARX); MAP_SPIIntClear(hwAttrs->baseAddr, SPI_INT_DMARX); MAP_SPIIntClear(hwAttrs->baseAddr, SPI_INT_EOW); /* * Clear any pending interrupt * As the TX DMA channel interrupt gets service, it may be possible * that the RX DMA channel finished in the meantime, which means * the IRQ for RX DMA channel is still pending... */ HwiP_clearInterrupt(hwAttrs->intNum); /* * Use a temporary transaction pointer in case the callback function * attempts to perform another SPI_transfer call */ msg = object->transaction; /* Indicate we are done with this transfer */ object->transaction = NULL; /* Release constraint since transaction is done */ Power_releaseConstraint(PowerCC3200_DISALLOW_DEEPSLEEP); DebugP_log2("SPI:(%p) DMA transaction: %p complete", hwAttrs->baseAddr, (uintptr_t)msg); object->transferCallbackFxn((SPI_Handle)arg, msg); } DebugP_log1("SPI:(%p) interrupt context end", hwAttrs->baseAddr); }
//***************************************************************************** // //! DMA error interrupt handler //! //! \param None //! //! This function //! 1. Invoked when DMA operation is in error //! //! \return None. // //***************************************************************************** void DmaErrorIntHandler(void) { MAP_uDMAIntClear(MAP_uDMAIntStatus()); }