stm32l4xx_it.c
Go to the documentation of this file.
1 /* USER CODE BEGIN Header */
2 /**
3 ******************************************************************************
4 * @file stm32l4xx_it.c
5 * @brief Interrupt Service Routines.
6 ******************************************************************************
7 * @attention
8 *
9 * <h2><center>&copy; Copyright (c) 2022 STMicroelectronics.
10 * All rights reserved.</center></h2>
11 *
12 * This software component is licensed by ST under BSD 3-Clause license,
13 * the "License"; You may not use this file except in compliance with the
14 * License. You may obtain a copy of the License at:
15 * opensource.org/licenses/BSD-3-Clause
16 *
17 ******************************************************************************
18 */
19 /* USER CODE END Header */
20
21 /* Includes ------------------------------------------------------------------*/
22 #include "main.h"
23 #include "stm32l4xx_it.h"
24 /* Private includes ----------------------------------------------------------*/
25 /* USER CODE BEGIN Includes */
26 /* USER CODE END Includes */
27 /* Private typedef -----------------------------------------------------------*/
28 /* USER CODE BEGIN TD */
29
30 /* USER CODE END TD */
31
32 /* Private define ------------------------------------------------------------*/
33 /* USER CODE BEGIN PD */
34
35 /* USER CODE END PD */
36
37 /* Private macro -------------------------------------------------------------*/
38 /* USER CODE BEGIN PM */
39
40 /* USER CODE END PM */
41
42 /* Private variables ---------------------------------------------------------*/
43 /* USER CODE BEGIN PV */
44
45 /* USER CODE END PV */
46
47 /* Private function prototypes -----------------------------------------------*/
48 /* USER CODE BEGIN PFP */
49
50 /* USER CODE END PFP */
51
52 /* Private user code ---------------------------------------------------------*/
53 /* USER CODE BEGIN 0 */
54
55 /* USER CODE END 0 */
56
57 /* External variables --------------------------------------------------------*/
58 extern I2C_HandleTypeDef hi2c2;
59 extern RTC_HandleTypeDef hrtc;
60 extern DMA_HandleTypeDef hdma_spi1_rx;
61 extern DMA_HandleTypeDef hdma_spi1_tx;
62 extern DMA_HandleTypeDef hdma_usart2_rx;
63 extern DMA_HandleTypeDef hdma_usart2_tx;
64 extern UART_HandleTypeDef huart2;
65 /* USER CODE BEGIN EV */
66
67 /* USER CODE END EV */
68
69 /******************************************************************************/
70 /* Cortex-M4 Processor Interruption and Exception Handlers */
71 /******************************************************************************/
72
73
74 /**
75 * @brief This function handles Non maskable interrupt.
76 */
77 void NMI_Handler(void)
78 {
79 /* USER CODE BEGIN NonMaskableInt_IRQn 0 */
80
81 /* USER CODE END NonMaskableInt_IRQn 0 */
82 /* USER CODE BEGIN NonMaskableInt_IRQn 1 */
83 while (1)
84 {
85 }
86 /* USER CODE END NonMaskableInt_IRQn 1 */
87 }
88
89
90 /**
91 * @brief This function handles Hard fault interrupt.
92 */
93 void HardFault_Handler(void)
94 {
95 /* USER CODE BEGIN HardFault_IRQn 0 */
96
97 /* USER CODE END HardFault_IRQn 0 */
98 while (1)
99 {
100 /* USER CODE BEGIN W1_HardFault_IRQn 0 */
101 /* USER CODE END W1_HardFault_IRQn 0 */
102 }
103 }
104
105
106 /**
107 * @brief This function handles Memory management fault.
108 */
109 void MemManage_Handler(void)
110 {
111 /* USER CODE BEGIN MemoryManagement_IRQn 0 */
112
113 /* USER CODE END MemoryManagement_IRQn 0 */
114 while (1)
115 {
116 /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */
117 /* USER CODE END W1_MemoryManagement_IRQn 0 */
118 }
119 }
120
121
122 /**
123 * @brief This function handles Prefetch fault, memory access fault.
124 */
125 void BusFault_Handler(void)
126 {
127 /* USER CODE BEGIN BusFault_IRQn 0 */
128
129 /* USER CODE END BusFault_IRQn 0 */
130 while (1)
131 {
132 /* USER CODE BEGIN W1_BusFault_IRQn 0 */
133 /* USER CODE END W1_BusFault_IRQn 0 */
134 }
135 }
136
137
138 /**
139 * @brief This function handles Undefined instruction or illegal state.
140 */
141 void UsageFault_Handler(void)
142 {
143 /* USER CODE BEGIN UsageFault_IRQn 0 */
144
145 /* USER CODE END UsageFault_IRQn 0 */
146 while (1)
147 {
148 /* USER CODE BEGIN W1_UsageFault_IRQn 0 */
149 /* USER CODE END W1_UsageFault_IRQn 0 */
150 }
151 }
152
153
154 /**
155 * @brief This function handles System service call via SWI instruction.
156 */
157 void SVC_Handler(void)
158 {
159 /* USER CODE BEGIN SVCall_IRQn 0 */
160
161 /* USER CODE END SVCall_IRQn 0 */
162 /* USER CODE BEGIN SVCall_IRQn 1 */
163
164 /* USER CODE END SVCall_IRQn 1 */
165 }
166
167
168 /**
169 * @brief This function handles Debug monitor.
170 */
171 void DebugMon_Handler(void)
172 {
173 /* USER CODE BEGIN DebugMonitor_IRQn 0 */
174
175 /* USER CODE END DebugMonitor_IRQn 0 */
176 /* USER CODE BEGIN DebugMonitor_IRQn 1 */
177
178 /* USER CODE END DebugMonitor_IRQn 1 */
179 }
180
181
182 /**
183 * @brief This function handles Pendable request for system service.
184 */
185 void PendSV_Handler(void)
186 {
187 /* USER CODE BEGIN PendSV_IRQn 0 */
188
189 /* USER CODE END PendSV_IRQn 0 */
190 /* USER CODE BEGIN PendSV_IRQn 1 */
191
192 /* USER CODE END PendSV_IRQn 1 */
193 }
194
195
196 /**
197 * @brief This function handles System tick timer.
198 */
199 void SysTick_Handler(void)
200 {
201 /* USER CODE BEGIN SysTick_IRQn 0 */
202
203 /* USER CODE END SysTick_IRQn 0 */
204 HAL_IncTick();
205 /* USER CODE BEGIN SysTick_IRQn 1 */
206 /* USER CODE END SysTick_IRQn 1 */
207 }
208
209
210 /******************************************************************************/
211 /* STM32L4xx Peripheral Interrupt Handlers */
212 /* Add here the Interrupt Handlers for the used peripherals. */
213 /* For the available peripheral interrupt handler names, */
214 /* please refer to the startup file (startup_stm32l4xx.s). */
215 /******************************************************************************/
216
217
218 /**
219 * @brief This function handles RTC wake-up interrupt through EXTI line 20.
220 */
221 void RTC_WKUP_IRQHandler(void)
222 {
223 /* USER CODE BEGIN RTC_WKUP_IRQn 0 */
224
225 /* USER CODE END RTC_WKUP_IRQn 0 */
226 HAL_RTCEx_WakeUpTimerIRQHandler(&hrtc);
227 /* USER CODE BEGIN RTC_WKUP_IRQn 1 */
228
229 /* USER CODE END RTC_WKUP_IRQn 1 */
230 }
231
232
233 /**
234 * @brief This function handles EXTI line3 interrupt.
235 */
236 void EXTI3_IRQHandler(void)
237 {
238 /* USER CODE BEGIN EXTI3_IRQn 0 */
239
240 /* USER CODE END EXTI3_IRQn 0 */
241 HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_3);
242 /* USER CODE BEGIN EXTI3_IRQn 1 */
243
244 /* USER CODE END EXTI3_IRQn 1 */
245 }
246
247
248 /**
249 * @brief This function handles DMA1 channel2 global interrupt.
250 */
251 void DMA1_Channel2_IRQHandler(void)
252 {
253 /* USER CODE BEGIN DMA1_Channel2_IRQn 0 */
254
255 /* USER CODE END DMA1_Channel2_IRQn 0 */
256 HAL_DMA_IRQHandler(&hdma_spi1_rx);
257 /* USER CODE BEGIN DMA1_Channel2_IRQn 1 */
258
259 /* USER CODE END DMA1_Channel2_IRQn 1 */
260 }
261
262
263 /**
264 * @brief This function handles DMA1 channel3 global interrupt.
265 */
266 void DMA1_Channel3_IRQHandler(void)
267 {
268 /* USER CODE BEGIN DMA1_Channel3_IRQn 0 */
269
270 /* USER CODE END DMA1_Channel3_IRQn 0 */
271 HAL_DMA_IRQHandler(&hdma_spi1_tx);
272 /* USER CODE BEGIN DMA1_Channel3_IRQn 1 */
273
274 /* USER CODE END DMA1_Channel3_IRQn 1 */
275 }
276
277
278 /**
279 * @brief This function handles DMA1 channel6 global interrupt.
280 */
281 void DMA1_Channel6_IRQHandler(void)
282 {
283 /* USER CODE BEGIN DMA1_Channel6_IRQn 0 */
284
285 /* USER CODE END DMA1_Channel6_IRQn 0 */
286 HAL_DMA_IRQHandler(&hdma_usart2_rx);
287 /* USER CODE BEGIN DMA1_Channel6_IRQn 1 */
288
289 /* USER CODE END DMA1_Channel6_IRQn 1 */
290 }
291
292
293 /**
294 * @brief This function handles DMA1 channel7 global interrupt.
295 */
296 void DMA1_Channel7_IRQHandler(void)
297 {
298 /* USER CODE BEGIN DMA1_Channel7_IRQn 0 */
299
300 /* USER CODE END DMA1_Channel7_IRQn 0 */
301 HAL_DMA_IRQHandler(&hdma_usart2_tx);
302 /* USER CODE BEGIN DMA1_Channel7_IRQn 1 */
303
304 /* USER CODE END DMA1_Channel7_IRQn 1 */
305 }
306
307
308 /**
309 * @brief This function handles I2C2 event interrupt.
310 */
311 void I2C2_EV_IRQHandler(void)
312 {
313 /* USER CODE BEGIN I2C2_EV_IRQn 0 */
314
315 /* USER CODE END I2C2_EV_IRQn 0 */
316 HAL_I2C_EV_IRQHandler(&hi2c2);
317 /* USER CODE BEGIN I2C2_EV_IRQn 1 */
318
319 /* USER CODE END I2C2_EV_IRQn 1 */
320 }
321
322
323 /**
324 * @brief This function handles USART2 global interrupt.
325 */
326 void USART2_IRQHandler(void)
327 {
328 /* USER CODE BEGIN USART2_IRQn 0 */
329
330 /* USER CODE END USART2_IRQn 0 */
331 HAL_UART_IRQHandler(&huart2);
332 /* USER CODE BEGIN USART2_IRQn 1 */
333
334 /* USER CODE END USART2_IRQn 1 */
335 }
336
337
338 /**
339 * @brief This function handles EXTI line[15:10] interrupts.
340 */
341 void EXTI15_10_IRQHandler(void)
342 {
343 /* USER CODE BEGIN EXTI15_10_IRQn 0 */
344
345 /* USER CODE END EXTI15_10_IRQn 0 */
346 HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_11);
347 /* USER CODE BEGIN EXTI15_10_IRQn 1 */
348
349 /* USER CODE END EXTI15_10_IRQn 1 */
350 }
351
352
353 /**
354 * @brief This function handles RTC alarm interrupt through EXTI line 18.
355 */
356 void RTC_Alarm_IRQHandler(void)
357 {
358 /* USER CODE BEGIN RTC_Alarm_IRQn 0 */
359
360 /* USER CODE END RTC_Alarm_IRQn 0 */
361 HAL_RTC_AlarmIRQHandler(&hrtc);
362 /* USER CODE BEGIN RTC_Alarm_IRQn 1 */
363
364 /* USER CODE END RTC_Alarm_IRQn 1 */
365 }
366
367
368 /* USER CODE BEGIN 1 */
369
370 /* USER CODE END 1 */
371 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
I2C2_EV_IRQHandler
void I2C2_EV_IRQHandler(void)
This function handles I2C2 event interrupt.
Definition: stm32l4xx_it.c:311
stm32l4xx_it.h
This file contains the headers of the interrupt handlers.
NMI_Handler
void NMI_Handler(void)
This function handles Non maskable interrupt.
Definition: stm32l4xx_it.c:77
DMA1_Channel6_IRQHandler
void DMA1_Channel6_IRQHandler(void)
This function handles DMA1 channel6 global interrupt.
Definition: stm32l4xx_it.c:281
hrtc
RTC_HandleTypeDef hrtc
DebugMon_Handler
void DebugMon_Handler(void)
This function handles Debug monitor.
Definition: stm32l4xx_it.c:171
BusFault_Handler
void BusFault_Handler(void)
This function handles Prefetch fault, memory access fault.
Definition: stm32l4xx_it.c:125
PendSV_Handler
void PendSV_Handler(void)
This function handles Pendable request for system service.
Definition: stm32l4xx_it.c:185
USART2_IRQHandler
void USART2_IRQHandler(void)
This function handles USART2 global interrupt.
Definition: stm32l4xx_it.c:326
DMA1_Channel3_IRQHandler
void DMA1_Channel3_IRQHandler(void)
This function handles DMA1 channel3 global interrupt.
Definition: stm32l4xx_it.c:266
hdma_spi1_rx
DMA_HandleTypeDef hdma_spi1_rx
hdma_usart2_rx
DMA_HandleTypeDef hdma_usart2_rx
RTC_WKUP_IRQHandler
void RTC_WKUP_IRQHandler(void)
This function handles RTC wake-up interrupt through EXTI line 20.
Definition: stm32l4xx_it.c:221
huart2
UART_HandleTypeDef huart2
EXTI15_10_IRQHandler
void EXTI15_10_IRQHandler(void)
This function handles EXTI line[15:10] interrupts.
Definition: stm32l4xx_it.c:341
HardFault_Handler
void HardFault_Handler(void)
This function handles Hard fault interrupt.
Definition: stm32l4xx_it.c:93
hdma_usart2_tx
DMA_HandleTypeDef hdma_usart2_tx
SysTick_Handler
void SysTick_Handler(void)
This function handles System tick timer.
Definition: stm32l4xx_it.c:199
hi2c2
I2C_HandleTypeDef hi2c2
SVC_Handler
void SVC_Handler(void)
This function handles System service call via SWI instruction.
Definition: stm32l4xx_it.c:157
EXTI3_IRQHandler
void EXTI3_IRQHandler(void)
This function handles EXTI line3 interrupt.
Definition: stm32l4xx_it.c:236
MemManage_Handler
void MemManage_Handler(void)
This function handles Memory management fault.
Definition: stm32l4xx_it.c:109
DMA1_Channel2_IRQHandler
void DMA1_Channel2_IRQHandler(void)
This function handles DMA1 channel2 global interrupt.
Definition: stm32l4xx_it.c:251
main.h
: Header for main.c file. This file contains the common defines of the application.
DMA1_Channel7_IRQHandler
void DMA1_Channel7_IRQHandler(void)
This function handles DMA1 channel7 global interrupt.
Definition: stm32l4xx_it.c:296
hdma_spi1_tx
DMA_HandleTypeDef hdma_spi1_tx
UsageFault_Handler
void UsageFault_Handler(void)
This function handles Undefined instruction or illegal state.
Definition: stm32l4xx_it.c:141
RTC_Alarm_IRQHandler
void RTC_Alarm_IRQHandler(void)
This function handles RTC alarm interrupt through EXTI line 18.
Definition: stm32l4xx_it.c:356