From da4403052cf884c501f27f3b7be0252fa89d5d7a Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Tue, 5 Jun 2012 18:41:10 -0400 Subject: maple/board.cpp: Add more explanatory comments. Signed-off-by: Marti Bolivar --- wirish/boards/maple/board.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'wirish/boards') 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 #include +// 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 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 -- cgit v1.2.3