Albin Hedman

Results 161 comments of Albin Hedman

I found the [esp32 crate](https://crates.io/crates/esp32) which [seems to have this](https://docs.rs/esp32/0.12.0/esp32/struct.PWM0.html). However I am assuming that should not be used at the same time as this crate due to the crates...

Maybe I will give it a try if I get time. Thanks! :)

Do you think looking at something like ledc.rs and its correlation to the idf would be a good starting point for how to design the api?

Am I missing something or are there no mcpwm related functions such as [mcpwm_init](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/mcpwm.html#_CPPv410mcpwm_init12mcpwm_unit_t13mcpwm_timer_tPK14mcpwm_config_t) in [esp_idf_sys](https://esp-rs.github.io/esp-idf-sys/esp_idf_sys/)?

Thanks a lot. I will try to take a look :)

As far as I can see `#include "driver/mcpwm.h"` is [already present in that file](https://github.com/esp-rs/esp-idf-sys/blob/master/src/include/esp-idf/bindings.h#L169) (just below the inclusion of `driver/ledc.h`). When searching for ledc in the repo I can not...

Oh, just checked locally and yes `esp_idf_sys::mcpwm_init` and friends are there.

@MabezDev do you think an API that would allow you to write something roughly like this would make sense? ```rust let peripherals = Peripherals::take().unwrap(); let config = OperatorConfig::default().frequency(25.kHz().into()); let mcpwm...

Oh, that does make sense. Thank you for the clarification :) . So I would have to do something more like(changed text in bold): 1. Device is not configured, start...

~~Have not have had time to check if this even compiles since my last changes...~~ Anyways is this somewhat what we want things to look like api wise? :)