aboutsummaryrefslogtreecommitdiffstats
path: root/wirish/boards/maple_RET6/include/board
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2012-06-01 01:10:47 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2012-06-01 01:28:51 -0400
commitd483f8fa0c7c1f65c926b24d6c66275953d03c4f (patch)
tree84cd29e2f201fbd6bbac753027c146061e0f05e4 /wirish/boards/maple_RET6/include/board
parentb1e06d3acaa72976042314c1debec008c5ac54d7 (diff)
downloadlibrambutan-d483f8fa0c7c1f65c926b24d6c66275953d03c4f.tar.gz
librambutan-d483f8fa0c7c1f65c926b24d6c66275953d03c4f.zip
Bring back HardwareSerial.
To make this happen, we need to have <board/board.h> tell us whether or not it's got each of the USARTs. Do that with BOARD_HAVE_USARTn, for n = 1,...,6. This lets us define HardwareSerial instances only when appropriate, and gets rid of some board-specific hacks we'd accumulated. The new <libmaple/usart.h> now has a convenience function for determining the bus rate by using the appropriate STM32_PCLKx macro, so we can shave a uint32 per instance, which is nice given that they're all going to be in memory. This changes the constructor arguments, but the API only specifies the semantics of the predefined instances, so this is still backwards-compatible. (We should look into storing the instances in Flash -- they don't change, after all.) We don't actually need struct usart_dev's definition in HardwareSerial.h, so replace it with a forward declaration and include <libmaple/usart.h> it in HardwareSerial.cpp instead. Assert some copyrights. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Diffstat (limited to 'wirish/boards/maple_RET6/include/board')
-rw-r--r--wirish/boards/maple_RET6/include/board/board.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/wirish/boards/maple_RET6/include/board/board.h b/wirish/boards/maple_RET6/include/board/board.h
index 1a0365a..3291498 100644
--- a/wirish/boards/maple_RET6/include/board/board.h
+++ b/wirish/boards/maple_RET6/include/board/board.h
@@ -36,17 +36,20 @@
#ifndef _BOARDS_MAPLE_RET6_H_
#define _BOARDS_MAPLE_RET6_H_
-/* A few of these values will seem strange given that it's a
- * high-density board. */
-
#define CYCLES_PER_MICROSECOND 72
#define SYSTICK_RELOAD_VAL 71999 /* takes a cycle to reload */
#define BOARD_BUTTON_PIN 38
#define BOARD_LED_PIN 13
-/* Note: UART4 and UART5 have pins which aren't broken out :( */
+/* UART4 and UART5 have pins which aren't broken out :( */
#define BOARD_NR_USARTS 3
+#define BOARD_HAVE_USART1 1
+#define BOARD_HAVE_USART2 1
+#define BOARD_HAVE_USART3 1
+#define BOARD_HAVE_UART4 0
+#define BOARD_HAVE_UART5 0
+#define BOARD_HAVE_USART6 0
#define BOARD_USART1_TX_PIN 7
#define BOARD_USART1_RX_PIN 8
#define BOARD_USART2_TX_PIN 1