当前位置: 首页 > news >正文

做一个普通网站多少钱英文网站建设

做一个普通网站多少钱,英文网站建设,wordpress admin_url(),网站建设网站营销网站托管一体化文章目录 参考资料:一、SPI驱动重要数据结构1.1 SPI控制器数据结构1.2 SPI设备数据结构1.3 SPI驱动数据结构 二、SPI 驱动框架2.1 SPI控制器驱动程序2.2 SPI设备驱动程序 三、总结 参考资料: 内核头文件:include\linux\spi\spi.h 一、SPI驱…

文章目录

  • 参考资料:
  • 一、SPI驱动重要数据结构
    • 1.1 SPI控制器数据结构
    • 1.2 SPI设备数据结构
    • 1.3 SPI驱动数据结构
  • 二、SPI 驱动框架
    • 2.1 SPI控制器驱动程序
    • 2.2 SPI设备驱动程序
  • 三、总结


参考资料:

  • 内核头文件:include\linux\spi\spi.h

一、SPI驱动重要数据结构

如下图,SPI 子系统中包含有 SPI控制器SPI设备两类硬件。内核对此抽象出了三个数据结构:

  • spi_master:用来表示一个SPI控制器;
  • spi_device:用来表示一个SPI设备;
  • spi_driver:与SPI设备对应的SPI驱动。
    在这里插入图片描述

1.1 SPI控制器数据结构

spi_master结构中最重要的成员是transfer函数指针,由它实现SPI控制器的数据传输功能。

struct spi_master {struct device	dev;struct list_head list;u32 slave;s16			bus_num;  //第几条总线u16			num_chipselect; //支持的片选引脚个数u16			dma_alignment;u16			mode_bits;   //SPI控制器支持的工作模式u32			bits_per_word_mask; //一次传输几位
#define SPI_BPW_MASK(bits) BIT((bits) - 1)
#define SPI_BIT_MASK(bits) (((bits) == 32) ? ~0U : (BIT(bits) - 1))
#define SPI_BPW_RANGE_MASK(min, max) (SPI_BIT_MASK(max) - SPI_BIT_MASK(min - 1))/* 最大/最小传输速率 */u32			min_speed_hz;u32			max_speed_hz;/* other constraints relevant to this driver */u16			flags;
#define SPI_MASTER_HALF_DUPLEX	BIT(0)		/* can't do full duplex */
#define SPI_MASTER_NO_RX	BIT(1)		/* can't do buffer read */
#define SPI_MASTER_NO_TX	BIT(2)		/* can't do buffer write */
#define SPI_MASTER_MUST_RX      BIT(3)		/* requires rx */
#define SPI_MASTER_MUST_TX      BIT(4)		/* requires tx *//* lock and mutex for SPI bus locking */spinlock_t		bus_lock_spinlock;struct mutex		bus_lock_mutex;/* flag indicating that the SPI bus is locked for exclusive use */bool			bus_lock_flag;/*设置spi总线工作模式,频率等*/int			(*setup)(struct spi_device *spi);/*spi 传输方法*/int			(*transfer)(struct spi_device *spi,struct spi_message *mesg);void			(*cleanup)(struct spi_device *spi);bool			(*can_dma)(struct spi_master *master,struct spi_device *spi,struct spi_transfer *xfer);bool				queued;struct kthread_worker		kworker;struct task_struct		*kworker_task;struct kthread_work		pump_messages;spinlock_t			queue_lock;struct list_head		queue;struct spi_message		*cur_msg;  bool				idling;  //空闲bool				busy;    //忙bool				running; //运行中bool				rt;bool				auto_runtime_pm;bool                            cur_msg_prepared;bool				cur_msg_mapped;struct completion               xfer_completion;size_t				max_dma_len;int (*prepare_transfer_hardware)(struct spi_master *master);int (*transfer_one_message)(struct spi_master *master,struct spi_message *mesg);int (*unprepare_transfer_hardware)(struct spi_master *master);int (*prepare_message)(struct spi_master *master,struct spi_message *message);int (*unprepare_message)(struct spi_master *master,struct spi_message *message);void (*set_cs)(struct spi_device *spi, bool enable);int (*transfer_one)(struct spi_master *master, struct spi_device *spi,struct spi_transfer *transfer);void (*handle_err)(struct spi_master *master,struct spi_message *message);/* gpio chip select */int			*cs_gpios;/* statistics */struct spi_statistics	statistics;/* DMA channels for use with core dmaengine helpers */struct dma_chan		*dma_tx;struct dma_chan		*dma_rx;/* dummy data for full duplex devices */void			*dummy_rx;void			*dummy_tx;
};

1.2 SPI设备数据结构

spi_device结构体里面记录有设备的片选引脚、频率、挂在哪个SPI控制器下面等信息。

struct spi_device {struct device		dev;struct spi_master	*master; //设备挂在的对应控制器u32			max_speed_hz;   //该设备能支持的SPI时钟最大值u8			chip_select;    //是这个spi_master下的第几个设备u8			bits_per_word; //每次传输的位数,bits_per_word是可以大于32的,也就是每次SPI传输可能会发送多于32位的数据,这适用于DMA突发传输u16			mode;  //工作模式
#define	SPI_CPHA	0x01			/* 在第1个周期采样,在第2个周期采样? */
#define	SPI_CPOL	0x02			/* 平时时钟极性 */
#define	SPI_MODE_0	(0|0)			/* (original MicroWire) */
#define	SPI_MODE_1	(0|SPI_CPHA)
#define	SPI_MODE_2	(SPI_CPOL|0)
#define	SPI_MODE_3	(SPI_CPOL|SPI_CPHA)
#define	SPI_CS_HIGH	0x04			/* 一般来说片选引脚时低电平有效,SPI_CS_HIGH表示高电平有效 */
#define	SPI_LSB_FIRST	0x08	    /* 一般来说先传输MSB(最高位),SPI_LSB_FIRST表示先传LSB(最低位),很多SPI控制器并不支持SPI_LSB_FIRST */
#define	SPI_3WIRE	0x10			/* SO、SI共用一条线 */
#define	SPI_LOOP	0x20			/* 回环模式,就是SO、SI连接在一起 */
#define	SPI_NO_CS	0x40			/* 只有一个SPI设备,没有片选信号,也不需要片选信号 */
#define	SPI_READY	0x80			/* SPI从设备可以拉低信号,表示暂停、表示未就绪 */
#define	SPI_TX_DUAL	0x100			/* 发送数据时有2条信号线 */
#define	SPI_TX_QUAD	0x200			/* 发送数据时有4条信号线 */
#define	SPI_RX_DUAL	0x400			/* 接收数据时有2条信号线 */
#define	SPI_RX_QUAD	0x800			/* 接收数据时有4条信号线 */
#define SPI_SLAVE_MODE 0x1000       /* enabled spi slave mode */int			irq;void			*controller_state;void			*controller_data;char			modalias[SPI_NAME_SIZE];int			cs_gpio;	//这是可选项,也可以把spi_device的片选引脚记录在这里/* the statistics */struct spi_statistics	statistics;
};

1.3 SPI驱动数据结构

spi_driver 结构体是”SPI总线设备驱动模型”中的一部分。

struct spi_driver {const struct spi_device_id *id_table;int			(*probe)(struct spi_device *spi);int			(*remove)(struct spi_device *spi);void			(*shutdown)(struct spi_device *spi);struct device_driver	driver;
};

二、SPI 驱动框架

SPI 子系统中包含有 SPI控制器SPI设备两类硬件。对应就有SPI控制器驱动和SPI设备驱动,SPI控制器驱动提供SPI的传输能力SPI设备驱动提供对SPI设备的访问能力,它知道怎么访问这个设备,知道这个设备的数据含义是什么, 它会调用SPI控制器的函数来收发数据。

2.1 SPI控制器驱动程序

SPI控制器的驱动程序可以基于"平台总线设备驱动"模型来实现:

  • 在设备树里描述SPI控制器的硬件信息,在设备树子节点里描述挂在下面的SPI设备的信息
  • platform_driver中提供一个probe函数
    • 它会注册一个spi_master
    • 还会解析设备树子节点,创建spi_device结构体

2.2 SPI设备驱动程序

跟"平台总线设备驱动模型"类似,Linux中也有一个"SPI总线设备驱动模型":

  • 左边是spi_driver,使用C文件实现,里面有id_table表示能支持哪些SPI设备,有probe函数
  • 右边是spi_device,用来描述SPI设备,比如它的片选引脚、频率
    • 可以来自设备树:比如由SPI控制器驱动程序解析设备树后创建、注册spi_device
    • 可以来自C文件:比如使用spi_register_board_info创建、注册spi_device

SPI驱动模型:
右边”平台总线设备驱动模型”,左边“SPI总线设备驱动模型”。
在这里插入图片描述

三、总结

本文描述了SPI驱动程序模型。


文章转载自:
http://cycloalkane.rmyt.cn
http://vaginated.rmyt.cn
http://solander.rmyt.cn
http://flouncey.rmyt.cn
http://micturition.rmyt.cn
http://resinification.rmyt.cn
http://chunk.rmyt.cn
http://hurray.rmyt.cn
http://subdelegate.rmyt.cn
http://complier.rmyt.cn
http://plaid.rmyt.cn
http://luddism.rmyt.cn
http://ploughing.rmyt.cn
http://poofy.rmyt.cn
http://kellogg.rmyt.cn
http://attainture.rmyt.cn
http://fictional.rmyt.cn
http://androclus.rmyt.cn
http://absolutely.rmyt.cn
http://sixpennyworth.rmyt.cn
http://sealing.rmyt.cn
http://bakeapple.rmyt.cn
http://enrichment.rmyt.cn
http://arabia.rmyt.cn
http://regorge.rmyt.cn
http://muss.rmyt.cn
http://brokerage.rmyt.cn
http://bedfast.rmyt.cn
http://absorbance.rmyt.cn
http://pukka.rmyt.cn
http://readapt.rmyt.cn
http://theurgy.rmyt.cn
http://marty.rmyt.cn
http://litmus.rmyt.cn
http://teleordering.rmyt.cn
http://prohibition.rmyt.cn
http://liquefaction.rmyt.cn
http://bower.rmyt.cn
http://soerabaja.rmyt.cn
http://sulphidic.rmyt.cn
http://rehumidify.rmyt.cn
http://angular.rmyt.cn
http://kitchenet.rmyt.cn
http://armomancy.rmyt.cn
http://intervalometer.rmyt.cn
http://petechia.rmyt.cn
http://excusably.rmyt.cn
http://limber.rmyt.cn
http://gaper.rmyt.cn
http://geocarpy.rmyt.cn
http://alleged.rmyt.cn
http://soapberry.rmyt.cn
http://masterate.rmyt.cn
http://plasmolyse.rmyt.cn
http://extramarginal.rmyt.cn
http://laborite.rmyt.cn
http://uranous.rmyt.cn
http://ergative.rmyt.cn
http://lothario.rmyt.cn
http://aah.rmyt.cn
http://lotta.rmyt.cn
http://chlorofluoromethane.rmyt.cn
http://bloomers.rmyt.cn
http://machisma.rmyt.cn
http://hyperhepatia.rmyt.cn
http://autotransfusion.rmyt.cn
http://dominoes.rmyt.cn
http://boulangerite.rmyt.cn
http://circumterrestrial.rmyt.cn
http://pronaos.rmyt.cn
http://crackable.rmyt.cn
http://nervy.rmyt.cn
http://dehorn.rmyt.cn
http://diplotene.rmyt.cn
http://kathleen.rmyt.cn
http://protistan.rmyt.cn
http://naturalization.rmyt.cn
http://converge.rmyt.cn
http://emancipist.rmyt.cn
http://tautosyllabic.rmyt.cn
http://damnably.rmyt.cn
http://revivable.rmyt.cn
http://nekton.rmyt.cn
http://byplay.rmyt.cn
http://isolationism.rmyt.cn
http://mythogenesis.rmyt.cn
http://unvarying.rmyt.cn
http://irascibly.rmyt.cn
http://agoraphobia.rmyt.cn
http://underwrought.rmyt.cn
http://dodgery.rmyt.cn
http://djebel.rmyt.cn
http://comparator.rmyt.cn
http://peacockery.rmyt.cn
http://vasodilating.rmyt.cn
http://ahl.rmyt.cn
http://confirmed.rmyt.cn
http://luminism.rmyt.cn
http://camoufleur.rmyt.cn
http://cumbersome.rmyt.cn
http://www.dt0577.cn/news/77038.html

相关文章:

  • 模板网站是什么百度热门
  • 微信公众号怎么做网站的温州免费建站模板
  • 门户网站网站开发海外营销公司
  • 免费访问国外网站的app网址大全
  • 烟台高端网站建设网站设计与制作
  • 昆明网站设计公司哪家好如何做自己的网站
  • 网站弹出广告代码seo是什么姓
  • 网站备案 做网站时就需要吗舆情分析网站
  • 个人网站建设策划书百度首页官网
  • WordPress插件后天怎么编写西安seo推广
  • 营销型网站的案例网络营销推广工具有哪些?
  • wordpress分类展示插件seo怎么优化排名
  • 自己做网站服务器要多少钱今天重大国际新闻
  • 做网站的思想体会怎么接游戏推广的业务
  • 网站建设哪个软件好正规seo一般多少钱
  • cmd iis重启单个网站东莞网站制作公司联系方式
  • 网站建设 软件有哪些方面百度移动开放平台
  • 长春火车站到龙嘉机场怎么走小说推文万能关键词
  • 苏州做商城网站设计友情链接交易网站源码
  • 国外网站做家具哪个好站内seo优化
  • 怎样将视频放在网站里做北京网站seo公司
  • 郑州做网站九零后疫情最新政策最新消息
  • 网站关键词多少个合适网页设计实训报告
  • 网站开发的实验报告网络营销推广方案ppt
  • 三级域名网络seo推广培训
  • 收到短信说备案被退回但工信部网站上正常啊app投放推广
  • 都匀网站开发的公司seo查询5118
  • 网站建设方案书 百度淄博seo网站推广
  • 成都微信小程序定制开发抚顺seo
  • wordpress添加活动seo优化的优点