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

Common crates #223

Closed
gruvw opened this issue Dec 2, 2023 · 1 comment
Closed

Common crates #223

gruvw opened this issue Dec 2, 2023 · 1 comment

Comments

@gruvw
Copy link

gruvw commented Dec 2, 2023

Hi, just started my first project in the embedded Rust world :)

I am wondering how can I access the so-called "common crates" outside this training scope ?

I finished going through the awesome examples in this repository, and I feel ready to start a project on my own.
After creating a new project from the template using the recommended cargo-generate, I am a bit lost without those common crates.

Are the rgb-led and wifi common crates published on crates.io, or are we supposed to copy and manually include those short pieces of code in our own projects ?

Thank you so much for your help, and sorry if this is not the right place to ask beginner questions.

@Vollbrecht
Copy link
Contributor

Vollbrecht commented Dec 3, 2023

You may be confused, because we recently updated how we export our basic 3 crates esp-idf-sys, esp-idf-hal and esp-idf-svc. From a relationship perspective we always made sure that svc depends on hal and hal depends on sys. Because of this with our latest release we fully re-export the hal and sys crate through svc. So you only need one dependency directly- Before that the user needed to make sure all 3 versions were aligned enough, with this we eased this a bit.

To access the underlying other two crates. for example you want to access peripherals of the hal crate, you can do use esp-idf-svc::hal::peripherals and similar for sys using esp-idf-svc::sys.

Wifi support if fully integrated inside esp-idf-svc and if you look what the std-traning does, its essentially just a function that wraps around the setup routine of the wifi, e,g creating a config , passing the nvs partition and creating a driver object and starting all things. In other words for your basic needs all should be there. The rgb-led is a bit special because its a smartl-led ( addressable with timed pwm pulses) if you want to use it in your projects you can either reuse the code from training or use an external driver that supports this ws2218 led's or what they were called.

In general if you have questions, the best place to ask is inside our matrix room

@gruvw gruvw closed this as completed Dec 3, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in esp-rs Dec 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants