diff options
author | marcoveeneman <marco-veeneman@hotmail.com> | 2016-10-27 22:55:17 +0200 |
---|---|---|
committer | marcoveeneman <marco-veeneman@hotmail.com> | 2016-10-27 22:55:17 +0200 |
commit | 223f46589016f2dce6a29cbd00d9020f80d2a556 (patch) | |
tree | 66653c078459a091ade80f5a6434cad9ee1c2741 /os/hal/ports/TIVA/LLD/GPTM/hal_gpt_lld.c | |
parent | 94fe96d3ae4a8d05b7d752f9ff8e0bd4b3de25d6 (diff) | |
download | ChibiOS-Contrib-223f46589016f2dce6a29cbd00d9020f80d2a556.tar.gz ChibiOS-Contrib-223f46589016f2dce6a29cbd00d9020f80d2a556.tar.bz2 ChibiOS-Contrib-223f46589016f2dce6a29cbd00d9020f80d2a556.zip |
Replaced custom register bitfield macros by TivaWare bitfield macros.
Diffstat (limited to 'os/hal/ports/TIVA/LLD/GPTM/hal_gpt_lld.c')
-rw-r--r-- | os/hal/ports/TIVA/LLD/GPTM/hal_gpt_lld.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/os/hal/ports/TIVA/LLD/GPTM/hal_gpt_lld.c b/os/hal/ports/TIVA/LLD/GPTM/hal_gpt_lld.c index fdf7c17..60d2b82 100644 --- a/os/hal/ports/TIVA/LLD/GPTM/hal_gpt_lld.c +++ b/os/hal/ports/TIVA/LLD/GPTM/hal_gpt_lld.c @@ -594,7 +594,7 @@ void gpt_lld_start(GPTDriver *gptp) /* Timer configuration.*/ HWREG(gptp->gpt + TIMER_O_CTL) = 0; - HWREG(gptp->gpt + TIMER_O_CFG) = GPTM_CFG_CFG_SPLIT; + HWREG(gptp->gpt + TIMER_O_CFG) = TIMER_CFG_16_BIT; HWREG(gptp->gpt + TIMER_O_TAPR) = ((TIVA_SYSCLK / gptp->config->frequency) - 1); } @@ -710,9 +710,9 @@ void gpt_lld_start_timer(GPTDriver *gptp, gptcnt_t interval) { HWREG(gptp->gpt + TIMER_O_TAILR) = interval - 1; HWREG(gptp->gpt + TIMER_O_ICR) = 0xfffffff; - HWREG(gptp->gpt + TIMER_O_IMR) = GPTM_IMR_TATOIM; - HWREG(gptp->gpt + TIMER_O_TAMR) = GPTM_TAMR_TAMR_PERIODIC | GPTM_TAMR_TAILD | GPTM_TAMR_TASNAPS; - HWREG(gptp->gpt + TIMER_O_CTL) = GPTM_CTL_TAEN | GPTM_CTL_TASTALL; + HWREG(gptp->gpt + TIMER_O_IMR) = TIMER_IMR_TATOIM; + HWREG(gptp->gpt + TIMER_O_TAMR) = TIMER_TAMR_TAMR_PERIOD | TIMER_TAMR_TAILD | TIMER_TAMR_TASNAPS; + HWREG(gptp->gpt + TIMER_O_CTL) = TIMER_CTL_TAEN | TIMER_CTL_TASTALL; } /** @@ -726,7 +726,7 @@ void gpt_lld_stop_timer(GPTDriver *gptp) { HWREG(gptp->gpt + TIMER_O_IMR) = 0; HWREG(gptp->gpt + TIMER_O_TAILR) = 0; - HWREG(gptp->gpt + TIMER_O_CTL) &= ~GPTM_CTL_TAEN; + HWREG(gptp->gpt + TIMER_O_CTL) &= ~TIMER_CTL_TAEN; } /** @@ -742,11 +742,11 @@ void gpt_lld_stop_timer(GPTDriver *gptp) */ void gpt_lld_polled_delay(GPTDriver *gptp, gptcnt_t interval) { - HWREG(gptp->gpt + TIMER_O_TAMR) = GPTM_TAMR_TAMR_ONESHOT | GPTM_TAMR_TAILD | GPTM_TAMR_TASNAPS; + HWREG(gptp->gpt + TIMER_O_TAMR) = TIMER_TAMR_TAMR_1_SHOT | TIMER_TAMR_TAILD | TIMER_TAMR_TASNAPS; HWREG(gptp->gpt + TIMER_O_TAILR) = interval - 1; HWREG(gptp->gpt + TIMER_O_ICR) = 0xffffffff; - HWREG(gptp->gpt + TIMER_O_CTL) = GPTM_CTL_TAEN | GPTM_CTL_TASTALL; - while (!(HWREG(gptp->gpt + TIMER_O_RIS) & GPTM_IMR_TATOIM)) + HWREG(gptp->gpt + TIMER_O_CTL) = TIMER_CTL_TAEN | TIMER_CTL_TASTALL; + while (!(HWREG(gptp->gpt + TIMER_O_RIS) & TIMER_IMR_TATOIM)) ; HWREG(gptp->gpt + TIMER_O_ICR) = 0xffffffff; } |