{"id":246,"date":"2024-09-26T18:30:00","date_gmt":"2024-09-26T10:30:00","guid":{"rendered":"https:\/\/www.armfun.cn\/?p=246"},"modified":"2024-10-10T17:50:44","modified_gmt":"2024-10-10T09:50:44","slug":"%ef%bc%88%e4%b8%83%ef%bc%89protues%e4%bb%bf%e7%9c%9fstm32%e5%8d%95%e7%89%87%e6%9c%bagpio%e5%a4%96%e9%83%a8%e4%b8%ad%e6%96%ad","status":"publish","type":"post","link":"https:\/\/www.armfun.cn\/?p=246","title":{"rendered":"\uff08\u4e03\uff09Proteus\u4eff\u771fSTM32\u5355\u7247\u673aGPIO\u5916\u90e8\u4e2d\u65ad"},"content":{"rendered":"\n<p>1\uff0c\u5728\u4e0a\u4e00\u8282\u7684\u9879\u76ee\u4e2d\uff0c\u589e\u52a0\u914d\u7f6ePC14\u548cPC15\u4e3aEXTI\u6a21\u5f0f<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"667\" height=\"612\" src=\"https:\/\/www.armfun.cn\/wp-content\/uploads\/2024\/09\/image-24.png\" alt=\"\" class=\"wp-image-247\" srcset=\"https:\/\/www.armfun.cn\/wp-content\/uploads\/2024\/09\/image-24.png 667w, https:\/\/www.armfun.cn\/wp-content\/uploads\/2024\/09\/image-24-300x275.png 300w\" sizes=\"(max-width: 667px) 100vw, 667px\" \/><\/figure>\n\n\n\n<p>2\uff0c\u5728SystemCore-&gt;GPIO\u4e2d\u914d\u7f6eGPIO14\u548cGPIO15\u542f\u7528\u5185\u90e8\u4e0a\u62c9\uff0c\u5e76\u914d\u7f6e\u914d\u4e0b\u964d\u6cbf\u4e2d\u65ad<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"905\" height=\"267\" src=\"https:\/\/www.armfun.cn\/wp-content\/uploads\/2024\/09\/image-25.png\" alt=\"\" class=\"wp-image-248\" srcset=\"https:\/\/www.armfun.cn\/wp-content\/uploads\/2024\/09\/image-25.png 905w, https:\/\/www.armfun.cn\/wp-content\/uploads\/2024\/09\/image-25-300x89.png 300w, https:\/\/www.armfun.cn\/wp-content\/uploads\/2024\/09\/image-25-768x227.png 768w, https:\/\/www.armfun.cn\/wp-content\/uploads\/2024\/09\/image-25-670x198.png 670w\" sizes=\"(max-width: 905px) 100vw, 905px\" \/><\/figure>\n\n\n\n<p>3\uff0c\u4f7f\u80fdGPIO EXTI line[15:10]\u4e2d\u65ad\uff0c\u751f\u6210\u4ee3\u7801<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"892\" height=\"215\" src=\"https:\/\/www.armfun.cn\/wp-content\/uploads\/2024\/09\/image-26.png\" alt=\"\" class=\"wp-image-249\" srcset=\"https:\/\/www.armfun.cn\/wp-content\/uploads\/2024\/09\/image-26.png 892w, https:\/\/www.armfun.cn\/wp-content\/uploads\/2024\/09\/image-26-300x72.png 300w, https:\/\/www.armfun.cn\/wp-content\/uploads\/2024\/09\/image-26-768x185.png 768w, https:\/\/www.armfun.cn\/wp-content\/uploads\/2024\/09\/image-26-670x161.png 670w\" sizes=\"(max-width: 892px) 100vw, 892px\" \/><\/figure>\n\n\n\n<p>4,\u91cd\u5199__weak void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)\u51fd\u6570\uff0c\u5904\u7406\u4e2d\u65ad\u6e90<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)\n{\n  if(GPIO_Pin==GPIO_PIN_14)\n\t{\n\t\tkey1_action();\n\t}\n\tif(GPIO_Pin==GPIO_PIN_15)\n\t{\n\t\tkey2_action();\n\t}\n}<\/code><\/pre>\n\n\n\n<p>5\uff0c\u4fee\u6539\u663e\u793a\u56fe\u7247\u5207\u6362\u51fd\u6570\uff0c\u5b9e\u73b0\u6309\u952e\u5207\u6362<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>static char sel=0;\nvoid disp_pic_switch()\n{\n\tswitch(sel)\n\t{\n\t\tcase 0:memcpy(dispbuff,pic1,8);break;\n\t\tcase 1:memcpy(dispbuff,pic2,8);break;\n\t\tcase 2:memcpy(dispbuff,pic3,8);break;\n\t\tcase 3:memcpy(dispbuff,pic4,8);break;\n\t\tcase 4:memcpy(dispbuff,pic5,8);break;\n\t\tcase 5:memcpy(dispbuff,pic6,8);break;\n\t}\n\t\/\/sel++;\n\t\/\/if(sel&gt;=6)\n\t\/\/\tsel=0;\n}\nvoid key1_action()\n{\n\tsel++;\n\tif(sel&gt;=6)\n\t\tsel=0;\n}\nvoid key2_action()\n{\n\tif(sel&gt;0)\n\t\tsel--;\n\telse\n\t\tsel=5;\n}<\/code><\/pre>\n\n\n\n<p>6,protues\u5185\u589e\u52a02\u4e2a\u6309\u952e\u5982\u4e0b\u56fe<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"898\" height=\"671\" src=\"https:\/\/www.armfun.cn\/wp-content\/uploads\/2024\/09\/image-27.png\" alt=\"\" class=\"wp-image-250\" srcset=\"https:\/\/www.armfun.cn\/wp-content\/uploads\/2024\/09\/image-27.png 898w, https:\/\/www.armfun.cn\/wp-content\/uploads\/2024\/09\/image-27-300x224.png 300w, https:\/\/www.armfun.cn\/wp-content\/uploads\/2024\/09\/image-27-768x574.png 768w, https:\/\/www.armfun.cn\/wp-content\/uploads\/2024\/09\/image-27-670x501.png 670w\" sizes=\"(max-width: 898px) 100vw, 898px\" \/><\/figure>\n\n\n\n<p>\u5728STM32\u4e2d\uff0cEXTI0-EXTI15\u5bf9\u5e94GPIO\u76840-15\u53f7\u5f15\u811a\u3002\u5bf9\u4e8e\u67d0\u4e00\u7279\u5b9a\u7684EXTI\u7ebf\uff0c\u4f8b\u5982EXTI0\uff0c\u53ea\u80fd\u9009\u62e9\u67d0\u4e00\u7ec4GPIO\uff08\u5982GPIOA\u3001GPIOB\u3001GPIOC\u7b49\uff09\u7684\u7b2c0\u53f7\u5f15\u811a\u6765\u89e6\u53d1\u8be5\u4e2d\u65ad\uff0c\u4e0d\u80fd\u540c\u65f6\u4f7f\u7528\u591a\u4e2a\u4e0d\u540c\u7ec4\u7684GPIO0\u5f15\u811a\u5171\u4eab\u540c\u4e00EXTI\u7ebf\u3002<\/p>\n\n\n\n<p>\u4e3e\u4e2a\u4f8b\u5b50\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>EXTI0 \u53ef\u4ee5\u8fde\u63a5\u5230 GPIOA_PIN_0\u3001GPIOB_PIN_0\u3001GPIOC_PIN_0 \u7b49\uff0c\u4f46\u5728\u4e00\u4e2a\u65f6\u95f4\u70b9\u53ea\u80fd\u9009\u62e9\u5176\u4e2d\u4e00\u4e2a\u5f15\u811a\u8fdb\u884c\u914d\u7f6e\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u5982\u679c\u9700\u8981\u591a\u4e2aGPIO\u5f15\u811a\u540c\u65f6\u54cd\u5e94\u4e2d\u65ad\uff0c\u901a\u5e38\u9700\u8981\u914d\u7f6e\u4e0d\u540c\u7684EXTI\u7ebf\u6765\u5206\u522b\u5904\u7406\u4e0d\u540c\u7684GPIO\u5f15\u811a\u3002<\/p>\n\n\n\n<p>git\u6e90\u7801\uff1a<a href=\"https:\/\/gitee.com\/armfun\/stm32_proteus\">https:\/\/gitee.com\/armfun\/stm32_proteus<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1\uff0c\u5728\u4e0a\u4e00\u8282\u7684\u9879\u76ee\u4e2d\uff0c\u589e\u52a0\u914d\u7f6ePC14\u548cPC15\u4e3aEXTI\u6a21\u5f0f 2\uff0c\u5728S&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-246","post","type-post","status-publish","format-standard","hentry","category-arm"],"views":1207,"_links":{"self":[{"href":"https:\/\/www.armfun.cn\/index.php?rest_route=\/wp\/v2\/posts\/246","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.armfun.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.armfun.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.armfun.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.armfun.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=246"}],"version-history":[{"count":8,"href":"https:\/\/www.armfun.cn\/index.php?rest_route=\/wp\/v2\/posts\/246\/revisions"}],"predecessor-version":[{"id":327,"href":"https:\/\/www.armfun.cn\/index.php?rest_route=\/wp\/v2\/posts\/246\/revisions\/327"}],"wp:attachment":[{"href":"https:\/\/www.armfun.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.armfun.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.armfun.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}