From 5befb0826a1ff77994c55f42cd73ccf0905a5ce0 Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Fri, 1 Jun 2012 03:05:56 -0400 Subject: libmaple/stm32.h: Add STM32_TIMER_MASK, STM32_HAVE_TIMER. Feature-test macros for dealing with the fact that timer support has holes. STM32_TIMER_MASK is a bitmask where bit n is set when TIMERn is present. STM32_HAVE_TIMER(n) just tests whether bit n is set in STM32_TIMER_MASK. This is necessary because e.g. the STM32F100RB has timers 1-4, 6, 7, and 15-17. Because of this, the usual STM32_NR_whatever won't work, and we use a bitmask instead. For F1 performance line (F103s), STM32_TIMER_MASK can be derived from the density. For F1 value line, I'm not as sure, so just add it for the single MCU we support (the STM32F100RB). Same story for F2: add it for the STM32F207IC. We can fix this up later if necessary. Signed-off-by: Marti Bolivar --- libmaple/stm32f2/include/series/stm32.h | 1 + 1 file changed, 1 insertion(+) (limited to 'libmaple/stm32f2') diff --git a/libmaple/stm32f2/include/series/stm32.h b/libmaple/stm32f2/include/series/stm32.h index 9e88a70..b53b7b6 100644 --- a/libmaple/stm32f2/include/series/stm32.h +++ b/libmaple/stm32f2/include/series/stm32.h @@ -63,6 +63,7 @@ extern "C" { #if defined(MCU_STM32F207IC) || defined(MCU_STM32F207IG) # define STM32_NR_GPIO_PORTS 9 +# define STM32_TIMER_MASK 0x7FFE /* TIMER1-TIMER14. */ # define STM32_SRAM_END ((void*)0x20020000) #else #error "Unrecognized STM32F2 MCU, or no MCU specified." -- cgit v1.2.3