aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple/stm32.h
diff options
context:
space:
mode:
Diffstat (limited to 'libmaple/stm32.h')
-rw-r--r--libmaple/stm32.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/libmaple/stm32.h b/libmaple/stm32.h
index 985b941..d7e946e 100644
--- a/libmaple/stm32.h
+++ b/libmaple/stm32.h
@@ -22,5 +22,44 @@
#endif
#endif
+/* MCU-specific configuration */
+#if defined(MCU_STM32F103RB)
+ /* e.g., LeafLabs Maple */
+
+ /* Number of GPIO ports (GPIOA, GPIOB, etc.) */
+ #define NR_GPIO_PORTS 4
+
+ /* SRAM size, in bytes */
+ #define SRAM_SIZE 0x5000
+
+#elif defined(MCU_STM32F103ZE)
+ /* e.g., LeafLabs Maple Native */
+
+ #define NR_GPIO_PORTS 7
+ #define SRAM_SIZE 0x10000
+
+#elif defined(MCU_STM32F103CB)
+ /* e.g., LeafLabs Maple Mini */
+
+ /* Note that this is not, strictly speaking, true. But only pins
+ 0 and 1 exist, and they're used for OSC on the Mini, so we'll
+ live with this for now. */
+ #define NR_GPIO_PORTS 3
+
+ #define SRAM_SIZE 0x5000
+
+#elif defined(MCU_STM32F103RE)
+ /* e.g., LeafLabs Maple RET6 edition */
+
+ #define NR_GPIO_PORTS 4
+ #define SRAM_SIZE 0x10000
+
+#else
+
+#error "No MCU type specified. Add something like -DMCU_STM32F103RB " \
+ "to your compiler arguments (probably in a Makefile)."
+
+#endif
+
#endif