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

Provide more generic UART APIs for read and write #1682

Closed
zephyrbot opened this issue Mar 4, 2016 · 18 comments
Closed

Provide more generic UART APIs for read and write #1682

zephyrbot opened this issue Mar 4, 2016 · 18 comments
Labels
area: API Changes to public APIs area: UART Universal Asynchronous Receiver-Transmitter Enhancement Changes/Updates/Additions to existing features priority: medium Medium impact/importance bug

Comments

@zephyrbot
Copy link
Collaborator

zephyrbot commented Mar 4, 2016

Reported by Daniel Leung:

According to the mailing list, there is a request for APIs to read/write from UART FIFO. This will provide a simpler way to deal with UART interrupts. Currently, all drivers using UART have to write their own interrupt routine.

The following is extracted from the mailing list:

Actually, the UART API is very low level when we compare it with other
APIs such as SPI and I2C. For instance, the UART API exposes functions
to manipulate the FIFOs and check for interrupt flags. Is there any plan
to add higher level APIs such as "transmit the characters from this buffer
and call this callback once the transmission finishes" or "read 10
characters into this buffer and call this callback once it is done"?

This is something I have thought about, but there is no concrete plan.

Is there anything particular you are looking for? Use cases would be
a good start. This helps me to understand what needs to be done.

No, I don't have anything in particular. Probably the bluetooth drivers
and the console_uart driver are a good source of use cases. For instance,
they all have their own implementation of a mechanism read data
asynchronously. An API such as uart_read(dev, callback, buf, len) might
be useful.

(Imported from Jira ZEP-89)

@zephyrbot
Copy link
Collaborator Author

by Andrew Boie:

We should wait on feedback from NXP on these interfaces before we plan out a revised API.

@zephyrbot
Copy link
Collaborator Author

by Mark Linkmeyer:

Anas Nashif , in the ww24.2 backlog grooming meeting we discussed this item, but I didn't catch the AR of what needs to happen next on it. Do you recall what the AR was?

@zephyrbot
Copy link
Collaborator Author

by ethan gao:

Set the testability to NotTest for the time being and back to check when the real work of it is locked down

@zephyrbot
Copy link
Collaborator Author

by Andy Ross:

This is pretty much the same request as the one in ZEP-540. We need a sane framework for doing async I/O in Zephyr. The UART driver happens to be special in that it actually has an async facility, it's just low-level and kludgy. But a solution that worked for I2C and SPI (or whatever) would work just as well for UART.

@zephyrbot
Copy link
Collaborator Author

by Anas Nashif:

is this WIP and will be in 1.6? please Accept issue in this case.

@zephyrbot
Copy link
Collaborator Author

by Andy Ross:

Yeah, this is rolled into the k_poll stuff. And UARTs (because they have generic interrupt hooks already) are going to be the launch driver integration. Should be early next week.

@zephyrbot
Copy link
Collaborator Author

by Mark Linkmeyer:

Andy Ross , are you on track to get this story fully implemented and merged before the 1.6 merge window closes on Nov 9th? It sounds like from your earlier comment this will be completed this week (the week of 10/17), correct?

@zephyrbot
Copy link
Collaborator Author

by Mark Linkmeyer:

Andy Ross , please see my question above. If this is not on track to be done in time for 1.6, what help do you need?

@zephyrbot
Copy link
Collaborator Author

by Anas Nashif:

I do not see this happening for 1.6, next.

@zephyrbot
Copy link
Collaborator Author

by Qiu Peiyang:

Any update ? Or any prototypes for this API ?

@zephyrbot
Copy link
Collaborator Author

by Leandro Pereira:

Andy Ross , do you have anything for this? I can take it over from where you left.

@zephyrbot
Copy link
Collaborator Author

zephyrbot commented Apr 23, 2017

by Paul Sokolovsky:

Note that GH-3457 is concerned with elaboration of existing UART API in a way that will allow robust support of interrupt-driven transfers across ports - which is currently not possible, because different ports have various deviations in API implementation, which in turn apparently due to fact that API isn't clearly defined and there're no good tests to validate an implementation. (The latter is on its own "hard", because reliable testing a hardware block like UART requires a separate controlling node.)

@zephyrbot
Copy link
Collaborator Author

by Paul Sokolovsky:

Further note is that there's growing in functionality interrupt-driven pull-style console API: #49 . Te usecase behind it is simple: "Provide console API resembling that of POSIX API, to allow to develop/port applications easily".

The description of this ticket talks about implementing partially push-style API, but only partially, because not e.g. input data will be pushed into client, but only completion notifications.

Overall, usecases of interrupt-driven console API and generic higher-level UART API discussed here are pretty different, it just makes sense to keep in mind that console API is there and user interaction usecases are handled by it.

@zephyrbot
Copy link
Collaborator Author

zephyrbot commented May 25, 2017

Blocks GH-2003

@zephyrbot
Copy link
Collaborator Author

zephyrbot commented May 25, 2017

Related to GH-2078

@zephyrbot
Copy link
Collaborator Author

zephyrbot commented May 25, 2017

Related to GH-3457

@zephyrbot zephyrbot added priority: medium Medium impact/importance bug area: UART Universal Asynchronous Receiver-Transmitter Enhancement Changes/Updates/Additions to existing features labels Sep 23, 2017
@nashif nashif added the area: API Changes to public APIs label Jul 25, 2018
@carlescufi
Copy link
Member

@dcpleung could you take a look at the new API in #10820 and see if that satisfies the requirements in this issue? If so, could you please close it?

@dcpleung
Copy link
Member

#10820 looks good to me. Closing this one...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: API Changes to public APIs area: UART Universal Asynchronous Receiver-Transmitter Enhancement Changes/Updates/Additions to existing features priority: medium Medium impact/importance bug
Projects
None yet
Development

No branches or pull requests

4 participants