-
Notifications
You must be signed in to change notification settings - Fork 226
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
Changing SPI clock is unexpectedly expensive #1666
Comments
I think this the answer. let clock_setting = Spi::calculate_clock_settings(&clocks, frequency);
// User can store clock_setting object per device.
spi.set_frequency(clock_setting); EDIT: This will also be very handy for setting up configurable segmented transfers. |
Bumping this issue. SPI sharing is a very common use case and this can be easily supported by introducing a |
I don't think this is as easy as you think, the peripherals can have multiple clock sources. Since we intend to support configuring clock sources, we'll have to somehow tie these config options together, while at the same time remain backward compatible when we introduce the clock source configuration. cc #1668 |
Changing the SPI frequency essentially goes to
esp-hal/esp-hal/src/spi/master.rs
Line 2576 in a20054c
which is a loop-based search. However in situations like multi-slave SPI bus with different clocks, this will need to be executed many times.
Don't know what is the best way, could
clk_spi_mst/32
as this is the most common scenarioXREF: rust-embedded/embedded-hal#605
The text was updated successfully, but these errors were encountered: