aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pal.h
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-06-21 09:35:39 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-06-21 09:35:39 +0000
commit8183016f1cb574d923c83eab468ca37617051d78 (patch)
tree41308cf6e02ac0bc848c2a6f5733e81f576495cd /src/lib/pal.h
parent1c7e52eb35c244e5855ea7978ab02d9540829e00 (diff)
downloadChibiOS-8183016f1cb574d923c83eab468ca37617051d78.tar.gz
ChibiOS-8183016f1cb574d923c83eab468ca37617051d78.tar.bz2
ChibiOS-8183016f1cb574d923c83eab468ca37617051d78.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1043 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'src/lib/pal.h')
-rw-r--r--src/lib/pal.h35
1 files changed, 28 insertions, 7 deletions
diff --git a/src/lib/pal.h b/src/lib/pal.h
index 96ed8c312..c45a801e6 100644
--- a/src/lib/pal.h
+++ b/src/lib/pal.h
@@ -296,6 +296,24 @@ typedef struct {
pal_lld_writegroup(port, mask, offset, bits)
#endif
+
+/**
+ * @brief Pads group mode setup.
+ * @details This function programs a pads group belonging to the same port
+ * with the specified mode.
+ *
+ * @param[in] port the port identifier
+ * @param[in] mask the group mask
+ * @param[in] mode the setup mode
+ *
+ * @note Programming an unknown or unsupported mode is silently ignored.
+ */
+#if !defined(pal_lld_setgroupmode) || defined(__DOXYGEN__)
+#define palSetGroupMode(port, mask, mode)
+#else
+#define palSetGroupMode(port, mask, mode) pal_lld_setgroupmode(port, mask, mode)
+#endif
+
/**
* @brief Reads an input pad logical state.
*
@@ -400,21 +418,24 @@ typedef struct {
#define palTogglePad(port, pad) pal_lld_togglepad(port, pad)
#endif
+
/**
- * @brief Pads mode setup.
- * @details This function programs a pads group belonging to the same port
- * with the specified mode.
+ * @brief Pad mode setup.
+ * @details This function programs a pad with the specified mode.
*
* @param[in] port the port identifier
- * @param[in] mask the group mask
+ * @param[in] pad the pad number within the port
* @param[in] mode the setup mode
*
+ * @note The default implementation not necessarily optimal. Low level drivers
+ * may optimize the function by using specific hardware or coding.
* @note Programming an unknown or unsupported mode is silently ignored.
*/
-#if !defined(pal_lld_setmode) || defined(__DOXYGEN__)
-#define palSetMode(port, mask, mode)
+#if !defined(pal_lld_setpadmode) || defined(__DOXYGEN__)
+#define palSetPadMode(port, pad, mode) \
+ palSetGroupMode(port, PAL_PORT_BIT(pad), mode)
#else
-#define palSetMode(port, mask, mode) pal_lld_setmode(port, mask, mode)
+#define palSetPadMode(port, pad, mode) pal_lld_setpadmode(port, pad, mode)
#endif
#ifdef __cplusplus