9 Comments

  1. [...] I enabled the SPI device on my Rasp­berry PI, I wanted to drive some LED Mod­ules. Thanks to Scott Gib­son this was quite [...]

  2. 趣味の電子工作 » GPIO制御

    [...] Neophob  SPI [...]

  3. TT
    TT January 15, 2013 at 16:18 . Reply

    I am pretty new to programming. I have a device which I want to connect to the RPi using SPI. I tried out the spi_devtest.c and it works. But the SPI frame of the slave device requires 24 bits. I have searched high and low and have not been able to find a solution. I tried changing the number of bits per word but that does not work. I wonder if I would have to just send 3 bytes instead of 24 bits. In that case, I don’t know how to send 3 bytes without the chip select going inactive after each word. Any help would be greatly appreciated.

  4. TT
    TT January 16, 2013 at 22:09 . Reply

    nevermind, i figured it out. thanks anyways :)

  5. yvesined
    yvesined May 8, 2013 at 08:22 . Reply

    That was a quite awesome tutorial guys! Thank you. Is it possible to set digital GPIO Pins with this library (for example the CSN Pin that is recommened for SPI)?
    Greets, yvesined.

  6. Tom Hodder
    Tom Hodder July 24, 2014 at 15:18 . Reply

    After shorting the pins, I get the following output;

    $ sudo ./spidev_test
    spi mode: 0
    bits per word: 8
    max speed: 10000000 Hz (10000 KHz)

    EE FF

  7. Anteino
    Anteino November 8, 2014 at 03:45 . Reply

    When compiling the spidev_test.c it gives me a shitload of compile errors:

    root@raspberrypi:/home/pi/LEDServer# gcc spidev_test.c -o spidev_test
    spidev_test.c: In function âtransferâ:
    spidev_test.c:60:13: error: âSPI_TX_QUADâ undeclared (first use in this function)
    spidev_test.c:60:13: note: each undeclared identifier is reported only once for each function it appears in
    spidev_test.c:61:5: error: âstruct spi_ioc_transferâ has no member named âtx_nbitsâ
    spidev_test.c:62:18: error: âSPI_TX_DUALâ undeclared (first use in this function)
    spidev_test.c:63:5: error: âstruct spi_ioc_transferâ has no member named âtx_nbitsâ
    spidev_test.c:64:13: error: âSPI_RX_QUADâ undeclared (first use in this function)
    spidev_test.c:65:5: error: âstruct spi_ioc_transferâ has no member named ârx_nbitsâ
    spidev_test.c:66:18: error: âSPI_RX_DUALâ undeclared (first use in this function)
    spidev_test.c:67:5: error: âstruct spi_ioc_transferâ has no member named ârx_nbitsâ
    spidev_test.c: In function âparse_optsâ:
    spidev_test.c:172:12: error: âSPI_TX_DUALâ undeclared (first use in this function)
    spidev_test.c:175:12: error: âSPI_TX_QUADâ undeclared (first use in this function)
    spidev_test.c:184:12: error: âSPI_RX_DUALâ undeclared (first use in this function)
    spidev_test.c:186:12: error: âSPI_RX_QUADâ undeclared (first use in this function)
    spidev_test.c: In function âmainâ:
    spidev_test.c:204:18: error: âSPI_IOC_WR_MODE32â undeclared (first use in this function)
    spidev_test.c:208:18: error: âSPI_IOC_RD_MODE32â undeclared (first use in this function)

    I’ve done everything exactly like you said except that I used the 2014-09-09-wheezy-raspbian.zip. And because the edge bleed kernel from Chris Boot was not available anymore I reverted to olf firmware with: sudo rpi-update 8234d5148aded657760e9ecd622f324d140ae891. Could you give me advise on this? It seems that no environmental variables are declared in the program/system, what can I do to solve this? Create them manually?

    1. Anteino
      Anteino November 8, 2014 at 03:53 . Reply

Leave a Reply

%d bloggers like this: