diff options
author | Marti Bolivar <mbolivar@leaflabs.com> | 2012-06-05 18:41:10 -0400 |
---|---|---|
committer | Marti Bolivar <mbolivar@leaflabs.com> | 2012-06-07 03:38:30 -0400 |
commit | da4403052cf884c501f27f3b7be0252fa89d5d7a (patch) | |
tree | 1066c6d8ad461d76faf40fc817ad07a8a00b67c2 /wirish | |
parent | 947caf8be9d94713d012443f950e148f8fa6e7c8 (diff) | |
download | librambutan-da4403052cf884c501f27f3b7be0252fa89d5d7a.tar.gz librambutan-da4403052cf884c501f27f3b7be0252fa89d5d7a.zip |
maple/board.cpp: Add more explanatory comments.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Diffstat (limited to 'wirish')
-rw-r--r-- | wirish/boards/maple/board.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/wirish/boards/maple/board.cpp b/wirish/boards/maple/board.cpp index 256bb90..26c47b7 100644 --- a/wirish/boards/maple/board.cpp +++ b/wirish/boards/maple/board.cpp @@ -36,9 +36,19 @@ #include <libmaple/timer.h> #include <wirish/wirish_types.h> +// boardInit(): nothing special to do for Maple. +// +// When defining your own board.cpp, you can put extra code in this +// function if you have anything you want done on reset, before main() +// or setup() are called. void boardInit(void) { } +// Pin map: this lets the basic I/O functions (digitalWrite(), +// analogRead(), pwmWrite()) translate from pin numbers to STM32 +// peripherals. +// +// See <wirish/wirish_types.h> for what goes in an stm32_pin_info. extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS] = { /* Top header */ @@ -98,14 +108,20 @@ extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS] = { {GPIOB, NULL, NULL, 4, 0, ADCx}, /* D43/PB4 */ }; +// Array of pins you can use for pwmWrite(). Keep it in Flash because +// it doesn't change, and so we don't waste RAM. extern const uint8 boardPWMPins[] __FLASH__ = { 0, 1, 2, 3, 5, 6, 7, 8, 9, 11, 12, 14, 24, 27, 28 }; +// Array of pins you can use for analogRead(). extern const uint8 boardADCPins[] __FLASH__ = { 0, 1, 2, 3, 10, 11, 12, 15, 16, 17, 18, 19, 20, 27, 28 }; +// Array of pins that the board uses for something special. Other than +// the button and the LED, it's usually best to leave these pins alone +// unless you know what you're doing. extern const uint8 boardUsedPins[] __FLASH__ = { BOARD_LED_PIN, BOARD_BUTTON_PIN, BOARD_JTMS_SWDIO_PIN, BOARD_JTCK_SWCLK_PIN, BOARD_JTDI_PIN, BOARD_JTDO_PIN, BOARD_NJTRST_PIN |