stm32h7xx_hal_msp.c 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /* USER CODE BEGIN Header */
  2. /**
  3. ******************************************************************************
  4. * @file stm32h7xx_hal_msp.c
  5. * @brief This file provides code for the MSP Initialization
  6. * and de-Initialization codes.
  7. ******************************************************************************
  8. * @attention
  9. *
  10. * Copyright (c) 2022 STMicroelectronics.
  11. * All rights reserved.
  12. *
  13. * This software is licensed under terms that can be found in the LICENSE file
  14. * in the root directory of this software component.
  15. * If no LICENSE file comes with this software, it is provided AS-IS.
  16. *
  17. ******************************************************************************
  18. */
  19. /* USER CODE END Header */
  20. /* Includes ------------------------------------------------------------------*/
  21. #include "main.h"
  22. /* USER CODE BEGIN Includes */
  23. /* USER CODE END Includes */
  24. /* Private typedef -----------------------------------------------------------*/
  25. /* USER CODE BEGIN TD */
  26. /* USER CODE END TD */
  27. /* Private define ------------------------------------------------------------*/
  28. /* USER CODE BEGIN Define */
  29. /* USER CODE END Define */
  30. /* Private macro -------------------------------------------------------------*/
  31. /* USER CODE BEGIN Macro */
  32. /* USER CODE END Macro */
  33. /* Private variables ---------------------------------------------------------*/
  34. /* USER CODE BEGIN PV */
  35. /* USER CODE END PV */
  36. /* Private function prototypes -----------------------------------------------*/
  37. /* USER CODE BEGIN PFP */
  38. /* USER CODE END PFP */
  39. /* External functions --------------------------------------------------------*/
  40. /* USER CODE BEGIN ExternalFunctions */
  41. /* USER CODE END ExternalFunctions */
  42. /* USER CODE BEGIN 0 */
  43. /* USER CODE END 0 */
  44. /**
  45. * Initializes the Global MSP.
  46. */
  47. void HAL_MspInit(void)
  48. {
  49. /* USER CODE BEGIN MspInit 0 */
  50. /* USER CODE END MspInit 0 */
  51. __HAL_RCC_SYSCFG_CLK_ENABLE();
  52. /* System interrupt init*/
  53. /* USER CODE BEGIN MspInit 1 */
  54. /* USER CODE END MspInit 1 */
  55. }
  56. /**
  57. * @brief TIM_Base MSP Initialization
  58. * This function configures the hardware resources used in this example
  59. * @param htim_base: TIM_Base handle pointer
  60. * @retval None
  61. */
  62. void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* htim_base)
  63. {
  64. if(htim_base->Instance==TIM3)
  65. {
  66. /* USER CODE BEGIN TIM3_MspInit 0 */
  67. /* USER CODE END TIM3_MspInit 0 */
  68. /* Peripheral clock enable */
  69. __HAL_RCC_TIM3_CLK_ENABLE();
  70. /* TIM3 interrupt Init */
  71. HAL_NVIC_SetPriority(TIM3_IRQn, 0, 0);
  72. HAL_NVIC_EnableIRQ(TIM3_IRQn);
  73. /* USER CODE BEGIN TIM3_MspInit 1 */
  74. /* USER CODE END TIM3_MspInit 1 */
  75. }
  76. }
  77. /**
  78. * @brief TIM_Base MSP De-Initialization
  79. * This function freeze the hardware resources used in this example
  80. * @param htim_base: TIM_Base handle pointer
  81. * @retval None
  82. */
  83. void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* htim_base)
  84. {
  85. if(htim_base->Instance==TIM3)
  86. {
  87. /* USER CODE BEGIN TIM3_MspDeInit 0 */
  88. /* USER CODE END TIM3_MspDeInit 0 */
  89. /* Peripheral clock disable */
  90. __HAL_RCC_TIM3_CLK_DISABLE();
  91. /* TIM3 interrupt DeInit */
  92. HAL_NVIC_DisableIRQ(TIM3_IRQn);
  93. /* USER CODE BEGIN TIM3_MspDeInit 1 */
  94. /* USER CODE END TIM3_MspDeInit 1 */
  95. }
  96. }
  97. /* USER CODE BEGIN 1 */
  98. /* USER CODE END 1 */