diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2021-05-24 21:17:51 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2021-05-24 21:17:51 -0400 |
commit | 6a3c357a50e7ce4f612a66dfdc5e03e71433eabf (patch) | |
tree | 5fdfd8f656e624d5b30f62f52f67a47e97f9cc8c /src/stm32/serial.c | |
parent | c1e8ee58e7bef33734c457f668f4d13942c1459d (diff) | |
download | kutter-6a3c357a50e7ce4f612a66dfdc5e03e71433eabf.tar.gz kutter-6a3c357a50e7ce4f612a66dfdc5e03e71433eabf.tar.xz kutter-6a3c357a50e7ce4f612a66dfdc5e03e71433eabf.zip |
stm32: Add alternate serial ports on stm32f4
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/stm32/serial.c')
-rw-r--r-- | src/stm32/serial.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/stm32/serial.c b/src/stm32/serial.c index 38432fa5..5806eaab 100644 --- a/src/stm32/serial.c +++ b/src/stm32/serial.c @@ -18,12 +18,24 @@ #define GPIO_Tx GPIO('A', 9) #define USARTx USART1 #define USARTx_IRQn USART1_IRQn +#elif CONFIG_STM32_SERIAL_USART1_ALT_PB7_PB6 + DECL_CONSTANT_STR("RESERVE_PINS_serial", "PB7,PB6"); + #define GPIO_Rx GPIO('B', 7) + #define GPIO_Tx GPIO('B', 6) + #define USARTx USART1 + #define USARTx_IRQn USART1_IRQn #elif CONFIG_STM32_SERIAL_USART2 DECL_CONSTANT_STR("RESERVE_PINS_serial", "PA3,PA2"); #define GPIO_Rx GPIO('A', 3) #define GPIO_Tx GPIO('A', 2) #define USARTx USART2 #define USARTx_IRQn USART2_IRQn +#elif CONFIG_STM32_SERIAL_USART2_ALT_PD6_PD5 + DECL_CONSTANT_STR("RESERVE_PINS_serial", "PD6,PD5"); + #define GPIO_Rx GPIO('D', 6) + #define GPIO_Tx GPIO('D', 5) + #define USARTx USART2 + #define USARTx_IRQn USART2_IRQn #elif CONFIG_STM32_SERIAL_USART3 DECL_CONSTANT_STR("RESERVE_PINS_serial", "PB11,PB10"); #define GPIO_Rx GPIO('B', 11) |