/************************************************************************************************** * @fn sblRun * * @brief Serial Boot run code for the SPI transport. * * input parameters * * None. * * output parameters * * None. * * @return None. */ static void sblRun(void) { halUARTCfg_t uartConfig; uartConfig.callBackFunc = sblRxCB; HAL_DMA_SET_ADDR_DESC1234(dmaCh1234); HalUARTInitSPI(); HalUARTOpenSPI(&uartConfig); while (1) { if (PxIFG & SPI_RDYIn_BIT) { spiRdyIn(); } HalUARTPollSPI(); if (HAL_DMA_CHECK_IRQ(HAL_SPI_CH_TX)) { HAL_DMA_CLEAR_IRQ(HAL_SPI_CH_TX); HalUART_DMAIsrSPI(); if (sblReset) { HAL_SYSTEM_RESET(); } } } }
/****************************************************************************** * @fn HalDMAInit * * @brief DMA Interrupt Service Routine * * @param None * * @return None *****************************************************************************/ void HalDmaInit( void ) { HAL_DMA_SET_ADDR_DESC0( &dmaCh0 ); HAL_DMA_SET_ADDR_DESC1234( dmaCh1234 ); #if (HAL_UART_DMA || \ ((defined HAL_SPI) && (HAL_SPI == TRUE)) || \ ((defined HAL_IRGEN) && (HAL_IRGEN == TRUE))) DMAIE = 1; #endif }
/****************************************************************************** * @fn HalDMAInit * * @brief DMA Interrupt Service Routine * * @param None * * @return None *****************************************************************************/ void HalDmaInit( void ) { HAL_DMA_SET_ADDR_DESC0( &dmaCh0 ); HAL_DMA_SET_ADDR_DESC1234( dmaCh1234 ); DMAIE = 1; }