2023-03-15 18:01:54 +08:00
|
|
|
# Emulated UART configuration options
|
|
|
|
|
|
|
|
# Copyright (c) 2023 Fabian Blatz
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
config UART_EMUL
|
|
|
|
bool "Emulated UART driver [EXPERIMENTAL]"
|
|
|
|
default y
|
|
|
|
depends on DT_HAS_ZEPHYR_UART_EMUL_ENABLED
|
drivers: serial: uart_emul: support interrupt-driven receive
Previously, the uart_emul device did not support interrupt-driven
receive, which is an unwritten requirement for hooking up a uart to
the Zephyr console driver.
The console is a fairly high-traffic subsystem, and we should be able
to perform more extensive testing on it, aside from maching twister
output against a regular expression. With this change, we can use
the emulation uart within the body of a ZTest.
Testing Done:
```shell
west build -p auto -b qemu_riscv64 -t run tests/drivers/console_switching
...
*** Booting Zephyr OS build zephyr-v3.4.0-4277-gae0d63471be1 ***
Running TESTSUITE console_switching
===================================================================
START - test_read
read "Hello, uart_emul0!" from uart_emul0
read "Hello, uart_emul1!" from uart_emul1
read "Hello, uart_emul0!" from uart_emul0
read "Hello, uart_emul1!" from uart_emul1
PASS - test_read in 0.005 seconds
===================================================================
START - test_write
wrote "Hello, uart_emul0!" to uart_emul0
wrote "Hello, uart_emul1!" to uart_emul1
wrote "Hello, uart_emul0!" to uart_emul0
wrote "Hello, uart_emul1!" to uart_emul1
PASS - test_write in 0.003 seconds
===================================================================
TESTSUITE console_switching succeeded
------ TESTSUITE SUMMARY START ------
SUITE PASS - 100.00% [console_switching]: pass = 2, fail = 0, skip = 0...
- PASS - [console_switching.test_read] duration = 0.005 seconds
- PASS - [console_switching.test_write] duration = 0.003 seconds
------ TESTSUITE SUMMARY END ------
===================================================================
PROJECT EXECUTION SUCCESSFUL
```
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-10-03 02:31:48 +08:00
|
|
|
select SERIAL_SUPPORT_INTERRUPT
|
2023-03-15 18:01:54 +08:00
|
|
|
select RING_BUFFER
|
|
|
|
select EXPERIMENTAL
|
|
|
|
help
|
|
|
|
Enable the emulated UART driver.
|
2023-11-02 21:56:02 +08:00
|
|
|
|
|
|
|
if UART_EMUL
|
|
|
|
|
|
|
|
config UART_EMUL_WORK_Q_STACK_SIZE
|
|
|
|
int "UART emulator work queue stack size"
|
|
|
|
default 2048
|
|
|
|
|
|
|
|
config UART_EMUL_WORK_Q_PRIORITY
|
2024-01-13 01:34:18 +08:00
|
|
|
int "UART emulator work queue thread priority"
|
2023-11-02 21:56:02 +08:00
|
|
|
default 1
|
|
|
|
|
|
|
|
endif # UART_EMUL
|