Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: SPI on RPI



On Mon, 30 May 2022 at 18:25 -0000, Michael van Elst wrote:
> You need to initialize sit_recv and sit_recvlen as well.
> 
> Here is an example. Most SPI devices use a separate data/command
> line, here GPIO25 that must be configured as output (with DTB or
> /etc/gpio.conf). Many chips allow reading back data or status
> information, but real-world devices don't support it.

Thanks, this was really helpful.  I had done most of what
you suggested (initialising sit_recv and sit_recvlen and
also using a GPIO pin--as it happens, also pin 25--to
distinguish between data and command).  I did a bad job of
creating a minimal example in my email but my actual code
was essentially quite similar to yours, with the difference
that I hadn't configure the SPI device first (and when I
did, I set the speed to zero, wrongly assuming it would
correspond to some default).  Once I configured it with a
nonzero speed as in your code things started to work.

Pouya


Home | Main Index | Thread Index | Old Index