Search code examples
c#raspberry-pi3spiwindowsiot

SpiDevice read, write and transfer


Playing with Windows IoT on a raspberry pi 3 and I am trying to communicate to an Adafruit RFM69HCW.

I have connected to the device via SPI and not matter what I do I can't seem to get the pi to read anything from the device registers. The one thing I wanted to know is what exactly does SpiDevice.Read(), Write(), TransferSequential() and TransferFullDuplex() do? I know the obvious basics but I am after the steps it performs for each function.

Reason I ask is because in the spec of the RF module it says when communicating you have to set the CS pin to low, send the command and then set the CS pin back to High. Does, for example, SpiDevice.Read() do this already?

I have been converting both an Arduino library and a Python Raspberry Pi code so I know about doing the Hard Reset first.

Link to the spec if anyone interested.RFM69HCW-V1.1.pdf


Solution

  • Reason I ask is because in the spec of the RF module it says when communicating you have to set the CS pin to low, send the command and then set the CS pin back to High. Does, for example, SpiDevice.Read() do this already?

    Yes, you are right. I test the SPIAccelerometer sample and get the following sequence diagram. The yellow line is chip select and the other is clock line. As you can see, when writing and reading the CS is set to low.(The wave shape is ugly because my scope has low performance.)

    enter image description here