aboutsummaryrefslogtreecommitdiffstats
path: root/wirish/boards/maple_native.h
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2011-03-30 00:55:51 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2011-03-30 07:19:13 -0400
commitb13926073f47012d6654b0236f195c4356831fc2 (patch)
tree6b7e2a0f98ad0dd469855012cd9a10add8c8def4 /wirish/boards/maple_native.h
parentefbc87c64d89bbb367b6d8face6c50edf0eb5e5c (diff)
downloadlibrambutan-b13926073f47012d6654b0236f195c4356831fc2.tar.gz
librambutan-b13926073f47012d6654b0236f195c4356831fc2.zip
Board-specific values; corresponding QA test generalizations.
Various board-specific #defines and arrays of pins added. For the changelog (some of this information predates this commit): * wirish/boards.h now declares the following arrays of pin numbers: * boardPWMPins - PWM-capable pins * boardADCPins - ADC-capable pins * boardUsedPins - pins already in use, e.g. BOARD_BUTTON_PIN It also declares a bool boardUsesPin(uint8 pin) function for convenient testing of whether a pin is in use. * wirish/boards/*.h now define: * BOARD_USART1_TX_PIN * BOARD_USART1_RX_PIN * BOARD_USART2_TX_PIN * BOARD_USART2_RX_PIN * BOARD_USART3_TX_PIN * BOARD_USART3_RX_PIN * BOARD_NR_GPIO_PINS (renamed from NR_GPIO_PINS) * BOARD_NR_USARTS (renamed from NR_USARTS) * BOARD_NR_PWM_PINS * BOARD_NR_ADC_PINS * BOARD_NR_USED_PINS * wirish/boards/maple_native.h now defines: * BOARD_UART4_TX_PIN * BOARD_UART4_RX_PIN * BOARD_UART5_TX_PIN * BOARD_UART5_RX_PIN (Unfortunately, wirish/boards/maple_RET6.h cannot, since at least one of the UART4/UART5 pins are used already; this will require layout changes for a wide-release Maple form factor RET6 board). * wirish/boards/*.cpp all include the corresponding array definitions. They all live in flash by default, thanks to the new __FLASH__ macro in wirish/wirish_types.h, which is a synonym for the existing __attr_flash #define in libmaple/libmaple_types.h. The documentation was updated to include this information. It also gained various FIXME/TODO comments related to its generalization across boards. The quality assurance-related examples (examples/qa-slave-shield.cpp and examples/test-session.cpp) now make heavy use of board-specific values to ensure portability.
Diffstat (limited to 'wirish/boards/maple_native.h')
-rw-r--r--wirish/boards/maple_native.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/wirish/boards/maple_native.h b/wirish/boards/maple_native.h
index 21fc480..4e3ee82 100644
--- a/wirish/boards/maple_native.h
+++ b/wirish/boards/maple_native.h
@@ -43,11 +43,10 @@
#define CYCLES_PER_MICROSECOND 72
#define SYSTICK_RELOAD_VAL 71999
-#define BOARD_LED_PIN D21
-#define BOARD_BUTTON_PIN D18
-
-#define NR_USARTS 5
+#define BOARD_LED_PIN 21
+#define BOARD_BUTTON_PIN 18
+#define BOARD_NR_USARTS 5
#define BOARD_USART1_TX_PIN 25
#define BOARD_USART1_RX_PIN 26
#define BOARD_USART2_TX_PIN 51
@@ -59,6 +58,12 @@
#define BOARD_UART5_TX_PIN 20
#define BOARD_UART5_RX_PIN 28
-#define NR_GPIO_PINS 100
+#define BOARD_NR_GPIO_PINS 100
+#define BOARD_NR_PWM_PINS 18
+#define BOARD_NR_ADC_PINS 21
+/* FIXME! this isn't true at all; almost all of the triple header pins
+ * are used by the FSMC by default. Fix this (and the corresponding
+ * boardUsedPins definition in maple_native.cpp) by QA time. */
+#define BOARD_NR_USED_PINS 2
#endif