esp-rs / esp-hal

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

Add support for other clock sources in timer driver #174

Closed JurajSadel closed 7 months ago

JurajSadel commented 2 years ago

Currently, we are using only apb_clock in General-purpose timers implementation. The https://github.com/esp-rs/esp-hal/pull/77 added other options for the clock source.

JurajSadel commented 2 years ago

After discussion with @bjoernQ it seems it's not that straightforward.

In ESP-IDF the user can set the clock source but also manually choose the divider etc - it's a much lower level API. Do we want to have an additional low-level constructor that takes the clock source and divider? Then the user will want to use ticks for e.g start function - probably going to be a lot of effort. Also would be a general design decision since if we offer a low-level version here why don't we have it everywhere?

For now, let's turn this issue into a discussion of how we want to deal with this in the future. What is your opinion @bjoernQ, @jessebraham, @MabezDev?

MabezDev commented 7 months ago

ABP has served us well and I'm not aware of any current issues with TIMG being driven from it, therefore I'm going to close this for now.