跳转到内容

protocol::UartRxSync API

文档稀疏
符号
24
已记录
3
类型
1
继承关系
0
源码分支
main

21 / 24 个公开 API 符号没有说明。

共 1 个类型

类型目录
类

protocol::UartRxSync

查看源码

带帧头同步功能的串口接收器,基于中断和 DMA。 典型使用场景是固定帧格式传感器:先用中断逐字节找帧头,再交给 DMA 接收整帧剩余部分。 这样既能保持同步,也能减少每个字节都进中断带来的开销。

构造与析构

2

UartRxSync

函数公开
        protocol::UartRxSync< HeaderLen, FrameLen, DecodeWithHeader >::UartRxSync (UART_HandleTypeDef *huart, Buffer &buffer)
      

上游未提供说明。

protocol/UartRxSync/UartRxSync.hpp:65

~UartRxSync

函数公开虚函数
        virtual protocol::UartRxSync< HeaderLen, FrameLen, DecodeWithHeader >::~UartRxSync ()=default
      

上游未提供说明。

protocol/UartRxSync/UartRxSync.hpp:69

成员函数

10

decode

函数受保护纯虚函数
        virtual bool protocol::UartRxSync< HeaderLen, FrameLen, DecodeWithHeader >::decode (const uint8_t data[DecodeWithHeader ? FrameLen :FrameLen - HeaderLen])=0
      

上游未提供说明。

protocol/UartRxSync/UartRxSync.hpp:203

header

函数受保护纯虚函数const
        virtual const std::array< uint8_t, HeaderLen > & protocol::UartRxSync< HeaderLen, FrameLen, DecodeWithHeader >::header () const =0
      

上游未提供说明。

protocol/UartRxSync/UartRxSync.hpp:202

timeout

函数受保护虚函数const
        virtual uint32_t protocol::UartRxSync< HeaderLen, FrameLen, DecodeWithHeader >::timeout () const
      

上游未提供说明。

protocol/UartRxSync/UartRxSync.hpp:205

成员变量

5

嵌套类型

2

Buffer

类型定义公开
        using protocol::UartRxSync< HeaderLen, FrameLen, DecodeWithHeader >::Buffer = memory::DMABuffer<FrameLen>
      

上游未提供说明。

protocol/UartRxSync/UartRxSync.hpp:63

SyncState

枚举公开

上游未提供说明。

DMAActive
上游未提供说明。
Receiving
上游未提供说明。
Stopped
上游未提供说明。
WaitHead
上游未提供说明。
protocol/UartRxSync/UartRxSync.hpp:70

其他公开符号

宏定义

2

UartRxSync_DefineCallback

宏定义

Deprecated 旧式宏包装,建议直接使用类实例的回调注册方式。 这个宏保留主要是为了兼容旧代码,新的代码请直接调用 RegisterCallback 对应的能力。

protocol/UartRxSync/UartRxSync.hpp:41

文件

1

protocol/UartRxSync/UartRxSync.hpp

文件

带帧头同步的 UART 接收器。 syhanjin 2026-02-01 通过“找帧头 + DMA 收剩余帧”来降低丢包风险,适合固定帧格式传感器。

protocol/UartRxSync/UartRxSync.hpp