nuttx/drivers/serial
Nathan Hartman 409e2f3701 drivers/serial, libc/termios: Implement tcsendbreak
The TERMIOS(3) function tcsendbreak() and the IOCTLs TCSBRK and TCSBRKP
transmit a serial line Break.

Previously NuttX included an extern declaration for tcsendbreak() and
defines for TCSBRK and TCSBRKP but none of these were implemented.
Attempting to build programs that called tcsendbreak() would fail with
a linker error; attempting to use TCSBRK and TCSBRKP would result in an
error at runtime.

This changeset adds the tcsendbreak() function and handling for TCSBRK
and TCSBRKP; tcsendbreak() is implemented in terms of TCSBRK. Both
TCSBRK and TCSBRKP are implemented in terms of the BSD-compatible Break
IOCTLs TIOCSBRK and TIOCCBRK, which must be provided by the lower half
serial driver. Currently, not all lower half serial drivers in NuttX
support these IOCTLs. Those that do implement them may need one or more
Kconfig options to be set, such as `CONFIG_*_U[S]ART_BREAKS` and, on
some architectures, a separate `CONFIG_*_SERIALBRK_BSDCOMPAT`.

* drivers/serial/serial.c
  (uart_tcsendbreak): New function.
  (uart_ioctl): Implement TCSBRK and TCSBRKP.

* libs/libc/termios/lib_tcsendbreak.c
  (): New file.

* libs/libc/termios/Make.defs
  (CSRCS): Add lib_tcsendbreak.c to the build.

Thanks to Xiang Xiao for PR feedback.

Co-authored-by: Xiang Xiao <xiaoxiang781216@gmail.com>
2023-02-15 07:50:02 +08:00
..
Kconfig build/Kconfig: fix warnings detected by kconfiglib 2023-02-09 20:07:46 +08:00
Kconfig-16550 serial/uart_16550: Allow uintptr_t as addr width 2022-01-14 19:40:30 +08:00
Kconfig-lpuart Add initial support for NXP S32K3 MCU family 2022-07-25 23:47:05 +08:00
Kconfig-sci
Kconfig-uart
Kconfig-usart
Make.defs serial: Move tcdrain implementation from drivers/serial to libc 2021-12-29 08:11:08 -03:00
ptmx.c Remove the unnecessary NULL fields in global instance definition of file_operations 2023-01-04 00:32:13 +02:00
pty.c fs: Move mmap callback before truncate in [file|mountpt]_operations 2023-01-04 17:43:59 +02:00
pty.h Replace nxsem API when used as a lock with nxmutex API 2022-10-17 15:59:46 +09:00
serial_dma.c serial: merge serial check signo to one place 2022-01-10 17:07:32 +01:00
serial_io.c drivers/serial: Fix docstrings on UART interrupt handlers 2023-02-07 04:41:36 +08:00
serial.c drivers/serial, libc/termios: Implement tcsendbreak 2023-02-15 07:50:02 +08:00
uart_16550.c drivers/serial: Fix docstrings on UART interrupt handlers 2023-02-07 04:41:36 +08:00
uart_bth4.c fs: Move mmap callback before truncate in [file|mountpt]_operations 2023-01-04 17:43:59 +02:00
uart_rpmsg.c Replace nxsem API when used as a lock with nxmutex API 2022-10-17 15:59:46 +09:00