/** * @brief TIM MSP De-Initialization * This function frees the hardware resources used in this example: * - Disable the Peripheral's clock * - Revert GPIO to their default state * @param htim: TIM handle pointer * @retval None */ void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef *htim) { /*##-1- Reset peripherals ##################################################*/ TIMx_FORCE_RESET(); TIMx_RELEASE_RESET(); }
void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef *htim) { #ifdef TIMn if(htim->Instance == TIMx) { TIMx_FORCE_RESET(); TIMx_RELEASE_RESET(); } #endif }
/** * @brief UART MSP De-Initialization * This function frees the hardware resources used in this example: * - Disable the Peripheral's clock * - Revert GPIO, and NVIC configuration to their default state * @param huart: UART handle pointer * @retval None */ void HAL_UART_MspDeInit(UART_HandleTypeDef *huart) { /*##-1- Reset peripherals ##################################################*/ USARTx_FORCE_RESET(); USARTx_RELEASE_RESET(); /*##-2- Disable peripherals and GPIO Clocks #################################*/ /* Configure UART Tx as alternate function */ HAL_GPIO_DeInit(USARTx_TX_GPIO_PORT, USARTx_TX_PIN); /* Configure UART Rx as alternate function */ HAL_GPIO_DeInit(USARTx_RX_GPIO_PORT, USARTx_RX_PIN); /*##-3- Disable the NVIC for UART ##########################################*/ HAL_NVIC_DisableIRQ(USARTx_IRQn); /*##-4- Reset TIM peripheral ###############################################*/ TIMx_FORCE_RESET(); TIMx_RELEASE_RESET(); }