{"id":62629,"date":"2026-01-20T11:58:06","date_gmt":"2026-01-20T03:58:06","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/62629.html"},"modified":"2026-01-20T11:58:06","modified_gmt":"2026-01-20T03:58:06","slug":"stm32-%e6%a0%87%e5%87%86%e5%a4%96%e8%ae%be%e5%ba%93%e4%b8%ad%e5%85%b3%e4%ba%8e-gpio%ef%bc%88%e9%80%9a%e7%94%a8%e8%be%93%e5%85%a5%e8%be%93%e5%87%ba%ef%bc%89-%e6%a8%a1%e5%9d%97%e7%9a%84%e5%87%bd","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/62629.html","title":{"rendered":"STM32 \u6807\u51c6\u5916\u8bbe\u5e93\u4e2d\u5173\u4e8e GPIO\uff08\u901a\u7528\u8f93\u5165\u8f93\u51fa\uff09 \u6a21\u5757\u7684\u51fd\u6570\u58f0\u660e"},"content":{"rendered":"<p>\u8fd9\u4e9b\u51fd\u6570\u901a\u5e38\u4f4d\u4e8e stm32f10x_gpio.h \u6587\u4ef6\u4e2d&#xff0c;\u4e3a\u4e86\u65b9\u4fbf\u4f60\u7406\u89e3&#xff0c;\u6211\u5c06\u8fd9\u4e9b\u51fd\u6570\u6309\u7167\u529f\u80fd\u903b\u8f91\u8fdb\u884c\u4e86\u5206\u7c7b\u89e3\u6790&#xff1a;<\/p>\n<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"1.%E5%88%9D%E5%A7%8B%E5%8C%96%E4%B8%8E%E9%85%8D%E7%BD%AE%E5%87%BD%E6%95%B0-toc\" style=\"margin-left:0px\">1.\u521d\u59cb\u5316\u4e0e\u914d\u7f6e\u51fd\u6570<\/p>\n<p id=\"2.%E8%AF%BB%E5%8F%96%E8%BE%93%E5%85%A5%E4%BF%A1%E5%8F%B7%E5%87%BD%E6%95%B0-toc\" style=\"margin-left:0px\">2.\u8bfb\u53d6\u8f93\u5165\u4fe1\u53f7\u51fd\u6570<\/p>\n<p id=\"3.%E8%AF%BB%E5%8F%96%E8%BE%93%E5%87%BA%E7%8A%B6%E6%80%81%E5%87%BD%E6%95%B0-toc\" style=\"margin-left:0px\">3.\u8bfb\u53d6\u8f93\u51fa\u72b6\u6001\u51fd\u6570<\/p>\n<p id=\"4.%E6%8E%A7%E5%88%B6%E8%BE%93%E5%87%BA%E7%94%B5%E5%B9%B3%E5%87%BD%E6%95%B0-toc\" style=\"margin-left:0px\">4.\u63a7\u5236\u8f93\u51fa\u7535\u5e73\u51fd\u6570<\/p>\n<p id=\"5.%E9%AB%98%E7%BA%A7%2F%E7%89%B9%E6%AE%8A%E5%8A%9F%E8%83%BD%E5%87%BD%E6%95%B0-toc\" style=\"margin-left:0px\">5.\u9ad8\u7ea7\/\u7279\u6b8a\u529f\u80fd\u51fd\u6570<\/p>\n<p id=\"1.GPIO_Init(%E6%9C%80%E5%9F%BA%E7%A1%80%3A%E5%88%9D%E5%A7%8B%E5%8C%96%E5%BC%95%E8%84%9A)-toc\" style=\"margin-left:0px\">1.GPIO_Init(\u6700\u57fa\u7840:\u521d\u59cb\u5316\u5f15\u811a)<\/p>\n<p id=\"2.GPIO_SetBits%2F%20GPIO_ResetBits%20(%E6%8E%A7%E5%88%B6%E8%BE%93%E5%87%BA)-toc\" style=\"margin-left:0px\">2.GPIO_SetBits\/ GPIO_ResetBits (\u63a7\u5236\u8f93\u51fa)<\/p>\n<p id=\"3.%20GPIO_ReadInputDataBit%20(%E8%AF%BB%E5%8F%96%E7%8A%B6%E6%80%81)-toc\" style=\"margin-left:0px\">3. GPIO_ReadInputDataBit (\u8bfb\u53d6\u72b6\u6001)<\/p>\n<p id=\"4.%20GPIO_EXTILineConfig%20(%E4%B8%AD%E6%96%AD%E6%98%A0%E5%B0%84)-toc\" style=\"margin-left:0px\">4. GPIO_EXTILineConfig (\u4e2d\u65ad\u6620\u5c04)<\/p>\n<p id=\"%E7%89%B9%E5%88%AB%E6%8F%90%E9%86%92%3A%E9%85%8D%E7%BD%AE%E4%B8%89%E9%83%A8%E6%9B%B2-toc\" style=\"margin-left:0px\">\u7279\u522b\u63d0\u9192:\u914d\u7f6e\u4e09\u90e8\u66f2<\/p>\n<hr id=\"hr-toc\" \/>\n<h2 id=\"1.%E5%88%9D%E5%A7%8B%E5%8C%96%E4%B8%8E%E9%85%8D%E7%BD%AE%E5%87%BD%E6%95%B0\">1.\u521d\u59cb\u5316\u4e0e\u914d\u7f6e\u51fd\u6570<\/h2>\n<p>\u8fd9\u7c7b\u51fd\u6570\u7528\u4e8e\u8bbe\u7f6e\u5f15\u811a\u7684\u5de5\u4f5c\u6a21\u5f0f(\u5982\u63a8\u633d\u8f93\u51fa\u3001\u6d6e\u7a7a\u8f93\u5165\u7b49)\u548c\u901f\u5ea6\u3002<\/p>\n<p><span style=\"color:#ff9900\">GPI0_DeInit<\/span>:\u5c06\u5916\u8bbeGPIOx\u5bc4\u5b58\u5668\u91cd\u8bbe\u4e3a\u9ed8\u8ba4\u503c(\u590d\u4f4d)\u3002 <span style=\"color:#ff9900\">GPI0_AFI0DeInit<\/span>:\u5c06\u590d\u4f4d\u5907\u7528\u529f\u80fd(AFIO)\u5bc4\u5b58\u5668\u91cd\u8bbe\u4e3a\u9ed8\u8ba4\u503c\u3002 <span style=\"color:#ff9900\">GPIO Init<\/span>:\u6700\u5e38\u7528\u7684\u51fd\u6570\u3002\u6839\u636eGPI0InitStruct\u4e2d\u6307\u5b9a\u7684\u53c2\u6570\u521d\u59cb\u5316 GPIOx\u3002 <span style=\"color:#ff9900\">GPI0_StructInit<\/span>:\u628aGPI0_InitStruct \u4e2d\u7684\u6210\u5458\u586b\u5165\u9ed8\u8ba4\u503c(\u65b9\u4fbf\u540e\u7eed\u4fee\u6539)\u3002<\/p>\n<h2 id=\"2.%E8%AF%BB%E5%8F%96%E8%BE%93%E5%85%A5%E4%BF%A1%E5%8F%B7%E5%87%BD%E6%95%B0\">2.\u8bfb\u53d6\u8f93\u5165\u4fe1\u53f7\u51fd\u6570<\/h2>\n<p>\u7528\u4e8e\u68c0\u6d4b\u5f15\u811a\u4e0a\u7684\u7535\u5e73\u72b6\u6001(\u9ad8\u7535\u5e73\u6216\u4f4e\u7535\u5e73)\u3002<\/p>\n<p><span style=\"color:#ff9900\">GPI0 ReadInputDataBit<\/span>:\u8bfb\u53d6\u6307\u5b9a GPIO\u7aef\u53e3\u7684\u67d0\u4e2a\u7279\u5b9a\u5f15\u811a\u7684\u8f93\u5165\u503c\u3002 <span style=\"color:#ff9900\">GPI0_ReadInputData<\/span>:\u8bfb\u53d6\u6574\u4e2aGPIO\u7aef\u53e3(16\u4f4d)\u7684\u8f93\u5165\u503c\u3002<\/p>\n<h2 id=\"3.%E8%AF%BB%E5%8F%96%E8%BE%93%E5%87%BA%E7%8A%B6%E6%80%81%E5%87%BD%E6%95%B0\">3.\u8bfb\u53d6\u8f93\u51fa\u72b6\u6001\u51fd\u6570<\/h2>\n<p>\u7528\u4e8e\u67e5\u770b\u4f60\u4e4b\u524d\u7ed9\u5f15\u811a\u8bbe\u7f6e\u4e86\u4ec0\u4e48\u7535\u5e73\u3002<\/p>\n<p><span style=\"color:#ff9900\">GPI0 ReadOutputDataBit<\/span>:\u8bfb\u53d6\u6307\u5b9a\u7aef\u53e3\u67d0\u4e2a\u5f15\u811a\u7684\u8f93\u51fa\u72b6\u6001\u3002 <span style=\"color:#ff9900\">GPI0_ReadOutputData<\/span>:\u8bfb\u53d6\u6574\u4e2a\u7aef\u53e3\u7684\u8f93\u51fa\u72b6\u6001\u3002<\/p>\n<h2 id=\"4.%E6%8E%A7%E5%88%B6%E8%BE%93%E5%87%BA%E7%94%B5%E5%B9%B3%E5%87%BD%E6%95%B0\">4.\u63a7\u5236\u8f93\u51fa\u7535\u5e73\u51fd\u6570<\/h2>\n<p>\u7528\u4e8e\u8ba9\u5f15\u811a\u8f93\u51fa\u9ad8\u7535\u5e73\u6216\u4f4e\u7535\u5e73(\u5e38\u7528\u4e8e\u63a7\u5236LED\u3001\u7ee7\u7535\u5668\u7b49)\u3002<\/p>\n<p><span style=\"color:#ff9900\">GPI0_SetBits<\/span>:\u5c06\u6307\u5b9a\u7684\u5f15\u811a\u8bbe\u7f6e\u4e3a\u9ad8\u7535\u5e73(1)\u3002 <span style=\"color:#ff9900\">GPI0 ResetBits<\/span>:\u5c06\u6307\u5b9a\u7684\u5f15\u811a\u8bbe\u7f6e\u4e3a\u4f4e\u7535\u5e73(0)\u3002 <span style=\"color:#ff9900\">GPI0_WriteBit<\/span>:\u5411\u6307\u5b9a\u5f15\u811a\u5199\u5165\u503c(\u9ad8\u7535\u5e73\u6216\u4f4e\u7535\u5e73)\u3002 <span style=\"color:#ff9900\">GPI0 Write<\/span>:\u5411\u6574\u4e2aGPIO\u7aef\u53e3\u5199\u5165\u6570\u636e(\u4e00\u6b21\u6027\u63a7\u523616\u4e2a\u5f15\u811a)\u3002<\/p>\n<h2 id=\"5.%E9%AB%98%E7%BA%A7%2F%E7%89%B9%E6%AE%8A%E5%8A%9F%E8%83%BD%E5%87%BD%E6%95%B0\">5.\u9ad8\u7ea7\/\u7279\u6b8a\u529f\u80fd\u51fd\u6570<\/h2>\n<p>\u7528\u4e8e\u9501\u5b9a\u914d\u7f6e\u3001\u5f15\u811a\u590d\u7528\u6216\u4e2d\u65ad\u6620\u5c04\u3002<\/p>\n<p><span style=\"color:#ff9900\">GPI0 PinLockConfig<\/span>:\u9501\u5b9a\u5f15\u811a\u914d\u7f6e\u3002\u9501\u5b9a\u540e&#xff0c;\u76f4\u5230\u4e0b\u6b21\u590d\u4f4d\u524d\u90fd\u4e0d\u80fd\u66f4\u6539\u8be5\u5f15\u811a\u7684\u8bbe\u7f6e\u3002 <span style=\"color:#ff9900\">GPI0_EventOutputConfig<\/span>:\u914d\u7f6e\u4e8b\u4ef6\u8f93\u51fa\u5f15\u811a\u3002 <span style=\"color:#ff9900\">GPI0_EventOutputCmd<\/span>:\u4f7f\u80fd\u6216\u5931\u80fd\u4e8b\u4ef6\u8f93\u51fa\u3002 <span style=\"color:#ff9900\">GPI0_PinRemapConfig<\/span>:\u5f15\u811a\u91cd\u6620\u5c04\u3002\u6539\u53d8\u67d0\u4e9b\u5916\u8bbe(\u5982\u5b9a\u65f6\u5668\u3001\u4e32\u53e3)\u5bf9\u5e94\u7684\u7269\u7406\u5f15\u811a\u3002 <span style=\"color:#ff9900\">GPI0_EXTILineConfig<\/span>:\u9009\u62e9GPIO\u5f15\u811a\u4f5c\u4e3a\u5916\u90e8\u4e2d\u65ad\u7ebf(EXTI)\u3002 <span style=\"color:#ff9900\">GPI0_ETH_MediaInterfaceConfig<\/span>:\u914d\u7f6e\u4ee5\u592a\u7f51\u63a5\u53e3(\u4ec5\u9002\u7528\u4e8e\u5e26\u4ee5\u592a\u7f51\u63a7\u5236\u5668\u7684\u578b\u53f7)\u3002<\/p>\n<p>\u6311\u9009\u4e86\u5728 STM32 \u5f00\u53d1\u4e2d\u6700\u6838\u5fc3\u3001\u6700\u5e38\u7528\u7684\u51e0\u4e2a\u51fd\u6570&#xff0c;\u5e76\u7ed3\u5408\u4ee3\u7801\u793a\u4f8b\u8fdb\u884c\u89e3\u6790<\/p>\n<h2 id=\"1.GPIO_Init(%E6%9C%80%E5%9F%BA%E7%A1%80%3A%E5%88%9D%E5%A7%8B%E5%8C%96%E5%BC%95%E8%84%9A)\">1.GPIO_Init(\u6700\u57fa\u7840:\u521d\u59cb\u5316\u5f15\u811a)<\/h2>\n<p>\u529f\u80fd\u63cf\u8ff0<\/p>\n<p>\u8fd9\u4e2a\u51fd\u6570\u76f8\u5f53\u4e8e&#034;\u5f00\u5173&#034;\u3002\u5728\u64cd\u4f5c\u4efb\u4f55\u5f15\u811a\u4e4b\u524d&#xff0c;\u4f60\u5fc5\u987b\u544a\u8bc9\u5355\u7247\u673a:\u8fd9\u4e2a\u5f15\u811a\u662f\u8f93\u5165\u8fd8\u662f\u8f93\u51fa?\u901f\u5ea6\u662f\u591a\u5c11?<\/p>\n<p>\u5982\u4f55\u4f7f\u7528<\/p>\n<p>\u4f60\u9700\u8981\u5148\u5b9a\u4e49\u4e00\u4e2a\u7ed3\u6784\u4f53&#xff0c;\u586b\u5165\u53c2\u6570&#xff0c;\u7136\u540e\u8c03\u7528\u8be5\u51fd\u6570\u3002<\/p>\n<p>GPIO_InitTypeDef GPIO_InitStructure; \/\/ 1. \u5b9a\u4e49\u7ed3\u6784\u4f53<\/p>\n<p>\/\/ 2. \u5f00\u542f\u65f6\u949f (\u8fd9\u4e00\u6b65\u81f3\u5173\u91cd\u8981&#xff0c;\u5426\u5219\u914d\u7f6e\u65e0\u6548)<br \/>\nRCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE); <\/p>\n<p>\/\/ 3. \u8bbe\u7f6e\u53c2\u6570<br \/>\nGPIO_InitStructure.GPIO_Pin &#061; GPIO_Pin_0;          \/\/ \u9009\u62e9 0 \u53f7\u5f15\u811a<br \/>\nGPIO_InitStructure.GPIO_Mode &#061; GPIO_Mode_Out_PP;   \/\/ \u63a8\u633d\u8f93\u51fa (\u5e38\u7528\u4e8e\u70b9\u706f)<br \/>\nGPIO_InitStructure.GPIO_Speed &#061; GPIO_Speed_50MHz;  \/\/ \u7ffb\u8f6c\u901f\u5ea6<\/p>\n<p>\/\/ 4. \u8c03\u7528\u51fd\u6570<br \/>\nGPIO_Init(GPIOA, &amp;GPIO_InitStructure); <\/p>\n<h2 id=\"2.GPIO_SetBits%2F%20GPIO_ResetBits%20(%E6%8E%A7%E5%88%B6%E8%BE%93%E5%87%BA)\">2.GPIO_SetBits\/ GPIO_ResetBits (\u63a7\u5236\u8f93\u51fa)<\/h2>\n<p>\u529f\u80fd\u63cf\u8ff0<\/p>\n<p>SetBits:\u8ba9\u5f15\u811a\u53d8\u9ad8\u7535\u5e73(\u901a\u5e38LED\u706d\u6216\u4eae&#xff0c;\u53d6\u51b3\u4e8e\u7535\u8def)\u3002 ResetBits:\u8ba9\u5f15\u811a\u53d8\u4f4e\u7535\u5e73\u3002<\/p>\n<p>\u5982\u4f55\u4f7f\u7528<\/p>\n<p>\u8fd9\u4e24\u4e2a\u51fd\u6570\u975e\u5e38\u76f4\u89c2&#xff0c;\u76f4\u63a5\u8f93\u5165\u7aef\u53e3\u548c\u5f15\u811a\u53f7\u3002<\/p>\n<p>\/\/ \u8ba9 PA0 \u8f93\u51fa\u9ad8\u7535\u5e73<br \/>\nGPIO_SetBits(GPIOA, GPIO_Pin_0);<\/p>\n<p>\/\/ \u8ba9 PA0 \u8f93\u51fa\u4f4e\u7535\u5e73<br \/>\nGPIO_ResetBits(GPIOA, GPIO_Pin_0); <\/p>\n<h2 id=\"3.%20GPIO_ReadInputDataBit%20(%E8%AF%BB%E5%8F%96%E7%8A%B6%E6%80%81)\">3. GPIO_ReadInputDataBit (\u8bfb\u53d6\u72b6\u6001)<\/h2>\n<p>\u529f\u80fd\u63cf\u8ff0<\/p>\n<p>\u5e38\u7528\u4e8e\u68c0\u6d4b\u6309\u952e\u3002\u5b83\u4f1a\u8fd4\u56de\u8be5\u5f15\u811a\u5f53\u524d\u7684\u7535\u5e73\u72b6\u6001\u3002<\/p>\n<p>\u5982\u4f55\u4f7f\u7528<\/p>\n<p>\u5b83\u8fd4\u56de\u4e00\u4e2a uint8_t \u7c7b\u578b\u7684\u503c&#xff08;1 \u6216 0&#xff09;\u3002<\/p>\n<p>if (GPIO_ReadInputDataBit(GPIOA, GPIO_Pin_1) &#061;&#061; 0)<br \/>\n{<br \/>\n    \/\/ \u5982\u679c\u8bfb\u53d6\u5230\u4f4e\u7535\u5e73&#xff0c;\u8bf4\u660e\u6309\u952e\u53ef\u80fd\u88ab\u6309\u4e0b\u4e86<br \/>\n    \/\/ \u6267\u884c\u76f8\u5e94\u903b\u8f91&#8230;<br \/>\n} <\/p>\n<h2 id=\"4.%20GPIO_EXTILineConfig%20(%E4%B8%AD%E6%96%AD%E6%98%A0%E5%B0%84)\">4. GPIO_EXTILineConfig (\u4e2d\u65ad\u6620\u5c04)<\/h2>\n<p>\u529f\u80fd\u63cf\u8ff0<\/p>\n<p>\u5982\u679c\u4f60\u60f3\u8ba9\u67d0\u4e2a\u5f15\u811a\u5728\u7535\u5e73\u53d8\u5316\u65f6\u89e6\u53d1\u4e00\u4e2a\u201c\u4e2d\u65ad\u201d&#xff08;\u5373\u505c\u4e0b\u4e3b\u7a0b\u5e8f\u53bb\u5904\u7406\u7d27\u6025\u4efb\u52a1&#xff09;&#xff0c;\u5c31\u9700\u8981\u7528\u8fd9\u4e2a\u51fd\u6570\u3002\u5b83\u628a GPIO \u5f15\u811a\u548c\u5916\u90e8\u4e2d\u65ad\u7ebf\u8fde\u63a5\u8d77\u6765\u3002<\/p>\n<p>\u5982\u4f55\u4f7f\u7528<\/p>\n<p>\u901a\u5e38\u914d\u5408 AFIO \u65f6\u949f\u4f7f\u7528\u3002<\/p>\n<p>\/\/ \u5c06 PB0 \u8fde\u63a5\u5230\u5916\u90e8\u4e2d\u65ad\u7ebf 0 \u4e0a<br \/>\nGPIO_EXTILineConfig(GPIO_PortSourceGPIOB, GPIO_PinSource0); <\/p>\n<h2 id=\"%E7%89%B9%E5%88%AB%E6%8F%90%E9%86%92%3A%E9%85%8D%E7%BD%AE%E4%B8%89%E9%83%A8%E6%9B%B2\">\u7279\u522b\u63d0\u9192:\u914d\u7f6e\u4e09\u90e8\u66f2<\/h2>\n<p>\u5728Keil\u4e2d\u4f7f\u7528\u8fd9\u4e9b\u51fd\u6570\u65f6&#xff0c;\u8bf7\u52a1\u5fc5\u9075\u5b88\u4ee5\u4e0b\u6d41\u7a0b&#xff0c;\u5426\u5219\u5f15\u811a\u4e0d\u4f1a\u5de5\u4f5c:<\/p>\n<p>1.\u5f00\u542f\u65f6\u949f(RCC_APB2PeriphClockCmd )o 2.\u914d\u7f6e\u7ed3\u6784\u4f53(GPI0_InitTypeDef)\u3002 3.\u8c03\u7528\u521d\u59cb\u5316\u51fd\u6570(GPI0_Init)\u3002<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd9\u4e9b\u51fd\u6570\u901a\u5e38\u4f4d\u4e8e stm32f10x_gpio.h \u6587\u4ef6\u4e2d&#xff0c;\u4e3a\u4e86\u65b9\u4fbf\u4f60\u7406\u89e3&#xff0c;\u6211\u5c06\u8fd9\u4e9b\u51fd\u6570\u6309\u7167\u529f\u80fd\u903b\u8f91\u8fdb\u884c\u4e86\u5206\u7c7b\u89e3\u6790&#xff1a;<br \/>\n\u76ee\u5f55<br \/>\n1.\u521d\u59cb\u5316\u4e0e\u914d\u7f6e\u51fd\u6570<br \/>\n2.\u8bfb\u53d6\u8f93\u5165\u4fe1\u53f7\u51fd\u6570<br \/>\n3.\u8bfb\u53d6\u8f93\u51fa\u72b6\u6001\u51fd\u6570<br \/>\n4.\u63a7\u5236\u8f93\u51fa\u7535\u5e73\u51fd\u6570<br \/>\n5.\u9ad8\u7ea7\/\u7279\u6b8a\u529f\u80fd\u51fd\u6570<br \/>\n1.GPIO_Init(\u6700\u57fa\u7840:\u521d\u59cb\u5316\u5f15\u811a)<br \/>\n2.GPIO_SetBits\/ GPIO_ResetBits (\u63a7\u5236\u8f93\u51fa)<br \/>\n3. GPIO_ReadInputDataBit (\u8bfb\u53d6\u72b6\u6001)<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[217,270,269],"topic":[],"class_list":["post-62629","post","type-post","status-publish","format-standard","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 \u6807\u51c6\u5916\u8bbe\u5e93\u4e2d\u5173\u4e8e GPIO\uff08\u901a\u7528\u8f93\u5165\u8f93\u51fa\uff09 \u6a21\u5757\u7684\u51fd\u6570\u58f0\u660e - \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\/62629.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"STM32 \u6807\u51c6\u5916\u8bbe\u5e93\u4e2d\u5173\u4e8e GPIO\uff08\u901a\u7528\u8f93\u5165\u8f93\u51fa\uff09 \u6a21\u5757\u7684\u51fd\u6570\u58f0\u660e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u8fd9\u4e9b\u51fd\u6570\u901a\u5e38\u4f4d\u4e8e stm32f10x_gpio.h \u6587\u4ef6\u4e2d&#xff0c;\u4e3a\u4e86\u65b9\u4fbf\u4f60\u7406\u89e3&#xff0c;\u6211\u5c06\u8fd9\u4e9b\u51fd\u6570\u6309\u7167\u529f\u80fd\u903b\u8f91\u8fdb\u884c\u4e86\u5206\u7c7b\u89e3\u6790&#xff1a; \u76ee\u5f55 1.\u521d\u59cb\u5316\u4e0e\u914d\u7f6e\u51fd\u6570 2.\u8bfb\u53d6\u8f93\u5165\u4fe1\u53f7\u51fd\u6570 3.\u8bfb\u53d6\u8f93\u51fa\u72b6\u6001\u51fd\u6570 4.\u63a7\u5236\u8f93\u51fa\u7535\u5e73\u51fd\u6570 5.\u9ad8\u7ea7\/\u7279\u6b8a\u529f\u80fd\u51fd\u6570 1.GPIO_Init(\u6700\u57fa\u7840:\u521d\u59cb\u5316\u5f15\u811a) 2.GPIO_SetBits\/ GPIO_ResetBits (\u63a7\u5236\u8f93\u51fa) 3. GPIO_ReadInputDataBit (\u8bfb\u53d6\u72b6\u6001)\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/62629.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-20T03:58:06+00:00\" \/>\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=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/62629.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/62629.html\",\"name\":\"STM32 \u6807\u51c6\u5916\u8bbe\u5e93\u4e2d\u5173\u4e8e GPIO\uff08\u901a\u7528\u8f93\u5165\u8f93\u51fa\uff09 \u6a21\u5757\u7684\u51fd\u6570\u58f0\u660e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-20T03:58:06+00:00\",\"dateModified\":\"2026-01-20T03:58:06+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/62629.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/62629.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/62629.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"STM32 \u6807\u51c6\u5916\u8bbe\u5e93\u4e2d\u5173\u4e8e GPIO\uff08\u901a\u7528\u8f93\u5165\u8f93\u51fa\uff09 \u6a21\u5757\u7684\u51fd\u6570\u58f0\u660e\"}]},{\"@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 \u6807\u51c6\u5916\u8bbe\u5e93\u4e2d\u5173\u4e8e GPIO\uff08\u901a\u7528\u8f93\u5165\u8f93\u51fa\uff09 \u6a21\u5757\u7684\u51fd\u6570\u58f0\u660e - \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\/62629.html","og_locale":"zh_CN","og_type":"article","og_title":"STM32 \u6807\u51c6\u5916\u8bbe\u5e93\u4e2d\u5173\u4e8e GPIO\uff08\u901a\u7528\u8f93\u5165\u8f93\u51fa\uff09 \u6a21\u5757\u7684\u51fd\u6570\u58f0\u660e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u8fd9\u4e9b\u51fd\u6570\u901a\u5e38\u4f4d\u4e8e stm32f10x_gpio.h \u6587\u4ef6\u4e2d&#xff0c;\u4e3a\u4e86\u65b9\u4fbf\u4f60\u7406\u89e3&#xff0c;\u6211\u5c06\u8fd9\u4e9b\u51fd\u6570\u6309\u7167\u529f\u80fd\u903b\u8f91\u8fdb\u884c\u4e86\u5206\u7c7b\u89e3\u6790&#xff1a; \u76ee\u5f55 1.\u521d\u59cb\u5316\u4e0e\u914d\u7f6e\u51fd\u6570 2.\u8bfb\u53d6\u8f93\u5165\u4fe1\u53f7\u51fd\u6570 3.\u8bfb\u53d6\u8f93\u51fa\u72b6\u6001\u51fd\u6570 4.\u63a7\u5236\u8f93\u51fa\u7535\u5e73\u51fd\u6570 5.\u9ad8\u7ea7\/\u7279\u6b8a\u529f\u80fd\u51fd\u6570 1.GPIO_Init(\u6700\u57fa\u7840:\u521d\u59cb\u5316\u5f15\u811a) 2.GPIO_SetBits\/ GPIO_ResetBits (\u63a7\u5236\u8f93\u51fa) 3. GPIO_ReadInputDataBit (\u8bfb\u53d6\u72b6\u6001)","og_url":"https:\/\/www.wsisp.com\/helps\/62629.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-20T03:58:06+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/62629.html","url":"https:\/\/www.wsisp.com\/helps\/62629.html","name":"STM32 \u6807\u51c6\u5916\u8bbe\u5e93\u4e2d\u5173\u4e8e GPIO\uff08\u901a\u7528\u8f93\u5165\u8f93\u51fa\uff09 \u6a21\u5757\u7684\u51fd\u6570\u58f0\u660e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-20T03:58:06+00:00","dateModified":"2026-01-20T03:58:06+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/62629.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/62629.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/62629.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"STM32 \u6807\u51c6\u5916\u8bbe\u5e93\u4e2d\u5173\u4e8e GPIO\uff08\u901a\u7528\u8f93\u5165\u8f93\u51fa\uff09 \u6a21\u5757\u7684\u51fd\u6570\u58f0\u660e"}]},{"@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\/62629","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=62629"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/62629\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=62629"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=62629"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=62629"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=62629"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}