esp-rs/book

An GPIO example would be nice to have, some analoge/SPI/I2C/UART Read/Write

Codeleiche opened this issue · 6 comments

Hello everyone,
I'm just getting started with Rust, as well as Embedded Rust. While finding a lot about Rust, I really don't get the Embedded part... how to communicate or read a sensor is faar from obvious and I find my self handling registers like in the old days. Is there some hidden relationship between creates I don't see? how can I read an i2C bus just one or two functions away? how do I program an PWM Pin without setting it's register? Are there abstractions for that? Are thous in the esp-idf-hal? I saw something called i2c and gpio or spi in there that sounds promising but it seams to be a documentation less create, were is the documentation? Is there some kind of Parent create?
All those questions are in my head when I think about programming my sweet esp32 in Rust and It would be super nice if at least a part could be answered it this Book. The best demo I could find is the rust-esp32-std-demo and while there is a lot of interesting stuff in here It's more about networking and less about micro controlling.
Thx in andvance and If somebody gets me on track with some stuff to read I would love to answer some of those questions with an easy DHT and or led example in the book.

I also think that it would be nice a little example or description how to set the gpio high/low. While this is explained in the blinky esp32-hal. i don't know how to do this with the esp32-idf-hal (is it possible?)

I think it is, there is some gpio usage in the rust-esp32-std-demo but just for driving screens and stuff there is no clue on how to drive some analog pins...

I think we could benefit from some examples, however I don't think we want to start trying to rewrite the official embedded rust resources. Many of the questions you have here are ecosystem wide questions that are answered in the official embedded rust docs.

For example "GPIO,analoge/SPI/I2C/UART Read/Write" are all operations covered by the embedded-hal, which both esp32-hal & esp-idf-hal implement (various levels of support in each, but both support all of the peripherals you listed).

I'm not sure how much detail on this topic belongs in this particular book, but I think it's pretty clear we need to add some more information regarding embedded-hal, and make it more clear that these operations are already documented elsewhere.

I found that documentation exists for the esp-idf-hal but it's super outdated (current version esp-idf-hal-0.32.2, documented version esp-idf-hal-0.1.2) I now can get going but the book could have helped me to reach this state way earlier.

Documentation for all the esp-idf based crates are now available, sorry this took so long to get around to!