diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2014-03-08 10:19:32 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2014-03-08 10:19:32 +0000 |
commit | 6bc9f636b5488434375da0296a3d90285dc1cec4 (patch) | |
tree | b48404ced7251d3ec32dd816e7d4f96df8357d57 /os/hal/ports/STM32 | |
parent | f40d33139e0bd179b766d1576dfd7b494734ff67 (diff) | |
download | ChibiOS-6bc9f636b5488434375da0296a3d90285dc1cec4.tar.gz ChibiOS-6bc9f636b5488434375da0296a3d90285dc1cec4.tar.bz2 ChibiOS-6bc9f636b5488434375da0296a3d90285dc1cec4.zip |
More enhancements to the GPT driver.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6759 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/ports/STM32')
-rw-r--r-- | os/hal/ports/STM32/LLD/TIMv1/gpt_lld.h | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/os/hal/ports/STM32/LLD/TIMv1/gpt_lld.h b/os/hal/ports/STM32/LLD/TIMv1/gpt_lld.h index 4a914133e..9f0b16980 100644 --- a/os/hal/ports/STM32/LLD/TIMv1/gpt_lld.h +++ b/os/hal/ports/STM32/LLD/TIMv1/gpt_lld.h @@ -432,19 +432,42 @@ struct GPTDriver { /**
* @brief Changes the interval of GPT peripheral.
* @details This function changes the interval of a running GPT unit.
- * @pre The GPT unit must have been activated using @p gptStart().
- * @pre The GPT unit must have been running in continuous mode using
- * @p gptStartContinuous().
+ * @pre The GPT unit must be running in continuous mode.
* @post The GPT unit interval is changed to the new value.
* @note The function has effect at the next cycle start.
*
* @param[in] gptp pointer to a @p GPTDriver object
* @param[in] interval new cycle time in timer ticks
+ *
* @notapi
*/
#define gpt_lld_change_interval(gptp, interval) \
((gptp)->tim->ARR = (uint32_t)((interval) - 1))
+/**
+ * @brief Returns the interval of GPT peripheral.
+ * @pre The GPT unit must be running in continuous mode.
+ *
+ * @param[in] gptp pointer to a @p GPTDriver object
+ * @return The current interval.
+ *
+ * @notapi
+ */
+#define gpt_lld_get_interval(gptp) ((gptcnt_t)(gptp)->tim->ARR + 1)
+
+/**
+ * @brief Returns the counter value of GPT peripheral.
+ * @pre The GPT unit must be running in continuous mode.
+ * @note The nature of the counter is not defined, it may count upward
+ * or downward, it could be continuously running or not.
+ *
+ * @param[in] gptp pointer to a @p GPTDriver object
+ * @return The current counter value.
+ *
+ * @notapi
+ */
+#define gpt_lld_get_counter(gptp) ((gptcnt_t)(gptp)->tim->CNT)
+
/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
|