CH375做HOST的程序.doc

  1. 1、本文档共18页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
CH375做HOST的程序

CH375做HOST的程序(C51) CH375做HOST的程序(C51) 作者:佚名????文章来源:佚名????点击数:????更新时间:2006-5-9???? 共享某网友CH375做HOST的程序,暂时可以和slaver通讯 /*************************************** ** USB 1.1 Host for CH375 ? ? ** ** 单片机用89C51 ? ? ? ? ? ? ? ** ****************************************/ /* 如果设备端不是CH37X,那么分析描述符 */ /* CH375中断为查询方式 */ #include string.h #include stdio.h #include intrins.h #include reg51.h #include CH375INC.H #define DELAY_START_value 1 ? /* 根据单片机的时钟选择延时初值 */ #define UNKNOWN_USB_DEVICE 0xF1 #define USB_INT_RET_NAK 0x2A /*,返回NAK */ typedef struct _USB_DEVICE_DESCRIPTOR { ? unsigned char bLength; ? unsigned char bDescriptorType; ? unsigned short bcdUSB; ? unsigned char bDeviceClass; ? unsigned char bDeviceSubClass; ? unsigned char bDeviceProtocol; ? unsigned char bMaxPacketSize0; ? unsigned short idVendor; ? unsigned short idProduct; ? unsigned short bcdDevice; ? unsigned char iManufacturer; ? unsigned char iProduct; ? unsigned char iSerialNumber; ? unsigned char bNumConfigurations; } USB_DEV_DESCR, *PUSB_DEV_DESCR; typedef struct _USB_CONFIG_DESCRIPTOR { ? unsigned char bLength; ? unsigned char bDescriptorType; ? unsigned short wTotalLength; ? unsigned char bNumInterfaces; ? unsigned char bConfigurationvalue; ? unsigned char iConfiguration; ? unsigned char bmAttributes; ? unsigned char MaxPower; } USB_CFG_DESCR, *PUSB_CFG_DESCR; typedef struct _USB_INTERF_DESCRIPTOR { ? unsigned char bLength; ? unsigned char bDescriptorType; ? unsigned char bInterfaceNumber; ? unsigned char bAlternateSetting; ? unsigned char bNumEndpoints; ? unsigned char bInterfaceClass; ? unsigned char bInterfaceSubClass; ? unsigned char bInterfaceProtocol; ? unsigned char iInterface; } USB_ITF_DESCR, *PUSB_ITF_DESCR; typedef struct _USB_ENDPOINT_DESCRIPTOR { ? unsigned char bLength; ? unsigned char bDescriptorType; ? unsigned char bEndpointAddress; ? unsigned char bmAttributes; ? unsigned short wMaxPacketSize; ? unsigned char bInterval; } USB_ENDP_DESCR, *PUSB_ENDP_DESCR; typedef struct _USB

文档评论(0)

liudao + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档