HardwareFirstly, check the manual (or user guide) for the chip you're using. It's very likely that it does have an SPI peripheral on-chip, but it might not. In addition, it's common for peripherals to share I/O pins as most applications only use a small subset of the available peripherals. Thus, even if it has SPI, you may not be able to use it if you're using other peripherals that share the same pins.If you don't have a hardware SPI peripheral, you can probably still interface with SPI because you can control the I/O pins manually from software; this is known as "bit banging". However, the data rate will probably be lower and you'll get more CPU overhead, especially if you want your device to act as a slave. In addition, it'll take longer to implement and debug the SPI interface if you have to do it all manually.LinuxIt is likely that you do have SPI on your chip, but that Linux simply doesn't have a driver for it. In this case, you'll probably have to write your own driver. If you're lucky, there may be one available on the net, but I couldn't tell you where to look.Also note that Linux may not regard SPI as a device in its own right. It may think of it more as a bus. However, I've never used SPI from Linux so I can't be sure about this. Can anyone be sure of anything in Linux? :-)
You should be fine then, unless some other part of Linux is using it as I/O. That is unlikely. Your driver will need to configure the pins to connect them to the SPI peripheral internally. You'll need to look at the chip's user manual for details on how to do that.SPI is neither a char or a block device because those are abstract Linux terms used to classify a device. However, your driver should probably present SPI as a char device.What exactly are you trying to achieve with SPI? It sends and receives synchronously, so a slave cannot simply send data, and similar a master cannot simply receive data. It doesn't work like a normal UART-like device.
About the pin sharing though it has pins for SPI it is also shared as I/O. But i do not intend to use it for any other purpose other than SPI.
There seems to be not much of sample driver code for SPI..... Is SPI char or block device??