Skip to content

Commit

Permalink
stm32: Add support for USART3 on PC11/PC10 on STM32G474. (#6704)
Browse files Browse the repository at this point in the history
Signed-off-by: Liam Powell <liam@liampwll.com>
  • Loading branch information
liampwll authored and rogerlz committed Oct 24, 2024
1 parent 464fde9 commit a5260c4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/stm32/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,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
Expand Down
8 changes: 8 additions & 0 deletions src/stm32/stm32f0_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a5260c4

Please sign in to comment.