{"id":92132,"date":"2026-08-09T13:17:00","date_gmt":"2026-08-09T05:17:00","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/92132.html"},"modified":"2026-08-09T13:17:00","modified_gmt":"2026-08-09T05:17:00","slug":"%e8%ae%be%e5%a4%87%e6%a0%91%e5%ad%a6%e4%b9%a05-%e8%af%bb%e5%86%99%e5%ae%9e%e6%93%8d","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/92132.html","title":{"rendered":"\u8bbe\u5907\u6811\u5b66\u4e605--\u8bfb\u5199\u5b9e\u64cd"},"content":{"rendered":"<p>\u5b9e\u73b0\u4e00\u4e2a\u9a71\u52a8\u8bfb\u53d6\u81ea\u5df1\u5b9a\u4e49\u7684\u8bbe\u5907\u6811<\/p>\n<h2>1 \u8bbe\u5907\u6811\u8bfb\u5199\u63a5\u53e3<\/h2>\n<p>\u5934\u6587\u4ef6<\/p>\n<p>#include &lt;linux\/of.h&gt;          \/\/\u8282\u70b9\u3001\u5c5e\u6027\u57fa\u7840\u63a5\u53e3<br \/>\n#include &lt;linux\/of_address.h&gt;  \/\/reg\u7269\u7406\u5730\u5740<br \/>\n#include &lt;linux\/of_irq.h&gt;      \/\/\u4e2d\u65ad<br \/>\n#include &lt;linux\/of_gpio.h&gt;     \/\/GPIO<br \/>\n#include &lt;linux\/of_clk.h&gt;      \/\/\u65f6\u949f<br \/>\n#include &lt;linux\/of_pinctrl.h&gt;  \/\/\u5f15\u811a\u914d\u7f6e<br \/>\n#include &lt;linux\/of_property.h&gt; <\/p>\n<p>\u67e5\u627e\/\u904d\u5386\u8bbe\u5907\u8282\u70b9<\/p>\n<table>\n<tr>\u63a5\u53e3\u529f\u80fd\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>of_find_node_by_path()<\/td>\n<td>\u6309\u7167\u8bbe\u5907\u6811\u5168\u8def\u5f84\u67e5\u627e\u8282\u70b9<\/td>\n<\/tr>\n<tr>\n<td>of_find_node_by_name()<\/td>\n<td>\u6309\u8282\u70b9 name \u67e5\u627e<\/td>\n<\/tr>\n<tr>\n<td>of_find_node_by_type()<\/td>\n<td>\u6309 device\u2011type \u5c5e\u6027\u67e5\u627e<\/td>\n<\/tr>\n<tr>\n<td>of_find_compatible_node()<\/td>\n<td>\u6839\u636e compatible \u5339\u914d\u8282\u70b9<\/td>\n<\/tr>\n<tr>\n<td>of_get_child_by_name()<\/td>\n<td>\u83b7\u53d6\u6307\u5b9a\u540d\u5b57\u7684\u5b50\u8282\u70b9<\/td>\n<\/tr>\n<tr>\n<td>of_next_child_node()<\/td>\n<td>\u5faa\u73af\u904d\u5386\u6240\u6709\u5b50\u8282\u70b9<\/td>\n<\/tr>\n<tr>\n<td>of_node_put()<\/td>\n<td>\u8282\u70b9\u5f15\u7528\u8ba1\u6570\u91ca\u653e&#xff08;\u67e5\u5230\u8282\u70b9\u5fc5\u987b\u8c03\u7528&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>of_device_is_available()<\/td>\n<td>\u5224\u65ad\u8282\u70b9 status &#061; &#034;okay&#034; \u662f\u5426\u542f\u7528<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8bfb\u53d6\u8282\u70b9\u5c5e\u6027&#xff08;\u6700\u5e38\u7528&#xff09;<\/p>\n<table>\n<tr>\u63a5\u53e3\u7528\u9014<\/tr>\n<tbody>\n<tr>\n<td>of_property_read_bool(node, &#034;xxx&#034;)<\/td>\n<td>\u5e03\u5c14\u5c5e\u6027&#xff0c;\u5b58\u5728\u5373\u8fd4\u56de true<\/td>\n<\/tr>\n<tr>\n<td>of_property_read_u8()<\/td>\n<td>\u8bfb\u53d6 uint8 \u5c5e\u6027<\/td>\n<\/tr>\n<tr>\n<td>of_property_read_u16()<\/td>\n<td>\u8bfb\u53d6 uint16<\/td>\n<\/tr>\n<tr>\n<td>of_property_read_u32()<\/td>\n<td>\u8bfb\u53d6\u5355\u4e2a 32 \u4f4d\u6574\u578b<\/td>\n<\/tr>\n<tr>\n<td>of_property_read_u64()<\/td>\n<td>\u8bfb\u53d6 64 \u4f4d\u6574\u578b<\/td>\n<\/tr>\n<tr>\n<td>of_property_read_u32_array()<\/td>\n<td>\u8bfb\u53d6 u32 \u6570\u7ec4<\/td>\n<\/tr>\n<tr>\n<td>of_property_read_string()<\/td>\n<td>\u8bfb\u53d6\u5b57\u7b26\u4e32\u5c5e\u6027<\/td>\n<\/tr>\n<tr>\n<td>of_property_read_string_array()<\/td>\n<td>\u8bfb\u53d6\u5b57\u7b26\u4e32\u6570\u7ec4<\/td>\n<\/tr>\n<tr>\n<td>of_property_match_string()<\/td>\n<td>\u5339\u914d\u5b57\u7b26\u4e32\u5217\u8868\u7d22\u5f15<\/td>\n<\/tr>\n<tr>\n<td>of_find_property()<\/td>\n<td>\u83b7\u53d6 property \u539f\u59cb\u7ed3\u6784\u4f53<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>reg\u7269\u7406\u5185\u5b58\u5730\u5740\u64cd\u4f5c<\/p>\n<table>\n<tr>\u63a5\u53e3\u4f5c\u7528<\/tr>\n<tbody>\n<tr>\n<td>of_address_to_resource()<\/td>\n<td>reg \u8f6c\u4e3a struct\u2011resource<\/td>\n<\/tr>\n<tr>\n<td>of_iomap()<\/td>\n<td>\u7269\u7406\u5730\u5740\u6620\u5c04\u6210\u5185\u6838\u865a\u62df\u5730\u5740<\/td>\n<\/tr>\n<tr>\n<td>of_iounmap()<\/td>\n<td>\u89e3\u9664\u5730\u5740\u6620\u5c04<\/td>\n<\/tr>\n<tr>\n<td>of_address_in_resource()<\/td>\n<td>\u68c0\u67e5\u5730\u5740\u662f\u5426\u843d\u5728 reg \u533a\u95f4<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4e2d\u65ad\u8d44\u6e90<\/p>\n<table>\n<tr>\u63a5\u53e3\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>irq_of_parse_and_map()<\/td>\n<td>\u89e3\u6790 interrupts \u5c5e\u6027\u3001\u6620\u5c04\u4e2d\u65ad\u53f7<\/td>\n<\/tr>\n<tr>\n<td>of_irq_get()<\/td>\n<td>\u83b7\u53d6\u8282\u70b9\u7b2c n \u4e2a\u4e2d\u65ad<\/td>\n<\/tr>\n<tr>\n<td>of_irq_to_resource()<\/td>\n<td>\u4e2d\u65ad\u8f6c\u4e3a resource \u7ed3\u6784\u4f53<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>phandle\u5f15\u7528\u8282\u70b9<\/p>\n<table>\n<tr>\u63a5\u53e3\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>of_parse_phandle()<\/td>\n<td>\u89e3\u6790 phandle&#xff0c;\u62ff\u5230\u88ab\u5f15\u7528\u8282\u70b9<\/td>\n<\/tr>\n<tr>\n<td>of_parse_phandle_with_args()<\/td>\n<td>\u89e3\u6790\u5e26\u53c2\u6570\u7684 phandle&#xff08;\u4e2d\u65ad\u63a7\u5236\u5668\u5e38\u7528&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6b64\u5916\u8fd8\u6709\u4e00\u4e9b&#xff0c;\u5c31\u4e0d\u5168\u90e8\u5217\u4e86\u3002\u3002<\/p>\n<\/p>\n<h2>2 \u4e00\u4e2a\u4f8b\u5b50<\/h2>\n<p>\u5b9e\u9a8c\u662f\u57fa\u4e8e\u6811\u8393\u6d3e&#xff0c;\u4e3b\u8981\u662f\u73af\u5883\u65b9\u4fbf\u3002<\/p>\n<h3 style=\"background-color:transparent\">2.1 \u8bbe\u5907\u6811<\/h3>\n<p>\/*<br \/>\n * Custom Device Tree Overlay for Raspberry Pi DT experiment<br \/>\n * Defines a platform device node &#034;tom,mydevice&#034; with various property<br \/>\n * types that a driver can parse: string, u32 array, u64, GPIO, IRQ, clock.<br \/>\n *\/<\/p>\n<p>\/dts-v1\/;<br \/>\n\/plugin\/;<\/p>\n<p>\/ {<br \/>\n    compatible &#061; &#034;brcm,bcm2712&#034;;<\/p>\n<p>    fragment&#064;0 {<br \/>\n        target-path &#061; &#034;\/&#034;;<br \/>\n        __overlay__ {<br \/>\n            tom_mydevice: tom,mydevice {<br \/>\n                compatible &#061; &#034;tom,mydevice&#034;;<br \/>\n                status &#061; &#034;okay&#034;;<\/p>\n<p>                \/* string properties *\/<br \/>\n                device-name &#061; &#034;tom-demo-device&#034;;<br \/>\n                description &#061; &#034;A demo DT node for parsing practice&#034;;<\/p>\n<p>                \/* u32 scalar *\/<br \/>\n                version &#061; &lt;0x00010002&gt;;<\/p>\n<p>                \/* u32 array *\/<br \/>\n                channel-ids &#061; &lt;1 2 3 4 8&gt;;<\/p>\n<p>                \/* u64 (as two 32-bit cells, big-endian) *\/<br \/>\n                big-counter &#061; &lt;0x00000001 0x11223344&gt;;<\/p>\n<p>                \/* GPIO pin number (real BCM GPIO 17) *\/<br \/>\n                led-gpio &#061; &lt;&amp;gpio 17 0&gt;;<\/p>\n<p>                \/* GPIO handled via gpios prop *\/<br \/>\n                gpios &#061; &lt;&amp;gpio 22 0&gt;, &lt;&amp;gpio 23 0&gt;;<\/p>\n<p>                \/* interrupts on a free IRQ line (10) *\/<br \/>\n                interrupts &#061; &lt;10&gt;;<br \/>\n                interrupt-parent &#061; &lt;&amp;gpio&gt;;<\/p>\n<p>                \/* clock reference: use the system&#039;s 108M clock *\/<br \/>\n                clocks &#061; &lt;&amp;clk_108MHz&gt;;<br \/>\n                clock-names &#061; &#034;sysclk&#034;;<\/p>\n<p>                \/* child node for nested parsing demo *\/<br \/>\n                child-config {<br \/>\n                    #address-cells &#061; &lt;1&gt;;<br \/>\n                    #size-cells &#061; &lt;1&gt;;<br \/>\n                    label &#061; &#034;child-1&#034;;<br \/>\n                    reg &#061; &lt;0x0 0x1000&gt;;<br \/>\n                };<br \/>\n            };<br \/>\n        };<br \/>\n    };<\/p>\n<p>    __overrides__ {<br \/>\n        mydevice-enabled &#061; &lt;&amp;tom_mydevice&gt;,&#034;status&#034;;<br \/>\n    };<br \/>\n};<\/p>\n<h3>2.2 \u9a71\u52a8<\/h3>\n<p>\/\/ tom_device_driver.c<br \/>\n\/\/ Platform driver that parses properties from the &#034;tom,mydevice&#034;<br \/>\n\/\/ device tree node defined in tom-device.dts overlay.<br \/>\n#include &lt;linux\/init.h&gt;<br \/>\n#include &lt;linux\/module.h&gt;<br \/>\n#include &lt;linux\/platform_device.h&gt;<br \/>\n#include &lt;linux\/of.h&gt;<br \/>\n#include &lt;linux\/of_gpio.h&gt;<br \/>\n#include &lt;linux\/of_irq.h&gt;<br \/>\n#include &lt;linux\/clk.h&gt;<br \/>\n#include &lt;linux\/gpio\/consumer.h&gt;<\/p>\n<p>MODULE_LICENSE(&#034;Dual BSD\/GPL&#034;);<br \/>\nMODULE_AUTHOR(&#034;Tom&#034;);<br \/>\nMODULE_DESCRIPTION(&#034;Parse custom device tree properties&#034;);<\/p>\n<p>static int tom_device_probe(struct platform_device *pdev)<br \/>\n{<br \/>\nstruct device *dev &#061; &amp;pdev-&gt;dev;<br \/>\nstruct device_node *np &#061; dev-&gt;of_node;<br \/>\nconst char *name, *desc;<br \/>\nu32 version;<br \/>\nu32 channels[8];<br \/>\nint nch, i;<br \/>\nu64 big_counter;<br \/>\nu32 counter_hi, counter_lo;<br \/>\nint gpio_led, ret;<br \/>\nstruct gpio_desc *led_gpio;<br \/>\nstruct clk *clk;<\/p>\n<p>dev_info(dev, &#034;&#061;&#061;&#061; Tom Device DT probe &#061;&#061;&#061;\\\\n&#034;);<br \/>\nif (!np) {<br \/>\ndev_err(dev, &#034;No OF node!\\\\n&#034;);<br \/>\nreturn -ENODEV;<br \/>\n}<br \/>\ndev_info(dev, &#034;OF node full name: %s\\\\n&#034;, np-&gt;full_name);<\/p>\n<p>\/* 1. String properties *\/<br \/>\nret &#061; of_property_read_string(np, &#034;device-name&#034;, &amp;name);<br \/>\nif (!ret)<br \/>\ndev_info(dev, &#034;device-name &#061; %s\\\\n&#034;, name);<br \/>\nelse<br \/>\ndev_err(dev, &#034;read device-name failed: %d\\\\n&#034;, ret);<\/p>\n<p>ret &#061; of_property_read_string(np, &#034;description&#034;, &amp;desc);<br \/>\nif (!ret)<br \/>\ndev_info(dev, &#034;description &#061; %s\\\\n&#034;, desc);<\/p>\n<p>\/* 2. u32 scalar *\/<br \/>\nret &#061; of_property_read_u32(np, &#034;version&#034;, &amp;version);<br \/>\nif (!ret)<br \/>\ndev_info(dev, &#034;version &#061; 0x%08x (%u)\\\\n&#034;, version, version);<\/p>\n<p>\/* 3. u32 array *\/<br \/>\nnch &#061; of_property_read_variable_u32_array(np, &#034;channel-ids&#034;, channels,<br \/>\n  0, ARRAY_SIZE(channels));<br \/>\nif (nch &gt; 0) {<br \/>\ndev_info(dev, &#034;channel-ids count &#061; %d:&#034;, nch);<br \/>\nfor (i &#061; 0; i &lt; nch; i&#043;&#043;)<br \/>\npr_cont(&#034; %u&#034;, channels[i]);<br \/>\npr_cont(&#034;\\\\n&#034;);<br \/>\n} else {<br \/>\ndev_err(dev, &#034;read channel-ids failed: %d\\\\n&#034;, nch);<br \/>\n}<\/p>\n<p>\/* 4. u64 property (two cells) *\/<br \/>\nret &#061; of_property_read_u32_index(np, &#034;big-counter&#034;, 0, &amp;counter_hi);<br \/>\nif (ret &#061;&#061; 0)<br \/>\nret &#061; of_property_read_u32_index(np, &#034;big-counter&#034;, 1, &amp;counter_lo);<br \/>\nif (!ret) {<br \/>\nbig_counter &#061; ((u64)counter_hi &lt;&lt; 32) | counter_lo;<br \/>\ndev_info(dev, &#034;big-counter &#061; 0x%016llx\\\\n&#034;, big_counter);<br \/>\n} else {<br \/>\ndev_err(dev, &#034;read big-counter failed: %d\\\\n&#034;, ret);<br \/>\n}<\/p>\n<p>\/* 5. GPIO via of_get_named_gpio *\/<br \/>\ngpio_led &#061; of_get_named_gpio(np, &#034;led-gpio&#034;, 0);<br \/>\nif (gpio_is_valid(gpio_led))<br \/>\ndev_info(dev, &#034;led-gpio &#061; GPIO %d\\\\n&#034;, gpio_led);<br \/>\nelse<br \/>\ndev_err(dev, &#034;led-gpio invalid: %d\\\\n&#034;, gpio_led);<\/p>\n<p>\/* 6. GPIO via devm_gpiod_get_optional (gpios property) *\/<br \/>\nled_gpio &#061; devm_gpiod_get_optional(dev, NULL, GPIOD_ASIS);<br \/>\nif (IS_ERR(led_gpio)) {<br \/>\ndev_err(dev, &#034;gpiod get failed: %ld\\\\n&#034;, PTR_ERR(led_gpio));<br \/>\n} else if (led_gpio) {<br \/>\nint gpionum &#061; desc_to_gpio(led_gpio);<br \/>\ndev_info(dev, &#034;gpios[0] desc -&gt; GPIO %d\\\\n&#034;, gpionum);<br \/>\n} else {<br \/>\ndev_info(dev, &#034;no gpios property found\\\\n&#034;);<br \/>\n}<\/p>\n<p>\/* 7. Interrupt *\/<br \/>\n{<br \/>\nint irq &#061; of_irq_get(np, 0);<br \/>\nif (irq &gt;&#061; 0)<br \/>\ndev_info(dev, &#034;interrupts[0] -&gt; irq &#061; %d\\\\n&#034;, irq);<br \/>\nelse<br \/>\ndev_info(dev, &#034;no irq (%d)\\\\n&#034;, irq);<br \/>\n}<\/p>\n<p>\/* 8. Clock *\/<br \/>\nclk &#061; devm_clk_get(dev, &#034;sysclk&#034;);<br \/>\nif (IS_ERR(clk)) {<br \/>\ndev_info(dev, &#034;clock sysclk not available: %ld\\\\n&#034;, PTR_ERR(clk));<br \/>\n} else {<br \/>\nunsigned long rate &#061; clk_get_rate(clk);<br \/>\ndev_info(dev, &#034;clock sysclk rate &#061; %lu Hz\\\\n&#034;, rate);<br \/>\n}<\/p>\n<p>\/* 9. Child node *\/<br \/>\n{<br \/>\nstruct device_node *child;<br \/>\nchild &#061; of_get_child_by_name(np, &#034;child-config&#034;);<br \/>\nif (child) {<br \/>\nconst char *clabel;<br \/>\nu32 caddr;<br \/>\nif (!of_property_read_string(child, &#034;label&#034;, &amp;clabel))<br \/>\ndev_info(dev, &#034;child-config label &#061; %s\\\\n&#034;, clabel);<br \/>\nif (!of_property_read_u32_index(child, &#034;reg&#034;, 1, &amp;caddr))<br \/>\ndev_info(dev, &#034;child-config reg[1] &#061; 0x%x\\\\n&#034;, caddr);<br \/>\nof_node_put(child);<br \/>\n} else {<br \/>\ndev_info(dev, &#034;no child-config node\\\\n&#034;);<br \/>\n}<br \/>\n}<\/p>\n<p>\/* 10. Show full raw property dump via \/sys nodes *\/<br \/>\ndev_info(dev, &#034;&#061;&#061;&#061; probe complete &#061;&#061;&#061;\\\\n&#034;);<br \/>\nreturn 0;<br \/>\n}<\/p>\n<p>static void tom_device_remove(struct platform_device *pdev)<br \/>\n{<br \/>\ndev_info(&amp;pdev-&gt;dev, &#034;Tom device removed\\\\n&#034;);<br \/>\n}<\/p>\n<p>static const struct of_device_id tom_device_of_match[] &#061; {<br \/>\n{ .compatible &#061; &#034;tom,mydevice&#034; },<br \/>\n{ }<br \/>\n};<br \/>\nMODULE_DEVICE_TABLE(of, tom_device_of_match);<\/p>\n<p>static struct platform_driver tom_device_driver &#061; {<br \/>\n.probe  &#061; tom_device_probe,<br \/>\n.remove &#061; tom_device_remove,<br \/>\n.driver &#061; {<br \/>\n.name &#061; &#034;tom_device&#034;,<br \/>\n.of_match_table &#061; tom_device_of_match,<br \/>\n},<br \/>\n};<\/p>\n<p>module_platform_driver(tom_device_driver);<\/p>\n<h3>2.3 \u8fd0\u884c<\/h3>\n<p>\u8fd0\u884c\u65b9\u6cd5&#xff1a;<\/p>\n<p>\u7f16\u8bd1&#xff1a;dtc -&#064; -I dts -O dtb -o tom-device.dtbo tom-device.dts&#xff08;-&#064; \u4fdd\u7559\u7b26\u53f7&#xff09;\u3002<\/p>\n<p>\u4e4b\u540e\u7f16\u8bd1\u9a71\u52a8\u5e76insmod\u3002<\/p>\n<\/p>\n<p>\u8fd0\u884c\u7ed3\u679c&#xff1a;<\/p>\n<p>tom_device tom,mydevice: device-name &#061; tom-demo-device<br \/>\ntom_device tom,mydevice: description &#061; A demo DT node for parsing practice<br \/>\ntom_device tom,mydevice: version &#061; 0x00010002 (65538)<br \/>\ntom_device tom,mydevice: channel-ids count &#061; 5:<br \/>\ntom_device tom,mydevice: big-counter &#061; 0x0000000111223344<br \/>\ntom_device tom,mydevice: led-gpio &#061; GPIO 588<br \/>\ntom_device tom,mydevice: gpios[0] desc -&gt; GPIO 593<br \/>\ntom_device tom,mydevice: no irq (-75)<br \/>\ntom_device tom,mydevice: clock sysclk rate &#061; 108000000 Hz<br \/>\ntom_device tom,mydevice: child-config label &#061; child-1<br \/>\ntom_device tom,mydevice: child-config reg[1] &#061; 0x1000<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"181\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260809051657-6a780d49c80d2.png\" width=\"322\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b9e\u73b0\u4e00\u4e2a\u9a71\u52a8\u8bfb\u53d6\u81ea\u5df1\u5b9a\u4e49\u7684\u8bbe\u5907\u6811<br \/>\n1 \u8bbe\u5907\u6811\u8bfb\u5199\u63a5\u53e3<br \/>\n\u5934\u6587\u4ef6<br \/>\n#include           \/\/\u8282\u70b9\u3001\u5c5e\u6027\u57fa\u7840\u63a5\u53e3<br \/>\n#include   \/\/reg\u7269\u7406\u5730\u5740<br \/>\n#include       \/\/\u4e2d\u65ad<br \/>\n#include      \/\/GPIO<br \/>\n#include       \/\/\u65f6\u949f<br \/>\n#include &lt;li<\/p>\n","protected":false},"author":2,"featured_media":92131,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[58,1363],"topic":[],"class_list":["post-92132","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-linux","tag-1363"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u8bbe\u5907\u6811\u5b66\u4e605-\u8bfb\u5199\u5b9e\u64cd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/92132.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u8bbe\u5907\u6811\u5b66\u4e605-\u8bfb\u5199\u5b9e\u64cd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u5b9e\u73b0\u4e00\u4e2a\u9a71\u52a8\u8bfb\u53d6\u81ea\u5df1\u5b9a\u4e49\u7684\u8bbe\u5907\u6811 1 \u8bbe\u5907\u6811\u8bfb\u5199\u63a5\u53e3 \u5934\u6587\u4ef6 #include      \/\/\u8282\u70b9\u3001\u5c5e\u6027\u57fa\u7840\u63a5\u53e3 #include  \/\/reg\u7269\u7406\u5730\u5740 #include    \/\/\u4e2d\u65ad #include   \/\/GPIO #include    \/\/\u65f6\u949f #include &lt;li\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/92132.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-09T05:17:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260809051657-6a780d49c80d2.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/92132.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/92132.html\",\"name\":\"\u8bbe\u5907\u6811\u5b66\u4e605-\u8bfb\u5199\u5b9e\u64cd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-09T05:17:00+00:00\",\"dateModified\":\"2026-08-09T05:17:00+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/92132.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/92132.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/92132.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u8bbe\u5907\u6811\u5b66\u4e605--\u8bfb\u5199\u5b9e\u64cd\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u8bbe\u5907\u6811\u5b66\u4e605-\u8bfb\u5199\u5b9e\u64cd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/92132.html","og_locale":"zh_CN","og_type":"article","og_title":"\u8bbe\u5907\u6811\u5b66\u4e605-\u8bfb\u5199\u5b9e\u64cd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u5b9e\u73b0\u4e00\u4e2a\u9a71\u52a8\u8bfb\u53d6\u81ea\u5df1\u5b9a\u4e49\u7684\u8bbe\u5907\u6811 1 \u8bbe\u5907\u6811\u8bfb\u5199\u63a5\u53e3 \u5934\u6587\u4ef6 #include      \/\/\u8282\u70b9\u3001\u5c5e\u6027\u57fa\u7840\u63a5\u53e3 #include  \/\/reg\u7269\u7406\u5730\u5740 #include    \/\/\u4e2d\u65ad #include   \/\/GPIO #include    \/\/\u65f6\u949f #include &lt;li","og_url":"https:\/\/www.wsisp.com\/helps\/92132.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-09T05:17:00+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260809051657-6a780d49c80d2.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/92132.html","url":"https:\/\/www.wsisp.com\/helps\/92132.html","name":"\u8bbe\u5907\u6811\u5b66\u4e605-\u8bfb\u5199\u5b9e\u64cd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-09T05:17:00+00:00","dateModified":"2026-08-09T05:17:00+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/92132.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/92132.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/92132.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u8bbe\u5907\u6811\u5b66\u4e605--\u8bfb\u5199\u5b9e\u64cd"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/92132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=92132"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/92132\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/92131"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=92132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=92132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=92132"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=92132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}