From 6128152b48a577b1ee9e8d3502ffebea7582b62f Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 18 Dec 2012 09:55:48 +0000 Subject: Improvement in SPC5xx PAL drivers. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4947 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/SPC5xx/SIUL_v1/pal_lld.h | 14 ++++++++++++++ os/hal/platforms/SPC5xx/SIU_v1/pal_lld.h | 14 ++++++++++++++ 2 files changed, 28 insertions(+) (limited to 'os/hal/platforms') 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 @@ -364,6 +364,20 @@ typedef struct { #define pal_lld_clearpad(port, pad) \ (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. 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 @@ -360,6 +360,20 @@ typedef struct { #define pal_lld_clearpad(port, pad) \ (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. -- cgit v1.2.3