esp-rs / esp-hal

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

Implement embassy_embedded_hal::SetConfig #1919

Open phemmer opened 1 month ago

phemmer commented 1 month ago

This is a feature request to implement embassy_embedded_hal::SetConfig on anything which currently implements SpiBus (which would be Spi and SpiDma).

This would be useful with SpiDeviceWithConfig (blocking and async) for running multiple SPI devices with different clock speed capabilities on the same bus.

Yes, the user (me) could put a wrapper around Spi/SpiDma to implement SetConfig, and that might be what I do as a short term solution. But Just thought it would be good to have a native implementation.

Dominaezzz commented 1 month ago

Related https://github.com/esp-rs/esp-hal/issues/1666 and https://github.com/esp-rs/esp-hal/issues/1826