stm32: Add serial USART serial port option for port PD9/PD8
Signed-off-by: Gerrit Sturm <gsturm16@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
8c5fc1688a
commit
96ff54e143
|
@ -111,9 +111,12 @@ choice
|
||||||
bool "USART2"
|
bool "USART2"
|
||||||
config STM32_SERIAL_USART3
|
config STM32_SERIAL_USART3
|
||||||
bool "USART3"
|
bool "USART3"
|
||||||
|
config STM32_SERIAL_USART3_ALT
|
||||||
|
bool "USART3 (on PD9/PD8)" if MACH_STM32F4
|
||||||
endchoice
|
endchoice
|
||||||
config SERIAL_PORT
|
config SERIAL_PORT
|
||||||
int
|
int
|
||||||
|
default 103 if STM32_SERIAL_USART3_ALT
|
||||||
default 3 if STM32_SERIAL_USART3
|
default 3 if STM32_SERIAL_USART3
|
||||||
default 2 if STM32_SERIAL_USART2
|
default 2 if STM32_SERIAL_USART2
|
||||||
default 1
|
default 1
|
||||||
|
|
|
@ -25,6 +25,13 @@ DECL_CONSTANT_STR("RESERVE_PINS_serial", "PA3,PA2");
|
||||||
#define USARTx USART2
|
#define USARTx USART2
|
||||||
#define USARTx_IRQn USART2_IRQn
|
#define USARTx_IRQn USART2_IRQn
|
||||||
#define USARTx_IRQHandler USART2_IRQHandler
|
#define USARTx_IRQHandler USART2_IRQHandler
|
||||||
|
#elif CONFIG_SERIAL_PORT == 103
|
||||||
|
DECL_CONSTANT_STR("RESERVE_PINS_serial", "PD9,PD8");
|
||||||
|
#define GPIO_Rx GPIO('D', 9)
|
||||||
|
#define GPIO_Tx GPIO('D', 8)
|
||||||
|
#define USARTx USART3
|
||||||
|
#define USARTx_IRQn USART3_IRQn
|
||||||
|
#define USARTx_IRQHandler USART3_IRQHandler
|
||||||
#else
|
#else
|
||||||
DECL_CONSTANT_STR("RESERVE_PINS_serial", "PB11,PB10");
|
DECL_CONSTANT_STR("RESERVE_PINS_serial", "PB11,PB10");
|
||||||
#define GPIO_Rx GPIO('B', 11)
|
#define GPIO_Rx GPIO('B', 11)
|
||||||
|
|
Loading…
Reference in New Issue