From cbbacdb239211fc33b0423b1213d2e58ac1692da Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 8 Dec 2009 14:42:32 +0000 Subject: HAL support for AVR. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1394 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/AVR/hal_lld.c | 57 +++++++++++++++++++++++++++++++++++++ os/hal/platforms/AVR/hal_lld.h | 60 +++++++++++++++++++++++++++++++++++++++ os/hal/platforms/AVR/platform.dox | 7 +++++ os/hal/platforms/AVR/platform.mk | 6 ++++ os/hal/platforms/AVR/serial_lld.c | 10 +++++-- os/hal/platforms/AVR/serial_lld.h | 6 +++- 6 files changed, 142 insertions(+), 4 deletions(-) create mode 100644 os/hal/platforms/AVR/hal_lld.c create mode 100644 os/hal/platforms/AVR/hal_lld.h create mode 100644 os/hal/platforms/AVR/platform.mk (limited to 'os/hal/platforms/AVR') diff --git a/os/hal/platforms/AVR/hal_lld.c b/os/hal/platforms/AVR/hal_lld.c new file mode 100644 index 000000000..954b6f48a --- /dev/null +++ b/os/hal/platforms/AVR/hal_lld.c @@ -0,0 +1,57 @@ +/* + 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 AVR/hal_lld.c + * @brief AVR HAL subsystem low level driver code. + * @addtogroup AVR_HAL + * @{ + */ + +#include "ch.h" +#include "hal.h" + +/*===========================================================================*/ +/* Low Level Driver exported variables. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Low Level Driver local variables. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* 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/AVR/hal_lld.h b/os/hal/platforms/AVR/hal_lld.h new file mode 100644 index 000000000..b0698e993 --- /dev/null +++ b/os/hal/platforms/AVR/hal_lld.h @@ -0,0 +1,60 @@ +/* + 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 AVR/hal_lld.h + * @brief AVR HAL subsystem low level driver header. + * @addtogroup AVR_HAL + * @{ + */ + +#ifndef _HAL_LLD_H_ +#define _HAL_LLD_H_ + +/*===========================================================================*/ +/* Driver constants. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver pre-compile time settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* 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/AVR/platform.dox b/os/hal/platforms/AVR/platform.dox index 05eb4d76e..0302b83bb 100644 --- a/os/hal/platforms/AVR/platform.dox +++ b/os/hal/platforms/AVR/platform.dox @@ -24,6 +24,13 @@ * @ingroup AVR */ +/** + * @defgroup AVR_HAL AVR HAL Support + * @brief HAL support. + * + * @ingroup AVR_DRIVERS + */ + /** * @defgroup AVR_SERIAL AVR USART Support * @brief USART support. diff --git a/os/hal/platforms/AVR/platform.mk b/os/hal/platforms/AVR/platform.mk new file mode 100644 index 000000000..fdc5390bb --- /dev/null +++ b/os/hal/platforms/AVR/platform.mk @@ -0,0 +1,6 @@ +# List of all the AVR platform files. +PLATFORMSRC = ${CHIBIOS}/os/hal/platforms/AVR/hal_lld.c \ + ${CHIBIOS}/os/hal/platforms/AVR/serial_lld.c + +# Required include directories +PLATFORMINC = ${CHIBIOS}/os/hal/platforms/AVR diff --git a/os/hal/platforms/AVR/serial_lld.c b/os/hal/platforms/AVR/serial_lld.c index 0acf15700..1f1bef013 100644 --- a/os/hal/platforms/AVR/serial_lld.c +++ b/os/hal/platforms/AVR/serial_lld.c @@ -19,13 +19,15 @@ /** * @file AVR/serial_lld.c - * @brief AVR low level serial driver code + * @brief AVR low level serial driver code. * @addtogroup AVR_SERIAL * @{ */ -#include -#include +#include "ch.h" +#include "hal.h" + +#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__) #if USE_AVR_USART0 || defined(__DOXYGEN__) /** @@ -253,4 +255,6 @@ void sd_lld_stop(SerialDriver *sdp) { #endif } +#endif /* CH_HAL_USE_SERIAL */ + /** @} */ diff --git a/os/hal/platforms/AVR/serial_lld.h b/os/hal/platforms/AVR/serial_lld.h index c1889f8b5..266bf2a32 100644 --- a/os/hal/platforms/AVR/serial_lld.h +++ b/os/hal/platforms/AVR/serial_lld.h @@ -19,7 +19,7 @@ /** * @file AVR/serial_lld.h - * @brief AVR low level serial driver header + * @brief AVR low level serial driver header. * @addtogroup AVR_SERIAL * @{ */ @@ -27,6 +27,8 @@ #ifndef _SERIAL_LLD_H_ #define _SERIAL_LLD_H_ +#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__) + /*===========================================================================*/ /* Driver pre-compile time settings. */ /*===========================================================================*/ @@ -156,6 +158,8 @@ extern "C" { #endif /** @endcond*/ +#endif /* CH_HAL_USE_SERIAL */ + #endif /* _SERIAL_LLD_H_ */ /** @} */ -- cgit v1.2.3