aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple/libmaple.h
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2011-05-09 16:35:13 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2011-05-09 16:40:58 -0400
commit868fb1c273e562a1140abfa948022c9d4f55bccf (patch)
tree73067aa8cf6f8bd0d7663a634c1f878a78b567ed /libmaple/libmaple.h
parent47c53377292a4db28057fc6394c928cde3727e97 (diff)
downloadlibrambutan-868fb1c273e562a1140abfa948022c9d4f55bccf.tar.gz
librambutan-868fb1c273e562a1140abfa948022c9d4f55bccf.zip
Reverting commits between `git merge-head master refactor` and master.
This is a combination of 11 revert commits, and allows for a clean merge of the work done in the refactor branch. The combined commit messages follow. Revert "Committing basic ring_buffer test." This reverts commit 987fa5f433e0cd41b1621dad8b4e331cf82d49f3. Revert "qa-slave-shield.cpp and test-session.cpp fixes for Mini and RET6 Edition." This reverts commit cdd367bdd264c9e19180032c119850fbba2115ba. Revert "Brought examples/ up to date; PIN_MAP bugfix for D24." This reverts commit b4c2d4514c6d52cac8a649c5d5c24b68a3c0a416. Revert "Separated GPIO config to a separate FSMC routine." This reverts commit 744848ad0fc33eed66acc44e41c3c9d646c5b100. Revert "Slightly faster RAM writes (6.5MHz)." This reverts commit 8ba0b6bb065acb4aff26bc9c838de5f37515caf1. Revert "FSMC working but slow (~6 MHz)." This reverts commit 0dc9490cf4f4f10a23b08fef1728773f10c1b76a. Revert "Maple Mini ERROR_LED_PIN fix." This reverts commit 07d437706840901db1e09ff0ab88229c67c1fa8a. Revert "Fixing USBSerial::read(void*, uint32) return value (thanks, Crenn!)" This reverts commit 3ba7196712a5bfe4fe1166b6c34d49c3d7254568. Revert "Trivial gpio_init() bugfix" This reverts commit f6ce003bb935f26eeefa54acf7c2ae6afaabd871. Revert "Trivial changes to test-session.cpp" This reverts commit a32a37b121ac7e62660d2a83fe67c857fe705122. Revert ".gitignore: Ignore cscope* files" This reverts commit d8c72c17bd6d7416a0846e69f4f5ae5cb229d58e.
Diffstat (limited to 'libmaple/libmaple.h')
-rw-r--r--libmaple/libmaple.h94
1 files changed, 53 insertions, 41 deletions
diff --git a/libmaple/libmaple.h b/libmaple/libmaple.h
index f893cff..02e27d3 100644
--- a/libmaple/libmaple.h
+++ b/libmaple/libmaple.h
@@ -42,20 +42,6 @@
#define DEBUG_LEVEL DEBUG_ALL
#endif
-/* Bitbanded Memory sections */
-#define BITBAND_SRAM_REF 0x20000000
-#define BITBAND_SRAM_BASE 0x22000000
-#define BITBAND_PERI_REF 0x40000000
-#define BITBAND_PERI_BASE 0x42000000
-
-#define USB_CONFIG_MAX_POWER (100 >> 1)
-#define RESET_DELAY (100)
-
-#define ERROR_USART_NUM USART2
-#define ERROR_USART_BAUD 9600
-#define ERROR_TX_PORT GPIOA_BASE
-#define ERROR_TX_PIN 2
-
/* MCU-specific configuration */
#if defined(MCU_STM32F103RB)
/* e.g., LeafLabs Maple */
@@ -88,21 +74,39 @@
#define VCOM_ID_PRODUCT 0x0004
#define USB_DISC_BANK GPIOC_BASE
#define USB_DISC_PIN 12
+ #define USB_CONFIG_MAX_POWER (100 >> 1)
+ #define RESET_DELAY (100)
/* Where to put usercode (based on space reserved for bootloader) */
#define USER_ADDR_ROM 0x08005000
#define USER_ADDR_RAM 0x20000C00
- #define STACK_TOP 0x20000800 /* FIXME can this possibly be correct? */
+ #define STACK_TOP 0x20000800
+ /* Debug port settings (from ASSERT) */
#define ERROR_LED_PORT GPIOB_BASE
#define ERROR_LED_PIN 12
+ #define ERROR_USART_NUM USART2
+ #define ERROR_USART_BAUD 9600
+ #define ERROR_TX_PORT GPIOA_BASE
+ #define ERROR_TX_PIN 2
+
+ /* Just in case, most boards have at least some memory */
+ #ifndef RAMSIZE
+ # define RAMSIZE (caddr_t)0x50000
+ #endif
+
+ /* Bitbanded Memory sections */
+ #define BITBAND_SRAM_REF 0x20000000
+ #define BITBAND_SRAM_BASE 0x22000000
+ #define BITBAND_PERI_REF 0x40000000
+ #define BITBAND_PERI_BASE 0x42000000
#elif defined(MCU_STM32F103ZE)
/* e.g., LeafLabs Maple Native */
#define NR_GPIO_PORTS 7
#define NR_GPIO_PINS 100
- #define NR_BKP_REGS 42
+ #define NR_BKP_REGS 42 /* TODO test on Native */
#define NR_TIMERS 8
#define NR_USART 5 /* NB: 4 and 5 are UART only */
#define NR_FSMC 1
@@ -112,6 +116,8 @@
#define VCOM_ID_PRODUCT 0x0004
#define USB_DISC_BANK GPIOB_BASE
#define USB_DISC_PIN 8
+ #define USB_CONFIG_MAX_POWER (100 >> 1)
+ #define RESET_DELAY (100)
#define USER_ADDR_ROM 0x08005000
#define USER_ADDR_RAM 0x20000C00
@@ -119,13 +125,26 @@
#define ERROR_LED_PORT GPIOC_BASE
#define ERROR_LED_PIN 15
+ #define ERROR_USART_NUM USART1
+ #define ERROR_USART_BAUD 9600
+ #define ERROR_TX_PORT GPIOA_BASE
+ #define ERROR_TX_PIN 10
+
+ #ifndef RAMSIZE
+ # define RAMSIZE (caddr_t)0x50000
+ #endif
+
+ #define BITBAND_SRAM_REF 0x20000000
+ #define BITBAND_SRAM_BASE 0x22000000
+ #define BITBAND_PERI_REF 0x40000000
+ #define BITBAND_PERI_BASE 0x42000000
#elif defined(MCU_STM32F103CB)
/* e.g., LeafLabs Maple Mini */
#define NR_GPIO_PORTS 3
#define NR_GPIO_PINS 34
- #define NR_BKP_REGS 10
+ #define NR_BKP_REGS 10 /* TODO test on Mini */
#define NR_TIMERS 4
#define NR_USART 3
#define NR_FSMC 0
@@ -135,36 +154,29 @@
#define VCOM_ID_PRODUCT 0x0005
#define USB_DISC_BANK GPIOB_BASE
#define USB_DISC_PIN 9
+ #define USB_CONFIG_MAX_POWER (100 >> 1)
+ #define RESET_DELAY 100
#define USER_ADDR_ROM 0x08005000
#define USER_ADDR_RAM 0x20000C00
#define STACK_TOP 0x20000800
#define ERROR_LED_PORT GPIOB_BASE
- #define ERROR_LED_PIN 1
-
-#elif defined(MCU_STM32F103RE)
- /* e.g., LeafLabs Maple RET6 Edition */
-
- #define NR_GPIO_PORTS 4
- #define NR_GPIO_PINS 39
- #define NR_BKP_REGS 42
- #define NR_TIMERS 8
- #define NR_USART 5 /* NB: 4 and 5 are UART only */
- #define NR_FSMC 0
- #define NR_DAC_PINS 0 /* HACK: LED hooked up to DAC2 */
-
- #define VCOM_ID_VENDOR 0x1EAF
- #define VCOM_ID_PRODUCT 0x0004
- #define USB_DISC_BANK GPIOC_BASE
- #define USB_DISC_PIN 12
-
- #define USER_ADDR_ROM 0x08005000
- #define USER_ADDR_RAM 0x20000C00
- #define STACK_TOP 0x20000800
-
- #define ERROR_LED_PORT GPIOA_BASE
- #define ERROR_LED_PIN 5
+ #define ERROR_LED_PIN 12
+ #define ERROR_USART_NUM USART2
+ #define ERROR_USART_BAUD 9600
+ #define ERROR_TX_PORT GPIOA_BASE
+ #define ERROR_TX_PIN 2
+
+ #ifndef RAMSIZE
+ # define RAMSIZE (caddr_t)0x50000
+ #endif
+
+ /* Bitbanded Memory sections */
+ #define BITBAND_SRAM_REF 0x20000000
+ #define BITBAND_SRAM_BASE 0x22000000
+ #define BITBAND_PERI_REF 0x40000000
+ #define BITBAND_PERI_BASE 0x42000000
#else