embassy-rs / embassy

Modern embedded framework, using Rust and async.
https://embassy.dev
Apache License 2.0
4.81k stars 652 forks source link

Why cyw43 use pio spi? #1514

Open overheat opened 1 year ago

overheat commented 1 year ago

Just be curious about this. Because I remember it is normal SPI peripheral for wifi chip connection before.

overheat commented 1 year ago

https://github.com/overheat/embassy/blob/82d765689aa0f922d0b43e402eaa3d911b2d461d/cyw43-pio/src/lib.rs

I can only find some comments in the code. Is it related to overclock?

phire commented 9 months ago

On the Pico W, the SPI pins are not hooked to the correct pins to use the RP2040's normal SPI peripheral. The Pico W PCB also uses resistors to multiples MOSI and MISO (and the cyw43's interrupt request) onto a single GPIO pin, so it's not even proper 4-wire SPI anymore. This design allows the Pico W to have the same external GPIO layout as the original Pico, at the cost of needing to use the PIO as a custom SPI implementation.

That previous version might have been for a different PCB that hooked the cyw43 to the proper pins for SPI?