-
Notifications
You must be signed in to change notification settings - Fork 2k
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
drivers/periph/uart: add periph_uart_tx_ondemand feature #20108
Merged
benpicco
merged 4 commits into
RIOT-OS:master
from
benpicco:drivers/dose-uart_ondemand_tx
Dec 14, 2023
Merged
drivers/periph/uart: add periph_uart_tx_ondemand feature #20108
benpicco
merged 4 commits into
RIOT-OS:master
from
benpicco:drivers/dose-uart_ondemand_tx
Dec 14, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
benpicco
requested review from
MrKevinWeiss,
jue89,
dylad and
keestux
as code owners
November 24, 2023 18:14
github-actions
bot
added
Platform: ARM
Platform: This PR/issue effects ARM-based platforms
Area: drivers
Area: Device drivers
Area: cpu
Area: CPU/MCU ports
labels
Nov 24, 2023
benpicco
commented
Nov 24, 2023
@@ -19,6 +19,7 @@ | |||
#ifndef SOFT_UART_PARAMS_H | |||
#define SOFT_UART_PARAMS_H | |||
|
|||
#include "board.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not exactly related to this PR, but without it SOFT_UART_PARAM_xx
set in board.h
would not get applied.
I first thought of using the software UART to invert the line polarity, but then I found I can use a real UART instead if I re-configure the TX pin.
benpicco
added
the
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
label
Dec 10, 2023
maribu
reviewed
Dec 10, 2023
benpicco
force-pushed
the
drivers/dose-uart_ondemand_tx
branch
from
December 14, 2023 17:26
1ea4955
to
ce92bcc
Compare
benpicco
force-pushed
the
drivers/dose-uart_ondemand_tx
branch
from
December 14, 2023 17:30
ce92bcc
to
9cde80e
Compare
maribu
approved these changes
Dec 14, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area: cpu
Area: CPU/MCU ports
Area: drivers
Area: Device drivers
Area: Kconfig
Area: Kconfig integration
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
Platform: ARM
Platform: This PR/issue effects ARM-based platforms
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.
Contribution description
We have a one-wire bus where the idle level is LOW:
If two sensors pull the bus high at the same time, no-one will be able to send anything.
To make this work with standard UART where idle is LOW, we employ a little hack in which we de-mux the UART TX pin when we are not sending and only mux it to TX when we want to send a frame.
This generates a spurious 0 byte after the de-muxing, but since our DOSE frames are well delimited, this noise outside the frame is no issue.
Testing procedure
This bus is really slow (2400 Baud) but it works:
Issues/PRs references
previous attempt at this was #14300