From aebb14f26cd8fa90ad3a187085f165f46b7867de Mon Sep 17 00:00:00 2001 From: lacklustrlabs Date: Fri, 1 Dec 2017 16:54:16 +0100 Subject: [PATCH] Rollback to master --- STM32F1/cores/maple/boards_private.h | 2 +- STM32F1/variants/STM32VLD/board.cpp | 103 ++++---- STM32F1/variants/generic_gd32f103c/board.cpp | 73 +++--- STM32F1/variants/generic_stm32f103c/board.cpp | 74 +++--- STM32F1/variants/generic_stm32f103r/board.cpp | 103 ++++---- .../variants/generic_stm32f103r8/board.cpp | 99 ++++---- STM32F1/variants/generic_stm32f103t/board.cpp | 49 ++-- STM32F1/variants/generic_stm32f103v/board.cpp | 161 ++++++------- STM32F1/variants/generic_stm32f103z/board.cpp | 226 +++++++++--------- STM32F1/variants/hytiny_stm32f103t/board.cpp | 49 ++-- STM32F1/variants/maple_mini/board.cpp | 70 +++--- STM32F1/variants/maple_ret6/board.cpp | 100 ++++---- STM32F1/variants/microduino/board.cpp | 50 ++-- STM32F1/variants/nucleo_f103rb/board.cpp | 94 ++++---- STM32F3/cores/maple/wirish/boards_private.h | 2 +- 15 files changed, 634 insertions(+), 621 deletions(-) diff --git a/STM32F1/cores/maple/boards_private.h b/STM32F1/cores/maple/boards_private.h index 332843d..49867ca 100644 --- a/STM32F1/cores/maple/boards_private.h +++ b/STM32F1/cores/maple/boards_private.h @@ -42,7 +42,7 @@ /* Makes the PIN_MAP rows more human-readable. */ #define PMAP_ROW(gpio_dev, gpio_bit, timer_dev, timer_ch, adc_dev, adc_ch) \ - { gpio_dev, timer_dev, adc_dev, gpio_bit, timer_ch, adc_ch, 0} + { gpio_dev, timer_dev, adc_dev, gpio_bit, timer_ch, adc_ch } namespace wirish { namespace priv { diff --git a/STM32F1/variants/STM32VLD/board.cpp b/STM32F1/variants/STM32VLD/board.cpp index 182e8f7..1cecbd9 100644 --- a/STM32F1/variants/STM32VLD/board.cpp +++ b/STM32F1/variants/STM32VLD/board.cpp @@ -51,66 +51,67 @@ void boardInit(void) { } // Note. See the enum of pin names in board.h + extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS] = { - {&gpioa, &timer2, &adc1, 0, 1, 0, 0}, /* PA0 */ - {&gpioa, &timer2, &adc1, 1, 2, 1, 0}, /* PA1 */ - {&gpioa, &timer2, &adc1, 2, 3, 2, 0}, /* PA2 */ - {&gpioa, &timer2, &adc1, 3, 4, 3, 0}, /* PA3 */ - {&gpioa, NULL, &adc1, 4, 0, 4, 0}, /* PA4 */ - {&gpioa, NULL, &adc1, 5, 0, 5, 0}, /* PA5 */ - {&gpioa, &timer3, &adc1, 6, 1, 6, 0}, /* PA6 */ - {&gpioa, &timer3, &adc1, 7, 2, 7, 0}, /* PA7 */ - {&gpioa, &timer1, NULL, 8, 1, ADCx, 0}, /* PA8 */ - {&gpioa, &timer1, NULL, 9, 2, ADCx, 0}, /* PA9 */ - {&gpioa, &timer1, NULL, 10, 3, ADCx, 0}, /* PA10 */ - {&gpioa, NULL, NULL, 11, 0, ADCx, 0}, /* PA11 */ - {&gpioa, NULL, NULL, 12, 0, ADCx, 0}, /* PA12 */ - {&gpioa, NULL, NULL, 13, 0, ADCx, 0}, /* PA13 */ - {&gpioa, NULL, NULL, 14, 0, ADCx, 0}, /* PA14 */ - {&gpioa, NULL, NULL, 15, 0, ADCx, 0}, /* PA15 */ + {&gpioa, &timer2, &adc1, 0, 1, 0}, /* PA0 */ + {&gpioa, &timer2, &adc1, 1, 2, 1}, /* PA1 */ + {&gpioa, &timer2, &adc1, 2, 3, 2}, /* PA2 */ + {&gpioa, &timer2, &adc1, 3, 4, 3}, /* PA3 */ + {&gpioa, NULL, &adc1, 4, 0, 4}, /* PA4 */ + {&gpioa, NULL, &adc1, 5, 0, 5}, /* PA5 */ + {&gpioa, &timer3, &adc1, 6, 1, 6}, /* PA6 */ + {&gpioa, &timer3, &adc1, 7, 2, 7}, /* PA7 */ + {&gpioa, &timer1, NULL, 8, 1, ADCx}, /* PA8 */ + {&gpioa, &timer1, NULL, 9, 2, ADCx}, /* PA9 */ + {&gpioa, &timer1, NULL, 10, 3, ADCx}, /* PA10 */ + {&gpioa, NULL, NULL, 11, 0, ADCx}, /* PA11 */ + {&gpioa, NULL, NULL, 12, 0, ADCx}, /* PA12 */ + {&gpioa, NULL, NULL, 13, 0, ADCx}, /* PA13 */ + {&gpioa, NULL, NULL, 14, 0, ADCx}, /* PA14 */ + {&gpioa, NULL, NULL, 15, 0, ADCx}, /* PA15 */ - {&gpiob, &timer3, &adc1, 0, 3, 8, 0}, /* PB0 */ - {&gpiob, &timer3, &adc1, 1, 4, 9, 0}, /* PB1 */ - {&gpiob, NULL, NULL, 2, 0, ADCx, 0}, /* PB2 */ - {&gpiob, NULL, NULL, 3, 0, ADCx, 0}, /* PB3 */ - {&gpiob, NULL, NULL, 4, 0, ADCx, 0}, /* PB4 */ - {&gpiob, NULL, NULL, 5, 0, ADCx, 0}, /* PB5 */ - {&gpiob, &timer4, NULL, 6, 1, ADCx, 0}, /* PB6 */ - {&gpiob, &timer4, NULL, 7, 2, ADCx, 0}, /* PB7 */ - {&gpiob, &timer4, NULL, 8, 3, ADCx, 0}, /* PB8 */ - {&gpiob, &timer4, NULL, 9, 4, ADCx, 0}, /* PB9 */ - {&gpiob, NULL, NULL, 10, 0, ADCx, 0}, /* PB10 */ - {&gpiob, NULL, NULL, 11, 0, ADCx, 0}, /* PB11 */ - {&gpiob, NULL, NULL, 12, 0, ADCx, 0}, /* PB12 */ - {&gpiob, NULL, NULL, 13, 0, ADCx, 0}, /* PB13 */ - {&gpiob, NULL, NULL, 14, 0, ADCx, 0}, /* PB14 */ - {&gpiob, NULL, NULL, 15, 0, ADCx, 0}, /* PB15 */ + {&gpiob, &timer3, &adc1, 0, 3, 8}, /* PB0 */ + {&gpiob, &timer3, &adc1, 1, 4, 9}, /* PB1 */ + {&gpiob, NULL, NULL, 2, 0, ADCx}, /* PB2 */ + {&gpiob, NULL, NULL, 3, 0, ADCx}, /* PB3 */ + {&gpiob, NULL, NULL, 4, 0, ADCx}, /* PB4 */ + {&gpiob, NULL, NULL, 5, 0, ADCx}, /* PB5 */ + {&gpiob, &timer4, NULL, 6, 1, ADCx}, /* PB6 */ + {&gpiob, &timer4, NULL, 7, 2, ADCx}, /* PB7 */ + {&gpiob, &timer4, NULL, 8, 3, ADCx}, /* PB8 */ + {&gpiob, &timer4, NULL, 9, 4, ADCx}, /* PB9 */ + {&gpiob, NULL, NULL, 10, 0, ADCx}, /* PB10 */ + {&gpiob, NULL, NULL, 11, 0, ADCx}, /* PB11 */ + {&gpiob, NULL, NULL, 12, 0, ADCx}, /* PB12 */ + {&gpiob, NULL, NULL, 13, 0, ADCx}, /* PB13 */ + {&gpiob, NULL, NULL, 14, 0, ADCx}, /* PB14 */ + {&gpiob, NULL, NULL, 15, 0, ADCx}, /* PB15 */ /* Andy Hull - the R8 is similar to the C8 but exposes more GPIO as follows */ - {&gpioc, NULL, &adc1, 0, 0, 10, 0}, /* PC0 */ - {&gpioc, NULL, &adc1, 1, 0, 11, 0}, /* PC1 */ - {&gpioc, NULL, &adc1, 2, 0, 12, 0}, /* PC2 */ - {&gpioc, NULL, &adc1, 3, 0, 13, 0}, /* PC3 */ - {&gpioc, NULL, &adc1, 4, 0, 14, 0}, /* PC4 */ - {&gpioc, NULL, &adc1, 5, 0, 15, 0}, /* PC5 */ + {&gpioc, NULL, &adc1, 0, 0, 10}, /* PC0 */ + {&gpioc, NULL, &adc1, 1, 0, 11}, /* PC1 */ + {&gpioc, NULL, &adc1, 2, 0, 12}, /* PC2 */ + {&gpioc, NULL, &adc1, 3, 0, 13}, /* PC3 */ + {&gpioc, NULL, &adc1, 4, 0, 14}, /* PC4 */ + {&gpioc, NULL, &adc1, 5, 0, 15}, /* PC5 */ - {&gpioc, NULL, NULL, 6, 0, ADCx, 0}, /* PC6 */ - {&gpioc, NULL, NULL, 7, 0, ADCx, 0}, /* PC7 */ - {&gpioc, NULL, NULL, 8, 0, ADCx, 0}, /* PC8 */ - {&gpioc, NULL, NULL, 9, 0, ADCx, 0}, /* PC9 */ + {&gpioc, NULL, NULL, 6, 0, ADCx}, /* PC6 */ + {&gpioc, NULL, NULL, 7, 0, ADCx}, /* PC7 */ + {&gpioc, NULL, NULL, 8, 0, ADCx}, /* PC8 */ + {&gpioc, NULL, NULL, 9, 0, ADCx}, /* PC9 */ - {&gpioc, NULL, NULL, 10, 0, ADCx, 0}, /* PC10 */ - {&gpioc, NULL, NULL, 11, 0, ADCx, 0}, /* PC11 */ - {&gpioc, NULL, NULL, 12, 0, ADCx, 0}, /* PC12 */ - {&gpioc, NULL, NULL, 13, 0, ADCx, 0}, /* PC13 */ - {&gpioc, NULL, NULL, 14, 0, ADCx, 0}, /* PC14 */ - {&gpioc, NULL, NULL, 15, 0, ADCx, 0}, /* PC15 */ + {&gpioc, NULL, NULL, 10, 0, ADCx}, /* PC10 */ + {&gpioc, NULL, NULL, 11, 0, ADCx}, /* PC11 */ + {&gpioc, NULL, NULL, 12, 0, ADCx}, /* PC12 */ + {&gpioc, NULL, NULL, 13, 0, ADCx}, /* PC13 */ + {&gpioc, NULL, NULL, 14, 0, ADCx}, /* PC14 */ + {&gpioc, NULL, NULL, 15, 0, ADCx}, /* PC15 */ - {&gpiod, NULL, NULL, 0, 0, ADCx, 0}, /* PD2 */ - {&gpiod, NULL, NULL, 1, 0, ADCx, 0}, /* PD2 */ - {&gpiod, NULL, NULL, 2, 0, ADCx, 0}, /* PD2 */ + {&gpiod, NULL, NULL, 0, 0, ADCx}, /* PD2 */ + {&gpiod, NULL, NULL, 1, 0, ADCx}, /* PD2 */ + {&gpiod, NULL, NULL, 2, 0, ADCx}, /* PD2 */ }; extern const uint8 boardPWMPins[BOARD_NR_PWM_PINS] __FLASH__ = { diff --git a/STM32F1/variants/generic_gd32f103c/board.cpp b/STM32F1/variants/generic_gd32f103c/board.cpp index da22d52..8b136f2 100644 --- a/STM32F1/variants/generic_gd32f103c/board.cpp +++ b/STM32F1/variants/generic_gd32f103c/board.cpp @@ -51,46 +51,49 @@ void boardInit(void) { } // Note. See the enum of pin names in board.h + extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS] = { - {&gpioa, &timer2, &adc1, 0, 1, 0, 0}, /* PA0 */ - {&gpioa, &timer2, &adc1, 1, 2, 1, 0}, /* PA1 */ - {&gpioa, &timer2, &adc1, 2, 3, 2, 0}, /* PA2 */ - {&gpioa, &timer2, &adc1, 3, 4, 3, 0}, /* PA3 */ - {&gpioa, NULL, &adc1, 4, 0, 4, 0}, /* PA4 */ - {&gpioa, NULL, &adc1, 5, 0, 5, 0}, /* PA5 */ - {&gpioa, &timer3, &adc1, 6, 1, 6, 0}, /* PA6 */ - {&gpioa, &timer3, &adc1, 7, 2, 7, 0}, /* PA7 */ - {&gpioa, &timer1, NULL, 8, 1, ADCx, 0}, /* PA8 */ - {&gpioa, &timer1, NULL, 9, 2, ADCx, 0}, /* PA9 */ - {&gpioa, &timer1, NULL, 10, 3, ADCx, 0}, /* PA10 */ - {&gpioa, &timer1, NULL, 11, 4, ADCx, 0}, /* PA11 */ - {&gpioa, NULL, NULL, 12, 0, ADCx, 0}, /* PA12 */ - {&gpioa, NULL, NULL, 13, 0, ADCx, 0}, /* PA13 */ - {&gpioa, NULL, NULL, 14, 0, ADCx, 0}, /* PA14 */ - {&gpioa, NULL, NULL, 15, 0, ADCx, 0}, /* PA15 */ + {&gpioa, &timer2, &adc1, 0, 1, 0}, /* PA0 */ + {&gpioa, &timer2, &adc1, 1, 2, 1}, /* PA1 */ + {&gpioa, &timer2, &adc1, 2, 3, 2}, /* PA2 */ + {&gpioa, &timer2, &adc1, 3, 4, 3}, /* PA3 */ + {&gpioa, NULL, &adc1, 4, 0, 4}, /* PA4 */ + {&gpioa, NULL, &adc1, 5, 0, 5}, /* PA5 */ + {&gpioa, &timer3, &adc1, 6, 1, 6}, /* PA6 */ + {&gpioa, &timer3, &adc1, 7, 2, 7}, /* PA7 */ + {&gpioa, &timer1, NULL, 8, 1, ADCx}, /* PA8 */ + {&gpioa, &timer1, NULL, 9, 2, ADCx}, /* PA9 */ + {&gpioa, &timer1, NULL, 10, 3, ADCx}, /* PA10 */ + {&gpioa, &timer1, NULL, 11, 4, ADCx}, /* PA11 */ + {&gpioa, NULL, NULL, 12, 0, ADCx}, /* PA12 */ + {&gpioa, NULL, NULL, 13, 0, ADCx}, /* PA13 */ + {&gpioa, NULL, NULL, 14, 0, ADCx}, /* PA14 */ + {&gpioa, NULL, NULL, 15, 0, ADCx}, /* PA15 */ - {&gpiob, &timer3, &adc1, 0, 3, 8, 0}, /* PB0 */ - {&gpiob, &timer3, &adc1, 1, 4, 9, 0}, /* PB1 */ - {&gpiob, NULL, NULL, 2, 0, ADCx, 0}, /* PB2 */ - {&gpiob, NULL, NULL, 3, 0, ADCx, 0}, /* PB3 */ - {&gpiob, NULL, NULL, 4, 0, ADCx, 0}, /* PB4 */ - {&gpiob, NULL, NULL, 5, 0, ADCx, 0}, /* PB5 */ - {&gpiob, &timer4, NULL, 6, 1, ADCx, 0}, /* PB6 */ - {&gpiob, &timer4, NULL, 7, 2, ADCx, 0}, /* PB7 */ - {&gpiob, &timer4, NULL, 8, 3, ADCx, 0}, /* PB8 */ - {&gpiob, &timer4, NULL, 9, 4, ADCx, 0}, /* PB9 */ - {&gpiob, NULL, NULL, 10, 0, ADCx, 0}, /* PB10 */ - {&gpiob, NULL, NULL, 11, 0, ADCx, 0}, /* PB11 */ - {&gpiob, NULL, NULL, 12, 0, ADCx, 0}, /* PB12 */ - {&gpiob, NULL, NULL, 13, 0, ADCx, 0}, /* PB13 */ - {&gpiob, NULL, NULL, 14, 0, ADCx, 0}, /* PB14 */ - {&gpiob, NULL, NULL, 15, 0, ADCx, 0}, /* PB15 */ + {&gpiob, &timer3, &adc1, 0, 3, 8}, /* PB0 */ + {&gpiob, &timer3, &adc1, 1, 4, 9}, /* PB1 */ + {&gpiob, NULL, NULL, 2, 0, ADCx}, /* PB2 */ + {&gpiob, NULL, NULL, 3, 0, ADCx}, /* PB3 */ + {&gpiob, NULL, NULL, 4, 0, ADCx}, /* PB4 */ + {&gpiob, NULL, NULL, 5, 0, ADCx}, /* PB5 */ + {&gpiob, &timer4, NULL, 6, 1, ADCx}, /* PB6 */ + {&gpiob, &timer4, NULL, 7, 2, ADCx}, /* PB7 */ + {&gpiob, &timer4, NULL, 8, 3, ADCx}, /* PB8 */ + {&gpiob, &timer4, NULL, 9, 4, ADCx}, /* PB9 */ + {&gpiob, NULL, NULL, 10, 0, ADCx}, /* PB10 */ + {&gpiob, NULL, NULL, 11, 0, ADCx}, /* PB11 */ + {&gpiob, NULL, NULL, 12, 0, ADCx}, /* PB12 */ + {&gpiob, NULL, NULL, 13, 0, ADCx}, /* PB13 */ + {&gpiob, NULL, NULL, 14, 0, ADCx}, /* PB14 */ + {&gpiob, NULL, NULL, 15, 0, ADCx}, /* PB15 */ + + {&gpioc, NULL, NULL, 13, 0, ADCx}, /* PC13 */ + {&gpioc, NULL, NULL, 14, 0, ADCx}, /* PC14 */ + {&gpioc, NULL, NULL, 15, 0, ADCx}, /* PC15 */ + - {&gpioc, NULL, NULL, 13, 0, ADCx, 0}, /* PC13 */ - {&gpioc, NULL, NULL, 14, 0, ADCx, 0}, /* PC14 */ - {&gpioc, NULL, NULL, 15, 0, ADCx, 0}, /* PC15 */ }; diff --git a/STM32F1/variants/generic_stm32f103c/board.cpp b/STM32F1/variants/generic_stm32f103c/board.cpp index 7b33ba8..7102adb 100644 --- a/STM32F1/variants/generic_stm32f103c/board.cpp +++ b/STM32F1/variants/generic_stm32f103c/board.cpp @@ -51,46 +51,50 @@ void boardInit(void) { } // Note. See the enum of pin names in board.h + extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS] = { - {&gpioa, &timer2, &adc1, 0, 1, 0, 0}, /* PA0 */ - {&gpioa, &timer2, &adc1, 1, 2, 1, 0}, /* PA1 */ - {&gpioa, &timer2, &adc1, 2, 3, 2, 0}, /* PA2 */ - {&gpioa, &timer2, &adc1, 3, 4, 3, 0}, /* PA3 */ - {&gpioa, NULL, &adc1, 4, 0, 4, 0}, /* PA4 */ - {&gpioa, NULL, &adc1, 5, 0, 5, 0}, /* PA5 */ - {&gpioa, &timer3, &adc1, 6, 1, 6, 0}, /* PA6 */ - {&gpioa, &timer3, &adc1, 7, 2, 7, 0}, /* PA7 */ - {&gpioa, &timer1, NULL, 8, 1, ADCx, 0}, /* PA8 */ - {&gpioa, &timer1, NULL, 9, 2, ADCx, 0}, /* PA9 */ - {&gpioa, &timer1, NULL, 10, 3, ADCx, 0}, /* PA10 */ - {&gpioa, &timer1, NULL, 11, 4, ADCx, 0}, /* PA11 */ - {&gpioa, NULL, NULL, 12, 0, ADCx, 0}, /* PA12 */ - {&gpioa, NULL, NULL, 13, 0, ADCx, 0}, /* PA13 */ - {&gpioa, NULL, NULL, 14, 0, ADCx, 0}, /* PA14 */ - {&gpioa, NULL, NULL, 15, 0, ADCx, 0}, /* PA15 */ + {&gpioa, &timer2, &adc1, 0, 1, 0}, /* PA0 */ + {&gpioa, &timer2, &adc1, 1, 2, 1}, /* PA1 */ + {&gpioa, &timer2, &adc1, 2, 3, 2}, /* PA2 */ + {&gpioa, &timer2, &adc1, 3, 4, 3}, /* PA3 */ + {&gpioa, NULL, &adc1, 4, 0, 4}, /* PA4 */ + {&gpioa, NULL, &adc1, 5, 0, 5}, /* PA5 */ + {&gpioa, &timer3, &adc1, 6, 1, 6}, /* PA6 */ + {&gpioa, &timer3, &adc1, 7, 2, 7}, /* PA7 */ + {&gpioa, &timer1, NULL, 8, 1, ADCx}, /* PA8 */ + {&gpioa, &timer1, NULL, 9, 2, ADCx}, /* PA9 */ + {&gpioa, &timer1, NULL, 10, 3, ADCx}, /* PA10 */ + {&gpioa, &timer1, NULL, 11, 4, ADCx}, /* PA11 */ + {&gpioa, NULL, NULL, 12, 0, ADCx}, /* PA12 */ + {&gpioa, NULL, NULL, 13, 0, ADCx}, /* PA13 */ + {&gpioa, NULL, NULL, 14, 0, ADCx}, /* PA14 */ + {&gpioa, NULL, NULL, 15, 0, ADCx}, /* PA15 */ - {&gpiob, &timer3, &adc1, 0, 3, 8, 0}, /* PB0 */ - {&gpiob, &timer3, &adc1, 1, 4, 9, 0}, /* PB1 */ - {&gpiob, NULL, NULL, 2, 0, ADCx, 0}, /* PB2 */ - {&gpiob, NULL, NULL, 3, 0, ADCx, 0}, /* PB3 */ - {&gpiob, NULL, NULL, 4, 0, ADCx, 0}, /* PB4 */ - {&gpiob, NULL, NULL, 5, 0, ADCx, 0}, /* PB5 */ - {&gpiob, &timer4, NULL, 6, 1, ADCx, 0}, /* PB6 */ - {&gpiob, &timer4, NULL, 7, 2, ADCx, 0}, /* PB7 */ - {&gpiob, &timer4, NULL, 8, 3, ADCx, 0}, /* PB8 */ - {&gpiob, &timer4, NULL, 9, 4, ADCx, 0}, /* PB9 */ - {&gpiob, NULL, NULL, 10, 0, ADCx, 0}, /* PB10 */ - {&gpiob, NULL, NULL, 11, 0, ADCx, 0}, /* PB11 */ - {&gpiob, NULL, NULL, 12, 0, ADCx, 0}, /* PB12 */ - {&gpiob, NULL, NULL, 13, 0, ADCx, 0}, /* PB13 */ - {&gpiob, NULL, NULL, 14, 0, ADCx, 0}, /* PB14 */ - {&gpiob, NULL, NULL, 15, 0, ADCx, 0}, /* PB15 */ + {&gpiob, &timer3, &adc1, 0, 3, 8}, /* PB0 */ + {&gpiob, &timer3, &adc1, 1, 4, 9}, /* PB1 */ + {&gpiob, NULL, NULL, 2, 0, ADCx}, /* PB2 */ + {&gpiob, NULL, NULL, 3, 0, ADCx}, /* PB3 */ + {&gpiob, NULL, NULL, 4, 0, ADCx}, /* PB4 */ + {&gpiob, NULL, NULL, 5, 0, ADCx}, /* PB5 */ + {&gpiob, &timer4, NULL, 6, 1, ADCx}, /* PB6 */ + {&gpiob, &timer4, NULL, 7, 2, ADCx}, /* PB7 */ + {&gpiob, &timer4, NULL, 8, 3, ADCx}, /* PB8 */ + {&gpiob, &timer4, NULL, 9, 4, ADCx}, /* PB9 */ + {&gpiob, NULL, NULL, 10, 0, ADCx}, /* PB10 */ + {&gpiob, NULL, NULL, 11, 0, ADCx}, /* PB11 */ + {&gpiob, NULL, NULL, 12, 0, ADCx}, /* PB12 */ + {&gpiob, NULL, NULL, 13, 0, ADCx}, /* PB13 */ + {&gpiob, NULL, NULL, 14, 0, ADCx}, /* PB14 */ + {&gpiob, NULL, NULL, 15, 0, ADCx}, /* PB15 */ + + {&gpioc, NULL, NULL, 13, 0, ADCx}, /* PC13 */ + {&gpioc, NULL, NULL, 14, 0, ADCx}, /* PC14 */ + {&gpioc, NULL, NULL, 15, 0, ADCx}, /* PC15 */ + + - {&gpioc, NULL, NULL, 13, 0, ADCx, 0}, /* PC13 */ - {&gpioc, NULL, NULL, 14, 0, ADCx, 0}, /* PC14 */ - {&gpioc, NULL, NULL, 15, 0, ADCx, 0}, /* PC15 */ }; extern const uint8 boardPWMPins[BOARD_NR_PWM_PINS] __FLASH__ = { diff --git a/STM32F1/variants/generic_stm32f103r/board.cpp b/STM32F1/variants/generic_stm32f103r/board.cpp index e564425..3e3589c 100644 --- a/STM32F1/variants/generic_stm32f103r/board.cpp +++ b/STM32F1/variants/generic_stm32f103r/board.cpp @@ -69,6 +69,7 @@ void boardInit(void) { // - Timer channel (1 to 4, for PWM), or 0 if none // - ADC device, or NULL if none // - ADC channel, or ADCx if none + extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS] = { /* gpio_dev *gpio_device; GPIO device @@ -80,61 +81,61 @@ extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS] = { uint8 pinMode; mode specific by pinMode call (Roger Clark added to optimize compatibility with Arduino API */ - {&gpioa, &timer2, &adc1, 0, 1, 0, 0}, /* PA0 */ - {&gpioa, &timer2, &adc1, 1, 2, 1, 0}, /* PA1 */ - {&gpioa, &timer2, &adc1, 2, 3, 2, 0}, /* PA2 */ - {&gpioa, &timer2, &adc1, 3, 4, 3, 0}, /* PA3 */ - {&gpioa, NULL, &adc1, 4, 0, 4, 0}, /* PA4 */ - {&gpioa, NULL, &adc1, 5, 0, 5, 0}, /* PA5 */ - {&gpioa, &timer3, &adc1, 6, 1, 6, 0}, /* PA6 */ - {&gpioa, &timer3, &adc1, 7, 2, 7, 0}, /* PA7 */ - {&gpioa, &timer1, NULL, 8, 1, ADCx, 0}, /* PA8 */ - {&gpioa, &timer1, NULL, 9, 2, ADCx, 0}, /* PA9 */ - {&gpioa, &timer1, NULL, 10, 3, ADCx, 0}, /* PA10 */ - {&gpioa, NULL, NULL, 11, 0, ADCx, 0}, /* PA11 */ - {&gpioa, NULL, NULL, 12, 0, ADCx, 0}, /* PA12 */ - {&gpioa, NULL, NULL, 13, 0, ADCx, 0}, /* PA13 */ - {&gpioa, NULL, NULL, 14, 0, ADCx, 0}, /* PA14 */ - {&gpioa, NULL, NULL, 15, 0, ADCx, 0}, /* PA15 */ + {&gpioa, &timer2, &adc1, 0, 1, 0}, /* PA0 */ + {&gpioa, &timer2, &adc1, 1, 2, 1}, /* PA1 */ + {&gpioa, &timer2, &adc1, 2, 3, 2}, /* PA2 */ + {&gpioa, &timer2, &adc1, 3, 4, 3}, /* PA3 */ + {&gpioa, NULL, &adc1, 4, 0, 4}, /* PA4 */ + {&gpioa, NULL, &adc1, 5, 0, 5}, /* PA5 */ + {&gpioa, &timer3, &adc1, 6, 1, 6}, /* PA6 */ + {&gpioa, &timer3, &adc1, 7, 2, 7}, /* PA7 */ + {&gpioa, &timer1, NULL, 8, 1, ADCx}, /* PA8 */ + {&gpioa, &timer1, NULL, 9, 2, ADCx}, /* PA9 */ + {&gpioa, &timer1, NULL, 10, 3, ADCx}, /* PA10 */ + {&gpioa, NULL, NULL, 11, 0, ADCx}, /* PA11 */ + {&gpioa, NULL, NULL, 12, 0, ADCx}, /* PA12 */ + {&gpioa, NULL, NULL, 13, 0, ADCx}, /* PA13 */ + {&gpioa, NULL, NULL, 14, 0, ADCx}, /* PA14 */ + {&gpioa, NULL, NULL, 15, 0, ADCx}, /* PA15 */ - {&gpiob, &timer3, &adc1, 0, 3, 8, 0}, /* PB0 */ - {&gpiob, &timer3, &adc1, 1, 4, 9, 0}, /* PB1 */ - {&gpiob, NULL, NULL, 2, 0, ADCx, 0}, /* PB2 */ - {&gpiob, NULL, NULL, 3, 0, ADCx, 0}, /* PB3 */ - {&gpiob, NULL, NULL, 4, 0, ADCx, 0}, /* PB4 */ - {&gpiob, NULL, NULL, 5, 0, ADCx, 0}, /* PB5 */ - {&gpiob, &timer4, NULL, 6, 1, ADCx, 0}, /* PB6 */ - {&gpiob, &timer4, NULL, 7, 2, ADCx, 0}, /* PB7 */ - {&gpiob, &timer4, NULL, 8, 3, ADCx, 0}, /* PB8 */ - {&gpiob, NULL, NULL, 9, 0, ADCx, 0}, /* PB9 */ - {&gpiob, NULL, NULL, 10, 0, ADCx, 0}, /* PB10 */ - {&gpiob, NULL, NULL, 11, 0, ADCx, 0}, /* PB11 */ - {&gpiob, NULL, NULL, 12, 0, ADCx, 0}, /* PB12 */ - {&gpiob, NULL, NULL, 13, 0, ADCx, 0}, /* PB13 */ - {&gpiob, NULL, NULL, 14, 0, ADCx, 0}, /* PB14 */ - {&gpiob, NULL, NULL, 15, 0, ADCx, 0}, /* PB15 */ + {&gpiob, &timer3, &adc1, 0, 3, 8}, /* PB0 */ + {&gpiob, &timer3, &adc1, 1, 4, 9}, /* PB1 */ + {&gpiob, NULL, NULL, 2, 0, ADCx}, /* PB2 */ + {&gpiob, NULL, NULL, 3, 0, ADCx}, /* PB3 */ + {&gpiob, NULL, NULL, 4, 0, ADCx}, /* PB4 */ + {&gpiob, NULL, NULL, 5, 0, ADCx}, /* PB5 */ + {&gpiob, &timer4, NULL, 6, 1, ADCx}, /* PB6 */ + {&gpiob, &timer4, NULL, 7, 2, ADCx}, /* PB7 */ + {&gpiob, &timer4, NULL, 8, 3, ADCx}, /* PB8 */ + {&gpiob, NULL, NULL, 9, 0, ADCx}, /* PB9 */ + {&gpiob, NULL, NULL, 10, 0, ADCx}, /* PB10 */ + {&gpiob, NULL, NULL, 11, 0, ADCx}, /* PB11 */ + {&gpiob, NULL, NULL, 12, 0, ADCx}, /* PB12 */ + {&gpiob, NULL, NULL, 13, 0, ADCx}, /* PB13 */ + {&gpiob, NULL, NULL, 14, 0, ADCx}, /* PB14 */ + {&gpiob, NULL, NULL, 15, 0, ADCx}, /* PB15 */ - {&gpioc, NULL, &adc1, 0, 0, 10, 0}, /* PC0 */ - {&gpioc, NULL, &adc1, 1, 0, 11, 0}, /* PC1 */ - {&gpioc, NULL, &adc1, 2, 0, 12, 0}, /* PC2 */ - {&gpioc, NULL, &adc1, 3, 0, 13, 0}, /* PC3 */ - {&gpioc, NULL, &adc1, 4, 0, 14, 0}, /* PC4 */ - {&gpioc, NULL, &adc1, 5, 0, 15, 0}, /* PC5 */ - {&gpioc, &timer8, NULL, 6, 1, ADCx, 0}, /* PC6 */ - {&gpioc, &timer8, NULL, 7, 2, ADCx, 0}, /* PC7 */ - {&gpioc, &timer8, NULL, 8, 3, ADCx, 0}, /* PC8 */ - {&gpioc, &timer8, NULL, 9, 4, ADCx, 0}, /* PC9 */ - {&gpioc, NULL, NULL, 10, 0, ADCx, 0}, /* PC10 UART4_TX/SDIO_D2 */ - {&gpioc, NULL, NULL, 11, 0, ADCx, 0}, /* PC11 UART4_RX/SDIO_D3 */ - {&gpioc, NULL, NULL, 12, 0, ADCx, 0}, /* PC12 UART5_TX/SDIO_CK */ - {&gpioc, NULL, NULL, 13, 0, ADCx, 0}, /* PC13 TAMPER-RTC */ - {&gpioc, NULL, NULL, 14, 0, ADCx, 0}, /* PC14 OSC32_IN */ - {&gpioc, NULL, NULL, 15, 0, ADCx, 0}, /* PC15 OSC32_OUT */ + {&gpioc, NULL, &adc1, 0, 0, 10}, /* PC0 */ + {&gpioc, NULL, &adc1, 1, 0, 11}, /* PC1 */ + {&gpioc, NULL, &adc1, 2, 0, 12}, /* PC2 */ + {&gpioc, NULL, &adc1, 3, 0, 13}, /* PC3 */ + {&gpioc, NULL, &adc1, 4, 0, 14}, /* PC4 */ + {&gpioc, NULL, &adc1, 5, 0, 15}, /* PC5 */ + {&gpioc, &timer8, NULL, 6, 1, ADCx}, /* PC6 */ + {&gpioc, &timer8, NULL, 7, 2, ADCx}, /* PC7 */ + {&gpioc, &timer8, NULL, 8, 3, ADCx}, /* PC8 */ + {&gpioc, &timer8, NULL, 9, 4, ADCx}, /* PC9 */ + {&gpioc, NULL, NULL, 10, 0, ADCx}, /* PC10 UART4_TX/SDIO_D2 */ + {&gpioc, NULL, NULL, 11, 0, ADCx}, /* PC11 UART4_RX/SDIO_D3 */ + {&gpioc, NULL, NULL, 12, 0, ADCx}, /* PC12 UART5_TX/SDIO_CK */ + {&gpioc, NULL, NULL, 13, 0, ADCx}, /* PC13 TAMPER-RTC */ + {&gpioc, NULL, NULL, 14, 0, ADCx}, /* PC14 OSC32_IN */ + {&gpioc, NULL, NULL, 15, 0, ADCx}, /* PC15 OSC32_OUT */ - {&gpiod, NULL, NULL, 0, 0, ADCx, 0} , /* PD0 OSC_IN */ - {&gpiod, NULL, NULL, 1, 0, ADCx, 0} , /* PD1 OSC_OUT */ - {&gpiod, NULL, NULL, 2, 0, ADCx, 0} , /* PD2 TIM3_ETR/UART5_RX SDIO_CMD */ + {&gpiod, NULL, NULL, 0, 0, ADCx} , /* PD0 OSC_IN */ + {&gpiod, NULL, NULL, 1, 0, ADCx} , /* PD1 OSC_OUT */ + {&gpiod, NULL, NULL, 2, 0, ADCx} , /* PD2 TIM3_ETR/UART5_RX SDIO_CMD */ }; /* Basically everything that is defined as having a timer us PWM */ diff --git a/STM32F1/variants/generic_stm32f103r8/board.cpp b/STM32F1/variants/generic_stm32f103r8/board.cpp index f667d2f..05f85a5 100644 --- a/STM32F1/variants/generic_stm32f103r8/board.cpp +++ b/STM32F1/variants/generic_stm32f103r8/board.cpp @@ -51,64 +51,65 @@ void boardInit(void) { } // Note. See the enum of pin names in board.h + extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS] = { - {&gpioa, &timer2, &adc1, 0, 1, 0, 0}, /* PA0 */ - {&gpioa, &timer2, &adc1, 1, 2, 1, 0}, /* PA1 */ - {&gpioa, &timer2, &adc1, 2, 3, 2, 0}, /* PA2 */ - {&gpioa, &timer2, &adc1, 3, 4, 3, 0}, /* PA3 */ - {&gpioa, NULL, &adc1, 4, 0, 4, 0}, /* PA4 */ - {&gpioa, NULL, &adc1, 5, 0, 5, 0}, /* PA5 */ - {&gpioa, &timer3, &adc1, 6, 1, 6, 0}, /* PA6 */ - {&gpioa, &timer3, &adc1, 7, 2, 7, 0}, /* PA7 */ - {&gpioa, &timer1, NULL, 8, 1, ADCx, 0}, /* PA8 */ - {&gpioa, &timer1, NULL, 9, 2, ADCx, 0}, /* PA9 */ - {&gpioa, &timer1, NULL, 10, 3, ADCx, 0}, /* PA10 */ - {&gpioa, &timer1, NULL, 11, 4, ADCx, 0}, /* PA11 */ - {&gpioa, NULL, NULL, 12, 0, ADCx, 0}, /* PA12 */ - {&gpioa, NULL, NULL, 13, 0, ADCx, 0}, /* PA13 */ - {&gpioa, NULL, NULL, 14, 0, ADCx, 0}, /* PA14 */ - {&gpioa, NULL, NULL, 15, 0, ADCx, 0}, /* PA15 */ + {&gpioa, &timer2, &adc1, 0, 1, 0}, /* PA0 */ + {&gpioa, &timer2, &adc1, 1, 2, 1}, /* PA1 */ + {&gpioa, &timer2, &adc1, 2, 3, 2}, /* PA2 */ + {&gpioa, &timer2, &adc1, 3, 4, 3}, /* PA3 */ + {&gpioa, NULL, &adc1, 4, 0, 4}, /* PA4 */ + {&gpioa, NULL, &adc1, 5, 0, 5}, /* PA5 */ + {&gpioa, &timer3, &adc1, 6, 1, 6}, /* PA6 */ + {&gpioa, &timer3, &adc1, 7, 2, 7}, /* PA7 */ + {&gpioa, &timer1, NULL, 8, 1, ADCx}, /* PA8 */ + {&gpioa, &timer1, NULL, 9, 2, ADCx}, /* PA9 */ + {&gpioa, &timer1, NULL, 10, 3, ADCx}, /* PA10 */ + {&gpioa, &timer1, NULL, 11, 4, ADCx}, /* PA11 */ + {&gpioa, NULL, NULL, 12, 0, ADCx}, /* PA12 */ + {&gpioa, NULL, NULL, 13, 0, ADCx}, /* PA13 */ + {&gpioa, NULL, NULL, 14, 0, ADCx}, /* PA14 */ + {&gpioa, NULL, NULL, 15, 0, ADCx}, /* PA15 */ - {&gpiob, &timer3, &adc1, 0, 3, 8, 0}, /* PB0 */ - {&gpiob, &timer3, &adc1, 1, 4, 9, 0}, /* PB1 */ - {&gpiob, NULL, NULL, 2, 0, ADCx, 0}, /* PB2 */ - {&gpiob, NULL, NULL, 3, 0, ADCx, 0}, /* PB3 */ - {&gpiob, NULL, NULL, 4, 0, ADCx, 0}, /* PB4 */ - {&gpiob, NULL, NULL, 5, 0, ADCx, 0}, /* PB5 */ - {&gpiob, &timer4, NULL, 6, 1, ADCx, 0}, /* PB6 */ - {&gpiob, &timer4, NULL, 7, 2, ADCx, 0}, /* PB7 */ - {&gpiob, &timer4, NULL, 8, 3, ADCx, 0}, /* PB8 */ - {&gpiob, &timer4, NULL, 9, 4, ADCx, 0}, /* PB9 */ - {&gpiob, NULL, NULL, 10, 0, ADCx, 0}, /* PB10 */ - {&gpiob, NULL, NULL, 11, 0, ADCx, 0}, /* PB11 */ - {&gpiob, NULL, NULL, 12, 0, ADCx, 0}, /* PB12 */ - {&gpiob, NULL, NULL, 13, 0, ADCx, 0}, /* PB13 */ - {&gpiob, NULL, NULL, 14, 0, ADCx, 0}, /* PB14 */ - {&gpiob, NULL, NULL, 15, 0, ADCx, 0}, /* PB15 */ + {&gpiob, &timer3, &adc1, 0, 3, 8}, /* PB0 */ + {&gpiob, &timer3, &adc1, 1, 4, 9}, /* PB1 */ + {&gpiob, NULL, NULL, 2, 0, ADCx}, /* PB2 */ + {&gpiob, NULL, NULL, 3, 0, ADCx}, /* PB3 */ + {&gpiob, NULL, NULL, 4, 0, ADCx}, /* PB4 */ + {&gpiob, NULL, NULL, 5, 0, ADCx}, /* PB5 */ + {&gpiob, &timer4, NULL, 6, 1, ADCx}, /* PB6 */ + {&gpiob, &timer4, NULL, 7, 2, ADCx}, /* PB7 */ + {&gpiob, &timer4, NULL, 8, 3, ADCx}, /* PB8 */ + {&gpiob, &timer4, NULL, 9, 4, ADCx}, /* PB9 */ + {&gpiob, NULL, NULL, 10, 0, ADCx}, /* PB10 */ + {&gpiob, NULL, NULL, 11, 0, ADCx}, /* PB11 */ + {&gpiob, NULL, NULL, 12, 0, ADCx}, /* PB12 */ + {&gpiob, NULL, NULL, 13, 0, ADCx}, /* PB13 */ + {&gpiob, NULL, NULL, 14, 0, ADCx}, /* PB14 */ + {&gpiob, NULL, NULL, 15, 0, ADCx}, /* PB15 */ /* Andy Hull - the R8 is similar to the C8 but exposes more GPIO as follows */ - {&gpioc, NULL, &adc1, 0, 0, 10, 0}, /* PC0 */ - {&gpioc, NULL, &adc1, 1, 0, 11, 0}, /* PC1 */ - {&gpioc, NULL, &adc1, 2, 0, 12, 0}, /* PC2 */ - {&gpioc, NULL, &adc1, 3, 0, 13, 0}, /* PC3 */ - {&gpioc, NULL, &adc1, 4, 0, 14, 0}, /* PC4 */ - {&gpioc, NULL, &adc1, 5, 0, 15, 0}, /* PC5 */ + {&gpioc, NULL, &adc1, 0, 0, 10}, /* PC0 */ + {&gpioc, NULL, &adc1, 1, 0, 11}, /* PC1 */ + {&gpioc, NULL, &adc1, 2, 0, 12}, /* PC2 */ + {&gpioc, NULL, &adc1, 3, 0, 13}, /* PC3 */ + {&gpioc, NULL, &adc1, 4, 0, 14}, /* PC4 */ + {&gpioc, NULL, &adc1, 5, 0, 15}, /* PC5 */ - {&gpioc, NULL, NULL, 6, 0, ADCx, 0}, /* PC6 */ - {&gpioc, NULL, NULL, 7, 0, ADCx, 0}, /* PC7 */ - {&gpioc, NULL, NULL, 8, 0, ADCx, 0}, /* PC8 */ - {&gpioc, NULL, NULL, 9, 0, ADCx, 0}, /* PC9 */ + {&gpioc, NULL, NULL, 6, 0, ADCx}, /* PC6 */ + {&gpioc, NULL, NULL, 7, 0, ADCx}, /* PC7 */ + {&gpioc, NULL, NULL, 8, 0, ADCx}, /* PC8 */ + {&gpioc, NULL, NULL, 9, 0, ADCx}, /* PC9 */ - {&gpioc, NULL, NULL, 10, 0, ADCx, 0}, /* PC10 */ - {&gpioc, NULL, NULL, 11, 0, ADCx, 0}, /* PC11 */ - {&gpioc, NULL, NULL, 12, 0, ADCx, 0}, /* PC12 */ - {&gpioc, NULL, NULL, 13, 0, ADCx, 0}, /* PC13 */ - {&gpioc, NULL, NULL, 14, 0, ADCx, 0}, /* PC14 */ - {&gpioc, NULL, NULL, 15, 0, ADCx, 0}, /* PC15 */ + {&gpioc, NULL, NULL, 10, 0, ADCx}, /* PC10 */ + {&gpioc, NULL, NULL, 11, 0, ADCx}, /* PC11 */ + {&gpioc, NULL, NULL, 12, 0, ADCx}, /* PC12 */ + {&gpioc, NULL, NULL, 13, 0, ADCx}, /* PC13 */ + {&gpioc, NULL, NULL, 14, 0, ADCx}, /* PC14 */ + {&gpioc, NULL, NULL, 15, 0, ADCx}, /* PC15 */ - {&gpiod, NULL, NULL, 2, 0, ADCx, 0}, /* PD2 */ + {&gpiod, NULL, NULL, 2, 0, ADCx}, /* PD2 */ }; extern const uint8 boardPWMPins[BOARD_NR_PWM_PINS] __FLASH__ = { diff --git a/STM32F1/variants/generic_stm32f103t/board.cpp b/STM32F1/variants/generic_stm32f103t/board.cpp index 85c252c..e7a1dc0 100644 --- a/STM32F1/variants/generic_stm32f103t/board.cpp +++ b/STM32F1/variants/generic_stm32f103t/board.cpp @@ -51,34 +51,35 @@ void boardInit(void) { } // Note. See the enum of pin names in board.h + extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS] = { - {&gpioa, &timer2, &adc1, 0, 1, 0, 0}, /* PA0 */ - {&gpioa, &timer2, &adc1, 1, 2, 1, 0}, /* PA1 */ - {&gpioa, &timer2, &adc1, 2, 3, 2, 0}, /* PA2 */ - {&gpioa, &timer2, &adc1, 3, 4, 3, 0}, /* PA3 */ - {&gpioa, NULL, &adc1, 4, 0, 4, 0}, /* PA4 */ - {&gpioa, NULL, &adc1, 5, 0, 5, 0}, /* PA5 */ - {&gpioa, &timer3, &adc1, 6, 1, 6, 0}, /* PA6 */ - {&gpioa, &timer3, &adc1, 7, 2, 7, 0}, /* PA7 */ - {&gpioa, &timer1, NULL, 8, 1, ADCx, 0}, /* PA8 */ - {&gpioa, &timer1, NULL, 9, 2, ADCx, 0}, /* PA9 */ - {&gpioa, &timer1, NULL, 10, 3, ADCx, 0}, /* PA10 */ - {&gpioa, &timer1, NULL, 11, 4, ADCx, 0}, /* PA11 */ - {&gpioa, NULL, NULL, 12, 0, ADCx, 0}, /* PA12 */ - {&gpioa, NULL, NULL, 13, 0, ADCx, 0}, /* PA13 */ - {&gpioa, NULL, NULL, 14, 0, ADCx, 0}, /* PA14 */ - {&gpioa, NULL, NULL, 15, 0, ADCx, 0}, /* PA15 */ + {&gpioa, &timer2, &adc1, 0, 1, 0}, /* PA0 */ + {&gpioa, &timer2, &adc1, 1, 2, 1}, /* PA1 */ + {&gpioa, &timer2, &adc1, 2, 3, 2}, /* PA2 */ + {&gpioa, &timer2, &adc1, 3, 4, 3}, /* PA3 */ + {&gpioa, NULL, &adc1, 4, 0, 4}, /* PA4 */ + {&gpioa, NULL, &adc1, 5, 0, 5}, /* PA5 */ + {&gpioa, &timer3, &adc1, 6, 1, 6}, /* PA6 */ + {&gpioa, &timer3, &adc1, 7, 2, 7}, /* PA7 */ + {&gpioa, &timer1, NULL, 8, 1, ADCx}, /* PA8 */ + {&gpioa, &timer1, NULL, 9, 2, ADCx}, /* PA9 */ + {&gpioa, &timer1, NULL, 10, 3, ADCx}, /* PA10 */ + {&gpioa, &timer1, NULL, 11, 4, ADCx}, /* PA11 */ + {&gpioa, NULL, NULL, 12, 0, ADCx}, /* PA12 */ + {&gpioa, NULL, NULL, 13, 0, ADCx}, /* PA13 */ + {&gpioa, NULL, NULL, 14, 0, ADCx}, /* PA14 */ + {&gpioa, NULL, NULL, 15, 0, ADCx}, /* PA15 */ - {&gpiob, &timer3, &adc1, 0, 3, 8, 0}, /* PB0 */ - {&gpiob, &timer3, &adc1, 1, 4, 9, 0}, /* PB1 */ - {&gpiob, NULL, NULL, 2, 0, ADCx, 0}, /* PB2 */ - {&gpiob, NULL, NULL, 3, 0, ADCx, 0}, /* PB3 */ - {&gpiob, NULL, NULL, 4, 0, ADCx, 0}, /* PB4 */ - {&gpiob, NULL, NULL, 5, 0, ADCx, 0}, /* PB5 */ - {&gpiob, &timer4, NULL, 6, 1, ADCx, 0}, /* PB6 */ - {&gpiob, &timer4, NULL, 7, 2, ADCx, 0}, /* PB7 */ + {&gpiob, &timer3, &adc1, 0, 3, 8}, /* PB0 */ + {&gpiob, &timer3, &adc1, 1, 4, 9}, /* PB1 */ + {&gpiob, NULL, NULL, 2, 0, ADCx}, /* PB2 */ + {&gpiob, NULL, NULL, 3, 0, ADCx}, /* PB3 */ + {&gpiob, NULL, NULL, 4, 0, ADCx}, /* PB4 */ + {&gpiob, NULL, NULL, 5, 0, ADCx}, /* PB5 */ + {&gpiob, &timer4, NULL, 6, 1, ADCx}, /* PB6 */ + {&gpiob, &timer4, NULL, 7, 2, ADCx}, /* PB7 */ }; extern const uint8 boardPWMPins[BOARD_NR_PWM_PINS] __FLASH__ = { diff --git a/STM32F1/variants/generic_stm32f103v/board.cpp b/STM32F1/variants/generic_stm32f103v/board.cpp index a6b3165..9c13772 100644 --- a/STM32F1/variants/generic_stm32f103v/board.cpp +++ b/STM32F1/variants/generic_stm32f103v/board.cpp @@ -68,6 +68,7 @@ void boardInit(void) { // - Timer channel (1 to 4, for PWM), or 0 if none // - ADC device, or NULL if none // - ADC channel, or ADCx if none + extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS] = { /* gpio_dev *gpio_device; GPIO device @@ -78,91 +79,91 @@ extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS] = { uint8 adc_channel; Pin ADC channel, or ADCx if none. */ - {&gpioa, &timer2, &adc1, 0, 1, 0, 0}, /* PA0 */ - {&gpioa, &timer2, &adc1, 1, 2, 1, 0}, /* PA1 */ - {&gpioa, &timer2, &adc1, 2, 3, 2, 0}, /* PA2 */ - {&gpioa, &timer2, &adc1, 3, 4, 3, 0}, /* PA3 */ - {&gpioa, NULL, &adc1, 4, 0, 4, 0}, /* PA4 */ - {&gpioa, NULL, &adc1, 5, 0, 5, 0}, /* PA5 */ - {&gpioa, &timer3, &adc1, 6, 1, 6, 0}, /* PA6 */ - {&gpioa, &timer3, &adc1, 7, 2, 7, 0}, /* PA7 */ - {&gpioa, &timer1, NULL, 8, 1, ADCx, 0}, /* PA8 */ - {&gpioa, &timer1, NULL, 9, 2, ADCx, 0}, /* PA9 */ - {&gpioa, &timer1, NULL, 10, 3, ADCx, 0}, /* PA10 */ - {&gpioa, NULL, NULL, 11, 0, ADCx, 0}, /* PA11 */ //Could have &timer1_CH4, but is also CAN_RX and USBDM - {&gpioa, NULL, NULL, 12, 0, ADCx, 0}, /* PA12 */ //Could have &timer1_ETR, but is also CAN_TX and USBDP - {&gpioa, NULL, NULL, 13, 0, ADCx, 0}, /* PA13 */ - {&gpioa, NULL, NULL, 14, 0, ADCx, 0}, /* PA14 */ - {&gpioa, NULL, NULL, 15, 0, ADCx, 0}, /* PA15 */ //SPI3_NSS + {&gpioa, &timer2, &adc1, 0, 1, 0}, /* PA0 */ + {&gpioa, &timer2, &adc1, 1, 2, 1}, /* PA1 */ + {&gpioa, &timer2, &adc1, 2, 3, 2}, /* PA2 */ + {&gpioa, &timer2, &adc1, 3, 4, 3}, /* PA3 */ + {&gpioa, NULL, &adc1, 4, 0, 4}, /* PA4 */ + {&gpioa, NULL, &adc1, 5, 0, 5}, /* PA5 */ + {&gpioa, &timer3, &adc1, 6, 1, 6}, /* PA6 */ + {&gpioa, &timer3, &adc1, 7, 2, 7}, /* PA7 */ + {&gpioa, &timer1, NULL, 8, 1, ADCx}, /* PA8 */ + {&gpioa, &timer1, NULL, 9, 2, ADCx}, /* PA9 */ + {&gpioa, &timer1, NULL, 10, 3, ADCx}, /* PA10 */ + {&gpioa, NULL, NULL, 11, 0, ADCx}, /* PA11 */ //Could have &timer1_CH4, but is also CAN_RX and USBDM + {&gpioa, NULL, NULL, 12, 0, ADCx}, /* PA12 */ //Could have &timer1_ETR, but is also CAN_TX and USBDP + {&gpioa, NULL, NULL, 13, 0, ADCx}, /* PA13 */ + {&gpioa, NULL, NULL, 14, 0, ADCx}, /* PA14 */ + {&gpioa, NULL, NULL, 15, 0, ADCx}, /* PA15 */ //SPI3_NSS - {&gpiob, &timer3, &adc1, 0, 3, 8, 0}, /* PB0 */ - {&gpiob, &timer3, &adc1, 1, 4, 9, 0}, /* PB1 */ + {&gpiob, &timer3, &adc1, 0, 3, 8}, /* PB0 */ + {&gpiob, &timer3, &adc1, 1, 4, 9}, /* PB1 */ /* NOTE PB2 is not included as its Boot 1 */ - {&gpiob, NULL, NULL, 3, 0, ADCx, 0}, /* PB3 */ //JTDO, SPI3_SCK / I2S3_CK/ - {&gpiob, NULL, NULL, 4, 0, ADCx, 0}, /* PB4 */ //NJTRST, SPI3_MISO - {&gpiob, NULL, NULL, 5, 0, ADCx, 0}, /* PB5 */ //I2C1_SMBA/ SPI3_MOSI - {&gpiob, &timer4, NULL, 6, 1, ADCx, 0}, /* PB6 */ //I2C1_SCL(9) - {&gpiob, &timer4, NULL, 7, 2, ADCx, 0}, /* PB7 */ //I2C1_SDA(9) / FSMC_NADV - {&gpiob, &timer4, NULL, 8, 3, ADCx, 0}, /* PB8 */ //SDIO_D4 - {&gpiob, &timer4, NULL, 9, 4, ADCx, 0}, /* PB9 */ //SDIO_D5 - {&gpiob, NULL, NULL, 10, 0, ADCx, 0}, /* PB10 */ //I2C2_SCL/USART3_TX - {&gpiob, NULL, NULL, 11, 0, ADCx, 0}, /* PB11 */ //I2C2_SDA/USART3_RX - {&gpiob, NULL, NULL, 12, 0, ADCx, 0}, /* PB12 */ //SPI2_NSS/I2S2_WS/I2C2_SMBA/USART3_CK - {&gpiob, NULL, NULL, 13, 0, ADCx, 0}, /* PB13 */ //SPI2_SCK/I2S2_CK/USART3_CTS - {&gpiob, NULL, NULL, 14, 0, ADCx, 0}, /* PB14 */ //SPI2_MISO/TIM1_CH2N/USART3_RTS - {&gpiob, NULL, NULL, 15, 0, ADCx, 0}, /* PB15 */ //SPI2_MOSI/I2S2_SD + {&gpiob, NULL, NULL, 3, 0, ADCx}, /* PB3 */ //JTDO, SPI3_SCK / I2S3_CK/ + {&gpiob, NULL, NULL, 4, 0, ADCx}, /* PB4 */ //NJTRST, SPI3_MISO + {&gpiob, NULL, NULL, 5, 0, ADCx}, /* PB5 */ //I2C1_SMBA/ SPI3_MOSI + {&gpiob, &timer4, NULL, 6, 1, ADCx}, /* PB6 */ //I2C1_SCL(9) + {&gpiob, &timer4, NULL, 7, 2, ADCx}, /* PB7 */ //I2C1_SDA(9) / FSMC_NADV + {&gpiob, &timer4, NULL, 8, 3, ADCx}, /* PB8 */ //SDIO_D4 + {&gpiob, &timer4, NULL, 9, 4, ADCx}, /* PB9 */ //SDIO_D5 + {&gpiob, NULL, NULL, 10, 0, ADCx}, /* PB10 */ //I2C2_SCL/USART3_TX + {&gpiob, NULL, NULL, 11, 0, ADCx}, /* PB11 */ //I2C2_SDA/USART3_RX + {&gpiob, NULL, NULL, 12, 0, ADCx}, /* PB12 */ //SPI2_NSS/I2S2_WS/I2C2_SMBA/USART3_CK + {&gpiob, NULL, NULL, 13, 0, ADCx}, /* PB13 */ //SPI2_SCK/I2S2_CK/USART3_CTS + {&gpiob, NULL, NULL, 14, 0, ADCx}, /* PB14 */ //SPI2_MISO/TIM1_CH2N/USART3_RTS + {&gpiob, NULL, NULL, 15, 0, ADCx}, /* PB15 */ //SPI2_MOSI/I2S2_SD - {&gpioc, NULL, &adc1, 0, 0, 10, 0}, /* PC0 */ - {&gpioc, NULL, &adc1, 1, 0, 11, 0}, /* PC1 */ - {&gpioc, NULL, &adc1, 2, 0, 12, 0}, /* PC2 */ - {&gpioc, NULL, &adc1, 3, 0, 13, 0}, /* PC3 */ - {&gpioc, NULL, &adc1, 4, 0, 14, 0}, /* PC4 */ - {&gpioc, NULL, &adc1, 5, 0, 15, 0}, /* PC5 */ - {&gpioc, &timer8, NULL, 6, 1, ADCx, 0}, /* PC6 I2S2_MCK/SDIO_D6*/ - {&gpioc, &timer8, NULL, 7, 2, ADCx, 0}, /* PC7 I2S3_MCK/SDIO_D7*/ - {&gpioc, &timer8, NULL, 8, 3, ADCx, 0}, /* PC8 SDIO_D0*/ - {&gpioc, &timer8, NULL, 9, 4, ADCx, 0}, /* PC9 SDIO_D1*/ - {&gpioc, NULL, NULL, 10, 0, ADCx, 0}, /* PC10 UART4_TX/SDIO_D2 */ - {&gpioc, NULL, NULL, 11, 0, ADCx, 0}, /* PC11 UART4_RX/SDIO_D3 */ - {&gpioc, NULL, NULL, 12, 0, ADCx, 0}, /* PC12 UART5_TX/SDIO_CK */ - {&gpioc, NULL, NULL, 13, 0, ADCx, 0}, /* PC13 TAMPER-RTC/ Limited output*/ - {&gpioc, NULL, NULL, 14, 0, ADCx, 0}, /* PC14 OSC32_IN/ Limited output*/ - {&gpioc, NULL, NULL, 15, 0, ADCx, 0}, /* PC15 OSC32_OUT/ Limited output*/ + {&gpioc, NULL, &adc1, 0, 0, 10}, /* PC0 */ + {&gpioc, NULL, &adc1, 1, 0, 11}, /* PC1 */ + {&gpioc, NULL, &adc1, 2, 0, 12}, /* PC2 */ + {&gpioc, NULL, &adc1, 3, 0, 13}, /* PC3 */ + {&gpioc, NULL, &adc1, 4, 0, 14}, /* PC4 */ + {&gpioc, NULL, &adc1, 5, 0, 15}, /* PC5 */ + {&gpioc, &timer8, NULL, 6, 1, ADCx}, /* PC6 I2S2_MCK/SDIO_D6*/ + {&gpioc, &timer8, NULL, 7, 2, ADCx}, /* PC7 I2S3_MCK/SDIO_D7*/ + {&gpioc, &timer8, NULL, 8, 3, ADCx}, /* PC8 SDIO_D0*/ + {&gpioc, &timer8, NULL, 9, 4, ADCx}, /* PC9 SDIO_D1*/ + {&gpioc, NULL, NULL, 10, 0, ADCx}, /* PC10 UART4_TX/SDIO_D2 */ + {&gpioc, NULL, NULL, 11, 0, ADCx}, /* PC11 UART4_RX/SDIO_D3 */ + {&gpioc, NULL, NULL, 12, 0, ADCx}, /* PC12 UART5_TX/SDIO_CK */ + {&gpioc, NULL, NULL, 13, 0, ADCx}, /* PC13 TAMPER-RTC/ Limited output*/ + {&gpioc, NULL, NULL, 14, 0, ADCx}, /* PC14 OSC32_IN/ Limited output*/ + {&gpioc, NULL, NULL, 15, 0, ADCx}, /* PC15 OSC32_OUT/ Limited output*/ - {&gpiod, NULL, NULL, 0, 0, ADCx, 0} , /* PD0 OSC_IN */ - {&gpiod, NULL, NULL, 1, 0, ADCx, 0} , /* PD1 OSC_OUT */ - {&gpiod, NULL, NULL, 2, 0, ADCx, 0} , /* PD2 TIM3_ETR/UART5_RX SDIO_CMD */ - {&gpiod, NULL, NULL, 3, 0, ADCx, 0} , /* PD3 FSMC_CLK */ - {&gpiod, NULL, NULL, 4, 0, ADCx, 0} , /* PD4 FSMC_NOE */ - {&gpiod, NULL, NULL, 5, 0, ADCx, 0} , /* PD5 FSMC_NWE */ - {&gpiod, NULL, NULL, 6, 0, ADCx, 0} , /* PD6 FSMC_NWAIT */ - {&gpiod, NULL, NULL, 7, 0, ADCx, 0} , /* PD7 FSMC_NE1/FSMC_NCE2 */ - {&gpiod, NULL, NULL, 8, 0, ADCx, 0} , /* PD8 FSMC_D13 */ - {&gpiod, NULL, NULL, 9, 0, ADCx, 0} , /* PD9 FSMC_D14 */ - {&gpiod, NULL, NULL, 10, 0, ADCx, 0} , /* PD10 FSMC_D15 */ - {&gpiod, NULL, NULL, 11, 0, ADCx, 0} , /* PD11 FSMC_A16 */ - {&gpiod, NULL, NULL, 12, 0, ADCx, 0} , /* PD12 FSMC_A17 */ - {&gpiod, NULL, NULL, 13, 0, ADCx, 0} , /* PD13 FSMC_A18 */ - {&gpiod, NULL, NULL, 14, 0, ADCx, 0} , /* PD14 FSMC_D0 */ - {&gpiod, NULL, NULL, 15, 0, ADCx, 0} , /* PD15 FSMC_D1 */ + {&gpiod, NULL, NULL, 0, 0, ADCx} , /* PD0 OSC_IN */ + {&gpiod, NULL, NULL, 1, 0, ADCx} , /* PD1 OSC_OUT */ + {&gpiod, NULL, NULL, 2, 0, ADCx} , /* PD2 TIM3_ETR/UART5_RX SDIO_CMD */ + {&gpiod, NULL, NULL, 3, 0, ADCx} , /* PD3 FSMC_CLK */ + {&gpiod, NULL, NULL, 4, 0, ADCx} , /* PD4 FSMC_NOE */ + {&gpiod, NULL, NULL, 5, 0, ADCx} , /* PD5 FSMC_NWE */ + {&gpiod, NULL, NULL, 6, 0, ADCx} , /* PD6 FSMC_NWAIT */ + {&gpiod, NULL, NULL, 7, 0, ADCx} , /* PD7 FSMC_NE1/FSMC_NCE2 */ + {&gpiod, NULL, NULL, 8, 0, ADCx} , /* PD8 FSMC_D13 */ + {&gpiod, NULL, NULL, 9, 0, ADCx} , /* PD9 FSMC_D14 */ + {&gpiod, NULL, NULL, 10, 0, ADCx} , /* PD10 FSMC_D15 */ + {&gpiod, NULL, NULL, 11, 0, ADCx} , /* PD11 FSMC_A16 */ + {&gpiod, NULL, NULL, 12, 0, ADCx} , /* PD12 FSMC_A17 */ + {&gpiod, NULL, NULL, 13, 0, ADCx} , /* PD13 FSMC_A18 */ + {&gpiod, NULL, NULL, 14, 0, ADCx} , /* PD14 FSMC_D0 */ + {&gpiod, NULL, NULL, 15, 0, ADCx} , /* PD15 FSMC_D1 */ - {&gpioe, NULL, NULL, 0, 0, ADCx, 0} , /* PE0 TIM4_ETR / FSMC_NBL0 */ - {&gpioe, NULL, NULL, 1, 0, ADCx, 0} , /* PE1 FSMC_NBL1 */ - {&gpioe, NULL, NULL, 2, 0, ADCx, 0} , /* PE2 TRACECK/ FSMC_A23 */ - {&gpioe, NULL, NULL, 3, 0, ADCx, 0} , /* PE3 TRACED0/FSMC_A19 */ - {&gpioe, NULL, NULL, 4, 0, ADCx, 0} , /* PE4 TRACED1/FSMC_A20 */ - {&gpioe, NULL, NULL, 5, 0, ADCx, 0} , /* PE5 TRACED2/FSMC_A21 */ - {&gpioe, NULL, NULL, 6, 0, ADCx, 0} , /* PE6 TRACED3/FSMC_A22 */ - {&gpioe, NULL, NULL, 7, 0, ADCx, 0} , /* PE7 FSMC_D4 */ - {&gpioe, NULL, NULL, 8, 0, ADCx, 0} , /* PE8 FSMC_D5 */ - {&gpioe, NULL, NULL, 9, 0, ADCx, 0} , /* PE9 FSMC_D6 */ - {&gpioe, NULL, NULL, 10, 0, ADCx, 0} , /* PE10 FSMC_D7 */ - {&gpioe, NULL, NULL, 11, 0, ADCx, 0} , /* PE11 FSMC_D8 */ - {&gpioe, NULL, NULL, 12, 0, ADCx, 0} , /* PE12 FSMC_D9 */ - {&gpioe, NULL, NULL, 13, 0, ADCx, 0} , /* PE13 FSMC_D10 */ - {&gpioe, NULL, NULL, 14, 0, ADCx, 0} , /* PE14 FSMC_D11 */ - {&gpioe, NULL, NULL, 15, 0, ADCx, 0} , /* PE15 FSMC_D12 */ + {&gpioe, NULL, NULL, 0, 0, ADCx} , /* PE0 TIM4_ETR / FSMC_NBL0 */ + {&gpioe, NULL, NULL, 1, 0, ADCx} , /* PE1 FSMC_NBL1 */ + {&gpioe, NULL, NULL, 2, 0, ADCx} , /* PE2 TRACECK/ FSMC_A23 */ + {&gpioe, NULL, NULL, 3, 0, ADCx} , /* PE3 TRACED0/FSMC_A19 */ + {&gpioe, NULL, NULL, 4, 0, ADCx} , /* PE4 TRACED1/FSMC_A20 */ + {&gpioe, NULL, NULL, 5, 0, ADCx} , /* PE5 TRACED2/FSMC_A21 */ + {&gpioe, NULL, NULL, 6, 0, ADCx} , /* PE6 TRACED3/FSMC_A22 */ + {&gpioe, NULL, NULL, 7, 0, ADCx} , /* PE7 FSMC_D4 */ + {&gpioe, NULL, NULL, 8, 0, ADCx} , /* PE8 FSMC_D5 */ + {&gpioe, NULL, NULL, 9, 0, ADCx} , /* PE9 FSMC_D6 */ + {&gpioe, NULL, NULL, 10, 0, ADCx} , /* PE10 FSMC_D7 */ + {&gpioe, NULL, NULL, 11, 0, ADCx} , /* PE11 FSMC_D8 */ + {&gpioe, NULL, NULL, 12, 0, ADCx} , /* PE12 FSMC_D9 */ + {&gpioe, NULL, NULL, 13, 0, ADCx} , /* PE13 FSMC_D10 */ + {&gpioe, NULL, NULL, 14, 0, ADCx} , /* PE14 FSMC_D11 */ + {&gpioe, NULL, NULL, 15, 0, ADCx} , /* PE15 FSMC_D12 */ }; @@ -195,4 +196,4 @@ extern const uint8 boardUsedPins[BOARD_NR_USED_PINS] __FLASH__ = { DEFINE_HWSERIAL(Serial2, 3); DEFINE_HWSERIAL_UART(Serial3, 4); DEFINE_HWSERIAL_UART(Serial4, 5); -#endif +#endif \ No newline at end of file diff --git a/STM32F1/variants/generic_stm32f103z/board.cpp b/STM32F1/variants/generic_stm32f103z/board.cpp index 0d112a3..830479e 100644 --- a/STM32F1/variants/generic_stm32f103z/board.cpp +++ b/STM32F1/variants/generic_stm32f103z/board.cpp @@ -80,126 +80,126 @@ extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS] = { uint8 pinMode; mode specific by pinMode call (Roger Clark added to optimize compatibility with Arduino API */ - {&gpioa, &timer2, &adc1, 0, 1, 0, 0}, /* PA0 */ - {&gpioa, &timer2, &adc1, 1, 2, 1, 0}, /* PA1 */ - {&gpioa, &timer2, &adc1, 2, 3, 2, 0}, /* PA2 */ - {&gpioa, &timer2, &adc1, 3, 4, 3, 0}, /* PA3 */ - {&gpioa, NULL, &adc1, 4, 0, 4, 0}, /* PA4 */ - {&gpioa, NULL, &adc1, 5, 0, 5, 0}, /* PA5 */ - {&gpioa, &timer3, &adc1, 6, 1, 6, 0}, /* PA6 */ - {&gpioa, &timer3, &adc1, 7, 2, 7, 0}, /* PA7 */ - {&gpioa, &timer1, NULL, 8, 1, ADCx, 0}, /* PA8 */ - {&gpioa, &timer1, NULL, 9, 2, ADCx, 0}, /* PA9 */ - {&gpioa, &timer1, NULL, 10, 3, ADCx, 0}, /* PA10 */ - {&gpioa, NULL, NULL, 11, 0, ADCx, 0}, /* PA11 */ - {&gpioa, NULL, NULL, 12, 0, ADCx, 0}, /* PA12 */ - {&gpioa, NULL, NULL, 13, 0, ADCx, 0}, /* PA13 */ - {&gpioa, NULL, NULL, 14, 0, ADCx, 0}, /* PA14 */ - {&gpioa, NULL, NULL, 15, 0, ADCx, 0}, /* PA15 */ + {&gpioa, &timer2, &adc1, 0, 1, 0}, /* PA0 */ + {&gpioa, &timer2, &adc1, 1, 2, 1}, /* PA1 */ + {&gpioa, &timer2, &adc1, 2, 3, 2}, /* PA2 */ + {&gpioa, &timer2, &adc1, 3, 4, 3}, /* PA3 */ + {&gpioa, NULL, &adc1, 4, 0, 4}, /* PA4 */ + {&gpioa, NULL, &adc1, 5, 0, 5}, /* PA5 */ + {&gpioa, &timer3, &adc1, 6, 1, 6}, /* PA6 */ + {&gpioa, &timer3, &adc1, 7, 2, 7}, /* PA7 */ + {&gpioa, &timer1, NULL, 8, 1, ADCx}, /* PA8 */ + {&gpioa, &timer1, NULL, 9, 2, ADCx}, /* PA9 */ + {&gpioa, &timer1, NULL, 10, 3, ADCx}, /* PA10 */ + {&gpioa, NULL, NULL, 11, 0, ADCx}, /* PA11 */ + {&gpioa, NULL, NULL, 12, 0, ADCx}, /* PA12 */ + {&gpioa, NULL, NULL, 13, 0, ADCx}, /* PA13 */ + {&gpioa, NULL, NULL, 14, 0, ADCx}, /* PA14 */ + {&gpioa, NULL, NULL, 15, 0, ADCx}, /* PA15 */ - {&gpiob, &timer3, &adc1, 0, 3, 8, 0}, /* PB0 */ - {&gpiob, &timer3, &adc1, 1, 4, 9, 0}, /* PB1 */ - {&gpiob, &timer3, &adc1, 2, 4, 9, 0}, /* PB2 */ - {&gpiob, NULL, NULL, 3, 0, ADCx, 0}, /* PB3 */ - {&gpiob, NULL, NULL, 4, 0, ADCx, 0}, /* PB4 */ - {&gpiob, NULL, NULL, 5, 0, ADCx, 0}, /* PB5 */ - {&gpiob, &timer4, NULL, 6, 1, ADCx, 0}, /* PB6 */ - {&gpiob, &timer4, NULL, 7, 2, ADCx, 0}, /* PB7 */ - {&gpiob, &timer4, NULL, 8, 3, ADCx, 0}, /* PB8 */ - {&gpiob, &timer4, NULL, 9, 4, ADCx, 0}, /* PB9 */ - {&gpiob, NULL, NULL, 10, 0, ADCx, 0}, /* PB10 */ - {&gpiob, NULL, NULL, 11, 0, ADCx, 0}, /* PB11 */ - {&gpiob, NULL, NULL, 12, 0, ADCx, 0}, /* PB12 */ - {&gpiob, NULL, NULL, 13, 0, ADCx, 0}, /* PB13 */ - {&gpiob, NULL, NULL, 14, 0, ADCx, 0}, /* PB14 */ - {&gpiob, NULL, NULL, 15, 0, ADCx, 0}, /* PB15 */ + {&gpiob, &timer3, &adc1, 0, 3, 8}, /* PB0 */ + {&gpiob, &timer3, &adc1, 1, 4, 9}, /* PB1 */ + {&gpiob, &timer3, &adc1, 2, 4, 9}, /* PB2 */ + {&gpiob, NULL, NULL, 3, 0, ADCx}, /* PB3 */ + {&gpiob, NULL, NULL, 4, 0, ADCx}, /* PB4 */ + {&gpiob, NULL, NULL, 5, 0, ADCx}, /* PB5 */ + {&gpiob, &timer4, NULL, 6, 1, ADCx}, /* PB6 */ + {&gpiob, &timer4, NULL, 7, 2, ADCx}, /* PB7 */ + {&gpiob, &timer4, NULL, 8, 3, ADCx}, /* PB8 */ + {&gpiob, &timer4, NULL, 9, 4, ADCx}, /* PB9 */ + {&gpiob, NULL, NULL, 10, 0, ADCx}, /* PB10 */ + {&gpiob, NULL, NULL, 11, 0, ADCx}, /* PB11 */ + {&gpiob, NULL, NULL, 12, 0, ADCx}, /* PB12 */ + {&gpiob, NULL, NULL, 13, 0, ADCx}, /* PB13 */ + {&gpiob, NULL, NULL, 14, 0, ADCx}, /* PB14 */ + {&gpiob, NULL, NULL, 15, 0, ADCx}, /* PB15 */ - {&gpioc, NULL, &adc1, 0, 0, 10, 0}, /* PC0 */ - {&gpioc, NULL, &adc1, 1, 0, 11, 0}, /* PC1 */ - {&gpioc, NULL, &adc1, 2, 0, 12, 0}, /* PC2 */ - {&gpioc, NULL, &adc1, 3, 0, 13, 0}, /* PC3 */ - {&gpioc, NULL, &adc1, 4, 0, 14, 0}, /* PC4 */ - {&gpioc, NULL, &adc1, 5, 0, 15, 0}, /* PC5 */ - {&gpioc, &timer8, NULL, 6, 1, ADCx, 0}, /* PC6 */ - {&gpioc, &timer8, NULL, 7, 2, ADCx, 0}, /* PC7 */ - {&gpioc, &timer8, NULL, 8, 3, ADCx, 0}, /* PC8 */ - {&gpioc, &timer8, NULL, 9, 4, ADCx, 0}, /* PC9 */ - {&gpioc, NULL, NULL, 10, 0, ADCx, 0}, /* PC10 UART4_TX/SDIO_D2 */ - {&gpioc, NULL, NULL, 11, 0, ADCx, 0}, /* PC11 UART4_RX/SDIO_D3 */ - {&gpioc, NULL, NULL, 12, 0, ADCx, 0}, /* PC12 UART5_TX/SDIO_CK */ - {&gpioc, NULL, NULL, 13, 0, ADCx, 0}, /* PC13 TAMPER-RTC */ - {&gpioc, NULL, NULL, 14, 0, ADCx, 0}, /* PC14 OSC32_IN */ - {&gpioc, NULL, NULL, 15, 0, ADCx, 0}, /* PC15 OSC32_OUT */ + {&gpioc, NULL, &adc1, 0, 0, 10}, /* PC0 */ + {&gpioc, NULL, &adc1, 1, 0, 11}, /* PC1 */ + {&gpioc, NULL, &adc1, 2, 0, 12}, /* PC2 */ + {&gpioc, NULL, &adc1, 3, 0, 13}, /* PC3 */ + {&gpioc, NULL, &adc1, 4, 0, 14}, /* PC4 */ + {&gpioc, NULL, &adc1, 5, 0, 15}, /* PC5 */ + {&gpioc, &timer8, NULL, 6, 1, ADCx}, /* PC6 */ + {&gpioc, &timer8, NULL, 7, 2, ADCx}, /* PC7 */ + {&gpioc, &timer8, NULL, 8, 3, ADCx}, /* PC8 */ + {&gpioc, &timer8, NULL, 9, 4, ADCx}, /* PC9 */ + {&gpioc, NULL, NULL, 10, 0, ADCx}, /* PC10 UART4_TX/SDIO_D2 */ + {&gpioc, NULL, NULL, 11, 0, ADCx}, /* PC11 UART4_RX/SDIO_D3 */ + {&gpioc, NULL, NULL, 12, 0, ADCx}, /* PC12 UART5_TX/SDIO_CK */ + {&gpioc, NULL, NULL, 13, 0, ADCx}, /* PC13 TAMPER-RTC */ + {&gpioc, NULL, NULL, 14, 0, ADCx}, /* PC14 OSC32_IN */ + {&gpioc, NULL, NULL, 15, 0, ADCx}, /* PC15 OSC32_OUT */ - {&gpiod, NULL, NULL, 0, 0, ADCx, 0} , /* PD0 OSC_IN */ - {&gpiod, NULL, NULL, 1, 0, ADCx, 0} , /* PD1 OSC_OUT */ - {&gpiod, NULL, NULL, 2, 0, ADCx, 0} , /* PD2 TIM3_ETR/UART5_RX SDIO_CMD */ + {&gpiod, NULL, NULL, 0, 0, ADCx} , /* PD0 OSC_IN */ + {&gpiod, NULL, NULL, 1, 0, ADCx} , /* PD1 OSC_OUT */ + {&gpiod, NULL, NULL, 2, 0, ADCx} , /* PD2 TIM3_ETR/UART5_RX SDIO_CMD */ - {&gpiod, NULL, NULL, 3, 0, ADCx, 0} , /* PD3 FSMC_CLK */ - {&gpiod, NULL, NULL, 4, 0, ADCx, 0} , /* PD4 FSMC_NOE */ - {&gpiod, NULL, NULL, 5, 0, ADCx, 0} , /* PD5 FSMC_NWE */ - {&gpiod, NULL, NULL, 6, 0, ADCx, 0} , /* PD6 FSMC_NWAIT */ - {&gpiod, NULL, NULL, 7, 0, ADCx, 0} , /* PD7 FSMC_NE1/FSMC_NCE2 */ - {&gpiod, NULL, NULL, 8, 0, ADCx, 0} , /* PD8 FSMC_D13 */ - {&gpiod, NULL, NULL, 9, 0, ADCx, 0} , /* PD9 FSMC_D14 */ - {&gpiod, NULL, NULL, 10, 0, ADCx, 0} , /* PD10 FSMC_D15 */ - {&gpiod, NULL, NULL, 11, 0, ADCx, 0} , /* PD11 FSMC_A16 */ - {&gpiod, NULL, NULL, 12, 0, ADCx, 0} , /* PD12 FSMC_A17 */ - {&gpiod, NULL, NULL, 13, 0, ADCx, 0} , /* PD13 FSMC_A18 */ - {&gpiod, NULL, NULL, 14, 0, ADCx, 0} , /* PD14 FSMC_D0 */ - {&gpiod, NULL, NULL, 15, 0, ADCx, 0} , /* PD15 FSMC_D1 */ + {&gpiod, NULL, NULL, 3, 0, ADCx} , /* PD3 FSMC_CLK */ + {&gpiod, NULL, NULL, 4, 0, ADCx} , /* PD4 FSMC_NOE */ + {&gpiod, NULL, NULL, 5, 0, ADCx} , /* PD5 FSMC_NWE */ + {&gpiod, NULL, NULL, 6, 0, ADCx} , /* PD6 FSMC_NWAIT */ + {&gpiod, NULL, NULL, 7, 0, ADCx} , /* PD7 FSMC_NE1/FSMC_NCE2 */ + {&gpiod, NULL, NULL, 8, 0, ADCx} , /* PD8 FSMC_D13 */ + {&gpiod, NULL, NULL, 9, 0, ADCx} , /* PD9 FSMC_D14 */ + {&gpiod, NULL, NULL, 10, 0, ADCx} , /* PD10 FSMC_D15 */ + {&gpiod, NULL, NULL, 11, 0, ADCx} , /* PD11 FSMC_A16 */ + {&gpiod, NULL, NULL, 12, 0, ADCx} , /* PD12 FSMC_A17 */ + {&gpiod, NULL, NULL, 13, 0, ADCx} , /* PD13 FSMC_A18 */ + {&gpiod, NULL, NULL, 14, 0, ADCx} , /* PD14 FSMC_D0 */ + {&gpiod, NULL, NULL, 15, 0, ADCx} , /* PD15 FSMC_D1 */ - {&gpioe, NULL, NULL, 0, 0, ADCx, 0} , /* PE0 */ - {&gpioe, NULL, NULL, 1, 0, ADCx, 0} , /* PE1 */ - {&gpioe, NULL, NULL, 2, 0, ADCx, 0} , /* PE2 */ - {&gpioe, NULL, NULL, 3, 0, ADCx, 0} , /* PE3 */ - {&gpioe, NULL, NULL, 4, 0, ADCx, 0} , /* PE4 */ - {&gpioe, NULL, NULL, 5, 0, ADCx, 0} , /* PE5 */ - {&gpioe, NULL, NULL, 6, 0, ADCx, 0} , /* PE6 */ - {&gpioe, NULL, NULL, 7, 0, ADCx, 0} , /* PE7 */ - {&gpioe, NULL, NULL, 8, 0, ADCx, 0} , /* PE8 */ - {&gpioe, NULL, NULL, 9, 0, ADCx, 0} , /* PE9 */ - {&gpioe, NULL, NULL, 10, 0, ADCx, 0} , /* PE10 */ - {&gpioe, NULL, NULL, 11, 0, ADCx, 0} , /* PE11 */ - {&gpioe, NULL, NULL, 12, 0, ADCx, 0} , /* PE12 */ - {&gpioe, NULL, NULL, 13, 0, ADCx, 0} , /* PE13 */ - {&gpioe, NULL, NULL, 14, 0, ADCx, 0} , /* PE14 */ - {&gpioe, NULL, NULL, 15, 0, ADCx, 0} , /* PE15 */ + {&gpioe, NULL, NULL, 0, 0, ADCx} , /* PE0 */ + {&gpioe, NULL, NULL, 1, 0, ADCx} , /* PE1 */ + {&gpioe, NULL, NULL, 2, 0, ADCx} , /* PE2 */ + {&gpioe, NULL, NULL, 3, 0, ADCx} , /* PE3 */ + {&gpioe, NULL, NULL, 4, 0, ADCx} , /* PE4 */ + {&gpioe, NULL, NULL, 5, 0, ADCx} , /* PE5 */ + {&gpioe, NULL, NULL, 6, 0, ADCx} , /* PE6 */ + {&gpioe, NULL, NULL, 7, 0, ADCx} , /* PE7 */ + {&gpioe, NULL, NULL, 8, 0, ADCx} , /* PE8 */ + {&gpioe, NULL, NULL, 9, 0, ADCx} , /* PE9 */ + {&gpioe, NULL, NULL, 10, 0, ADCx} , /* PE10 */ + {&gpioe, NULL, NULL, 11, 0, ADCx} , /* PE11 */ + {&gpioe, NULL, NULL, 12, 0, ADCx} , /* PE12 */ + {&gpioe, NULL, NULL, 13, 0, ADCx} , /* PE13 */ + {&gpioe, NULL, NULL, 14, 0, ADCx} , /* PE14 */ + {&gpioe, NULL, NULL, 15, 0, ADCx} , /* PE15 */ - {&gpiof, NULL, NULL, 0, 0, ADCx, 0} , /* PF0 */ - {&gpiof, NULL, NULL, 1, 0, ADCx, 0} , /* PF1 */ - {&gpiof, NULL, NULL, 2, 0, ADCx, 0} , /* PF2 */ - {&gpiof, NULL, NULL, 3, 0, ADCx, 0} , /* PF3 */ - {&gpiof, NULL, NULL, 4, 0, ADCx, 0} , /* PF4 */ - {&gpiof, NULL, NULL, 5, 0, ADCx, 0} , /* PF5 */ - {&gpiof, NULL, NULL, 6, 0, ADCx, 0} , /* PF6 */ - {&gpiof, NULL, NULL, 7, 0, ADCx, 0} , /* PF7 */ - {&gpiof, NULL, NULL, 8, 0, ADCx, 0} , /* PF8 */ - {&gpiof, NULL, NULL, 9, 0, ADCx, 0} , /* PF9 */ - {&gpiof, NULL, NULL, 10, 0, ADCx, 0} , /* PF10 */ - {&gpiof, NULL, NULL, 11, 0, ADCx, 0} , /* PF11 */ - {&gpiof, NULL, NULL, 12, 0, ADCx, 0} , /* PF12 */ - {&gpiof, NULL, NULL, 13, 0, ADCx, 0} , /* PF13 */ - {&gpiof, NULL, NULL, 14, 0, ADCx, 0} , /* PF14 */ - {&gpiof, NULL, NULL, 15, 0, ADCx, 0} , /* PF15 */ + {&gpiof, NULL, NULL, 0, 0, ADCx} , /* PF0 */ + {&gpiof, NULL, NULL, 1, 0, ADCx} , /* PF1 */ + {&gpiof, NULL, NULL, 2, 0, ADCx} , /* PF2 */ + {&gpiof, NULL, NULL, 3, 0, ADCx} , /* PF3 */ + {&gpiof, NULL, NULL, 4, 0, ADCx} , /* PF4 */ + {&gpiof, NULL, NULL, 5, 0, ADCx} , /* PF5 */ + {&gpiof, NULL, NULL, 6, 0, ADCx} , /* PF6 */ + {&gpiof, NULL, NULL, 7, 0, ADCx} , /* PF7 */ + {&gpiof, NULL, NULL, 8, 0, ADCx} , /* PF8 */ + {&gpiof, NULL, NULL, 9, 0, ADCx} , /* PF9 */ + {&gpiof, NULL, NULL, 10, 0, ADCx} , /* PF10 */ + {&gpiof, NULL, NULL, 11, 0, ADCx} , /* PF11 */ + {&gpiof, NULL, NULL, 12, 0, ADCx} , /* PF12 */ + {&gpiof, NULL, NULL, 13, 0, ADCx} , /* PF13 */ + {&gpiof, NULL, NULL, 14, 0, ADCx} , /* PF14 */ + {&gpiof, NULL, NULL, 15, 0, ADCx} , /* PF15 */ - {&gpiog, NULL, NULL, 0, 0, ADCx, 0} , /* PG0 */ - {&gpiog, NULL, NULL, 1, 0, ADCx, 0} , /* PG1 */ - {&gpiog, NULL, NULL, 2, 0, ADCx, 0} , /* PG2 */ - {&gpiog, NULL, NULL, 3, 0, ADCx, 0} , /* PG3 */ - {&gpiog, NULL, NULL, 4, 0, ADCx, 0} , /* PG4 */ - {&gpiog, NULL, NULL, 5, 0, ADCx, 0} , /* PG5 */ - {&gpiog, NULL, NULL, 6, 0, ADCx, 0} , /* PG6 */ - {&gpiog, NULL, NULL, 7, 0, ADCx, 0} , /* PG7 */ - {&gpiog, NULL, NULL, 8, 0, ADCx, 0} , /* PG8 */ - {&gpiog, NULL, NULL, 9, 0, ADCx, 0} , /* PG9 */ - {&gpiog, NULL, NULL, 10, 0, ADCx, 0} , /* PG10 */ - {&gpiog, NULL, NULL, 11, 0, ADCx, 0} , /* PG11 */ - {&gpiog, NULL, NULL, 12, 0, ADCx, 0} , /* PG12 */ - {&gpiog, NULL, NULL, 13, 0, ADCx, 0} , /* PG13 */ - {&gpiog, NULL, NULL, 14, 0, ADCx, 0} , /* PG14 */ - {&gpiog, NULL, NULL, 15, 0, ADCx, 0} /* PG15 */ + {&gpiog, NULL, NULL, 0, 0, ADCx} , /* PG0 */ + {&gpiog, NULL, NULL, 1, 0, ADCx} , /* PG1 */ + {&gpiog, NULL, NULL, 2, 0, ADCx} , /* PG2 */ + {&gpiog, NULL, NULL, 3, 0, ADCx} , /* PG3 */ + {&gpiog, NULL, NULL, 4, 0, ADCx} , /* PG4 */ + {&gpiog, NULL, NULL, 5, 0, ADCx} , /* PG5 */ + {&gpiog, NULL, NULL, 6, 0, ADCx} , /* PG6 */ + {&gpiog, NULL, NULL, 7, 0, ADCx} , /* PG7 */ + {&gpiog, NULL, NULL, 8, 0, ADCx} , /* PG8 */ + {&gpiog, NULL, NULL, 9, 0, ADCx} , /* PG9 */ + {&gpiog, NULL, NULL, 10, 0, ADCx} , /* PG10 */ + {&gpiog, NULL, NULL, 11, 0, ADCx} , /* PG11 */ + {&gpiog, NULL, NULL, 12, 0, ADCx} , /* PG12 */ + {&gpiog, NULL, NULL, 13, 0, ADCx} , /* PG13 */ + {&gpiog, NULL, NULL, 14, 0, ADCx} , /* PG14 */ + {&gpiog, NULL, NULL, 15, 0, ADCx} /* PG15 */ }; /* Basically everything that is defined as having a timer us PWM */ @@ -231,4 +231,4 @@ extern const uint8 boardUsedPins[BOARD_NR_USED_PINS] __FLASH__ = { DEFINE_HWSERIAL(Serial2, 3); DEFINE_HWSERIAL_UART(Serial3, 4); DEFINE_HWSERIAL_UART(Serial4, 5); -#endif +#endif \ No newline at end of file diff --git a/STM32F1/variants/hytiny_stm32f103t/board.cpp b/STM32F1/variants/hytiny_stm32f103t/board.cpp index b3fdd9b..f1fb44f 100644 --- a/STM32F1/variants/hytiny_stm32f103t/board.cpp +++ b/STM32F1/variants/hytiny_stm32f103t/board.cpp @@ -51,34 +51,35 @@ void boardInit(void) { } // Note. See the enum of pin names in board.h + extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS] = { - {&gpioa, &timer2, &adc1, 0, 1, 0, 0}, /* PA0 */ - {&gpioa, &timer2, &adc1, 1, 2, 1, 0}, /* PA1 */ - {&gpioa, &timer2, &adc1, 2, 3, 2, 0}, /* PA2 */ - {&gpioa, &timer2, &adc1, 3, 4, 3, 0}, /* PA3 */ - {&gpioa, NULL, &adc1, 4, 0, 4, 0}, /* PA4 */ - {&gpioa, NULL, &adc1, 5, 0, 5, 0}, /* PA5 */ - {&gpioa, &timer3, &adc1, 6, 1, 6, 0}, /* PA6 */ - {&gpioa, &timer3, &adc1, 7, 2, 7, 0}, /* PA7 */ - {&gpioa, &timer1, NULL, 8, 1, ADCx, 0}, /* PA8 */ - {&gpioa, &timer1, NULL, 9, 2, ADCx, 0}, /* PA9 */ - {&gpioa, &timer1, NULL, 10, 3, ADCx, 0}, /* PA10 */ - {&gpioa, &timer1, NULL, 11, 4, ADCx, 0}, /* PA11 */ - {&gpioa, NULL, NULL, 12, 0, ADCx, 0}, /* PA12 */ - {&gpioa, NULL, NULL, 13, 0, ADCx, 0}, /* PA13 */ - {&gpioa, NULL, NULL, 14, 0, ADCx, 0}, /* PA14 */ - {&gpioa, NULL, NULL, 15, 0, ADCx, 0}, /* PA15 */ + {&gpioa, &timer2, &adc1, 0, 1, 0}, /* PA0 */ + {&gpioa, &timer2, &adc1, 1, 2, 1}, /* PA1 */ + {&gpioa, &timer2, &adc1, 2, 3, 2}, /* PA2 */ + {&gpioa, &timer2, &adc1, 3, 4, 3}, /* PA3 */ + {&gpioa, NULL, &adc1, 4, 0, 4}, /* PA4 */ + {&gpioa, NULL, &adc1, 5, 0, 5}, /* PA5 */ + {&gpioa, &timer3, &adc1, 6, 1, 6}, /* PA6 */ + {&gpioa, &timer3, &adc1, 7, 2, 7}, /* PA7 */ + {&gpioa, &timer1, NULL, 8, 1, ADCx}, /* PA8 */ + {&gpioa, &timer1, NULL, 9, 2, ADCx}, /* PA9 */ + {&gpioa, &timer1, NULL, 10, 3, ADCx}, /* PA10 */ + {&gpioa, &timer1, NULL, 11, 4, ADCx}, /* PA11 */ + {&gpioa, NULL, NULL, 12, 0, ADCx}, /* PA12 */ + {&gpioa, NULL, NULL, 13, 0, ADCx}, /* PA13 */ + {&gpioa, NULL, NULL, 14, 0, ADCx}, /* PA14 */ + {&gpioa, NULL, NULL, 15, 0, ADCx}, /* PA15 */ - {&gpiob, &timer3, &adc1, 0, 3, 8, 0}, /* PB0 */ - {&gpiob, &timer3, &adc1, 1, 4, 9, 0}, /* PB1 */ - {&gpiob, NULL, NULL, 2, 0, ADCx, 0}, /* PB2 */ - {&gpiob, NULL, NULL, 3, 0, ADCx, 0}, /* PB3 */ - {&gpiob, NULL, NULL, 4, 0, ADCx, 0}, /* PB4 */ - {&gpiob, NULL, NULL, 5, 0, ADCx, 0}, /* PB5 */ - {&gpiob, &timer4, NULL, 6, 1, ADCx, 0}, /* PB6 */ - {&gpiob, &timer4, NULL, 7, 2, ADCx, 0}, /* PB7 */ + {&gpiob, &timer3, &adc1, 0, 3, 8}, /* PB0 */ + {&gpiob, &timer3, &adc1, 1, 4, 9}, /* PB1 */ + {&gpiob, NULL, NULL, 2, 0, ADCx}, /* PB2 */ + {&gpiob, NULL, NULL, 3, 0, ADCx}, /* PB3 */ + {&gpiob, NULL, NULL, 4, 0, ADCx}, /* PB4 */ + {&gpiob, NULL, NULL, 5, 0, ADCx}, /* PB5 */ + {&gpiob, &timer4, NULL, 6, 1, ADCx}, /* PB6 */ + {&gpiob, &timer4, NULL, 7, 2, ADCx}, /* PB7 */ }; diff --git a/STM32F1/variants/maple_mini/board.cpp b/STM32F1/variants/maple_mini/board.cpp index 72faa17..f49b336 100644 --- a/STM32F1/variants/maple_mini/board.cpp +++ b/STM32F1/variants/maple_mini/board.cpp @@ -54,43 +54,43 @@ extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS] = { /* Top header */ - {&gpiob, NULL, NULL, 11, 0, ADCx, 0}, /* D0/PB11 */ - {&gpiob, NULL, NULL, 10, 0, ADCx, 0}, /* D1/PB10 */ - {&gpiob, NULL, NULL, 2, 0, ADCx, 0}, /* D2/PB2 */ - {&gpiob, &timer3, &adc1, 0, 3, 8, 0}, /* D3/PB0 */ - {&gpioa, &timer3, &adc1, 7, 2, 7, 0}, /* D4/PA7 */ - {&gpioa, &timer3, &adc1, 6, 1, 6, 0}, /* D5/PA6 */ - {&gpioa, NULL, &adc1, 5, 0, 5, 0}, /* D6/PA5 */ - {&gpioa, NULL, &adc1, 4, 0, 4, 0}, /* D7/PA4 */ - {&gpioa, &timer2, &adc1, 3, 4, 3, 0}, /* D8/PA3 */ - {&gpioa, &timer2, &adc1, 2, 3, 2, 0}, /* D9/PA2 */ - {&gpioa, &timer2, &adc1, 1, 2, 1, 0}, /* D10/PA1 */ - {&gpioa, &timer2, &adc1, 0, 1, 0, 0}, /* D11/PA0 */ - {&gpioc, NULL, NULL, 15, 0, ADCx, 0}, /* D12/PC15 */ - {&gpioc, NULL, NULL, 14, 0, ADCx, 0}, /* D13/PC14 */ - {&gpioc, NULL, NULL, 13, 0, ADCx, 0}, /* D14/PC13 */ + {&gpiob, NULL, NULL, 11, 0, ADCx}, /* D0/PB11 */ + {&gpiob, NULL, NULL, 10, 0, ADCx}, /* D1/PB10 */ + {&gpiob, NULL, NULL, 2, 0, ADCx}, /* D2/PB2 */ + {&gpiob, &timer3, &adc1, 0, 3, 8}, /* D3/PB0 */ + {&gpioa, &timer3, &adc1, 7, 2, 7}, /* D4/PA7 */ + {&gpioa, &timer3, &adc1, 6, 1, 6}, /* D5/PA6 */ + {&gpioa, NULL, &adc1, 5, 0, 5}, /* D6/PA5 */ + {&gpioa, NULL, &adc1, 4, 0, 4}, /* D7/PA4 */ + {&gpioa, &timer2, &adc1, 3, 4, 3}, /* D8/PA3 */ + {&gpioa, &timer2, &adc1, 2, 3, 2}, /* D9/PA2 */ + {&gpioa, &timer2, &adc1, 1, 2, 1}, /* D10/PA1 */ + {&gpioa, &timer2, &adc1, 0, 1, 0}, /* D11/PA0 */ + {&gpioc, NULL, NULL, 15, 0, ADCx}, /* D12/PC15 */ + {&gpioc, NULL, NULL, 14, 0, ADCx}, /* D13/PC14 */ + {&gpioc, NULL, NULL, 13, 0, ADCx}, /* D14/PC13 */ /* Bottom header */ - {&gpiob, &timer4, NULL, 7, 2, ADCx, 0}, /* D15/PB7 */ - {&gpiob, &timer4, NULL, 6, 1, ADCx, 0}, /* D16/PB6 */ - {&gpiob, NULL, NULL, 5, 0, ADCx, 0}, /* D17/PB5 */ - {&gpiob, NULL, NULL, 4, 0, ADCx, 0}, /* D18/PB4 */ - {&gpiob, NULL, NULL, 3, 0, ADCx, 0}, /* D19/PB3 */ - {&gpioa, NULL, NULL, 15, 0, ADCx, 0}, /* D20/PA15 */ - {&gpioa, NULL, NULL, 14, 0, ADCx, 0}, /* D21/PA14 */ - {&gpioa, NULL, NULL, 13, 0, ADCx, 0}, /* D22/PA13 */ - {&gpioa, NULL, NULL, 12, 0, ADCx, 0}, /* D23/PA12 */ - {&gpioa, &timer1, NULL, 11, 4, ADCx, 0}, /* D24/PA11 */ - {&gpioa, &timer1, NULL, 10, 3, ADCx, 0}, /* D25/PA10 */ - {&gpioa, &timer1, NULL, 9, 2, ADCx, 0}, /* D26/PA9 */ - {&gpioa, &timer1, NULL, 8, 1, ADCx, 0}, /* D27/PA8 */ - {&gpiob, NULL, NULL, 15, 0, ADCx, 0}, /* D28/PB15 */ - {&gpiob, NULL, NULL, 14, 0, ADCx, 0}, /* D29/PB14 */ - {&gpiob, NULL, NULL, 13, 0, ADCx, 0}, /* D30/PB13 */ - {&gpiob, NULL, NULL, 12, 0, ADCx, 0}, /* D31/PB12 */ - {&gpiob, &timer4, NULL, 8, 3, ADCx, 0}, /* D32/PB8 */ - {&gpiob, &timer3, &adc1, 1, 4, 9, 0}, /* D33/PB1 */ + {&gpiob, &timer4, NULL, 7, 2, ADCx}, /* D15/PB7 */ + {&gpiob, &timer4, NULL, 6, 1, ADCx}, /* D16/PB6 */ + {&gpiob, NULL, NULL, 5, 0, ADCx}, /* D17/PB5 */ + {&gpiob, NULL, NULL, 4, 0, ADCx}, /* D18/PB4 */ + {&gpiob, NULL, NULL, 3, 0, ADCx}, /* D19/PB3 */ + {&gpioa, NULL, NULL, 15, 0, ADCx}, /* D20/PA15 */ + {&gpioa, NULL, NULL, 14, 0, ADCx}, /* D21/PA14 */ + {&gpioa, NULL, NULL, 13, 0, ADCx}, /* D22/PA13 */ + {&gpioa, NULL, NULL, 12, 0, ADCx}, /* D23/PA12 */ + {&gpioa, &timer1, NULL, 11, 4, ADCx}, /* D24/PA11 */ + {&gpioa, &timer1, NULL, 10, 3, ADCx}, /* D25/PA10 */ + {&gpioa, &timer1, NULL, 9, 2, ADCx}, /* D26/PA9 */ + {&gpioa, &timer1, NULL, 8, 1, ADCx}, /* D27/PA8 */ + {&gpiob, NULL, NULL, 15, 0, ADCx}, /* D28/PB15 */ + {&gpiob, NULL, NULL, 14, 0, ADCx}, /* D29/PB14 */ + {&gpiob, NULL, NULL, 13, 0, ADCx}, /* D30/PB13 */ + {&gpiob, NULL, NULL, 12, 0, ADCx}, /* D31/PB12 */ + {&gpiob, &timer4, NULL, 8, 3, ADCx}, /* D32/PB8 */ + {&gpiob, &timer3, &adc1, 1, 4, 9}, /* D33/PB1 */ }; extern const uint8 boardPWMPins[BOARD_NR_PWM_PINS] __FLASH__ = { @@ -125,4 +125,4 @@ DEFINE_HWSERIAL(Serial1, 1); DEFINE_HWSERIAL(Serial2, 2); DEFINE_HWSERIAL(Serial3, 3); - + \ No newline at end of file diff --git a/STM32F1/variants/maple_ret6/board.cpp b/STM32F1/variants/maple_ret6/board.cpp index 82127ff..fb92779 100644 --- a/STM32F1/variants/maple_ret6/board.cpp +++ b/STM32F1/variants/maple_ret6/board.cpp @@ -82,66 +82,66 @@ extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS] = { /* Top header */ - { &gpioa, &timer2, &adc1, 3, 4, 3, 0}, /* D0/PA3 */ - { &gpioa, &timer2, &adc1, 2, 3, 2, 0}, /* D1/PA2 */ - { &gpioa, &timer2, &adc1, 0, 1, 0, 0}, /* D2/PA0 */ - { &gpioa, &timer2, &adc1, 1, 2, 1, 0}, /* D3/PA1 */ - { &gpiob, NULL, NULL, 5, 0, ADCx, 0}, /* D4/PB5 */ - { &gpiob, &timer4, NULL, 6, 1, ADCx, 0}, /* D5/PB6 */ - { &gpioa, &timer1, NULL, 8, 1, ADCx, 0}, /* D6/PA8 */ - { &gpioa, &timer1, NULL, 9, 2, ADCx, 0}, /* D7/PA9 */ - { &gpioa, &timer1, NULL, 10, 3, ADCx, 0}, /* D8/PA10 */ - { &gpiob, &timer4, NULL, 7, 2, ADCx, 0}, /* D9/PB7 */ - { &gpioa, NULL, &adc1, 4, 0, 4, 0}, /* D10/PA4 */ - { &gpioa, &timer3, &adc1, 7, 2, 7, 0}, /* D11/PA7 */ - { &gpioa, &timer3, &adc1, 6, 1, 6, 0}, /* D12/PA6 */ - { &gpioa, NULL, &adc1, 5, 0, 5, 0}, /* D13/PA5 (LED) */ - { &gpiob, &timer4, NULL, 8, 3, ADCx, 0}, /* D14/PB8 */ + { &gpioa, &timer2, &adc1, 3, 4, 3 }, /* D0/PA3 */ + { &gpioa, &timer2, &adc1, 2, 3, 2 }, /* D1/PA2 */ + { &gpioa, &timer2, &adc1, 0, 1, 0 }, /* D2/PA0 */ + { &gpioa, &timer2, &adc1, 1, 2, 1 }, /* D3/PA1 */ + { &gpiob, NULL, NULL, 5, 0, ADCx }, /* D4/PB5 */ + { &gpiob, &timer4, NULL, 6, 1, ADCx }, /* D5/PB6 */ + { &gpioa, &timer1, NULL, 8, 1, ADCx }, /* D6/PA8 */ + { &gpioa, &timer1, NULL, 9, 2, ADCx }, /* D7/PA9 */ + { &gpioa, &timer1, NULL, 10, 3, ADCx }, /* D8/PA10 */ + { &gpiob, &timer4, NULL, 7, 2, ADCx }, /* D9/PB7 */ + { &gpioa, NULL, &adc1, 4, 0, 4 }, /* D10/PA4 */ + { &gpioa, &timer3, &adc1, 7, 2, 7 }, /* D11/PA7 */ + { &gpioa, &timer3, &adc1, 6, 1, 6 }, /* D12/PA6 */ + { &gpioa, NULL, &adc1, 5, 0, 5 }, /* D13/PA5 (LED) */ + { &gpiob, &timer4, NULL, 8, 3, ADCx }, /* D14/PB8 */ /* Little header */ - { &gpioc, NULL, &adc1, 0, 0, 10, 0}, /* D15/PC0 */ - { &gpioc, NULL, &adc1, 1, 0, 11, 0}, /* D16/PC1 */ - { &gpioc, NULL, &adc1, 2, 0, 12, 0}, /* D17/PC2 */ - { &gpioc, NULL, &adc1, 3, 0, 13, 0}, /* D18/PC3 */ - { &gpioc, NULL, &adc1, 4, 0, 14, 0}, /* D19/PC4 */ - { &gpioc, NULL, &adc1, 5, 0, 15, 0}, /* D20/PC5 */ + { &gpioc, NULL, &adc1, 0, 0, 10 }, /* D15/PC0 */ + { &gpioc, NULL, &adc1, 1, 0, 11 }, /* D16/PC1 */ + { &gpioc, NULL, &adc1, 2, 0, 12 }, /* D17/PC2 */ + { &gpioc, NULL, &adc1, 3, 0, 13 }, /* D18/PC3 */ + { &gpioc, NULL, &adc1, 4, 0, 14 }, /* D19/PC4 */ + { &gpioc, NULL, &adc1, 5, 0, 15 }, /* D20/PC5 */ /* External header */ - { &gpioc, NULL, NULL, 13, 0, ADCx, 0}, /* D21/PC13 */ - { &gpioc, NULL, NULL, 14, 0, ADCx, 0}, /* D22/PC14 */ - { &gpioc, NULL, NULL, 15, 0, ADCx, 0}, /* D23/PC15 */ - { &gpiob, &timer4, NULL, 9, 4, ADCx, 0}, /* D24/PB9 */ - { &gpiod, NULL, NULL, 2, 0, ADCx, 0}, /* D25/PD2 */ - { &gpioc, NULL, NULL, 10, 0, ADCx, 0}, /* D26/PC10 */ - { &gpiob, &timer3, &adc1, 0, 3, 8, 0}, /* D27/PB0 */ - { &gpiob, &timer3, &adc1, 1, 4, 9, 0}, /* D28/PB1 */ - { &gpiob, NULL, NULL, 10, 0, ADCx, 0}, /* D29/PB10 */ - { &gpiob, NULL, NULL, 11, 0, ADCx, 0}, /* D30/PB11 */ - { &gpiob, NULL, NULL, 12, 0, ADCx, 0}, /* D31/PB12 */ - { &gpiob, NULL, NULL, 13, 0, ADCx, 0}, /* D32/PB13 */ - { &gpiob, NULL, NULL, 14, 0, ADCx, 0}, /* D33/PB14 */ - { &gpiob, NULL, NULL, 15, 0, ADCx, 0}, /* D34/PB15 */ - { &gpioc, &timer8, NULL, 6, 1, ADCx, 0}, /* D35/PC6 */ - { &gpioc, &timer8, NULL, 7, 2, ADCx, 0}, /* D36/PC7 */ - { &gpioc, &timer8, NULL, 8, 3, ADCx, 0}, /* D37/PC8 */ - { &gpioc, &timer8, NULL, 9, 4, ADCx, 0}, /* D38/PC9 (BUT) */ + { &gpioc, NULL, NULL, 13, 0, ADCx }, /* D21/PC13 */ + { &gpioc, NULL, NULL, 14, 0, ADCx }, /* D22/PC14 */ + { &gpioc, NULL, NULL, 15, 0, ADCx }, /* D23/PC15 */ + { &gpiob, &timer4, NULL, 9, 4, ADCx }, /* D24/PB9 */ + { &gpiod, NULL, NULL, 2, 0, ADCx }, /* D25/PD2 */ + { &gpioc, NULL, NULL, 10, 0, ADCx }, /* D26/PC10 */ + { &gpiob, &timer3, &adc1, 0, 3, 8 }, /* D27/PB0 */ + { &gpiob, &timer3, &adc1, 1, 4, 9 }, /* D28/PB1 */ + { &gpiob, NULL, NULL, 10, 0, ADCx }, /* D29/PB10 */ + { &gpiob, NULL, NULL, 11, 0, ADCx }, /* D30/PB11 */ + { &gpiob, NULL, NULL, 12, 0, ADCx }, /* D31/PB12 */ + { &gpiob, NULL, NULL, 13, 0, ADCx }, /* D32/PB13 */ + { &gpiob, NULL, NULL, 14, 0, ADCx }, /* D33/PB14 */ + { &gpiob, NULL, NULL, 15, 0, ADCx }, /* D34/PB15 */ + { &gpioc, &timer8, NULL, 6, 1, ADCx }, /* D35/PC6 */ + { &gpioc, &timer8, NULL, 7, 2, ADCx }, /* D36/PC7 */ + { &gpioc, &timer8, NULL, 8, 3, ADCx }, /* D37/PC8 */ + { &gpioc, &timer8, NULL, 9, 4, ADCx }, /* D38/PC9 (BUT) */ /* JTAG header */ - { &gpioa, NULL, NULL, 13, 0, ADCx, 0}, /* D39/PA13 */ - { &gpioa, NULL, NULL, 14, 0, ADCx, 0}, /* D40/PA14 */ - { &gpioa, NULL, NULL, 15, 0, ADCx, 0}, /* D41/PA15 */ - { &gpiob, NULL, NULL, 3, 0, ADCx, 0}, /* D42/PB3 */ - { &gpiob, NULL, NULL, 4, 0, ADCx, 0}, /* D43/PB4 */ + { &gpioa, NULL, NULL, 13, 0, ADCx }, /* D39/PA13 */ + { &gpioa, NULL, NULL, 14, 0, ADCx }, /* D40/PA14 */ + { &gpioa, NULL, NULL, 15, 0, ADCx }, /* D41/PA15 */ + { &gpiob, NULL, NULL, 3, 0, ADCx }, /* D42/PB3 */ + { &gpiob, NULL, NULL, 4, 0, ADCx }, /* D43/PB4 */ - { &gpioc, NULL, NULL, 11, 0, ADCx, 0}, /* D44/PC11 UART4_RX/SDIO_D3 */ - { &gpioc, NULL, NULL, 12, 0, ADCx, 0}, /* D45/PC12 UART5_TX/SDIO_CK */ + { &gpioc, NULL, NULL, 11, 0, ADCx }, /* D44/PC11 UART4_RX/SDIO_D3 */ + { &gpioc, NULL, NULL, 12, 0, ADCx }, /* D45/PC12 UART5_TX/SDIO_CK */ - { &gpiod, NULL, NULL, 0, 0, ADCx, 0}, /* PD0 OSC_IN */ - { &gpiod, NULL, NULL, 1, 0, ADCx, 0}, /* PD1 OSC_OUT */ - { &gpiob, NULL, NULL, 2, 0, ADCx, 0}, /* PB2 */ + { &gpiod, NULL, NULL, 0, 0, ADCx }, /* PD0 OSC_IN */ + { &gpiod, NULL, NULL, 1, 0, ADCx }, /* PD1 OSC_OUT */ + { &gpiob, NULL, NULL, 2, 0, ADCx }, /* PB2 */ }; /* Basically everything that is defined as having a timer us PWM */ @@ -175,4 +175,4 @@ DEFINE_HWSERIAL(Serial1, 1); DEFINE_HWSERIAL(Serial2, 2); DEFINE_HWSERIAL(Serial3, 3); DEFINE_HWSERIAL_UART(Serial4, 4); -DEFINE_HWSERIAL_UART(Serial5, 5); +DEFINE_HWSERIAL_UART(Serial5, 5); \ No newline at end of file diff --git a/STM32F1/variants/microduino/board.cpp b/STM32F1/variants/microduino/board.cpp index 51c8024..2a00288 100644 --- a/STM32F1/variants/microduino/board.cpp +++ b/STM32F1/variants/microduino/board.cpp @@ -54,35 +54,35 @@ void boardInit(void) { extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS] = { - {&gpioa, &timer1, NULL, 10, 3, ADCx, 0}, /* D0(RxD0)/PA10 */ - {&gpioa, &timer1, NULL, 9, 2, ADCx, 0}, /* D1(TxD1)/PA9 */ - {&gpiob, NULL, NULL, 11, 0, ADCx, 0}, /* D2/PB11 */ - {&gpiob, NULL, NULL, 10, 0, ADCx, 0}, /* D3/PB10 */ - {&gpioa, &timer1, NULL, 8, 1, ADCx, 0}, /* D4/PA8 */ - {&gpioa, NULL, NULL, 13, 0, ADCx, 0}, /* D5/PA13 */ - {&gpioa, NULL, NULL, 14, 0, ADCx, 0}, /* D6/PA14 */ - {&gpioa, NULL, NULL, 15, 0, ADCx, 0}, /* D7/PA15 */ - {&gpiob, NULL, NULL, 3, 0, ADCx, 0}, /* D8/PB3 */ - {&gpiob, NULL, NULL, 4, 0, ADCx, 0}, /* D9/PB4 */ - {&gpioa, NULL, &adc1, 4, 0, 4, 0}, /* D10/PA4 */ - {&gpioa, &timer3, &adc1, 7, 2, 7, 0}, /* D11/PA7 */ - {&gpioa, &timer3, &adc1, 6, 1, 6, 0}, /* D12/PA6 */ - {&gpioa, NULL, &adc1, 5, 0, 5, 0}, /* D13/PA5 */ + {&gpioa, &timer1, NULL, 10, 3, ADCx}, /* D0(RxD0)/PA10 */ + {&gpioa, &timer1, NULL, 9, 2, ADCx}, /* D1(TxD1)/PA9 */ + {&gpiob, NULL, NULL, 11, 0, ADCx}, /* D2/PB11 */ + {&gpiob, NULL, NULL, 10, 0, ADCx}, /* D3/PB10 */ + {&gpioa, &timer1, NULL, 8, 1, ADCx}, /* D4/PA8 */ + {&gpioa, NULL, NULL, 13, 0, ADCx}, /* D5/PA13 */ + {&gpioa, NULL, NULL, 14, 0, ADCx}, /* D6/PA14 */ + {&gpioa, NULL, NULL, 15, 0, ADCx}, /* D7/PA15 */ + {&gpiob, NULL, NULL, 3, 0, ADCx}, /* D8/PB3 */ + {&gpiob, NULL, NULL, 4, 0, ADCx}, /* D9/PB4 */ + {&gpioa, NULL, &adc1, 4, 0, 4}, /* D10/PA4 */ + {&gpioa, &timer3, &adc1, 7, 2, 7}, /* D11/PA7 */ + {&gpioa, &timer3, &adc1, 6, 1, 6}, /* D12/PA6 */ + {&gpioa, NULL, &adc1, 5, 0, 5}, /* D13/PA5 */ - {&gpioa, &timer2, &adc1, 0, 1, 0, 0}, /* D14(A0)/PA0 */ - {&gpioa, &timer2, &adc1, 1, 2, 1, 0}, /* D15(A1)/PA1 */ - {&gpioa, &timer2, &adc1, 2, 3, 2, 0}, /* D16(A2)/PA2 */ - {&gpioa, &timer2, &adc1, 3, 4, 3, 0}, /* D17(A3)/PA3 */ - {&gpiob, &timer4, NULL, 7, 2, ADCx, 0}, /* D18(A4)/PB7 */ - {&gpiob, &timer4, NULL, 6, 1, ADCx, 0}, /* D19(A5)/PB6 */ - {&gpiob, &timer3, &adc1, 0, 3, 8, 0}, /* D20(A6)/PB0 */ - {&gpiob, &timer3, &adc1, 1, 4, 9, 0}, /* D21(A7)/PB1 */ + {&gpioa, &timer2, &adc1, 0, 1, 0}, /* D14(A0)/PA0 */ + {&gpioa, &timer2, &adc1, 1, 2, 1}, /* D15(A1)/PA1 */ + {&gpioa, &timer2, &adc1, 2, 3, 2}, /* D16(A2)/PA2 */ + {&gpioa, &timer2, &adc1, 3, 4, 3}, /* D17(A3)/PA3 */ + {&gpiob, &timer4, NULL, 7, 2, ADCx}, /* D18(A4)/PB7 */ + {&gpiob, &timer4, NULL, 6, 1, ADCx}, /* D19(A5)/PB6 */ + {&gpiob, &timer3, &adc1, 0, 3, 8}, /* D20(A6)/PB0 */ + {&gpiob, &timer3, &adc1, 1, 4, 9}, /* D21(A7)/PB1 */ - {&gpioa, NULL, NULL, 12, 0, ADCx, 0}, /* D22/PA12/USB D+ */ - {&gpioa, &timer1, NULL, 11, 4, ADCx, 0}, /* D23/PA11/USB D- */ + {&gpioa, NULL, NULL, 12, 0, ADCx}, /* D22/PA12/USB D+ */ + {&gpioa, &timer1, NULL, 11, 4, ADCx}, /* D23/PA11/USB D- */ // FIXME: find out which pin is the button, if any - {&gpiob, NULL, NULL, 8, 0, ADCx, 0}, /* D24/PB8??/Button */ + {&gpiob, NULL, NULL, 8, 0, ADCx}, /* D24/PB8??/Button */ }; extern const uint8 boardPWMPins[BOARD_NR_PWM_PINS] __FLASH__ = { diff --git a/STM32F1/variants/nucleo_f103rb/board.cpp b/STM32F1/variants/nucleo_f103rb/board.cpp index a70a188..9f3e08a 100644 --- a/STM32F1/variants/nucleo_f103rb/board.cpp +++ b/STM32F1/variants/nucleo_f103rb/board.cpp @@ -96,55 +96,55 @@ rcc_pll_cfg w_board_pll_cfg = {RCC_PLLSRC_HSI_DIV_2, &pll_data}; extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS] = { /* Arduino-like header, right connectors */ - {&gpioa, NULL, &adc1, 3, 0, 3, 0}, /* D0/PA3 */ - {&gpioa, NULL, &adc1, 2, 0, 2, 0}, /* D1/PA2 */ - {&gpioa, &timer1, NULL, 10, 3, ADCx, 0}, /* D2/PA10 */ - {&gpiob, &timer2, NULL, 3, 2, ADCx, 0}, /* D3/PB3 */ - {&gpiob, &timer3, NULL, 5, 2, ADCx, 0}, /* D4/PB5 */ - {&gpiob, &timer3, NULL, 4, 1, ADCx, 0}, /* D5/PB4 */ - {&gpiob, &timer2, NULL, 10, 3, ADCx, 0}, /* D6/PB10 */ - {&gpioa, &timer1, NULL, 8, 1, ADCx, 0}, /* D7/PA8 */ + {&gpioa, NULL, &adc1, 3, 0, 3}, /* D0/PA3 */ + {&gpioa, NULL, &adc1, 2, 0, 2}, /* D1/PA2 */ + {&gpioa, &timer1, NULL, 10, 3, ADCx}, /* D2/PA10 */ + {&gpiob, &timer2, NULL, 3, 2, ADCx}, /* D3/PB3 */ + {&gpiob, &timer3, NULL, 5, 2, ADCx}, /* D4/PB5 */ + {&gpiob, &timer3, NULL, 4, 1, ADCx}, /* D5/PB4 */ + {&gpiob, &timer2, NULL, 10, 3, ADCx}, /* D6/PB10 */ + {&gpioa, &timer1, NULL, 8, 1, ADCx}, /* D7/PA8 */ - {&gpioa, &timer1, NULL, 9, 2, ADCx, 0}, /* D8/PA9 */ - {&gpioc, NULL, NULL, 7, 0, ADCx, 0}, /* D9/PC7 */ - {&gpiob, &timer4, NULL, 6, 1, ADCx, 0}, /* D10/PB6 */ - {&gpioa, NULL, &adc1, 7, 0, 7, 0}, /* D11/PA7 */ - {&gpioa, NULL, &adc1, 6, 0, 6, 0}, /* D12/PA6 */ - {&gpioa, NULL, NULL, 5, 0, ADCx, 0}, /* D13/PA5 LED - no &adc12_IN5 !*/ - {&gpiob, &timer4, NULL, 9, 4, ADCx, 0}, /* D14/PB9 */ - {&gpiob, &timer4, NULL, 8, 3, ADCx, 0}, /* D15/PB8 */ + {&gpioa, &timer1, NULL, 9, 2, ADCx}, /* D8/PA9 */ + {&gpioc, NULL, NULL, 7, 0, ADCx}, /* D9/PC7 */ + {&gpiob, &timer4, NULL, 6, 1, ADCx}, /* D10/PB6 */ + {&gpioa, NULL, &adc1, 7, 0, 7}, /* D11/PA7 */ + {&gpioa, NULL, &adc1, 6, 0, 6}, /* D12/PA6 */ + {&gpioa, NULL, NULL, 5, 0, ADCx}, /* D13/PA5 LED - no &adc12_IN5 !*/ + {&gpiob, &timer4, NULL, 9, 4, ADCx}, /* D14/PB9 */ + {&gpiob, &timer4, NULL, 8, 3, ADCx}, /* D15/PB8 */ - {&gpioa, NULL, &adc1, 0, 0, 0, 0}, /* D16/A0/PA0 */ - {&gpioa, NULL, &adc1, 1, 0, 1, 0}, /* D17/A1/PA1 */ - {&gpioa, NULL, &adc1, 4, 0, 4, 0}, /* D18/A2/PA4 */ - {&gpiob, &timer3, &adc1, 0, 3, 8, 0}, /* D19/A3/PB0 */ - {&gpioc, NULL, &adc1, 1, 0, 11, 0}, /* D20/A4/PC1 */ - {&gpioc, NULL, &adc1, 0, 0, 10, 0}, /* D21/A5/PC0 */ + {&gpioa, NULL, &adc1, 0, 0, 0}, /* D16/A0/PA0 */ + {&gpioa, NULL, &adc1, 1, 0, 1}, /* D17/A1/PA1 */ + {&gpioa, NULL, &adc1, 4, 0, 4}, /* D18/A2/PA4 */ + {&gpiob, &timer3, &adc1, 0, 3, 8}, /* D19/A3/PB0 */ + {&gpioc, NULL, &adc1, 1, 0, 11}, /* D20/A4/PC1 */ + {&gpioc, NULL, &adc1, 0, 0, 10}, /* D21/A5/PC0 */ - {&gpioc, NULL, NULL, 10, 0, ADCx, 0}, /* D22/PC10 */ - {&gpioc, NULL, NULL, 12, 0, ADCx, 0}, /* D23/PC12 */ - {&gpiob, &timer4, NULL, 7, 2, ADCx, 0}, /* D24/PB7 */ - {&gpioc, NULL, NULL, 13, 0, ADCx, 0}, /* D25/PC13 USER BLUE BUTTON */ - {&gpioc, NULL, NULL, 14, 0, ADCx, 0}, /* D26/PC14 */ - {&gpioc, NULL, NULL, 15, 0, ADCx, 0}, /* D27/PC15 */ - {&gpioc, NULL, &adc1, 2, 0, 12, 0}, /* D28/PC2 */ - {&gpioc, NULL, &adc1, 3, 0, 13, 0}, /* D29/PC3 */ - {&gpioc, NULL, NULL, 11, 0, ADCx, 0}, /* D30/PC11 */ - {&gpiod, NULL, NULL, 2, 0, ADCx, 0}, /* D31/PD2 */ - {&gpioc, NULL, NULL, 9, 0, ADCx, 0}, /* D32/PC9 */ - {&gpioc, NULL, NULL, 8, 0, ADCx, 0}, /* D33/PC8 */ - {&gpioc, NULL, NULL, 6, 0, ADCx, 0}, /* D34/PC6 */ - {&gpioc, NULL, &adc1, 5, 0, 15, 0}, /* D35/PC5 */ - {&gpioa, NULL, NULL, 12, 0, ADCx, 0}, /* D36/PA12 */ - {&gpioa, &timer1, NULL, 11, 4, ADCx, 0}, /* D37/PA11 */ - {&gpiob, NULL, NULL, 12, 0, ADCx, 0}, /* D38/PB12 */ - {&gpiob, &timer2, NULL, 11, 4, ADCx, 0}, /* D39/PB11 PWM-not working?*/ - {&gpiob, NULL, NULL, 2, 0, ADCx, 0}, /* D40/PB2 BOOT1 !!*/ - {&gpiob, &timer3, &adc1, 1, 4, 9, 0}, /* D41/PB1 */ - {&gpiob, NULL, NULL, 15, 0, ADCx, 0}, /* D42/PB15 */ - {&gpiob, NULL, NULL, 14, 0, ADCx, 0}, /* D43/PB14 */ - {&gpiob, NULL, NULL, 13, 0, ADCx, 0}, /* D44/PB13 */ - {&gpioc, NULL, &adc1, 4, 0, 14, 0}, /* D45/PC4 */ + {&gpioc, NULL, NULL, 10, 0, ADCx}, /* D22/PC10 */ + {&gpioc, NULL, NULL, 12, 0, ADCx}, /* D23/PC12 */ + {&gpiob, &timer4, NULL, 7, 2, ADCx}, /* D24/PB7 */ + {&gpioc, NULL, NULL, 13, 0, ADCx}, /* D25/PC13 USER BLUE BUTTON */ + {&gpioc, NULL, NULL, 14, 0, ADCx}, /* D26/PC14 */ + {&gpioc, NULL, NULL, 15, 0, ADCx}, /* D27/PC15 */ + {&gpioc, NULL, &adc1, 2, 0, 12}, /* D28/PC2 */ + {&gpioc, NULL, &adc1, 3, 0, 13}, /* D29/PC3 */ + {&gpioc, NULL, NULL, 11, 0, ADCx}, /* D30/PC11 */ + {&gpiod, NULL, NULL, 2, 0, ADCx}, /* D31/PD2 */ + {&gpioc, NULL, NULL, 9, 0, ADCx}, /* D32/PC9 */ + {&gpioc, NULL, NULL, 8, 0, ADCx}, /* D33/PC8 */ + {&gpioc, NULL, NULL, 6, 0, ADCx}, /* D34/PC6 */ + {&gpioc, NULL, &adc1, 5, 0, 15}, /* D35/PC5 */ + {&gpioa, NULL, NULL, 12, 0, ADCx}, /* D36/PA12 */ + {&gpioa, &timer1, NULL, 11, 4, ADCx}, /* D37/PA11 */ + {&gpiob, NULL, NULL, 12, 0, ADCx}, /* D38/PB12 */ + {&gpiob, &timer2, NULL, 11, 4, ADCx}, /* D39/PB11 PWM-not working?*/ + {&gpiob, NULL, NULL, 2, 0, ADCx}, /* D40/PB2 BOOT1 !!*/ + {&gpiob, &timer3, &adc1, 1, 4, 9}, /* D41/PB1 */ + {&gpiob, NULL, NULL, 15, 0, ADCx}, /* D42/PB15 */ + {&gpiob, NULL, NULL, 14, 0, ADCx}, /* D43/PB14 */ + {&gpiob, NULL, NULL, 13, 0, ADCx}, /* D44/PB13 */ + {&gpioc, NULL, &adc1, 4, 0, 14}, /* D45/PC4 */ // PMAP_ROW(&gpioa, 13, NULL, 0, NULL, ADCx), /* D41/PA13 do not use*/ // PMAP_ROW(&gpioa, 14, NULL, 0, NULL, ADCx), /* D42/PA14 do not use*/ // PMAP_ROW(&gpioa, 15, &timer2, 1, NULL, ADCx), /* D43/PA15 do not use*/ @@ -256,4 +256,4 @@ MOSI alternate functions on the GPIO ports. DEFINE_HWSERIAL(Serial, 3);// Use HW Serial 2 as "Serial" DEFINE_HWSERIAL(Serial1, 2); DEFINE_HWSERIAL(Serial2, 1); -#endif +#endif \ No newline at end of file diff --git a/STM32F3/cores/maple/wirish/boards_private.h b/STM32F3/cores/maple/wirish/boards_private.h index 332843d..49867ca 100644 --- a/STM32F3/cores/maple/wirish/boards_private.h +++ b/STM32F3/cores/maple/wirish/boards_private.h @@ -42,7 +42,7 @@ /* Makes the PIN_MAP rows more human-readable. */ #define PMAP_ROW(gpio_dev, gpio_bit, timer_dev, timer_ch, adc_dev, adc_ch) \ - { gpio_dev, timer_dev, adc_dev, gpio_bit, timer_ch, adc_ch, 0} + { gpio_dev, timer_dev, adc_dev, gpio_bit, timer_ch, adc_ch } namespace wirish { namespace priv {