aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--demos/ARM7-LPC214x-GCC/Makefile13
-rw-r--r--os/hal/platforms/AT91SAM7/pal_lld.h2
-rw-r--r--os/hal/platforms/LPC214x/hal_lld.c70
-rw-r--r--os/hal/platforms/LPC214x/hal_lld.h63
-rw-r--r--os/hal/platforms/LPC214x/lpc214x_ssp.c5
-rw-r--r--os/hal/platforms/LPC214x/pal_lld.c4
-rw-r--r--os/hal/platforms/LPC214x/pal_lld.h6
-rw-r--r--os/hal/platforms/LPC214x/platform.mk8
-rw-r--r--os/hal/platforms/LPC214x/serial_lld.c7
-rw-r--r--os/hal/platforms/LPC214x/vic.c4
-rw-r--r--os/hal/platforms/MSP430/pal_lld.h2
-rw-r--r--os/hal/platforms/STM32/pal_lld.h2
12 files changed, 159 insertions, 27 deletions
diff --git a/demos/ARM7-LPC214x-GCC/Makefile b/demos/ARM7-LPC214x-GCC/Makefile
index 792ff4fbd..10eb571ae 100644
--- a/demos/ARM7-LPC214x-GCC/Makefile
+++ b/demos/ARM7-LPC214x-GCC/Makefile
@@ -44,6 +44,8 @@ LDSCRIPT = ch.ld
# Imported source files
CHIBIOS = ../..
+include ${CHIBIOS}/os/hal/hal.mk
+include ${CHIBIOS}/os/hal/platforms/LPC214x/platform.mk
include ${CHIBIOS}/os/ports/GCC/ARM7/port.mk
include ${CHIBIOS}/os/kernel/kernel.mk
include ${CHIBIOS}/test/test.mk
@@ -53,11 +55,8 @@ include ${CHIBIOS}/test/test.mk
CSRC = ${PORTSRC} \
${KERNSRC} \
${TESTSRC} \
- ${CHIBIOS}/os/io/pal.c \
- ${CHIBIOS}/os/io/serial.c \
- ${CHIBIOS}/os/io/platforms/LPC214x/pal_lld.c \
- ${CHIBIOS}/os/io/platforms/LPC214x/serial_lld.c \
- ${CHIBIOS}/os/io/platforms/LPC214x/vic.c \
+ ${HALSRC} \
+ ${PLATFORMSRC} \
${CHIBIOS}/os/io/platforms/LPC214x/lpc214x_ssp.c \
${CHIBIOS}/os/various/evtimer.c \
board.c buzzer.c mmcsd.c main.c
@@ -90,9 +89,7 @@ TCPPSRC =
ASMSRC = $(PORTASM) \
${CHIBIOS}/os/ports/GCC/ARM7/LPC214x/vectors.s
-INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \
- ${CHIBIOS}/os/io \
- ${CHIBIOS}/os/io/platforms/LPC214x \
+INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) $(HALINC) $(PLATFORMINC) \
${CHIBIOS}/os/various \
${CHIBIOS}/os/ports/GCC/ARM7/LPC214x
diff --git a/os/hal/platforms/AT91SAM7/pal_lld.h b/os/hal/platforms/AT91SAM7/pal_lld.h
index ad1fad249..ecfb7711d 100644
--- a/os/hal/platforms/AT91SAM7/pal_lld.h
+++ b/os/hal/platforms/AT91SAM7/pal_lld.h
@@ -54,7 +54,7 @@ typedef struct {
/**
* @brief AT91SAM7 PIO static initializer.
* @details An instance of this structure must be passed to @p palInit() at
- * system startup time in order to initialized the digital I/O
+ * system startup time in order to initialize the digital I/O
* subsystem. This represents only the initial setup, specific pads
* or whole ports can be reprogrammed at later time.
*/
diff --git a/os/hal/platforms/LPC214x/hal_lld.c b/os/hal/platforms/LPC214x/hal_lld.c
new file mode 100644
index 000000000..09d5c639d
--- /dev/null
+++ b/os/hal/platforms/LPC214x/hal_lld.c
@@ -0,0 +1,70 @@
+/*
+ ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio.
+
+ This file is part of ChibiOS/RT.
+
+ ChibiOS/RT is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ ChibiOS/RT is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+/**
+ * @file templates/hal_lld.c
+ * @brief HAL Driver subsystem low level driver source template
+ * @addtogroup HAL_LLD
+ * @{
+ */
+
+#include "ch.h"
+#include "hal.h"
+
+/*===========================================================================*/
+/* Low Level Driver exported variables. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Low Level Driver local variables. */
+/*===========================================================================*/
+
+/**
+ * @brief PAL setup.
+ * @details Digital I/O ports static configuration as defined in @p board.h.
+ */
+const LPC214xFIOConfig pal_default_config =
+{
+ VAL_PINSEL0,
+ VAL_PINSEL1,
+ VAL_PINSEL2,
+ {VAL_FIO0PIN, VAL_FIO0DIR},
+ {VAL_FIO1PIN, VAL_FIO1DIR}
+};
+
+/*===========================================================================*/
+/* Low Level Driver local functions. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Low Level Driver interrupt handlers. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Low Level Driver exported functions. */
+/*===========================================================================*/
+
+/**
+ * @brief Low level HAL driver initialization.
+ */
+void hal_lld_init(void) {
+
+}
+
+/** @} */
diff --git a/os/hal/platforms/LPC214x/hal_lld.h b/os/hal/platforms/LPC214x/hal_lld.h
new file mode 100644
index 000000000..40345ec72
--- /dev/null
+++ b/os/hal/platforms/LPC214x/hal_lld.h
@@ -0,0 +1,63 @@
+/*
+ ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio.
+
+ This file is part of ChibiOS/RT.
+
+ ChibiOS/RT is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ ChibiOS/RT is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+/**
+ * @file templates/hal_lld.h
+ * @brief HAL subsystem low level driver header template
+ * @addtogroup HAL_LLD
+ * @{
+ */
+
+#ifndef _HAL_LLD_H_
+#define _HAL_LLD_H_
+
+#include "lpc214x.h"
+#include "vic.h"
+
+/*===========================================================================*/
+/* Driver pre-compile time settings. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver constants. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Derived constants and error checks. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver data structures and types. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* External declarations. */
+/*===========================================================================*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ void hal_lld_init(void);
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _HAL_LLD_H_ */
+
+/** @} */
diff --git a/os/hal/platforms/LPC214x/lpc214x_ssp.c b/os/hal/platforms/LPC214x/lpc214x_ssp.c
index af9915395..d6b465483 100644
--- a/os/hal/platforms/LPC214x/lpc214x_ssp.c
+++ b/os/hal/platforms/LPC214x/lpc214x_ssp.c
@@ -24,10 +24,9 @@
* @{
*/
-#include <ch.h>
-#include <pal.h>
+#include "ch.h""
+#include "hal.h"
-#include "lpc214x.h"
#include "lpc214x_ssp.h"
#if LPC214x_SSP_USE_MUTEX
diff --git a/os/hal/platforms/LPC214x/pal_lld.c b/os/hal/platforms/LPC214x/pal_lld.c
index 666afef55..5a024fff8 100644
--- a/os/hal/platforms/LPC214x/pal_lld.c
+++ b/os/hal/platforms/LPC214x/pal_lld.c
@@ -24,8 +24,8 @@
* @{
*/
-#include <ch.h>
-#include <pal.h>
+#include "ch.h"
+#include "hal.h"
/**
* @brief LPC214x I/O ports configuration.
diff --git a/os/hal/platforms/LPC214x/pal_lld.h b/os/hal/platforms/LPC214x/pal_lld.h
index 565b3333a..f007abda8 100644
--- a/os/hal/platforms/LPC214x/pal_lld.h
+++ b/os/hal/platforms/LPC214x/pal_lld.h
@@ -27,8 +27,6 @@
#ifndef _PAL_LLD_H_
#define _PAL_LLD_H_
-#include "lpc214x.h"
-
/*===========================================================================*/
/* Unsupported modes and specific modes */
/*===========================================================================*/
@@ -54,7 +52,7 @@ typedef struct {
/**
* @brief LPC214x FIO static initializer.
* @details An instance of this structure must be passed to @p palInit() at
- * system startup time in order to initialized the digital I/O
+ * system startup time in order to initialize the digital I/O
* subsystem. This represents only the initial setup, specific pads
* or whole ports can be reprogrammed at later time.
*/
@@ -237,6 +235,8 @@ typedef FIO * ioportid_t;
(port)->FIO_DIR = (dir); \
}
+extern const LPC214xFIOConfig pal_default_config;
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/os/hal/platforms/LPC214x/platform.mk b/os/hal/platforms/LPC214x/platform.mk
new file mode 100644
index 000000000..3625b157f
--- /dev/null
+++ b/os/hal/platforms/LPC214x/platform.mk
@@ -0,0 +1,8 @@
+# List of all the LPC214x platform files.
+PLATFORMSRC = ${CHIBIOS}/os/hal/platforms/LPC214x/hal_lld.c \
+ ${CHIBIOS}/os/hal/platforms/LPC214x/pal_lld.c \
+ ${CHIBIOS}/os/hal/platforms/LPC214x/serial_lld.c \
+ ${CHIBIOS}/os/hal/platforms/LPC214x/vic.c
+
+# Required include directories
+PLATFORMINC = ${CHIBIOS}/os/hal/platforms/LPC214x
diff --git a/os/hal/platforms/LPC214x/serial_lld.c b/os/hal/platforms/LPC214x/serial_lld.c
index c7db717b2..e7ccc6dd0 100644
--- a/os/hal/platforms/LPC214x/serial_lld.c
+++ b/os/hal/platforms/LPC214x/serial_lld.c
@@ -24,11 +24,8 @@
* @{
*/
-#include <ch.h>
-#include <serial.h>
-
-#include "board.h"
-#include "vic.h"
+#include "ch.h"
+#include "hal.h"
#if USE_LPC214x_UART0 || defined(__DOXYGEN__)
/** @brief UART0 serial driver identifier.*/
diff --git a/os/hal/platforms/LPC214x/vic.c b/os/hal/platforms/LPC214x/vic.c
index 685830063..b94b4b53f 100644
--- a/os/hal/platforms/LPC214x/vic.c
+++ b/os/hal/platforms/LPC214x/vic.c
@@ -24,9 +24,7 @@
* @{
*/
-#include <ch.h>
-
-#include "lpc214x.h"
+#include "ch.h"
/**
* @brief VIC Initialization.
diff --git a/os/hal/platforms/MSP430/pal_lld.h b/os/hal/platforms/MSP430/pal_lld.h
index 0519af3b1..198728c2f 100644
--- a/os/hal/platforms/MSP430/pal_lld.h
+++ b/os/hal/platforms/MSP430/pal_lld.h
@@ -73,7 +73,7 @@ typedef struct {
/**
* @brief MSP430 I/O ports static initializer.
* @details An instance of this structure must be passed to @p palInit() at
- * system startup time in order to initialized the digital I/O
+ * system startup time in order to initialize the digital I/O
* subsystem. This represents only the initial setup, specific pads
* or whole ports can be reprogrammed at later time.
*/
diff --git a/os/hal/platforms/STM32/pal_lld.h b/os/hal/platforms/STM32/pal_lld.h
index 2b21880db..72866b057 100644
--- a/os/hal/platforms/STM32/pal_lld.h
+++ b/os/hal/platforms/STM32/pal_lld.h
@@ -48,7 +48,7 @@ typedef struct {
/**
* @brief STM32 GPIO static initializer.
* @details An instance of this structure must be passed to @p palInit() at
- * system startup time in order to initialized the digital I/O
+ * system startup time in order to initialize the digital I/O
* subsystem. This represents only the initial setup, specific pads
* or whole ports can be reprogrammed at later time.
*/