stm32: Allow UARTs to use alternate clocks.

Add support for an alternate clock. If available,
alternate clock is enabled and used to get the
device clock rate.
Based on: #45053.

Signed-off-by: Artur Lipowski <Artur.Lipowski@hidglobal.com>
This commit is contained in:
Artur Lipowski 2022-05-10 12:18:28 +02:00 committed by Maureen Helm
commit bb8575962d
2 changed files with 48 additions and 17 deletions

View file

@ -21,7 +21,9 @@ struct uart_stm32_config {
/* USART instance */
USART_TypeDef *usart;
/* clock subsystem driving this peripheral */
struct stm32_pclken pclken;
const struct stm32_pclken *pclken;
/* number of clock subsystems */
size_t pclk_len;
/* initial hardware flow control, 1 for RTS/CTS */
bool hw_flow_control;
/* initial parity, 0 for none, 1 for odd, 2 for even */