Micropython and C SDK currently include code for Motorola/Freescale/NXP SPI format only (which is mode 0, the default value).; see #1099.
You would probably have to access the control register directly to reconfigure it for NS/TI Microwire/SPI after the provided initialization:
https://github.com/raspberrypi/pico-sdk/blob/2.0.0/src/rp2_common/hardware_spi/include/hardware/spi.h#L255
https://github.com/raspberrypi/pico-sdk/blob/2.0.0/src/rp2040/hardware_structs/include/hardware/structs/spi.h#L32
https://github.com/micropython/micropython/blob/v1.23.0/ports/rp2/machine_spi.c#L191
https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf#page=519
Maybe the order parameter (currently unused, i.e. constant value 1, or possibly 0) could be repurposed as some combined frame format/mode/order enum (like FRF = order >> 1)… [It looks like continuous TI SSI format mode could also be useful for software S/PDIF instead of using PIO or HSTX.]
You would probably have to access the control register directly to reconfigure it for NS/TI Microwire/SPI after the provided initialization:
https://github.com/raspberrypi/pico-sdk/blob/2.0.0/src/rp2_common/hardware_spi/include/hardware/spi.h#L255
https://github.com/raspberrypi/pico-sdk/blob/2.0.0/src/rp2040/hardware_structs/include/hardware/structs/spi.h#L32
https://github.com/micropython/micropython/blob/v1.23.0/ports/rp2/machine_spi.c#L191
https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf#page=519
Maybe the order parameter (currently unused, i.e. constant value 1, or possibly 0) could be repurposed as some combined frame format/mode/order enum (like FRF = order >> 1)… [It looks like continuous TI SSI format mode could also be useful for software S/PDIF instead of using PIO or HSTX.]
Statistics: Posted by PicoTinker — Fri Oct 11, 2024 1:43 am