How to setup virtual SPI in Linux

If you are developing application which depends of hardware which is not available yet, then SPI interface can be hard to support in emulator and in such situation virtual SPI can be very handy.Now lets get in to detail on the implementation.Basically everything is file in Linux, files, devices etc with exception to network interfaces. So the SPI device what the driver creates is also a file. The file operations such as open, read, write, close can be performed in a normal file, in spi device file you can also perform ioctl operation. So what we need is to emulate these operation on a file from the other side. The best way to emulate these file operation is to use a virtual file system and I found FUSE to be very ideal for this.

Read more