esp-rs / esp-hal

no_std Hardware Abstraction Layers for ESP32 microcontrollers
https://docs.esp-rs.org/esp-hal/
Apache License 2.0
777 stars 215 forks source link

RFC: Provide consistent APIs for configuring clock sources for peripheral drivers #1668

Open jessebraham opened 5 months ago

jessebraham commented 5 months ago

From this project's inception we've just been hard-coding the clock source for peripheral drivers (usually just using the default clock source). This has been done just to keep things simple. We've reached the point that I feel we should start thinking more about this. I think it should not be too difficult to provide consistent APIs for configuring clock sources.

(I have not thought about this much (or at all, really) yet but I will update this comment once I have a better idea of what we should actually do about this)

playfulFence commented 4 months ago

I guess conceptually it should be something like https://github.com/esp-rs/esp-hal/pull/1416, right?

sunsoan commented 1 month ago

I guess conceptually it should be something like #1416, right?

yes,some other peripheral also need a method to config clock source

MabezDev commented 1 week ago

I changed my mind, this isn't a beta blocker but a 1.0 blocker - I've added a note in https://github.com/esp-rs/esp-hal/issues/2495 (the only driver where we set the clock source) to mark it as unstable until we figure out a full solution for this.