diff options
author | Daniel Friesel <derf@finalrewind.org> | 2021-01-30 19:19:20 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2021-01-30 19:19:20 +0100 |
commit | 027a587aa8ca06d4b781ddd2f6875a6d3dfe2db3 (patch) | |
tree | 06fddc8c4e0e8aba8fbdb72c5d6d04fba990464c /include | |
parent | 6dce5ced436fd6ca054847b3c41db871ab565a83 (diff) |
msp430fr5994lp timer: add setup_hz for very low frequencies
Diffstat (limited to 'include')
-rw-r--r-- | include/arch/msp430fr5994lp/driver/timer.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/arch/msp430fr5994lp/driver/timer.h b/include/arch/msp430fr5994lp/driver/timer.h index c07ae4e..9a2c7fe 100644 --- a/include/arch/msp430fr5994lp/driver/timer.h +++ b/include/arch/msp430fr5994lp/driver/timer.h @@ -62,6 +62,13 @@ class Timer { TA0CCR0 = 2000000UL / frequency; TA0CTL |= TACLR; } + + inline void setup_hz_low(uint16_t const frequency) { // 250 kHz base + TA0CTL = TASSEL__SMCLK | _TA0_MAIN_DIV; + TA0EX0 = 7; + TA0CCR0 = 250000UL / frequency; + TA0CTL |= TACLR; + } #endif inline void start(unsigned char const interrupt) { |