{"id":76854,"date":"2026-02-23T13:34:00","date_gmt":"2026-02-23T05:34:00","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/76854.html"},"modified":"2026-02-23T13:34:00","modified_gmt":"2026-02-23T05:34:00","slug":"stm32%e5%af%84%e5%ad%98%e5%99%a8%e6%98%a0%e5%b0%84%e5%8e%9f%e7%90%86%e4%b8%8e%e7%bb%93%e6%9e%84%e4%bd%93%e5%b0%81%e8%a3%85%e5%ae%9e%e8%b7%b5","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/76854.html","title":{"rendered":"STM32\u5bc4\u5b58\u5668\u6620\u5c04\u539f\u7406\u4e0e\u7ed3\u6784\u4f53\u5c01\u88c5\u5b9e\u8df5"},"content":{"rendered":"<h3>\n 1. \u5bc4\u5b58\u5668\u6620\u5c04\u7684\u672c\u8d28&#xff1a;\u4ece\u5185\u5b58\u5730\u5740\u5230\u53ef\u7f16\u7a0b\u5916\u8bbe\u7684\u5de5\u7a0b\u6865\u6881<br \/>\n<\/h3>\n<p>\n \u5728\u5d4c\u5165\u5f0f\u7cfb\u7edf\u5f00\u53d1\u4e2d&#xff0c;\u201c\u5bc4\u5b58\u5668\u201d\u4e00\u8bcd\u5e38\u88ab\u521d\u5b66\u8005\u8bef\u89e3\u4e3a\u67d0\u79cd\u795e\u79d8\u7684\u786c\u4ef6\u5f00\u5173\u6216\u62bd\u8c61\u6982\u5ff5\u3002\u5b9e\u9645\u4e0a&#xff0c;\u5bc4\u5b58\u5668\u662f\u5fae\u63a7\u5236\u5668\u4e2d\u6700\u57fa\u7840\u3001\u6700\u771f\u5b9e\u7684\u7269\u7406\u5b58\u5728\u2014\u2014\u5b83\u662f\u4e00\u5757\u4f4d\u4e8e\u7279\u5b9a\u5185\u5b58\u5730\u5740\u4e0a\u7684\u3001\u53ef\u88abCPU\u76f4\u63a5\u8bfb\u5199\u768432\u4f4d&#xff08;\u621616\/8\u4f4d&#xff09;\u5b58\u50a8\u5355\u5143\u3002\u5bf9STM32\u800c\u8a00&#xff0c;\u5bc4\u5b58\u5668\u5e76\u975e\u60ac\u6d6e\u4e8e\u7a7a\u4e2d\u7684\u903b\u8f91\u7b26\u53f7&#xff0c;\u800c\u662f\u4e25\u683c\u6620\u5c04\u5728\u7247\u4e0a\u5730\u5740\u7a7a\u95f4\u4e2d\u7684\u4e00\u7ec4\u8fde\u7eed\u5185\u5b58\u4f4d\u7f6e\u3002\u7406\u89e3\u5bc4\u5b58\u5668\u6620\u5c04&#xff08;Register Mapping&#xff09;&#xff0c;\u5c31\u662f\u7406\u89e3\u5982\u4f55\u5c06C\u8bed\u8a00\u4e2d\u7684\u53d8\u91cf\u64cd\u4f5c&#xff0c;\u7cbe\u51c6\u5730\u8f6c\u5316\u4e3a\u5bf9\u8fd9\u4e9b\u7269\u7406\u5730\u5740\u5355\u5143\u7684\u8bfb\u5199\u884c\u4e3a\u3002\u8fd9\u4e00\u8fc7\u7a0b\u6784\u6210\u4e86\u6240\u6709\u5e95\u5c42\u9a71\u52a8\u5f00\u53d1\u7684\u57fa\u77f3&#xff0c;\u4e5f\u662fHAL\u5e93\u3001LL\u5e93\u4e43\u81f3\u88f8\u673a\u7f16\u7a0b\u5171\u540c\u4f9d\u8d56\u7684\u5e95\u5c42\u4e8b\u5b9e\u3002\n<\/p>\n<p>\n \u5bc4\u5b58\u5668\u6620\u5c04\u7684\u6838\u5fc3\u903b\u8f91\u6781\u4e3a\u6734\u7d20&#xff1a;<\/p>\n<p>  \u5916\u8bbe\u529f\u80fd\u7531\u5176\u5185\u90e8\u5bc4\u5b58\u5668\u7684\u72b6\u6001\u51b3\u5b9a&#xff0c;\u800c\u5bc4\u5b58\u5668\u7684\u72b6\u6001\u7531\u5176\u6240\u5728\u5185\u5b58\u5730\u5740\u7684\u503c\u51b3\u5b9a&#xff0c;\u56e0\u6b64&#xff0c;\u8bbf\u95ee\u5916\u8bbe\u5373\u7b49\u4ef7\u4e8e\u8bbf\u95ee\u5176\u5bf9\u5e94\u5730\u5740\u8303\u56f4\u5185\u7684\u5185\u5b58\u5355\u5143<\/p>\n<p> \u3002\u8fd9\u4e00\u903b\u8f91\u770b\u4f3c\u7b80\u5355&#xff0c;\u5374\u8981\u6c42\u5f00\u53d1\u8005\u5f7b\u5e95\u629b\u5f03\u201c\u8c03\u7528\u51fd\u6570\u5373\u5b8c\u6210\u914d\u7f6e\u201d\u7684\u9ed1\u76d2\u601d\u7ef4&#xff0c;\u8f6c\u800c\u5efa\u7acb\u4e00\u79cd\u201c\u5730\u5740\u2014\u5bc4\u5b58\u5668\u2014\u529f\u80fd\u201d\u7684\u4e09\u7ef4\u6620\u5c04\u610f\u8bc6\u3002\u5f53\u6211\u4eec\u5728\u4ee3\u7801\u4e2d\u5199\u4e0b<\/p>\n<p>  GPIOB-&gt;ODR |&#061; (1U &lt;&lt; 10);<\/p>\n<p> \u65f6&#xff0c;\u7f16\u8bd1\u5668\u6700\u7ec8\u751f\u6210\u7684\u673a\u5668\u6307\u4ee4&#xff0c;\u5e76\u975e\u8c03\u7528\u67d0\u4e2a\u5e93\u51fd\u6570&#xff0c;\u800c\u662f\u5411\u5730\u5740<\/p>\n<p>  0x40010C14<\/p>\n<p> \u6267\u884c\u4e00\u6b21\u201c\u8bfb-\u4fee\u6539-\u5199\u201d\u64cd\u4f5c\u3002\u8fd9\u4e2a\u5730\u5740\u7684\u786e\u5b9a&#xff0c;\u6b63\u662f\u5bc4\u5b58\u5668\u6620\u5c04\u5de5\u4f5c\u7684\u5168\u90e8\u610f\u4e49\u3002\n<\/p>\n<p>\n STM32F103\u7684\u6570\u636e\u624b\u518c\u4e2d\u660e\u786e\u6307\u51fa&#xff0c;\u5176\u6574\u4e2a\u5730\u5740\u7a7a\u95f4\u88ab\u5212\u5206\u4e3a\u591a\u4e2a\u529f\u80fd\u533a\u5757&#xff08;Memory Blocks&#xff09;\u3002\u5176\u4e2d&#xff0c;Block 0\u7528\u4e8e\u5b58\u653eFlash\u7a0b\u5e8f\u5b58\u50a8\u5668&#xff0c;Block 1\u7528\u4e8eSRAM\u6570\u636e\u5b58\u50a8\u5668&#xff0c;\u800c<\/p>\n<p>  Block 2\u5219\u4e13\u7528\u4e8e\u5916\u8bbe&#xff08;Peripherals&#xff09;<\/p>\n<p> \u3002Block 2\u7684\u8d77\u59cb\u5730\u5740\u4e3a<\/p>\n<p>  0x40000000<\/p>\n<p> &#xff0c;\u603b\u957f\u5ea6\u4e3a1GB&#xff08;0x40000000 ~ 0x7FFFFFFF&#xff09;&#xff0c;\u4f46\u5b9e\u9645\u53ef\u7528\u7684\u5916\u8bbe\u5730\u5740\u4ec5\u5360\u5176\u4e2d\u4e00\u5c0f\u90e8\u5206\u3002Block 2\u5e76\u975e\u4e00\u4e2a\u5355\u4e00\u3001\u5e73\u5766\u7684\u5185\u5b58\u6c60&#xff0c;\u800c\u662f\u4f9d\u636e\u5916\u8bbe\u5de5\u4f5c\u9891\u7387\u4e0e\u6027\u80fd\u9700\u6c42&#xff0c;\u88ab\u8fdb\u4e00\u6b65\u5212\u5206\u4e3a\u4e09\u6761\u72ec\u7acb\u7684\u603b\u7ebf\u7ed3\u6784&#xff1a;APB1&#xff08;Advanced Peripheral Bus 1&#xff09;\u3001APB2&#xff08;Advanced Peripheral Bus 2&#xff09;\u548cAHB&#xff08;Advanced High-performance Bus&#xff09;\u3002\u8fd9\u79cd\u5212\u5206\u5e76\u975e\u968f\u610f\u4e3a\u4e4b&#xff0c;\u800c\u662fSTMicroelectronics\u57fa\u4e8eARM Cortex-M3\u5185\u6838\u7684AMBA\u603b\u7ebf\u89c4\u8303\u6240\u4f5c\u7684\u5de5\u7a0b\u5b9e\u73b0&#xff0c;\u5176\u6839\u672c\u76ee\u7684\u5728\u4e8e\u5e73\u8861\u7cfb\u7edf\u6027\u80fd\u3001\u529f\u8017\u4e0e\u8bbe\u8ba1\u590d\u6742\u5ea6\u3002\n<\/p>\n<p>\n APB1\u603b\u7ebf\u8fd0\u884c\u4e8e\u6700\u9ad836MHz&#xff08;\u5728F103\u7cfb\u5217\u4e2d\u901a\u5e38\u4e3a36MHz&#xff09;&#xff0c;\u7528\u4e8e\u8fde\u63a5\u4f4e\u901f\u5916\u8bbe&#xff0c;\u5982\u5b9a\u65f6\u5668TIM2-TIM7\u3001USART2\/3\u3001SPI2\/3\u3001I2C1\/2\u3001DAC\u4ee5\u53ca\u57fa\u672c\u7684ADC\u901a\u9053\u3002APB2\u603b\u7ebf\u5219\u8fd0\u884c\u4e8e\u6700\u9ad872MHz&#xff0c;\u670d\u52a1\u4e8e\u9ad8\u901f\u5916\u8bbe&#xff0c;\u5305\u62ecGPIO\u7aef\u53e3A-E\u3001USART1\u3001SPI1\u3001ADC1\u3001\u9ad8\u7ea7\u5b9a\u65f6\u5668TIM1\/TIM8\u4ee5\u53ca\u5916\u90e8\u4e2d\u65ad\u63a7\u5236\u5668&#xff08;EXTI&#xff09;\u3002AHB\u603b\u7ebf\u662f\u7cfb\u7edf\u4e2d\u6700\u5feb\u7684\u603b\u7ebf&#xff0c;\u76f4\u63a5\u8fde\u63a5\u5230Cortex-M3\u5185\u6838&#xff0c;\u5176\u4e3b\u8981\u627f\u8f7d\u5bf9\u8c61\u662f\u5b58\u50a8\u5668\u63a7\u5236\u5668&#xff08;\u5982FSMC&#xff09;\u3001DMA\u63a7\u5236\u5668\u3001\u4ee5\u53ca\u7cfb\u7edf\u7ea7\u5916\u8bbe&#xff08;\u5982NVIC\u3001SCB&#xff09;\u3002\u503c\u5f97\u6ce8\u610f\u7684\u662f&#xff0c;AHB\u603b\u7ebf\u7684\u57fa\u5730\u5740<\/p>\n<p>  0x40010000<\/p>\n<p> \u5e76\u975e\u4eceBlock 2\u7684\u7edd\u5bf9\u8d77\u70b9\u5f00\u59cb&#xff0c;\u800c\u662f\u76f8\u5bf9\u4e8eAPB1\u57fa\u5730\u5740<\/p>\n<p>  0x40000000<\/p>\n<p> \u7684\u4e00\u4e2a\u504f\u79fb\u91cf\u3002\u8fd9\u79cd\u5c42\u7ea7\u5316\u7684\u603b\u7ebf\u67b6\u6784&#xff0c;\u610f\u5473\u7740\u5bf9\u4efb\u4f55\u4e00\u4e2a\u5916\u8bbe\u7684\u8bbf\u95ee&#xff0c;\u90fd\u5fc5\u987b\u9996\u5148\u786e\u5b9a\u5176\u6240\u5c5e\u7684\u603b\u7ebf&#xff0c;\u518d\u8ba1\u7b97\u5176\u5728\u8be5\u603b\u7ebf\u4e0a\u7684\u76f8\u5bf9\u504f\u79fb&#xff0c;\u6700\u7ec8\u624d\u80fd\u5f97\u5230\u5176\u552f\u4e00\u768432\u4f4d\u7edd\u5bf9\u5730\u5740\u3002\n<\/p>\n<h3>\n 2. \u603b\u7ebf\u57fa\u5730\u5740\u4e0e\u5916\u8bbe\u57fa\u5730\u5740\u7684\u7cbe\u786e\u8ba1\u7b97<br \/>\n<\/h3>\n<p>\n \u5bc4\u5b58\u5668\u6620\u5c04\u7684\u7b2c\u4e00\u6b65&#xff0c;\u662f\u786e\u7acb\u4e09\u6761\u603b\u7ebf\u7684\u57fa\u5730\u5740\u3002\u8fd9\u5e76\u975e\u51ed\u7a7a\u81c6\u65ad&#xff0c;\u800c\u662f\u76f4\u63a5\u6e90\u4e8eSTM32F103\u53c2\u8003\u624b\u518c&#xff08;Reference Manual, RM0008&#xff09;\u7b2c2.3\u8282\u201cMemory map\u201d\u4e2d\u7ed9\u51fa\u7684\u6743\u5a01\u5b9a\u4e49\u3002\u6839\u636e\u8be5\u624b\u518c&#xff0c;APB1\u3001APB2\u4e0eAHB\u7684\u57fa\u5730\u5740\u5982\u4e0b&#xff1a;\n<\/p>\n<table>\n<tr>\n    \u603b\u7ebf\u540d\u79f0<\/p>\n<p>    \u57fa\u5730\u5740&#xff08;\u5341\u516d\u8fdb\u5236&#xff09;<\/p>\n<p>    \u76f8\u5bf9\u4e8eBlock 2\u8d77\u70b9\u7684\u504f\u79fb<br \/>\n   <\/tr>\n<tbody>\n<tr>\n<td style=\"text-align: left\">\n    APB1\n   <\/td>\n<td style=\"text-align: left\">\n<p>     0x40000000<\/p>\n<\/td>\n<td style=\"text-align: left\">\n<p>     0x00000000<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left\">\n    APB2\n   <\/td>\n<td style=\"text-align: left\">\n<p>     0x40010000<\/p>\n<\/td>\n<td style=\"text-align: left\">\n<p>     0x00010000<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left\">\n    AHB\n   <\/td>\n<td style=\"text-align: left\">\n<p>     0x40018000<\/p>\n<\/td>\n<td style=\"text-align: left\">\n<p>     0x00018000<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\n \u6b64\u5904\u9700\u7279\u522b\u5f3a\u8c03\u4e00\u4e2a\u5173\u952e\u7ec6\u8282&#xff1a;<\/p>\n<p>  APB1\u7684\u57fa\u5730\u5740<\/p>\n<p>   0x40000000<\/p>\n<p>  &#xff0c;\u5373\u662f\u6574\u4e2a\u5916\u8bbeBlock 2\u7684\u8d77\u59cb\u5730\u5740&#xff0c;\u56e0\u6b64\u5b83\u4e5f\u88ab\u79f0\u4f5c\u201c\u5916\u8bbe\u57fa\u5730\u5740\u201d&#xff08;Peripheral Base Address&#xff09;<\/p>\n<p> \u3002\u8fd9\u610f\u5473\u7740&#xff0c;\u6240\u6709\u5916\u8bbe\u7684\u7edd\u5bf9\u5730\u5740&#xff0c;\u90fd\u53ef\u4ee5\u7edf\u4e00\u8868\u793a\u4e3a\u201c\u5916\u8bbe\u57fa\u5730\u5740 &#043; \u603b\u7ebf\u504f\u79fb &#043; \u5916\u8bbe\u504f\u79fb\u201d\u3002\u4f8b\u5982&#xff0c;APB2\u7684\u57fa\u5730\u5740<\/p>\n<p>  0x40010000<\/p>\n<p> &#xff0c;\u53ef\u4ee5\u88ab\u770b\u4f5c\u662f<\/p>\n<p>  0x40000000 &#043; 0x00010000<\/p>\n<p> &#xff1b;\u540c\u7406&#xff0c;AHB\u7684\u57fa\u5730\u5740<\/p>\n<p>  0x40018000<\/p>\n<p> &#xff0c;\u5219\u662f<\/p>\n<p>  0x40000000 &#043; 0x00018000<\/p>\n<p> \u3002\u8fd9\u79cd\u8868\u8fbe\u65b9\u5f0f&#xff0c;\u4e3a\u540e\u7eed\u7684C\u8bed\u8a00\u5b8f\u5b9a\u4e49\u63d0\u4f9b\u4e86\u6e05\u6670\u7684\u6570\u5b66\u57fa\u7840\u3002\n<\/p>\n<p>\n \u4ee5GPIO\u7aef\u53e3\u4e3a\u4f8b&#xff0c;\u5176\u5728\u53c2\u8003\u624b\u518c\u7684\u201cPeripheral memory map\u201d\u8868\u683c\u4e2d\u88ab\u660e\u786e\u5217\u51fa\u3002GPIOA\u7684\u57fa\u5730\u5740\u4e3a<\/p>\n<p>  0x40010800<\/p>\n<p> &#xff0c;GPIOB\u4e3a<\/p>\n<p>  0x40010C00<\/p>\n<p> &#xff0c;GPIOC\u4e3a<\/p>\n<p>  0x40011000<\/p>\n<p> &#xff0c;GPIOD\u4e3a<\/p>\n<p>  0x40011400<\/p>\n<p> &#xff0c;GPIOE\u4e3a<\/p>\n<p>  0x40011800<\/p>\n<p> \u3002\u89c2\u5bdf\u8fd9\u4e9b\u5730\u5740&#xff0c;\u53ef\u4ee5\u53d1\u73b0\u4e00\u4e2a\u4e25\u683c\u7684\u89c4\u5f8b&#xff1a;\u5b83\u4eec\u5747\u4f4d\u4e8eAPB2\u603b\u7ebf\u4e0a&#xff08;\u56e0\u4e3a<\/p>\n<p>  0x40010800<\/p>\n<p> &gt;<\/p>\n<p>  0x40010000<\/p>\n<p> \u4e14 &lt;<\/p>\n<p>  0x40018000<\/p>\n<p> &#xff09;&#xff0c;\u5e76\u4e14\u76f8\u90bb\u7aef\u53e3\u4e4b\u95f4\u76f8\u5dee<\/p>\n<p>  0x00000400<\/p>\n<p> &#xff08;\u53731024\u5b57\u8282&#xff09;\u3002\u8fd9\u5370\u8bc1\u4e86\u624b\u518c\u4e2d\u5173\u4e8e\u201cAPB2\u603b\u7ebf\u6302\u8f7dGPIOA-E\u201d\u7684\u63cf\u8ff0\u3002\u8fdb\u4e00\u6b65\u8ba1\u7b97\u5176\u76f8\u5bf9\u4e8eAPB2\u57fa\u5730\u5740<\/p>\n<p>  0x40010000<\/p>\n<p> \u7684\u504f\u79fb\u91cf&#xff1a;<\/p>\n<p> &#8211; GPIOA:<\/p>\n<p>  0x40010800 &#8211; 0x40010000 &#061; 0x00000800<\/p>\n<p> &#8211; GPIOB:<\/p>\n<p>  0x40010C00 &#8211; 0x40010000 &#061; 0x00000C00<\/p>\n<p> &#8211; GPIOC:<\/p>\n<p>  0x40011000 &#8211; 0x40010000 &#061; 0x00001000<\/p>\n<p>\n \u8fd9\u4e2a<\/p>\n<p>  0x00000800<\/p>\n<p> \u3001<\/p>\n<p>  0x00000C00<\/p>\n<p> \u7b49\u6570\u503c&#xff0c;\u5c31\u662fGPIO\u5916\u8bbe\u5728APB2\u603b\u7ebf\u4e0a\u7684\u201c\u5916\u8bbe\u504f\u79fb\u91cf\u201d\u3002\u5b83\u4e0e\u603b\u7ebf\u504f\u79fb\u91cf<\/p>\n<p>  0x00010000<\/p>\n<p> \u76f8\u52a0&#xff0c;\u4fbf\u5f97\u5230\u4e86GPIOA\/B\/C\u7684\u7edd\u5bf9\u5730\u5740\u3002\u8fd9\u79cd\u5206\u5c42\u8ba1\u7b97\u6cd5&#xff0c;\u662f\u6784\u5efa\u53ef\u7ef4\u62a4\u3001\u53ef\u6269\u5c55\u5bc4\u5b58\u5668\u6620\u5c04\u4f53\u7cfb\u7684\u5173\u952e\u3002\u5728C\u8bed\u8a00\u4e2d&#xff0c;\u6211\u4eec\u5c06\u5176\u89c4\u8303\u5316\u4e3a\u4e00\u7cfb\u5217\u5b8f\u5b9a\u4e49&#xff1a;\n<\/p>\n<p>\/* \u5b9a\u4e49\u5916\u8bbe\u57fa\u5730\u5740 *\/<br \/>\n#define PERIPH_BASE           ((uint32_t)0x40000000)<\/p>\n<p>\/* \u5b9a\u4e49\u5404\u603b\u7ebf\u57fa\u5730\u5740&#xff08;\u76f8\u5bf9\u4e8ePERIPH_BASE\u7684\u504f\u79fb&#xff09; *\/<br \/>\n#define APB1PERIPH_BASE       (PERIPH_BASE &#043; 0x00000000)<br \/>\n#define APB2PERIPH_BASE       (PERIPH_BASE &#043; 0x00010000)<br \/>\n#define AHBPERIPH_BASE        (PERIPH_BASE &#043; 0x00018000)<\/p>\n<p>\/* \u5b9a\u4e49GPIO\u5916\u8bbe\u57fa\u5730\u5740&#xff08;\u76f8\u5bf9\u4e8eAPB2PERIPH_BASE\u7684\u504f\u79fb&#xff09; *\/<br \/>\n#define GPIOA_BASE            (APB2PERIPH_BASE &#043; 0x00000800)<br \/>\n#define GPIOB_BASE            (APB2PERIPH_BASE &#043; 0x00000C00)<br \/>\n#define GPIOC_BASE            (APB2PERIPH_BASE &#043; 0x00001000)<br \/>\n#define GPIOD_BASE            (APB2PERIPH_BASE &#043; 0x00001400)<br \/>\n#define GPIOE_BASE            (APB2PERIPH_BASE &#043; 0x00001800)<\/p>\n<p>\n \u4e0a\u8ff0\u5b8f\u5b9a\u4e49\u7684\u7cbe\u5999\u4e4b\u5904\u5728\u4e8e&#xff0c;\u5b83\u5b8c\u5168\u590d\u73b0\u4e86\u786c\u4ef6\u5730\u5740\u7a7a\u95f4\u7684\u7269\u7406\u7ed3\u6784\u3002<\/p>\n<p>  GPIOB_BASE<\/p>\n<p> \u7684\u8ba1\u7b97\u8fc7\u7a0b<\/p>\n<p>  0x40000000 &#043; 0x00010000 &#043; 0x00000C00 &#061; 0x40010C00<\/p>\n<p> &#xff0c;\u4e0e\u624b\u518c\u4e2d\u7ed9\u51fa\u7684\u5730\u5740\u4e25\u4e1d\u5408\u7f1d\u3002\u8fd9\u79cd\u201c\u6240\u89c1\u5373\u6240\u5f97\u201d\u7684\u5b9a\u4e49\u65b9\u5f0f&#xff0c;\u4f7f\u5f97\u4ee3\u7801\u5177\u5907\u4e86\u6781\u5f3a\u7684\u81ea\u89e3\u91ca\u6027\u3002\u5f53\u4e00\u4e2a\u5de5\u7a0b\u5e08\u770b\u5230<\/p>\n<p>  GPIOB_BASE<\/p>\n<p> \u65f6&#xff0c;\u65e0\u9700\u67e5\u9605\u4efb\u4f55\u6587\u6863&#xff0c;\u4ec5\u51ed\u5b8f\u540d\u5373\u53ef\u63a8\u65ad\u51fa\u5176\u7269\u7406\u4f4d\u7f6e\u548c\u6240\u5c5e\u603b\u7ebf&#xff0c;\u8fd9\u662f\u9ad8\u8d28\u91cf\u5d4c\u5165\u5f0f\u4ee3\u7801\u7684\u91cd\u8981\u6807\u5fd7\u3002\n<\/p>\n<h3>\n 3. \u5bc4\u5b58\u5668\u7ed3\u6784\u4f53\u5c01\u88c5&#xff1a;\u4ece\u5730\u5740\u5230\u53ef\u8bfb\u4ee3\u7801\u7684\u8303\u5f0f\u8dc3\u8fc1<br \/>\n<\/h3>\n<p>\n \u4ec5\u4ec5\u5b9a\u4e49\u5916\u8bbe\u7684\u57fa\u5730\u5740&#xff0c;\u8ddd\u79bb\u7f16\u5199\u53ef\u7ef4\u62a4\u7684\u9a71\u52a8\u4ee3\u7801\u4ecd\u6709\u5de8\u5927\u9e3f\u6c9f\u3002\u8bbe\u60f3\u4e00\u4e0b&#xff0c;\u82e5\u8981\u914d\u7f6eGPIOB\u7684\u7b2c10\u5f15\u811a\u4e3a\u63a8\u633d\u8f93\u51fa\u6a21\u5f0f&#xff0c;\u6211\u4eec\u9700\u8981\u5411\u5176\u201c\u7aef\u53e3\u914d\u7f6e\u4f4e\u5bc4\u5b58\u5668\u201d&#xff08;CRL&#xff09;\u5199\u5165\u7279\u5b9a\u503c\u3002\u6839\u636e\u624b\u518c&#xff0c;CRL\u7684\u504f\u79fb\u5730\u5740\u4e3a<\/p>\n<p>  0x00<\/p>\n<p> &#xff0c;\u5176\u7edd\u5bf9\u5730\u5740\u5373\u4e3a<\/p>\n<p>  GPIOB_BASE &#043; 0x00 &#061; 0x40010C00<\/p>\n<p> \u3002\u6700\u539f\u59cb\u7684\u5199\u6cd5\u662f&#xff1a;\n<\/p>\n<p>*(volatile uint32_t*)(0x40010C00) &#061; 0x00000003; \/\/ \u914d\u7f6ePB10\u4e3a\u63a8\u633d\u8f93\u51fa<\/p>\n<p>\n \u8fd9\u79cd\u65b9\u5f0f\u867d\u80fd\u5de5\u4f5c&#xff0c;\u4f46\u5176\u7f3a\u9677\u663e\u800c\u6613\u89c1&#xff1a;<\/p>\n<p>  \u5730\u5740\u6570\u5b57\u6beb\u65e0\u8bed\u4e49&#xff0c;\u65e0\u6cd5\u4f53\u73b0\u529f\u80fd\u610f\u56fe&#xff0c;\u4e14\u6781\u6613\u56e0\u7b14\u8bef\u5bfc\u81f4\u707e\u96be\u6027\u9519\u8bef<\/p>\n<p> \u3002\u5bc4\u5b58\u5668\u6620\u5c04\u7684\u7b2c\u4e8c\u9636\u6bb5&#xff0c;\u4fbf\u662f\u5f15\u5165C\u8bed\u8a00\u7684\u7ed3\u6784\u4f53&#xff08;struct&#xff09;\u673a\u5236&#xff0c;\u5c06\u4e00\u7ec4\u5177\u6709\u903b\u8f91\u5173\u8054\u7684\u5bc4\u5b58\u5668&#xff0c;\u5c01\u88c5\u6210\u4e00\u4e2a\u5177\u6709\u660e\u786e\u6210\u5458\u540d\u79f0\u7684\u590d\u5408\u6570\u636e\u7c7b\u578b\u3002\u8fd9\u4e0d\u4ec5\u662f\u8bed\u6cd5\u7cd6&#xff0c;\u66f4\u662f\u4e00\u79cd\u5de5\u7a0b\u8303\u5f0f\u7684\u5347\u7ea7&#xff0c;\u5b83\u5c06\u201c\u64cd\u4f5c\u5185\u5b58\u5730\u5740\u201d\u7684\u5e95\u5c42\u884c\u4e3a&#xff0c;\u62bd\u8c61\u4e3a\u201c\u64cd\u4f5c\u7ed3\u6784\u4f53\u6210\u5458\u201d\u7684\u9ad8\u5c42\u8bed\u4e49\u3002\n<\/p>\n<p>\n STM32\u7684\u6bcf\u4e2aGPIO\u7aef\u53e3&#xff0c;\u5176\u5bc4\u5b58\u5668\u5217\u8868\u5728\u624b\u518c\u4e2d\u88ab\u6e05\u6670\u5730\u5b9a\u4e49\u4e3a\u4e00\u4e2a\u8fde\u7eed\u7684\u3001\u56fa\u5b9a\u5927\u5c0f\u7684\u7ed3\u6784\u3002\u4ee5GPIOB\u4e3a\u4f8b&#xff0c;\u5176\u6838\u5fc3\u5bc4\u5b58\u5668\u6309\u987a\u5e8f\u6392\u5217\u5982\u4e0b&#xff08;\u5747\u4e3a32\u4f4d&#xff09;&#xff1a;<\/p>\n<p> 1.<\/p>\n<p>  CRL<\/p>\n<p> (Port Configuration Register Low): \u504f\u79fb<\/p>\n<p>  0x00<\/p>\n<p> 2.<\/p>\n<p>  CRH<\/p>\n<p> (Port Configuration Register High): \u504f\u79fb<\/p>\n<p>  0x04<\/p>\n<p> 3.<\/p>\n<p>  IDR<\/p>\n<p> (Port Input Data Register): \u504f\u79fb<\/p>\n<p>  0x08<\/p>\n<p> 4.<\/p>\n<p>  ODR<\/p>\n<p> (Port Output Data Register): \u504f\u79fb<\/p>\n<p>  0x0C<\/p>\n<p> 5.<\/p>\n<p>  BSRR<\/p>\n<p> (Port Bit Set\/Reset Register): \u504f\u79fb<\/p>\n<p>  0x10<\/p>\n<p> 6.<\/p>\n<p>  BRR<\/p>\n<p> (Port Bit Reset Register): \u504f\u79fb<\/p>\n<p>  0x14<\/p>\n<p> 7.<\/p>\n<p>  LCKR<\/p>\n<p> (Port Configuration Lock Register): \u504f\u79fb<\/p>\n<p>  0x18<\/p>\n<p>\n \u8fd9\u4e9b\u5bc4\u5b58\u5668\u5728\u5185\u5b58\u4e2d\u5360\u636e<\/p>\n<p>  0x00<\/p>\n<p> \u5230<\/p>\n<p>  0x1C<\/p>\n<p> \u517128\u5b57\u8282&#xff08;7\u4e2a\u5bc4\u5b58\u5668 \u00d7 4\u5b57\u8282&#xff09;&#xff0c;\u6784\u6210\u4e00\u4e2a\u5b8c\u7f8e\u7684\u3001\u7d27\u51d1\u7684\u7ed3\u6784\u4f53\u5e03\u5c40\u3002\u6211\u4eec\u53ef\u4ee5\u636e\u6b64\u5b9a\u4e49\u4e00\u4e2a\u540d\u4e3a<\/p>\n<p>  GPIO_TypeDef<\/p>\n<p> \u7684\u7ed3\u6784\u4f53&#xff1a;\n<\/p>\n<p>typedef struct {<br \/>\n    __IO uint32_t CRL;   \/*!&lt; Port configuration register low,              Address offset: 0x00 *\/<br \/>\n    __IO uint32_t CRH;   \/*!&lt; Port configuration register high,             Address offset: 0x04 *\/<br \/>\n    __IO uint32_t IDR;   \/*!&lt; Port input data register,                     Address offset: 0x08 *\/<br \/>\n    __IO uint32_t ODR;   \/*!&lt; Port output data register,                    Address offset: 0x0C *\/<br \/>\n    __IO uint32_t BSRR;  \/*!&lt; Port bit set\/reset register,                  Address offset: 0x10 *\/<br \/>\n    __IO uint32_t BRR;   \/*!&lt; Port bit reset register,                      Address offset: 0x14 *\/<br \/>\n    __IO uint32_t LCKR;  \/*!&lt; Port configuration lock register,             Address offset: 0x18 *\/<br \/>\n} GPIO_TypeDef;<\/p>\n<p>\n \u6b64\u5904<\/p>\n<p>  __IO<\/p>\n<p> \u662f\u4e00\u4e2a\u7531CMSIS\u6807\u51c6\u5b9a\u4e49\u7684\u5b8f&#xff0c;\u5c55\u5f00\u540e\u4e3a<\/p>\n<p>  volatile<\/p>\n<p> \u5173\u952e\u5b57&#xff0c;\u5176\u4f5c\u7528\u81f3\u5173\u91cd\u8981&#xff1a;\u5b83\u544a\u8bc9\u7f16\u8bd1\u5668&#xff0c;\u8be5\u53d8\u91cf\u6240\u6307\u5411\u7684\u5185\u5b58\u5185\u5bb9\u53ef\u80fd\u88ab\u786c\u4ef6&#xff08;\u800c\u975e\u4ec5\u7531\u8f6f\u4ef6&#xff09;\u968f\u65f6\u4fee\u6539&#xff0c;\u56e0\u6b64\u7981\u6b62\u7f16\u8bd1\u5668\u5bf9\u8be5\u53d8\u91cf\u8fdb\u884c\u4efb\u4f55\u4f18\u5316&#xff08;\u5982\u7f13\u5b58\u5230\u5bc4\u5b58\u5668\u3001\u5220\u9664\u5197\u4f59\u8bfb\u53d6\u7b49&#xff09;&#xff0c;\u786e\u4fdd\u6bcf\u6b21\u8bbf\u95ee\u90fd\u662f\u771f\u5b9e\u7684\u5185\u5b58\u8bfb\u5199\u3002\n<\/p>\n<p>\n \u7ed3\u6784\u4f53\u5b9a\u4e49\u5b8c\u6210\u540e&#xff0c;\u5bc4\u5b58\u5668\u6620\u5c04\u7684\u6700\u540e\u4e00\u6b65&#xff0c;\u4fbf\u662f\u5c06\u5916\u8bbe\u7684\u57fa\u5730\u5740&#xff08;\u4e00\u4e2a\u7eaf\u6570\u5b57&#xff09;\u5f3a\u5236\u8f6c\u6362\u4e3a\u8be5\u7ed3\u6784\u4f53\u7c7b\u578b\u7684\u6307\u9488\u3002\u8fd9\u5229\u7528\u4e86C\u8bed\u8a00\u6307\u9488\u7684\u201c\u5730\u5740\u91cd\u89e3\u91ca\u201d\u80fd\u529b&#xff1a;\n<\/p>\n<p>#define GPIOB               ((GPIO_TypeDef *) GPIOB_BASE)<\/p>\n<p>\n \u8fd9\u6761\u5b8f\u5b9a\u4e49\u7684\u542b\u4e49\u662f&#xff1a;\u5c06<\/p>\n<p>  GPIOB_BASE<\/p>\n<p> &#xff08;\u5373<\/p>\n<p>  0x40010C00<\/p>\n<p> &#xff09;\u8fd9\u4e2a32\u4f4d\u65e0\u7b26\u53f7\u6574\u6570&#xff0c;\u89c6\u4e3a\u4e00\u4e2a<\/p>\n<p>  GPIO_TypeDef<\/p>\n<p> \u7ed3\u6784\u4f53\u7684\u9996\u5730\u5740&#xff0c;\u5e76\u521b\u5efa\u4e00\u4e2a\u6307\u5411\u5b83\u7684\u6307\u9488\u3002\u81ea\u6b64&#xff0c;<\/p>\n<p>  GPIOB<\/p>\n<p> \u4e0d\u518d\u662f\u4e00\u4e2a\u51b0\u51b7\u7684\u6570\u5b57&#xff0c;\u800c\u662f\u4e00\u4e2a\u62e5\u67097\u4e2a\u5177\u540d\u6210\u5458\u7684\u3001\u53ef\u88ab\u76f4\u63a5\u64cd\u4f5c\u7684\u5bf9\u8c61\u3002\u914d\u7f6ePB10\u7684\u64cd\u4f5c&#xff0c;\u4fbf\u4ece\u6666\u6da9\u7684\u5730\u5740\u64cd\u4f5c&#xff0c;\u8f6c\u53d8\u4e3a\u76f4\u89c2\u7684\u7ed3\u6784\u4f53\u6210\u5458\u8bbf\u95ee&#xff1a;\n<\/p>\n<p>GPIOB-&gt;CRL &amp;&#061; ~(0xFU &lt;&lt; (10 * 4)); \/\/ \u6e05\u9664PB10\u76844\u4f4d\u914d\u7f6e\u4f4d<br \/>\nGPIOB-&gt;CRL |&#061;  (0x3U &lt;&lt; (10 * 4)); \/\/ \u8bbe\u7f6ePB10\u4e3a\u63a8\u633d\u8f93\u51fa\u6a21\u5f0f&#xff08;0x03&#xff09;<\/p>\n<p>\n \u8fd9\u6bb5\u4ee3\u7801\u7684\u53ef\u8bfb\u6027\u4e0e\u5065\u58ee\u6027&#xff0c;\u8fdc\u8d85\u539f\u59cb\u7684<\/p>\n<p>  *(uint32_t*)0x40010C00 &#061; &#8230;<\/p>\n<p> \u3002\u5b83\u660e\u786e\u8868\u8fbe\u4e86\u64cd\u4f5c\u610f\u56fe&#xff08;\u914d\u7f6eCRL\u5bc4\u5b58\u5668&#xff09;\u3001\u64cd\u4f5c\u5bf9\u8c61&#xff08;PB10&#xff09;\u548c\u64cd\u4f5c\u7ed3\u679c&#xff08;\u63a8\u633d\u8f93\u51fa&#xff09;\u3002\u66f4\u91cd\u8981\u7684\u662f&#xff0c;\u5b83\u5c06\u786c\u4ef6\u7ec6\u8282&#xff08;\u5730\u5740\u8ba1\u7b97&#xff09;\u4e0e\u4e1a\u52a1\u903b\u8f91&#xff08;\u914d\u7f6e\u5f15\u811a&#xff09;\u5f7b\u5e95\u89e3\u8026\u3002\u5f53\u9700\u8981\u914d\u7f6e\u5176\u4ed6\u5f15\u811a\u65f6&#xff0c;\u53ea\u9700\u6539\u53d8\u4f4d\u79fb\u91cf<\/p>\n<p>  (n * 4)<\/p>\n<p> &#xff0c;\u800c\u65e0\u9700\u91cd\u65b0\u8ba1\u7b97\u4efb\u4f55\u5730\u5740\u3002\u8fd9\u79cd\u5c01\u88c5&#xff0c;\u662f\u5d4c\u5165\u5f0f\u8f6f\u4ef6\u5de5\u7a0b\u5316\u3001\u6a21\u5757\u5316\u7684\u6838\u5fc3\u5b9e\u8df5\u3002\n<\/p>\n<h3>\n 4. \u5bc4\u5b58\u5668\u4f4d\u64cd\u4f5c&#xff1a;\u539f\u5b50\u6027\u3001\u5b89\u5168\u6027\u7684\u5de5\u7a0b\u5b9e\u73b0<br \/>\n<\/h3>\n<p>\n \u5728\u5b8c\u6210\u4e86\u5bc4\u5b58\u5668\u7684\u7ed3\u6784\u4f53\u5c01\u88c5\u540e&#xff0c;\u5bf9\u5355\u4e2a\u5bc4\u5b58\u5668\u4f4d\u7684\u7cbe\u786e\u63a7\u5236&#xff0c;\u6210\u4e3a\u9a71\u52a8\u5f00\u53d1\u4e2d\u6700\u4e3a\u9891\u7e41\u4e5f\u6700\u4e3a\u5173\u952e\u7684\u64cd\u4f5c\u3002STM32\u7684\u8bb8\u591a\u5bc4\u5b58\u5668&#xff08;\u5982<\/p>\n<p>  ODR<\/p>\n<p> \u3001<\/p>\n<p>  BSRR<\/p>\n<p> \u3001<\/p>\n<p>  BRR<\/p>\n<p> &#xff09;\u7684\u8bbe\u8ba1\u54f2\u5b66&#xff0c;\u662f\u652f\u6301\u5bf9\u4efb\u610f\u4e00\u4f4d\u6216\u591a\u4f4d\u8fdb\u884c\u201c\u7f6e\u4f4d\u201d&#xff08;Set&#xff09;\u6216\u201c\u6e05\u96f6\u201d&#xff08;Reset&#xff09;&#xff0c;\u540c\u65f6\u4fdd\u8bc1\u5176\u4ed6\u4f4d\u7684\u72b6\u6001\u4e0d\u53d7\u5f71\u54cd\u3002\u8fd9\u5e76\u975e\u4e00\u4e2a\u7b80\u5355\u7684\u8d4b\u503c\u95ee\u9898&#xff0c;\u800c\u662f\u4e00\u4e2a\u6d89\u53ca\u5e76\u53d1\u5b89\u5168\u3001\u786c\u4ef6\u7279\u6027\u548cC\u8bed\u8a00\u4f4d\u8fd0\u7b97\u6280\u5de7\u7684\u7efc\u5408\u5de5\u7a0b\u8bfe\u9898\u3002\n<\/p>\n<p>\n \u6700\u76f4\u89c2\u7684\u9519\u8bef\u505a\u6cd5&#xff0c;\u662f\u76f4\u63a5\u5bf9\u6574\u4e2a\u5bc4\u5b58\u5668\u8fdb\u884c\u8d4b\u503c\u3002\u4f8b\u5982&#xff0c;\u8981\u5c06GPIOB\u7684\u7b2c10\u4f4d&#xff08;PB10&#xff09;\u8bbe\u7f6e\u4e3a\u9ad8\u7535\u5e73&#xff0c;\u6709\u4eba\u4f1a\u5199\u51fa&#xff1a;\n<\/p>\n<p>GPIOB-&gt;ODR &#061; 1U &lt;&lt; 10; \/\/ \u9519\u8bef&#xff01;\u4f1a\u5c06ODR\u5176\u4ed615\u4f4d\u5168\u90e8\u6e05\u96f6<\/p>\n<p>\n \u6b64\u64cd\u4f5c\u7684\u95ee\u9898\u5728\u4e8e&#xff0c;<\/p>\n<p>  ODR<\/p>\n<p> &#xff08;Output Data Register&#xff09;\u662f\u4e00\u4e2a16\u4f4d\u5bc4\u5b58\u5668&#xff0c;\u5176\u6bcf\u4e00\u4f4d\u5bf9\u5e94\u4e00\u4e2aGPIO\u5f15\u811a\u7684\u8f93\u51fa\u7535\u5e73\u3002<\/p>\n<p>  1U &lt;&lt; 10<\/p>\n<p> \u7684\u7ed3\u679c\u662f<\/p>\n<p>  0x0400<\/p>\n<p> &#xff0c;\u5373\u53ea\u6709\u7b2c10\u4f4d\u4e3a1&#xff0c;\u5176\u4f59\u4f4d\u5168\u4e3a0\u3002\u6267\u884c\u6b64\u8d4b\u503c\u540e&#xff0c;<\/p>\n<p>  ODR<\/p>\n<p> \u7684\u503c\u53d8\u4e3a<\/p>\n<p>  0x0400<\/p>\n<p> &#xff0c;\u8fd9\u610f\u5473\u7740PB0-PB9\u548cPB11-PB15\u7684\u8f93\u51fa\u72b6\u6001\u5168\u90e8\u88ab\u5f3a\u5236\u62c9\u4f4e\u3002\u8fd9\u5728\u591a\u5f15\u811a\u534f\u540c\u5de5\u4f5c\u7684\u7cfb\u7edf\u4e2d\u662f\u4e0d\u53ef\u63a5\u53d7\u7684&#xff0c;\u56e0\u4e3a\u5b83\u7834\u574f\u4e86\u5176\u4ed6\u5f15\u811a\u7684\u5f53\u524d\u72b6\u6001&#xff0c;\u5c5e\u4e8e\u5178\u578b\u7684\u201c\u526f\u4f5c\u7528\u201d\u3002\n<\/p>\n<p>\n \u6b63\u786e\u7684\u505a\u6cd5&#xff0c;\u662f\u5229\u7528C\u8bed\u8a00\u7684\u4f4d\u8fd0\u7b97\u7b26&#xff0c;\u5b9e\u73b0\u5bf9\u76ee\u6807\u4f4d\u7684\u201c\u8bfb-\u4fee\u6539-\u5199\u201d&#xff08;Read-Modify-Write&#xff09;\u539f\u5b50\u64cd\u4f5c\u3002\u5176\u6838\u5fc3\u601d\u60f3\u662f&#xff1a;<\/p>\n<p>  \u5148\u8bfb\u53d6\u5bc4\u5b58\u5668\u7684\u5f53\u524d\u503c&#xff0c;\u7136\u540e\u5728\u5185\u5b58\u4e2d\u5bf9\u5176\u8fdb\u884c\u4f4d\u8fd0\u7b97\u4fee\u6539&#xff0c;\u6700\u540e\u5c06\u65b0\u503c\u5199\u56de\u5bc4\u5b58\u5668<\/p>\n<p> \u3002\u5bf9\u4e8e\u201c\u7f6e\u4f4d\u201d\u64cd\u4f5c&#xff0c;\u4f7f\u7528\u6309\u4f4d\u6216&#xff08;<\/p>\n<p>  |<\/p>\n<p> &#xff09;&#xff1a;\n<\/p>\n<p>GPIOB-&gt;ODR |&#061; (1U &lt;&lt; 10); \/\/ \u6b63\u786e&#xff1a;\u4ec5\u5c06PB10\u7f6e1&#xff0c;\u5176\u4ed6\u4f4d\u4fdd\u6301\u4e0d\u53d8<\/p>\n<p>\n \u5bf9\u4e8e\u201c\u6e05\u96f6\u201d\u64cd\u4f5c&#xff0c;\u4f7f\u7528\u6309\u4f4d\u4e0e&#xff08;<\/p>\n<p>  &amp;<\/p>\n<p> &#xff09;\u914d\u5408\u53d6\u53cd&#xff08;<\/p>\n<p>  ~<\/p>\n<p> &#xff09;&#xff1a;\n<\/p>\n<p>GPIOB-&gt;ODR &amp;&#061; ~(1U &lt;&lt; 10); \/\/ \u6b63\u786e&#xff1a;\u4ec5\u5c06PB10\u6e05\u96f6&#xff0c;\u5176\u4ed6\u4f4d\u4fdd\u6301\u4e0d\u53d8<\/p>\n<p>\n \u8fd9\u4e24\u6761\u8bed\u53e5\u7684\u6c47\u7f16\u5b9e\u73b0&#xff0c;\u901a\u5e38\u4f1a\u88ab\u7f16\u8bd1\u5668\u4f18\u5316\u4e3a\u4e00\u6761<\/p>\n<p>  OR<\/p>\n<p> \u6216<\/p>\n<p>  AND<\/p>\n<p> \u6307\u4ee4&#xff0c;\u5176\u6548\u7387\u6781\u9ad8\u3002\u7136\u800c&#xff0c;\u5728\u67d0\u4e9b\u5bf9\u5b9e\u65f6\u6027\u8981\u6c42\u6781\u9ad8\u7684\u573a\u666f\u4e0b&#xff0c;\u6216\u8005\u5f53\u5bc4\u5b58\u5668\u672c\u8eab\u4e0d\u652f\u6301\u539f\u5b50\u8bfb-\u4fee\u6539-\u5199\u65f6&#xff08;\u5982\u67d0\u4e9b\u72b6\u6001\u5bc4\u5b58\u5668&#xff09;&#xff0c;\u8fd9\u79cd\u4e09\u6b65\u64cd\u4f5c\u4ecd\u53ef\u80fd\u5b58\u5728\u7ade\u6001\u98ce\u9669\u3002STM32F103\u4e3a\u6b64\u63d0\u4f9b\u4e86\u786c\u4ef6\u7ea7\u7684\u89e3\u51b3\u65b9\u6848\u2014\u2014<\/p>\n<p>  BSRR<\/p>\n<p> &#xff08;Bit Set\/Reset Register&#xff09;\u5bc4\u5b58\u5668\u3002<\/p>\n<p>  BSRR<\/p>\n<p> \u662f\u4e00\u4e2a32\u4f4d\u5bc4\u5b58\u5668&#xff0c;\u5176\u9ad816\u4f4d&#xff08;bit[31:16]&#xff09;\u7528\u4e8e\u201c\u7f6e\u4f4d\u201d&#xff0c;\u4f4e16\u4f4d&#xff08;bit[15:0]&#xff09;\u7528\u4e8e\u201c\u6e05\u96f6\u201d\u3002\u5411<\/p>\n<p>  BSRR<\/p>\n<p> \u7684\u67d0\u4e00\u4f4d\u5199\u51651&#xff0c;\u5c06\u7acb\u5373\u89e6\u53d1\u5bf9\u5e94GPIO\u5f15\u811a\u7684\u7f6e\u4f4d\u6216\u6e05\u96f6\u52a8\u4f5c&#xff0c;\u4e14\u8be5\u64cd\u4f5c\u662f\u786c\u4ef6\u539f\u5b50\u7684&#xff0c;\u4e0d\u4f1a\u5f71\u54cd\u5176\u4ed6\u4f4d&#xff0c;\u4e5f\u65e0\u9700\u8bfb\u53d6\u539f\u503c\u3002\n<\/p>\n<p>\/\/ \u4f7f\u7528BSRR\u5b9e\u73b0\u539f\u5b50\u7f6e\u4f4d\u548c\u6e05\u96f6&#xff08;\u63a8\u8350\u7528\u4e8e\u5173\u952e\u8def\u5f84&#xff09;<br \/>\nGPIOB-&gt;BSRR &#061; (1U &lt;&lt; 10);          \/\/ \u7f6e\u4f4dPB10&#xff08;\u5199\u5165\u4f4e16\u4f4d&#xff09;<br \/>\nGPIOB-&gt;BSRR &#061; (1U &lt;&lt; (10 &#043; 16));   \/\/ \u6e05\u96f6PB10&#xff08;\u5199\u5165\u9ad816\u4f4d&#xff09;<\/p>\n<p>  BSRR<\/p>\n<p> \u7684\u5de7\u5999\u4e4b\u5904\u5728\u4e8e&#xff0c;\u5b83\u5c06\u201c\u7f6e\u4f4d\u201d\u548c\u201c\u6e05\u96f6\u201d\u8fd9\u4e24\u4e2a\u4e92\u65a5\u7684\u64cd\u4f5c&#xff0c;\u901a\u8fc7\u5730\u5740\u7a7a\u95f4\u7684\u540c\u4e00\u5bc4\u5b58\u5668\u7684\u4e0d\u540c\u4f4d\u57df\u6765\u5206\u79bb&#xff0c;\u4ece\u800c\u89c4\u907f\u4e86\u8f6f\u4ef6\u5c42\u9762\u7684\u8bfb-\u4fee\u6539-\u5199\u7ade\u4e89\u3002\u5728\u5b9e\u9645\u9879\u76ee\u4e2d&#xff0c;\u6211\u66fe\u5728\u4e00\u4e2a\u7535\u673a\u9a71\u52a8\u677f\u4e0a\u9047\u5230\u8fc7\u56e0<\/p>\n<p>  ODR<\/p>\n<p> \u76f4\u63a5\u8d4b\u503c\u5bfc\u81f4\u7684PWM\u6ce2\u5f62\u6296\u52a8\u95ee\u9898\u3002\u5c06\u6240\u6709\u5f15\u811a\u63a7\u5236\u903b\u8f91\u5207\u6362\u81f3<\/p>\n<p>  BSRR<\/p>\n<p> \u540e&#xff0c;\u6296\u52a8\u5b8c\u5168\u6d88\u5931&#xff0c;\u7cfb\u7edf\u7a33\u5b9a\u6027\u5f97\u5230\u663e\u8457\u63d0\u5347\u3002\u8fd9\u5370\u8bc1\u4e86\u4e00\u4e2a\u7ecf\u9a8c&#xff1a;<\/p>\n<p>  \u5728\u5e95\u5c42\u9a71\u52a8\u4e2d&#xff0c;\u4f18\u5148\u9009\u62e9\u786c\u4ef6\u63d0\u4f9b\u7684\u539f\u5b50\u64cd\u4f5c\u539f\u8bed&#xff0c;\u800c\u975e\u4f9d\u8d56\u8f6f\u4ef6\u6a21\u62df&#xff0c;\u662f\u4fdd\u969c\u7cfb\u7edf\u9c81\u68d2\u6027\u7684\u9ec4\u91d1\u6cd5\u5219<\/p>\n<p> \u3002\n<\/p>\n<h3>\n 5. \u4ece\u7406\u8bba\u5230\u5b9e\u8df5&#xff1a;\u624b\u5199\u5bc4\u5b58\u5668\u6620\u5c04\u7684\u5b8c\u6574\u4ee3\u7801\u793a\u4f8b<br \/>\n<\/h3>\n<p>\n \u7406\u8bba\u7684\u6700\u7ec8\u4ef7\u503c&#xff0c;\u5728\u4e8e\u6307\u5bfc\u5b9e\u8df5\u3002\u4e0b\u9762&#xff0c;\u6211\u4eec\u5c06\u524d\u8ff0\u6240\u6709\u539f\u7406&#xff0c;\u6574\u5408\u4e3a\u4e00\u4efd\u5b8c\u6574\u7684\u3001\u53ef\u76f4\u63a5\u7f16\u8bd1\u8fd0\u884c\u7684\u5bc4\u5b58\u5668\u6620\u5c04\u5934\u6587\u4ef6&#xff08;<\/p>\n<p>  stm32f103xx.h<\/p>\n<p> \u7684\u7b80\u5316\u7248&#xff09;\u3002\u8fd9\u4efd\u4ee3\u7801\u5e76\u975e\u4e3a\u4e86\u66ff\u4ee3\u5b98\u65b9\u56fa\u4ef6\u5e93&#xff0c;\u800c\u662f\u4e3a\u4e86\u63ed\u793a\u5176\u5185\u90e8\u6784\u9020&#xff0c;\u8ba9\u5f00\u53d1\u8005\u771f\u6b63\u7406\u89e3\u201c\u4e3a\u4ec0\u4e48\u8fd9\u6837\u5199\u201d\u3002\n<\/p>\n<p>#ifndef __STM32F103XX_H<br \/>\n#define __STM32F103XX_H<\/p>\n<p>#include &lt;stdint.h&gt;<\/p>\n<p>\/* \u5b9a\u4e49volatile\u5173\u952e\u5b57&#xff0c;\u786e\u4fdd\u5185\u5b58\u8bbf\u95ee\u4e0d\u88ab\u4f18\u5316 *\/<br \/>\n#ifndef __IO<br \/>\n#define __IO volatile<br \/>\n#endif<\/p>\n<p>\/* \u5b9a\u4e49\u5916\u8bbe\u57fa\u5730\u5740 *\/<br \/>\n#define PERIPH_BASE           ((uint32_t)0x40000000)<\/p>\n<p>\/* \u5b9a\u4e49\u5404\u603b\u7ebf\u57fa\u5730\u5740 *\/<br \/>\n#define APB1PERIPH_BASE       (PERIPH_BASE &#043; 0x00000000)<br \/>\n#define APB2PERIPH_BASE       (PERIPH_BASE &#043; 0x00010000)<br \/>\n#define AHBPERIPH_BASE        (PERIPH_BASE &#043; 0x00018000)<\/p>\n<p>\/* \u5b9a\u4e49GPIO\u5916\u8bbe\u57fa\u5730\u5740 *\/<br \/>\n#define GPIOA_BASE            (APB2PERIPH_BASE &#043; 0x00000800)<br \/>\n#define GPIOB_BASE            (APB2PERIPH_BASE &#043; 0x00000C00)<br \/>\n#define GPIOC_BASE            (APB2PERIPH_BASE &#043; 0x00001000)<br \/>\n#define GPIOD_BASE            (APB2PERIPH_BASE &#043; 0x00001400)<br \/>\n#define GPIOE_BASE            (APB2PERIPH_BASE &#043; 0x00001800)<\/p>\n<p>\/* \u5b9a\u4e49GPIO\u5bc4\u5b58\u5668\u7ed3\u6784\u4f53 *\/<br \/>\ntypedef struct {<br \/>\n    __IO uint32_t CRL;   \/*!&lt; Port configuration register low,              Address offset: 0x00 *\/<br \/>\n    __IO uint32_t CRH;   \/*!&lt; Port configuration register high,             Address offset: 0x04 *\/<br \/>\n    __IO uint32_t IDR;   \/*!&lt; Port input data register,                     Address offset: 0x08 *\/<br \/>\n    __IO uint32_t ODR;   \/*!&lt; Port output data register,                    Address offset: 0x0C *\/<br \/>\n    __IO uint32_t BSRR;  \/*!&lt; Port bit set\/reset register,                  Address offset: 0x10 *\/<br \/>\n    __IO uint32_t BRR;   \/*!&lt; Port bit reset register,                      Address offset: 0x14 *\/<br \/>\n    __IO uint32_t LCKR;  \/*!&lt; Port configuration lock register,             Address offset: 0x18 *\/<br \/>\n} GPIO_TypeDef;<\/p>\n<p>\/* \u5b9a\u4e49GPIO\u7aef\u53e3\u6307\u9488 *\/<br \/>\n#define GPIOA               ((GPIO_TypeDef *) GPIOA_BASE)<br \/>\n#define GPIOB               ((GPIO_TypeDef *) GPIOB_BASE)<br \/>\n#define GPIOC               ((GPIO_TypeDef *) GPIOC_BASE)<br \/>\n#define GPIOD               ((GPIO_TypeDef *) GPIOD_BASE)<br \/>\n#define GPIOE               ((GPIO_TypeDef *) GPIOE_BASE)<\/p>\n<p>\/* \u5b9a\u4e49RCC&#xff08;Reset and Clock Control&#xff09;\u5916\u8bbe\u57fa\u5730\u5740\u53ca\u7ed3\u6784\u4f53&#xff08;\u4f5c\u4e3a\u5ef6\u4f38\u793a\u4f8b&#xff09; *\/<br \/>\n#define RCC_BASE              (APB2PERIPH_BASE &#043; 0x00001000)<\/p>\n<p>typedef struct {<br \/>\n    __IO uint32_t CR;        \/*!&lt; RCC clock control register,                 Address offset: 0x00 *\/<br \/>\n    __IO uint32_t CFGR;      \/*!&lt; RCC clock configuration register,           Address offset: 0x04 *\/<br \/>\n    __IO uint32_t CIR;       \/*!&lt; RCC clock interrupt register,               Address offset: 0x08 *\/<br \/>\n    __IO uint32_t APB2RSTR;  \/*!&lt; RCC APB2 peripheral reset register,         Address offset: 0x0C *\/<br \/>\n    __IO uint32_t APB1RSTR;  \/*!&lt; RCC APB1 peripheral reset register,         Address offset: 0x10 *\/<br \/>\n    __IO uint32_t AHBENR;    \/*!&lt; RCC AHB peripheral clock enable register,   Address offset: 0x14 *\/<br \/>\n    __IO uint32_t APB2ENR;   \/*!&lt; RCC APB2 peripheral clock enable register,  Address offset: 0x18 *\/<br \/>\n    __IO uint32_t APB1ENR;   \/*!&lt; RCC APB1 peripheral clock enable register,  Address offset: 0x1C *\/<br \/>\n    __IO uint32_t BDCR;      \/*!&lt; RCC Backup domain control register,         Address offset: 0x20 *\/<br \/>\n    __IO uint32_t CSR;       \/*!&lt; RCC clock control &amp; status register,        Address offset: 0x24 *\/<br \/>\n} RCC_TypeDef;<\/p>\n<p>#define RCC                 ((RCC_TypeDef *) RCC_BASE)<\/p>\n<p>\/* \u51fd\u6570\u58f0\u660e&#xff1a;\u4e00\u4e2a\u7b80\u5355\u7684GPIO\u521d\u59cb\u5316\u51fd\u6570 *\/<br \/>\nvoid GPIO_Init(void);<\/p>\n<p>#endif \/* __STM32F103XX_H *\/<\/p>\n<p>\n \u8fd9\u662f\u4e00\u4e2a\u7eaf\u7cb9\u7684\u5934\u6587\u4ef6&#xff0c;\u5b83\u4e0d\u5305\u542b\u4efb\u4f55<\/p>\n<p>  .c<\/p>\n<p> \u5b9e\u73b0&#xff0c;\u5176\u5168\u90e8\u5185\u5bb9\u90fd\u662f\u5b8f\u5b9a\u4e49\u548c\u7c7b\u578b\u58f0\u660e\u3002\u5c06\u6b64\u6587\u4ef6\u5305\u542b\u5230\u4f60\u7684\u4e3b\u7a0b\u5e8f\u4e2d&#xff0c;\u4f60\u5c31\u53ef\u4ee5\u50cf\u5b98\u65b9\u5e93\u4e00\u6837&#xff0c;\u4f7f\u7528<\/p>\n<p>  GPIOB-&gt;ODR |&#061; (1U &lt;&lt; 10);<\/p>\n<p> \u8fd9\u6837\u7684\u8bed\u53e5\u3002\u800c<\/p>\n<p>  GPIO_Init()<\/p>\n<p> \u51fd\u6570\u7684\u5b9e\u73b0&#xff0c;\u5219\u53ef\u4ee5\u653e\u5728\u4e00\u4e2a<\/p>\n<p>  .c<\/p>\n<p> \u6587\u4ef6\u4e2d&#xff0c;\u5b83\u5c06\u8d1f\u8d23\u4f7f\u80fdGPIOB\u7684\u65f6\u949f&#xff08;\u901a\u8fc7\u64cd\u4f5c<\/p>\n<p>  RCC-&gt;APB2ENR<\/p>\n<p> \u5bc4\u5b58\u5668&#xff09;\u3001\u914d\u7f6ePB10\u7684\u6a21\u5f0f&#xff08;\u901a\u8fc7\u64cd\u4f5c<\/p>\n<p>  GPIOB-&gt;CRL<\/p>\n<p> \u5bc4\u5b58\u5668&#xff09;\u7b49\u3002\n<\/p>\n<p>\n \u8fd9\u4efd\u4ee3\u7801\u7684\u6bcf\u4e00\u4e2a\u5b57\u7b26&#xff0c;\u90fd\u5bf9\u5e94\u7740\u82af\u7247\u624b\u518c\u4e2d\u7684\u4e00\u884c\u63cf\u8ff0\u3002\u5f53\u4f60\u4eb2\u624b\u6572\u4e0b<\/p>\n<p>  #define GPIOB_BASE (APB2PERIPH_BASE &#043; 0x00000C00)<\/p>\n<p> \u65f6&#xff0c;\u4f60\u4e0d\u662f\u5728\u5199\u4ee3\u7801&#xff0c;\u800c\u662f\u5728\u4e0e\u7845\u7247\u5bf9\u8bdd&#xff1b;\u5f53\u4f60\u5199\u4e0b<\/p>\n<p>  GPIOB-&gt;BSRR &#061; (1U &lt;&lt; 10);<\/p>\n<p> \u65f6&#xff0c;\u4f60\u4e0d\u662f\u5728\u8c03\u7528\u51fd\u6570&#xff0c;\u800c\u662f\u5728\u5411\u786c\u4ef6\u53d1\u51fa\u4e00\u9053\u7cbe\u786e\u7684\u6307\u4ee4\u3002\u8fd9\u79cd\u201c\u77e5\u5176\u7136&#xff0c;\u66f4\u77e5\u5176\u6240\u4ee5\u7136\u201d\u7684\u638c\u63a7\u611f&#xff0c;\u662f\u5d4c\u5165\u5f0f\u5de5\u7a0b\u5e08\u6700\u5b9d\u8d35\u7684\u804c\u4e1a\u7d20\u517b\u3002\u5728\u6211\u5e26\u8fc7\u7684\u51e0\u4e2a\u65b0\u4eba\u4e2d&#xff0c;\u51e1\u662f\u575a\u6301\u4ece\u8fd9\u4efd\u624b\u5199\u6620\u5c04\u5f00\u59cb\u5b66\u4e60\u7684&#xff0c;\u4e09\u4e2a\u6708\u540e\u90fd\u80fd\u72ec\u7acb\u5b8c\u6210\u590d\u6742\u7684\u5916\u8bbe\u9a71\u52a8\u5f00\u53d1&#xff1b;\u800c\u90a3\u4e9b\u53ea\u6ee1\u8db3\u4e8e\u8c03\u7528HAL\u5e93API\u7684&#xff0c;\u5f80\u5f80\u5728\u9047\u5230\u65f6\u949f\u914d\u7f6e\u9519\u8bef\u6216\u4e2d\u65ad\u5931\u6548\u65f6&#xff0c;\u4fbf\u675f\u624b\u65e0\u7b56\u3002\u8fd9\u5e76\u975e\u6280\u672f\u96be\u5ea6\u7684\u5dee\u5f02&#xff0c;\u800c\u662f\u5de5\u7a0b\u601d\u7ef4\u6df1\u5ea6\u7684\u6839\u672c\u533a\u522b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. \u5bc4\u5b58\u5668\u6620\u5c04\u7684\u672c\u8d28&#xff1a;\u4ece\u5185\u5b58\u5730\u5740\u5230\u53ef\u7f16\u7a0b\u5916\u8bbe\u7684\u5de5\u7a0b\u6865\u6881\u5728\u5d4c\u5165\u5f0f\u7cfb\u7edf\u5f00\u53d1\u4e2d&#xff0c;\u201c\u5bc4\u5b58\u5668\u201d\u4e00\u8bcd\u5e38\u88ab\u521d\u5b66\u8005\u8bef\u89e3\u4e3a\u67d0\u79cd\u795e\u79d8\u7684\u786c\u4ef6\u5f00\u5173\u6216\u62bd\u8c61\u6982\u5ff5\u3002\u5b9e\u9645\u4e0a&#xff0c;\u5bc4\u5b58\u5668\u662f\u5fae\u63a7\u5236\u5668\u4e2d\u6700\u57fa\u7840\u3001\u6700\u771f\u5b9e\u7684\u7269\u7406\u5b58\u5728\u2014\u2014\u5b83\u662f\u4e00\u5757\u4f4d\u4e8e\u7279\u5b9a\u5185\u5b58\u5730\u5740\u4e0a\u7684\u3001\u53ef\u88abCPU\u76f4\u63a5\u8bfb\u5199\u768432\u4f4d&#xff08;\u621616\/8\u4f4d&#xff09;\u5b58\u50a8\u5355\u5143\u3002\u5bf9STM32\u800c\u8a00&#xff0c;\u5bc4\u5b58\u5668\u5e76\u975e\u60ac\u6d6e\u4e8e\u7a7a\u4e2d\u7684\u903b\u8f91\u7b26\u53f7&#xff0c;\u800c\u662f\u4e25\u683c\u6620\u5c04\u5728\u7247\u4e0a\u5730\u5740\u7a7a\u95f4\u4e2d\u7684\u4e00\u7ec4\u8fde\u7eed\u5185\u5b58\u4f4d\u7f6e\u3002\u7406\u89e3\u5bc4\u5b58\u5668\u6620<\/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":[8348,8349,217],"topic":[],"class_list":["post-76854","post","type-post","status-publish","format-standard","hentry","category-server","tag-8348","tag-8349","tag-stm32"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>STM32\u5bc4\u5b58\u5668\u6620\u5c04\u539f\u7406\u4e0e\u7ed3\u6784\u4f53\u5c01\u88c5\u5b9e\u8df5 - \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\/76854.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"STM32\u5bc4\u5b58\u5668\u6620\u5c04\u539f\u7406\u4e0e\u7ed3\u6784\u4f53\u5c01\u88c5\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"1. \u5bc4\u5b58\u5668\u6620\u5c04\u7684\u672c\u8d28&#xff1a;\u4ece\u5185\u5b58\u5730\u5740\u5230\u53ef\u7f16\u7a0b\u5916\u8bbe\u7684\u5de5\u7a0b\u6865\u6881\u5728\u5d4c\u5165\u5f0f\u7cfb\u7edf\u5f00\u53d1\u4e2d&#xff0c;\u201c\u5bc4\u5b58\u5668\u201d\u4e00\u8bcd\u5e38\u88ab\u521d\u5b66\u8005\u8bef\u89e3\u4e3a\u67d0\u79cd\u795e\u79d8\u7684\u786c\u4ef6\u5f00\u5173\u6216\u62bd\u8c61\u6982\u5ff5\u3002\u5b9e\u9645\u4e0a&#xff0c;\u5bc4\u5b58\u5668\u662f\u5fae\u63a7\u5236\u5668\u4e2d\u6700\u57fa\u7840\u3001\u6700\u771f\u5b9e\u7684\u7269\u7406\u5b58\u5728\u2014\u2014\u5b83\u662f\u4e00\u5757\u4f4d\u4e8e\u7279\u5b9a\u5185\u5b58\u5730\u5740\u4e0a\u7684\u3001\u53ef\u88abCPU\u76f4\u63a5\u8bfb\u5199\u768432\u4f4d&#xff08;\u621616\/8\u4f4d&#xff09;\u5b58\u50a8\u5355\u5143\u3002\u5bf9STM32\u800c\u8a00&#xff0c;\u5bc4\u5b58\u5668\u5e76\u975e\u60ac\u6d6e\u4e8e\u7a7a\u4e2d\u7684\u903b\u8f91\u7b26\u53f7&#xff0c;\u800c\u662f\u4e25\u683c\u6620\u5c04\u5728\u7247\u4e0a\u5730\u5740\u7a7a\u95f4\u4e2d\u7684\u4e00\u7ec4\u8fde\u7eed\u5185\u5b58\u4f4d\u7f6e\u3002\u7406\u89e3\u5bc4\u5b58\u5668\u6620\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/76854.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-23T05:34:00+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=\"7 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/76854.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/76854.html\",\"name\":\"STM32\u5bc4\u5b58\u5668\u6620\u5c04\u539f\u7406\u4e0e\u7ed3\u6784\u4f53\u5c01\u88c5\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-02-23T05:34:00+00:00\",\"dateModified\":\"2026-02-23T05:34:00+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/76854.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/76854.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/76854.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"STM32\u5bc4\u5b58\u5668\u6620\u5c04\u539f\u7406\u4e0e\u7ed3\u6784\u4f53\u5c01\u88c5\u5b9e\u8df5\"}]},{\"@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\u5bc4\u5b58\u5668\u6620\u5c04\u539f\u7406\u4e0e\u7ed3\u6784\u4f53\u5c01\u88c5\u5b9e\u8df5 - \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\/76854.html","og_locale":"zh_CN","og_type":"article","og_title":"STM32\u5bc4\u5b58\u5668\u6620\u5c04\u539f\u7406\u4e0e\u7ed3\u6784\u4f53\u5c01\u88c5\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"1. \u5bc4\u5b58\u5668\u6620\u5c04\u7684\u672c\u8d28&#xff1a;\u4ece\u5185\u5b58\u5730\u5740\u5230\u53ef\u7f16\u7a0b\u5916\u8bbe\u7684\u5de5\u7a0b\u6865\u6881\u5728\u5d4c\u5165\u5f0f\u7cfb\u7edf\u5f00\u53d1\u4e2d&#xff0c;\u201c\u5bc4\u5b58\u5668\u201d\u4e00\u8bcd\u5e38\u88ab\u521d\u5b66\u8005\u8bef\u89e3\u4e3a\u67d0\u79cd\u795e\u79d8\u7684\u786c\u4ef6\u5f00\u5173\u6216\u62bd\u8c61\u6982\u5ff5\u3002\u5b9e\u9645\u4e0a&#xff0c;\u5bc4\u5b58\u5668\u662f\u5fae\u63a7\u5236\u5668\u4e2d\u6700\u57fa\u7840\u3001\u6700\u771f\u5b9e\u7684\u7269\u7406\u5b58\u5728\u2014\u2014\u5b83\u662f\u4e00\u5757\u4f4d\u4e8e\u7279\u5b9a\u5185\u5b58\u5730\u5740\u4e0a\u7684\u3001\u53ef\u88abCPU\u76f4\u63a5\u8bfb\u5199\u768432\u4f4d&#xff08;\u621616\/8\u4f4d&#xff09;\u5b58\u50a8\u5355\u5143\u3002\u5bf9STM32\u800c\u8a00&#xff0c;\u5bc4\u5b58\u5668\u5e76\u975e\u60ac\u6d6e\u4e8e\u7a7a\u4e2d\u7684\u903b\u8f91\u7b26\u53f7&#xff0c;\u800c\u662f\u4e25\u683c\u6620\u5c04\u5728\u7247\u4e0a\u5730\u5740\u7a7a\u95f4\u4e2d\u7684\u4e00\u7ec4\u8fde\u7eed\u5185\u5b58\u4f4d\u7f6e\u3002\u7406\u89e3\u5bc4\u5b58\u5668\u6620","og_url":"https:\/\/www.wsisp.com\/helps\/76854.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-02-23T05:34:00+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"7 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/76854.html","url":"https:\/\/www.wsisp.com\/helps\/76854.html","name":"STM32\u5bc4\u5b58\u5668\u6620\u5c04\u539f\u7406\u4e0e\u7ed3\u6784\u4f53\u5c01\u88c5\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-02-23T05:34:00+00:00","dateModified":"2026-02-23T05:34:00+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/76854.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/76854.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/76854.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"STM32\u5bc4\u5b58\u5668\u6620\u5c04\u539f\u7406\u4e0e\u7ed3\u6784\u4f53\u5c01\u88c5\u5b9e\u8df5"}]},{"@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\/76854","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=76854"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/76854\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=76854"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=76854"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=76854"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=76854"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}