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