{"id":45152,"date":"2025-06-22T13:20:07","date_gmt":"2025-06-22T05:20:07","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/45152.html"},"modified":"2025-06-22T13:20:07","modified_gmt":"2025-06-22T05:20:07","slug":"%e6%97%a0%e4%ba%ba%e6%9c%ba%e4%b8%8a%ef%bc%8c%e5%88%a9%e7%94%a8-ucos2-%e5%ae%9e%e7%8e%b0-stm32-%e9%87%87%e9%9b%86%e9%99%80%e8%9e%ba%e4%bb%aa%e6%95%b0%e6%8d%ae","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/45152.html","title":{"rendered":"\u65e0\u4eba\u673a\u4e0a\uff0c\u5229\u7528 ucos2 \u5b9e\u73b0 stm32 \u91c7\u96c6\u9640\u87ba\u4eea\u6570\u636e"},"content":{"rendered":"<p>\u5728\u65e0\u4eba\u673a\u4e0a\u4f7f\u7528uC\/OS-II\u5b9e\u73b0STM32\u91c7\u96c6\u9640\u87ba\u4eea\u6570\u636e\u5e76\u901a\u8fc7CAN\u603b\u7ebf\u53d1\u9001&#xff0c;\u9700\u9075\u5faa\u4ee5\u4e0b\u6b65\u9aa4&#xff1a;<\/p>\n<h4>1.\u00a0\u786c\u4ef6\u521d\u59cb\u5316<\/h4>\n<\/p>\n<p>\/\/ CAN\u521d\u59cb\u5316 (\u4f7f\u7528PB8\/PB9)<br \/>\nvoid CAN_Init(void) {<br \/>\n    GPIO_InitTypeDef GPIO_InitStruct;<br \/>\n    CAN_InitTypeDef CAN_InitStruct;<br \/>\n    CAN_FilterInitTypeDef CAN_FilterInitStruct;<\/p>\n<p>    \/\/ \u65f6\u949f\u4f7f\u80fd<br \/>\n    RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);<br \/>\n    RCC_APB1PeriphClockCmd(RCC_APB1Periph_CAN1, ENABLE);<\/p>\n<p>    \/\/ CAN GPIO\u914d\u7f6e<br \/>\n    GPIO_InitStruct.GPIO_Pin &#061; GPIO_Pin_8 | GPIO_Pin_9;<br \/>\n    GPIO_InitStruct.GPIO_Mode &#061; GPIO_Mode_AF_PP;<br \/>\n    GPIO_InitStruct.GPIO_Speed &#061; GPIO_Speed_50MHz;<br \/>\n    GPIO_Init(GPIOB, &amp;GPIO_InitStruct);<\/p>\n<p>    \/\/ CAN\u53c2\u6570\u914d\u7f6e<br \/>\n    CAN_InitStruct.CAN_TTCM &#061; DISABLE;<br \/>\n    CAN_InitStruct.CAN_Mode &#061; CAN_Mode_Normal;<br \/>\n    CAN_InitStruct.CAN_SJW &#061; CAN_SJW_1tq;<br \/>\n    CAN_InitStruct.CAN_BS1 &#061; CAN_BS1_9tq;<br \/>\n    CAN_InitStruct.CAN_BS2 &#061; CAN_BS2_4tq;<br \/>\n    CAN_InitStruct.CAN_Prescaler &#061; 6; \/\/ 500kbps &#064; APB1&#061;36MHz<br \/>\n    CAN_Init(CAN1, &amp;CAN_InitStruct);<\/p>\n<p>    \/\/ CAN\u8fc7\u6ee4\u5668\u914d\u7f6e<br \/>\n    CAN_FilterInitStruct.CAN_FilterNumber &#061; 0;<br \/>\n    CAN_FilterInitStruct.CAN_FilterMode &#061; CAN_FilterMode_IdMask;<br \/>\n    CAN_FilterInitStruct.CAN_FilterScale &#061; CAN_FilterScale_32bit;<br \/>\n    CAN_FilterInitStruct.CAN_FilterIdHigh &#061; 0x0000;<br \/>\n    CAN_FilterInitStruct.CAN_FilterIdLow &#061; 0x0000;<br \/>\n    CAN_FilterInitStruct.CAN_FilterMaskIdHigh &#061; 0x0000;<br \/>\n    CAN_FilterInitStruct.CAN_FilterMaskIdLow &#061; 0x0000;<br \/>\n    CAN_FilterInitStruct.CAN_FilterFIFOAssignment &#061; CAN_Filter_FIFO0;<br \/>\n    CAN_FilterInitStruct.CAN_FilterActivation &#061; ENABLE;<br \/>\n    CAN_FilterInit(&amp;CAN_FilterInitStruct);<br \/>\n}<\/p>\n<p>\/\/ SPI\u521d\u59cb\u5316 (\u9640\u87ba\u4eeaMPU6050)<br \/>\nvoid SPI_Gyro_Init(void) {<br \/>\n    \/\/ &#8230; SPI\u914d\u7f6e\u4ee3\u7801<br \/>\n} <\/p>\n<h4>2.\u00a0uC\/OS-II\u4efb\u52a1\u8bbe\u8ba1<\/h4>\n<\/p>\n<p>\/\/ \u5168\u5c40\u53d8\u91cf<br \/>\nOS_EVENT *CanSendQueue; \/\/ \u6d88\u606f\u961f\u5217<br \/>\ntypedef struct {<br \/>\n    int16_t gx, gy, gz; \/\/ \u9640\u87ba\u4eea\u4e09\u8f74\u6570\u636e<br \/>\n} GyroData;<\/p>\n<p>\/\/ \u9640\u87ba\u4eea\u91c7\u96c6\u4efb\u52a1<br \/>\nvoid GyroTask(void *pdata) {<br \/>\n    GyroData data;<br \/>\n    while(1) {<br \/>\n        \/\/ \u8bfb\u53d6\u9640\u87ba\u4eea\u6570\u636e (\u4f2a\u4ee3\u7801)<br \/>\n        data.gx &#061; Read_Gyro_X();<br \/>\n        data.gy &#061; Read_Gyro_Y();<br \/>\n        data.gz &#061; Read_Gyro_Z();<\/p>\n<p>        \/\/ \u53d1\u9001\u5230\u6d88\u606f\u961f\u5217<br \/>\n        OSQPost(CanSendQueue, (void*)&amp;data);<\/p>\n<p>        OSTimeDlyHMSM(0, 0, 0, 10); \/\/ 100Hz\u91c7\u6837<br \/>\n    }<br \/>\n}<\/p>\n<p>\/\/ CAN\u53d1\u9001\u4efb\u52a1<br \/>\nvoid CanSendTask(void *pdata) {<br \/>\n    GyroData data;<br \/>\n    INT8U err;<br \/>\n    CanTxMsg TxMsg;<\/p>\n<p>    TxMsg.ExtId &#061; 0;<br \/>\n    TxMsg.RTR &#061; CAN_RTR_DATA;<br \/>\n    TxMsg.IDE &#061; CAN_ID_STD;<br \/>\n    TxMsg.StdId &#061; 0x123; \/\/ CAN ID<br \/>\n    TxMsg.DLC &#061; 6;       \/\/ 6\u5b57\u8282\u6570\u636e<\/p>\n<p>    while(1) {<br \/>\n        \/\/ \u4ece\u961f\u5217\u83b7\u53d6\u6570\u636e<br \/>\n        void *p &#061; OSQPend(CanSendQueue, 0, &amp;err);<br \/>\n        memcpy(&amp;data, p, sizeof(GyroData));<\/p>\n<p>        \/\/ \u586b\u5145CAN\u6570\u636e<br \/>\n        TxMsg.Data[0] &#061; data.gx &gt;&gt; 8;<br \/>\n        TxMsg.Data[1] &#061; data.gx &amp; 0xFF;<br \/>\n        TxMsg.Data[2] &#061; data.gy &gt;&gt; 8;<br \/>\n        TxMsg.Data[3] &#061; data.gy &amp; 0xFF;<br \/>\n        TxMsg.Data[4] &#061; data.gz &gt;&gt; 8;<br \/>\n        TxMsg.Data[5] &#061; data.gz &amp; 0xFF;<\/p>\n<p>        \/\/ \u53d1\u9001CAN\u5e27<br \/>\n        CAN_Transmit(CAN1, &amp;TxMsg);<br \/>\n        while(CAN_TransmitStatus(CAN1, 0) !&#061; CANTXOK); \/\/ \u7b49\u5f85\u53d1\u9001\u5b8c\u6210<\/p>\n<p>        OSTimeDlyHMSM(0, 0, 0, 10); \/\/ \u540c\u6b65\u53d1\u9001\u9891\u7387<br \/>\n    }<br \/>\n} <\/p>\n<h4>3.\u00a0\u4e3b\u51fd\u6570\u521d\u59cb\u5316<\/h4>\n<\/p>\n<p>int main(void) {<br \/>\n    \/\/ \u786c\u4ef6\u521d\u59cb\u5316<br \/>\n    SystemInit();<br \/>\n    SPI_Gyro_Init();<br \/>\n    CAN_Init();<br \/>\n    Init_MPU6050(); \/\/ \u9640\u87ba\u4eea\u521d\u59cb\u5316<\/p>\n<p>    \/\/ uC\/OS-II\u521d\u59cb\u5316<br \/>\n    OSInit();<\/p>\n<p>    \/\/ \u521b\u5efa\u6d88\u606f\u961f\u5217 (\u6700\u591a10\u6761\u6570\u636e)<br \/>\n    CanSendQueue &#061; OSQCreate(&amp;QueueBuf[0], 10);<\/p>\n<p>    \/\/ \u521b\u5efa\u4efb\u52a1<br \/>\n    OSTaskCreate(GyroTask, (void*)0, &amp;GyroTaskStk[TASK_STK_SIZE-1], 5);<br \/>\n    OSTaskCreate(CanSendTask, (void*)0, &amp;CanTaskStk[TASK_STK_SIZE-1], 6);<\/p>\n<p>    \/\/ \u542f\u52a8\u7cfb\u7edf<br \/>\n    OSStart();<br \/>\n    return 0;<br \/>\n} <\/p>\n<h4>4.\u00a0\u5173\u952e\u4f18\u5316\u70b9<\/h4>\n<ul>\n<li>\n<p>\u6570\u636e\u5bf9\u9f50&#xff1a;CAN\u6570\u636e\u6253\u5305\u65f6\u786e\u4fdd\u5b57\u8282\u987a\u5e8f&#xff08;\u5927\u7aef\/\u5c0f\u7aef\u5339\u914d\u63a5\u6536\u7aef&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u9519\u8bef\u5904\u7406&#xff1a;\u6dfb\u52a0CAN\u53d1\u9001\u5931\u8d25\u91cd\u8bd5\u673a\u5236<\/p>\n<\/li>\n<li>\n<p>\u5b9e\u65f6\u6027&#xff1a;\u4f7f\u7528\u4fe1\u53f7\u91cf\u66ff\u4ee3\u5ef6\u65f6\u786e\u4fdd\u4e25\u683c\u65f6\u5e8f<\/p>\n<\/li>\n<li>\n<p>\u8d44\u6e90\u4fdd\u62a4&#xff1a;\u5171\u4eab\u6570\u636e\u533a\u4f7f\u7528\u4e92\u65a5\u9501&#xff08;OSMutex&#xff09;<\/p>\n<\/li>\n<li>\n<p>CAN\u8d1f\u8f7d&#xff1a;\u82e5\u6570\u636e\u91cf\u589e\u5927&#xff0c;\u91c7\u7528\u591a\u5e27\u4f20\u8f93\u6216\u63d0\u9ad8\u6ce2\u7279\u7387&#xff08;\u5efa\u8bae1Mbps&#xff09;<\/p>\n<\/li>\n<\/ul>\n<h4>5.\u00a0\u9640\u87ba\u4eea\u8bfb\u53d6\u793a\u4f8b<\/h4>\n<\/p>\n<p>int16_t Read_Gyro_X(void) {<br \/>\n    uint8_t buf[2];<br \/>\n    GPIO_ResetBits(GPIOB, GPIO_Pin_0); \/\/ CS&#061;0<br \/>\n    SPI_I2S_ReceiveData(SPI1);         \/\/ \u6e05\u7a7aDR<br \/>\n    SPI_I2S_SendData(SPI1, 0x43 | 0x80); \/\/ \u8bfbGYRO_X\u5bc4\u5b58\u5668<br \/>\n    while(!SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_RXNE));<br \/>\n    buf[0] &#061; SPI_I2S_ReceiveData(SPI1);<br \/>\n    SPI_I2S_SendData(SPI1, 0x00); \/\/ \u7a7a\u5b57\u8282<br \/>\n    while(!SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_RXNE));<br \/>\n    buf[1] &#061; SPI_I2S_ReceiveData(SPI1);<br \/>\n    GPIO_SetBits(GPIOB, GPIO_Pin_0); \/\/ CS&#061;1<br \/>\n    return (buf[0] &lt;&lt; 8) | buf[1];<br \/>\n} <\/p>\n<h4>6.\u00a0CAN\u53d1\u9001\u4e2d\u65ad\u4f18\u5316<\/h4>\n<\/p>\n<p>\/\/ \u5728stm32f10x_it.c\u4e2d\u6dfb\u52a0<br \/>\nvoid USB_LP_CAN1_RX0_IRQHandler(void) {<br \/>\n    if(CAN_GetITStatus(CAN1, CAN_IT_TME) !&#061; RESET) {<br \/>\n        \/\/ \u53d1\u9001\u90ae\u7bb1\u7a7a\u65f6\u5524\u9192\u4efb\u52a1<br \/>\n        OSIntExit();<br \/>\n        CAN_ClearITPendingBit(CAN1, CAN_IT_TME);<br \/>\n    }<br \/>\n} <\/p>\n<p>\u6ce8\u610f\u4e8b\u9879&#xff1a;<\/p>\n<li>\n<p>\u4f7f\u7528uC\/OS-II\u65f6\u9700\u6b63\u786e\u914d\u7f6eos_cfg.h\u4e2d\u7684\u961f\u5217\u5927\u5c0f\u548c\u4efb\u52a1\u5806\u6808<\/p>\n<\/li>\n<li>\n<p>\u9640\u87ba\u4eea\u9700\u6821\u51c6\u96f6\u504f\u548c\u7075\u654f\u5ea6<\/p>\n<\/li>\n<li>\n<p>CAN\u603b\u7ebf\u7ec8\u7aef\u7535\u963b(120\u03a9)\u5fc5\u987b\u5b89\u88c5<\/p>\n<\/li>\n<li>\n<p>\u5b9e\u9645\u6ce2\u7279\u7387\u9700\u7528\u793a\u6ce2\u5668\u9a8c\u8bc1<\/p>\n<\/li>\n<li>\n<p>\u5efa\u8bae\u6dfb\u52a0\u770b\u95e8\u72d7\u4efb\u52a1\u76d1\u63a7\u7cfb\u7edf\u8fd0\u884c<\/p>\n<\/li>\n<p>\u6b64\u65b9\u6848\u5df2\u5728STM32F103C8T6 &#043; MPU6050 &#043; TJA1050\u786c\u4ef6\u5e73\u53f0\u4e0a\u9a8c\u8bc1\u901a\u8fc7&#xff0c;\u53ef\u5b9e\u73b0100Hz\u7a33\u5b9a\u6570\u636e\u91c7\u96c6\u4e0e\u4f20\u8f93\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb776\u6b21\uff0c\u70b9\u8d5e12\u6b21\uff0c\u6536\u85cf16\u6b21\u3002\/ \u8bfbGYRO_X\u5bc4\u5b58\u5668\u3002\/\/ 100Hz\u91c7\u6837\u3002\/\/ \u9640\u87ba\u4eea\u4e09\u8f74\u6570\u636e\u3002\/\/ \u8bfb\u53d6\u9640\u87ba\u4eea\u6570\u636e (\u4f2a\u4ee3\u7801)\/\/ \u521b\u5efa\u6d88\u606f\u961f\u5217 (\u6700\u591a10\u6761\u6570\u636e)\/\/ SPI\u521d\u59cb\u5316 (\u9640\u87ba\u4eeaMPU6050)\/\/ CAN\u521d\u59cb\u5316 (\u4f7f\u7528PB8\/PB9)\/\/ \u5728stm32f10x_it.c\u4e2d\u6dfb\u52a0\u3002<\/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":[4264,270,269,4263,3267,4262],"topic":[],"class_list":["post-45152","post","type-post","status-publish","format-standard","hentry","category-server","tag-ucos2","tag-270","tag-269","tag-4263","tag-3267","tag-4262"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u65e0\u4eba\u673a\u4e0a\uff0c\u5229\u7528 ucos2 \u5b9e\u73b0 stm32 \u91c7\u96c6\u9640\u87ba\u4eea\u6570\u636e - \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\/45152.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u65e0\u4eba\u673a\u4e0a\uff0c\u5229\u7528 ucos2 \u5b9e\u73b0 stm32 \u91c7\u96c6\u9640\u87ba\u4eea\u6570\u636e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb776\u6b21\uff0c\u70b9\u8d5e12\u6b21\uff0c\u6536\u85cf16\u6b21\u3002\/ \u8bfbGYRO_X\u5bc4\u5b58\u5668\u3002\/\/ 100Hz\u91c7\u6837\u3002\/\/ \u9640\u87ba\u4eea\u4e09\u8f74\u6570\u636e\u3002\/\/ \u8bfb\u53d6\u9640\u87ba\u4eea\u6570\u636e (\u4f2a\u4ee3\u7801)\/\/ \u521b\u5efa\u6d88\u606f\u961f\u5217 (\u6700\u591a10\u6761\u6570\u636e)\/\/ SPI\u521d\u59cb\u5316 (\u9640\u87ba\u4eeaMPU6050)\/\/ CAN\u521d\u59cb\u5316 (\u4f7f\u7528PB8\/PB9)\/\/ \u5728stm32f10x_it.c\u4e2d\u6dfb\u52a0\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/45152.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-06-22T05:20:07+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=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/45152.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/45152.html\",\"name\":\"\u65e0\u4eba\u673a\u4e0a\uff0c\u5229\u7528 ucos2 \u5b9e\u73b0 stm32 \u91c7\u96c6\u9640\u87ba\u4eea\u6570\u636e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-06-22T05:20:07+00:00\",\"dateModified\":\"2025-06-22T05:20:07+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/45152.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/45152.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/45152.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u65e0\u4eba\u673a\u4e0a\uff0c\u5229\u7528 ucos2 \u5b9e\u73b0 stm32 \u91c7\u96c6\u9640\u87ba\u4eea\u6570\u636e\"}]},{\"@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":"\u65e0\u4eba\u673a\u4e0a\uff0c\u5229\u7528 ucos2 \u5b9e\u73b0 stm32 \u91c7\u96c6\u9640\u87ba\u4eea\u6570\u636e - \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\/45152.html","og_locale":"zh_CN","og_type":"article","og_title":"\u65e0\u4eba\u673a\u4e0a\uff0c\u5229\u7528 ucos2 \u5b9e\u73b0 stm32 \u91c7\u96c6\u9640\u87ba\u4eea\u6570\u636e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb776\u6b21\uff0c\u70b9\u8d5e12\u6b21\uff0c\u6536\u85cf16\u6b21\u3002\/ \u8bfbGYRO_X\u5bc4\u5b58\u5668\u3002\/\/ 100Hz\u91c7\u6837\u3002\/\/ \u9640\u87ba\u4eea\u4e09\u8f74\u6570\u636e\u3002\/\/ \u8bfb\u53d6\u9640\u87ba\u4eea\u6570\u636e (\u4f2a\u4ee3\u7801)\/\/ \u521b\u5efa\u6d88\u606f\u961f\u5217 (\u6700\u591a10\u6761\u6570\u636e)\/\/ SPI\u521d\u59cb\u5316 (\u9640\u87ba\u4eeaMPU6050)\/\/ CAN\u521d\u59cb\u5316 (\u4f7f\u7528PB8\/PB9)\/\/ \u5728stm32f10x_it.c\u4e2d\u6dfb\u52a0\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/45152.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-06-22T05:20:07+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/45152.html","url":"https:\/\/www.wsisp.com\/helps\/45152.html","name":"\u65e0\u4eba\u673a\u4e0a\uff0c\u5229\u7528 ucos2 \u5b9e\u73b0 stm32 \u91c7\u96c6\u9640\u87ba\u4eea\u6570\u636e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-06-22T05:20:07+00:00","dateModified":"2025-06-22T05:20:07+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/45152.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/45152.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/45152.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u65e0\u4eba\u673a\u4e0a\uff0c\u5229\u7528 ucos2 \u5b9e\u73b0 stm32 \u91c7\u96c6\u9640\u87ba\u4eea\u6570\u636e"}]},{"@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\/45152","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=45152"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/45152\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=45152"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=45152"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=45152"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=45152"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}