Emulating a shift register in STM32G0
Hi all.
My objective is to read a stream of data intended for a shift register with 1.5us clock period.
There are 17 clock cycles and I want to sample the data at the transition (upper or lower).
Can this be achieved using SPI or should I just bit-bang it?
I have tried using HAL_SPI_Receive but the results are not consistent.
I wait until the data line goes down and call HAL_SPI_Receive to read 2 or 3 bytes, but the data returned is incomplete.
Maybe I am not understanding HAL_SPI_Receive correctly. The timeout is milliseconds? Can I set it to 1 ms to timeout trying to read the 24 bits where only 17 exist? And will it return the data read so far?
Thank You