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 Support #3

Open
esden opened this issue Oct 12, 2023 · 4 comments
Open

UART Support #3

esden opened this issue Oct 12, 2023 · 4 comments

Comments

@esden
Copy link
Collaborator

esden commented Oct 12, 2023

Are there any plans to also support UART as a protocol with this library?

I need to use the notecard over serial, and might be able to contribute some effort towards supporting UART.

If you are planning to add it, do you have specific thoughts on how you would like it done?

@gauteh
Copy link
Owner

gauteh commented Oct 12, 2023

Yeah that would be great! Maybe the serial::Write trait in embedded hal is shared between i2c and uart? And it just need some generalization?

Blues also added a binary interface for larger data transfer that I would like to implement. And the interface would actually some times be more flexible and robust with allocation. Or at least truncating heapless strings (there's an open issue on that on heapless).

@gauteh
Copy link
Owner

gauteh commented Oct 12, 2023

I had a stupid bug where the driver failed in places with long names, because I had chosen a too short string length.

@esden
Copy link
Collaborator Author

esden commented Oct 12, 2023

Here is one way of implementing this. https://github.com/analogdevicesinc/adi-adxl355-rs/blob/main/adi-adxl355/src/lib.rs
But maybe there is a better and cleaner solution.

@gauteh
Copy link
Owner

gauteh commented Oct 12, 2023

Yes, I think in practice you have to do something like that, because the differences are so big that you can't just swap the Write trait (e.g. https://github.com/gauteh/notecard-rs/blob/main/src/lib.rs#L291 or https://dev.blues.io/guides-and-tutorials/notecard-guides/serial-over-i2c-protocol/). Wheras with UART it is probably easier, you don't have to send and allocate the number of bytes to read, but you read until the response is complete?

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

No branches or pull requests

2 participants