aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/NRF5/LLD/GPIOv1/hal_pal_lld.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/ports/NRF5/LLD/GPIOv1/hal_pal_lld.h')
-rw-r--r--os/hal/ports/NRF5/LLD/GPIOv1/hal_pal_lld.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/os/hal/ports/NRF5/LLD/GPIOv1/hal_pal_lld.h b/os/hal/ports/NRF5/LLD/GPIOv1/hal_pal_lld.h
index 2df3fd3..e9021eb 100644
--- a/os/hal/ports/NRF5/LLD/GPIOv1/hal_pal_lld.h
+++ b/os/hal/ports/NRF5/LLD/GPIOv1/hal_pal_lld.h
@@ -155,6 +155,14 @@ typedef uint32_t iopadid_t;
#define NRF5_GPIOTE_NUM_CHANNELS (8)
#endif
+/**
+ * @brief Pad to event number
+ * @details Converts pad to GPIOTE peripheral pad event number
+ */
+#if !defined(NRF5_PAL_PAD_TO_EVENT) || defined(__DOXYGEN__)
+#define NRF5_PAL_PAD_TO_EVENT(pad) ((pad) % NRF5_GPIOTE_NUM_CHANNELS)
+#endif
+
/*===========================================================================*/
/* Implementation, some of the following macros could be implemented as */
/* functions, if so please put them in pal_lld.c. */