stm32h7xx_it.c 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. /* USER CODE BEGIN Header */
  2. /**
  3. ******************************************************************************
  4. * @file stm32h7xx_it.c
  5. * @brief Interrupt Service Routines.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * Copyright (c) 2024 STMicroelectronics.
  10. * All rights reserved.
  11. *
  12. * This software is licensed under terms that can be found in the LICENSE file
  13. * in the root directory of this software component.
  14. * If no LICENSE file comes with this software, it is provided AS-IS.
  15. *
  16. ******************************************************************************
  17. */
  18. /* USER CODE END Header */
  19. /* Includes ------------------------------------------------------------------*/
  20. #include "main.h"
  21. #include "stm32h7xx_it.h"
  22. /* Private includes ----------------------------------------------------------*/
  23. /* USER CODE BEGIN Includes */
  24. /* USER CODE END Includes */
  25. /* Private typedef -----------------------------------------------------------*/
  26. /* USER CODE BEGIN TD */
  27. /* USER CODE END TD */
  28. /* Private define ------------------------------------------------------------*/
  29. /* USER CODE BEGIN PD */
  30. /* USER CODE END PD */
  31. /* Private macro -------------------------------------------------------------*/
  32. /* USER CODE BEGIN PM */
  33. /* USER CODE END PM */
  34. /* Private variables ---------------------------------------------------------*/
  35. /* USER CODE BEGIN PV */
  36. /* USER CODE END PV */
  37. /* Private function prototypes -----------------------------------------------*/
  38. /* USER CODE BEGIN PFP */
  39. /* USER CODE END PFP */
  40. /* Private user code ---------------------------------------------------------*/
  41. /* USER CODE BEGIN 0 */
  42. /* USER CODE END 0 */
  43. /* External variables --------------------------------------------------------*/
  44. extern DMA_HandleTypeDef hdma_adc1;
  45. extern DMA_HandleTypeDef hdma_adc2;
  46. extern DMA_HandleTypeDef hdma_adc3;
  47. extern DAC_HandleTypeDef hdac1;
  48. extern UART_HandleTypeDef huart8;
  49. extern UART_HandleTypeDef huart1;
  50. extern TIM_HandleTypeDef htim6;
  51. /* USER CODE BEGIN EV */
  52. /* USER CODE END EV */
  53. /******************************************************************************/
  54. /* Cortex Processor Interruption and Exception Handlers */
  55. /******************************************************************************/
  56. /**
  57. * @brief This function handles Non maskable interrupt.
  58. */
  59. void NMI_Handler(void)
  60. {
  61. /* USER CODE BEGIN NonMaskableInt_IRQn 0 */
  62. /* USER CODE END NonMaskableInt_IRQn 0 */
  63. /* USER CODE BEGIN NonMaskableInt_IRQn 1 */
  64. while (1)
  65. {
  66. }
  67. /* USER CODE END NonMaskableInt_IRQn 1 */
  68. }
  69. /**
  70. * @brief This function handles Hard fault interrupt.
  71. */
  72. void HardFault_Handler(void)
  73. {
  74. /* USER CODE BEGIN HardFault_IRQn 0 */
  75. /* USER CODE END HardFault_IRQn 0 */
  76. while (1)
  77. {
  78. /* USER CODE BEGIN W1_HardFault_IRQn 0 */
  79. /* USER CODE END W1_HardFault_IRQn 0 */
  80. }
  81. }
  82. /**
  83. * @brief This function handles Memory management fault.
  84. */
  85. void MemManage_Handler(void)
  86. {
  87. /* USER CODE BEGIN MemoryManagement_IRQn 0 */
  88. /* USER CODE END MemoryManagement_IRQn 0 */
  89. while (1)
  90. {
  91. /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */
  92. /* USER CODE END W1_MemoryManagement_IRQn 0 */
  93. }
  94. }
  95. /**
  96. * @brief This function handles Pre-fetch fault, memory access fault.
  97. */
  98. void BusFault_Handler(void)
  99. {
  100. /* USER CODE BEGIN BusFault_IRQn 0 */
  101. /* USER CODE END BusFault_IRQn 0 */
  102. while (1)
  103. {
  104. /* USER CODE BEGIN W1_BusFault_IRQn 0 */
  105. /* USER CODE END W1_BusFault_IRQn 0 */
  106. }
  107. }
  108. /**
  109. * @brief This function handles Undefined instruction or illegal state.
  110. */
  111. void UsageFault_Handler(void)
  112. {
  113. /* USER CODE BEGIN UsageFault_IRQn 0 */
  114. /* USER CODE END UsageFault_IRQn 0 */
  115. while (1)
  116. {
  117. /* USER CODE BEGIN W1_UsageFault_IRQn 0 */
  118. /* USER CODE END W1_UsageFault_IRQn 0 */
  119. }
  120. }
  121. /**
  122. * @brief This function handles Debug monitor.
  123. */
  124. void DebugMon_Handler(void)
  125. {
  126. /* USER CODE BEGIN DebugMonitor_IRQn 0 */
  127. /* USER CODE END DebugMonitor_IRQn 0 */
  128. /* USER CODE BEGIN DebugMonitor_IRQn 1 */
  129. /* USER CODE END DebugMonitor_IRQn 1 */
  130. }
  131. /******************************************************************************/
  132. /* STM32H7xx Peripheral Interrupt Handlers */
  133. /* Add here the Interrupt Handlers for the used peripherals. */
  134. /* For the available peripheral interrupt handler names, */
  135. /* please refer to the startup file (startup_stm32h7xx.s). */
  136. /******************************************************************************/
  137. /**
  138. * @brief This function handles RCC global interrupt.
  139. */
  140. void RCC_IRQHandler(void)
  141. {
  142. /* USER CODE BEGIN RCC_IRQn 0 */
  143. /* USER CODE END RCC_IRQn 0 */
  144. /* USER CODE BEGIN RCC_IRQn 1 */
  145. /* USER CODE END RCC_IRQn 1 */
  146. }
  147. /**
  148. * @brief This function handles DMA1 stream0 global interrupt.
  149. */
  150. void DMA1_Stream0_IRQHandler(void)
  151. {
  152. /* USER CODE BEGIN DMA1_Stream0_IRQn 0 */
  153. /* USER CODE END DMA1_Stream0_IRQn 0 */
  154. HAL_DMA_IRQHandler(&hdma_adc1);
  155. /* USER CODE BEGIN DMA1_Stream0_IRQn 1 */
  156. /* USER CODE END DMA1_Stream0_IRQn 1 */
  157. }
  158. /**
  159. * @brief This function handles DMA1 stream1 global interrupt.
  160. */
  161. void DMA1_Stream1_IRQHandler(void)
  162. {
  163. /* USER CODE BEGIN DMA1_Stream1_IRQn 0 */
  164. /* USER CODE END DMA1_Stream1_IRQn 0 */
  165. HAL_DMA_IRQHandler(&hdma_adc2);
  166. /* USER CODE BEGIN DMA1_Stream1_IRQn 1 */
  167. /* USER CODE END DMA1_Stream1_IRQn 1 */
  168. }
  169. /**
  170. * @brief This function handles DMA1 stream2 global interrupt.
  171. */
  172. void DMA1_Stream2_IRQHandler(void)
  173. {
  174. /* USER CODE BEGIN DMA1_Stream2_IRQn 0 */
  175. /* USER CODE END DMA1_Stream2_IRQn 0 */
  176. HAL_DMA_IRQHandler(&hdma_adc3);
  177. /* USER CODE BEGIN DMA1_Stream2_IRQn 1 */
  178. /* USER CODE END DMA1_Stream2_IRQn 1 */
  179. }
  180. /**
  181. * @brief This function handles USART1 global interrupt.
  182. */
  183. void USART1_IRQHandler(void)
  184. {
  185. /* USER CODE BEGIN USART1_IRQn 0 */
  186. /* USER CODE END USART1_IRQn 0 */
  187. HAL_UART_IRQHandler(&huart1);
  188. /* USER CODE BEGIN USART1_IRQn 1 */
  189. /* USER CODE END USART1_IRQn 1 */
  190. }
  191. /**
  192. * @brief This function handles EXTI line[15:10] interrupts.
  193. */
  194. void EXTI15_10_IRQHandler(void)
  195. {
  196. /* USER CODE BEGIN EXTI15_10_IRQn 0 */
  197. /* USER CODE END EXTI15_10_IRQn 0 */
  198. HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_10);
  199. HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_11);
  200. HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_14);
  201. HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_15);
  202. /* USER CODE BEGIN EXTI15_10_IRQn 1 */
  203. /* USER CODE END EXTI15_10_IRQn 1 */
  204. }
  205. /**
  206. * @brief This function handles TIM6 global interrupt, DAC1_CH1 and DAC1_CH2 underrun error interrupts.
  207. */
  208. void TIM6_DAC_IRQHandler(void)
  209. {
  210. /* USER CODE BEGIN TIM6_DAC_IRQn 0 */
  211. /* USER CODE END TIM6_DAC_IRQn 0 */
  212. if (hdac1.State != HAL_DAC_STATE_RESET) {
  213. HAL_DAC_IRQHandler(&hdac1);
  214. }
  215. HAL_TIM_IRQHandler(&htim6);
  216. /* USER CODE BEGIN TIM6_DAC_IRQn 1 */
  217. /* USER CODE END TIM6_DAC_IRQn 1 */
  218. }
  219. /**
  220. * @brief This function handles UART8 global interrupt.
  221. */
  222. void UART8_IRQHandler(void)
  223. {
  224. /* USER CODE BEGIN UART8_IRQn 0 */
  225. /* USER CODE END UART8_IRQn 0 */
  226. HAL_UART_IRQHandler(&huart8);
  227. /* USER CODE BEGIN UART8_IRQn 1 */
  228. /* USER CODE END UART8_IRQn 1 */
  229. }
  230. /* USER CODE BEGIN 1 */
  231. /* USER CODE END 1 */