From fc9669bcfd233dbd45ef1000a0c7a0deeabe2f8a Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Thu, 23 Nov 2023 13:32:18 +0100 Subject: [PATCH] drivers/periph/uart: add periph_uart_tx_ondemand feature --- drivers/include/periph/uart.h | 18 ++++++++++++++++++ kconfigs/Kconfig.features | 5 +++++ 2 files changed, 23 insertions(+) diff --git a/drivers/include/periph/uart.h b/drivers/include/periph/uart.h index 7f80461fba..33a04782fb 100644 --- a/drivers/include/periph/uart.h +++ b/drivers/include/periph/uart.h @@ -381,6 +381,24 @@ void uart_poweron(uart_t uart); */ void uart_poweroff(uart_t uart); +/** + * @brief Enable the TX line one the given UART + * + * @note requires the `periph_uart_tx_ondemand` feature + * + * @param[in] uart the UART device start TX on + */ +void uart_enable_tx(uart_t uart); + +/** + * @brief Disable the TX line one the given UART + * + * @note requires the `periph_uart_tx_ondemand` feature + * + * @param[in] uart the UART device to stop TX on + */ +void uart_disable_tx(uart_t uart); + #ifdef __cplusplus } #endif diff --git a/kconfigs/Kconfig.features b/kconfigs/Kconfig.features index cb824d97b1..9815cc1f57 100644 --- a/kconfigs/Kconfig.features +++ b/kconfigs/Kconfig.features @@ -587,6 +587,11 @@ config HAS_PERIPH_UART_MODECFG help Indicates that the UART peripheral allows mode configuration. +config HAS_PERIPH_UART_TX_ONDEMAND + bool + help + Indicates that the UART peripheral can enable the TX line on demmand. + config HAS_PERIPH_UART_NONBLOCKING bool help