stm32: add alternate pinout for USART2
Added to both generic stm32 and stm32f0 Signed-off-by: Arne Jansen <arne@die-jansens.de>
This commit is contained in:
parent
5ce86bd005
commit
0cd4d5d5ea
|
@ -155,7 +155,9 @@ choice
|
|||
config STM32_SERIAL_USART1
|
||||
bool "USART1"
|
||||
config STM32_SERIAL_USART2
|
||||
bool "USART2"
|
||||
bool "USART2 (on PA3/PA2)"
|
||||
config STM32_SERIAL_USART2_ALT
|
||||
bool "USART2 (on PA15/PA14)"
|
||||
config STM32_SERIAL_USART3
|
||||
bool "USART3"
|
||||
config STM32_SERIAL_USART3_ALT
|
||||
|
@ -165,6 +167,7 @@ config SERIAL_PORT
|
|||
int
|
||||
default 103 if STM32_SERIAL_USART3_ALT
|
||||
default 3 if STM32_SERIAL_USART3
|
||||
default 102 if STM32_SERIAL_USART2_ALT
|
||||
default 2 if STM32_SERIAL_USART2
|
||||
default 1
|
||||
|
||||
|
|
|
@ -24,6 +24,12 @@ DECL_CONSTANT_STR("RESERVE_PINS_serial", "PA3,PA2");
|
|||
#define GPIO_Tx GPIO('A', 2)
|
||||
#define USARTx USART2
|
||||
#define USARTx_IRQn USART2_IRQn
|
||||
#elif CONFIG_SERIAL_PORT == 102
|
||||
DECL_CONSTANT_STR("RESERVE_PINS_serial", "PA14,PA15");
|
||||
#define GPIO_Rx GPIO('A', 14)
|
||||
#define GPIO_Tx GPIO('A', 15)
|
||||
#define USARTx USART2b
|
||||
#define USARTx_IRQn USART2_IRQn
|
||||
#elif CONFIG_SERIAL_PORT == 103
|
||||
DECL_CONSTANT_STR("RESERVE_PINS_serial", "PD9,PD8");
|
||||
#define GPIO_Rx GPIO('D', 9)
|
||||
|
|
|
@ -24,6 +24,12 @@ DECL_CONSTANT_STR("RESERVE_PINS_serial", "PA3,PA2");
|
|||
#define GPIO_Tx GPIO('A', 2)
|
||||
#define USARTx USART2
|
||||
#define USARTx_IRQn USART2_IRQn
|
||||
#elif CONFIG_SERIAL_PORT == 102
|
||||
DECL_CONSTANT_STR("RESERVE_PINS_serial", "PA15,PA14");
|
||||
#define GPIO_Rx GPIO('A', 15)
|
||||
#define GPIO_Tx GPIO('A', 14)
|
||||
#define USARTx USART2
|
||||
#define USARTx_IRQn USART2_IRQn
|
||||
#endif
|
||||
|
||||
#define CR1_FLAGS (USART_CR1_UE | USART_CR1_RE | USART_CR1_TE \
|
||||
|
|
Loading…
Reference in New Issue