aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2019-01-05 19:24:22 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2019-01-05 19:24:22 +0000
commitcd33832ea347eef0f2380964eddcd2e3744339ba (patch)
tree5445eea09f9fb47c71d5e2e3bf6e33140d48db7b /os/hal/ports
parentb470e1ae0feb1d173465f8083248ad4324755592 (diff)
downloadChibiOS-cd33832ea347eef0f2380964eddcd2e3744339ba.tar.gz
ChibiOS-cd33832ea347eef0f2380964eddcd2e3744339ba.tar.bz2
ChibiOS-cd33832ea347eef0f2380964eddcd2e3744339ba.zip
Event enable check API added to PAL driver.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12530 110e8d01-0319-4d1e-a829-52ad28d1bb01
Diffstat (limited to 'os/hal/ports')
-rw-r--r--os/hal/ports/STM32/LLD/GPIOv1/hal_pal_lld.h14
-rw-r--r--os/hal/ports/STM32/LLD/GPIOv2/hal_pal_lld.h14
-rw-r--r--os/hal/ports/STM32/LLD/GPIOv3/hal_pal_lld.h14
3 files changed, 42 insertions, 0 deletions
diff --git a/os/hal/ports/STM32/LLD/GPIOv1/hal_pal_lld.h b/os/hal/ports/STM32/LLD/GPIOv1/hal_pal_lld.h
index 9ec04153c..d7d26942e 100644
--- a/os/hal/ports/STM32/LLD/GPIOv1/hal_pal_lld.h
+++ b/os/hal/ports/STM32/LLD/GPIOv1/hal_pal_lld.h
@@ -414,6 +414,20 @@ typedef uint32_t iopadid_t;
#define pal_lld_get_line_event(line) \
&_pal_events[PAL_PAD(line)]
+/**
+ * @brief Pad event enable check.
+ *
+ * @param[in] port port identifier
+ * @param[in] pad pad number within the port
+ * @return Pad event status.
+ * @retval false if the pad event is disabled.
+ * @retval true if the pad event is enabled.
+ *
+ * @notapi
+ */
+#define pal_lld_ispadeventenabled(port, pad) \
+ (bool)((EXTI->IMR & (1U << (uint32_t)pad)) != 0U)
+
#if !defined(__DOXYGEN__)
extern const PALConfig pal_default_config;
extern palevent_t _pal_events[16];
diff --git a/os/hal/ports/STM32/LLD/GPIOv2/hal_pal_lld.h b/os/hal/ports/STM32/LLD/GPIOv2/hal_pal_lld.h
index 1d9033753..d6dd4df72 100644
--- a/os/hal/ports/STM32/LLD/GPIOv2/hal_pal_lld.h
+++ b/os/hal/ports/STM32/LLD/GPIOv2/hal_pal_lld.h
@@ -472,6 +472,20 @@ typedef uint32_t iopadid_t;
#define pal_lld_get_line_event(line) \
&_pal_events[PAL_PAD(line)]
+/**
+ * @brief Pad event enable check.
+ *
+ * @param[in] port port identifier
+ * @param[in] pad pad number within the port
+ * @return Pad event status.
+ * @retval false if the pad event is disabled.
+ * @retval true if the pad event is enabled.
+ *
+ * @notapi
+ */
+#define pal_lld_ispadeventenabled(port, pad) \
+ (bool)((EXTI->IMR & (1U << (uint32_t)pad)) != 0U)
+
#if !defined(__DOXYGEN__)
extern palevent_t _pal_events[16];
#endif
diff --git a/os/hal/ports/STM32/LLD/GPIOv3/hal_pal_lld.h b/os/hal/ports/STM32/LLD/GPIOv3/hal_pal_lld.h
index 638c9a81d..0348744a0 100644
--- a/os/hal/ports/STM32/LLD/GPIOv3/hal_pal_lld.h
+++ b/os/hal/ports/STM32/LLD/GPIOv3/hal_pal_lld.h
@@ -512,6 +512,20 @@ typedef uint32_t iopadid_t;
#define pal_lld_get_line_event(line) \
&_pal_events[PAL_PAD(line)]
+/**
+ * @brief Pad event enable check.
+ *
+ * @param[in] port port identifier
+ * @param[in] pad pad number within the port
+ * @return Pad event status.
+ * @retval false if the pad event is disabled.
+ * @retval true if the pad event is enabled.
+ *
+ * @notapi
+ */
+#define pal_lld_ispadeventenabled(port, pad) \
+ (bool)((EXTI->IMR & (1U << (uint32_t)pad)) != 0U)
+
#if !defined(__DOXYGEN__)
extern palevent_t _pal_events[16];
#endif