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 /demos/ARM7-LPC214x-G++ | |
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 'demos/ARM7-LPC214x-G++')
-rw-r--r-- | demos/ARM7-LPC214x-G++/Makefile | 1 | ||||
-rw-r--r-- | demos/ARM7-LPC214x-G++/board.c | 21 | ||||
-rw-r--r-- | demos/ARM7-LPC214x-G++/board.h | 4 |
3 files changed, 16 insertions, 10 deletions
diff --git a/demos/ARM7-LPC214x-G++/Makefile b/demos/ARM7-LPC214x-G++/Makefile index 24a8ce684..894a37e61 100644 --- a/demos/ARM7-LPC214x-G++/Makefile +++ b/demos/ARM7-LPC214x-G++/Makefile @@ -50,6 +50,7 @@ include ../../test/test.mk # setting.
CSRC = ../../ports/ARM7/chcore.c \
../../ports/ARM7-LPC214x/vic.c \
+ ../../ports/ARM7-LPC214x/pal_lld.c \
../../ports/ARM7-LPC214x/lpc214x_serial.c \
${KERNSRC} \
${TESTSRC} \
diff --git a/demos/ARM7-LPC214x-G++/board.c b/demos/ARM7-LPC214x-G++/board.c index c3c39a5a9..68b060dbd 100644 --- a/demos/ARM7-LPC214x-G++/board.c +++ b/demos/ARM7-LPC214x-G++/board.c @@ -59,6 +59,18 @@ static CH_IRQ_HANDLER(T0IrqHandler) { }
/*
+ * Digital I/O ports static configuration as defined in @p board.h.
+ */
+static const LPC214xFIOConfig config =
+{
+ VAL_PINSEL0,
+ VAL_PINSEL1,
+ VAL_PINSEL2,
+ {VAL_FIO0PIN, VAL_FIO0DIR},
+ {VAL_FIO1PIN, VAL_FIO1DIR}
+};
+
+/*
* Early initialization code.
* This initialization is performed just after reset before BSS and DATA
* segments initialization.
@@ -101,14 +113,7 @@ void hwinit0(void) { /*
* I/O pins configuration.
*/
- PINSEL0 = VAL_PINSEL0;
- PINSEL1 = VAL_PINSEL1;
- PINSEL2 = VAL_PINSEL2;
- palInit();
- pal_lld_lpc214x_set_direction(IOPORT_A, VAL_FIO0DIR);
- palWritePort(IOPORT_A, 0xFFFFFFFF);
- pal_lld_lpc214x_set_direction(IOPORT_B, VAL_FIO1DIR);
- palWritePort(IOPORT_B, 0xFFFFFFFF);
+ palInit(&config);
}
/*
diff --git a/demos/ARM7-LPC214x-G++/board.h b/demos/ARM7-LPC214x-G++/board.h index fee4baa61..022383032 100644 --- a/demos/ARM7-LPC214x-G++/board.h +++ b/demos/ARM7-LPC214x-G++/board.h @@ -20,9 +20,7 @@ #ifndef _BOARD_H_
#define _BOARD_H_
-#ifndef _LPC214X_H_
#include "lpc214x.h"
-#endif
#define BOARD_OLIMEX_LCP_P2148
@@ -64,6 +62,8 @@ #define VAL_PINSEL2 0x00000004
#define VAL_FIO0DIR 0xB0703C00
#define VAL_FIO1DIR 0x00000000
+#define VAL_FIO0PIN 0xFFFFFFFF
+#define VAL_FIO1PIN 0xFFFFFFFF
#define PA_LED1 10
#define PA_LED2 11
|