{"id":44839,"date":"2023-09-27T09:09:08","date_gmt":"2023-09-27T01:09:08","guid":{"rendered":"https:\/\/www.techphant.cn\/?p=44839"},"modified":"2023-09-27T09:09:08","modified_gmt":"2023-09-27T01:09:08","slug":"syskckzdjs","status":"publish","type":"post","link":"https:\/\/www.techphant.cn\/blog\/44839.html","title":{"rendered":"\u4f7f\u7528STM32 HAL\u5e93\u4e32\u53e3\u4e2d\u65ad\u63a5\u6536"},"content":{"rendered":"

  \u5728\u5927\u591a\u6570\u5d4c\u5165\u5f0f\u7cfb\u7edf\u5f00\u53d1\u4e2d\uff0c\u4e32\u53e3\u901a\u4fe1\u662f\u4e00\u79cd\u91cd\u8981\u7684\u6570\u636e\u4f20\u8f93\u65b9\u5f0f\u3002STM32 HAL\u5e93\u63d0\u4f9b\u4e86\u4e00\u79cd\u975e\u5e38\u65b9\u4fbf\u7684\u4e32\u53e3\u4e2d\u65ad\u63a5\u6536\u65b9\u6cd5\uff0c\u53ef\u4ee5\u6709\u6548\u63d0\u9ad8\u6570\u636e\u63a5\u6536\u7684\u6548\u7387\u3002<\/strong>\u672c\u6587\u5c06\u4ecb\u7ecdSTM32 HAL\u5e93\u4e32\u53e3\u4e2d\u65ad\u63a5\u6536\u7684\u57fa\u672c\u539f\u7406\uff0c\u4ee5\u53ca\u5982\u4f55\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\u4f7f\u7528\u5b83\u3002<\/p>\n

STM32 HAL\u5e93\u4e32\u53e3\u4e2d\u65ad\u63a5\u6536\u7684\u57fa\u672c\u539f\u7406<\/h2>\n

  STM32 HAL\u5e93\u4e32\u53e3\u4e2d\u65ad\u63a5\u6536\u7684\u57fa\u672c\u539f\u7406\u662f\uff0c\u5f53\u4e32\u53e3\u63a5\u6536\u5230\u6570\u636e\u65f6\uff0c\u4f1a\u89e6\u53d1\u4e00\u4e2a\u4e2d\u65ad\uff0c\u7136\u540e\u8c03\u7528\u7a0b\u5e8f\u4e2d\u5b9a\u4e49\u7684\u4e2d\u65ad\u670d\u52a1\u7a0b\u5e8f\uff08ISR\uff09\uff0c\u5728ISR\u4e2d\u7f16\u5199\u4ee3\u7801\uff0c\u4ece\u4e32\u53e3\u4e2d\u8bfb\u53d6\u6570\u636e\uff0c\u5e76\u5c06\u6570\u636e\u653e\u5165\u7f13\u51b2\u533a\u3002<\/p>\n

  \u914d\u7f6e\u4e32\u53e3\u4e2d\u65ad<\/h3>\n

  \u8981\u4f7f\u7528STM32 HAL\u5e93\u4e32\u53e3\u4e2d\u65ad\u63a5\u6536\uff0c\u9700\u8981\u5728\u7a0b\u5e8f\u4e2d\u914d\u7f6e\u4e32\u53e3\u7684\u4e2d\u65ad\u3002\u9996\u5148\uff0c\u9700\u8981\u5728HAL_UART_Init\u51fd\u6570\u4e2d\u914d\u7f6eUART_IT_RXNE\u4e2d\u65ad\uff0c\u7136\u540e\uff0c\u5728HAL_UART_MspInit\u51fd\u6570\u4e2d\uff0c\u4f7f\u80fdUART\u7684\u4e2d\u65ad\uff0c\u6700\u540e\uff0c\u5728main\u51fd\u6570\u4e2d\uff0c\u4f7f\u80fd\u4e2d\u65ad\u603b\u5165\u53e3\u3002<\/p>\n

  \u7f16\u5199\u4e2d\u65ad\u670d\u52a1\u7a0b\u5e8f<\/h3>\n

  \u5f53\u4e32\u53e3\u6536\u5230\u6570\u636e\u65f6\uff0c\u4f1a\u89e6\u53d1UART_IT_RXNE\u4e2d\u65ad\uff0c\u7136\u540e\u8c03\u7528\u4e2d\u65ad\u670d\u52a1\u7a0b\u5e8f\u3002\u5728\u4e2d\u65ad\u670d\u52a1\u7a0b\u5e8f\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528HAL_UART_Receive_IT\u51fd\u6570\u4ece\u4e32\u53e3\u8bfb\u53d6\u6570\u636e\uff0c\u5e76\u5c06\u6570\u636e\u653e\u5165\u7f13\u51b2\u533a\u3002<\/p>\n

  \u4f7f\u7528\u7f13\u51b2\u533a\u6570\u636e<\/h3>\n

  \u5f53\u4e32\u53e3\u6570\u636e\u653e\u5165\u7f13\u51b2\u533a\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528\u7f13\u51b2\u533a\u4e2d\u7684\u6570\u636e\u8fdb\u884c\u5904\u7406\uff0c\u6bd4\u5982\u89e3\u6790\u6570\u636e\uff0c\u8fdb\u884c\u63a7\u5236\u7b49\u3002<\/p>\n

STM32 HAL\u5e93\u4e32\u53e3\u4e2d\u65ad\u63a5\u6536\u7684\u5b9e\u9645\u5e94\u7528<\/h2>\n

  STM32 HAL\u5e93\u4e32\u53e3\u4e2d\u65ad\u63a5\u6536\u53ef\u4ee5\u5e94\u7528\u5728\u8bb8\u591a\u573a\u666f\u4e2d\uff0c\u6bd4\u5982\u4e32\u53e3\u901a\u4fe1\u3001\u4e32\u53e3\u8c03\u8bd5\u7b49\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5b9e\u9645\u5e94\u7528\u7684\u4f8b\u5b50\uff1a<\/p>\n

  \u4e32\u53e3\u901a\u4fe1<\/h3>\n

  STM32 HAL\u5e93\u4e32\u53e3\u4e2d\u65ad\u63a5\u6536\u53ef\u4ee5\u7528\u4e8e\u5b9e\u73b0\u4e32\u53e3\u901a\u4fe1\uff0c\u53ef\u4ee5\u5c06\u4e32\u53e3\u6536\u5230\u7684\u6570\u636e\u653e\u5165\u7f13\u51b2\u533a\uff0c\u7136\u540e\u4f7f\u7528\u7f13\u51b2\u533a\u4e2d\u7684\u6570\u636e\u8fdb\u884c\u5904\u7406\uff0c\u5b9e\u73b0\u4e32\u53e3\u901a\u4fe1\u529f\u80fd\u3002<\/p>\n

  \u4e32\u53e3\u8c03\u8bd5<\/h3>\n

  STM32 HAL\u5e93\u4e32\u53e3\u4e2d\u65ad\u63a5\u6536\u53ef\u4ee5\u7528\u4e8e\u5b9e\u73b0\u4e32\u53e3\u8c03\u8bd5\u529f\u80fd\uff0c\u53ef\u4ee5\u5c06\u4e32\u53e3\u6536\u5230\u7684\u6570\u636e\u653e\u5165\u7f13\u51b2\u533a\uff0c\u7136\u540e\u4f7f\u7528\u7f13\u51b2\u533a\u4e2d\u7684\u6570\u636e\u8fdb\u884c\u5904\u7406\uff0c\u5b9e\u73b0\u4e32\u53e3\u8c03\u8bd5\u529f\u80fd\u3002<\/p>\n

\u603b\u7ed3<\/h2>\n

  STM32 HAL\u5e93\u63d0\u4f9b\u4e86\u4e00\u79cd\u975e\u5e38\u65b9\u4fbf\u7684\u4e32\u53e3\u4e2d\u65ad\u63a5\u6536\u65b9\u6cd5\uff0c\u53ef\u4ee5\u6709\u6548\u63d0\u9ad8\u6570\u636e\u63a5\u6536\u7684\u6548\u7387\u3002<\/strong>\u53ea\u9700\u8981\u5728\u7a0b\u5e8f\u4e2d\u914d\u7f6e\u4e32\u53e3\u4e2d\u65ad\uff0c\u7f16\u5199\u4e2d\u65ad\u670d\u52a1\u7a0b\u5e8f\uff0c\u7136\u540e\u4f7f\u7528\u7f13\u51b2\u533a\u4e2d\u7684\u6570\u636e\u8fdb\u884c\u5904\u7406\uff0c\u5c31\u53ef\u4ee5\u5b9e\u73b0\u4e32\u53e3\u901a\u4fe1\u3001\u4e32\u53e3\u8c03\u8bd5\u7b49\u529f\u80fd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5728\u5927\u591a\u6570\u5d4c\u5165\u5f0f\u7cfb\u7edf\u5f00\u53d1\u4e2d\uff0c\u4e32\u53e3\u901a\u4fe1\u662f\u4e00\u79cd\u91cd\u8981\u7684\u6570\u636e\u4f20\u8f93\u65b9\u5f0f\u3002STM32HAL\u5e93\u63d0\u4f9b\u4e86\u4e00\u79cd\u975e\u5e38\u65b9\u4fbf\u7684\u4e32\u53e3\u4e2d\u65ad\u63a5\u6536\u65b9\u6cd5\uff0c\u53ef\u4ee5\u6709\u6548\u63d0\u9ad8\u6570\u636e\u63a5\u6536\u7684\u6548\u7387\u3002<\/st\n<\/p>\n","protected":false},"author":1,"featured_media":4132,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"categories":[36],"tags":[287],"class_list":["post-44839","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-stm32"],"_links":{"self":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/44839","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/comments?post=44839"}],"version-history":[{"count":0,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/44839\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media\/4132"}],"wp:attachment":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media?parent=44839"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/categories?post=44839"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/tags?post=44839"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}