From 7148a664b5c73138a504cd61a1882cfb91ba3b7a Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 12 Sep 2011 13:40:44 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3309 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/templates/ext_lld.h | 125 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 os/hal/templates/ext_lld.h (limited to 'os/hal/templates/ext_lld.h') diff --git a/os/hal/templates/ext_lld.h b/os/hal/templates/ext_lld.h new file mode 100644 index 000000000..eb5a624a4 --- /dev/null +++ b/os/hal/templates/ext_lld.h @@ -0,0 +1,125 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 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/ext_lld.h + * @brief EXT Driver subsystem low level driver header template. + * + * @addtogroup EXT + * @{ + */ + +#ifndef _EXT_LLD_H_ +#define _EXT_LLD_H_ + +#if HAL_USE_EXT || defined(__DOXYGEN__) + +/*===========================================================================*/ +/* Driver constants. */ +/*===========================================================================*/ + +/** + * @brief Available number of EXT channels. + */ +#define EXT_MAX_CHANNELS 20 + +/*===========================================================================*/ +/* Driver pre-compile time settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Derived constants and error checks. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver data structures and types. */ +/*===========================================================================*/ + +/** + * @brief EXT channel identifier. + */ +typedef uint32_t expchannel_t; + +/** + * @brief Type of an EXT generic notification callback. + * + * @param[in] extp pointer to the @p EXPDriver object triggering the + * callback + */ +typedef void (*extcallback_t)(EXTDriver *extp); + +/** + * @brief Channel configuration structure. + */ +typedef struct { + uint32_t mode; /**< @brief Channel mode. */ + extcallback_t cb; /**< @brief Channel callback. */ +} EXTChannelConfig; + +/** + * @brief Driver configuration structure. + * @note It could be empty on some architectures. + */ +typedef struct { + /** + * @brief Channel configurations. + */ + EXTChannelConfig channels[EXT_MAX_CHANNELS]; + /* End of the mandatory fields.*/ +} EXTConfig; + +/** + * @brief Structure representing an EXT driver. + */ +struct EXTDriver { + /** + * @brief Driver state. + */ + extstate_t state; + /** + * @brief Current configuration data. + */ + const EXTConfig *config; + /* End of the mandatory fields.*/ +}; + +/*===========================================================================*/ +/* Driver macros. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* External declarations. */ +/*===========================================================================*/ + +#ifdef __cplusplus +extern "C" { +#endif + void ext_lld_init(void); + void ext_lld_start(EXTDriver *extp); + void ext_lld_stop(EXTDriver *extp); +#ifdef __cplusplus +} +#endif + +#endif /* HAL_USE_EXT */ + +#endif /* _EXT_LLD_H_ */ + +/** @} */ -- cgit v1.2.3 From fbac4d253d67cc5b1ec39166ce1abb8124b1e3a8 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 13 Sep 2011 12:40:42 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3314 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/templates/ext_lld.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'os/hal/templates/ext_lld.h') diff --git a/os/hal/templates/ext_lld.h b/os/hal/templates/ext_lld.h index eb5a624a4..494cef1b9 100644 --- a/os/hal/templates/ext_lld.h +++ b/os/hal/templates/ext_lld.h @@ -114,6 +114,8 @@ extern "C" { void ext_lld_init(void); void ext_lld_start(EXTDriver *extp); void ext_lld_stop(EXTDriver *extp); + void ext_lld_channel_enable(EXTDriver *extp, expchannel_t channel); + void ext_lld_channel_disable(EXTDriver *extp, expchannel_t channel); #ifdef __cplusplus } #endif -- cgit v1.2.3 From c39d08fc2ae9c43f73114e24292520306bddde19 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 23 Sep 2011 15:48:55 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3384 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/templates/ext_lld.h | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'os/hal/templates/ext_lld.h') diff --git a/os/hal/templates/ext_lld.h b/os/hal/templates/ext_lld.h index 494cef1b9..f299a8914 100644 --- a/os/hal/templates/ext_lld.h +++ b/os/hal/templates/ext_lld.h @@ -63,14 +63,23 @@ typedef uint32_t expchannel_t; * @param[in] extp pointer to the @p EXPDriver object triggering the * callback */ -typedef void (*extcallback_t)(EXTDriver *extp); +typedef void (*extcallback_t)(EXTDriver *extp, expchannel_t channel); /** * @brief Channel configuration structure. */ typedef struct { - uint32_t mode; /**< @brief Channel mode. */ - extcallback_t cb; /**< @brief Channel callback. */ + /** + * @brief Channel mode. + */ + uint32_t mode; + /** + * @brief Channel callback. + * @details In the STM32 implementation a @p NULL callback pointer is + * valid and configures the channel as an event sources instead + * of an interrupt source. + */ + extcallback_t cb; } EXTChannelConfig; /** @@ -108,6 +117,10 @@ struct EXTDriver { /* External declarations. */ /*===========================================================================*/ +#if !defined(__DOXYGEN__) +extern EXTDriver EXTD1; +#endif + #ifdef __cplusplus extern "C" { #endif -- cgit v1.2.3 From de5dcbba856524599a8f06d3a9bdbf1b01db44c2 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 21 Jan 2012 14:29:42 +0000 Subject: License text updated with new year. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3846 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/templates/ext_lld.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'os/hal/templates/ext_lld.h') diff --git a/os/hal/templates/ext_lld.h b/os/hal/templates/ext_lld.h index f299a8914..9b35f6350 100644 --- a/os/hal/templates/ext_lld.h +++ b/os/hal/templates/ext_lld.h @@ -1,6 +1,6 @@ /* ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011 Giovanni Di Sirio. + 2011,2012 Giovanni Di Sirio. This file is part of ChibiOS/RT. -- cgit v1.2.3 From 184a71345c6a36a9a8664eda8fbcc3ea728267a8 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 2 Feb 2013 10:58:09 +0000 Subject: Updated license years. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5102 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/templates/ext_lld.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'os/hal/templates/ext_lld.h') diff --git a/os/hal/templates/ext_lld.h b/os/hal/templates/ext_lld.h index 9b35f6350..5c4c4398a 100644 --- a/os/hal/templates/ext_lld.h +++ b/os/hal/templates/ext_lld.h @@ -1,6 +1,6 @@ /* ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. + 2011,2012,2013 Giovanni Di Sirio. This file is part of ChibiOS/RT. -- cgit v1.2.3 From 9708a3c30ff4ce1d95b3333b6be4375138a89be5 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 24 Feb 2013 15:35:53 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5313 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/templates/ext_lld.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'os/hal/templates/ext_lld.h') diff --git a/os/hal/templates/ext_lld.h b/os/hal/templates/ext_lld.h index 5c4c4398a..d1f971713 100644 --- a/os/hal/templates/ext_lld.h +++ b/os/hal/templates/ext_lld.h @@ -44,6 +44,19 @@ /* Driver pre-compile time settings. */ /*===========================================================================*/ +/** + * @name Configuration options + * @{ + */ +/** + * @brief EXT driver enable switch. + * @details If set to @p TRUE the support for EXT1 is included. + */ +#if !defined(PLATFORM_EXT_USE_EXT1) || defined(__DOXYGEN__) +#define PLATFORM_EXT_USE_EXT1 FALSE +#endif +/** @} */ + /*===========================================================================*/ /* Derived constants and error checks. */ /*===========================================================================*/ @@ -117,7 +130,7 @@ struct EXTDriver { /* External declarations. */ /*===========================================================================*/ -#if !defined(__DOXYGEN__) +#if PLATFORM_EXT_USE_EXT1 && !defined(__DOXYGEN__) extern EXTDriver EXTD1; #endif -- cgit v1.2.3 From ac598a7b1c4227cbffbbb1af449f2be21e6976a5 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 25 Feb 2013 13:10:39 +0000 Subject: LLD templates fixed. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5319 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/templates/ext_lld.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'os/hal/templates/ext_lld.h') diff --git a/os/hal/templates/ext_lld.h b/os/hal/templates/ext_lld.h index d1f971713..981253d8f 100644 --- a/os/hal/templates/ext_lld.h +++ b/os/hal/templates/ext_lld.h @@ -53,7 +53,7 @@ * @details If set to @p TRUE the support for EXT1 is included. */ #if !defined(PLATFORM_EXT_USE_EXT1) || defined(__DOXYGEN__) -#define PLATFORM_EXT_USE_EXT1 FALSE +#define PLATFORM_EXT_USE_EXT1 FALSE #endif /** @} */ -- cgit v1.2.3 From 853216256ad4cdacf5f94edb7d6b738c6be165a1 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 30 Mar 2013 10:32:37 +0000 Subject: Relicensing parts of the tree under the Apache 2.0 license. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5521 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/templates/ext_lld.h | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'os/hal/templates/ext_lld.h') diff --git a/os/hal/templates/ext_lld.h b/os/hal/templates/ext_lld.h index 981253d8f..ca020a7a6 100644 --- a/os/hal/templates/ext_lld.h +++ b/os/hal/templates/ext_lld.h @@ -1,21 +1,17 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012,2013 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio - This file is part of ChibiOS/RT. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at - 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. + http://www.apache.org/licenses/LICENSE-2.0 - 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 . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. */ /** -- cgit v1.2.3