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

[UART] Add buffer level check for synchronous API #24496

Open
cujomalainey opened this issue Apr 19, 2020 · 0 comments
Open

[UART] Add buffer level check for synchronous API #24496

cujomalainey opened this issue Apr 19, 2020 · 0 comments
Assignees
Labels
area: UART Universal Asynchronous Receiver-Transmitter Enhancement Changes/Updates/Additions to existing features

Comments

@cujomalainey
Copy link
Contributor

cujomalainey commented Apr 19, 2020

Is your feature request related to a problem? Please describe.
Most common uart APIs have the ability to either peek or check the buffer level without actually reading the first element.

The current Zephyr UART driver does not offer this ability.
The only ways to tell if there is data in the buffer is the ISR callback event
or
uart_irq_rx_ready which is only allowed inside the ISR.

Describe the solution you'd like
A method of checking the amount of frames available outside the ISR. Either new syscall or make uart_irq_rx_ready safe outside the ISR.

Describe alternatives you've considered
I can write my own buffer backed by the ISR, but it seems impractical for my use case and seems like this is a common feature that should be available.

Additional context
I can submit the PR, I just wanted to get feedback before doing the work to see why this was not part of the original API.

@carlescufi carlescufi added area: UART Universal Asynchronous Receiver-Transmitter Enhancement Changes/Updates/Additions to existing features labels Apr 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: UART Universal Asynchronous Receiver-Transmitter Enhancement Changes/Updates/Additions to existing features
Projects
None yet
Development

No branches or pull requests

4 participants