{"id":40585,"date":"2023-10-05T13:10:31","date_gmt":"2023-10-05T05:10:31","guid":{"rendered":"https:\/\/www.techphant.cn\/?p=40585"},"modified":"2023-10-05T13:10:31","modified_gmt":"2023-10-05T05:10:31","slug":"swbzdxjhsx","status":"publish","type":"post","link":"https:\/\/www.techphant.cn\/blog\/40585.html","title":{"rendered":"STM32\u5916\u90e8\u4e2d\u65ad14\uff1a\u8be6\u89e3\u548c\u5b9e\u73b0"},"content":{"rendered":"

  STM32\u5916\u90e8\u4e2d\u65ad14\uff0c\u53c8\u79f0\u5916\u90e8\u4e2d\u65adEXTI14\uff0c\u662fSTM32\u5fae\u63a7\u5236\u5668\u7684\u4e00\u79cd\u5916\u90e8\u4e2d\u65ad\uff0c\u5b83\u53ef\u4ee5\u68c0\u6d4b\u5916\u90e8\u8bbe\u5907\u7684\u4e2d\u65ad\u4fe1\u53f7\uff0c\u5e76\u5728\u68c0\u6d4b\u5230\u4fe1\u53f7\u65f6\u89e6\u53d1\u4e2d\u65ad\u5904\u7406\u51fd\u6570\uff0c\u4ece\u800c\u5b9e\u73b0\u5916\u90e8\u8bbe\u5907\u7684\u4e2d\u65ad\u63a7\u5236\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecdSTM32\u5916\u90e8\u4e2d\u65ad14\u7684\u539f\u7406\uff0c\u5e76\u63d0\u4f9b\u5b9e\u73b0\u6b65\u9aa4\uff0c\u4ee5\u5e2e\u52a9\u8bfb\u8005\u66f4\u597d\u7684\u7406\u89e3\u548c\u4f7f\u7528\u8fd9\u4e00\u529f\u80fd\u3002<\/p>\n

1. STM32\u5916\u90e8\u4e2d\u65ad14\u7684\u539f\u7406<\/h2>\n

  STM32\u5916\u90e8\u4e2d\u65ad14\u662fSTM32\u5fae\u63a7\u5236\u5668\u7684\u4e00\u79cd\u5916\u90e8\u4e2d\u65ad\uff0c\u5b83\u53ef\u4ee5\u68c0\u6d4b\u5916\u90e8\u8bbe\u5907\u7684\u4e2d\u65ad\u4fe1\u53f7\uff0c\u5e76\u5728\u68c0\u6d4b\u5230\u4fe1\u53f7\u65f6\u89e6\u53d1\u4e2d\u65ad\u5904\u7406\u51fd\u6570\uff0c\u4ece\u800c\u5b9e\u73b0\u5916\u90e8\u8bbe\u5907\u7684\u4e2d\u65ad\u63a7\u5236\u3002STM32\u5916\u90e8\u4e2d\u65ad14\u7684\u5de5\u4f5c\u539f\u7406\u662f\uff1a\u5728\u5916\u90e8\u8bbe\u5907\u7684\u4e2d\u65ad\u4fe1\u53f7\u8f93\u5165\u7aef\uff0c\u63a5\u5165STM32\u5fae\u63a7\u5236\u5668\u7684\u5916\u90e8\u4e2d\u65ad14\u8f93\u5165\u7aef\uff1b\u5f53\u5916\u90e8\u8bbe\u5907\u53d1\u51fa\u4e2d\u65ad\u4fe1\u53f7\u65f6\uff0cSTM32\u5fae\u63a7\u5236\u5668\u4f1a\u68c0\u6d4b\u5230\u4fe1\u53f7\uff0c\u5e76\u89e6\u53d1\u76f8\u5e94\u7684\u4e2d\u65ad\u5904\u7406\u51fd\u6570\uff0c\u4ece\u800c\u5b9e\u73b0\u5916\u90e8\u8bbe\u5907\u7684\u4e2d\u65ad\u63a7\u5236\u3002<\/p>\n

2. STM32\u5916\u90e8\u4e2d\u65ad14\u7684\u5b9e\u73b0\u6b65\u9aa4<\/h2>\n

  2.1 \u914d\u7f6eEXTI14\u5f15\u811a<\/h3>\n

  \u9996\u5148\uff0c\u9700\u8981\u914d\u7f6eSTM32\u5fae\u63a7\u5236\u5668\u7684EXTI14\u5f15\u811a\uff0c\u4ee5\u4fbf\u5916\u90e8\u8bbe\u5907\u7684\u4e2d\u65ad\u4fe1\u53f7\u53ef\u4ee5\u88ab\u68c0\u6d4b\u5230\u3002\u5177\u4f53\u7684\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n

    \n
  1. \u6253\u5f00STM32CubeMX\uff0c\u9009\u62e9\u5bf9\u5e94\u7684STM32\u5fae\u63a7\u5236\u5668\uff0c\u5e76\u6253\u5f00\u5bf9\u5e94\u7684\u5de5\u7a0b\uff1b<\/li>\n
  2. \u5728Pinout & Configuration\u9875\u9762\uff0c\u9009\u62e9EXTI14\u5f15\u811a\uff0c\u5e76\u5728GPIO Configuration\u9875\u9762\uff0c\u5c06\u8be5\u5f15\u811a\u7684Mode\u9009\u62e9\u4e3aInput\uff0c\u4ee5\u4fbf\u63a5\u6536\u5916\u90e8\u8bbe\u5907\u7684\u4e2d\u65ad\u4fe1\u53f7\uff1b<\/li>\n
  3. \u5728NVIC Settings\u9875\u9762\uff0c\u52fe\u9009EXTI14\u7684\u4e2d\u65ad\uff0c\u4ee5\u4fbf\u5728\u68c0\u6d4b\u5230\u5916\u90e8\u8bbe\u5907\u7684\u4e2d\u65ad\u4fe1\u53f7\u65f6\uff0c\u53ef\u4ee5\u89e6\u53d1\u4e2d\u65ad\u5904\u7406\u51fd\u6570\uff1b<\/li>\n
  4. \u70b9\u51fbGenerate Code\uff0c\u751f\u6210STM32\u5de5\u7a0b\u4ee3\u7801\uff1b<\/li>\n
  5. \u5728\u751f\u6210\u7684\u5de5\u7a0b\u4ee3\u7801\u4e2d\uff0c\u627e\u5230main.c\u6587\u4ef6\uff0c\u5728\u8be5\u6587\u4ef6\u4e2d\uff0c\u5c06EXTI14\u5f15\u811a\u7684GPIO\u914d\u7f6e\u4e3a\u8f93\u5165\u6a21\u5f0f\uff0c\u4ee5\u4fbf\u63a5\u6536\u5916\u90e8\u8bbe\u5907\u7684\u4e2d\u65ad\u4fe1\u53f7\uff1b<\/li>\n
  6. \u5728main.c\u6587\u4ef6\u4e2d\uff0c\u5b9e\u73b0EXTI14\u7684\u4e2d\u65ad\u5904\u7406\u51fd\u6570\uff0c\u4ee5\u4fbf\u5728\u68c0\u6d4b\u5230\u5916\u90e8\u8bbe\u5907\u7684\u4e2d\u65ad\u4fe1\u53f7\u65f6\uff0c\u53ef\u4ee5\u6267\u884c\u76f8\u5e94\u7684\u5904\u7406\u51fd\u6570\uff1b<\/li>\n
  7. \u7f16\u8bd1\u5e76\u70e7\u5f55STM32\u5de5\u7a0b\u4ee3\u7801\uff0c\u4ee5\u4fbf\u5728\u5916\u90e8\u8bbe\u5907\u53d1\u51fa\u4e2d\u65ad\u4fe1\u53f7\u65f6\uff0c\u53ef\u4ee5\u89e6\u53d1EXTI14\u7684\u4e2d\u65ad\u5904\u7406\u51fd\u6570\uff0c\u4ece\u800c\u5b9e\u73b0\u5916\u90e8\u8bbe\u5907\u7684\u4e2d\u65ad\u63a7\u5236\u3002<\/li>\n<\/ol>\n

      2.2 \u4f7f\u7528EXTI14\u7684\u6ce8\u610f\u4e8b\u9879<\/h3>\n

      \u5728\u4f7f\u7528STM32\u5916\u90e8\u4e2d\u65ad14\u65f6\uff0c\u9700\u8981\u6ce8\u610f\u4ee5\u4e0b\u51e0\u70b9\uff1a<\/p>\n

      \n
    • \u9996\u5148\uff0c\u9700\u8981\u6b63\u786e\u914d\u7f6eEXTI14\u5f15\u811a\uff0c\u4ee5\u4fbf\u63a5\u6536\u5916\u90e8\u8bbe\u5907\u7684\u4e2d\u65ad\u4fe1\u53f7\uff1b<\/li>\n
    • \u5176\u6b21\uff0c\u9700\u8981\u6b63\u786e\u5b9e\u73b0EXTI14\u7684\u4e2d\u65ad\u5904\u7406\u51fd\u6570\uff0c\u4ee5\u4fbf\u5728\u68c0\u6d4b\u5230\u5916\u90e8\u8bbe\u5907\u7684\u4e2d\u65ad\u4fe1\u53f7\u65f6\uff0c\u53ef\u4ee5\u6267\u884c\u76f8\u5e94\u7684\u5904\u7406\u51fd\u6570\uff1b<\/li>\n
    • \u6700\u540e\uff0c\u9700\u8981\u786e\u4fdd\u5916\u90e8\u8bbe\u5907\u7684\u4e2d\u65ad\u4fe1\u53f7\u8db3\u591f\u7a33\u5b9a\uff0c\u4ee5\u4fbf\u53ef\u4ee5\u53ca\u65f6\u89e6\u53d1EXTI14\u7684\u4e2d\u65ad\u5904\u7406\u51fd\u6570\uff0c\u4ece\u800c\u5b9e\u73b0\u5916\u90e8\u8bbe\u5907\u7684\u4e2d\u65ad\u63a7\u5236\u3002<\/li>\n<\/ul>\n

      3. \u603b\u7ed3<\/h2>\n

        \u672c\u6587\u8be6\u7ec6\u4ecb\u7ecd\u4e86STM32\u5916\u90e8\u4e2d\u65ad14\u7684\u539f\u7406\u548c\u5b9e\u73b0\u6b65\u9aa4\uff0c\u5e76\u7ed9\u51fa\u4e86\u4f7f\u7528EXTI14\u7684\u6ce8\u610f\u4e8b\u9879\uff0c\u5e0c\u671b\u80fd\u591f\u5e2e\u52a9\u8bfb\u8005\u66f4\u597d\u7684\u7406\u89e3\u548c\u4f7f\u7528\u8fd9\u4e00\u529f\u80fd\u3002<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"

      STM32\u5916\u90e8\u4e2d\u65ad14\uff0c\u53c8\u79f0\u5916\u90e8\u4e2d\u65adEXTI14\uff0c\u662fSTM32\u5fae\u63a7\u5236\u5668\u7684\u4e00\u79cd\u5916\u90e8\u4e2d\u65ad\uff0c\u5b83\u53ef\u4ee5\u68c0\u6d4b\u5916\u90e8\u8bbe\u5907\u7684\u4e2d\u65ad\u4fe1\u53f7\uff0c\u5e76\u5728\u68c0\u6d4b\u5230\u4fe1\u53f7\u65f6\u89e6\u53d1\u4e2d\u65ad\u5904\u7406\u51fd\u6570\uff0c\u4ece\u800c\u5b9e\u73b0\u5916\u90e8\u8bbe\u5907\u7684\u4e2d<\/p>\n","protected":false},"author":1,"featured_media":4132,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"categories":[36],"tags":[287],"class_list":["post-40585","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-stm32"],"_links":{"self":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/40585","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/comments?post=40585"}],"version-history":[{"count":0,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/40585\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media\/4132"}],"wp:attachment":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media?parent=40585"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/categories?post=40585"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/tags?post=40585"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}