summaryrefslogtreecommitdiff
path: root/nuttx/arch/arm/src/tiva/tiva_timer.c
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2015-01-09 11:07:52 -0600
committerGregory Nutt <gnutt@nuttx.org>2015-01-09 11:07:52 -0600
commit7d51dbf6d5371162b41c5e283ddb30721993a954 (patch)
tree4f35e3c58105f9a8d72222e9c9fd2ea31866f625 /nuttx/arch/arm/src/tiva/tiva_timer.c
parentab65f8dcf608731d68eddd4fe47f2305dd0c60c0 (diff)
downloadnuttx-7d51dbf6d5371162b41c5e283ddb30721993a954.tar.gz
nuttx-7d51dbf6d5371162b41c5e283ddb30721993a954.tar.bz2
nuttx-7d51dbf6d5371162b41c5e283ddb30721993a954.zip
Tiva Timer: Add interfaces to start/stop timers and to set the interval load registers.
Diffstat (limited to 'nuttx/arch/arm/src/tiva/tiva_timer.c')
-rw-r--r--nuttx/arch/arm/src/tiva/tiva_timer.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/nuttx/arch/arm/src/tiva/tiva_timer.c b/nuttx/arch/arm/src/tiva/tiva_timer.c
index c3e55de63..2aac2777b 100644
--- a/nuttx/arch/arm/src/tiva/tiva_timer.c
+++ b/nuttx/arch/arm/src/tiva/tiva_timer.c
@@ -1349,3 +1349,56 @@ TIMER_HANDLE tiva_gptm_configure(const struct tiva_gptmconfig_s *config)
return ret < 0 ? (TIMER_HANDLE)NULL : (TIMER_HANDLE)priv;
}
+
+/****************************************************************************
+ * Name: tiva_gptm_putreg
+ *
+ * Description:
+ * This function permits setting of any timer register by its offset into
+ * the timer block. Its primary purpose is to support inline functions
+ * defined in this header file.
+ *
+ ****************************************************************************/
+
+void tiva_gptm_putreg(TIMER_HANDLE handle, unsigned int offset, uint32_t value)
+{
+ DEBUGASSERT(handle);
+ tiva_putreg((struct tiva_gptmstate_s *)handle, offset, value);
+}
+
+/****************************************************************************
+ * Name: tiva_gptm_getreg
+ *
+ * Description:
+ * This function permits reading of any timer register by its offset into
+ * the timer block. Its primary purpose is to support inline functions
+ * defined in this header file.
+ *
+ ****************************************************************************/
+
+uint32_t tiva_gptm_getreg(TIMER_HANDLE handle, unsigned int offset)
+{
+ DEBUGASSERT(handle);
+ return tiva_getreg((struct tiva_gptmstate_s *)handle, offset);
+}
+
+/****************************************************************************
+ * Name: tiva_gptm_modifyreg
+ *
+ * Description:
+ * This function permits atomic of any timer register by its offset into
+ * the timer block. Its primary purpose is to support inline functions
+ * defined in this header file.
+ *
+ ****************************************************************************/
+
+void tiva_gptm_modifyreg(TIMER_HANDLE handle, unsigned int offset,
+ uint32_t clrbits, uint32_t setbits)
+{
+ struct tiva_gptmstate_s *priv = (struct tiva_gptmstate_s *)handle;
+ uintptr_t regaddr;
+
+ DEBUGASSERT(priv && priv->attr);
+ regaddr = priv->attr->base + offset;
+ modifyreg32(regaddr, clrbits, setbits);
+}