{"id":3659,"date":"2026-02-08T14:42:39","date_gmt":"2026-02-08T06:42:39","guid":{"rendered":"http:\/\/www.51cos.com\/?p=3659"},"modified":"2026-02-08T14:42:39","modified_gmt":"2026-02-08T06:42:39","slug":"%e5%bc%80%e5%8f%91%e4%b8%80%e6%ac%beusb%e5%b0%8f%e9%94%ae%e7%9b%98%ef%bc%8c%e4%b8%80%e9%94%ae%e6%89%93%e5%bc%80%e5%9b%ba%e5%ae%9a%e7%bd%91%e9%a1%b5","status":"publish","type":"post","link":"http:\/\/www.51cos.com\/?p=3659","title":{"rendered":"\u5f00\u53d1\u4e00\u6b3eUSB\u5c0f\u952e\u76d8\uff0c\u4e00\u952e\u6253\u5f00\u56fa\u5b9a\u7f51\u9875"},"content":{"rendered":"<pre data-language=HTML><code class=\"language-markup line-numbers\">\u6211\u60f3\u7528\u5357\u4eac\u6c81\u6052\uff08WCH\uff09MCU\u505a\u4e2a\u5c0f\u952e\u76d8\uff0c\u4e00\u952e\u6253\u5f00\u67d0\u4e2a\u56fa\u5b9a\u7684\u7f51\u9875\u6216\u8005\u8f6f\u4ef6\uff0c\u662f\u5426\u53ef\u884c\uff1fwindows\u4e0emac\u7535\u8111\u9ed8\u8ba4\u8f93\u5165\u6cd5\u9ed8\u8ba4\u53ef\u80fd\u662f\u4e2d\u6587\u6216\u8005\u82f1\u6587\uff0c\u4e0d\u8981\u9884\u5148\u88c5\u4efb\u4f55\u9a71\u52a8\u8f6f\u4ef6\uff0c\u4e5f\u4e0d\u8981\u7528\u6237\u63d0\u524d\u9884\u8bbe\u3002\n<\/code><\/pre>\n<p>\u8fd9\u662f\u4e00\u4e2a\u975e\u5e38\u7ecf\u5178\u4e14\u5177\u6709\u6311\u6218\u6027\u7684\u786c\u4ef6\u5de5\u7a0b\u95ee\u9898\u3002<strong>\u7ed3\u8bba\u662f\uff1a\u5b8c\u5168\u53ef\u884c<\/strong>\uff0c\u4f46\u4f60\u5fc5\u987b\u7ed5\u8fc7\u201c\u5b57\u7b26\u8f93\u5165\u201d\u8fd9\u4e2a\u5751\uff0c\u5229\u7528\u64cd\u4f5c\u7cfb\u7edf\u5e95\u5c42\u7684\u5feb\u6377\u952e\u903b\u8f91\u3002<\/p>\n<p>\u8981\u5b9e\u73b0\u201c\u4e0d\u88c5\u9a71\u52a8\u3001\u4e0d\u770b\u8f93\u5165\u6cd5\u72b6\u6001\u3001\u4e00\u952e\u6253\u5f00\u7f51\u9875\u201d\uff0c\u6211\u4eec\u9700\u8981\u9488\u5bf9 Windows \u548c macOS \u91c7\u7528\u4e24\u5957\u4e0d\u540c\u7684\u201c\u76f2\u6253\u201d\u7b56\u7565\u3002<\/p>\n<h3>\u6838\u5fc3\u75db\u70b9\uff1a\u4e3a\u4ec0\u4e48\u8f93\u5165\u6cd5\u662f\u201c\u6740\u624b\u201d\uff1f<\/h3>\n<p>\u5982\u679c\u4f60\u5355\u7eaf\u6a21\u62df\u952e\u76d8\u6572\u51fb <code>w-w-w-.-g-o-o-g-l-e<\/code>\uff0c\u5728\u4e2d\u6587\u8f93\u5165\u6cd5\u4e0b\uff0c\u7535\u8111\u4f1a\u8ba4\u4e3a\u4f60\u5728\u6253\u5b57\uff0c\u5c4f\u5e55\u4e0a\u4f1a\u51fa\u73b0\u201c\u4e07-\u4e07-\u4e07\u2026\u2026\u201d\u7684\u5019\u9009\u8bcd\u6846\uff0c\u800c\u4e0d\u662f\u76f4\u63a5\u8fdb\u5165\u5730\u5740\u680f\u3002<\/p>\n<hr \/>\n<h3>\u7b2c\u4e00\u6b65\uff1aWindows \u7684\u201c\u514d\u75ab\u8f93\u5165\u6cd5\u201d\u65b9\u6848<\/h3>\n<p>\u5728 Windows \u4e0a\uff0c\u6700\u7a33\u59a5\u7684\u529e\u6cd5\u662f\u5229\u7528 <strong><code>Alt<\/code> + \u5c0f\u952e\u76d8\u6570\u5b57\u952e<\/strong>\u3002\u8fd9\u662f\u7cfb\u7edf\u5e95\u5c42\u7684\u8f93\u5165\u65b9\u5f0f\uff0c\u65e0\u8bba\u8f93\u5165\u6cd5\u662f\u4e2d\u6587\u8fd8\u662f\u82f1\u6587\uff0c\u5b83\u90fd\u4f1a\u76f4\u63a5\u8f93\u51fa\u5bf9\u5e94\u7684 ASCII \u5b57\u7b26\u3002<\/p>\n<p><strong>\u903b\u8f91\u8bbe\u8ba1\uff1a<\/strong><br \/>\n1.  \u6309\u4e0b <code>Win + R<\/code>\uff08\u6253\u5f00\u8fd0\u884c\u5bf9\u8bdd\u6846\uff09\u3002<br \/>\n2.  \u7b49\u5f85 300ms\u3002<br \/>\n3.  <strong>\u6838\u5fc3\u6280\u5de7\uff1a<\/strong> \u6a21\u62df\u8f93\u5165 <code>cmd \/c start https:\/\/www.google.com<\/code>\u3002<br \/>\n4.  <strong>\u5982\u4f55\u8f93\u5165\u5b57\u7b26\uff1a<\/strong> \u6bcf\u4e00\u4e2a\u5b57\u6bcd\u90fd\u901a\u8fc7 <code>Alt<\/code> \u7801\u8f93\u5165\u3002\u4f8b\u5982\u8f93\u5165\u5b57\u6bcd <code>h<\/code> (ASCII 104)\uff1a<br \/>\n    *   \u6309\u4e0b <code>Alt<\/code> \u4e0d\u653e\u3002<br \/>\n    *   \u4f9d\u6b21\u6309\u4e0b\u5c0f\u952e\u76d8 <code>1<\/code>, <code>0<\/code>, <code>4<\/code>\u3002<br \/>\n    *   \u677e\u5f00 <code>Alt<\/code>\u3002<br \/>\n    *   <em>\u8fd9\u79cd\u65b9\u5f0f\u53ef\u4ee5\u65e0\u89c6\u4efb\u4f55\u4e2d\u6587\u8f93\u5165\u6cd5\uff0c\u5f3a\u5236\u8f93\u51fa\u5b57\u7b26\u3002<\/em><br \/>\n5.  \u6309\u4e0b <code>Enter<\/code>\u3002<\/p>\n<h3>\u7b2c\u4e8c\u6b65\uff1amacOS \u7684\u201c\u76f2\u6253\u201d\u65b9\u6848<\/h3>\n<p>macOS \u6ca1\u6709\u7c7b\u4f3c Windows \u7684 Alt \u7801\uff0c\u4f46\u5b83\u7684 <strong>Spotlight (\u805a\u7126\u641c\u7d22)<\/strong> \u5bf9 URL \u7684\u8bc6\u522b\u975e\u5e38\u667a\u80fd\u3002<\/p>\n<p><strong>\u903b\u8f91\u8bbe\u8ba1\uff1a<\/strong><br \/>\n1.  \u6309\u4e0b <code>Command + Space<\/code>\uff08\u6253\u5f00 Spotlight\uff09\u3002<br \/>\n2.  \u7b49\u5f85 200ms\u3002<br \/>\n3.  \u76f4\u63a5\u6a21\u62df\u8f93\u5165\u7f51\u9875\u5730\u5740\u3002<br \/>\n4.  <strong>\u5982\u4f55\u907f\u5f00\u8f93\u5165\u6cd5\uff1a<\/strong> macOS \u7684 Spotlight \u6709\u4e2a\u7279\u6027\uff0c\u5f53\u4f60\u5feb\u901f\u8f93\u5165\u7c7b\u4f3c <code>https:\/\/<\/code> \u8fd9\u79cd\u683c\u5f0f\u7684\u5b57\u7b26\u4e32\u65f6\uff0c\u5b83\u901a\u5e38\u4f1a\u4f18\u5148\u8bc6\u522b\u4e3a\u7f51\u5740\u800c\u975e\u6c49\u5b57\u3002<br \/>\n5.  <strong>\u66f4\u9ad8\u7ea7\u7684\u6280\u5de7\uff1a<\/strong> \u5148\u53d1\u9001\u4e00\u4e2a <code>Command + A<\/code> \u7136\u540e <code>Backspace<\/code>\uff0c\u786e\u4fdd\u641c\u7d22\u6846\u662f\u7a7a\u7684\u3002<\/p>\n<hr \/>\n<h3>\u7b2c\u4e09\u6b65\uff1a\u6c81\u6052 MCU (CH552) \u7684\u5b9e\u73b0\u7ec6\u8282<\/h3>\n<p>\u7531\u4e8e\u4f60\u8981\u505a\u7684\u662f\u201c\u5c0f\u952e\u76d8\u201d\uff0c\u5efa\u8bae\u4f7f\u7528 <strong>CH552G<\/strong>\uff08\u975e\u5e38\u4fbf\u5b9c\uff0cSOP16 \u5c01\u88c5\uff09\u3002<\/p>\n<h4>1. \u786c\u4ef6\u7535\u8def<\/h4>\n<ul>\n<li><strong>MCU:<\/strong> CH552G\u3002<\/li>\n<li><strong>\u6309\u952e:<\/strong> \u4e00\u4e2a\u6309\u952e\u8fde\u63a5\u5230 GPIO\uff08\u5982 P1.1\uff09\uff0c\u5e76\u505a\u4e0b\u62c9\u6216\u4e0a\u62c9\u5904\u7406\u3002<\/li>\n<li><strong>USB:<\/strong> D+ \u548c D- \u76f4\u63a5\u8fde\u5230 USB \u6bcd\u5ea7\uff08\u6ce8\u610f CH552 \u662f 3.3V \u903b\u8f91\uff0cVCC \u4f9b\u7535\u9700\u6ce8\u610f\uff09\u3002<\/li>\n<\/ul>\n<h4>2. \u56fa\u4ef6\u903b\u8f91\u5b9e\u73b0 (\u4f2a\u4ee3\u7801)<\/h4>\n<p>\u4f60\u9700\u8981\u4fee\u6539\u6c81\u6052\u5b98\u65b9\u7684 <code>USB_HID_Keyboard<\/code> \u793a\u4f8b\uff1a<\/p>\n<pre><code class=\"language-c line-numbers\">\/\/ \u4f2a\u4ee3\u7801\uff1a\u5f53\u6309\u952e\u6309\u4e0b\u65f6\u6267\u884c\nvoid trigger_open_url() {\n    \/\/ --- 1. Windows \u5e8f\u5217 ---\n    press_key(GUI, 'r');       \/\/ Win+R\n    delay(500);\n\n    \/\/ \u4f7f\u7528 Alt+\u5c0f\u952e\u76d8 \u8f93\u5165 \"cmd \/c start https:\/\/google.com\"\n    \/\/ \u793a\u4f8b\uff1a\u8f93\u5165 'h' (ASCII 104)\n    press_alt_numpad(104); \n    \/\/ ... \u5faa\u73af\u5904\u7406\u5b57\u7b26\u4e32\u4e2d\u7684\u6bcf\u4e2a\u5b57\u7b26 ...\n\n    press_key(ENTER);\n    delay(1000);\n\n    \/\/ --- 2. macOS \u5e8f\u5217 ---\n    press_key(GUI, ' ');       \/\/ Cmd+Space\n    delay(500);\n\n    \/\/ \u76f4\u63a5\u6253\u5b57\u8f93\u5165 URL\n    print_string(\"https:\/\/www.google.com\");\n    delay(200);\n    press_key(ENTER);\n}\n<\/code><\/pre>\n<h4>3. \u5982\u4f55\u517c\u5bb9\u4e24\u5957\u7cfb\u7edf\uff1f<\/h4>\n<p>\u56e0\u4e3a\u786c\u4ef6\u4e0d\u77e5\u9053\u5b83\u63d2\u5728\u4e86 Windows \u8fd8\u662f Mac \u4e0a\uff0c\u6700\u7b80\u5355\u7c97\u66b4\u7684\u65b9\u6cd5\u662f\uff1a<strong>\u6309\u4e00\u4e0b\u6309\u952e\uff0c\u5148\u540e\u53d1\u9001\u4e24\u5957\u6307\u4ee4\u3002<\/strong><br \/>\n*   Windows \u7684 <code>Win+R<\/code> \u6307\u4ee4\u5728 Mac \u4e0a\u4f1a\u8bef\u89e6\u53d1 Spotlight \u6216\u5176\u4ed6\u529f\u80fd\uff0c\u4f46\u56e0\u4e3a\u540e\u7eed\u6307\u4ee4\u4e0d\u5339\u914d\uff0c\u901a\u5e38\u4e0d\u4f1a\u6709\u7834\u574f\u6027\u540e\u679c\u3002<br \/>\n*   \u53cd\u4e4b\u4ea6\u7136\u3002<\/p>\n<hr \/>\n<h3>\u7b2c\u56db\u6b65\uff1a\u8fdb\u9636\u907f\u5751\u6307\u5357<\/h3>\n<ol>\n<li><strong>\u5927\u5199\u9501\u5b9a (Caps Lock) \u7684\u5e72\u6270\uff1a<\/strong><br \/>\n\u5982\u679c\u7528\u6237\u5f00\u542f\u4e86\u5927\u5199\u9501\u5b9a\uff0c\u8f93\u5165\u7684 <code>https<\/code> \u53ef\u80fd\u53d8\u6210 <code>HTTPS<\/code>\u3002\u867d\u7136\u7f51\u5740\u4e0d\u533a\u5206\u5927\u5c0f\u5199\uff0c\u4f46\u4e3a\u4e86\u4fdd\u9669\uff0c\u5728\u53d1\u9001\u5b57\u7b26\u4e32\u524d\uff0c\u5148\u53d1\u9001\u4e00\u6b21 <code>Caps Lock<\/code> \u4fe1\u53f7\u68c0\u6d4b\u6216\u5f3a\u5236\u5173\u95ed\uff08\u867d\u7136 HID \u534f\u8bae\u652f\u6301\u8bfb\u53d6\u952e\u76d8\u706f\u72b6\u6001\uff0c\u4f46\u903b\u8f91\u8f83\u590d\u6742\uff09\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u901f\u5ea6\u63a7\u5236\uff1a<\/strong><br \/>\n\u6a21\u62df\u6309\u952e\u4e0d\u80fd\u592a\u5feb\u3002\u6bcf\u4e2a\u5b57\u7b26\u4e4b\u95f4\u5efa\u8bae\u7559 5-10ms \u7684\u5ef6\u8fdf\uff0c\u6253\u5f00\u8fd0\u884c\u7a97\u53e3\u540e\u5efa\u8bae\u7559 300-500ms \u5ef6\u8fdf\uff0c\u5426\u5219\u7535\u8111\u53cd\u5e94\u4e0d\u8fc7\u6765\uff0c\u4f1a\u5bfc\u81f4\u5b57\u7b26\u4e22\u5931\u3002<\/p>\n<\/li>\n<li>\n<p><strong>USB \u63cf\u8ff0\u7b26\uff1a<\/strong><br \/>\n\u5c06\u8bbe\u5907\u5b9a\u4e49\u4e3a\u6807\u51c6 <strong>HID Keyboard<\/strong>\u3002\u8fd9\u6837\u5728\u4efb\u4f55\u7535\u8111\u4e0a\u63d2\u4e0a\u53bb\u90fd\u4f1a\u663e\u793a\u201c\u6b63\u5728\u8bbe\u7f6e HID \u952e\u76d8\u8bbe\u5907\u201d\uff0c\u65e0\u9700\u4efb\u4f55\u9a71\u52a8\u3002<\/p>\n<\/li>\n<\/ol>\n<h3>\u63a8\u8350\u65b9\u6848\u603b\u7ed3<\/h3>\n<ul>\n<li><strong>\u82af\u7247\uff1a<\/strong> \u5357\u4eac\u6c81\u6052 <strong>CH552G<\/strong> (\u6210\u672c\u7ea6 1.5 \u5143)\u3002<\/li>\n<li><strong>\u7b56\u7565\uff1a<\/strong> Windows \u4e0b\u4f7f\u7528 <strong>Alt + \u5c0f\u952e\u76d8\u7801<\/strong>\uff08\u5f7b\u5e95\u89e3\u51b3\u8f93\u5165\u6cd5\u95ee\u9898\uff09\uff1bmacOS \u4e0b\u76f4\u63a5\u8f93\u5165\u3002<\/li>\n<li><strong>\u5f62\u6001\uff1a<\/strong> 1 \u4e2a\u673a\u68b0\u6309\u952e + 1 \u4e2a\u5c0f\u5916\u58f3 = \u4f60\u7684\u201c\u4e00\u952e\u76f4\u8fbe\u7f51\u9875\u201d\u795e\u5668\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u79cd\u65b9\u6848\u4e0d\u4ec5\u80fd\u6253\u5f00\u7f51\u9875\uff0c\u8fd8\u80fd\u901a\u8fc7 Windows \u7684\u8fd0\u884c\u7a97\u53e3\u8f93\u5165 <code>calc<\/code>\uff08\u8ba1\u7b97\u5668\uff09\u3001<code>notepad<\/code>\uff08\u8bb0\u4e8b\u672c\uff09\u7b49\u547d\u4ee4\u76f4\u63a5\u542f\u52a8\u672c\u5730\u8f6f\u4ef6\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6211\u60f3\u7528\u5357\u4eac\u6c81\u6052\uff08WCH\uff09MCU\u505a\u4e2a\u5c0f\u952e\u76d8\uff0c\u4e00\u952e\u6253\u5f00\u67d0\u4e2a\u56fa\u5b9a\u7684\u7f51\u9875\u6216\u8005\u8f6f\u4ef6\uff0c\u662f\u5426\u53ef\u884c\uff1fwindows\u4e0emac\u7535\u8111 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-3659","post","type-post","status-publish","format-standard","hentry","category-embedded"],"_links":{"self":[{"href":"http:\/\/www.51cos.com\/index.php?rest_route=\/wp\/v2\/posts\/3659","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.51cos.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.51cos.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.51cos.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.51cos.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3659"}],"version-history":[{"count":1,"href":"http:\/\/www.51cos.com\/index.php?rest_route=\/wp\/v2\/posts\/3659\/revisions"}],"predecessor-version":[{"id":3660,"href":"http:\/\/www.51cos.com\/index.php?rest_route=\/wp\/v2\/posts\/3659\/revisions\/3660"}],"wp:attachment":[{"href":"http:\/\/www.51cos.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3659"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.51cos.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3659"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.51cos.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3659"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}