diff options
| author | Marti Bolivar <mbolivar@mit.edu> | 2010-10-22 21:13:02 -0400 | 
|---|---|---|
| committer | Marti Bolivar <mbolivar@mit.edu> | 2010-10-22 21:13:02 -0400 | 
| commit | 6c956a383834b66c29591294f0926ced22f3e3b7 (patch) | |
| tree | 00214f59655cf96d747228d9ffb8f6059b63b31c /libmaple/timers.h | |
| parent | dd7e6ecdafcb8938e23dfd18a36d70628fbc74bd (diff) | |
| download | librambutan-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.h | 18 | 
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;  | 
