8 Replies Latest reply on Nov 2, 2015 7:00 PM by Sriranjan

    Where is the IOCTL function for SPI from the arduino libraries defined?




      I am working with the SPI on Edison arduino breakout board.In the SPI.cpp files found in the libraries folder of arduino there is this following call;

      uint8_t SPIClass::transfer(uint8_t txData)


          uint8_t rxData = 0xFF;

          struct spi_ioc_transfer msg;


          memset(&msg, 0, sizeof(msg));


          msg.tx_buf = (__u64) &txData;

          msg.rx_buf = (__u64) &rxData;

          msg.len = sizeof(uint8_t);

          //msg.delay_usecs = 0;


         if (ioctl (this->fd, SPI_IOC_MESSAGE(1), &msg) < 0)


      Where is this IOCTL defined? i want to add some code to the definition of IOCTL that is called here in SPI.cpp.Please let me know.