/****************************************************************************** * @fn HalUARTInit * * @brief Initialize the UART * * @param none * * @return none *****************************************************************************/ void HalUARTInit(void) { #if (HAL_UART_DMA && HAL_UART_SPI) // When both are defined, port is run-time choice. if (HAL_UART_PORT) { HalUARTInitSPI(); } else { HalUARTInitDMA(); } #else #if HAL_UART_DMA HalUARTInitDMA(); #endif #if HAL_UART_ISR HalUARTInitISR(); #endif #if HAL_UART_SPI HalUARTInitSPI(); #endif #if HAL_UART_USB HalUARTInitUSB(); #endif #endif }
/************************************************************************************************* * @fn HalUARTInit() * * @brief Initialize the UART * * @param none * * @return none *************************************************************************************************/ void HalUARTInit(void) { #if HAL_UART_USB HalUARTInitUSB(); #else HalUARTInitIsr(); #endif }
/************************************************************************************************** * @fn sblInit * * @brief SBL initialization. * * input parameters * * None. * * output parameters * * None. * * @return None. */ static void sblInit(void) { HAL_USB_PULLUP_DISABLE(); /* This is in place of calling HalDmaInit() which would require init of the other 4 DMA * descriptors in addition to just Channel 0. */ HAL_DMA_SET_ADDR_DESC0(&dmaCh0); HalUARTInitUSB(); SB_INIT_LEDS(); }
/************************************************************************************************** * @fn sblInit * * @brief Initialization for SBL. * * input parameters * * None. * * output parameters * * None. * * @return None. ************************************************************************************************** */ static void sblInit(void) { HAL_BOARD_INIT(); vddWait(VDD_MIN_RUN); magicByte = SB_MAGIC_VALUE; /* This is in place of calling HalDmaInit() which would require init of the other 4 DMA * descriptors in addition to just Channel 0. */ HAL_DMA_SET_ADDR_DESC0(&dmaCh0); HalUARTInitUSB(); }
/****************************************************************************** * @fn HalUARTInit * * @brief Initialize the UART * * @param none * * @return none *****************************************************************************/ void HalUARTInit(void) { #if HAL_UART_DMA HalUARTInitDMA(); #endif #if HAL_UART_ISR HalUARTInitISR(); #endif #if HAL_UART_USB HalUARTInitUSB(); #endif }
/****************************************************************************** * @fn HalUARTInit * * @brief Initialize the UART * * @param none * * @return none *****************************************************************************/ void HalUARTInit(void) { if (ZNP_CFG1_SPI == znpCfg1) { return; } #if HAL_UART_DMA HalUARTInitDMA(); #endif #if HAL_UART_ISR HalUARTInitISR(); #endif #if HAL_UART_USB HalUARTInitUSB(); #endif }
/************************************************************************************************** * @fn sblInit * * @brief SBL initialization. * * input parameters * * None. * * output parameters * * None. * * @return None. */ static void sblInit(uint8 bootloaderForcedByMainApp) { HAL_BOARD_INIT(); if (! bootloaderForcedByMainApp) { // If power on reset (i.e. reset not due to main software request) - pull down D+. // If reset is due to software request - do not touch the pull, otherwise the USB bus will reset and re-enumerate on the host. HAL_USB_PULLUP_DISABLE(); } /* This is in place of calling HalDmaInit() which would require init of the other 4 DMA * descriptors in addition to just Channel 0. */ HAL_DMA_SET_ADDR_DESC0(&dmaCh0); HalUARTInitUSB(); SB_INIT_LEDS(); }