有没有SPI接口的NAND FLASH
展开全部
spi/spi.h>文件包含内核文档,做主要源码,应该详读内核API文档相关章节.本文概览,解细节前致图景.
SPI请求进入I/O队列.请求给定SPI设备按照FIFO顺序进行,通完机制异步通知.同简单同步措施:先写读.
俩类SPI驱:
控制器驱(Controller drivers)...集SOC控制器,经扮演MasterSlave双角色.类驱直接接触硬件层寄存器甚至使用DMA.亦或者扮演bitbanger,仅需要GPIO脚;
协议驱(Protocoldrivers)...控制器slave或者控制器另外条SPI链路Master传递消息.协议驱控制器读数据,比堆0,1代码,解析意义协议数据;
于协议驱应该我要写,spilinux内核spi系统spi核层,类似USBcore主控制器部,另spi设备层.前者内核帮咱写,让spi设备能工作,借助spicontroller driver导些设施编写protocoldrivers.
struct spi_device结构封装俩类驱间master-side接口.
化SPI编程接口core,专注于使用板级初始化代码提供设备表并借助于驱模型连接controllerprotocol驱.sysfs文件系统,SPI视图:
1 /sys/devices/.../CTLR ... physical node for a given SPI controller
2
3 /sys/devices/.../CTLR/spiB.C ... spi_device on bus "B",
4 chipselect C, accessed through CTLR.
5
6 /sys/bus/spi/devices/spiB.C ... symlink to that physical
7 .../CTLR/spiB.C device
8
9 /sys/devices/.../CTLR/spiB.C/modalias ... identifies the driver
10 that should be used with this device (for hotplug/coldplug)
11
12 /sys/bus/spi/drivers/D ... driver for one or more spi*.* devices
13
14 /sys/class/spi_master/spiB ... symlink (or actual device node) to
15 a logical node which could hold class related state for the
16 controller managing bus "B". All spiB.* devices share one
17 physical SPI bus segment, with SCLK, MOSI, and MISO.
需要注意控制器类状态实际位置取决于您否启CONFIG_SYSFS_DEPRECATED标志.,唯特定类状态总线编号("B" in "spiB"),所/sys/class些入口项唯识别总线标志.
SPI请求进入I/O队列.请求给定SPI设备按照FIFO顺序进行,通完机制异步通知.同简单同步措施:先写读.
俩类SPI驱:
控制器驱(Controller drivers)...集SOC控制器,经扮演MasterSlave双角色.类驱直接接触硬件层寄存器甚至使用DMA.亦或者扮演bitbanger,仅需要GPIO脚;
协议驱(Protocoldrivers)...控制器slave或者控制器另外条SPI链路Master传递消息.协议驱控制器读数据,比堆0,1代码,解析意义协议数据;
于协议驱应该我要写,spilinux内核spi系统spi核层,类似USBcore主控制器部,另spi设备层.前者内核帮咱写,让spi设备能工作,借助spicontroller driver导些设施编写protocoldrivers.
struct spi_device结构封装俩类驱间master-side接口.
化SPI编程接口core,专注于使用板级初始化代码提供设备表并借助于驱模型连接controllerprotocol驱.sysfs文件系统,SPI视图:
1 /sys/devices/.../CTLR ... physical node for a given SPI controller
2
3 /sys/devices/.../CTLR/spiB.C ... spi_device on bus "B",
4 chipselect C, accessed through CTLR.
5
6 /sys/bus/spi/devices/spiB.C ... symlink to that physical
7 .../CTLR/spiB.C device
8
9 /sys/devices/.../CTLR/spiB.C/modalias ... identifies the driver
10 that should be used with this device (for hotplug/coldplug)
11
12 /sys/bus/spi/drivers/D ... driver for one or more spi*.* devices
13
14 /sys/class/spi_master/spiB ... symlink (or actual device node) to
15 a logical node which could hold class related state for the
16 controller managing bus "B". All spiB.* devices share one
17 physical SPI bus segment, with SCLK, MOSI, and MISO.
需要注意控制器类状态实际位置取决于您否启CONFIG_SYSFS_DEPRECATED标志.,唯特定类状态总线编号("B" in "spiB"),所/sys/class些入口项唯识别总线标志.
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询