diff options
Diffstat (limited to 'os/hal/ports/STM32/LLD/EXTIv1')
-rw-r--r-- | os/hal/ports/STM32/LLD/EXTIv1/notes.txt | 4 | ||||
-rw-r--r-- | os/hal/ports/STM32/LLD/EXTIv1/stm32_exti.h | 14 |
2 files changed, 16 insertions, 2 deletions
diff --git a/os/hal/ports/STM32/LLD/EXTIv1/notes.txt b/os/hal/ports/STM32/LLD/EXTIv1/notes.txt index bf6aefb7f..ac83cf58d 100644 --- a/os/hal/ports/STM32/LLD/EXTIv1/notes.txt +++ b/os/hal/ports/STM32/LLD/EXTIv1/notes.txt @@ -10,5 +10,5 @@ STM32_EXTI_NUM_LINES - Number of EXTI lines, it can be between 0 and 63. STM32_EXTI_IMR1_MASK - Mask of the fixed lines that must not be
handled by the driver (0..31).
STM32_EXTI_IMR2_MASK - Mask of the fixed lines that must not be
- handled by the driver (32..63).
-
\ No newline at end of file + handled by the driver (32..63). Only required
+ if STM32_EXTI_NUM_LINES is greater than 32.
diff --git a/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti.h b/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti.h index bd1f53222..cb4b2826d 100644 --- a/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti.h +++ b/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti.h @@ -88,6 +88,20 @@ typedef uint32_t extimode_t; /* Driver macros. */
/*===========================================================================*/
+/**
+ * @brief From group 1 line number to mask.
+ *
+ * @param[in] line line number in range 0..31
+ */
+#define EXTI_MASK1(line) (uint32_t)(1U << (line))
+
+/**
+ * @brief From group 2 line number to mask.
+ *
+ * @param[in] line line number in range 32..63
+ */
+#define EXTI_MASK2(line) (uint32_t)(1U << ((line) - 32U))
+
/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
|