aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/platforms
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-12-18 09:55:48 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-12-18 09:55:48 +0000
commit6128152b48a577b1ee9e8d3502ffebea7582b62f (patch)
treeaf72fe897cf25e675117f8d6822fd20f641c4e6f /os/hal/platforms
parente4cd1a369f0c6a23f4949a90b544f3e9f2d16715 (diff)
downloadChibiOS-6128152b48a577b1ee9e8d3502ffebea7582b62f.tar.gz
ChibiOS-6128152b48a577b1ee9e8d3502ffebea7582b62f.tar.bz2
ChibiOS-6128152b48a577b1ee9e8d3502ffebea7582b62f.zip
Improvement in SPC5xx PAL drivers.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4947 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms')
-rw-r--r--os/hal/platforms/SPC5xx/SIUL_v1/pal_lld.h14
-rw-r--r--os/hal/platforms/SPC5xx/SIU_v1/pal_lld.h14
2 files changed, 28 insertions, 0 deletions
diff --git a/os/hal/platforms/SPC5xx/SIUL_v1/pal_lld.h b/os/hal/platforms/SPC5xx/SIUL_v1/pal_lld.h
index 548e8684e..d5b59412f 100644
--- a/os/hal/platforms/SPC5xx/SIUL_v1/pal_lld.h
+++ b/os/hal/platforms/SPC5xx/SIUL_v1/pal_lld.h
@@ -365,6 +365,20 @@ typedef struct {
(SIU.GPDO[((port) * 16) + (pad)].R = 0)
/**
+ * @brief Toggles a pad logical state.
+ * @note The @ref PAL provides a default software implementation of this
+ * functionality, implement this function if can optimize it by using
+ * special hardware functionalities or special coding.
+ *
+ * @param[in] port port identifier
+ * @param[in] pad pad number within the port
+ *
+ * @notapi
+ */
+#define pal_lld_togglepad(port, pad) \
+ (SIU.GPDO[((port) * 16) + (pad)].R = ~SIU.GPDO[((port) * 16) + (pad)].R)
+
+/**
* @brief Pad mode setup.
* @details This function programs a pad with the specified mode.
* @note The @ref PAL provides a default software implementation of this
diff --git a/os/hal/platforms/SPC5xx/SIU_v1/pal_lld.h b/os/hal/platforms/SPC5xx/SIU_v1/pal_lld.h
index 4d4cd319a..ae7678ba1 100644
--- a/os/hal/platforms/SPC5xx/SIU_v1/pal_lld.h
+++ b/os/hal/platforms/SPC5xx/SIU_v1/pal_lld.h
@@ -361,6 +361,20 @@ typedef struct {
(SIU.GPDO[((port) * 16) + (pad)].R = 0)
/**
+ * @brief Toggles a pad logical state.
+ * @note The @ref PAL provides a default software implementation of this
+ * functionality, implement this function if can optimize it by using
+ * special hardware functionalities or special coding.
+ *
+ * @param[in] port port identifier
+ * @param[in] pad pad number within the port
+ *
+ * @notapi
+ */
+#define pal_lld_togglepad(port, pad) \
+ (SIU.GPDO[((port) * 16) + (pad)].R = ~SIU.GPDO[((port) * 16) + (pad)].R)
+
+/**
* @brief Pad mode setup.
* @details This function programs a pad with the specified mode.
* @note The @ref PAL provides a default software implementation of this