anonymous_namespace{I2CUpdateManager.cpp}
上游未提供说明。
services/i2c_update_manager/I2CUpdateManager.cpp:90.1.0+855c407f828e7 / 75 个公开 API 符号没有说明。
上游未提供说明。
services/i2c_update_manager/I2CUpdateManager.cpp:9上游未提供说明。
services/i2c_update_manager/I2CDevice.hpp:24上游未提供说明。
services/i2c_update_manager/I2CUpdateManager.hpp:18描述 manager 自身线程的运行配置
services/i2c_update_manager/I2CUpdateManager.hpp:26描述一个已注册设备的调度参数
services/i2c_update_manager/I2CUpdateManager.hpp:37
virtual uint8_t I2CDevice::address7bit () const =0
获取设备的 7 位 I2C 地址 设备地址
services/i2c_update_manager/I2CDevice.hpp:42
uint8_t I2CDevice::consecutiveFailures () const
获取连续失败次数 当前累计的连续失败次数
services/i2c_update_manager/I2CDevice.hpp:108
uint32_t I2CDevice::conversionDeadlineMs () const
获取本轮转换的预期完成时刻 conversionMs() trigger_ms_ +
services/i2c_update_manager/I2CDevice.hpp:65
virtual uint32_t I2CDevice::conversionMs () const
获取触发后需要等待的最短转换时间 转换等待时间,单位毫秒;返回 0 表示可直接进入读取阶段
services/i2c_update_manager/I2CDevice.hpp:123
bool I2CDevice::hasValidData () const
查询设备当前是否持有有效数据 最近一次成功更新后数据是否仍有效
services/i2c_update_manager/I2CDevice.hpp:81
virtual bool I2CDevice::init (I2CBusDMA &bus, uint32_t timeout_ms)=0
执行一次初始化或探活流程 bus 当前设备所在的 I2C 总线 timeout_ms 单次事务超时时间,单位毫秒 初始化是否成功
services/i2c_update_manager/I2CDevice.hpp:50
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
bool I2CDevice::isInitialized () const
查询设备是否已经初始化成功 当前是否已经成功初始化
services/i2c_update_manager/I2CDevice.hpp:71
bool I2CDevice::isOnline () const
查询设备当前是否在线 最近一次访问后设备是否在线
services/i2c_update_manager/I2CDevice.hpp:76
uint32_t I2CDevice::lastAttemptMs () const
获取最近一次尝试访问设备的时间 最近一次访问尝试的时间戳
services/i2c_update_manager/I2CDevice.hpp:93
uint32_t I2CDevice::lastFailureMs () const
获取最近一次更新失败的时间 最近一次失败时间戳
services/i2c_update_manager/I2CDevice.hpp:103
uint32_t I2CDevice::lastSuccessMs () const
获取最近一次成功更新设备的时间 最近一次成功更新时间戳
services/i2c_update_manager/I2CDevice.hpp:98
void I2CDevice::markFailure (uint32_t now_ms)
记录一次失败更新 now_ms 当前时间戳,单位毫秒
services/i2c_update_manager/I2CDevice.hpp:169
void I2CDevice::markInitialized (uint32_t now_ms)
上游未提供说明。
services/i2c_update_manager/I2CDevice.hpp:154
void I2CDevice::markSuccess (uint32_t now_ms)
记录一次成功更新 now_ms 当前时间戳,单位毫秒
services/i2c_update_manager/I2CDevice.hpp:143
virtual const char * I2CDevice::name () const =0
获取设备名称 设备名字符串,仅用于日志或调试显示
services/i2c_update_manager/I2CDevice.hpp:36
virtual void I2CDevice::onDataInvalidated ()
当父类判定数据失效时,同步清理子类缓存标记
services/i2c_update_manager/I2CDevice.hpp:137
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
virtual bool I2CDevice::onTrigger (I2CBusDMA &, uint32_t)
发送一次“开始转换”或“开始采样”命令 bus 当前设备所在的 I2C 总线 timeout_ms 单次事务超时时间,单位毫秒 触发是否成功
services/i2c_update_manager/I2CDevice.hpp:117
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
virtual I2CDevice::~I2CDevice ()=default
虚析构函数
services/i2c_update_manager/I2CDevice.hpp:30
I2CUpdateManager::I2CUpdateManager (I2CBusDMA &bus)
使用一条总线构造调度器 bus 要管理的 I2C 总线
services/i2c_update_manager/I2CUpdateManager.hpp:54
uint32_t I2CUpdateManager::computeSleepMs (uint32_t now_ms) const
计算下一次轮询前最多可以休眠多久 now_ms 当前时间戳,单位毫秒 推荐休眠时长,单位毫秒
services/i2c_update_manager/I2CUpdateManager.hpp:108
std::size_t I2CUpdateManager::deviceCount () const
获取当前已注册设备数量 当前设备条目数量
services/i2c_update_manager/I2CUpdateManager.hpp:93
bool I2CUpdateManager::isRunning () const
查询调度线程当前是否在运行 调度器是否处于运行状态
services/i2c_update_manager/I2CUpdateManager.hpp:88
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
void I2CUpdateManager::run ()
后台调度线程主循环
services/i2c_update_manager/I2CUpdateManager.hpp:129
I2CUpdateManager::Entry * I2CUpdateManager::selectReadyEntry (uint32_t now_ms)
选择当前已经到期且应优先调度的设备条目 now_ms 当前时间戳,单位毫秒 选中的设备条目,若无可调度设备则返回空指针
services/i2c_update_manager/I2CUpdateManager.hpp:101
void I2CUpdateManager::serviceEntry (Entry &entry, uint32_t now_ms)
推进一个设备条目的初始化或更新流程 entry 要推进的设备条目 now_ms 当前时间戳,单位毫秒
services/i2c_update_manager/I2CUpdateManager.hpp:115
bool I2CUpdateManager::start ()
使用默认配置创建并启动后台调度线程 调度线程是否成功启动
services/i2c_update_manager/I2CUpdateManager.hpp:70
bool I2CUpdateManager::start (const Config &config)
使用给定配置创建并启动后台调度线程 config 调度线程配置 调度线程是否成功启动
services/i2c_update_manager/I2CUpdateManager.hpp:77
void I2CUpdateManager::stop ()
请求后台调度线程退出
services/i2c_update_manager/I2CUpdateManager.hpp:82
static void I2CUpdateManager::taskEntry (void *pvParameters)
CMSIS-RTOS v2 线程入口的静态桥接函数 pvParameters 传入的调度器对象指针
services/i2c_update_manager/I2CUpdateManager.hpp:121
uint32_t anonymous_namespace{I2CUpdateManager.cpp}::kernelTicksFromMs (uint32_t timeout_ms)
上游未提供说明。
services/i2c_update_manager/I2CUpdateManager.cpp:17
bool anonymous_namespace{I2CUpdateManager.cpp}::tickReached (const uint32_t now_ms, const uint32_t due_ms)
上游未提供说明。
services/i2c_update_manager/I2CUpdateManager.cpp:12描述基类状态机当前处于哪个阶段
ReadTriggerWait描述一次 update() 推进后的结果
CompleteFailedPending
uint8_t I2CDevice::consecutive_failures_
当前连续失败次数
services/i2c_update_manager/I2CDevice.hpp:194
bool I2CDevice::data_valid_
当前缓存的数据是否有效
services/i2c_update_manager/I2CDevice.hpp:190
bool I2CDevice::initialized_
设备是否已经成功初始化
services/i2c_update_manager/I2CDevice.hpp:188
uint32_t I2CDevice::last_attempt_ms_
最近一次尝试访问设备的时间戳
services/i2c_update_manager/I2CDevice.hpp:191
uint32_t I2CDevice::last_failure_ms_
最近一次失败时间戳
services/i2c_update_manager/I2CDevice.hpp:193
uint32_t I2CDevice::last_success_ms_
最近一次成功更新时间戳
services/i2c_update_manager/I2CDevice.hpp:192
bool I2CDevice::online_
设备最近一次访问后是否在线
services/i2c_update_manager/I2CDevice.hpp:189
Phase I2CDevice::phase_
当前状态机阶段
services/i2c_update_manager/I2CDevice.hpp:185
uint32_t I2CDevice::trigger_ms_
最近一次触发采样的时间戳
services/i2c_update_manager/I2CDevice.hpp:186
uint32_t I2CUpdateManager::Config::max_sleep_ms
空闲时单次最长休眠时间,单位毫秒
services/i2c_update_manager/I2CUpdateManager.hpp:31
osPriority_t I2CUpdateManager::Config::priority
调度线程优先级
services/i2c_update_manager/I2CUpdateManager.hpp:30
uint32_t I2CUpdateManager::Config::stack_size_bytes
调度线程栈大小,单位 byte
services/i2c_update_manager/I2CUpdateManager.hpp:29
const char* I2CUpdateManager::Config::task_name
调度线程名称
services/i2c_update_manager/I2CUpdateManager.hpp:28
uint32_t I2CUpdateManager::Entry::cycle_start_ms
当前周期的名义起点
services/i2c_update_manager/I2CUpdateManager.hpp:44
I2CDevice* I2CUpdateManager::Entry::device
设备对象指针
services/i2c_update_manager/I2CUpdateManager.hpp:39
bool I2CUpdateManager::Entry::enabled
当前条目是否启用
services/i2c_update_manager/I2CUpdateManager.hpp:45
bool I2CUpdateManager::Entry::initialized
设备是否已经完成初始化
services/i2c_update_manager/I2CUpdateManager.hpp:46
uint32_t I2CUpdateManager::Entry::next_due_ms
下次应被调度的时刻
services/i2c_update_manager/I2CUpdateManager.hpp:43
bool I2CUpdateManager::Entry::pending_
当前是否正处于 Trigger 到 Read 的等待阶段
services/i2c_update_manager/I2CUpdateManager.hpp:47
uint32_t I2CUpdateManager::Entry::period_ms
周期调度间隔,单位毫秒
services/i2c_update_manager/I2CUpdateManager.hpp:40
uint32_t I2CUpdateManager::Entry::phase_ms
初始错峰相位,单位毫秒
services/i2c_update_manager/I2CUpdateManager.hpp:41
uint32_t I2CUpdateManager::Entry::timeout_ms
单次设备事务超时时间,单位毫秒
services/i2c_update_manager/I2CUpdateManager.hpp:42
std::size_t I2CUpdateManager::MaxDevices
上游未提供说明。
services/i2c_update_manager/I2CUpdateManager.hpp:21
I2CBusDMA& I2CUpdateManager::bus_
当前调度器独占管理的 I2C 总线
services/i2c_update_manager/I2CUpdateManager.hpp:131
Config I2CUpdateManager::config_
当前采用的线程配置
services/i2c_update_manager/I2CUpdateManager.hpp:135
Entry I2CUpdateManager::entries_[MaxDevices] [MaxDevices]
已注册设备的调度表
services/i2c_update_manager/I2CUpdateManager.hpp:132
std::size_t I2CUpdateManager::entry_count_
当前已注册设备数量
services/i2c_update_manager/I2CUpdateManager.hpp:133
bool I2CUpdateManager::run_flag_
后台调度线程是否应继续运行
services/i2c_update_manager/I2CUpdateManager.hpp:136
osThreadId_t I2CUpdateManager::task_handle_
后台调度线程句柄
services/i2c_update_manager/I2CUpdateManager.hpp:134I2CDevice 基类状态机实现
services/i2c_update_manager/I2CDevice.cpp面向 manager 周期调度的 I2C 设备抽象基类 ChillyHigh
services/i2c_update_manager/I2CDevice.hppI2C 周期更新管理器实现
services/i2c_update_manager/I2CUpdateManager.cpp单条 I2C 总线的周期更新管理器
services/i2c_update_manager/I2CUpdateManager.hpp