Skip to content

Commit 632a804

Browse files
committed
drivers: DTR/RI virtual UART implementation
Terms: Data Terminal Equipment (DTE), AKA. host. Data Communication Equipment (DCE), AKA. Serial Modem. Data Terminal Ready (DTR) Ring Indicate (RI) DTR operation: When DCE notices DTR asserted fom DTE, it resumes UART, enables RX and sends any possibly pending TX data. When DCE notices DTR deasserted from DTE, it aborts possible TX, disables RX and suspends UART. RI operation: When DCE observes DTR deasserted and it needs to send data, it sets RI up to notify DTE. Application integration: * uart_rx_enable is used as indicator that application is ready. * UART_RX_BUF_REQUEST is sent by virtual UART to application to request a buffer. * Logic level 1 is asserted, use DT to change 0/1 level of that. Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no> Signed-off-by: Markus Lassila <markus.lassila@nordicsemi.no> dtr dtr
1 parent 0e3c69b commit 632a804

9 files changed

Lines changed: 716 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66

77
zephyr_include_directories(include)
88

9+
add_subdirectory(drivers)
910
add_subdirectory(lib)

Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
# as the module Kconfig entry point (see zephyr/module.yml). You can browse
66
# module options by going to Zephyr -> Modules in Kconfig.
77

8+
rsource "drivers/Kconfig"
89
rsource "lib/Kconfig"

drivers/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2025 Nordic Semiconductor ASA
2+
#
3+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
4+
5+
add_subdirectory_ifdef(CONFIG_DTR_UART dtr_uart)

drivers/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
6+
menu "Drivers"
7+
rsource "dtr_uart/Kconfig"
8+
endmenu

drivers/dtr_uart/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#
2+
# Copyright (c) 2025 Nordic Semiconductor
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
zephyr_library()
8+
zephyr_library_sources(dtr_uart.c)

drivers/dtr_uart/Kconfig

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
6+
config DTR_UART
7+
bool "DTR UART implementation - DCE side"
8+
default y
9+
depends on DT_HAS_NORDIC_DTR_UART_ENABLED
10+
select GPIO
11+
select UART_ASYNC_API
12+
select RING_BUFFER
13+
select PM_DEVICE
14+
help
15+
Data Terminal Ready (DTR) UART implements UART API and extends UART communication
16+
with DTR and Ring Indicator (RI) signals.
17+
18+
Data Communication Equipment (DCE) is controlled by DTE (Data Terminal Equipment)
19+
using DTR signal. When DTR is deasserted, DCE will stop the UART communication and
20+
power down the UART peripheral. When DTR is asserted, DCE will power up the UART
21+
peripheral and start the UART communication.
22+
23+
RI signal is used by DCE to notify DTE that data is available to read.
24+
25+
if DTR_UART
26+
27+
module = DTR_UART
28+
module-str = dtr uart
29+
source "subsys/logging/Kconfig.template.log_config"
30+
31+
endif # DTR_UART

0 commit comments

Comments
 (0)