aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/AVR/XMEGA/LLD/GPIOv1/hal_pal_lld.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/ports/AVR/XMEGA/LLD/GPIOv1/hal_pal_lld.c')
-rw-r--r--os/hal/ports/AVR/XMEGA/LLD/GPIOv1/hal_pal_lld.c82
1 files changed, 82 insertions, 0 deletions
diff --git a/os/hal/ports/AVR/XMEGA/LLD/GPIOv1/hal_pal_lld.c b/os/hal/ports/AVR/XMEGA/LLD/GPIOv1/hal_pal_lld.c
index e7f220da4..f80d5e0e1 100644
--- a/os/hal/ports/AVR/XMEGA/LLD/GPIOv1/hal_pal_lld.c
+++ b/os/hal/ports/AVR/XMEGA/LLD/GPIOv1/hal_pal_lld.c
@@ -151,6 +151,88 @@ void _pal_lld_setgroupmode(ioportid_t port,
}
}
+/**
+ * @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
+ */
+void _pal_lld_enablepadevent(ioportid_t port,
+ iopadid_t pad,
+ ioeventmode_t mode,
+ palcallback_t callback,
+ void *arg) {
+ (void)port;
+ (void)pad;
+ (void)mode;
+ (void)callback;
+ (void)arg;
+
+ /* TODO: Implement the interruption here. */
+ /*
+ #if (port == IOPORT4)
+ #elif (port == IOPORT5)
+ #else
+ #error The selected port dont have an EXT INTx pin.
+ */
+ //}
+}
+
+/**
+ * @brief Make a line identifier with a given port and pad identifiers.
+ *
+ * @param[in] port the port identifier
+ * @param[in] pad the pad identifier
+ *
+ * @return line the builded line
+ *
+ * @notapi
+ */
+ioline_t _pal_lld_setlineid(ioportid_t port, uint8_t pad) {
+
+ ioline_t line;
+
+ line.port = port;
+ line.pad = pad;
+
+ return line;
+}
+
+/**
+ * @brief Get a port identifier from a line identifier.
+ *
+ * @param[in] line the line identifier
+ *
+ * @return port the port of the corresponding line
+ *
+ * @notapi
+ */
+ioportid_t _pal_lld_getportfromline(ioline_t line) {
+
+ return line.port;
+}
+
+/**
+ * @brief Get a pad identifier from a line identifier.
+ *
+ * @param[in] line the line identifier
+ *
+ * @return pad the pad of the corresponding line
+ *
+ * @notapi
+ */
+uint8_t _pal_lld_getpadfromline(ioline_t line) {
+
+ return line.pad;
+}
+
#endif /* HAL_USE_PAL */
/** @} */