Hello,
I am working on talking to a SPI slave device using SPI mode 3, so CPOL = 1 and CPHA = 1.
It is currently a very minimalistic project for testing purposes.
I am using the zephyr API for doing a single SPI transceive.
The problem is that the clock polarity is incorrect when doing a transaction. After the SPI CS is pulled low by the SPI API, the clock polarity is still low. While it should be high in SPI mode 3. This causes a rising edge, where it is visible that the SPI API has some vague understanding of what SPI mode it should be, as it is then high for a short idle period.
The result is that the SPI slave is confused now, since a rising edge on the SCLK when CS is low means that it samples a bit.
During the transceive, the SPI CLK goes to a low idle state (seems to not comply to its configured SPI mode).
I am struggling to find a way to make the SCLK be high from the moment CS is low (or before, I don't need this GPIO for anything else, it can be always high when idle).
Relevent code:
proj conf
dtsi
dts
application code
I hope I provided enough info. Your help would be much appreciated.
Kind regards.