08 2013 档案
摘要:在学习Linux驱动的过程中,遇到一个宏叫做container_of。该宏定义在include/linux/kernel.h中,首先来贴出它的代码:/*** container_of - cast a member of a structure out to the containing structure* @ptr: the pointer to the member.* @type: the type of the container struct this is embedded in.* @member: the name of the member within the struc
阅读全文
摘要:学习USB协议笔记前面一章说明了USB描述符和USB枚举流程。三、USB包结构与包分类 1、 USB是串行通信,LSB在前,MSB在最后。不同的数据包包含不同的域,但其都是以同步域开始的。包结构如下所示: 同步域 --- 告知设备开始数据传输,并同步主机和设备的时钟 一般是00000001 高速设备31个0最后一个1 包标识符(PID) --- 在同步域最后一个1后开始,标示一个数据包的类型。 数据包:令牌包、数据包、握手包、特殊包。每种包还分为多种类型,见下图 包结束符(EOP) --- 2个SE0信号(SE0是指D+、D-同时保持为低电平) 2...
阅读全文

浙公网安备 33010602011771号