aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple
diff options
context:
space:
mode:
Diffstat (limited to 'libmaple')
-rw-r--r--libmaple/include/libmaple/stm32.h22
-rw-r--r--libmaple/stm32f1/include/series/stm32.h4
2 files changed, 23 insertions, 3 deletions
diff --git a/libmaple/include/libmaple/stm32.h b/libmaple/include/libmaple/stm32.h
index 356a360..4c0898b 100644
--- a/libmaple/include/libmaple/stm32.h
+++ b/libmaple/include/libmaple/stm32.h
@@ -36,8 +36,21 @@
extern "C" {
#endif
-/* Everything enclosed in the following __DOXYGEN_PREDEFINED_HACK
- * conditional block must be defined in the series header. */
+/**
+ * @brief STM32 series identifiers.
+ */
+typedef enum stm32_series {
+ STM32_SERIES_F1, /**< F1 series */
+ STM32_SERIES_F2, /**< F2 series */
+ STM32_SERIES_L1, /**< L1 series */
+ STM32_SERIES_F4, /**< F4 series */
+} stm32_series;
+
+/* The series header is responsible for defining:
+ *
+ * - Everything enclosed in the following __DOXYGEN_PREDEFINED_HACK
+ * conditional block.
+ */
#include <series/stm32.h>
#ifdef __DOXYGEN_PREDEFINED_HACK
@@ -70,6 +83,11 @@ extern "C" {
*/
/**
+ * @brief enum stm32_series value for the MCU being targeted.
+ */
+#define STM32_MCU_SERIES
+
+/**
* @brief Number of interrupts in the vector table.
*
* This does not include Cortex-M interrupts (NMI, HardFault, etc.).
diff --git a/libmaple/stm32f1/include/series/stm32.h b/libmaple/stm32f1/include/series/stm32.h
index f0ca616..86f0294 100644
--- a/libmaple/stm32f1/include/series/stm32.h
+++ b/libmaple/stm32f1/include/series/stm32.h
@@ -66,9 +66,11 @@ extern "C" {
#endif
/*
- * MCU-specific values.
+ * Series- and MCU-specific values.
*/
+#define STM32_MCU_SERIES STM32_SERIES_F1
+
#if defined(MCU_STM32F103RB)
# define STM32_NR_GPIO_PORTS 4
# define STM32_SRAM_END ((void*)0x20005000)