I want to use SPI interface to read and write the registers in an external FPGA (so I called it SPI device). I know Linux kernel has the spi driver. So can I use mmap? If yes, should I open the device file through "/sys/bus/spi/devices/DEVICE_NAME" in my code?

I noticed that when I cd to "/sys/bus/spi/devices/SPI_DEVICE_NAME", the path was changed automatically to "/sys/devices/soc.0/CORE_NAME/SOME_NUMBER/SPI_DEVICE_NAME". Can anyone explain it for me?

Thanks in advance!

Hetty

有帮助吗?

解决方案

SPI is strictly a command- and stream-oriented protocol. Linux does not have any facility for accessing the data available via it in a random manner. Or even in a sequential manner, since it does not have any drivers for SPI devices; all operations must be performed by user software.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top