久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费
標題:
經測試利用STM32實現(xiàn)的USB Dual RS485設備可直接使用在64位的win10預覽版中,自動...
[打印本頁]
作者:
xiaos
時間:
2015-4-4 01:46
標題:
經測試利用STM32實現(xiàn)的USB Dual RS485設備可直接使用在64位的win10預覽版中,自動...
設備驅動經過兩次自動搜索和安裝,廉價的STM32F1芯片實現(xiàn)了雙路的USB轉RS485通信硬件橋,驅動是微軟自家的,
其中一路信號在大蝦開發(fā)板上通信測試通過,大蝦開發(fā)板帶有CH341電路,這個芯片的驅動也是自動安裝的。
作為一個符合微軟標準的USB復合設備(
USB composite device
),本人設計的這款USB智能通訊產品,能被xpsp3, win7, win10所支持。
建議使用比較新的系統(tǒng),在linux系統(tǒng)下,測試只能支持一個。
USB串行設備的配置描述常量數(shù)組如下所示,該描述不涉及代碼部分,需要了解USB通訊協(xié)議。雖說是落后的USB1.1,可以滿足常規(guī)
工作的需求。國內的專用芯片只有USB1.1全速的,USB2.0高速或USB3.0國內沒有芯片可用,意法半導體的STM32F1或STM32L1可
替代國內專用芯片的大部分功能,關鍵是還能實現(xiàn)智能通訊,專用芯片不能編程,功能太單一。
const uint8_t Virtual_Com_Port_ConfigDescriptor[] =
{
/*Configuation Descriptor*/
0x09, /* bLength: Configuation Descriptor size */
USB_CONFIGURATION_DESCRIPTOR_TYPE, /* bDescriptorType: Configuration */
VIRTUAL_COM_PORT_SIZ_CONFIG_DESC, /* wTotalLength:no of returned bytes */
0x00,
0x04, /* bNumInterfaces: 4 interface */
0x01, /* bConfigurationValue: Configuration value */
0x00, /* iConfiguration: Index of string descriptor describing the configuration */
0xC0, /* bmAttributes: self powered */
0x32, /* MaxPower 100 mA */
/*IAD Configuation Descriptor*/
0x08, /* bLength: Interface Descriptor size */
0x0B, /* bDescriptorType: IAD */
0x00, /* bFirstInterface */
0x02, /* bInterfaceCount */
0x02, /* bFunctionClass: CDC */
0x02, /* bFunctionSubClass */
0x01, /* bFunctionProtocol */
0x02, /* iFunction */
/*Interface Descriptor*/
0x09, /* bLength: Interface Descriptor size */
USB_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType: Interface */
/* Interface descriptor type */
0x00, /* bInterfaceNumber: Number of Interface */
0x00, /* bAlternateSetting: Alternate setting */
0x01, /* bNumEndpoints: One endpoints used */
0x02, /* bInterfaceClass: Communication Interface Class */
0x02, /* bInterfaceSubClass: Abstract Control Model */
0x01, /* bInterfaceProtocol: Common AT commands */
0x00, /* iInterface: */
/*Header Functional Descriptor*/
0x05, /* bLength: Endpoint Descriptor size */
0x24, /* bDescriptorType: CS_INTERFACE */
0x00, /* bDescriptorSubtype: Header Func Desc */
0x10, /* bcdCDC: spec release number */
0x01,
/*Call Managment Functional Descriptor*/
0x05, /* bFunctionLength */
0x24, /* bDescriptorType: CS_INTERFACE */
0x01, /* bDescriptorSubtype: Call Management Func Desc */
0x00, /* bmCapabilities: D0+D1 */
0x01, /* bDataInterface: 1 */
/*ACM Functional Descriptor*/
0x04, /* bFunctionLength */
0x24, /* bDescriptorType: CS_INTERFACE */
0x02, /* bDescriptorSubtype: Abstract Control Management desc */
0x02, /* bmCapabilities */
/*Union Functional Descriptor*/
0x05, /* bFunctionLength */
0x24, /* bDescriptorType: CS_INTERFACE */
0x06, /* bDescriptorSubtype: Union func desc */
0x00, /* bMasterInterface: Communication class interface */
0x01, /* bSlaveInterface0: Data Class Interface */
/*Endpoint 2 Descriptor*/
0x07, /* bLength: Endpoint Descriptor size */
USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType: Endpoint */
0x82, /* bEndpointAddress: (IN2) */
0x03, /* bmAttributes: Interrupt */
VIRTUAL_COM_PORT_INT_SIZE, /* wMaxPacketSize: */
0x00,
0xFF, /* bInterval: */
/*Data class interface descriptor*/
0x09, /* bLength: Endpoint Descriptor size */
USB_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType: */
0x01, /* bInterfaceNumber: Number of Interface */
0x00, /* bAlternateSetting: Alternate setting */
0x02, /* bNumEndpoints: Two endpoints used */
0x0A, /* bInterfaceClass: CDC */
0x00, /* bInterfaceSubClass: */
0x00, /* bInterfaceProtocol: */
0x00, /* iInterface: */
/*Endpoint 3 Descriptor*/
0x07, /* bLength: Endpoint Descriptor size */
USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType: Endpoint */
0x03, /* bEndpointAddress: (OUT3) */
0x02, /* bmAttributes: Bulk */
VIRTUAL_COM_PORT_DATA_SIZE, /* wMaxPacketSize: */
0x00,
0x00, /* bInterval: ignore for Bulk transfer */
/*Endpoint 1 Descriptor*/
0x07, /* bLength: Endpoint Descriptor size */
USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType: Endpoint */
0x81, /* bEndpointAddress: (IN1) */
0x02, /* bmAttributes: Bulk */
VIRTUAL_COM_PORT_DATA_SIZE, /* wMaxPacketSize: */
0x00,
0x00, /* bInterval */
/*IAD Configuation Descriptor*/
0x08, /* bLength: Interface Descriptor size */
0x0B, /* bDescriptorType: IAD */
0x02, /* bFirstInterface */
0x02, /* bInterfaceCount */
0x02, /* bFunctionClass: CDC */
0x02, /* bFunctionSubClass */
0x01, /* bFunctionProtocol */
0x02, /* iFunction */
/*Interface Descriptor*/
0x09, /* bLength: Interface Descriptor size */
USB_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType: Interface */
/* Interface descriptor type */
0x02, /* bInterfaceNumber: Number of Interface */
0x00, /* bAlternateSetting: Alternate setting */
0x01, /* bNumEndpoints: One endpoints used */
0x02, /* bInterfaceClass: Communication Interface Class */
0x02, /* bInterfaceSubClass: Abstract Control Model */
0x01, /* bInterfaceProtocol: Common AT commands */
0x00, /* iInterface: */
/*Header Functional Descriptor*/
0x05, /* bLength: Endpoint Descriptor size */
0x24, /* bDescriptorType: CS_INTERFACE */
0x00, /* bDescriptorSubtype: Header Func Desc */
0x10, /* bcdCDC: spec release number */
0x01,
/*Call Managment Functional Descriptor*/
0x05, /* bFunctionLength */
0x24, /* bDescriptorType: CS_INTERFACE */
0x01, /* bDescriptorSubtype: Call Management Func Desc */
0x00, /* bmCapabilities: D0+D1 */
0x03, /* !! bDataInterface: */
/*ACM Functional Descriptor*/
0x04, /* bFunctionLength */
0x24, /* bDescriptorType: CS_INTERFACE */
0x02, /* bDescriptorSubtype: Abstract Control Management desc */
0x02, /* bmCapabilities */
/*Union Functional Descriptor*/
0x05, /* bFunctionLength */
0x24, /* bDescriptorType: CS_INTERFACE */
0x06, /* bDescriptorSubtype: Union func desc */
0x02, /* !! bMasterInterface: Communication class interface */
0x03, /* !! bSlaveInterface0: Data Class Interface */
/*Endpoint 2 Descriptor*/
0x07, /* bLength: Endpoint Descriptor size */
USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType: Endpoint */
0x85, /* bEndpointAddress: (IN2) */
0x03, /* bmAttributes: Interrupt */
VIRTUAL_COM_PORT_INT_SIZE, /* wMaxPacketSize: */
0x00,
0xFF, /* bInterval: */
/*Data class interface descriptor*/
0x09, /* bLength: Endpoint Descriptor size */
USB_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType: */
0x03, /* bInterfaceNumber: Number of Interface */
0x00, /* bAlternateSetting: Alternate setting */
0x02, /* bNumEndpoints: Two endpoints used */
0x0A, /* bInterfaceClass: CDC */
0x00, /* bInterfaceSubClass: */
0x00, /* bInterfaceProtocol: */
0x00, /* iInterface: */
/*Endpoint 3 Descriptor*/
0x07, /* bLength: Endpoint Descriptor size */
USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType: Endpoint */
0x06, /* bEndpointAddress: (OUT3) */
0x02, /* bmAttributes: Bulk */
VIRTUAL_COM_PORT_DATA_SIZE, /* wMaxPacketSize: */
0x00,
0x00, /* bInterval: ignore for Bulk transfer */
/*Endpoint 1 Descriptor*/
0x07, /* bLength: Endpoint Descriptor size */
USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType: Endpoint */
0x84, /* bEndpointAddress: (IN1) */
0x02, /* bmAttributes: Bulk */
VIRTUAL_COM_PORT_DATA_SIZE, /* wMaxPacketSize: */
0x00,
0x00 /* bInterval */
};
作者:
eriks626
時間:
2015-4-7 18:05
有其他的資料嗎〉
歡迎光臨 (http://www.zg4o1577.cn/bbs/)
Powered by Discuz! X3.1
主站蜘蛛池模板:
午夜午夜精品一区二区三区文
|
中文在线一区二区
|
国产资源一区二区三区
|
亚洲国产一区二区视频
|
亚洲a网
|
国产中文
|
欧美一极视频
|
黄色国产视频
|
中文字幕一区在线观看视频
|
青青99
|
一区二区三区不卡视频
|
欧美一区二区三区在线视频
|
国产 日韩 欧美 在线
|
欧美精品日韩精品国产精品
|
欧美三区在线观看
|
日韩爱爱网
|
韩国欧洲一级毛片
|
亚洲电影在线播放
|
操久久
|
精品中文字幕一区二区三区
|
亚洲国产精品日本
|
9久久精品
|
夜夜草导航
|
欧美精品一
|
97视频人人澡人人爽
|
亚洲自拍偷拍免费视频
|
成人精品在线视频
|
一区二区视频在线观看
|
久草久
|
久久免费大片
|
精品久久久久久
|
亚洲色图图片
|
99看片网
|
欧美日韩在线免费观看
|
欧美精品在线免费观看
|
日韩一区二区在线免费观看
|
欧美日产国产成人免费图片
|
久久高清精品
|
欧美一区视频
|
国产精品伦理一区
|
一区二区三区四区国产
|