{"id":2811,"date":"2019-09-16T03:33:14","date_gmt":"2019-09-16T03:33:14","guid":{"rendered":""},"modified":"2019-09-16T11:33:56","modified_gmt":"2019-09-16T03:33:56","slug":"%e5%9f%ba%e4%ba%8es1c33l11%e8%8a%af%e7%89%87%e7%9a%84%e5%b5%8c%e5%85%a5%e5%bc%8fusb%e5%8f%8c%e5%90%91%e9%80%9a%e4%bf%a1%e7%b3%bb%e7%bb%9f%e8%ae%be%e8%ae%a1","status":"publish","type":"post","link":"http:\/\/www.szryc.com\/?p=2811","title":{"rendered":"\u57fa\u4e8eS1C33L11\u82af\u7247\u7684\u5d4c\u5165\u5f0fUSB\u53cc\u5411\u901a\u4fe1\u7cfb\u7edf\u8bbe\u8ba1"},"content":{"rendered":"
\n\tUSB<\/u>\u4f5c\u4e3a\u4e00\u79cd\u4e32\u884c\u901a\u4fe1\u603b\u7ebf\uff0c\u91c7\u7528\u4e3b\u4ece\u5f0f\u901a\u4fe1\u65b9\u5f0f\uff0c\u4ece\u8bbe\u5907\u53ea\u80fd\u88ab\u52a8\u54cd\u5e94\u6765\u81ea\u4e3b\u8bbe\u5907\u7684\u8bf7\u6c42\uff0c\u4e0d\u80fd\u4e3b\u52a8\u53d1\u8d77\u8bf7\u6c42\u3002\u968f\u7740\u5d4c\u5165\u5f0f\u7cfb\u7edf\u6280\u672f\u7684\u53d1\u5c55\uff0c\u5bf9\u4ea4\u4e92\u6027\u64cd\u4f5c\u8981\u6c42\u8d8a\u6765\u8d8a\u8feb\u5207\uff0c\u800c\u91c7\u7528USB\u53cc\u5411\u901a\u4fe1\u53ef\u4ee5\u5f88\u597d\u5730\u89e3\u51b3\u4e0a\u8ff0\u95ee\u9898\u3002\u672c\u6587\u4ecb\u7ecd\u4e00\u79cd\u57fa\u4e8eS1C33L11\u82af\u7247\u5229\u7528\u5d4c\u5165\u5f0f\u64cd\u4f5c\u7cfb\u7edf\u7684\u540c\u6b65\u673a\u5236\u901a\u8fc7\u5bf9\u5faa\u73af\u961f\u5217\u53ca\u81ea\u5b9a\u4e49\u63a7\u5236\u5305\u7684\u64cd\u4f5c\u6765\u5b9e\u73b0\u53cc\u5411\u901a\u4fe1\u7684\u65b9\u6cd5\u3002<\/p>\n
\n\t1\u5d4c\u5165\u5f0f\u64cd\u4f5c\u7cfb\u7edf\u4e2dUSB\u53cc\u5411\u901a\u4fe1\u7cfb\u7edf\u6574\u4f53\u5c42\u6b21\u7ed3\u6784<\/p>\n
\n\t\u5d4c\u5165\u5f0f\u64cd\u4f5c\u7cfb\u7edf\u4e2dUSB\u53cc\u5411\u901a\u4fe1\u7cfb\u7edf\u6574\u4f53\u5c42\u6b21\u7ed3\u6784\u5982\u56fe1\u6240\u793a\u3002<\/p>\n
\n\t<\/p>\n
\n\t2\u786c\u4ef6\u7cfb\u7edf<\/p>\n
\n\t2.1S1C33L11\u53ca\u5176USB BLOCK\u7b80\u4ecb<\/p>\n
\n\tS1C33L11\u662fEPSON<\/u>\u516c\u53f8\u768432\u4f4d\u9ad8\u901f\uff0c\u4f4e\u529f\u8017\uff0c\u4f4e\u7535\u538bMCU<\/u>\u3002\u4ed6\u662f\u4ee5C33 STD 32\u4f4dRISC<\/u> CPU<\/u>\u4e3a\u6838\u5fc3\uff0c\u529f\u80fd\u5f3a\u5927\uff0c\u9664\u4e00\u822c\u5916\u56f4\u8bbe\u5907\u5916\u6709LCD\u63a7\u5236\u5668\uff0cCamera\u63a5\u53e3<\/u>\uff0cJPEG\u7f16\u7801\uff0cUSB1.1\u529f\u80fd\u63a7\u5236\u5668\uff0cMAC\uff08SPI<\/u>\u6a21\u5f0f\uff09\u63a5\u53e3\uff0cSmartMedia\u63a5\u53e3\uff0c\u8fd8\u5305\u62ec3\u4e2a\u632f\u8361\u7535\u8def<\/u>\u548c2\u4e2a\u9501<\/u>\u76f8\u73af<\/u>\uff08PLL\uff09\uff0c\u5185\u7f6e16kB RAM<\/u> \uff0c\u65e0ROM<\/u>\u3002<\/p>\n
\n\tS1C33L11\u5185\u5efa\u652f\u6301USB1.1\u534f\u8bae\u7684\u5168\u901f\u6a21\u5f0f\u3002\u652f\u6301\u63a7\u5236\u3001\u5757\u3001\u540c\u6b65\u548c\u4e2d\u65ad4\u79cd\u4f20\u8f93\u65b9\u5f0f\uff0c\u652f\u6301 4\u4e2a\u901a\u7528\u901a\u9053\uff08Epr\uff08r=a\uff0cb\uff0cc\uff0cd\uff09\uff09\u548c\u4e00\u4e2a\u63a7\u5236\u901a\u9053\uff08endpoint0\uff09\uff0c\u5e76\u4e3a\u6bcf\u4e2a\u901a\u9053\uff08endpoint\uff09\u63d0\u4f9b1 kB\u7684FIF<\/u>O\u3002<\/p>\n
\n\t2.2S1C33L11DMT01\u5f00\u53d1\u677f\u7b80\u4ecb<\/p>\n
\n\tS1C33L11DMT01\u5f00\u53d1\u677f\u91c7\u7528S1C33L11F00A1\u82af\u7247\u4e3a\u6838\u5fc3\uff0c\u5916\u63a52 MB RAM\uff0c32 MB FLASH\uff0c\u8fd8\u5e26\u6709STN TFT \u53cc\u5c4f\u5f69\u8272LCD\u7b49\uff0c\u6b64\u786c\u4ef6\u73af\u5883\u9002\u7528\u4e8e\u5404\u79cd\u5d4c\u5165\u5f0f\u64cd\u4f5c\u7cfb\u7edf\u7684\u8fd0\u884c\u53ca\u591a\u5a92\u4f53\u624b\u673a\u3001PDA\u7b49\u4ea7\u54c1\u7684\u5f00\u53d1\u3002\uff1f<\/p>\n
\n\t3USB\u53cc\u5411\u901a\u4fe1\u7684\u8bbe\u8ba1\u4e0e\u5b9e\u73b0<\/p>\n
\n\t\u672c\u6587USB\u53cc\u5411\u901a\u4fe1\u5728\u57fa\u672c\u4f20\u8f93\u65b9\u5f0f\u4e0a\u91c7\u7528USB\u5757\u4f20\u8f93\uff3b1\uff3d\u3002\u4ed6\u7531USB\u521d\u59cb\u5316\u3001USB\u4e2d\u65ad\u5904\u7406\u3001\u63a7\u5236\u4f20\u8f93\u548c\u5757\u4f20\u8f93\u51e0\u90e8\u5206\u7ec4\u6210\uff3b2\uff3d\u3002\u5728\u5b9e\u73b0\u53cc\u5411\u901a\u4fe1\u4e0a\uff0c\u5177\u4f53\u901a\u4fe1\u673a\u5236\u662f\uff1a\u5d4c\u5165\u5f0f\u5e94\u7528\u7a0b\u5e8f\u901a\u8fc7\u8bfb\u5199\u5faa\u73af\u961f\u5217\u548c\u4fe1\u53f7\u91cf\u72b6\u6001\u4e0eUSB \u786c\u4ef6\u6a21\u5757\u4e2d\u7684OUT \u548cIN FIFO\u76f8\u4e92\u901a\u4fe1\uff0c\u800cUSB\u4e0b\u4f4d\u673a\u4e0e\u4e0a\u4f4d\u673a\uff08PC\uff09\u7684\u8bfb\u5199\u901a\u4fe1\u5219\u901a\u8fc7\u4e0a\u4f4d\u673a\u5bf9\u63a7\u5236\u5305\u7684\u8bfb\u5199\u6765\u5b9e\u73b0\uff0c\u6700\u540e\u901a\u8fc7\u5faa\u73af\u961f\u5217\u3001\u4fe1\u53f7\u91cf\u3001\u63a7\u5236\u53053\u8005\u7ed3\u5408\u8fbe\u5230USB\u53cc\u5411\u901a\u4fe1\u7684\u76ee\u7684\u3002<\/p>\n
\n\t3.1USB\u53cc\u5411\u901a\u4fe1\u56fa\u4ef6\u7a0b\u5e8f\u7684\u8bbe\u8ba1\u4e0e\u5b9e\u73b0<\/p>\n
\n\t\uff081\uff09\u5faa\u73af\u961f\u5217<\/p>\n
\n\t\u91c7\u7528IN\u4f20\u8f93\u4e00\u4e2a\u5faa\u73af\u961f\u5217\uff0cOUT\u4f20\u8f93\u4e00\u4e2a\u5faa\u73af\u961f\u5217\uff08\u4ee5\u4e0b\u7b80\u79f0\u961f\u5217\uff09\uff0c\u6bcf\u961f\u5217\u52a8\u6001\u5206\u914d32 kB\u3002OUT\u961f\u5217\u505a\u4e3aOUT\u4f20\u8f93\u65f6\u7684\u4e8c\u7ea7\u7f13\u51b2\uff0c\u5373OUT\u4f20\u8f93\u65f6\u7684FIFO\u7684\u6570\u636e\u5fc5\u987b\u5148\u653e\u5165OUT\u961f\u5217\u624d\u80fd\u7531\u5d4c\u5165\u5f0f\u64cd\u4f5c\u7cfb\u7edf\u8bfb\u5199;IN\u961f\u5217\u505a\u4e3aIN\u4f20\u8f93\u65f6\u7684\u4e8c\u7ea7\u7f13\u51b2\uff0c\u5373IN\u4f20\u8f93\u65f6\u7684FIFO\u6570\u636e\u5fc5\u987b\u6765\u81eaIN\u961f\u5217;\u5d4c\u5165\u5f0f\u64cd\u4f5c\u7cfb\u7edf\u53ea\u5bf9\u4e8c\u7ea7\u7f13\u51b2\u8fdb\u884c\u8bfb\u5199\uff0c\u64cd\u4f5c\u7cfb\u7edf\u5bf9\u961f\u5217\u7684\u7ba1\u7406\u662f\u91c7\u7528\u4fe1\u53f7\u91cf\u901a\u77e5\u673a\u5236\u6765\u5b9e\u73b0\u3002<\/p>\n
\n\t\uff082\uff09\u63a7\u5236\u5305<\/p>\n
\n\t\u4e3a\u5b9e\u73b0\u53cc\u5411\u901a\u4fe1\uff0c\u89c4\u5b9a\u4e00\u79cd\u63a7\u5236\u5305\u683c\u5f0f\uff0c\u8bfb\u63a7\u5236\u5305\u662f\u5728USB\u534f\u8bae\u4e4b\u5916\u81ea\u5b9a\u4e49\u7684\u3002<\/p>\n
\n\t\u63a7\u5236\u5305\u56fa\u5b9a\u4e3a5\u5b57\u8282\u3002\u4ece\u5de6\u5230\u53f3\u7b2c\u4e00\u5b57\u8282\u4e3a\u72b6\u6001\u5b57\uff0c\u5269\u4e0b4\u5b57\u8282\u4f20\u9001\u8981\u6536\u53d1\u7684\u6570\u636e\u5b57\u8282\u6570\u3002\u5f53\u63a7\u5236\u5305\u7531\u4e0a\u4f4d\u673a\u53d1\u51fa\u65f6\uff0c\u72b6\u6001\u5b57\u89c4\u5b9a\u67093\u79cd\uff1a0x4F\uff1a\u4e0a\u4f4d\u673a\u8bf7\u6c42OUT\u4f20\u8f93\uff0c0x49\uff1a\u4e0a\u4f4d\u673a\u8bf7\u6c42IN\u4f20\u8f93\uff0c0x52\uff1a\u4e0a\u4f4d\u673a\u8bf7\u6c42\u8bfb\u53d6\u4e0b\u4f4d\u673a\u72b6\u6001;\u5f53\u4e0a\u4f4d\u673a\u6536\u5230\u63a7\u5236\u5305\u65f6\uff0c\u72b6\u6001\u5b57\u89c4\u5b9a\u67095\u79cd\uff1a0 x00\uff1aUSB\u7a7a\u95f2\u6001\uff0c0x01\uff1a\u4e0b\u4f4d\u673aOUT\u5faa\u73af\u961f\u5217\u6ee1\uff08\u5373OUT\u8d85\u65f6\uff09\uff0c0x02\uff1a\u4e0b\u4f4d\u673aIN\u5faa\u73af\u961f\u5217\u7a7a\uff08\u5373IN\u8d85\u65f6\uff09\uff0c0x04\uff1aOUT\u4f20\u9001\u6210\u529f\uff0c0x08\uff1aIN\u4f20\u9001\u6210\u529f\u3002<\/p>\n
\n\t\uff083\uff09\u5d4c\u5165\u5f0f\u64cd\u4f5c\u7cfb\u7edf\u7aef\u5e94\u7528\u7a0b\u5e8f\u8bfb\u5199USB\u8fc7\u7a0b<\/p>\n
\n\t\u8bfb\u51fd\u6570\uff1avoid ReadUSB\uff08unsigned char * ReadBuffer\uff0c DWORD size\uff09\u51fd\u6570\uff1a<\/p>\n
\n\t\u529f\u80fd\uff1a\u5d4c\u5165\u5f0f\u7cfb\u7edf\u5e94\u7528\u7a0b\u5e8f\u901a\u8fc7USB\u63a5\u53e3\u8bfb\u53d6\u4e0a\u4f4d\u673a\uff08PC\uff09\u7684\u6570\u636e\u3002<\/p>\n
\n\t\u53c2\u6570\u8bf4\u660e\uff1aunsigned char*ReadBuffer\u5b58\u653e\u6570\u636e\u7684\u6307\u9488\uff0cDWORD size\u4e3a\u8981\u8bfb\u51fa\u7684\u6570\u636e\u7684\u5c3a\u5bf8\uff08\u5355\u4f4d\uff1aB\uff09\u3002<\/p>\n
\n\t\u5b9e\u73b0\u8fc7\u7a0b\uff1a\u9996\u5148\u5224\u65ad\u5faa\u73af\u961f\u5217\u662f\u5426\u4e3a\u7a7a\uff0c\u4e0d\u4e3a\u7a7a\u5219\u5224\u65ad\u81ea\u8eab\u4fe1\u53f7\u91cf\u662f\u5426\u53ef\u7528\uff0c\u82e5\u53ef\u7528\uff0c\u5219\u4ece\u961f\u5217\u4e2d\u8bfb\u53d6\u4e00\u5b57\u8282\uff0c\u6bcf\u8bfb\u4e00\u5b57\u8282\u540e\u5411USB\u4efb\u52a1\u4e2d\u7684BulkOutGet\u51fd\u6570\uff08\u76f4\u63a5\u8bfb\u53d6OUT\u7684FIFO\u51fd\u6570\uff09\u53d1\u51fa\u4e00\u4e2a\u4fe1\u53f7\u91cf\uff0c\u901a\u77e5BulkOutGet\u51fd\u6570\u961f\u5217\u6b64\u65f6\u53ef\u4ee5\u5411OUT\u5faa\u73af\u961f\u5217\u4e2d\u5199\u5165\u6570\u636e\uff0c\u63a5\u7740\u91cd\u65b0\u5224\u65ad\uff0c\u4f9d\u6b21\u9010\u5b57\u8282\u4eceOUT\u5faa\u73af\u961f\u5217\u4e2d\u8bfb\u53d6\u6570\u636e\uff0c\u76f4\u5230\u8bfb\u5b8c\u8981\u6c42\u6570\u636e\u5927\u5c0f\u4e3a\u6b62\u3002\u5f53\u5faa\u73af\u961f\u5217\u4e3a\u7a7a\u65f6\uff0c\u9996\u5148\u53d1\u4e00\u4e2a\u4fe1\u53f7\u91cf\uff0c\u901a\u77e5BulkOutGet\u51fd\u6570\u5e94\u5411\u672c\u961f\u5217\u4e2d\u5199\u5165\u6570\u636e\u4e86\uff0c\u7136\u540e\u590d\u4f4d\u81ea\u8eab\u4fe1\u53f7\u91cf\uff0c\u63a5\u7740\u8c03\u7528\u7b49\u5f85\u4fe1\u53f7\u91cf\u7684\u51fd\u6570\uff0c\u76f4\u5230\u4fe1\u53f7\u91cf\u5230\u65f6\u624d\u63a5\u7740\u8bfb\u53d6\u3002\u82e5\u8d85\u65f6\uff0c\u5219\u5411\u5d4c\u5165\u5f0f\u64cd\u4f5c\u7cfb\u7edf\u53d1\u51fa\u8d85\u65f6\u901a\u77e5\uff0c\u540c\u65f6\u901a\u8fc7\u5411\u63a7\u5236\u5305\u4e2d\u5199\u5165\u8d85\u65f6\u72b6\u6001\uff080x01\uff09\u6765\u5411\u4e0a\u4f4d\u673a\uff08PC\uff09\u53d1\u51fa\u8d85\u65f6\u4fe1\u53f7\u3002<\/p>\n
\n\t\u5199\u51fd\u6570\uff1avoid Write<\/u>USB\uff08unsigned char*Write Buffer\uff0cDWORD size\uff09\u51fd\u6570\uff1a<\/p>\n
\n\t\u529f\u80fd\uff1a\u5d4c\u5165\u5f0f\u7cfb\u7edf\u5e94\u7528\u7a0b\u5e8f\u901a\u8fc7USB\u63a5\u53e3\u5411\u4e0a\u4f4d\u673a\uff08PC\uff09\u53d1\u9001\u6570\u636e\u3002<\/p>\n
\n\t\u53c2\u6570\u8bf4\u660e\uff1aunsigned char * WriteBuffer \u5b58\u653e\u6570\u636e\u7684\u6307\u9488\uff0cDWORD size\u4e3a\u8981\u5199\u5165\u7684\u6570\u636e\u7684\u5c3a\u5bf8\uff08\u5355\u4f4d\uff1aB\uff09\u3002<\/p>\n
\n\t\u5b9e\u73b0\u8fc7\u7a0b\uff1a\u9996\u5148\u5224\u65ad\u5faa\u73af\u961f\u5217\u662f\u5426\u6ee1\uff0c\u4e0d\u4e3a\u6ee1\u5219\u5224\u65ad\u81ea\u8eab\u4fe1\u53f7\u91cf\u662f\u5426\u53ef\u7528\uff0c\u82e5\u53ef\u7528\uff0c\u5219\u5411\u961f\u5217\u4e2d\u5199\u5165\u4e00\u5b57\u8282\uff0c\u6bcf\u5199\u5165\u4e00\u5b57\u8282\u540e\u5411USB\u4efb\u52a1\u4e2d\u7684BulkInDataSet\uff08\u76f4\u63a5\u5199IN\u7684FIFO\u51fd\u6570\uff09\u51fd\u6570\u53d1\u51fa\u4e00\u4e2a\u4fe1\u53f7\u91cf\u901a\u77e5\u6b64\u51fd\u6570\u6b64\u65f6\u53ef\u4ee5\u4eceIN\u5faa\u73af\u961f\u5217\u4e2d\u8bfb\u53d6\u6570\u636e;\u7136\u540e\u63a5\u7740\u91cd\u65b0\u5224\u65ad\u4f9d\u6b21\u9010\u5b57\u8282\u5411IN\u5faa\u73af\u961f\u5217\u5199\u5165\u6570\u636e\uff0c\u76f4\u5230\u5199\u5b8c\u8981\u6c42\u6570\u636e\u5927\u5c0f\u7684\u6570\u636e\u4e3a\u6b62\u3002\u5f53\u5faa\u73af\u961f\u5217\u6ee1\u65f6\uff0c\u5148\u53d1\u4e00\u4e2a\u4fe1\u53f7\u91cf\u901a\u77e5BulkInDataSet\u51fd\u6570\u5e94\u4ece\u961f\u5217\u4e2d\u53d6\u8d70\u6570\u636e\uff0c\u518d\u590d\u4f4d\u81ea\u8eab\u4fe1\u53f7\u91cf\uff0c\u63a5\u7740\u8c03\u7528\u7b49\u5f85\u4fe1\u53f7\u91cf\u7684\u51fd\u6570\uff0c\u76f4\u5230\u4fe1\u53f7\u91cf\u5230\u65f6\u624d\u63a5\u7740\u5199\u5165\uff0c\u82e5\u8d85\u65f6\uff0c\u5219\u5411\u5d4c\u5165\u5f0f\u64cd\u4f5c\u7cfb\u7edf\u53d1\u51fa\u8d85\u65f6\u901a\u77e5\uff0c\u540c\u65f6\u901a\u8fc7\u5411\u63a7\u5236\u5305\u4e2d\u5199\u5165\u8d85\u65f6\u72b6\u6001\uff080x02\uff09\u6765\u5411\u4e0a\u4f4d\u673a\uff08PC\uff09\u53d1\u51fa\u8d85\u65f6\u4fe1\u53f7\u3002<\/p>\n
\n\t\uff084\uff09 USB\u5757\u4f20\u8f93\u51fd\u6570<\/p>\n
\n\tUSB\u5757\u4f20\u8f93\u51fd\u6570\u662f\u76f4\u63a5\u548cUSB\u786c\u4ef6\u6253\u4ea4\u9053\u7684\u51fd\u6570\uff0c\u4ed6\u4eec\u76f4\u63a5\u8bfb\u53d6IN\u548cOUT\u4f20\u8f93\u901a\u9053\u7684FIFO\u3002voi d BulkInDataSet\uff08void\uff09\uff1a\u5176\u529f\u80fd\u662fIN\u4f20\u8f93\u8fc7\u7a0b\uff0c\u5373\u4eceIN\u5faa\u73af\u961f\u5217\u4e2d\u8bfb\u53d6\u6570\u636e\u5e76\u5411IN FIFO\u4e2d\u5199\u5165\u6570\u636e\uff0c\u518d\u5bf9\u5d4c\u5165\u5f0f\u64cd\u4f5c\u7cfb\u7edf\u4fe1\u53f7\u91cf\u505a\u76f8\u5e94\u5904\u7406\u3002<\/p>\n
\n\tvoid BulkOutDataGet\uff08void\uff09\u5176\u529f\u80fd\u662fOUT\u4f20\u8f93\u8fc7\u7a0b\uff0c\u5373\u4eceOUT FIFO\u4e2d\u8bfb\u51fa\u6570\u636e\u5e76\u5411OUT\u5faa\u73af\u961f\u5217\u4e2d\u5199\u5165\u6570\u636e\uff0c\u518d\u5bf9\u5d4c\u5165\u5f0f\u64cd\u4f5c\u7cfb\u7edf\u4fe1\u53f7\u91cf\u505a\u76f8\u5e94\u5904\u7406\u3002<\/p>\n
\n\t\uff085\uff09 \u5d4c\u5165\u5f0f\u64cd\u4f5c\u7cfb\u7edfUSB \u4efb\u52a1\u8c03\u7528\u51fd\u6570<\/p>\n
\n\tvoid SystemI<\/u>nit\uff08void\uff09\uff1aMCU\u521d\u59cb\u5316\uff08\u5fae\u5904\u7406\u5668\u5404\u63a7\u5236\u5bc4\u5b58\u5668<\/u>\u548c\u72b6\u6001\u521d\u59cb\u5316\u8fc7\u7a0b\uff09<\/p>\n
\n\tvoid USBInit\uff08void\uff09\uff1aUSB\u521d\u59cb\u5316\uff08\u5305\u62ec\u5bf9\u5faa\u73af\u961f\u5217\u5206\u914d\u5185\u5b58\u7b49\uff09<\/p>\n
\n\tvoid USBThread\uff08void\uff09\uff1aUSB\u8fd0\u884c\u4f53\uff08USB\u5de5\u4f5c\u8fc7\u7a0b\u5bf9USB\u4e2d\u65ad\u8fdb\u884c\u5904\u7406\u4e3b\u8981\u5305\u62ecUSB\u5757\u4f20\u8f93\u51fd \u6570\u3001USB\u4e2d\u65ad\u72b6\u6001\u5206\u6790\u5904\u7406\u7b49\uff09\u3002<\/p>\n
\n\tvoid FreeUSB\uff08void\uff09\uff1a\u5173\u95edUSB\u548c\u91ca\u653e\u7531malloc\u51fd\u6570\u5206\u914d\u7684\u5faa\u73af\u961f\u5217\u6240\u5360\u5185\u5b58<\/p>\n
\n\t3.2\u4e0a\u4f4d\u673a\uff08PC\uff09\u90e8\u5206<\/p>\n
\n\tUSB\u51fd\u6570\u5c42\uff08USBD\u53caHCD\uff09\u7531Windows98\u63d0\u4f9b\uff0c\u8d1f\u8d23\u7ba1\u7406USB\u8bbe\u5907\u9a71\u52a8\u7a0b\u5e8f\u4e0eUSB\u63a7\u5236\u5668\u4e4b\u95f4\u7684\u901a\u4fe1\u3001\u52a0\u8f7d\u53ca\u5378\u8f7dUSB\u9a71\u52a8\u7a0b\u5e8f\u7b49\u3002\u5177\u4f53\u65b9\u6cd5\u662f\u901a\u8fc7DriverWorks\u8f6f\u4ef6\u751f\u6210\u4e0a\u4f4d\u673a\uff08PC\uff09\u673a\u7aefUSB\u9a71\u52a8\u7a0b\u5e8f\u6a21\u677f\uff3b3\uff3d\uff0c\u6839\u636e\u4e0b\u4f4d\u673a\u7684\u60c5\u51b5\u5904\u7406\u76f8\u5e94\u7684\u8bfb\u5199\u90e8\u5206\uff0c\u6700\u540e\u901a\u8fc7\u5c01\u88c5\u57fa\u672cAPI\u51fd\u6570ReadFile\uff0cWriteFile\u6765\u5b9e\u73b0\u7528\u6237\u6001\u5e94\u7528\u7a0b\u5e8f\u4e0ePC\u673aUSB\u9a71\u52a8\u7a0b\u5e8f\u7684\u9694\u79bb\uff0c\u4f7fPC\u7684\u5e94\u7528\u5c42\u5bf9USB\u7684\u4f7f\u7528\u5982\u540c\u5bf9\u4e32\u53e3\u7684\u4f7f\u7528\u4e00\u6837\u65b9\u4fbf\uff0c\u7ed9\u7528\u6237\u6001\u5e94 \u7528\u7a0b\u5e8f\u63d0\u4f9b\u6709\u4e863\u4e2a\u63a5\u53e3\u51fd\u6570\uff1a<\/p>\n
\n\tunsigned char Read\uff08void *pReadBuffer\uff0cDWORD Size\uff09\uff1a\u4ece\u4e0b\u4f4d\u673a\u4e2d\u8bfb\u53d6\u6570\u636e<\/p>\n
\n\t\u53c2\u6570\u8bf4\u660e\uff1avoid *pBuffer\uff1a\u5b58\u653e\u8bfb\u53d6\u6570\u636e\u7684\u7f13\u51b2\uff0cDWORD Size\uff1a\u9700\u8bfb\u53d6\u6570\u636e\u7684\u5927\u5c0f\uff08\u5b57\u8282\u6570\uff09<\/p>\n
\n\t\u8fd4\u56de\u503c\uff1a<\/p>\n
\n\t0x10\uff1a\u9a71\u52a8\u51fa\u9519\uff08\u6307Windows USB \u9a71\u52a8\u7a0b\u5e8f\u51fa\u9519\uff09<\/p>\n
\n\t0x20\uff1a\u5185\u5b58\u7a7a\u95f4\u4e0d\u8db3\uff1f<\/p>\n
\n\t0x30\uff1a\u8bf7\u6c42\u7684\u6570\u636e\u5927\u5c0f\u4e3a0 B<\/p>\n
\n\t0x02\uff1a\u4e0b\u4f4d\u673a\u53d1\u9001\u8f6f\u8d85\u65f6<\/p>\n
\n\t0x08\uff1a\u8bfb\u53d6\u6210\u529f<\/p>\n
\n\tunsigned char Write\uff08void *pWriteBuffer\uff0cDWORD Size\uff09\uff1a\u53d1\u9001\u6570\u636e\u5230\u4e0b\u4f4d\u673a<\/p>\n
\n\t\u53c2\u6570\u8bf4\u660e\uff1avoid *pBuffer; \u5b58\u653e\u5199\u5165\u6570\u636e\u7684\u7f13\u51b2\uff0cDWORD Size; \u9700\u5199\u5165\u6570\u636e\u7684\u5927\u5c0f\uff08\u5b57\u8282\u6570\uff09\u3002<\/p>\n
\n\t\u8fd4\u56de\u503c\uff1a<\/p>\n
\n\t0x10\uff1aUSB\u9a71\u52a8\u51fa\u9519\uff08Windows USB \u9a71\u52a8\u7a0b\u5e8f\u51fa\u9519\uff09<\/p>\n
\n\t0x20\uff1a\u5185\u5b58\u7a7a\u95f4\u4e0d\u8db3<\/p>\n
\n\t0x30\uff1a\u8bf7\u6c42\u7684\u6570\u636e\u5927\u5c0f\u4e3a0 B<\/p>\n
\n\t0x01\uff1a\u4e0b\u4f4d\u673a\u8bfb\u53d6\u6570\u636e\u8f6f\u8d85\u65f6<\/p>\n
\n\t0x04\uff1a\u53d1\u9001\u6210\u529f<\/p>\n
\n\tvoid RequestUSB\uff08void *pRequestBuffer\uff0cDWORD Size=5\uff09\uff1a\u8bfb\u53d6\u4e0b\u4f4d\u673a\u8fd4\u56de\u7684\u64cd\u4f5c\u72b6\u6001\u3002<\/p>\n
\n\t\u53c2\u6570\u8bf4\u660e\uff1avoid *pRequestBuffer\uff1a5 B\u63a7\u5236\u5305\u7f13\u51b2<\/p>\n
\n\t\u5176\u4e2d\u6bcf\u6b21Read\u6216Write\u51fd\u6570\u7684\u8c03\u7528\u88ab\u5206\u4e3a\u82e5\u5e72\u6b21\u8bfb\/\u5199\u53d1\u9001\u3002\u5177\u4f53\u5904\u7406\u662f\uff1a \u8bbe\u5f85\u8bfb\u5199\u7684\u6570\u636e\u5b57\u8282\u6570\u4e3aX B\uff0c\u5f53X=5B\u65f6\uff0c\u5206\u5272\u4e3aX1=4 B\u548cX2=1 B\u4e24\u6b21\u53d1\u9001\uff08\u7531\u4e8e\u81ea\u5b9a\u4e49\u5305\u662f5 B\uff0c\u4e3a\u4e86\u4e0e\u81ea\u5b9a\u4e49\u63a7\u5236\u5305\u533a\u5206\u5f00\uff09;\u5f535 B16 kB\u65f6\u5219\u5206\u5272\u4ee516kB\u4e3a\u5355\u4f4d\u7684\u6570\u636e\u8fdb\u884c\u53d1\u9001\uff0c\u4e0d\u8db316 kB\u7684\u90e8\u5206\u518d\u53d1\u9001\u4e00\u6b21\u3002\u6bcf\u6b21\u8bfb\/\u5199\u53d1\u9001\u52063\u4e2a\u9636\u6bb5\uff1a\u53d1\u63a7\u5236\u5305\uff0c\u8bfb\/\u5199\u6570\u636e\uff0c\u8bfb\u63a7\u5236\u5305\u72b6\u6001\u3002<\/p>\n
\n\t4\u7ed3\u8bed<\/p>\n
\n\t\u57fa\u4e8eS1C33L11\u82af\u7247\u5728\u5d4c\u5165\u5f0f\u64cd\u4f5c\u7cfb\u7edf\u57fa\u7840\u4e0a\u5b9e\u73b0\u7684USB\u53cc\u5411\u901a\u4fe1\u4e25\u683c\u9075\u5faaUSB1.1\u534f\u8bae\uff0c\u5145\u5206\u5229\u7528\u4e86S1C33L11\u82af\u7247\u7684\u5185\u7f6e\u529f\u80fd\u548c\u5d4c\u5165\u5f0f\u64cd\u4f5c\u7cfb\u7edf\u7684\u4f5c\u7528\uff0c\u5177\u6709\u4ea4\u4e92\u4f5c\u7528\u5f3a\u3001\u5d4c\u5165\u5f0f\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u8bbe\u5907\u65e0\u5173\u6027\u597d\u7684\u7279\u70b9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
USB \u4f5c\u4e3a\u4e00\u79cd\u4e32\u884c\u901a\u4fe1\u603b\u7ebf\uff0c\u91c7\u7528\u4e3b\u4ece\u5f0f\u901a\u4fe1\u65b9\u5f0f\uff0c\u4ece\u8bbe\u5907\u53ea\u80fd\u88ab\u52a8\u54cd\u5e94\u6765\u81ea\u4e3b\u8bbe\u5907\u7684\u8bf7\u6c42\uff0c\u4e0d\u80fd\u4e3b\u52a8\u53d1\u8d77\u8bf7\u6c42\u3002\u968f\u7740\u5d4c\u5165\u5f0f\u7cfb\u7edf\u6280\u672f\u7684\u53d1\u5c55\uff0c\u5bf9\u4ea4\u4e92\u6027\u64cd\u4f5c\u8981\u6c42\u8d8a\u6765\u8d8a\u8feb\u5207\uff0c\u800c\u91c7\u7528US<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"_links":{"self":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/2811"}],"collection":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2811"}],"version-history":[{"count":0,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/2811\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2811"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2811"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2811"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}