diff options
author | Liam Powell <liam+github@liampwll.com> | 2024-10-24 23:10:09 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-24 11:10:09 -0400 |
commit | fe89c19ac0e02a5673010e9601b5a9c2f89fcf2a (patch) | |
tree | b39667f4c6075f4a1f4a188a614d6320d66765dd | |
parent | 0c806d84f706384d7274f17c155f194b3bfcb7c7 (diff) | |
download | kutter-fe89c19ac0e02a5673010e9601b5a9c2f89fcf2a.tar.gz kutter-fe89c19ac0e02a5673010e9601b5a9c2f89fcf2a.tar.xz kutter-fe89c19ac0e02a5673010e9601b5a9c2f89fcf2a.zip |
stm32: Add support for USART3 on PC11/PC10 on STM32G474. (#6704)
Signed-off-by: Liam Powell <liam@liampwll.com>
-rw-r--r-- | src/stm32/Kconfig | 4 | ||||
-rw-r--r-- | src/stm32/stm32f0_serial.c | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/stm32/Kconfig b/src/stm32/Kconfig index 037e37bb..4112e833 100644 --- a/src/stm32/Kconfig +++ b/src/stm32/Kconfig @@ -416,6 +416,10 @@ choice bool "Serial (on USART3 PD9/PD8)" if LOW_LEVEL_OPTIONS depends on !MACH_STM32F0 && !MACH_STM32F401 select SERIAL + config STM32_SERIAL_USART3_ALT_PC11_PC10 + bool "Serial (on USART3 PC11/PC10)" if LOW_LEVEL_OPTIONS + depends on MACH_STM32G474 + select SERIAL config STM32_SERIAL_UART4 bool "Serial (on UART4 PA0/PA1)" depends on MACH_STM32H7 diff --git a/src/stm32/stm32f0_serial.c b/src/stm32/stm32f0_serial.c index c987f149..964601b6 100644 --- a/src/stm32/stm32f0_serial.c +++ b/src/stm32/stm32f0_serial.c @@ -71,6 +71,14 @@ #define USARTx_FUNCTION GPIO_FUNCTION(CONFIG_MACH_STM32G0 ? 0 : 7) #define USARTx USART3 #define USARTx_IRQn USART3_IRQn +#elif CONFIG_STM32_SERIAL_USART3_ALT_PC11_PC10 + // Currently only supports STM32G474. + DECL_CONSTANT_STR("RESERVE_PINS_serial", "PC11,PC10"); + #define GPIO_Rx GPIO('C', 11) + #define GPIO_Tx GPIO('C', 10) + #define USARTx_FUNCTION GPIO_FUNCTION(7) + #define USARTx USART3 + #define USARTx_IRQn USART3_IRQn #elif CONFIG_STM32_SERIAL_UART4 DECL_CONSTANT_STR("RESERVE_PINS_serial", "PA1,PA0"); #define GPIO_Rx GPIO('A', 1) |