0

I am working on Qt5.9 version to develop an application. In this project I have a controller connected to Toradex SOM iMX6DL. I am developing application in Qt5.9 Qml.

I am not getting a source of information to implement SPI interface between controller and Toradex SOM in Qt Qml.

Please give me some information on this. If anyone have example code or documentation please share it to me.

Dharman
  • 30,962
  • 25
  • 85
  • 135
  • Can you share more details about your specific needs? Often, there are kernel drivers that abstract the use of SPI to the user space, and you would then, possibly, just need to read/write to files in your Qt application. – lgraba Oct 24 '19 at 11:29

2 Answers2

0

You should create your own QObject derived class and expose it to QMLEngine. Integrating QML and C++ in Qt documentation will give you a good understanding. Note the BackEnd class in the example and how it is registered to be used in QQmlApplicationEngine.

In your ExampleSPIBackEnd class (or whatever you name it), you have to use either read/write methods of "stdio.h" for half-duplex communication or "sys/ioctl.h" for full-duplex. Refer to this document for quick help.

This project also has good implementation. Consider their GPL v2 license.

Another good example is https://raspberry-projects.com/pi/programming-in-c/spi/using-the-spi-interface.

Soheil Armin
  • 2,725
  • 1
  • 6
  • 18
0

I searched for spidev, for the SPI implementation in C/C++.

Cleiton Bueno
  • 326
  • 2
  • 10