aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple/timers.h
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@mit.edu>2010-10-22 21:13:02 -0400
committerMarti Bolivar <mbolivar@mit.edu>2010-10-22 21:13:02 -0400
commit6c956a383834b66c29591294f0926ced22f3e3b7 (patch)
tree00214f59655cf96d747228d9ffb8f6059b63b31c /libmaple/timers.h
parentdd7e6ecdafcb8938e23dfd18a36d70628fbc74bd (diff)
downloadlibrambutan-6c956a383834b66c29591294f0926ced22f3e3b7.tar.gz
librambutan-6c956a383834b66c29591294f0926ced22f3e3b7.zip
maple mini runs blinky now.
still need usb descriptors to improve, and also nothing else is tested.
Diffstat (limited to 'libmaple/timers.h')
-rw-r--r--libmaple/timers.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/libmaple/timers.h b/libmaple/timers.h
index ba8245c..d180bab 100644
--- a/libmaple/timers.h
+++ b/libmaple/timers.h
@@ -132,9 +132,21 @@ typedef volatile uint32* TimerCCR;
#define TIMER8_CH3_CCR TIMER8_BASE + 0x3C
#define TIMER8_CH4_CCR TIMER8_BASE + 0x40
-#define TIMER_DISABLED 0
-#define TIMER_PWM 1
-#define TIMER_OUTPUTCOMPARE 2
+/**
+ * Used to configure the behavior of a timer.
+ */
+typedef enum TimerMode {
+ TIMER_DISABLED, /**< In this mode, the timer stops counting,
+ interrupts are not called, and no state changes
+ are output. */
+ TIMER_PWM, /**< This is the default mode for pins after
+ initialization. */
+ TIMER_OUTPUTCOMPARE, /**< In this mode, the timer counts from 0 to
+ the overflow value repeatedly; every time
+ the counter value reaches one of the
+ channel compare values, the corresponding
+ interrupt is fired. */
+} TimerMode;
typedef struct {
volatile uint16 CR1;