aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti18.inc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti18.inc')
-rw-r--r--lib/chibios/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti18.inc100
1 files changed, 100 insertions, 0 deletions
diff --git a/lib/chibios/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti18.inc b/lib/chibios/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti18.inc
new file mode 100644
index 000000000..81e829072
--- /dev/null
+++ b/lib/chibios/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti18.inc
@@ -0,0 +1,100 @@
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 EXTIv1/stm32_exti18.inc
19 * @brief Shared EXTI18 handler.
20 *
21 * @addtogroup STM32_EXTI18_HANDLER
22 * @{
23 */
24
25/*===========================================================================*/
26/* Driver local definitions. */
27/*===========================================================================*/
28
29/*===========================================================================*/
30/* Derived constants and error checks. */
31/*===========================================================================*/
32
33/* Priority settings checks.*/
34#if !defined(STM32_IRQ_EXTI18_PRIORITY)
35#error "STM32_IRQ_EXTI18_PRIORITY not defined in mcuconf.h"
36#endif
37
38#if !OSAL_IRQ_IS_VALID_PRIORITY(STM32_IRQ_EXTI18_PRIORITY)
39#error "Invalid IRQ priority assigned to STM32_IRQ_EXTI18_PRIORITY"
40#endif
41
42/*===========================================================================*/
43/* Driver exported variables. */
44/*===========================================================================*/
45
46/*===========================================================================*/
47/* Driver local variables. */
48/*===========================================================================*/
49
50/*===========================================================================*/
51/* Driver local functions. */
52/*===========================================================================*/
53
54static inline void exti18_irq_init(void) {
55#if defined(STM32_EXTI18_IS_USED)
56 nvicEnableVector(STM32_EXTI18_NUMBER, STM32_IRQ_EXTI18_PRIORITY);
57#endif
58}
59
60static inline void exti18_irq_deinit(void) {
61#if defined(STM32_EXTI18_IS_USED)
62 nvicDisableVector(STM32_EXTI18_NUMBER);
63#endif
64}
65
66/*===========================================================================*/
67/* Driver interrupt handlers. */
68/*===========================================================================*/
69
70#if defined(STM32_EXTI18_IS_USED) || defined(__DOXYGEN__)
71#if !defined(STM32_DISABLE_EXTI18_HANDLER)
72/**
73 * @brief EXTI[18] interrupt handler.
74 *
75 * @isr
76 */
77OSAL_IRQ_HANDLER(STM32_EXTI18_HANDLER) {
78 uint32_t pr;
79
80 OSAL_IRQ_PROLOGUE();
81
82 extiGetAndClearGroup1(1U << 18, pr);
83
84 /* Could be unused.*/
85 (void)pr;
86
87#if defined(STM32_EXTI18_ISR)
88 STM32_EXTI18_ISR(pr, 18);
89#endif
90
91 OSAL_IRQ_EPILOGUE();
92}
93#endif
94#endif
95
96/*===========================================================================*/
97/* Driver exported functions. */
98/*===========================================================================*/
99
100/** @} */