- 論壇徽章:
- 0
|
本帖最后由 wwxxxxll 于 2013-07-10 09:29 編輯
回復(fù) 10# thzhr2009
測試,你還是先接一個(gè)spi設(shè)備
在spidev.c中的probe//linux-3.2.36(我用的)
出現(xiàn)
spidev->devt = MKDEV(SPIDEV_MAJOR, minor);
dev = device_create(spidev_class, &spi->dev, spidev->devt,
spidev, "spidev%d.%d",
spi->master->bus_num, spi->chip_select);
/dev下生成有類似spidev0.0的設(shè)備文件,操作它就可以了,如果/dev下沒有那就可能沒裝載成功
看這個(gè)
http://blog.chinaunix.net/uid-24219701-id-3752902.html
ioctl的命令看spidev.c中spidev_ioctl和include/linux/spi/spidev.h中
就想普通的字符設(shè)備,沒什么區(qū)別 |
|