From d63759c9656d0c7fee06efcf28cda52249c2b090 Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Tue, 24 May 2011 20:28:06 -0400 Subject: Docs: Fix several board-specific values. Ugh. Fix BOARD_NR_ADC_PINS and boardADCPins on Maple, Maple Mini, and Maple RET6 Edition: Maple and Maple RET6 Ed. don't have ADC on pin 3. Seems likely that the error was due to AIN being missing on the silkscreen. They also have ADC on pin 13. This is not really true due to the voltage drop across the built-in LED. Maple Mini really should not include BOARD_LED_PIN among its ADC pins, since it's not broken out to a header. Fix BOARD_NR_PWM_PINS and boardPWMPins on Maple and RET6 Ed: Both boards falsely include pin 25 as a PWM pin. Maple RET6 Edition also lacks some PWM pins. Fix BOARD_NR_SPI on Maple RET6 Edition: SPI3 uses PB4, which is unusable since it's tied to NRST. This means that SPI3 is not available on the RET6 edition. Decreasing BOARD_NR_SPI to 2 to accomodate this. Leave the BOARD_SPI3_*_PIN defines intact so as not to further clutter the rest of the library with RET6-specific wrinkles. --- wirish/boards/maple.cpp | 4 ++-- wirish/boards/maple.h | 2 +- wirish/boards/maple_RET6.cpp | 6 ++++-- wirish/boards/maple_RET6.h | 14 ++++++++++++-- wirish/boards/maple_mini.cpp | 2 +- wirish/boards/maple_mini.h | 2 +- 6 files changed, 21 insertions(+), 9 deletions(-) (limited to 'wirish') diff --git a/wirish/boards/maple.cpp b/wirish/boards/maple.cpp index 2d35e7b..c82a113 100644 --- a/wirish/boards/maple.cpp +++ b/wirish/boards/maple.cpp @@ -100,11 +100,11 @@ extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS] = { }; extern const uint8 boardPWMPins[] __FLASH__ = { - 0, 1, 2, 3, 5, 6, 7, 8, 9, 11, 12, 14, 24, 25, 27, 28 + 0, 1, 2, 3, 5, 6, 7, 8, 9, 11, 12, 14, 24, 27, 28 }; extern const uint8 boardADCPins[] __FLASH__ = { - 0, 1, 2, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 27, 28 + 0, 1, 2, 3, 10, 11, 12, 15, 16, 17, 18, 19, 20, 27, 28 }; extern const uint8 boardUsedPins[] __FLASH__ = { diff --git a/wirish/boards/maple.h b/wirish/boards/maple.h index 4b55f7a..bfa9bc2 100644 --- a/wirish/boards/maple.h +++ b/wirish/boards/maple.h @@ -70,7 +70,7 @@ #define BOARD_NR_GPIO_PINS 44 /* Number of pins capable of PWM output */ -#define BOARD_NR_PWM_PINS 16 +#define BOARD_NR_PWM_PINS 15 /* Number of pins capable of ADC conversion */ #define BOARD_NR_ADC_PINS 15 diff --git a/wirish/boards/maple_RET6.cpp b/wirish/boards/maple_RET6.cpp index d5d3d32..25cdb10 100644 --- a/wirish/boards/maple_RET6.cpp +++ b/wirish/boards/maple_RET6.cpp @@ -96,12 +96,14 @@ extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS] = { {GPIOB, NULL, NULL, 4, 0, ADCx}, /* D43/PB4 */ }; +/* Note: Do NOT include pin 38 (TIM8_CH4), as that's BOARD_BUTTON_PIN + * and thus not broken out to a header. */ extern const uint8 boardPWMPins[BOARD_NR_PWM_PINS] __FLASH__ = { - 0, 1, 2, 3, 5, 6, 7, 8, 9, 11, 12, 14, 24, 25, 27, 28 + 0, 1, 2, 3, 5, 6, 7, 8, 9, 11, 12, 14, 24, 27, 28, 35, 36, 37 }; extern const uint8 boardADCPins[BOARD_NR_ADC_PINS] __FLASH__ = { - 0, 1, 2, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 27, 28 + 0, 1, 2, 3, 10, 11, 12, 15, 16, 17, 18, 19, 20, 27, 28 }; extern const uint8 boardUsedPins[BOARD_NR_USED_PINS] __FLASH__ = { diff --git a/wirish/boards/maple_RET6.h b/wirish/boards/maple_RET6.h index e70edce..755f400 100644 --- a/wirish/boards/maple_RET6.h +++ b/wirish/boards/maple_RET6.h @@ -40,6 +40,9 @@ #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 */ @@ -55,7 +58,12 @@ #define BOARD_USART3_TX_PIN 29 #define BOARD_USART3_RX_PIN 30 -#define BOARD_NR_SPI 3 +/* Note: + * + * SPI3 is unusable due to pin 43 (PB4) and NRST tie-together :(, but + * leave the definitions so as not to clutter things up. This is only + * OK since RET6 Ed. is specifically advertised as a beta board. */ +#define BOARD_NR_SPI 2 #define BOARD_SPI1_NSS_PIN 10 #define BOARD_SPI1_MOSI_PIN 11 #define BOARD_SPI1_MISO_PIN 12 @@ -70,7 +78,9 @@ #define BOARD_SPI3_SCK_PIN 42 #define BOARD_NR_GPIO_PINS 44 -#define BOARD_NR_PWM_PINS 16 +/* Note: NOT 19. The missing one is D38 a.k.a. BOARD_BUTTON_PIN, which + * isn't broken out to a header and is thus unusable for PWM. */ +#define BOARD_NR_PWM_PINS 18 #define BOARD_NR_ADC_PINS 15 #define BOARD_NR_USED_PINS 7 diff --git a/wirish/boards/maple_mini.cpp b/wirish/boards/maple_mini.cpp index 3bc250b..6a3a86b 100644 --- a/wirish/boards/maple_mini.cpp +++ b/wirish/boards/maple_mini.cpp @@ -90,7 +90,7 @@ extern const uint8 boardPWMPins[BOARD_NR_PWM_PINS] __FLASH__ = { }; extern const uint8 boardADCPins[BOARD_NR_ADC_PINS] __FLASH__ = { - 3, 4, 5, 6, 7, 8, 9, 10, 11, 33 // NB: 33 is BOARD_LED_PIN + 3, 4, 5, 6, 7, 8, 9, 10, 11 }; #define USB_DP 23 diff --git a/wirish/boards/maple_mini.h b/wirish/boards/maple_mini.h index fde7f98..51d63cd 100644 --- a/wirish/boards/maple_mini.h +++ b/wirish/boards/maple_mini.h @@ -66,7 +66,7 @@ #define BOARD_NR_GPIO_PINS 34 #define BOARD_NR_PWM_PINS 12 -#define BOARD_NR_ADC_PINS 10 +#define BOARD_NR_ADC_PINS 9 #define BOARD_NR_USED_PINS 4 #define BOARD_JTMS_SWDIO_PIN 22 -- cgit v1.2.3