aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2012-06-03 23:09:37 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2012-06-04 00:17:01 -0400
commit6ad1757e62dcfe112a473ef6474b9f4c1317cf9e (patch)
tree88fbb7030f35132a2a45578db08b8e65694da0c8
parent0873e4fc167f08fbac4b188a755a61f5afb03d20 (diff)
downloadlibrambutan-6ad1757e62dcfe112a473ef6474b9f4c1317cf9e.tar.gz
librambutan-6ad1757e62dcfe112a473ef6474b9f4c1317cf9e.zip
stm32.h: Add STM32_HAVE_DAC feature-test.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
-rw-r--r--libmaple/include/libmaple/stm32.h6
-rw-r--r--libmaple/stm32f1/include/series/stm32.h5
-rw-r--r--libmaple/stm32f2/include/series/stm32.h1
3 files changed, 12 insertions, 0 deletions
diff --git a/libmaple/include/libmaple/stm32.h b/libmaple/include/libmaple/stm32.h
index 94fb689..3845cab 100644
--- a/libmaple/include/libmaple/stm32.h
+++ b/libmaple/include/libmaple/stm32.h
@@ -78,6 +78,7 @@ extern "C" {
!defined(STM32_TIMER_MASK) || \
!defined(STM32_DELAY_US_MULT) || \
!defined(STM32_SRAM_END) || \
+ !defined(STM32_HAVE_DAC) || \
!defined(STM32_HAVE_FSMC) || \
!defined(STM32_HAVE_USB))
#error "Bad STM32F1 configuration. Check <series/stm32.h> header for your MCU."
@@ -180,6 +181,11 @@ extern "C" {
#define STM32_SRAM_END
/**
+ * @brief 1 if the target MCU has a DAC, and 0 otherwise.
+ */
+#define STM32_HAVE_DAC
+
+/**
* @brief 1 if the target MCU has the FSMC peripheral, and 0 otherwise.
*
* Note that the feature set of the FSMC peripheral is restricted on
diff --git a/libmaple/stm32f1/include/series/stm32.h b/libmaple/stm32f1/include/series/stm32.h
index 23c0591..e793a10 100644
--- a/libmaple/stm32f1/include/series/stm32.h
+++ b/libmaple/stm32f1/include/series/stm32.h
@@ -115,14 +115,17 @@ extern "C" {
# define STM32_NR_INTERRUPTS 43
# define STM32_TIMER_MASK 0x1E /* TIMER1--TIMER4 */
# define STM32_HAVE_FSMC 0
+# define STM32_HAVE_DAC 0
# elif defined(STM32_HIGH_DENSITY)
# define STM32_NR_INTERRUPTS 60
# define STM32_TIMER_MASK 0x1FE /* TIMER1--TIMER8 */
# define STM32_HAVE_FSMC 1
+# define STM32_HAVE_DAC 1
# elif defined(STM32_XL_DENSITY)
# define STM32_NR_INTERRUPTS 60
# define STM32_TIMER_MASK 0x7FFE /* TIMER1--TIMER14 */
# define STM32_HAVE_FSMC 1
+# define STM32_HAVE_DAC 1
# endif
#elif STM32_F1_LINE == STM32_F1_LINE_VALUE
@@ -132,11 +135,13 @@ extern "C" {
# ifdef STM32_MEDIUM_DENSITY
# define STM32_NR_INTERRUPTS 56
# define STM32_HAVE_FSMC 0
+# define STM32_HAVE_DAC 1
# elif defined(STM32_HIGH_DENSITY)
/* 61 interrupts here counts the possibility for a remapped
* DMA2 channel 5 IRQ occurring at NVIC index 60. */
# define STM32_NR_INTERRUPTS 61
# define STM32_HAVE_FSMC 1
+# define STM32_HAVE_DAC 1
# endif
#endif
diff --git a/libmaple/stm32f2/include/series/stm32.h b/libmaple/stm32f2/include/series/stm32.h
index b53b7b6..2c389ab 100644
--- a/libmaple/stm32f2/include/series/stm32.h
+++ b/libmaple/stm32f2/include/series/stm32.h
@@ -60,6 +60,7 @@ extern "C" {
#define STM32_NR_INTERRUPTS 81
#define STM32_HAVE_FSMC 1
#define STM32_HAVE_USB 1
+#define STM32_HAVE_DAC 1
#if defined(MCU_STM32F207IC) || defined(MCU_STM32F207IG)
# define STM32_NR_GPIO_PORTS 9