aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Utzig <utzig@utzig.org>2015-11-03 10:27:09 +0000
committerFabio Utzig <utzig@utzig.org>2015-11-03 10:27:09 +0000
commit8f44f19e28f12bbf3628064fb9ed4cb7637755b8 (patch)
tree38ac39276e5134a02c6c6377ca2e482e2a45ae5b
parent34674828a0bc31e48af8ca27c011a39e19f67664 (diff)
downloadChibiOS-8f44f19e28f12bbf3628064fb9ed4cb7637755b8.tar.gz
ChibiOS-8f44f19e28f12bbf3628064fb9ed4cb7637755b8.tar.bz2
ChibiOS-8f44f19e28f12bbf3628064fb9ed4cb7637755b8.zip
[KINETIS] Add port operations + small fixes
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8426 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r--os/hal/ports/KINETIS/KL2x/pal_lld.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/os/hal/ports/KINETIS/KL2x/pal_lld.h b/os/hal/ports/KINETIS/KL2x/pal_lld.h
index e08d77dfb..8b38709a5 100644
--- a/os/hal/ports/KINETIS/KL2x/pal_lld.h
+++ b/os/hal/ports/KINETIS/KL2x/pal_lld.h
@@ -147,7 +147,8 @@ typedef struct
*
* @notapi
*/
-#define pal_lld_readlatch(port) 0
+#define pal_lld_readlatch(port) \
+ (port)->PDOR
/**
* @brief Writes a bits mask on a I/O port.
@@ -157,7 +158,8 @@ typedef struct
*
* @notapi
*/
-#define pal_lld_writeport(port, bits)
+#define pal_lld_writeport(port, bits) \
+ (port)->PDOR = (bits)
/**
* @brief Sets a bits mask on a I/O port.
@@ -170,7 +172,8 @@ typedef struct
*
* @notapi
*/
-#define pal_lld_setport(port, bits)
+#define pal_lld_setport(port, bits) \
+ (port)->PSOR = (bits)
/**
* @brief Clears a bits mask on a I/O port.
@@ -183,7 +186,8 @@ typedef struct
*
* @notapi
*/
-#define pal_lld_clearport(port, bits)
+#define pal_lld_clearport(port, bits) \
+ (port)->PCOR = (bits)
/**
* @brief Toggles a bits mask on a I/O port.
@@ -196,7 +200,8 @@ typedef struct
*
* @notapi
*/
-#define pal_lld_toggleport(port, bits)
+#define pal_lld_toggleport(port, bits) \
+ (port)->PTOR = (bits)
/**
* @brief Reads a group of bits.
@@ -256,7 +261,7 @@ typedef struct
*
* @notapi
*/
-#define pal_lld_setpad(port, pad) (port)->PSOR |= ((uint32_t) 1 << (pad))
+#define pal_lld_setpad(port, pad) (port)->PSOR = ((uint32_t) 1 << (pad))
/**
* @brief Clears a pad logical state to @p PAL_LOW.
@@ -269,7 +274,7 @@ typedef struct
*
* @notapi
*/
-#define pal_lld_clearpad(port, pad) (port)->PCOR |= ((uint32_t) 1 << (pad))
+#define pal_lld_clearpad(port, pad) (port)->PCOR = ((uint32_t) 1 << (pad))
/**
* @brief Toggles a pad logical state.
@@ -282,7 +287,7 @@ typedef struct
*
* @notapi
*/
-#define pal_lld_togglepad(port, pad) (port)->PTOR |= ((uint32_t) 1 << (pad))
+#define pal_lld_togglepad(port, pad) (port)->PTOR = ((uint32_t) 1 << (pad))
/**
* @brief Pad mode setup.