arch/pic32mz: Serial TIOCxBRK BSD-compatible BREAK support #8550
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
In the lower half UART driver for PIC32MZ architecture, adding the
TIOCxBRK
ioctl calls (TIOCSBRK
andTIOCCBRK
). These allow an application to transmit a BREAK (either hardware-native or BSD compatible).This architecture does not support BSD-style BREAK in hardware so our implementation follows the precedent set in STM32, GD32, and Kinetis architectures: By default, if only
PIC32MZ_UART_BREAKS
is configured, we produce the hardware-native BREAK, which lasts for 12 bit lengths on this architecture; if, in addition,PIC32MZ_SERIALBRK_BSDCOMPAT
is also configured, we generate a BSD-style BREAK by putting the TX pin in GPIO mode and driving it "manually" until told to stop.Impact
When
PIC32MZ_UART_BREAKS
is activated,TIOCSBRK
andTIOCCBRK
ioctl calls are supported on PIC32MZ architectures. WhenPIC32MZ_SERIALBRK_BSDCOMPAT
is also activated, the ioctl calls are BSD-compatible. When not activated, no effect.Testing
Works on custom board.
nxstyle.