aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios/os/hal/ports/STM32/LLD/QUADSPIv2/stm32_quadspi1.inc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios/os/hal/ports/STM32/LLD/QUADSPIv2/stm32_quadspi1.inc')
-rw-r--r--lib/chibios/os/hal/ports/STM32/LLD/QUADSPIv2/stm32_quadspi1.inc110
1 files changed, 110 insertions, 0 deletions
diff --git a/lib/chibios/os/hal/ports/STM32/LLD/QUADSPIv2/stm32_quadspi1.inc b/lib/chibios/os/hal/ports/STM32/LLD/QUADSPIv2/stm32_quadspi1.inc
new file mode 100644
index 000000000..371bf773d
--- /dev/null
+++ b/lib/chibios/os/hal/ports/STM32/LLD/QUADSPIv2/stm32_quadspi1.inc
@@ -0,0 +1,110 @@
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 QUADSPIv2/stm32_quadspi1.inc
19 * @brief Shared QUADSPI1 handler.
20 *
21 * @addtogroup STM32_QUADSPI1_HANDLER
22 * @{
23 */
24
25/*===========================================================================*/
26/* Driver local definitions. */
27/*===========================================================================*/
28
29/*===========================================================================*/
30/* Derived constants and error checks. */
31/*===========================================================================*/
32
33/* Registry checks for robustness.*/
34#if !defined(STM32_HAS_QUADSPI1)
35#error "STM32_HAS_QUADSPI1 not defined in registry"
36#endif
37
38#if STM32_HAS_QUADSPI1
39
40/* Priority settings checks.*/
41#if !defined(STM32_IRQ_QUADSPI1_PRIORITY)
42#error "STM32_IRQ_QUADSPI1_PRIORITY not defined in mcuconf.h"
43#endif
44
45#if !OSAL_IRQ_IS_VALID_PRIORITY(STM32_IRQ_QUADSPI1_PRIORITY)
46#error "Invalid IRQ priority assigned to STM32_IRQ_QUADSPI1_PRIORITY"
47#endif
48
49#endif /* STM32_HAS_QUADSPI1 */
50
51/* Other checks.*/
52#if (HAL_USE_WSPI && STM32_WSPI_USE_QUADSPI1)
53#define STM32_QUADSPI1_IS_USED TRUE
54#else
55#define STM32_QUADSPI1_IS_USED FALSE
56#endif
57
58/*===========================================================================*/
59/* Driver exported variables. */
60/*===========================================================================*/
61
62/*===========================================================================*/
63/* Driver local variables. */
64/*===========================================================================*/
65
66/*===========================================================================*/
67/* Driver local functions. */
68/*===========================================================================*/
69
70static inline void quadspi1_irq_init(void) {
71#if STM32_QUADSPI1_IS_USED
72 nvicEnableVector(STM32_QUADSPI1_NUMBER, STM32_IRQ_QUADSPI1_PRIORITY);
73#endif
74}
75
76static inline void quadspi1_irq_deinit(void) {
77#if STM32_QUADSPI1_IS_USED
78 nvicDisableVector(STM32_QUADSPI1_NUMBER);
79#endif
80}
81
82/*===========================================================================*/
83/* Driver interrupt handlers. */
84/*===========================================================================*/
85
86#if STM32_QUADSPI1_IS_USED|| defined(__DOXYGEN__)
87/**
88 * @brief QUADSPI1 interrupt handler.
89 *
90 * @isr
91 */
92OSAL_IRQ_HANDLER(STM32_QUADSPI1_HANDLER) {
93
94 OSAL_IRQ_PROLOGUE();
95
96#if HAL_USE_WSPI
97#if STM32_WSPI_USE_QUADSPI1
98 wspi_lld_serve_interrupt(&WSPID1);
99#endif
100#endif
101
102 OSAL_IRQ_EPILOGUE();
103}
104#endif
105
106/*===========================================================================*/
107/* Driver exported functions. */
108/*===========================================================================*/
109
110/** @} */