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/ARM7-LPC214x/pal_lld.c | |
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/ARM7-LPC214x/pal_lld.c')
-rw-r--r-- | ports/ARM7-LPC214x/pal_lld.c | 22 |
1 files changed, 17 insertions, 5 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;
+ }
}
/** @} */
|