{"id":320,"date":"2025-11-09T10:54:16","date_gmt":"2025-11-09T02:54:16","guid":{"rendered":"https:\/\/szddt.com\/?p=320"},"modified":"2025-11-09T10:56:07","modified_gmt":"2025-11-09T02:56:07","slug":"320","status":"publish","type":"post","link":"https:\/\/szddt.com\/?p=320","title":{"rendered":"nRF54L15\u5c06NFC\u5f15\u811a\u4f5c\u4e3aGPIO\u7684\u65b9\u6cd5"},"content":{"rendered":"\n<p>NCS3.1.1\u7248\u672c\u91cc\uff0cdts\u91cc\u9ed8\u8ba4\u5c06P1.02,P1.03\u4f5c\u4e3aNFCpin\uff0c\u8fd9\u91cc\u9700\u8981\u5728\u914d\u7f6e\u4e2d\u53bb\u6389nfct\u7684\u5b9a\u4e49\uff0c\u540c\u65f6\u8fd8\u8981\u4fee\u6539uicr\u7684\u5185\u5bb9\u3002\u5177\u4f53\u64cd\u4f5c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p>1.\u5728prj.conf\u91cc\u589e\u52a0\u5982\u4e0b\u5185\u5bb9\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/* \u5148\u7981\u7528 NFC\uff0c\u91ca\u653e P1.02 \/ P1.03 *\/\n&amp;nfct {\n\tstatus = \"disabled\";\n};\n\n&amp;uicr {\n      nfct-pins-as-gpios;\n};\n\n\/ {\n    \/* \u5b9a\u4e49\u4e24\u4e2a GPIO \u8282\u70b9\u4f9b C \u7a0b\u5e8f\u8bbf\u95ee *\/\n    gpio_test {\n        compatible = \"gpio-leds\";\n        mygpio1: mygpio1 {\n            gpios = &lt;&amp;gpio1 2 GPIO_ACTIVE_HIGH>;\n        };\n        mygpio2: mygpio2 {\n            gpios = &lt;&amp;gpio1 3 GPIO_ACTIVE_HIGH>;\n        };\n    };\n\n    aliases {\n        mygpio1 = &amp;mygpio1;\n        mygpio2 = &amp;mygpio2;\n    };\n};<\/code><\/pre>\n\n\n\n<p>\u5728\u6d4b\u4ee3\u7801\u91cc\u53ef\u4ee5\u5982\u4e0b\u6d4b\u8bd5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>const struct gpio_dt_spec mygpio1 = GPIO_DT_SPEC_GET(DT_ALIAS(mygpio1), gpios);\nconst struct gpio_dt_spec mygpio2 = GPIO_DT_SPEC_GET(DT_ALIAS(mygpio2), gpios);\n\nint main(void)\n{\n    int i;\n    printk(\"Starting GPIO scan...\\n\");\n\n    gpio_pin_configure_dt(&amp;mygpio1, GPIO_OUTPUT);\n    gpio_pin_configure_dt(&amp;mygpio2, GPIO_OUTPUT);\n\n    while (1) {\n        gpio_pin_toggle_dt(&amp;mygpio1);\n        gpio_pin_toggle_dt(&amp;mygpio2);\n        k_msleep(500);\n    }\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>NCS3.1.1\u7248\u672c\u91cc\uff0cdts\u91cc\u9ed8\u8ba4\u5c06P1.02,P1.03\u4f5c\u4e3aNFCpin\uff0c\u8fd9\u91cc\u9700\u8981\u5728\u914d\u7f6e\u4e2d\u53bb\u6389n&hellip; <a href=\"https:\/\/szddt.com\/?p=320\" class=\"more-link read-more\" rel=\"bookmark\">\u7ee7\u7eed\u9605\u8bfb <span class=\"screen-reader-text\">nRF54L15\u5c06NFC\u5f15\u811a\u4f5c\u4e3aGPIO\u7684\u65b9\u6cd5<\/span><i class=\"fa fa-arrow-right\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":{"0":"post-320","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-4","7":"h-entry","9":"h-as-article"},"_links":{"self":[{"href":"https:\/\/szddt.com\/index.php?rest_route=\/wp\/v2\/posts\/320","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/szddt.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/szddt.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/szddt.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/szddt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=320"}],"version-history":[{"count":3,"href":"https:\/\/szddt.com\/index.php?rest_route=\/wp\/v2\/posts\/320\/revisions"}],"predecessor-version":[{"id":323,"href":"https:\/\/szddt.com\/index.php?rest_route=\/wp\/v2\/posts\/320\/revisions\/323"}],"wp:attachment":[{"href":"https:\/\/szddt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=320"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/szddt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=320"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/szddt.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}