Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arch/tiva: Serial TIOCxBRK BSD-compatible BREAK support #8475

Merged
merged 1 commit into from
Feb 8, 2023

Conversation

hartmannathan
Copy link
Contributor

Summary

In the lower half UART driver for Tiva architecture (TM4C12x), adding the TIOCxBRK ioctl calls, which allow an application to transmit a BSD compatible line BREAK. TIOCSBRK starts the BREAK and TIOCCBRK ends it.

This architecture supports BSD-style BREAK in hardware. We write to the BRK bit (bit 0) of the UART Line Control register (UARTLCRH) to start the BREAK, which begins after the UART finishes shifting out the current character in progress, if any, including its stop bit(s), and continues indefinitely until we write to the BRK bit again to stop the BREAK.

Impact

When new Kconfig option TIVA_UART_BREAKS is activated, TIOCSBRK and TIOCCBRK ioctl calls are supported on Tiva architectures. When not activated, no effect.

Testing

Custom board.

In the lower half UART driver for Tiva architecture (TM4C12x), adding
the TIOCxBRK ioctl calls, which allow an application to transmit a BSD
compatible line BREAK. TIOCSBRK starts the BREAK and TIOCCBRK ends it.

This architecture supports BSD-style BREAK in hardware. We write to
the BRK bit (bit 0) of the UART Line Control register (UARTLCRH) to
start the BREAK, which begins after the UART finishes shifting out the
current character in progress, if any, including its stop bit(s), and
continues indefinitely until we write to the BRK bit again to stop the
BREAK.

* arch/arm/src/tiva/Kconfig
  (config TIVA_UART_BREAKS): New. Appears as CONFIG_TIVA_UART_BREAKS
   in code.

* arch/arm/src/tiva/common/tiva_serial.c
  (struct up_dev_s): Add new field 'brk' to indicate line break in
   progress when built with CONFIG_TIVA_UART_BREAKS.
  (up_ioctl): Add cases for TIOCSBRK to turn BSD-compatible break on
   unconditionally and TIOCCBRK to turn break off unconditionally.
  (up_txint): Block enabling TX interrupt if line break in progress.
   This is similar to the STM32F7 implementation.
Copy link
Contributor

@davids5 davids5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hartmannathan
Copy link
Contributor Author

LGTM

Your input on this (previously on the mailing list) has been tremendously helpful. Thanks for all your help!

@xiaoxiang781216 xiaoxiang781216 merged commit 8b2c8c7 into apache:master Feb 8, 2023
@hartmannathan hartmannathan deleted the tiva-add-bsd-break branch February 8, 2023 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants