diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-07-04 15:33:21 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-07-04 15:33:21 +0000 |
commit | 2b5e0544c8285976d94abe21268342698c94dd85 (patch) | |
tree | c7cf0e209458e1622f9e399bc167e2c66f5f0586 /ports | |
parent | 979da150361becdb50625d056915f81099710122 (diff) | |
download | ChibiOS-2b5e0544c8285976d94abe21268342698c94dd85.tar.gz ChibiOS-2b5e0544c8285976d94abe21268342698c94dd85.tar.bz2 ChibiOS-2b5e0544c8285976d94abe21268342698c94dd85.zip |
Completed PAL support for LPC214x.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1056 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'ports')
-rw-r--r-- | ports/ARM7-LPC214x/pal_lld.c | 22 | ||||
-rw-r--r-- | ports/ARM7-LPC214x/pal_lld.h | 8 | ||||
-rw-r--r-- | ports/ARM7-LPC214x/port.dox | 12 | ||||
-rw-r--r-- | ports/ARMCM3-STM32F103/port.dox | 2 |
4 files changed, 32 insertions, 12 deletions
diff --git a/ports/ARM7-LPC214x/pal_lld.c b/ports/ARM7-LPC214x/pal_lld.c index 3d300bb55..e197a39fc 100644 --- a/ports/ARM7-LPC214x/pal_lld.c +++ b/ports/ARM7-LPC214x/pal_lld.c @@ -29,7 +29,7 @@ /**
* @brief LPC214x I/O ports configuration.
- * @details .
+ * @details FIO units and PINSEL registers initialization.
*
* @param[in] config the LPC214x ports configuration
*/
@@ -64,14 +64,26 @@ void _pal_lld_init(const LPC214xFIOConfig *config) { *
* @note This function is not meant to be invoked directly by the application
* code.
- * @note @p PAL_MODE_UNCONNECTED is implemented as push pull output.
- * @note Writing on pads programmed as pull-up or pull-down has the side
- * effect to modify the resistor setting because the output latched data
- * is used for the resistor selection.
+ * @note @p PAL_MODE_UNCONNECTED is implemented as push pull output with high
+ * state.
+ * @note This function does not alter the @p PINSELx registers. Alternate
+ * functions setup must be handled by device-specific code.
*/
void _pal_lld_setgroupmode(ioportid_t port,
ioportmask_t mask,
uint_fast8_t mode) {
+
+ switch (mode) {
+ case PAL_MODE_RESET:
+ case PAL_MODE_INPUT:
+ port->FIO_DIR &= ~mask;
+ break;
+ case PAL_MODE_UNCONNECTED:
+ port->FIO_PIN |= mask;
+ case PAL_MODE_OUTPUT_PUSHPULL:
+ port->FIO_DIR |= mask;
+ break;
+ }
}
/** @} */
diff --git a/ports/ARM7-LPC214x/pal_lld.h b/ports/ARM7-LPC214x/pal_lld.h index 2bbb0676b..143fc103f 100644 --- a/ports/ARM7-LPC214x/pal_lld.h +++ b/ports/ARM7-LPC214x/pal_lld.h @@ -27,9 +27,7 @@ #ifndef _PAL_LLD_H_
#define _PAL_LLD_H_
-#ifndef _LPC214X_H_
#include "lpc214x.h"
-#endif
/*===========================================================================*/
/* Unsupported modes and specific modes */
@@ -210,9 +208,9 @@ typedef FIO * ioportid_t; *
* @note This function is not meant to be invoked directly by the application
* code.
- * @note @p PAL_MODE_UNCONNECTED is implemented as output as recommended by
- * the MSP430x1xx Family User's Guide.
- * @note This function does not alter the @p PxSEL registers. Alternate
+ * @note @p PAL_MODE_UNCONNECTED is implemented as push pull output with high
+ * state.
+ * @note This function does not alter the @p PINSELx registers. Alternate
* functions setup must be handled by device-specific code.
*/
#define pal_lld_setgroupmode(port, mask, mode) \
diff --git a/ports/ARM7-LPC214x/port.dox b/ports/ARM7-LPC214x/port.dox index 332c6c191..e46ac4328 100644 --- a/ports/ARM7-LPC214x/port.dox +++ b/ports/ARM7-LPC214x/port.dox @@ -51,8 +51,18 @@ * - Output latched regardless of the pad setting.
* - Direct read of input pads regardless of the pad setting.
* .
- * The only non atomic operations are bit toggling and bus/group writing.
+ * <h2>Supported Setup Modes</h2>
+ * - @p PAL_MODE_RESET.
+ * - @p PAL_MODE_UNCONNECTED.
+ * - @p PAL_MODE_INPUT.
+ * - @p PAL_MODE_OUTPUT_PUSHPULL.
+ * .
+ * Any attempt to setup an invalid mode is ignored.
*
+ * <h2>Suboptimal Behavior</h2>
+ * - Pad/port toggling operations are not atomic.
+ * - Pad/group mode setup is not atomic.
+ * .
* @ingroup LPC214x
*/
diff --git a/ports/ARMCM3-STM32F103/port.dox b/ports/ARMCM3-STM32F103/port.dox index 3e3544ee5..b1828425c 100644 --- a/ports/ARMCM3-STM32F103/port.dox +++ b/ports/ARMCM3-STM32F103/port.dox @@ -52,7 +52,7 @@ *
* <h2>Suboptimal Behavior</h2>
* Some GPIO features are less than optimal:
- * - Pad/group/port toggling operations are not atomic.
+ * - Pad/port toggling operations are not atomic.
* - Pad/group mode setup is not atomic.
* - Writing on pads/groups/ports programmed as input with pull-up/down
* resistor can change the resistor setting because the output latch is
|