aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/LLD/GPIOv1/hal_pal_lld.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/ports/STM32/LLD/GPIOv1/hal_pal_lld.h')
-rw-r--r--os/hal/ports/STM32/LLD/GPIOv1/hal_pal_lld.h47
1 files changed, 47 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 5cfe24157..a80597d64 100644
--- a/os/hal/ports/STM32/LLD/GPIOv1/hal_pal_lld.h
+++ b/os/hal/ports/STM32/LLD/GPIOv1/hal_pal_lld.h
@@ -156,6 +156,11 @@ typedef uint32_t iomode_t;
typedef uint32_t ioline_t;
/**
+ * @brief Type of an event mode.
+ */
+typedef uint32_t ioeventmode_t;
+
+/**
* @brief Port Identifier.
* @details This type can be a scalar or some kind of pointer, do not make
* any assumption about it, use the provided macros when populating
@@ -163,6 +168,11 @@ typedef uint32_t ioline_t;
*/
typedef GPIO_TypeDef * ioportid_t;
+/**
+ * @brief Type of an pad identifier.
+ */
+typedef uint32_t iopadid_t;
+
/*===========================================================================*/
/* I/O Ports Identifiers. */
/* The low level driver wraps the definitions already present in the STM32 */
@@ -356,7 +366,38 @@ typedef GPIO_TypeDef * ioportid_t;
*/
#define pal_lld_writepad(port, pad, bit) pal_lld_writegroup(port, 1, pad, bit)
+/**
+ * @brief Pad event enable.
+ * @details This function programs an event callback in the specified mode.
+ * @note Programming an unknown or unsupported mode is silently ignored.
+ *
+ * @param[in] port port identifier
+ * @param[in] pad pad number within the port
+ * @param[in] mode pad event mode
+ * @param[in] callback event callback function
+ * @param[in] arg callback argument
+ *
+ * @notapi
+ */
+#define pal_lld_enablepadevent(port, pad, mode, callback, arg) \
+ _pal_lld_enablepadevent(port, pad, mode, callback, arg)
+
+/**
+ * @brief Pad event disable.
+ * @details This function disables previously programmed event callbacks.
+ *
+ * @param[in] port port identifier
+ * @param[in] pad pad number within the port
+ *
+ * @notapi
+ */
+#define pal_lld_disablepadevent(port, pad) \
+ _pal_lld_disablepadevent(port, pad)
+
+#if !defined(__DOXYGEN__)
extern const PALConfig pal_default_config;
+extern palevent_t _pal_events[16];
+#endif
#ifdef __cplusplus
extern "C" {
@@ -365,6 +406,12 @@ extern "C" {
void _pal_lld_setgroupmode(ioportid_t port,
ioportmask_t mask,
iomode_t mode);
+ void _pal_lld_enablepadevent(ioportid_t port,
+ iopadid_t pad,
+ ioeventmode_t mode,
+ palcallback_t callback,
+ void *arg);
+ void _pal_lld_disablepadevent(ioportid_t port, iopadid_t pad);
#ifdef __cplusplus
}
#endif