{"id":70364,"date":"2026-02-01T21:17:52","date_gmt":"2026-02-01T13:17:52","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/70364.html"},"modified":"2026-02-01T21:17:52","modified_gmt":"2026-02-01T13:17:52","slug":"stm32%ef%bc%8811%ef%bc%89-gpio%e8%be%93%e5%87%ba%ef%bc%8c%e5%ba%93%e5%87%bd%e6%95%b0%e7%82%b9%e7%81%af","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/70364.html","title":{"rendered":"STM32\uff0811\uff09-- GPIO\u8f93\u51fa\uff0c\u5e93\u51fd\u6570\u70b9\u706f"},"content":{"rendered":"<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"612\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201131745-697f52797d8bb.png\" width=\"1414\" \/><\/p>\n<h2>1. \u786c\u4ef6\u539f\u7406\u56fe<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"230\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201131745-697f5279c7cf1.png\" width=\"618\" \/><\/p>\n<p>\u8981\u70b9\u4eae\u8fd9\u51e0\u4e2aLED\u706f&#xff0c;\u5bf9\u5e94\u5f15\u811a\u90fd\u9700\u8981\u8f93\u51fa\u4f4e\u7535\u5e73<\/p>\n<h2>2.\u00a0 \u8f6f\u4ef6\u8bbe\u8ba1<\/h2>\n<h3>2.1 \u65b0\u589e\u9a71\u52a8\u6587\u4ef6<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"189\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201131745-697f5279d528e.png\" width=\"579\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"222\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201131746-697f527a3c6fa.png\" width=\"579\" \/><\/p>\n<p>\u65b0\u5efaLED\u9a71\u52a8\u7684\u5934\u6587\u4ef6\u548c\u6e90\u6587\u4ef6&#xff0c;<\/p>\n<p>\u6ce8&#xff1a;\u6b64\u5904\u5c06LED\u7684\u4e24\u4e2a\u6587\u4ef6\u65b0\u5efa\u5728\u4e86\u5de5\u7a0b\u7684User\u6587\u4ef6\u5939\u4e2d&#xff0c;\u5c31\u4e0d\u7528\u518d\u5305\u542b\u5934\u6587\u4ef6\u4e86&#xff1b;\u5982\u679c\u5728User\u6587\u4ef6\u5939\u4e0b\u518d\u5efa\u4e86\u4e00\u4e2a\u6587\u4ef6\u5939&#xff0c;\u5c06LED\u7684\u9a71\u52a8\u6587\u4ef6\u653e\u5728\u5176\u4e2d&#xff0c;\u90a3\u9700\u8981\u5728keil\u4e2d\u65b0\u589e\u5934\u6587\u4ef6\u7684\u5305\u542b\u8def\u5f84\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"209\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201131746-697f527a773e1.png\" width=\"567\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"319\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201131746-697f527af3491.png\" width=\"425\" \/><\/p>\n<h3>2.2 \u9a71\u52a8\u6587\u4ef6\u7684\u5b9e\u73b0<\/h3>\n<p>\u5728\u9a71\u52a8\u6587\u4ef6\u4e2d\u80af\u5b9a\u4f1a\u7528\u5230GPIOA\u3001GPIOB\u7b49\u5b8f\u5b9a\u4e49&#xff0c;\u6240\u4ee5\u9700\u8981\u5305\u542b\u201cstm32f4xx.h\u201d\u6587\u4ef6&#xff0c;\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u5305\u542b\u5bc4\u5b58\u5668\u6620\u5c04\u7b49\u5b9a\u4e49<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"216\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201131747-697f527b6049e.png\" width=\"387\" \/><\/p>\n<p><span style=\"color:#fe2c24\">\u5916\u8bbe\u7684\u521d\u59cb\u5316\u914d\u7f6e<\/span><\/p>\n<p><span style=\"color:#fe2c24\">1. \u5f00GPIO\u7684\u65f6\u949f<\/span><\/p>\n<p><span style=\"color:#fe2c24\">2. \u5b9a\u4e49\u4e00\u4e2aGPIO\u7684\u521d\u59cb\u5316\u7ed3\u6784\u4f53<\/span><\/p>\n<p><span style=\"color:#fe2c24\">3. \u914d\u7f6eGPIO\u521d\u59cb\u5316\u7ed3\u6784\u4f53\u6210\u5458<\/span><\/p>\n<p><span style=\"color:#fe2c24\">4. \u8c03\u7528GPIO\u521d\u59cb\u5316\u51fd\u6570&#xff0c;\u628a\u914d\u7f6e\u597d\u7684\u7ed3\u6784\u4f53\u6210\u5458\u7684\u53c2\u6570\u5199\u5165\u5bc4\u5b58\u5668<\/span><\/p>\n<h4>2.2.1 \u5f00\u542f\u65f6\u949f<\/h4>\n<p>\u9700\u5f00\u542fGPIOF\u548cGPIOC\u7684\u65f6\u949f&#xff0c;\u67e5\u624b\u518c&#xff0c;\u8fd9\u4e24\u4e2a\u5916\u8bbe\u4f4d\u4e8eAHB1\u603b\u7ebf\u4e0a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"217\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201131747-697f527b7059d.png\" width=\"512\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"316\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201131747-697f527b8fd8f.png\" width=\"628\" \/><\/p>\n<p>\u6bcf\u4e2a\u51fd\u6570\u90fd\u53ef\u4ee5\u5728.c\u6587\u4ef6\u4e2d\u67e5\u770b\u5b9a\u4e49\u3001\u51fd\u6570\u5f62\u53c2\u7684\u53ef\u53d6\u7684\u503c&#xff0c;\u5982\u4e0b\u793a\u4f8b&#xff1a;<\/p>\n<p>\/**<br \/>\n  * &#064;brief  Enables or disables the AHB1 peripheral clock.<br \/>\n  * &#064;note   After reset, the peripheral clock (used for registers read\/write access)<br \/>\n  *         is disabled and the application software has to enable this clock before<br \/>\n  *         using it.<br \/>\n  * &#064;param  RCC_AHBPeriph: specifies the AHB1 peripheral to gates its clock.<br \/>\n  *          This parameter can be any combination of the following values:<br \/>\n  *            &#064;arg RCC_AHB1Periph_GPIOA:       GPIOA clock<br \/>\n  *            &#064;arg RCC_AHB1Periph_GPIOB:       GPIOB clock<br \/>\n  *            &#064;arg RCC_AHB1Periph_GPIOC:       GPIOC clock<br \/>\n  *            &#064;arg RCC_AHB1Periph_GPIOD:       GPIOD clock<br \/>\n  *            &#064;arg RCC_AHB1Periph_GPIOE:       GPIOE clock<br \/>\n  *            &#064;arg RCC_AHB1Periph_GPIOF:       GPIOF clock<br \/>\n  *            &#064;arg RCC_AHB1Periph_GPIOG:       GPIOG clock<br \/>\n  *            &#064;arg RCC_AHB1Periph_GPIOG:       GPIOG clock<br \/>\n  *            &#064;arg RCC_AHB1Periph_GPIOI:       GPIOI clock<br \/>\n  *            &#064;arg RCC_AHB1Periph_GPIOJ:       GPIOJ clock (STM32F42xxx\/43xxx devices)<br \/>\n  *            &#064;arg RCC_AHB1Periph_GPIOK:       GPIOK clock (STM32F42xxx\/43xxx devices)<br \/>\n  *            &#064;arg RCC_AHB1Periph_CRC:         CRC clock<br \/>\n  *            &#064;arg RCC_AHB1Periph_BKPSRAM:     BKPSRAM interface clock<br \/>\n  *            &#064;arg RCC_AHB1Periph_CCMDATARAMEN CCM data RAM interface clock<br \/>\n  *            &#064;arg RCC_AHB1Periph_DMA1:        DMA1 clock<br \/>\n  *            &#064;arg RCC_AHB1Periph_DMA2:        DMA2 clock<br \/>\n  *            &#064;arg RCC_AHB1Periph_DMA2D:       DMA2D clock (STM32F429xx\/439xx devices)<br \/>\n  *            &#064;arg RCC_AHB1Periph_ETH_MAC:     Ethernet MAC clock<br \/>\n  *            &#064;arg RCC_AHB1Periph_ETH_MAC_Tx:  Ethernet Transmission clock<br \/>\n  *            &#064;arg RCC_AHB1Periph_ETH_MAC_Rx:  Ethernet Reception clock<br \/>\n  *            &#064;arg RCC_AHB1Periph_ETH_MAC_PTP: Ethernet PTP clock<br \/>\n  *            &#064;arg RCC_AHB1Periph_OTG_HS:      USB OTG HS clock<br \/>\n  *            &#064;arg RCC_AHB1Periph_OTG_HS_ULPI: USB OTG HS ULPI clock<br \/>\n  * &#064;param  NewState: new state of the specified peripheral clock.<br \/>\n  *          This parameter can be: ENABLE or DISABLE.<br \/>\n  * &#064;retval None<br \/>\n  *\/<br \/>\nvoid RCC_AHB1PeriphClockCmd(uint32_t RCC_AHB1Periph, FunctionalState NewState)<br \/>\n{<br \/>\n  \/* Check the parameters *\/<br \/>\n  assert_param(IS_RCC_AHB1_CLOCK_PERIPH(RCC_AHB1Periph));<\/p>\n<p>  assert_param(IS_FUNCTIONAL_STATE(NewState));<br \/>\n  if (NewState !&#061; DISABLE)<br \/>\n  {<br \/>\n    RCC-&gt;AHB1ENR |&#061; RCC_AHB1Periph;<br \/>\n  }<br \/>\n  else<br \/>\n  {<br \/>\n    RCC-&gt;AHB1ENR &amp;&#061; ~RCC_AHB1Periph;<br \/>\n  }<br \/>\n}<\/p>\n<p>\/\/1.\u5f00\u542f\u65f6\u949f<br \/>\nRCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC,ENABLE);<br \/>\nRCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOF,ENABLE);<\/p>\n<h4>2.2.2 \u5b9a\u4e49\u521d\u59cb\u5316\u7ed3\u6784\u4f53<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"263\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201131748-697f527ce1db3.png\" width=\"547\" \/><\/p>\n<p>\u6ce8\u91ca\u4e2d\u5199\u660e\u4e86\u53c2\u6570\u53ef\u53d6\u7684\u679a\u4e3e\u503c<\/p>\n<p>\/\/2.\u5b9a\u4e49\u521d\u59cb\u5316\u7ed3\u6784\u4f53<br \/>\nGPIO_InitTypeDef GPIO_InitStruct;<\/p>\n<h4>2.2.3 \u914d\u7f6eGPIO\u521d\u59cb\u5316\u7ed3\u6784\u4f53\u6210\u5458<\/h4>\n<p>    \/\/3.\u914d\u7f6eGPIO\u521d\u59cb\u5316\u7ed3\u6784\u4f53\u6210\u5458<br \/>\nGPIO_InitStruct.GPIO_Pin &#061; GPIO_Pin_6;<br \/>\nGPIO_InitStruct.GPIO_Mode &#061; GPIO_Mode_OUT;<br \/>\nGPIO_InitStruct.GPIO_Speed &#061; GPIO_High_Speed;<br \/>\nGPIO_InitStruct.GPIO_OType &#061; GPIO_OType_PP;<br \/>\nGPIO_InitStruct.GPIO_PuPd &#061; GPIO_PuPd_UP;\/\/\u914d\u7f6e\u4e3a\u4e0a\u62c9\u6a21\u5f0f<\/p>\n<h4>2.2.4 \u8c03\u7528GPIO\u521d\u59cb\u5316\u51fd\u6570<\/h4>\n<p>\/\/4.GPIO\u521d\u59cb\u5316\u51fd\u6570<br \/>\nGPIO_Init(GPIOF,&amp;GPIO_InitStruct);<\/p>\n<p><span style=\"color:#fe2c24\">\u6ce8&#xff1a;\u6b64\u65f6\u5b8c\u6210\u521d\u59cb\u5316\u540e&#xff0c;\u7aef\u53e3\u88ab\u914d\u7f6e\u4e3a\u4e0a\u62c9\u3001\u63a8\u633d\u8f93\u51fa\u6a21\u5f0f&#xff1b;\u67e5\u624b\u518c\u53ef\u77e5&#xff0c;\u5f53\u4e0a\u7535\u590d\u4f4d\u540e&#xff0c;ODR&#xff08;\u8f93\u51fa\u6570\u636e\u5bc4\u5b58\u5668&#xff09;\u9ed8\u8ba4\u591a\u4e3a 0&#xff0c;\u6240\u4ee5\u5f15\u811a\u9ed8\u8ba4\u4f1a\u8f93\u51fa\u4f4e\u7535\u5e73&#xff0c;\u53ea\u8c03\u7528\u6b64\u51fd\u6570\u7684\u8bdd&#xff0c;\u706f\u4f1a\u88ab\u70b9\u4eae\u3002<\/span><\/p>\n<p><span style=\"color:#fe2c24\">\u5185\u90e8\u4e0a\u62c9\u4e3b\u8981\u5f71\u54cd\u8f93\u5165\u6001\/\u9ad8\u963b\u6001\u65f6\u7535\u5e73&#xff1b;\u4e00\u65e6\u63a8\u633d\u8f93\u51fa\u5f00\u59cb\u9a71\u52a8&#xff0c;\u8f93\u51fa\u7535\u5e73&#xff08;\u5c24\u5176\u662f\u4f4e\u7535\u5e73&#xff09;\u4f1a\u8986\u76d6\u4e0a\u62c9\u6548\u679c\u3002<\/span><\/p>\n<h2 style=\"background-color:transparent\">3. \u4e3b\u51fd\u6570\u7684\u5b9e\u73b0<\/h2>\n<p>#include &#034;stm32f4xx.h&#034;<br \/>\n#include &#034;led.h&#034;<\/p>\n<p>void delay(uint32_t count);<br \/>\nint main(void)<br \/>\n{<br \/>\nLED_Config();<\/p>\n<p>while(1)<br \/>\n{<br \/>\nGPIO_SetBits(GPIOF,GPIO_Pin_6);<br \/>\ndelay(0xFFFFFF);<br \/>\nGPIO_ResetBits(GPIOF,GPIO_Pin_6);<br \/>\ndelay(0xFFFFFF);<br \/>\n}<\/p>\n<p>}<\/p>\n<p>void delay(uint32_t count)\/\/\u8f6f\u4ef6\u5ef6\u65f6<br \/>\n{<br \/>\nfor(;count&gt;0;count&#8211;);<br \/>\n}<\/p>\n<h2>4. \u6807\u51c6\u5e93\u8865\u5145\u77e5\u8bc6<\/h2>\n<h3>4.1 \u7cfb\u7edf\u521d\u59cb\u5316&#xff0c;\u65f6\u949f\u914d\u7f6e<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"290\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201131750-697f527eab9a9.png\" width=\"912\" \/><\/p>\n<h3>4.2 \u65ad\u8a00<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"584\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201131750-697f527ed00c6.png\" width=\"890\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"604\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201131751-697f527f1bd2b.png\" width=\"884\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"354\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201131751-697f527f51b4e.png\" width=\"850\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"716\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201131751-697f527f7781c.png\" width=\"904\" \/><\/p>\n<p>\u201c\u65ad\u8a00&#xff08;assert&#xff09;\u201d\u4f60\u53ef\u4ee5\u628a\u5b83\u7406\u89e3\u6210&#xff1a;\u7a0b\u5e8f\u5458\u5728\u4ee3\u7801\u91cc\u5199\u7684\u201c\u6211\u8981\u6c42\u8fd9\u91cc\u5fc5\u987b\u6ee1\u8db3\u67d0\u4e2a\u6761\u4ef6&#xff0c;\u5426\u5219\u7acb\u523b\u62a5\u9519\u201d \u7684\u68c0\u67e5\u3002<\/p>\n<ul>\n<li>\n<p>\u65ad\u8a00 &#061; \u8c03\u8bd5\u671f\u7684\u53c2\u6570\/\u903b\u8f91\u68c0\u67e5<\/p>\n<\/li>\n<li>\n<p>\u6761\u4ef6\u4e0d\u6ee1\u8db3\u5c31\u8fdb\u5165 assert_failed \u8ba9\u4f60\u5feb\u901f\u5b9a\u4f4d\u9519\u8bef<\/p>\n<\/li>\n<li>\n<p>\u4e0d\u60f3\u8981\u5f00\u9500\u5c31\u5173\u95ed&#xff08;\u4e0d\u5b9a\u4e49 USE_FULL_ASSERT&#xff09;&#xff0c;\u5b83\u5c31\u5565\u4e5f\u4e0d\u505a<\/p>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>1. \u786c\u4ef6\u539f\u7406\u56fe\u8981\u70b9\u4eae\u8fd9\u51e0\u4e2aLED\u706f&#xff0c;\u5bf9\u5e94\u5f15\u811a\u90fd\u9700\u8981\u8f93\u51fa\u4f4e\u7535\u5e732.\u00a0 \u8f6f\u4ef6\u8bbe\u8ba12.1 \u65b0\u589e\u9a71\u52a8\u6587\u4ef6\u65b0\u5efaLED\u9a71\u52a8\u7684\u5934\u6587\u4ef6\u548c\u6e90\u6587\u4ef6&#xff0c;\u6ce8&#xff1a;\u6b64\u5904\u5c06LED\u7684\u4e24\u4e2a\u6587\u4ef6\u65b0\u5efa\u5728\u4e86\u5de5\u7a0b\u7684User\u6587\u4ef6\u5939\u4e2d&#xff0c;\u5c31\u4e0d\u7528\u518d\u5305\u542b\u5934\u6587\u4ef6\u4e86&#xff1b;\u5982\u679c\u5728User\u6587\u4ef6\u5939\u4e0b\u518d\u5efa\u4e86\u4e00\u4e2a\u6587\u4ef6\u5939&#xff0c;\u5c06LED\u7684\u9a71\u52a8\u6587\u4ef6\u653e\u5728\u5176\u4e2d&#xff0c;\u90a3\u9700\u8981\u5728keil\u4e2d\u65b0\u589e\u5934\u6587\u4ef6\u7684\u5305\u542b\u8def\u5f84\u30022.2 \u9a71\u52a8\u6587\u4ef6\u7684\u5b9e\u73b0\u5728\u9a71\u52a8\u6587\u4ef6\u4e2d\u80af\u5b9a\u4f1a\u7528\u5230GPIOA\u3001GPIO<\/p>\n","protected":false},"author":2,"featured_media":70349,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[217,270,269],"topic":[],"class_list":["post-70364","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-stm32","tag-270","tag-269"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>STM32\uff0811\uff09- GPIO\u8f93\u51fa\uff0c\u5e93\u51fd\u6570\u70b9\u706f - \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\/70364.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"STM32\uff0811\uff09- GPIO\u8f93\u51fa\uff0c\u5e93\u51fd\u6570\u70b9\u706f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"1. \u786c\u4ef6\u539f\u7406\u56fe\u8981\u70b9\u4eae\u8fd9\u51e0\u4e2aLED\u706f&#xff0c;\u5bf9\u5e94\u5f15\u811a\u90fd\u9700\u8981\u8f93\u51fa\u4f4e\u7535\u5e732.\u00a0 \u8f6f\u4ef6\u8bbe\u8ba12.1 \u65b0\u589e\u9a71\u52a8\u6587\u4ef6\u65b0\u5efaLED\u9a71\u52a8\u7684\u5934\u6587\u4ef6\u548c\u6e90\u6587\u4ef6&#xff0c;\u6ce8&#xff1a;\u6b64\u5904\u5c06LED\u7684\u4e24\u4e2a\u6587\u4ef6\u65b0\u5efa\u5728\u4e86\u5de5\u7a0b\u7684User\u6587\u4ef6\u5939\u4e2d&#xff0c;\u5c31\u4e0d\u7528\u518d\u5305\u542b\u5934\u6587\u4ef6\u4e86&#xff1b;\u5982\u679c\u5728User\u6587\u4ef6\u5939\u4e0b\u518d\u5efa\u4e86\u4e00\u4e2a\u6587\u4ef6\u5939&#xff0c;\u5c06LED\u7684\u9a71\u52a8\u6587\u4ef6\u653e\u5728\u5176\u4e2d&#xff0c;\u90a3\u9700\u8981\u5728keil\u4e2d\u65b0\u589e\u5934\u6587\u4ef6\u7684\u5305\u542b\u8def\u5f84\u30022.2 \u9a71\u52a8\u6587\u4ef6\u7684\u5b9e\u73b0\u5728\u9a71\u52a8\u6587\u4ef6\u4e2d\u80af\u5b9a\u4f1a\u7528\u5230GPIOA\u3001GPIO\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/70364.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-01T13:17:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201131745-697f52797d8bb.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=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/70364.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/70364.html\",\"name\":\"STM32\uff0811\uff09- GPIO\u8f93\u51fa\uff0c\u5e93\u51fd\u6570\u70b9\u706f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-02-01T13:17:52+00:00\",\"dateModified\":\"2026-02-01T13:17:52+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/70364.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/70364.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/70364.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"STM32\uff0811\uff09-- GPIO\u8f93\u51fa\uff0c\u5e93\u51fd\u6570\u70b9\u706f\"}]},{\"@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":"STM32\uff0811\uff09- GPIO\u8f93\u51fa\uff0c\u5e93\u51fd\u6570\u70b9\u706f - \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\/70364.html","og_locale":"zh_CN","og_type":"article","og_title":"STM32\uff0811\uff09- GPIO\u8f93\u51fa\uff0c\u5e93\u51fd\u6570\u70b9\u706f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"1. \u786c\u4ef6\u539f\u7406\u56fe\u8981\u70b9\u4eae\u8fd9\u51e0\u4e2aLED\u706f&#xff0c;\u5bf9\u5e94\u5f15\u811a\u90fd\u9700\u8981\u8f93\u51fa\u4f4e\u7535\u5e732.\u00a0 \u8f6f\u4ef6\u8bbe\u8ba12.1 \u65b0\u589e\u9a71\u52a8\u6587\u4ef6\u65b0\u5efaLED\u9a71\u52a8\u7684\u5934\u6587\u4ef6\u548c\u6e90\u6587\u4ef6&#xff0c;\u6ce8&#xff1a;\u6b64\u5904\u5c06LED\u7684\u4e24\u4e2a\u6587\u4ef6\u65b0\u5efa\u5728\u4e86\u5de5\u7a0b\u7684User\u6587\u4ef6\u5939\u4e2d&#xff0c;\u5c31\u4e0d\u7528\u518d\u5305\u542b\u5934\u6587\u4ef6\u4e86&#xff1b;\u5982\u679c\u5728User\u6587\u4ef6\u5939\u4e0b\u518d\u5efa\u4e86\u4e00\u4e2a\u6587\u4ef6\u5939&#xff0c;\u5c06LED\u7684\u9a71\u52a8\u6587\u4ef6\u653e\u5728\u5176\u4e2d&#xff0c;\u90a3\u9700\u8981\u5728keil\u4e2d\u65b0\u589e\u5934\u6587\u4ef6\u7684\u5305\u542b\u8def\u5f84\u30022.2 \u9a71\u52a8\u6587\u4ef6\u7684\u5b9e\u73b0\u5728\u9a71\u52a8\u6587\u4ef6\u4e2d\u80af\u5b9a\u4f1a\u7528\u5230GPIOA\u3001GPIO","og_url":"https:\/\/www.wsisp.com\/helps\/70364.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-02-01T13:17:52+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201131745-697f52797d8bb.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/70364.html","url":"https:\/\/www.wsisp.com\/helps\/70364.html","name":"STM32\uff0811\uff09- GPIO\u8f93\u51fa\uff0c\u5e93\u51fd\u6570\u70b9\u706f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-02-01T13:17:52+00:00","dateModified":"2026-02-01T13:17:52+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/70364.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/70364.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/70364.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"STM32\uff0811\uff09-- GPIO\u8f93\u51fa\uff0c\u5e93\u51fd\u6570\u70b9\u706f"}]},{"@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\/70364","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=70364"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/70364\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/70349"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=70364"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=70364"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=70364"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=70364"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}