|
libxr
1.0
Want to be the best embedded framework
|
HPM MCHTMR 时间基准实现 / HPM MCHTMR based timebase implementation. More...
#include <hpm_timebase.hpp>
Public Member Functions | |
| HPMTimebase (MCHTMR_Type *timer=HPM_MCHTMR, clock_name_t clock=clock_mchtmr0) | |
| 构造 HPM 时间基对象 / Construct an HPM timebase object. | |
| MicrosecondTimestamp | _get_microseconds () override |
| 获取微秒时间戳 / Get current timestamp in microseconds. | |
| MillisecondTimestamp | _get_milliseconds () override |
| 获取毫秒时间戳 / Get current timestamp in milliseconds. | |
Public Member Functions inherited from LibXR::Timebase | |
| Timebase (uint64_t max_valid_us=UINT64_MAX, uint32_t max_valid_ms=UINT32_MAX) | |
| 默认构造函数,初始化全局时间基指针。 Default constructor, initializing the global timebase pointer. | |
Private Attributes | |
| MCHTMR_Type * | timer_ |
| 定时器外设实例 / Timer peripheral instance. | |
| uint32_t | clock_hz_ |
| 定时器输入时钟频率(Hz) / Timer input clock frequency in Hz. | |
Additional Inherited Members | |
Static Public Member Functions inherited from LibXR::Timebase | |
| static MicrosecondTimestamp | GetMicroseconds () |
| 获取当前时间的微秒级时间戳。 Gets the current timestamp in microseconds. | |
| static MillisecondTimestamp | GetMilliseconds () |
| 获取当前时间的毫秒级时间戳。 Gets the current timestamp in milliseconds. | |
| static void | DelayMicroseconds (uint32_t us) |
| 微秒级延时 / Delay in microseconds | |
Static Public Attributes inherited from LibXR::Timebase | |
| static Timebase * | timebase = nullptr |
| 静态指针,用于存储全局时间基对象。 Static pointer storing the global timebase instance. | |
HPM MCHTMR 时间基准实现 / HPM MCHTMR based timebase implementation.
基于 MCHTMR 计数器提供微秒与毫秒时间戳。 Provides microsecond and millisecond timestamps using MCHTMR counter.
Definition at line 19 of file hpm_timebase.hpp.
| HPMTimebase::HPMTimebase | ( | MCHTMR_Type * | timer = HPM_MCHTMR, |
| clock_name_t | clock = clock_mchtmr0 ) |
构造 HPM 时间基对象 / Construct an HPM timebase object.
| timer | MCHTMR 外设基地址 / MCHTMR base address. |
| clock | 定时器时钟源 / Clock source used by the timer. |
Definition at line 19 of file hpm_timebase.cpp.
|
overridevirtual |
获取微秒时间戳 / Get current timestamp in microseconds.
Implements LibXR::Timebase.
Definition at line 26 of file hpm_timebase.cpp.
|
overridevirtual |
获取毫秒时间戳 / Get current timestamp in milliseconds.
Implements LibXR::Timebase.
Definition at line 32 of file hpm_timebase.cpp.
|
private |
定时器输入时钟频率(Hz) / Timer input clock frequency in Hz.
Definition at line 45 of file hpm_timebase.hpp.
|
private |
定时器外设实例 / Timer peripheral instance.
Definition at line 43 of file hpm_timebase.hpp.