diff options
author | Dave Hylands <dhylands@gmail.com> | 2016-02-14 11:07:57 -0800 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-02-15 10:11:29 +0000 |
commit | ec37239e53262a97c514f8948b3edc73dcfe1188 (patch) | |
tree | a75f52bdd7f3000f2bd48510d6fd1565b150debd | |
parent | 4b2938a4b0ec6b31691509003cb1eda9458fa2d7 (diff) | |
download | micropython-ec37239e53262a97c514f8948b3edc73dcfe1188.tar.gz micropython-ec37239e53262a97c514f8948b3edc73dcfe1188.zip |
stmhal: Improvements to the STM32F4DISC UART config settings.
-rw-r--r-- | stmhal/boards/STM32F4DISC/mpconfigboard.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/stmhal/boards/STM32F4DISC/mpconfigboard.h b/stmhal/boards/STM32F4DISC/mpconfigboard.h index 4b0745259b..01202e0c95 100644 --- a/stmhal/boards/STM32F4DISC/mpconfigboard.h +++ b/stmhal/boards/STM32F4DISC/mpconfigboard.h @@ -23,18 +23,35 @@ #define MICROPY_HW_CLK_PLLQ (7) // UART config +#if 0 +// A9 is used for USB VBUS detect, and A10 is used for USB_FS_ID. +// UART1 is also on PB6/7 but PB6 is tied to the Audio SCL line. +// Without board modifications, this makes UART1 unusable on this board. #define MICROPY_HW_UART1_PORT (GPIOA) #define MICROPY_HW_UART1_PINS (GPIO_PIN_9 | GPIO_PIN_10) +#endif + #define MICROPY_HW_UART2_PORT (GPIOA) #define MICROPY_HW_UART2_PINS (GPIO_PIN_2 | GPIO_PIN_3) #define MICROPY_HW_UART2_RTS (GPIO_PIN_1) #define MICROPY_HW_UART2_CTS (GPIO_PIN_0) + #define MICROPY_HW_UART3_PORT (GPIOD) #define MICROPY_HW_UART3_PINS (GPIO_PIN_8 | GPIO_PIN_9) #define MICROPY_HW_UART3_RTS (GPIO_PIN_12) #define MICROPY_HW_UART3_CTS (GPIO_PIN_11) + +#if MICROPY_HW_HAS_SWITCH == 0 +// NOTE: A0 also connects to the user switch. To use UART4 you should +// set MICROPY_HW_HAS_SWITCH to 0, and also remove SB20 (on the back +// of the board near the USER switch). #define MICROPY_HW_UART4_PORT (GPIOA) #define MICROPY_HW_UART4_PINS (GPIO_PIN_0 | GPIO_PIN_1) +#endif + +// NOTE: PC7 is connected to MCLK on the Audio chip. This is an input signal +// so I think as long as you're not using the audio chip then it should +// be fine to use as a UART pin. #define MICROPY_HW_UART6_PORT (GPIOC) #define MICROPY_HW_UART6_PINS (GPIO_PIN_6 | GPIO_PIN_7) |