Open minameHeart opened 1 year ago
https://forums.raspberrypi.com/viewtopic.php?p=2259448#p2259448
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)…
Current implementation of spi.h does not support setting Frame Format FRF. According to RP2040 Datasheet following formats are possible:
spi_set_format should look something like that
spi_init() should then have a parameter to select Frame Format (FRF) or there should be at least a function to set Frame Format (FRF). Otherwise users are forced to write directly into register or modify SDK (unclean).
Btw. Datasize (DSS) is fixed to value 8 which makes the function spi_write16_blocking() and spi_write16_read16_blocking() useless. Datasize should be parameter, too.