summaryrefslogtreecommitdiff
path: root/nuttx/arch/arm/src/tiva/tiva_timer.h
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/arch/arm/src/tiva/tiva_timer.h')
-rw-r--r--nuttx/arch/arm/src/tiva/tiva_timer.h70
1 files changed, 8 insertions, 62 deletions
diff --git a/nuttx/arch/arm/src/tiva/tiva_timer.h b/nuttx/arch/arm/src/tiva/tiva_timer.h
index 6b98816a1..45f4350d5 100644
--- a/nuttx/arch/arm/src/tiva/tiva_timer.h
+++ b/nuttx/arch/arm/src/tiva/tiva_timer.h
@@ -301,14 +301,7 @@ void tiva_gptm_modifyreg(TIMER_HANDLE handle, unsigned int offset,
*
****************************************************************************/
-static inline void tiva_timer32_start(TIMER_HANDLE handle)
-{
- /* Set the TAEN bit in the GPTMCTL register to enable the timer and start
- * counting
- */
-
- tiva_gptm_modifyreg(handle, TIVA_TIMER_CTL_OFFSET, 0, TIMER_CTL_TAEN);
-}
+void tiva_timer32_start(TIMER_HANDLE handle);
/****************************************************************************
* Name: tiva_timer16_start
@@ -319,34 +312,10 @@ static inline void tiva_timer32_start(TIMER_HANDLE handle)
*
****************************************************************************/
-static inline void tiva_timer16_start(TIMER_HANDLE handle, int tmndx)
-{
- uint32_t setbits = tmndx ? TIMER_CTL_TBEN : TIMER_CTL_TAEN;
-
- /* Set the TnEN bit in the GPTMCTL register to enable the 16-bit timer and
- * start counting
- */
-
- tiva_gptm_modifyreg(handle, TIVA_TIMER_CTL_OFFSET, 0, setbits);
-}
-
-static inline void tiva_timer16a_start(TIMER_HANDLE handle)
-{
- /* Set the TAEN bit in the GPTMCTL register to enable 16-bit timer A and
- * start counting
- */
-
- tiva_gptm_modifyreg(handle, TIVA_TIMER_CTL_OFFSET, 0, TIMER_CTL_TAEN);
-}
+void tiva_timer16_start(TIMER_HANDLE handle, int tmndx);
-static inline void tiva_timer16b_start(TIMER_HANDLE handle)
-{
- /* Set the TBEN bit in the GPTMCTL register to enable 16-bit timer B and
- * start counting
- */
-
- tiva_gptm_modifyreg(handle, TIVA_TIMER_CTL_OFFSET, 0, TIMER_CTL_TBEN);
-}
+#define tiva_timer16a_start(h) tiva_timer16_start(h, TIMER16A)
+#define tiva_timer16b_start(h) tiva_timer16_start(h, TIMER16B)
/****************************************************************************
* Name: tiva_timer32_stop
@@ -357,12 +326,7 @@ static inline void tiva_timer16b_start(TIMER_HANDLE handle)
*
****************************************************************************/
-static inline void tiva_timer32_stop(TIMER_HANDLE handle)
-{
- /* Clear the TAEN bit in the GPTMCTL register to disable the 16-bit timer */
-
- tiva_gptm_modifyreg(handle, TIVA_TIMER_CTL_OFFSET, TIMER_CTL_TAEN, 0);
-}
+void tiva_timer32_stop(TIMER_HANDLE handle);
/****************************************************************************
* Name: tiva_timer16_stop
@@ -373,28 +337,10 @@ static inline void tiva_timer32_stop(TIMER_HANDLE handle)
*
****************************************************************************/
-static inline void tiva_timer16_stop(TIMER_HANDLE handle, int tmndx)
-{
- uint32_t clrbits = tmndx ? TIMER_CTL_TBEN : TIMER_CTL_TAEN;
-
- /* Clear the TnEN bit in the GPTMCTL register to disable the 16-bit timer */
-
- tiva_gptm_modifyreg(handle, TIVA_TIMER_CTL_OFFSET, clrbits, 0);
-}
-
-static inline void tiva_timer16a_stop(TIMER_HANDLE handle)
-{
- /* Clear the TAEN bit in the GPTMCTL register to disable the 16-bit timer A */
-
- tiva_gptm_modifyreg(handle, TIVA_TIMER_CTL_OFFSET, TIMER_CTL_TAEN, 0);
-}
+void tiva_timer16_stop(TIMER_HANDLE handle, int tmndx);
-static inline void tiva_timer16b_stop(TIMER_HANDLE handle)
-{
- /* Clear the TBEN bit in the GPTMCTL register to disable the 16-bit timer B */
-
- tiva_gptm_modifyreg(handle, TIVA_TIMER_CTL_OFFSET, TIMER_CTL_TBEN, 0);
-}
+#define tiva_timer16a_stop(h) tiva_timer16_stop(h, TIMER16A)
+#define tiva_timer16b_stop(h) tiva_timer16_stop(h, TIMER16B)
/****************************************************************************
* Name: tiva_timer32_setload