跳转到内容

services::I2CUpdateManager API

文档稀疏
符号
75
已记录
68
类型
4
继承关系
0
源码分支
main

7 / 75 个公开 API 符号没有说明。

共 4 个类型

类型目录
类

I2CDevice

查看源码

上游未提供类型说明。

构造与析构

1

成员函数

20

conversionMs

函数受保护虚函数const
        virtual uint32_t I2CDevice::conversionMs () const
      

获取触发后需要等待的最短转换时间 转换等待时间,单位毫秒;返回 0 表示可直接进入读取阶段

services/i2c_update_manager/I2CDevice.hpp:123

init

函数公开纯虚函数
        virtual bool I2CDevice::init (I2CBusDMA &bus, uint32_t timeout_ms)=0
      

执行一次初始化或探活流程 bus 当前设备所在的 I2C 总线 timeout_ms 单次事务超时时间,单位毫秒 初始化是否成功

services/i2c_update_manager/I2CDevice.hpp:50

isDataFresh

函数公开const
        bool I2CDevice::isDataFresh (const uint32_t now_ms, const uint32_t stale_ms) const
      

查询设备数据是否仍然新鲜 now_ms 当前时间戳,单位毫秒 stale_ms 允许的数据陈旧阈值,单位毫秒 数据是否仍在可接受的新鲜时间窗口内

services/i2c_update_manager/I2CDevice.hpp:88

onRead

函数受保护纯虚函数
        virtual bool I2CDevice::onRead (I2CBusDMA &bus, uint32_t now_ms, uint32_t timeout_ms)=0
      

读取一次设备数据并更新内部缓存 bus 当前设备所在的 I2C 总线 now_ms 当前时间戳,单位毫秒 timeout_ms 单次事务超时时间,单位毫秒 本轮读取是否成功

services/i2c_update_manager/I2CDevice.hpp:132

onTrigger

函数受保护虚函数
        virtual bool I2CDevice::onTrigger (I2CBusDMA &, uint32_t)
      

发送一次“开始转换”或“开始采样”命令 bus 当前设备所在的 I2C 总线 timeout_ms 单次事务超时时间,单位毫秒 触发是否成功

services/i2c_update_manager/I2CDevice.hpp:117

update

函数公开
        UpdateStatus I2CDevice::update (I2CBusDMA &bus, uint32_t now_ms, uint32_t timeout_ms)
      

推进一次设备状态机 bus 当前设备所在的 I2C 总线 now_ms 当前时间戳,单位毫秒 timeout_ms 单次事务超时时间,单位毫秒 本次推进后的状态结果

services/i2c_update_manager/I2CDevice.hpp:59

成员变量

9

嵌套类型

1
类

I2CUpdateManager

查看源码

上游未提供类型说明。

构造与析构

1

成员函数

11

computeSleepMs

函数私有const
        uint32_t I2CUpdateManager::computeSleepMs (uint32_t now_ms) const
      

计算下一次轮询前最多可以休眠多久 now_ms 当前时间戳,单位毫秒 推荐休眠时长,单位毫秒

services/i2c_update_manager/I2CUpdateManager.hpp:108

registerDevice

函数公开
        bool I2CUpdateManager::registerDevice (I2CDevice &device, uint32_t period_ms, uint32_t phase_ms=0U, uint32_t timeout_ms=20U)
      

注册一个周期设备 device 要注册的设备对象 period_ms 更新周期,单位毫秒 phase_ms 初始错峰相位,单位毫秒 timeout_ms 单次事务超时时间,单位毫秒 start() 设备是否注册成功;该接口只能在前调用

services/i2c_update_manager/I2CUpdateManager.hpp:64

selectReadyEntry

函数私有
        I2CUpdateManager::Entry * I2CUpdateManager::selectReadyEntry (uint32_t now_ms)
      

选择当前已经到期且应优先调度的设备条目 now_ms 当前时间戳,单位毫秒 选中的设备条目,若无可调度设备则返回空指针

services/i2c_update_manager/I2CUpdateManager.hpp:101

serviceEntry

函数私有
        void I2CUpdateManager::serviceEntry (Entry &entry, uint32_t now_ms)
      

推进一个设备条目的初始化或更新流程 entry 要推进的设备条目 now_ms 当前时间戳,单位毫秒

services/i2c_update_manager/I2CUpdateManager.hpp:115

成员变量

7

嵌套类型

2
结构体

I2CUpdateManager::Config

查看源码

描述 manager 自身线程的运行配置

成员变量

4
结构体

I2CUpdateManager::Entry

查看源码

描述一个已注册设备的调度参数

成员变量

9

其他公开符号

函数

2

枚举

1

文件

4