libxr  1.0
Want to be the best embedded framework
Loading...
Searching...
No Matches
ch32_timebase.cpp
1#include "ch32_timebase.hpp"
2
3using namespace LibXR;
4
5CH32Timebase::CH32Timebase() : Timebase(UINT64_MAX, UINT32_MAX)
6{
7 cnt_per_microsec_ = SystemCoreClock / 1000000;
8}
9
11{
12 uint64_t cnt = SysTick->CNT;
13 return MicrosecondTimestamp(cnt / cnt_per_microsec_);
14}
15
17{
18 return cnt_per_microsec_ / 1000;
19}
MicrosecondTimestamp _get_microseconds() override
纯虚函数,获取当前时间的微秒级时间戳(由派生类实现)。 Pure virtual function for obtaining the current timestamp in microseconds...
MillisecondTimestamp _get_milliseconds() override
纯虚函数,获取当前时间的毫秒级时间戳(由派生类实现)。 Pure virtual function for obtaining the current timestamp in milliseconds...
表示微秒级时间戳的类。Class representing a timestamp in microseconds.
表示毫秒级时间戳的类。Class representing a timestamp in milliseconds.
时间基类,用于提供高精度时间戳。 Timebase class for providing high-precision timestamps.
Definition timebase.hpp:18
LibXR 命名空间
Definition ch32_gpio.hpp:9