blob: 09f1e92d7ac41d3c0dd16519586686f934737f5d [file] [log] [blame]
Anas Nashif3ae52622019-04-06 09:08:09 -04001# SPDX-License-Identifier: Apache-2.0
2
Alberto Escolar Piedras013f2792018-09-22 19:19:59 +02003config UART_NATIVE_POSIX
4 bool "UART driver for native_posix"
Kumar Gala7d5215f2022-07-20 13:46:30 -05005 default y
6 depends on DT_HAS_ZEPHYR_NATIVE_POSIX_UART_ENABLED
Alberto Escolar Piedras013f2792018-09-22 19:19:59 +02007 select SERIAL_HAS_DRIVER
Alberto Escolar Piedras013f2792018-09-22 19:19:59 +02008 help
Jukka Rissanenf5219962019-04-15 10:10:02 +03009 This enables a UART driver for the POSIX ARCH with up to 2 UARTs.
10 For the first UART port, the driver can be configured
Alberto Escolar Piedras013f2792018-09-22 19:19:59 +020011 to either connect to the terminal from which native_posix was run, or into
Jukka Rissanenf5219962019-04-15 10:10:02 +030012 one dedicated pseudoterminal for that UART.
Alberto Escolar Piedras013f2792018-09-22 19:19:59 +020013
14if UART_NATIVE_POSIX
15
Alberto Escolar Piedras013f2792018-09-22 19:19:59 +020016choice
17 prompt "Native UART Port 0 connection"
18 default NATIVE_UART_0_ON_OWN_PTY
19
20config NATIVE_UART_0_ON_OWN_PTY
21 bool "Connect the UART to its own pseudo terminal"
22 help
Jukka Rissanenf5219962019-04-15 10:10:02 +030023 Connect this UART to its own pseudoterminal. This is the preferred
24 option for users who want to use Zephyr's shell.
25 Moreover this option does not conflict with any other native_posix
26 backend which may use the calling shell standard input/output.
Alberto Escolar Piedras013f2792018-09-22 19:19:59 +020027
28config NATIVE_UART_0_ON_STDINOUT
29 bool "Connect the UART to the invoking shell stdin/stdout"
30 help
Jukka Rissanenf5219962019-04-15 10:10:02 +030031 Connect this UART to the stdin & stdout of the calling shell/terminal
32 which invoked the native_posix executable. This is good enough for
33 automated testing, or when feeding from a file/pipe.
34 Note that other, non UART messages, will also be printed to the
35 terminal. This option should NOT be used in conjunction with
Alberto Escolar Piedrasacefd362019-01-18 14:47:40 +010036 NATIVE_POSIX_STDIN_CONSOLE
Jukka Rissanenf5219962019-04-15 10:10:02 +030037 It is strongly discouraged to try to use this option with the new
38 shell interactively, as the default terminal configuration is NOT
39 appropriate for interactive use.
Alberto Escolar Piedras013f2792018-09-22 19:19:59 +020040
41endchoice
42
Pavel Král97696f32020-10-28 21:17:17 +010043config UART_NATIVE_WAIT_PTS_READY_ENABLE
44 bool "Support waiting for pseudo terminal client readiness"
45 depends on NATIVE_UART_0_ON_OWN_PTY || UART_NATIVE_POSIX_PORT_1_ENABLE
46 help
47 When this option is selected a new command line switch is provided:
Fabio Utzig0f1517a2020-11-07 09:36:16 -030048 ``--wait_uart``
49 When ``--wait_uart`` is used, writes to the UART will be held until a
Pavel Král97696f32020-10-28 21:17:17 +010050 client has connected to the slave side of the pseudoterminal.
51 Otherwise writes are sent irrespectively.
52
Jukka Rissanenf5219962019-04-15 10:10:02 +030053config UART_NATIVE_POSIX_PORT_1_ENABLE
Gerard Marull-Paretas95fb0de2022-03-09 12:05:12 +010054 bool "Second UART port"
Jukka Rissanenf5219962019-04-15 10:10:02 +030055 help
56 Useful if you need to have another serial connection to host.
57 This is used for example in PPP (Point-to-Point Protocol)
58 implementation.
59
Alberto Escolar Piedras013f2792018-09-22 19:19:59 +020060config NATIVE_UART_AUTOATTACH_DEFAULT_CMD
61 string "Default command to attach the UART to a new terminal"
62 default "xterm -e screen %s &"
63 help
Jukka Rissanenf5219962019-04-15 10:10:02 +030064 If the native_posix executable is called with the --attach_uart
65 command line option, this will be the default command which will be
66 run to attach a new terminal to the 1st UART.
67 Note that this command must have one, and only one, '%s' as
68 placeholder for the pseudoterminal device name (e.g. /dev/pts/35)
69 This is only applicable if the UART_0 is configured to use its own
70 PTY with NATIVE_UART_0_ON_OWN_PTY.
71 The 2nd UART will not be affected by this option.
Jukka Rissanenadf72912020-08-12 11:01:11 +030072 If you are using GNOME, then you can use this command string
73 'gnome-terminal -- screen %s'
Alberto Escolar Piedras013f2792018-09-22 19:19:59 +020074
Ulf Magnusson116fb2f2019-03-09 04:23:02 +010075endif # UART_NATIVE_POSIX