-
Notifications
You must be signed in to change notification settings - Fork 109
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
examples: st7789: Initial commit #543
Conversation
@jrvanwhy as I hope you have some ideas |
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.
I'm pretty split on this.
On the one hand, it's a cool demo that a rather involved set of embedded-hal libraries can work in libtock-rs.
On the other hand, while it works, it's a pretty non-cannonical way of writing a Tock process---really, the translation from "draw pixel" <-> SPI commands should happen underneath something like the Screen HIL in the kernel, so the application is natively portable, the screen can be divided or switched between processes, etc.
Yeah, it would be nice to do it in the kernel. That's a huge effort though. tock/tock#3079 covers some of the things needed, which predictably have all stalled. It would also require a re-write of https://github.com/almindor/mipidsi in the kernel. Doing it in userspace means we can handle all of graphics complexities there and also utilise the well supported rust-embedded ecosystem. Maybe if you or someone else adds kernel support in the future we can update this to use that instead |
I'm not sure that's true. See for example the lvgl example in libtock-c which just uses an existing embedded graphics library, (not so different from the embedded-graphics crate). Supporting |
The main problem I have, I think, is that this looks like The Right Thing(tm) to do if it's in examples. I'm similarly wary of maintaining such examples long term. Two options that could solve both this problem and the specific problem of the dependencies living in the library's Cargo.toml:
|
Ah true. There is also already a Tock port for the ST7789 that I didn't know about as well. Although there are so many displays supported by embedded-rust that we don't have in the kernel, so it doesn't help for the next display A |
69a96b6
to
1765b89
Compare
Updated to implement "Idea A" with a demo directory containing a separate crate |
45effda
to
c258e99
Compare
This is a basic example of displaying data on a st7789 screen using Tock. Signed-off-by: Alistair Francis <[email protected]>
Signed-off-by: Alistair Francis <[email protected]>
c258e99
to
10a3d07
Compare
This is a basic example of displaying data on a st7789 screen using Tock.
This requires a few dependencies, which unfortunately get included for all examples. The other issue is that the example fails to build unless
FEATURES=rust_embedded
is passed as part of themake
command. What are people's thoughts on handling this?