pico-sdk
pico-sdk copied to clipboard
pico_cyw43_driver/cyw43_bus_pio_spi.c: make SPI_PROGRAM_NAME and CLOC…
Fixes #1498
This patch allows to override the default value for SPI_PROGRAM_NAME and CLOCK_DIV in src/rp2_common/pico_cyw43_driver/cyw43_bus_pio_spi.c by defining CYW43_SPI_PROGRAM_NAME and/or CYW43_PIO_CLOCK_DIV.
This is useful when other cpu speeds are involved, e.g. running the Pi Pico W at 12 MHz from xosc.
It would be nice to have full range of cpu speeds at runtime for Pico W.
I fully agree @matsobdev, the potential for power efficient applications is huge. But it involves a lot of changes. Running from xosc at 12 MHz with pll_sys disabled for example, is currently not possible using build settings alone. I think the first step in having the full range of cpu speeds available, would be to make the cpu speed and everything depending on it configurable at build time.
See also #1521 which allows the default clock divisor to be overridden at runtime, which is useful for Micropython etc. Both patches look like they can merge with each other without issue.