aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple/timer_private.h
Commit message (Collapse)AuthorAgeFilesLines
* Tweak some timer_private APIs.Marti Bolivar2012-06-071-8/+8
| | | | | | | The current versions of DELARE_*_TIMER() don't play well with cscope, which is a bad sign. Fix that. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
* libmaple/timer_private.h: Update to support TIM9-TIM14.Marti Bolivar2012-04-111-7/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | Add DECLARE_RESTRICTED_GENERAL_TIMER(), for declaring general-purpose timers with limited interrupt support -- that is, for declaring timers 9 through 14. This helps avoid wasting space on pointers to user handlers for interrupts that don't exist. Add dispatch_tim_9_12() and dispatch_tim_10_11_13_14(), which are special purpose dispatch routines for these "restricted" general purpose timers, which only try to dispatch interrupts supported by these timers. Change dispatch_single_irq() to check the logical and of the DIER and SR registers for the timer whose interrupt it's dispatching. This is necessary due to increased muxing on the timer IRQ lines caused by the new timers. See the comment in the patch for more details. This does add overhead on medium- and high-density STM32F1s, where the extra check is unnecessary, but it doesn't change dispatch_single_irq()'s semantics, and keeps the implementation simple, so we'll live with it. These changes will also work on F2 (and F4 AFAIK), which is why they're part of the global private timer API, as opposed to libmaple/stm32f1/timer.c. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
* libmaple/timer_private.h: Add more explanatory comments.Marti Bolivar2012-04-111-12/+31
| | | | | | | Hopefully these will be helpful when adding timer support for additional series in the future. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
* timer: Fixes, rip out nonportable bits.Marti Bolivar2012-04-111-0/+168
Fix copy-paste errors in, and add missing, register bit definitions. For copy-paste errors that would result in source incompatibilities with past releases, add some legacy defines. Add series header and C file for STM32F1 which fills in the missing API. Much of the F1 timer.c would be repeated on F2, so also add timer_private.h to hold these. Support for timers 9 through 14 is still missing. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>