drivers: serial: stm32: dts binding, and fixup for flow control

Allows to enable initial RTS/CTS hardware flow control
in the dts.

Co-authored-by: Benoit Leforestier <benoit.leforestier@gmail.com>
Signed-off-by: Georgij Cernysiov <g.cernysiov@elco-automation.de>
This commit is contained in:
Georgij Cernysiov 2019-02-08 18:39:35 +01:00 committed by Kumar Gala
commit 04da64db76
13 changed files with 63 additions and 0 deletions

View file

@ -722,6 +722,10 @@ static int uart_stm32_init(struct device *dev)
LL_USART_PARITY_NONE,
LL_USART_STOPBITS_1);
if (config->hw_flow_control) {
uart_stm32_set_hwctrl(dev, LL_USART_HWCONTROL_RTS_CTS);
}
/* Set the default baudrate */
uart_stm32_set_baudrate(dev, data->baud_rate);
@ -777,6 +781,7 @@ static const struct uart_stm32_config uart_stm32_cfg_##name = { \
.pclken = { .bus = DT_UART_STM32_##name##_CLOCK_BUS, \
.enr = DT_UART_STM32_##name##_CLOCK_BITS \
}, \
.hw_flow_control = DT_UART_STM32_##name##_HW_FLOW_CONTROL \
}; \
\
static struct uart_stm32_data uart_stm32_data_##name = { \