[KINETIS] Add port operations + small fixes

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8426 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
Fabio Utzig 2015-11-03 10:27:09 +00:00
parent 34674828a0
commit 8f44f19e28
1 changed files with 13 additions and 8 deletions

View File

@ -147,7 +147,8 @@ typedef struct
* *
* @notapi * @notapi
*/ */
#define pal_lld_readlatch(port) 0 #define pal_lld_readlatch(port) \
(port)->PDOR
/** /**
* @brief Writes a bits mask on a I/O port. * @brief Writes a bits mask on a I/O port.
@ -157,7 +158,8 @@ typedef struct
* *
* @notapi * @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. * @brief Sets a bits mask on a I/O port.
@ -170,7 +172,8 @@ typedef struct
* *
* @notapi * @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. * @brief Clears a bits mask on a I/O port.
@ -183,7 +186,8 @@ typedef struct
* *
* @notapi * @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. * @brief Toggles a bits mask on a I/O port.
@ -196,7 +200,8 @@ typedef struct
* *
* @notapi * @notapi
*/ */
#define pal_lld_toggleport(port, bits) #define pal_lld_toggleport(port, bits) \
(port)->PTOR = (bits)
/** /**
* @brief Reads a group of bits. * @brief Reads a group of bits.
@ -256,7 +261,7 @@ typedef struct
* *
* @notapi * @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. * @brief Clears a pad logical state to @p PAL_LOW.
@ -269,7 +274,7 @@ typedef struct
* *
* @notapi * @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. * @brief Toggles a pad logical state.
@ -282,7 +287,7 @@ typedef struct
* *
* @notapi * @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. * @brief Pad mode setup.