aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/LLD/TIMv1/hal_icu_lld.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/ports/STM32/LLD/TIMv1/hal_icu_lld.h')
-rw-r--r--os/hal/ports/STM32/LLD/TIMv1/hal_icu_lld.h43
1 files changed, 42 insertions, 1 deletions
diff --git a/os/hal/ports/STM32/LLD/TIMv1/hal_icu_lld.h b/os/hal/ports/STM32/LLD/TIMv1/hal_icu_lld.h
index 90c984fc4..0732ba816 100644
--- a/os/hal/ports/STM32/LLD/TIMv1/hal_icu_lld.h
+++ b/os/hal/ports/STM32/LLD/TIMv1/hal_icu_lld.h
@@ -105,6 +105,15 @@
#endif
/**
+ * @brief ICUD15 driver enable switch.
+ * @details If set to @p TRUE the support for ICUD15 is included.
+ * @note The default is @p TRUE.
+ */
+#if !defined(STM32_ICU_USE_TIM15) || defined(__DOXYGEN__)
+#define STM32_ICU_USE_TIM15 FALSE
+#endif
+
+/**
* @brief ICUD1 interrupt priority level setting.
*/
#if !defined(STM32_ICU_TIM1_IRQ_PRIORITY) || defined(__DOXYGEN__)
@@ -152,6 +161,13 @@
#if !defined(STM32_ICU_TIM9_IRQ_PRIORITY) || defined(__DOXYGEN__)
#define STM32_ICU_TIM9_IRQ_PRIORITY 7
#endif
+
+/**
+ * @brief ICUD15 interrupt priority level setting.
+ */
+#if !defined(STM32_ICU_TIM15_IRQ_PRIORITY) || defined(__DOXYGEN__)
+#define STM32_ICU_TIM15_IRQ_PRIORITY 7
+#endif
/** @} */
/*===========================================================================*/
@@ -186,6 +202,10 @@
#define STM32_HAS_TIM9 FALSE
#endif
+#if !defined(STM32_HAS_TIM15)
+#define STM32_HAS_TIM15 FALSE
+#endif
+
#if STM32_ICU_USE_TIM1 && !STM32_HAS_TIM1
#error "TIM1 not present in the selected device"
#endif
@@ -214,10 +234,14 @@
#error "TIM9 not present in the selected device"
#endif
+#if STM32_ICU_USE_TIM15 && !STM32_HAS_TIM15
+#error "TIM15 not present in the selected device"
+#endif
+
#if !STM32_ICU_USE_TIM1 && !STM32_ICU_USE_TIM2 && \
!STM32_ICU_USE_TIM3 && !STM32_ICU_USE_TIM4 && \
!STM32_ICU_USE_TIM5 && !STM32_ICU_USE_TIM8 && \
- !STM32_ICU_USE_TIM9
+ !STM32_ICU_USE_TIM9 && !STM32_ICU_USE_TIM15
#error "ICU driver activated but no TIM peripheral assigned"
#endif
@@ -278,6 +302,14 @@
#endif
#endif
+#if STM32_ICU_USE_TIM15
+#if defined(STM32_TIM15_IS_USED)
+#error "ICUD15 requires TIM15 but the timer is already used"
+#else
+#define STM32_TIM15_IS_USED
+#endif
+#endif
+
/* IRQ priority checks.*/
#if STM32_ICU_USE_TIM1 && !defined(STM32_TIM1_SUPPRESS_ISR) && \
!OSAL_IRQ_IS_VALID_PRIORITY(STM32_ICU_TIM1_IRQ_PRIORITY)
@@ -314,6 +346,11 @@
#error "Invalid IRQ priority assigned to TIM9"
#endif
+#if STM32_ICU_USE_TIM15 && !defined(STM32_TIM15_SUPPRESS_ISR) && \
+ !OSAL_IRQ_IS_VALID_PRIORITY(STM32_ICU_TIM15_IRQ_PRIORITY)
+#error "Invalid IRQ priority assigned to TIM15"
+#endif
+
/*===========================================================================*/
/* Driver data structures and types. */
/*===========================================================================*/
@@ -492,6 +529,10 @@ extern ICUDriver ICUD8;
extern ICUDriver ICUD9;
#endif
+#if STM32_ICU_USE_TIM15 && !defined(__DOXYGEN__)
+extern ICUDriver ICUD15;
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif