{"id":17504,"date":"2025-03-21T14:31:18","date_gmt":"2025-03-21T06:31:18","guid":{"rendered":"https:\/\/www.tosunai.com\/?p=17504"},"modified":"2025-03-21T14:31:31","modified_gmt":"2025-03-21T06:31:31","slug":"unlocking-tsmaster-fifo-function-efficient-method-message-reading","status":"publish","type":"post","link":"https:\/\/www.tosunai.com\/unlocking-tsmaster-fifo-function-efficient-method-message-reading\/","title":{"rendered":"\u5e72\u8d27\u5206\u4eab | \u89e3\u9501TSMaster fifo\u51fd\u6570\uff1a\u62a5\u6587\u8bfb\u53d6\u7684\u9ad8\u6548\u65b9\u6cd5"},"content":{"rendered":"
\u524d\u8a00<\/strong>\uff1a
<\/strong>
TSMaster\u76ee\u524d\u6709\u4e24\u79cd\u8bfb\u53d6\u62a5\u6587\u7684\u6a21\u5f0f\uff1a\u56de\u8c03\u51fd\u6570\u6a21\u5f0f\u548cfifo\u6a21\u5f0f\u3002fifo\u51fd\u6570\u662fTSMaster\u8fd1\u671f\u65b0\u589e\u7684\u51fd\u6570\uff0c\u672c\u6587\u5c06\u91cd\u70b9\u4ecb\u7ecdfifo\u6a21\u5757\u3002\u5173\u4e8e\u56de\u8c03\u51fd\u6570\u7684\u4f7f\u7528\u65b9\u6cd5\u53ef\u4ee5\u53c2\u8003\u5e2e\u52a9\u6a21\u5757\u7684\u300a\u5feb\u901f\u5165\u95e8\u300b\u624b\u518c\u3002
<\/pre><\/div><\/div><\/div>\u6280\u672f\u80cc\u666f<\/strong><\/h2>
TSMaster\u7684\u5c0f\u7a0b\u5e8f\u6a21\u5757\u4e2d\u63d0\u4f9b\u4e86\u63a5\u6536\u4e8b\u4ef6\u3001\u53d1\u9001\u4e8b\u4ef6\u4ee5\u53ca\u9884\u53d1\u9001\u4e8b\u4ef6\u7b49\u56de\u8c03\u4e8b\u4ef6\uff0c\u5982\u56fe 1\u3002\u76f8\u6bd4\u4e8e\u56de\u8c03\u51fd\u6570\uff0cfifo\u51fd\u6570\u4f7f\u7528\u8d77\u6765\u6bd4\u8f83\u7075\u6d3b\u65b9\u4fbf\uff0c\u53ef\u4ee5\u5728\u4efb\u610f\u4e00\u4e2a\u6a21\u5757\u4f7f\u7528\uff0c\u4e0d\u518d\u5c40\u9650\u4e8e\u63a5\u6536\u3001\u53d1\u9001\u7b49\u56de\u8c03\u4e8b\u4ef6\u3002\u76f8\u5173\u7684fifo\u51fd\u6570\u53ef\u4ee5\u5728\u3010\u8bbe\u8ba1\u3011-\u3010C\u5c0f\u7a0b\u5e8f\u3011-\u3010\u51fd\u6570\u3011\u4e2d\u627e\u5230\uff0c\u5982\u56fe2\u3002<\/p>
\u56fe 1:\u5c0f\u7a0b\u5e8f\u7684\u56de\u8c03\u6a21\u5757<\/figcaption><\/figure><\/div> \u56fe 2:\u5c0f\u7a0b\u5e8f\u7684fifo\u51fd\u6570\u6a21\u5757<\/figcaption><\/figure><\/div> <\/div>fifo\u51fd\u6570\u6982\u8ff0<\/strong><\/h2>
fifo\u662f\u4e00\u79cd\u6570\u636e\u7ed3\u6784\u6216\u7f13\u51b2\u673a\u5236\uff0c\u5b83\u9075\u5faa\u5148\u5165\u5148\u51fa\u7684\u539f\u5219\u3002\u5728\u6570\u636e\u63a5\u6536\u8fc7\u7a0b\u4e2d\uff0c\u6700\u65e9\u8fdb\u5165 fifo\u7684\u6570\u636e\u4f1a\u88ab\u6700\u5148\u5904\u7406\u6216\u8bfb\u53d6\u3002fifo \u6709\u4e00\u4e2a\u8f93\u5165\u7aef\u53e3\u548c\u4e00\u4e2a\u8f93\u51fa\u7aef\u53e3\u3002\u6570\u636e\u4ece\u8f93\u5165\u7aef\u53e3\u4f9d\u6b21\u8fdb\u5165 fifo\u7f13\u51b2\u533a\uff0c\u7136\u540e\u6309\u7167\u8fdb\u5165\u7684\u987a\u5e8f\u5728\u7f13\u51b2\u533a\u4e2d\u6392\u961f\u7b49\u5f85\u3002\u5f53\u9700\u8981\u8bfb\u53d6\u6570\u636e\u65f6\uff0c\u4ece\u8f93\u51fa\u7aef\u53e3\u6309\u7167\u5148\u5165\u5148\u51fa\u7684\u987a\u5e8f\u5c06\u6570\u636e\u53d6\u51fa\u3002\u8fd9\u6837\u53ef\u4ee5\u786e\u4fdd\u6570\u636e\u7684\u63a5\u6536\u548c\u5904\u7406\u987a\u5e8f\u4e0e\u5b83\u4eec\u5230\u8fbe\u7684\u987a\u5e8f\u4e00\u81f4\uff0c\u907f\u514d\u6570\u636e\u6df7\u4e71\u6216\u4e22\u5931\u3002fifo\u7684\u4f18\u70b9\u662f\u7528\u6237\u53ef\u4ee5\u5728\u81ea\u5df1\u7684\u4efb\u52a1\u6216\u8005\u7ebf\u7a0b\u4e2d\u6839\u636e\u9700\u8981\u4ece\u9a71\u52a8\u4e2d\u8bfb\u53d6\u6570\u636e\uff0c\u5ef6\u65f6\u7b49\u53ef\u4ee5\u81ea\u5df1\u63a7\u5236\u3002\u7f3a\u70b9\u662f\u5f02\u6b65\u7684\u65b9\u5f0f\uff0c\u662f\u5728\u62a5\u6587\u5df2\u7ecf\u6536\u53d1\u5b8c\u6210\u4e4b\u540e\u624d\u4f1a\u5c06\u6570\u636e\u53d6\u51fa\u8fdb\u884c\u5904\u7406\u3002<\/p>
\u5178\u578b\u5e94\u7528\uff1a<\/strong><\/p>
\u5728\u6c7d\u8f66\u53d1\u52a8\u673a\u3001\u53d8\u901f\u5668\u7b49\u52a8\u529b\u603b\u6210\u7cfb\u7edf\u4e2d\uff0c\u591a\u4e2a\u4f20\u611f\u5668\u548c\u6267\u884c\u5668\u901a\u8fc7 CAN \u603b\u7ebf\u8fdb\u884c\u901a\u4fe1\u3002fifo\u7528\u4e8e\u63a5\u6536\u6765\u81ea\u5404\u4e2a\u4f20\u611f\u5668\uff08\u5982\u8282\u6c14\u95e8\u4f4d\u7f6e\u4f20\u611f\u5668\u3001\u66f2\u8f74\u4f4d\u7f6e\u4f20\u611f\u5668\uff09\u7684 CAN \u62a5\u6587\u3002\u8fd9\u4e9b\u62a5\u6587\u5305\u542b\u4e86\u53d1\u52a8\u673a\u8fd0\u884c\u72b6\u6001\u3001\u8f6c\u901f\u3001\u8d1f\u8377\u7b49\u5173\u952e\u4fe1\u606f\u3002fifo \u6309\u7167\u62a5\u6587\u5230\u8fbe\u7684\u5148\u540e\u987a\u5e8f\u5b58\u50a8\uff0c\u53d1\u52a8\u673a\u63a7\u5236\u5355\u5143\uff08ECU\uff09\u4ece fifo \u4e2d\u4f9d\u6b21\u8bfb\u53d6\u62a5\u6587\uff0c\u8fdb\u884c\u6570\u636e\u5206\u6790\u548c\u5904\u7406\uff0c\u8fdb\u800c\u8c03\u6574\u55b7\u6cb9\u65f6\u95f4\u3001\u70b9\u706b\u63d0\u524d\u89d2\u7b49\u53c2\u6570\uff0c\u786e\u4fdd\u53d1\u52a8\u673a\u5728\u4e0d\u540c\u5de5\u51b5\u4e0b\u90fd\u80fd\u9ad8\u6548\u3001\u7a33\u5b9a\u8fd0\u884c\u3002<\/p>
<\/div>fifo\u51fd\u6570\u8bfb\u53d6\u62a5\u6587\u529f\u80fd\u5b9e\u73b0<\/strong><\/h2>
3.1 \u529f\u80fd\u5b9e\u73b0<\/strong><\/p>
3.1.1 \u8bfb\u53d6CAN\u62a5\u6587<\/p>
\u4f7f\u7528fifo\u8bfb\u53d6\u7f13\u5b58\u62a5\u6587\u4e4b\u524d\uff0c\u9700\u8981\u5148\u8c03\u7528com.tsfifo_enable_receive_fifo()\u51fd\u6570\u3002\u672c\u5c0f\u8282\u5c06\u63d0\u4f9b\u4e00\u4e2a\u7b80\u5355\u793a\u4f8b\uff0c\u53ef\u53c2\u8003\u4ee5\u4e0b\u6b65\u9aa4\u3002<\/p>
\u3010\u6b65\u9aa41\u3011\u65b0\u5efa\u7a0b\u5e8f\u542f\u52a8\u4e8b\u4ef6\uff0c\u5c06\u4f7f\u80fdfifo\u7684\u51fd\u6570\u6dfb\u52a0\u5230\u8be5\u4e8b\u4ef6\u51fd\u6570\u91cc\u3002\u5982\u56fe 3\u3002<\/p>
\u56fe 3: \u7a0b\u5e8f\u542f\u52a8\u4e8b\u4ef6<\/figcaption><\/figure> \u3010\u6b65\u9aa42\u3011\u65b0\u5efa\u6309\u952e\u4e8b\u4ef6\uff0c\u5c06\u8bfb\u53d6fifo\u7684\u51fd\u6570\u6dfb\u52a0\u5230\u8be5\u4e8b\u4ef6\u51fd\u6570\u91cc\u3002\u5982\u56fe 4\u3002<\/p>
\u56fe 4: \u6309\u952e\u4e8b\u4ef6<\/figcaption><\/figure> \u3010\u6b65\u9aa43\u3011\u65b0\u5efa\u7a0b\u5e8f\u505c\u6b62\u4e8b\u4ef6\uff0c\u5c06\u53d6\u6d88\u4f7f\u80fdfifo\u7684\u51fd\u6570\u6dfb\u52a0\u5230\u8be5\u4e8b\u4ef6\u51fd\u6570\u91cc\u3002\u5982\u56fe 5\u3002<\/p>
\u56fe 5: \u7a0b\u5e8f\u505c\u6b62\u4e8b\u4ef6<\/figcaption><\/figure> \u3010\u6e90\u7801\u5982\u4e0b\u3011<\/p>
<\/figure>
3.1.2 \u8bfb\u53d6LIN\u62a5\u6587<\/p>
\u4f7f\u7528fifo\u8bfb\u53d6\u7f13\u5b58\u62a5\u6587\u4e4b\u524d\uff0c\u9700\u8981\u5148\u8c03\u7528com.tsfifo_enable_receive_fifo()\u51fd\u6570\u3002\u53ef\u53c2\u80033.1.1\u8bfb\u53d6CAN\u62a5\u6587\u5c0f\u8282\u3002<\/p>
\u3010\u6e90\u7801\u5982\u4e0b\u3011<\/p>
<\/figure>
3.1.3 \u8bfb\u53d6FlexRay\u62a5\u6587<\/p>
\u4f7f\u7528fifo\u8bfb\u53d6\u7f13\u5b58\u62a5\u6587\u4e4b\u524d\uff0c\u9700\u8981\u5148\u8c03\u7528com.tsfifo_enable_receive_fifo()\u51fd\u6570\u3002\u53ef\u53c2\u80033.1.1\u8bfb\u53d6CAN\u62a5\u6587\u5c0f\u8282\u3002<\/p>
\u3010\u6e90\u7801\u5982\u4e0b\u3011<\/p>
<\/figure>
3.2 \u5b9e\u73b0\u6548\u679c<\/strong><\/p>
\u542f\u52a8\u5c0f\u7a0b\u5e8f\uff0c\u53d1\u9001\u62a5\u6587\uff0c\u6253\u5370\u7684\u6d88\u606f\u53ef\u5728\u3010\u5206\u6790\u3011-\u3010\u7cfb\u7edf\u6d88\u606f\u3011\u5904\u67e5\u770b\uff0c\u5982\u56fe 6\u3002<\/p>
\u56fe 6: \u5b9e\u73b0\u6548\u679c<\/figcaption><\/figure> <\/div>TSMaster fifo\u51fd\u6570\u8bf4\u660e<\/strong><\/h2>
4.1 fifo\u51fd\u6570\u8bf4\u660e<\/strong><\/p>
4.1.1 com.tsfifo_enable_receive_fifo<\/p>
<\/figure>
4.1.2 com.tsfifo_disable_receive_fifo<\/p>
<\/figure>
4.1.3 com.tsfifo_enable_receive_error_frames<\/p>
<\/figure>
4.1.4 com.tsfifo_disable_receive_error_frames<\/p>
<\/figure>
4.1.5 com.tsfifo_add_can_canfd_pass_filter<\/p>
<\/figure>
4.1.6 com.tsfifo_delete_can_canfd_pass_filter<\/p>
<\/figure>
4.1.7 com.tsfifo_add_lin_pass_filter<\/p>
<\/figure>
4.1.8 com.tsfifo_delete_lin_pass_filter<\/p>
<\/figure>
4.1.9 com.tsfifo_clear_can_receive_buffers<\/p>
<\/figure>
4.1.10 com.tsfifo_clear_canfd_receive_buffers<\/p>
<\/figure>
4.1.11 com.tsfifo_clear_lin_receive_buffers<\/p>
<\/figure>
4.1.12 com.tsfifo_clear_flexray_receive_buffers<\/p>
<\/figure>
4.1.13 com.tsfifo_read_can_buffer_frame_count<\/p>
<\/figure>
4.1.14 com.tsfifo_read_can_rx_buffer_frame_count<\/p>
<\/figure>
4.1.15 com.tsfifo_read_can_tx_buffer_frame_count<\/p>
<\/figure>
4.1.16 com.tsfifo_read_canfd_buffer_frame_count<\/p>
<\/figure>
4.1.17com.tsfifo_read_canfd_rx_buffer_frame_count<\/p>
<\/figure>
4.1.18 com.tsfifo_read_can_tx_buffer_frame_count<\/p>
<\/figure>
4.1.19 com.tsfifo_read_lin_buffer_frame_count<\/p>
<\/figure>
4.1.20 com.tsfifo_read_lin_rx_buffer_frame_count<\/p>
<\/figure>
4.1.21 com.tsfifo_read_lin_tx_buffer_frame_count<\/p>
<\/figure>
4.1.22 com.tsfifo_read_flexray_buffer_frame_count<\/p>
<\/figure>
4.1.23 com.tsfifo_read_flexray_rx_buffer_frame_count<\/p>
<\/figure>
4.1.24 com.tsfifo_receive_can_msgs<\/p>
<\/figure>
4.1.25 com.tsfifo_receive_canfd_msgs<\/p>
<\/figure>
4.1.26 com.tsfifo_receive_lin_msgs<\/p>
<\/figure>
4.1.27 com.tsfifo_receive_flexray_msgs<\/p>
<\/figure>
<\/div>\u7f29\u5199<\/strong><\/h2>
BLF<\/td> Binary Logging Format<\/td><\/tr> CAN<\/td> Controller Area Network<\/td><\/tr> CAN FD<\/td> CAN with Flexible Data-Rate<\/td><\/tr> ID<\/td> Identifier<\/td><\/tr> LIN<\/td> Local Interconnect Network<\/td><\/tr><\/tbody><\/table><\/figure> \u5c0f\u8d34\u58eb\uff1a<\/strong>
1\u3001\u8f6f\u4ef6\u4e0b\u8f7d\uff1a
\u70b9\u51fb\u4e0b\u65b9\u8f6f\u4ef6\u4e0b\u8f7d\u94fe\u63a5\uff0c\u76f4\u63a5\u4e0b\u8f7d\u5b89\u88c5\uff0c\u5efa\u8bae\u4e0b\u8f7d beta \u7248\u672c\uff1a
2\u3001\u8f6f\u4ef6\u5347\u7ea7\uff1a
\u5728\u7535\u8111\u6709\u4e92\u8054\u7f51\u8fde\u63a5\u7684\u524d\u63d0\u4e0b\uff0c\u53ef\u4ee5\u5728\u8f6f\u4ef6\u5185\u68c0\u67e5\u5347\u7ea7\u81f3\u6700\u65b0\u7248\u672c\u3002
\u6ce8\uff1a\u540c\u661f\u667a\u80fd\u6280\u672f\u652f\u6301\u90ae\u7bb1\uff1asupport@tosunai.cn<\/a>\uff0c\u6b22\u8fce\u5927\u5bb6\u524d\u6765\u54a8\u8be2\uff01\uff08\u987b\u6ce8\u660e\u516c\u53f8\u53ca\u8054\u7cfb\u65b9\u5f0f\uff09<\/strong><\/pre>\n\n