aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios/os/hal/ports/STM32/STM32L0xx/stm32_isr.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios/os/hal/ports/STM32/STM32L0xx/stm32_isr.c')
-rw-r--r--lib/chibios/os/hal/ports/STM32/STM32L0xx/stm32_isr.c125
1 files changed, 125 insertions, 0 deletions
diff --git a/lib/chibios/os/hal/ports/STM32/STM32L0xx/stm32_isr.c b/lib/chibios/os/hal/ports/STM32/STM32L0xx/stm32_isr.c
new file mode 100644
index 000000000..d7dfc9669
--- /dev/null
+++ b/lib/chibios/os/hal/ports/STM32/STM32L0xx/stm32_isr.c
@@ -0,0 +1,125 @@
1/*
2 ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/**
18 * @file STM32L0xx/stm32_isr.c
19 * @brief STM32L0xx ISR handler code.
20 *
21 * @addtogroup SRM32L0xx_ISR
22 * @{
23 */
24
25#include "hal.h"
26
27/*===========================================================================*/
28/* Driver local definitions. */
29/*===========================================================================*/
30
31#define exti_serve_irq(pr, channel) { \
32 \
33 if ((pr) & (1U << (channel))) { \
34 _pal_isr_code(channel); \
35 } \
36}
37
38/*===========================================================================*/
39/* Driver exported variables. */
40/*===========================================================================*/
41
42/*===========================================================================*/
43/* Driver local variables. */
44/*===========================================================================*/
45
46/*===========================================================================*/
47/* Driver local functions. */
48/*===========================================================================*/
49
50/*===========================================================================*/
51/* Driver interrupt handlers. */
52/*===========================================================================*/
53
54#include "stm32_dma1_ch23.inc"
55#include "stm32_dma1_ch4567.inc"
56
57#include "stm32_exti0_1.inc"
58#include "stm32_exti2_3.inc"
59#include "stm32_exti4_15.inc"
60
61#include "stm32_usart1.inc"
62#include "stm32_usart2.inc"
63#include "stm32_usart4_5.inc"
64#include "stm32_lpuart1.inc"
65
66#include "stm32_tim2.inc"
67#include "stm32_tim3.inc"
68#include "stm32_tim6.inc"
69#include "stm32_tim7.inc"
70#include "stm32_tim21.inc"
71#include "stm32_tim22.inc"
72
73/*===========================================================================*/
74/* Driver exported functions. */
75/*===========================================================================*/
76
77/**
78 * @brief Enables IRQ sources.
79 *
80 * @notapi
81 */
82void irqInit(void) {
83
84 exti0_1_irq_init();
85 exti2_3_irq_init();
86 exti4_15_irq_init();
87
88 tim2_irq_init();
89 tim3_irq_init();
90 tim6_irq_init();
91 tim7_irq_init();
92 tim21_irq_init();
93 tim22_irq_init();
94
95 usart1_irq_init();
96 usart2_irq_init();
97 usart4_usart5_irq_init();
98 lpuart1_irq_init();
99}
100
101/**
102 * @brief Disables IRQ sources.
103 *
104 * @notapi
105 */
106void irqDeinit(void) {
107
108 exti0_1_irq_deinit();
109 exti2_3_irq_deinit();
110 exti4_15_irq_deinit();
111
112 tim2_irq_deinit();
113 tim3_irq_deinit();
114 tim6_irq_deinit();
115 tim7_irq_deinit();
116 tim21_irq_deinit();
117 tim22_irq_deinit();
118
119 usart1_irq_deinit();
120 usart2_irq_deinit();
121 usart4_usart5_irq_deinit();
122 lpuart1_irq_deinit();
123}
124
125/** @} */