stm32h7xx_it.c 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  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 ETH_HandleTypeDef heth;
  45. extern DMA_HandleTypeDef hdma_uart8_rx;
  46. extern DMA_HandleTypeDef hdma_uart8_tx;
  47. extern UART_HandleTypeDef huart8;
  48. extern UART_HandleTypeDef huart1;
  49. extern UART_HandleTypeDef huart2;
  50. extern UART_HandleTypeDef huart3;
  51. extern UART_HandleTypeDef huart6;
  52. extern TIM_HandleTypeDef htim6;
  53. /* USER CODE BEGIN EV */
  54. extern UART_HandleTypeDef huart8;
  55. extern UART_HandleTypeDef huart1;
  56. /* USER CODE END EV */
  57. /******************************************************************************/
  58. /* Cortex Processor Interruption and Exception Handlers */
  59. /******************************************************************************/
  60. /**
  61. * @brief This function handles Non maskable interrupt.
  62. */
  63. void NMI_Handler(void)
  64. {
  65. /* USER CODE BEGIN NonMaskableInt_IRQn 0 */
  66. /* USER CODE END NonMaskableInt_IRQn 0 */
  67. /* USER CODE BEGIN NonMaskableInt_IRQn 1 */
  68. while (1)
  69. {
  70. }
  71. /* USER CODE END NonMaskableInt_IRQn 1 */
  72. }
  73. /**
  74. * @brief This function handles Hard fault interrupt.
  75. */
  76. void HardFault_Handler(void)
  77. {
  78. /* USER CODE BEGIN HardFault_IRQn 0 */
  79. /* USER CODE END HardFault_IRQn 0 */
  80. while (1)
  81. {
  82. /* USER CODE BEGIN W1_HardFault_IRQn 0 */
  83. /* USER CODE END W1_HardFault_IRQn 0 */
  84. }
  85. }
  86. /**
  87. * @brief This function handles Memory management fault.
  88. */
  89. void MemManage_Handler(void)
  90. {
  91. /* USER CODE BEGIN MemoryManagement_IRQn 0 */
  92. /* USER CODE END MemoryManagement_IRQn 0 */
  93. while (1)
  94. {
  95. /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */
  96. /* USER CODE END W1_MemoryManagement_IRQn 0 */
  97. }
  98. }
  99. /**
  100. * @brief This function handles Pre-fetch fault, memory access fault.
  101. */
  102. void BusFault_Handler(void)
  103. {
  104. /* USER CODE BEGIN BusFault_IRQn 0 */
  105. /* USER CODE END BusFault_IRQn 0 */
  106. while (1)
  107. {
  108. /* USER CODE BEGIN W1_BusFault_IRQn 0 */
  109. /* USER CODE END W1_BusFault_IRQn 0 */
  110. }
  111. }
  112. /**
  113. * @brief This function handles Undefined instruction or illegal state.
  114. */
  115. void UsageFault_Handler(void)
  116. {
  117. /* USER CODE BEGIN UsageFault_IRQn 0 */
  118. /* USER CODE END UsageFault_IRQn 0 */
  119. while (1)
  120. {
  121. /* USER CODE BEGIN W1_UsageFault_IRQn 0 */
  122. /* USER CODE END W1_UsageFault_IRQn 0 */
  123. }
  124. }
  125. /**
  126. * @brief This function handles Debug monitor.
  127. */
  128. void DebugMon_Handler(void)
  129. {
  130. /* USER CODE BEGIN DebugMonitor_IRQn 0 */
  131. /* USER CODE END DebugMonitor_IRQn 0 */
  132. /* USER CODE BEGIN DebugMonitor_IRQn 1 */
  133. /* USER CODE END DebugMonitor_IRQn 1 */
  134. }
  135. /******************************************************************************/
  136. /* STM32H7xx Peripheral Interrupt Handlers */
  137. /* Add here the Interrupt Handlers for the used peripherals. */
  138. /* For the available peripheral interrupt handler names, */
  139. /* please refer to the startup file (startup_stm32h7xx.s). */
  140. /******************************************************************************/
  141. /**
  142. * @brief This function handles RCC global interrupt.
  143. */
  144. void RCC_IRQHandler(void)
  145. {
  146. /* USER CODE BEGIN RCC_IRQn 0 */
  147. /* USER CODE END RCC_IRQn 0 */
  148. /* USER CODE BEGIN RCC_IRQn 1 */
  149. /* USER CODE END RCC_IRQn 1 */
  150. }
  151. /**
  152. * @brief This function handles USART1 global interrupt.
  153. */
  154. void USART1_IRQHandler(void)
  155. {
  156. /* USER CODE BEGIN USART1_IRQn 0 */
  157. /* USER CODE END USART1_IRQn 0 */
  158. HAL_UART_IRQHandler(&huart1);
  159. /* USER CODE BEGIN USART1_IRQn 1 */
  160. /* USER CODE END USART1_IRQn 1 */
  161. }
  162. /**
  163. * @brief This function handles USART2 global interrupt.
  164. */
  165. void USART2_IRQHandler(void)
  166. {
  167. /* USER CODE BEGIN USART2_IRQn 0 */
  168. /* USER CODE END USART2_IRQn 0 */
  169. HAL_UART_IRQHandler(&huart2);
  170. /* USER CODE BEGIN USART2_IRQn 1 */
  171. /* USER CODE END USART2_IRQn 1 */
  172. }
  173. /**
  174. * @brief This function handles USART3 global interrupt.
  175. */
  176. void USART3_IRQHandler(void)
  177. {
  178. /* USER CODE BEGIN USART3_IRQn 0 */
  179. /* USER CODE END USART3_IRQn 0 */
  180. HAL_UART_IRQHandler(&huart3);
  181. /* USER CODE BEGIN USART3_IRQn 1 */
  182. /* USER CODE END USART3_IRQn 1 */
  183. }
  184. /**
  185. * @brief This function handles TIM6 global interrupt, DAC1_CH1 and DAC1_CH2 underrun error interrupts.
  186. */
  187. void TIM6_DAC_IRQHandler(void)
  188. {
  189. /* USER CODE BEGIN TIM6_DAC_IRQn 0 */
  190. /* USER CODE END TIM6_DAC_IRQn 0 */
  191. HAL_TIM_IRQHandler(&htim6);
  192. /* USER CODE BEGIN TIM6_DAC_IRQn 1 */
  193. /* USER CODE END TIM6_DAC_IRQn 1 */
  194. }
  195. /**
  196. * @brief This function handles Ethernet global interrupt.
  197. */
  198. void ETH_IRQHandler(void)
  199. {
  200. /* USER CODE BEGIN ETH_IRQn 0 */
  201. /* USER CODE END ETH_IRQn 0 */
  202. HAL_ETH_IRQHandler(&heth);
  203. /* USER CODE BEGIN ETH_IRQn 1 */
  204. /* USER CODE END ETH_IRQn 1 */
  205. }
  206. /**
  207. * @brief This function handles DMA2 stream6 global interrupt.
  208. */
  209. void DMA2_Stream6_IRQHandler(void)
  210. {
  211. /* USER CODE BEGIN DMA2_Stream6_IRQn 0 */
  212. /* USER CODE END DMA2_Stream6_IRQn 0 */
  213. HAL_DMA_IRQHandler(&hdma_uart8_tx);
  214. /* USER CODE BEGIN DMA2_Stream6_IRQn 1 */
  215. /* USER CODE END DMA2_Stream6_IRQn 1 */
  216. }
  217. /**
  218. * @brief This function handles DMA2 stream7 global interrupt.
  219. */
  220. void DMA2_Stream7_IRQHandler(void)
  221. {
  222. /* USER CODE BEGIN DMA2_Stream7_IRQn 0 */
  223. /* USER CODE END DMA2_Stream7_IRQn 0 */
  224. HAL_DMA_IRQHandler(&hdma_uart8_rx);
  225. /* USER CODE BEGIN DMA2_Stream7_IRQn 1 */
  226. /* USER CODE END DMA2_Stream7_IRQn 1 */
  227. }
  228. /**
  229. * @brief This function handles USART6 global interrupt.
  230. */
  231. void USART6_IRQHandler(void)
  232. {
  233. /* USER CODE BEGIN USART6_IRQn 0 */
  234. /* USER CODE END USART6_IRQn 0 */
  235. HAL_UART_IRQHandler(&huart6);
  236. /* USER CODE BEGIN USART6_IRQn 1 */
  237. /* USER CODE END USART6_IRQn 1 */
  238. }
  239. /**
  240. * @brief This function handles UART8 global interrupt.
  241. */
  242. void UART8_IRQHandler(void)
  243. {
  244. /* USER CODE BEGIN UART8_IRQn 0 */
  245. /* USER CODE END UART8_IRQn 0 */
  246. HAL_UART_IRQHandler(&huart8);
  247. /* USER CODE BEGIN UART8_IRQn 1 */
  248. /* USER CODE END UART8_IRQn 1 */
  249. }
  250. /* USER CODE BEGIN 1 */
  251. /* USER CODE END 1 */