{"id":15867,"date":"2023-12-31T10:21:52","date_gmt":"2023-12-31T02:21:52","guid":{"rendered":"http:\/\/www.szryc.com\/?p=15867"},"modified":"2023-12-31T11:11:46","modified_gmt":"2023-12-31T03:11:46","slug":"%e5%9f%ba%e4%ba%8estm32cubemx%e9%a9%b1%e5%8a%a8tmos%e6%a8%a1%e5%9d%97sths34pf804-%e4%b8%ad%e6%96%ad%e8%8e%b7%e5%8f%96%e4%bf%a1%e5%8f%b7","status":"publish","type":"post","link":"http:\/\/www.szryc.com\/?p=15867","title":{"rendered":"\u57fa\u4e8eSTM32CUBEMX\u9a71\u52a8TMOS\u6a21\u5757STHS34PF80(4) \u4e2d\u65ad\u83b7\u53d6\u4fe1\u53f7"},"content":{"rendered":"
STM32CubeMX\u662f\u4e00\u79cd\u56fe\u5f62\u5316\u5de5\u5177\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u7528\u6237\u521d\u59cb\u5316STM32\u5fae\u63a7\u5236\u5668\uff0c\u5e76\u751f\u6210\u76f8\u5e94\u7684\u521d\u59cb\u5316C\u4ee3\u7801\u3002\u5bf9\u4e8eSTHS34PF80\uff0c\u8fd9\u662f\u4e00\u79cd\u529f\u7387\u573a\u6548\u5e94\u6676\u4f53\u7ba1\uff08TMOS\uff09\uff0c\u5b83\u4e0d\u76f4\u63a5\u4e0eSTM32CubeMX\u96c6\u6210\u3002\u7136\u800c\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528STM32CubeMX\u751f\u6210\u7684\u4ee3\u7801\u6765\u9a71\u52a8\u8fd9\u4e2a\u6a21\u5757\u3002<\/p>\n
\u9996\u5148\uff0c\u4f60\u9700\u8981\u786e\u5b9a\u5982\u4f55\u5c06STHS34PF80\u8fde\u63a5\u5230STM32\u3002\u53ef\u80fd\u7684\u4e00\u79cd\u65b9\u5f0f\u662f\u901a\u8fc7GPIO\uff08\u901a\u7528\u8f93\u5165\/\u8f93\u51fa\uff09\u5f15\u811a\u3002STM32CubeMX\u53ef\u4ee5\u5e2e\u52a9\u4f60\u914d\u7f6e\u8fd9\u4e9b\u5f15\u811a\u3002<\/p>\n
\u7136\u540e\uff0c\u4f60\u9700\u8981\u7f16\u5199\u4ee3\u7801\u6765\u63a7\u5236STHS34PF80\u3002\u5982\u679c\u4f60\u60f3\u8981\u5728\u67d0\u4e2a\u4e8b\u4ef6\u53d1\u751f\u65f6\uff08\u4f8b\u5982\uff0c\u5f53\u4e00\u4e2a\u8f93\u5165\u4fe1\u53f7\u8fbe\u5230\u67d0\u4e2a\u9608\u503c\u65f6\uff09\u901a\u8fc7STM32\u7684\u4e2d\u65ad\u670d\u52a1\u7a0b\u5e8f\uff08ISR\uff09\u6765\u83b7\u53d6\u4fe1\u53f7\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528STM32CubeMX\u751f\u6210\u7684\u4ee3\u7801\u6765\u5b9e\u73b0\u8fd9\u4e2a\u529f\u80fd\u3002<\/p>\n
\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\uff1a<\/p>\n
```c
\n\/* STM32CubeMX\u751f\u6210\u7684\u521d\u59cb\u5316\u4ee3\u7801... *\/<\/p>\n
\/* \u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u5047\u8bbeGPIO_PIN_0\u8fde\u63a5\u5230STHS34PF80 *\/
\n#define STHS34PF80_PIN GPIO_PIN_0<\/p>\n
\/* \u8fd9\u662f\u4e2d\u65ad\u670d\u52a1\u7a0b\u5e8f *\/
\nvoid EXTI0_IRQHandler(void)
\n{
\n\/* \u68c0\u67e5\u662f\u5426\u6709\u4e2d\u65ad\u53d1\u751f *\/
\nif (__HAL_GPIO_EXTI_GET_IT(STHS34PF80_PIN) != RESET)
\n{
\n\/* \u6e05\u9664\u4e2d\u65ad\u6807\u5fd7 *\/
\n__HAL_GPIO_EXTI_CLEAR_IT(STHS34PF80_PIN);<\/p>\n
\/* \u5728\u8fd9\u91cc\uff0c\u4f60\u53ef\u4ee5\u6dfb\u52a0\u4ee3\u7801\u6765\u5904\u7406\u4fe1\u53f7 *\/
\nhandleSignal();
\n}
\n}<\/p>\n
\/* \u8fd9\u662f\u5904\u7406\u4fe1\u53f7\u7684\u51fd\u6570 *\/
\nvoid handleSignal(void)
\n{
\n\/* \u5728\u8fd9\u91cc\uff0c\u4f60\u53ef\u4ee5\u6dfb\u52a0\u4ee3\u7801\u6765\u63a7\u5236STHS34PF80 *\/
\n}
\n```<\/p>\n
\u8fd9\u53ea\u662f\u4e00\u4e2a\u57fa\u672c\u7684\u793a\u4f8b\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u4f60\u53ef\u80fd\u9700\u8981\u6839\u636e\u4f60\u7684\u5177\u4f53\u9700\u6c42\u6765\u4fee\u6539\u8fd9\u4e2a\u4ee3\u7801\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
STM32CubeMX\u662f\u4e00\u79cd\u56fe\u5f62\u5316\u5de5\u5177\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u7528\u6237\u521d\u59cb\u5316STM32\u5fae\u63a7\u5236\u5668\uff0c\u5e76\u751f\u6210\u76f8\u5e94\u7684\u521d\u59cb\u5316C\u4ee3\u7801\u3002\u5bf9\u4e8e […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"_links":{"self":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/15867"}],"collection":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=15867"}],"version-history":[{"count":2,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/15867\/revisions"}],"predecessor-version":[{"id":15872,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/15867\/revisions\/15872"}],"wp:attachment":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=15867"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=15867"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=15867"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}