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

WIP Feature/spi display #117

Closed
wants to merge 4 commits into from
Closed

WIP Feature/spi display #117

wants to merge 4 commits into from

Conversation

georgik
Copy link

@georgik georgik commented Jul 25, 2022

Work in progress.

I am adding the ESP32-S2 example.

BTW: How do you handle dependencies for specific examples? I've added them to the main dependencies. Any better approach?

Is it necessary to change also .cargo/config.toml?

Sorry for the indentation in Cargo.toml. VS Code, for some reason, tries to indent everything on save. I will revert the indentation and clean up some code.

@bjoernQ
Copy link
Contributor

bjoernQ commented Jul 25, 2022

BTW: How do you handle dependencies for specific examples? I've added them to the main dependencies. Any better approach?

Dependencies that are only for the examples should go to the [dev-dependencies] section

Is it necessary to change also .cargo/config.toml?

There shouldn't be any need to touch it

@bjoernQ
Copy link
Contributor

bjoernQ commented Jul 25, 2022

One more thing: we shouldn't add esp-backtrace as a dependency since it unfortunately currently depends on ESP32C3-HAL itself - we can do it during development to make our lives easier but not check it in

@jessebraham
Copy link
Member

I'm a little concerned that this doesn't really add anything of value of the existing spi_loopback examples, and just adds to build time in CI and required maintenance. I also would like to see examples included for all chips (unless there is some hardware limitation forbidding such).

@bjoernQ
Copy link
Contributor

bjoernQ commented Jul 25, 2022

Maybe we could go for another repository hosting examples that are slightly more involved than what we have (and want to have) here?

(Examples which are between "show how the API works" and "show how to implement some solution")

@jessebraham
Copy link
Member

I think that's a better approach. To me the examples exist for two reasons:

  1. To allow verification in of drivers in CI
  2. To show a bare-minimum example of how to use some specific peripheral

@georgik
Copy link
Author

georgik commented Jul 25, 2022

@bjoernQ I tried to revert .cargo/config.toml, but then the build fails with:

error[E0599]: no method named `compare_exchange_weak` found for reference `&AtomicU8` in the current scope
   --> /Users/georgik/.cargo/registry/src/github.com-1ecc6299db9ec823/heapless-0.7.15/src/mpmc.rs:223:18
    |
223 |                 .compare_exchange_weak(
    |                  ^^^^^^^^^^^^^^^^^^^^^ method not found in `&AtomicU8`

Please, do you know @MabezDev which of the changes in .cargo/config.toml in this PR might be the resolution of the problem? I took the file from the freshly generated esp-template project.

@bjoernQ
Copy link
Contributor

bjoernQ commented Jul 25, 2022

Ah sorry - wasn't aware that one of the dependencies needs atomics - then you need that and then it's even more needed to move those examples to a separate repository, I guess

@georgik
Copy link
Author

georgik commented Jul 25, 2022

@jessebraham There is already an i2c_display example in the repo. The idea is to provide a similar quick start for Embedded Graphics and Espressif boards via SPI. IMO it's worth checking also builds with Embedded Graphics since it's defacto Rust standard. I see no problem moving it to another repo since graphics are slightly more elaborate than bare minimum communication with SPI. We might consider something like esp-graphical-demos and add more examples that pull other crates and handle more advanced stuff like double-buffering, which is required to build anything responsive. I welcome any suggestions.

Regarding boards/chips: Sure, I plan to add also S3, Kaluga, and ESP32. I had only good old S2 with me today to verify runtime.

@georgik
Copy link
Author

georgik commented Jul 25, 2022

The new repo should resemble something like this https://github.com/tuupola/esp_effects

@jessebraham
Copy link
Member

I'm going to close this, but I have created esp-rs/esp-hal-examples which can be the home for projects like this. We can get your example hosted in there along with some other more interesting demo projects.

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

Successfully merging this pull request may close these issues.

3 participants