libxr  1.0
Want to be the best embedded framework
Loading...
Searching...
No Matches
hpm_timebase.hpp
1#pragma once
2
3#include "timebase.hpp"
4
5#include "hpm_clock_drv.h"
6#include "hpm_mchtmr_drv.h"
7#include "hpm_soc.h"
8
9namespace LibXR
10{
11
19class HPMTimebase : public Timebase
20{
21 public:
27 HPMTimebase(MCHTMR_Type* timer = HPM_MCHTMR, clock_name_t clock = clock_mchtmr0);
28
34
40
41 private:
43 MCHTMR_Type* timer_;
45 uint32_t clock_hz_;
46};
47
48} // namespace LibXR
HPM MCHTMR 时间基准实现 / HPM MCHTMR based timebase implementation.
MCHTMR_Type * timer_
定时器外设实例 / Timer peripheral instance.
MillisecondTimestamp _get_milliseconds() override
获取毫秒时间戳 / Get current timestamp in milliseconds.
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.
uint32_t clock_hz_
定时器输入时钟频率(Hz) / Timer input clock frequency in Hz.
表示微秒级时间戳的类。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_can.hpp:14