aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/include/st.h
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-08-21 13:33:40 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-08-21 13:33:40 +0000
commit78b866e0a7046a893025fe1304064f255e37c411 (patch)
tree259b7140402d9a34768380ff0fdd5fa8a7e7bdfe /os/hal/include/st.h
parent371ef2afb5b7045d8293dd5a393a7783b025f8a8 (diff)
downloadChibiOS-78b866e0a7046a893025fe1304064f255e37c411.tar.gz
ChibiOS-78b866e0a7046a893025fe1304064f255e37c411.tar.bz2
ChibiOS-78b866e0a7046a893025fe1304064f255e37c411.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6192 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/include/st.h')
-rw-r--r--os/hal/include/st.h66
1 files changed, 62 insertions, 4 deletions
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_ */
/** @} */