From 0e34cd051ed686263001af3a721f6858db94d072 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 9 Aug 2013 08:25:09 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6109 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/st.h | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 os/hal/include/st.h (limited to 'os/hal/include/st.h') diff --git a/os/hal/include/st.h b/os/hal/include/st.h new file mode 100644 index 000000000..276ab2649 --- /dev/null +++ b/os/hal/include/st.h @@ -0,0 +1,72 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011,2012,2013 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 st.h + * @brief ST Driver macros and structures. + * + * @addtogroup ST + * @{ + */ + +#ifndef _ST_H_ +#define _ST_H_ + +#if (OSAL_ST_MODE != OSAL_ST_MODE_NONE) || defined(__DOXYGEN__) + +/*===========================================================================*/ +/* Driver constants. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver pre-compile time settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Derived constants and error checks. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver data structures and types. */ +/*===========================================================================*/ + +#include "st_lld.h" + +/*===========================================================================*/ +/* Driver macros. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* External declarations. */ +/*===========================================================================*/ + +#ifdef __cplusplus +extern "C" { +#endif + void stInit(void); +#ifdef __cplusplus +} +#endif + +#endif /* OSAL_ST_MODE != OSAL_ST_MODE_NONE */ + +#endif /* _ST_H_ */ + +/** @} */ -- cgit v1.2.3 From 78b866e0a7046a893025fe1304064f255e37c411 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 21 Aug 2013 13:33:40 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6192 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/st.h | 66 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 62 insertions(+), 4 deletions(-) (limited to 'os/hal/include/st.h') diff --git a/os/hal/include/st.h b/os/hal/include/st.h index 276ab2649..05d382d93 100644 --- a/os/hal/include/st.h +++ b/os/hal/include/st.h @@ -21,6 +21,8 @@ /** * @file st.h * @brief ST Driver macros and structures. + * @details This header is designed to be include-able without having to + * include other files from the HAL. * * @addtogroup ST * @{ @@ -29,8 +31,6 @@ #ifndef _ST_H_ #define _ST_H_ -#if (OSAL_ST_MODE != OSAL_ST_MODE_NONE) || defined(__DOXYGEN__) - /*===========================================================================*/ /* Driver constants. */ /*===========================================================================*/ @@ -53,6 +53,66 @@ /* Driver macros. */ /*===========================================================================*/ +/** + * @name Macro Functions + * @{ + */ +/** + * @brief Returns the time counter value. + * @note This functionality is only available in free running mode, the + * behavior in periodic mode is undefined. + * + * @return The counter value. + * + * @api + */ +#define stGetCounter() st_lld_get_counter() + +/** + * @brief Starts the alarm. + * @note Makes sure that no spurious alarms are triggered after + * this call. + * @note This functionality is only available in free running mode, the + * behavior in periodic mode is undefined. + * + * @param[in] time the time to be set for the first alarm + * + * @api + */ +#define stStartAlarm(time) st_lld_start_alarm(time) + +/** + * @brief Stops the alarm interrupt. + * @note This functionality is only available in free running mode, the + * behavior in periodic mode is undefined. + * + * @api + */ +#define stStopAlarm() st_lld_stop_alarm() + +/** + * @brief Sets the alarm time. + * @note This functionality is only available in free running mode, the + * behavior in periodic mode is undefined. + * + * @param[in] time the time to be set for the next alarm + * + * @api + */ +#define stSetAlarm(time) st_lld_set_alarm(time) + +/** + * @brief Returns the current alarm time. + * @note This functionality is only available in free running mode, the + * behavior in periodic mode is undefined. + * + * @return The currently set alarm time. + * + * @api + */ +#define stGetAlarm() st_lld_get_alarm() +/** @} */ + /*===========================================================================*/ /* External declarations. */ /*===========================================================================*/ @@ -65,8 +125,6 @@ extern "C" { } #endif -#endif /* OSAL_ST_MODE != OSAL_ST_MODE_NONE */ - #endif /* _ST_H_ */ /** @} */ -- cgit v1.2.3 From 960847273c5015002fff1bb7c483556140746de2 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 23 Aug 2013 07:57:26 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6205 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/st.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'os/hal/include/st.h') diff --git a/os/hal/include/st.h b/os/hal/include/st.h index 05d382d93..b2cb00543 100644 --- a/os/hal/include/st.h +++ b/os/hal/include/st.h @@ -111,6 +111,17 @@ * @api */ #define stGetAlarm() st_lld_get_alarm() + +/** + * @brief Determines if the alarm is active. + * + * @return The alarm status. + * @retval false if the alarm is not active. + * @retval true is the alarm is active + * + * @api + */ +#define stIsAlarmActive() st_lld_is_alarm_active() /** @} */ /*===========================================================================*/ -- cgit v1.2.3 From 3eb5840723fcae22783cbeaaffd78267401bc39f Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 19 Nov 2013 14:59:22 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6497 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/st.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'os/hal/include/st.h') diff --git a/os/hal/include/st.h b/os/hal/include/st.h index b2cb00543..43d64f643 100644 --- a/os/hal/include/st.h +++ b/os/hal/include/st.h @@ -60,7 +60,7 @@ /** * @brief Returns the time counter value. * @note This functionality is only available in free running mode, the - * behavior in periodic mode is undefined. + * behaviour in periodic mode is undefined. * * @return The counter value. * @@ -73,7 +73,7 @@ * @note Makes sure that no spurious alarms are triggered after * this call. * @note This functionality is only available in free running mode, the - * behavior in periodic mode is undefined. + * behaviour in periodic mode is undefined. * * @param[in] time the time to be set for the first alarm * @@ -84,7 +84,7 @@ /** * @brief Stops the alarm interrupt. * @note This functionality is only available in free running mode, the - * behavior in periodic mode is undefined. + * behaviour in periodic mode is undefined. * * @api */ @@ -93,7 +93,7 @@ /** * @brief Sets the alarm time. * @note This functionality is only available in free running mode, the - * behavior in periodic mode is undefined. + * behaviour in periodic mode is undefined. * * @param[in] time the time to be set for the next alarm * @@ -104,7 +104,7 @@ /** * @brief Returns the current alarm time. * @note This functionality is only available in free running mode, the - * behavior in periodic mode is undefined. + * behaviour in periodic mode is undefined. * * @return The currently set alarm time. * -- cgit v1.2.3 From 151ca1d309f2d350527a73676c5aa47f5c2fa921 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 20 Jan 2014 12:26:50 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6634 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/st.h | 48 ++++-------------------------------------------- 1 file changed, 4 insertions(+), 44 deletions(-) (limited to 'os/hal/include/st.h') diff --git a/os/hal/include/st.h b/os/hal/include/st.h index 43d64f643..ebe906f1c 100644 --- a/os/hal/include/st.h +++ b/os/hal/include/st.h @@ -68,50 +68,6 @@ */ #define stGetCounter() st_lld_get_counter() -/** - * @brief Starts the alarm. - * @note Makes sure that no spurious alarms are triggered after - * this call. - * @note This functionality is only available in free running mode, the - * behaviour in periodic mode is undefined. - * - * @param[in] time the time to be set for the first alarm - * - * @api - */ -#define stStartAlarm(time) st_lld_start_alarm(time) - -/** - * @brief Stops the alarm interrupt. - * @note This functionality is only available in free running mode, the - * behaviour in periodic mode is undefined. - * - * @api - */ -#define stStopAlarm() st_lld_stop_alarm() - -/** - * @brief Sets the alarm time. - * @note This functionality is only available in free running mode, the - * behaviour in periodic mode is undefined. - * - * @param[in] time the time to be set for the next alarm - * - * @api - */ -#define stSetAlarm(time) st_lld_set_alarm(time) - -/** - * @brief Returns the current alarm time. - * @note This functionality is only available in free running mode, the - * behaviour in periodic mode is undefined. - * - * @return The currently set alarm time. - * - * @api - */ -#define stGetAlarm() st_lld_get_alarm() - /** * @brief Determines if the alarm is active. * @@ -132,6 +88,10 @@ extern "C" { #endif void stInit(void); + void stStartAlarm(systime_t time); + void stStopAlarm(void); + void stSetAlarm(systime_t time); + systime_t stGetAlarm(void); #ifdef __cplusplus } #endif -- cgit v1.2.3