{"id":56572,"date":"2023-10-20T21:38:56","date_gmt":"2023-10-20T13:38:56","guid":{"rendered":"https:\/\/www.techphant.cn\/?p=56572"},"modified":"2023-10-20T21:38:56","modified_gmt":"2023-10-20T13:38:56","slug":"hkszdjs","status":"publish","type":"post","link":"https:\/\/www.techphant.cn\/blog\/56572.html","title":{"rendered":"HAL\u5e93SPI\u4e2d\u65ad\u63a5\u6536"},"content":{"rendered":"
HAL\u5e93SPI\u4e2d\u65ad\u63a5\u6536\u662f\u4e00\u79cd\u4f7f\u7528\u5916\u8bbe\u4e2d\u65ad(Peripheral Interrupts)\u7684\u65b9\u6cd5\uff0c\u7528\u4e8e\u63a5\u6536SPI\uff08Serial Peripheral Interface\uff09\u6570\u636e\u3002\u5b83\u53ef\u4ee5\u8ba9\u7528\u6237\u7f16\u5199\u7b80\u5355\u7684\u4ee3\u7801\u6765\u5904\u7406SPI\u4e2d\u65ad\uff0c\u800c\u4e0d\u9700\u8981\u82b1\u8d39\u592a\u591a\u7684\u65f6\u95f4\u6765\u8c03\u8bd5\u548c\u5b9e\u73b0\u66f4\u590d\u6742\u7684\u7a0b\u5e8f\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecdHAL\u5e93SPI\u4e2d\u65ad\u63a5\u6536\u7684\u5de5\u4f5c\u539f\u7406\uff0c\u4ee5\u53ca\u5982\u4f55\u4f7f\u7528\u5b83\u6765\u4f18\u5316SPI\u63a5\u6536\u7a0b\u5e8f\u3002<\/p>\n
HAL\u5e93SPI\u4e2d\u65ad\u63a5\u6536\u662f\u4e00\u79cd\u4f7f\u7528\u5916\u8bbe\u4e2d\u65ad\u7684\u65b9\u6cd5\uff0c\u5b83\u53ef\u4ee5\u8ba9\u7528\u6237\u7f16\u5199\u7b80\u5355\u7684\u4ee3\u7801\u6765\u5904\u7406SPI\u4e2d\u65ad\uff0c\u800c\u4e0d\u9700\u8981\u82b1\u8d39\u592a\u591a\u7684\u65f6\u95f4\u6765\u8c03\u8bd5\u548c\u5b9e\u73b0\u66f4\u590d\u6742\u7684\u7a0b\u5e8f\u3002HAL\u5e93SPI\u4e2d\u65ad\u63a5\u6536\u7684\u5de5\u4f5c\u539f\u7406\u662f\uff1a\u5f53\u5916\u8bbe\u53d1\u51fa\u4e2d\u65ad\u4fe1\u53f7\u65f6\uff0c\u786c\u4ef6\u4f1a\u5c06\u4e2d\u65ad\u53f7\u53d1\u9001\u7ed9CPU\uff0cCPU\u4f1a\u68c0\u67e5\u4e2d\u65ad\u53f7\uff0c\u5e76\u6267\u884c\u76f8\u5e94\u7684\u4e2d\u65ad\u670d\u52a1\u7a0b\u5e8f\uff08ISR\uff09\u3002ISR\u4f1a\u68c0\u67e5SPI\u72b6\u6001\u5bc4\u5b58\u5668\uff0c\u4ee5\u786e\u5b9a\u662f\u5426\u6709\u53ef\u7528\u7684\u6570\u636e\uff0c\u5982\u679c\u6709\uff0c\u5c31\u4f1a\u5c06\u6570\u636e\u8bfb\u53d6\u5230\u7f13\u51b2\u533a\uff0c\u5e76\u6267\u884c\u76f8\u5e94\u7684\u5904\u7406\u7a0b\u5e8f\u3002<\/p>\n
\u9996\u5148\uff0c\u7528\u6237\u9700\u8981\u4f7f\u7528HAL\u5e93\u7684API\u51fd\u6570\uff0c\u914d\u7f6eSPI\u63a5\u53e3\uff0c\u5305\u62ec\u8bbe\u7f6eSPI\u65f6\u949f\u901f\u5ea6\u3001\u6570\u636e\u4f4d\u957f\u5ea6\u3001\u5b57\u8282\u6392\u5e8f\u7b49\u3002<\/p>\n
\u63a5\u7740\uff0c\u7528\u6237\u9700\u8981\u4f7f\u7528HAL\u5e93\u7684API\u51fd\u6570\uff0c\u914d\u7f6eSPI\u4e2d\u65ad\u3002\u8fd9\u5305\u62ec\u8bbe\u7f6e\u4e2d\u65ad\u4f18\u5148\u7ea7\u3001\u4e2d\u65ad\u63a9\u7801\u7b49\u3002\u6b64\u5916\uff0c\u7528\u6237\u8fd8\u9700\u8981\u6307\u5b9a\u4e2d\u65ad\u670d\u52a1\u7a0b\u5e8f\uff08ISR\uff09\u7684\u5730\u5740\uff0c\u4ee5\u4fbf\u786c\u4ef6\u53ef\u4ee5\u5728\u6536\u5230\u4e2d\u65ad\u4fe1\u53f7\u65f6\uff0c\u8c03\u7528ISR\u3002<\/p>\n
\u6700\u540e\uff0c\u7528\u6237\u9700\u8981\u4f7f\u7528HAL\u5e93\u7684API\u51fd\u6570\uff0c\u5f00\u542fSPI\u4e2d\u65ad\u3002\u8fd9\u6837\uff0c\u5f53\u5916\u8bbe\u53d1\u51fa\u4e2d\u65ad\u4fe1\u53f7\u65f6\uff0c\u786c\u4ef6\u5c31\u4f1a\u5c06\u4e2d\u65ad\u53f7\u53d1\u9001\u7ed9CPU\uff0cCPU\u5c31\u4f1a\u8c03\u7528ISR\u6765\u5904\u7406\u4e2d\u65ad\u3002<\/p>\n
\u672c\u6587\u4ecb\u7ecd\u4e86HAL\u5e93SPI\u4e2d\u65ad\u63a5\u6536\u7684\u5de5\u4f5c\u539f\u7406\uff0c\u4ee5\u53ca\u5982\u4f55\u4f7f\u7528\u5b83\u6765\u4f18\u5316SPI\u63a5\u6536\u7a0b\u5e8f\u3002<\/strong>HAL\u5e93SPI\u4e2d\u65ad\u63a5\u6536\u53ef\u4ee5\u8ba9\u7528\u6237\u7f16\u5199\u7b80\u5355\u7684\u4ee3\u7801\u6765\u5904\u7406SPI\u4e2d\u65ad\uff0c\u800c\u4e0d\u9700\u8981\u82b1\u8d39\u592a\u591a\u7684\u65f6\u95f4\u6765\u8c03\u8bd5\u548c\u5b9e\u73b0\u66f4\u590d\u6742\u7684\u7a0b\u5e8f\u3002\u4f7f\u7528HAL\u5e93SPI\u4e2d\u65ad\u63a5\u6536\uff0c\u53ef\u4ee5\u63d0\u9ad8SPI\u63a5\u6536\u7a0b\u5e8f\u7684\u6548\u7387\uff0c\u5e76\u51cf\u5c11\u7f16\u7a0b\u65f6\u95f4\u3002<\/p>\n","protected":false},"excerpt":{"rendered":" HAL\u5e93SPI\u4e2d\u65ad\u63a5\u6536\u662f\u4e00\u79cd\u4f7f\u7528\u5916\u8bbe\u4e2d\u65ad(PeripheralInterrupts)\u7684\u65b9\u6cd5\uff0c\u7528\u4e8e\u63a5\u6536SPI\uff08SerialPeripheralInterface\uff09\u6570\u636e<\/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":[288],"class_list":["post-56572","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-spitx"],"_links":{"self":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/56572","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=56572"}],"version-history":[{"count":0,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/56572\/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=56572"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/categories?post=56572"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/tags?post=56572"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}