aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple/timers.h
diff options
context:
space:
mode:
authorPerry Hung <iperry@alum.mit.edu>2010-04-19 23:28:34 -0400
committerPerry Hung <iperry@alum.mit.edu>2010-04-19 23:31:32 -0400
commit0e2ccd30c4bac030bc33ed248564a640a63ea3c5 (patch)
tree4a6598b5c5a90f953cb6e6665a2dbcc1523ff329 /libmaple/timers.h
parenta7b3786810ee93c81b65a431c04fd2f5d75354d2 (diff)
downloadlibrambutan-0e2ccd30c4bac030bc33ed248564a640a63ea3c5.tar.gz
librambutan-0e2ccd30c4bac030bc33ed248564a640a63ea3c5.zip
Aded two timer function to set max reload value and prescaler
Diffstat (limited to 'libmaple/timers.h')
-rw-r--r--libmaple/timers.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/libmaple/timers.h b/libmaple/timers.h
index bcc7f2f..1ee89a0 100644
--- a/libmaple/timers.h
+++ b/libmaple/timers.h
@@ -122,6 +122,8 @@ typedef volatile uint32* TimerCCR;
void timer_init(uint8, uint16);
void timers_disable(void);
void timers_disable_channel(uint8, uint8);
+void timers_set_prescaler(uint32 timer_num, uint16 prescale);
+void timers_set_reload(uint32 timer_num, uint16 max_reload);
/* Turn on PWM with duty_cycle on the specified channel in timer.
* This function takes in a pointer to the corresponding CCR
@@ -140,6 +142,7 @@ static inline void timer_pwm_write_ccr(TimerCCR CCR, uint16 duty_cycle) {
*CCR = duty_cycle;
}
+
#ifdef __cplusplus
} // extern "C"
#endif