2019-04-06 21:08:09 +08:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2018-09-23 01:19:59 +08:00
|
|
|
config UART_NATIVE_POSIX
|
|
|
|
bool "UART driver for native_posix"
|
|
|
|
select SERIAL_HAS_DRIVER
|
|
|
|
depends on ARCH_POSIX
|
|
|
|
help
|
2019-04-15 15:10:02 +08:00
|
|
|
This enables a UART driver for the POSIX ARCH with up to 2 UARTs.
|
|
|
|
For the first UART port, the driver can be configured
|
2018-09-23 01:19:59 +08:00
|
|
|
to either connect to the terminal from which native_posix was run, or into
|
2019-04-15 15:10:02 +08:00
|
|
|
one dedicated pseudoterminal for that UART.
|
2018-09-23 01:19:59 +08:00
|
|
|
|
|
|
|
if UART_NATIVE_POSIX
|
|
|
|
|
|
|
|
choice
|
|
|
|
prompt "Native UART Port 0 connection"
|
|
|
|
default NATIVE_UART_0_ON_OWN_PTY
|
|
|
|
|
|
|
|
config NATIVE_UART_0_ON_OWN_PTY
|
|
|
|
bool "Connect the UART to its own pseudo terminal"
|
|
|
|
help
|
2019-04-15 15:10:02 +08:00
|
|
|
Connect this UART to its own pseudoterminal. This is the preferred
|
|
|
|
option for users who want to use Zephyr's shell.
|
|
|
|
Moreover this option does not conflict with any other native_posix
|
|
|
|
backend which may use the calling shell standard input/output.
|
2018-09-23 01:19:59 +08:00
|
|
|
|
|
|
|
config NATIVE_UART_0_ON_STDINOUT
|
|
|
|
bool "Connect the UART to the invoking shell stdin/stdout"
|
|
|
|
help
|
2019-04-15 15:10:02 +08:00
|
|
|
Connect this UART to the stdin & stdout of the calling shell/terminal
|
|
|
|
which invoked the native_posix executable. This is good enough for
|
|
|
|
automated testing, or when feeding from a file/pipe.
|
|
|
|
Note that other, non UART messages, will also be printed to the
|
|
|
|
terminal. This option should NOT be used in conjunction with
|
2019-01-18 21:47:40 +08:00
|
|
|
NATIVE_POSIX_STDIN_CONSOLE
|
2019-04-15 15:10:02 +08:00
|
|
|
It is strongly discouraged to try to use this option with the new
|
|
|
|
shell interactively, as the default terminal configuration is NOT
|
|
|
|
appropriate for interactive use.
|
2018-09-23 01:19:59 +08:00
|
|
|
|
|
|
|
endchoice
|
|
|
|
|
2019-04-15 15:10:02 +08:00
|
|
|
config UART_NATIVE_POSIX_PORT_1_ENABLE
|
|
|
|
bool "Enable second UART port"
|
|
|
|
help
|
|
|
|
Useful if you need to have another serial connection to host.
|
|
|
|
This is used for example in PPP (Point-to-Point Protocol)
|
|
|
|
implementation.
|
|
|
|
|
|
|
|
config UART_NATIVE_POSIX_PORT_1_NAME
|
|
|
|
string "Port 1 Device Name"
|
|
|
|
default "UART_1"
|
|
|
|
depends on UART_NATIVE_POSIX_PORT_1_ENABLE
|
|
|
|
help
|
|
|
|
This is the device name for UART, and is included in the device
|
|
|
|
struct.
|
|
|
|
|
2018-09-23 01:19:59 +08:00
|
|
|
config NATIVE_UART_AUTOATTACH_DEFAULT_CMD
|
|
|
|
string "Default command to attach the UART to a new terminal"
|
|
|
|
default "xterm -e screen %s &"
|
|
|
|
help
|
2019-04-15 15:10:02 +08:00
|
|
|
If the native_posix executable is called with the --attach_uart
|
|
|
|
command line option, this will be the default command which will be
|
|
|
|
run to attach a new terminal to the 1st UART.
|
|
|
|
Note that this command must have one, and only one, '%s' as
|
|
|
|
placeholder for the pseudoterminal device name (e.g. /dev/pts/35)
|
|
|
|
This is only applicable if the UART_0 is configured to use its own
|
|
|
|
PTY with NATIVE_UART_0_ON_OWN_PTY.
|
|
|
|
The 2nd UART will not be affected by this option.
|
2018-09-23 01:19:59 +08:00
|
|
|
|
2019-03-09 11:23:02 +08:00
|
|
|
endif # UART_NATIVE_POSIX
|