summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-01-30 19:19:20 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-01-30 19:19:20 +0100
commit027a587aa8ca06d4b781ddd2f6875a6d3dfe2db3 (patch)
tree06fddc8c4e0e8aba8fbdb72c5d6d04fba990464c /include
parent6dce5ced436fd6ca054847b3c41db871ab565a83 (diff)
msp430fr5994lp timer: add setup_hz for very low frequencies
Diffstat (limited to 'include')
-rw-r--r--include/arch/msp430fr5994lp/driver/timer.h7
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) {