From 456490bf06d9d6eccf7a02b18fba94058c81f26c Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 8 Dec 2009 08:28:49 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1388 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/AT91SAM7/pal_lld.h | 2 +- os/hal/platforms/LPC214x/hal_lld.c | 70 ++++++++++++++++++++++++++++++++++ os/hal/platforms/LPC214x/hal_lld.h | 63 ++++++++++++++++++++++++++++++ os/hal/platforms/LPC214x/lpc214x_ssp.c | 5 +-- os/hal/platforms/LPC214x/pal_lld.c | 4 +- os/hal/platforms/LPC214x/pal_lld.h | 6 +-- os/hal/platforms/LPC214x/platform.mk | 8 ++++ os/hal/platforms/LPC214x/serial_lld.c | 7 +--- os/hal/platforms/LPC214x/vic.c | 4 +- os/hal/platforms/MSP430/pal_lld.h | 2 +- os/hal/platforms/STM32/pal_lld.h | 2 +- 11 files changed, 154 insertions(+), 19 deletions(-) create mode 100644 os/hal/platforms/LPC214x/hal_lld.c create mode 100644 os/hal/platforms/LPC214x/hal_lld.h create mode 100644 os/hal/platforms/LPC214x/platform.mk (limited to 'os/hal/platforms') 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 . +*/ + +/** + * @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 . +*/ + +/** + * @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 -#include +#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 -#include +#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 -#include - -#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 - -#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. */ -- cgit v1.2.3