|
libxr
1.0
Want to be the best embedded framework
|
时间基类,用于提供高精度时间戳。 Timebase class for providing high-precision timestamps. More...
#include <timebase.hpp>
Public Member Functions | |
| Timebase ()=default | |
| 默认构造函数。 Default constructor. | |
| Timebase (const Timebase &)=delete | |
| 禁止拷贝构造。 Copy construction is disabled. | |
| Timebase & | operator= (const Timebase &)=delete |
| 禁止拷贝赋值。 Copy assignment is disabled. | |
Static Public Member Functions | |
| static MicrosecondTimestamp | GetMicroseconds () |
| 获取当前时间的微秒级时间戳。 Gets the current timestamp in microseconds. | |
| static MillisecondTimestamp | GetMilliseconds () |
| 获取当前时间的毫秒级时间戳。 Gets the current timestamp in milliseconds. | |
| static bool | IsReady () noexcept |
| 检查时间基是否已经初始化。 Check whether the active timebase backend is initialized. | |
| static void | DelayMicroseconds (uint32_t us) |
| 微秒级延时 / Delay in microseconds | |
Static Protected Member Functions | |
| static void | SetReady (bool ready=true) noexcept |
| 设置时间基就绪状态。 Set the timebase ready flag. | |
| static void | ConfigureWrapRange (uint64_t max_valid_us, uint32_t max_valid_ms) noexcept |
| 配置时间戳回绕上界。 Configure the timestamp wraparound limits. | |
| static uint64_t | GetConfiguredWrapRangeUs () noexcept |
| 读取当前配置的微秒回绕上界。 Read the configured microsecond wraparound limit. | |
| static uint32_t | GetConfiguredWrapRangeMs () noexcept |
| 读取当前配置的毫秒回绕上界。 Read the configured millisecond wraparound limit. | |
Static Private Attributes | |
| static bool | ready_ = false |
| 时间基是否已完成初始化。 Whether the timebase backend has been initialized. | |
时间基类,用于提供高精度时间戳。 Timebase class for providing high-precision timestamps.
该类提供了微秒和毫秒级的时间戳获取接口。 This class provides interfaces for obtaining timestamps in microseconds and milliseconds.
Definition at line 16 of file timebase.hpp.
|
inlinestaticprotectednoexcept |
配置时间戳回绕上界。 Configure the timestamp wraparound limits.
| max_valid_us | 微秒时间戳的有效上界。 Maximum valid microsecond timestamp value. |
| max_valid_ms | 毫秒时间戳的有效上界。 Maximum valid millisecond timestamp value. |
Definition at line 95 of file timebase.hpp.
|
inlinestatic |
微秒级延时 / Delay in microseconds
| us | 延时长度(us)/ Delay length (us) |
Definition at line 65 of file timebase.hpp.
|
inlinestaticnodiscardprotectednoexcept |
读取当前配置的毫秒回绕上界。 Read the configured millisecond wraparound limit.
Definition at line 113 of file timebase.hpp.
|
inlinestaticnodiscardprotectednoexcept |
读取当前配置的微秒回绕上界。 Read the configured microsecond wraparound limit.
Definition at line 104 of file timebase.hpp.
|
static |
获取当前时间的微秒级时间戳。 Gets the current timestamp in microseconds.
Definition at line 12 of file ch32_timebase.cpp.
|
static |
获取当前时间的毫秒级时间戳。 Gets the current timestamp in milliseconds.
Definition at line 40 of file ch32_timebase.cpp.
|
inlinestaticnodiscardnoexcept |
检查时间基是否已经初始化。 Check whether the active timebase backend is initialized.
Definition at line 59 of file timebase.hpp.
|
inlinestaticprotectednoexcept |
设置时间基就绪状态。 Set the timebase ready flag.
| ready | 是否就绪。Whether the backend is ready. |
Definition at line 85 of file timebase.hpp.
|
inlinestaticprivate |
时间基是否已完成初始化。 Whether the timebase backend has been initialized.
Definition at line 123 of file timebase.hpp.