feat(embedded-hal-bus): Spi - Add support for cs to clock delay#605
Conversation
0bbd0f6 to
e7fe105
Compare
|
Thanks for the PR! This is a welcome addition, just a few notes:
|
Thank you for the feedback! Note: If you ever encountered something similar and could give a quick tipwith the clock pin first bit floating for a while before starting normally under embassy_stm32: Maybe related to embassy-rs/embassy#1094 but I actually have no idea (timer prescaler config issue?), maybe you saw this in the past and could have quick tip? I will continue by testing on ESP32C3 awaiting I fix my issue on the STM32. |
|
it might be a bug yes. please file an issue or join #embassy, we can discuss there. |
e7fe105 to
ab42bc6
Compare
ab42bc6 to
e0b7617
Compare
Fix wrong variable name in spi shared delay driver
…vice-impls-for-CS-to-clock-delays
Issue created and solve at embassy-rs/embassy#3039 |
|
I hate to revive this, but the documentation has now been asking to do something impossible for two years (ff1f469). Is this in a state to be merged anytime? |

What
Add support for cs to clock delay in
embedded-hal-busspi's device implementation.Resolves #539
Why
This feature is defined at https://docs.rs/embedded-hal/latest/embedded_hal/spi/index.html#cs-to-clock-delays and issued at #539
Some chips that communicates through SPI necessitate this feature in order to correctly communicate.
How
Added a field in the device structs in order to store the
cs_to_clock_delay, with its adequate constructor parameter.The delay is applied in the shared transaction implementation, just after the CS is toggled.
Notes
core::time::Durationin the code, I would like to know if its a bad practice in embedded system implementation or not and why