aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2011-03-16 17:37:21 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2011-03-16 17:56:54 -0400
commit4862d1eae5813e278cfbb1d5e0a040010b92eb3f (patch)
treeb0771810e7d1da7d254375b4758128dce3793668 /libmaple
parent04ee498b46393250c31606e526c28cb3b2b870ed (diff)
downloadlibrambutan-4862d1eae5813e278cfbb1d5e0a040010b92eb3f.tar.gz
librambutan-4862d1eae5813e278cfbb1d5e0a040010b92eb3f.zip
Maple RET6 edition support
Diffstat (limited to 'libmaple')
-rw-r--r--libmaple/libmaple.h7
-rw-r--r--libmaple/pwr.c2
-rw-r--r--libmaple/rules.mk1
-rw-r--r--libmaple/usb/usb_config.h10
4 files changed, 13 insertions, 7 deletions
diff --git a/libmaple/libmaple.h b/libmaple/libmaple.h
index 0bbd34e..7814730 100644
--- a/libmaple/libmaple.h
+++ b/libmaple/libmaple.h
@@ -56,7 +56,6 @@
/* e.g., LeafLabs Maple Native */
#define NR_GPIO_PORTS 7
-
#define SRAM_SIZE 0x10000
#elif defined(MCU_STM32F103CB)
@@ -69,6 +68,12 @@
#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 " \
diff --git a/libmaple/pwr.c b/libmaple/pwr.c
index b43193e..d63a92d 100644
--- a/libmaple/pwr.c
+++ b/libmaple/pwr.c
@@ -28,7 +28,7 @@
#include "rcc.h"
pwr_dev pwr = {
- .regs = PWR_BASE;
+ .regs = PWR_BASE,
};
const pwr_dev *PWR = &pwr;
diff --git a/libmaple/rules.mk b/libmaple/rules.mk
index b87595d..b264b96 100644
--- a/libmaple/rules.mk
+++ b/libmaple/rules.mk
@@ -22,6 +22,7 @@ cSRCS_$(d) := adc.c \
gpio.c \
iwdg.c \
nvic.c \
+ pwr.c \
rcc.c \
spi.c \
syscalls.c \
diff --git a/libmaple/usb/usb_config.h b/libmaple/usb/usb_config.h
index 9003da9..0860b90 100644
--- a/libmaple/usb/usb_config.h
+++ b/libmaple/usb/usb_config.h
@@ -28,7 +28,7 @@
#define RESET_DELAY (100)
#define USB_CONFIG_MAX_POWER (100 >> 1)
-#if defined(BOARD_maple)
+#if defined(BOARD_maple) || defined(BOARD_maple_RET6)
/* USB Identifier numbers */
#define VCOM_ID_PRODUCT 0x0004
@@ -37,13 +37,13 @@
#elif defined(BOARD_maple_mini)
- #define VCOM_ID_PRODUCT 0x0005
+ #define VCOM_ID_PRODUCT 0x0004
#define USB_DISC_DEV GPIOB
#define USB_DISC_PIN 9
#elif defined(BOARD_maple_native)
- #define VCOM_ID_PRODUCT 0x0006
+ #define VCOM_ID_PRODUCT 0x0004
#define USB_DISC_DEV GPIOB
#define USB_DISC_PIN 8
@@ -51,8 +51,8 @@
#error ("Sorry! the USB stack relies on LeafLabs board-specific " \
"configuration right now. If you want, you can pretend you're one " \
- "of our boards; i.e., #define BOARD_maple, BOARD_maple_mini, or " \
- "BOARD_maple_native according to what matches your MCU best. " \
+ "of our boards; i.e., #define BOARD_maple, BOARD_maple_mini, or " \
+ "BOARD_maple_native according to what matches your MCU best. " \
"You should also take a look at libmaple/usb/descriptors.c; we make " \
"some assumptions there that you probably won't like.")