libxr
1.0
Want to be the best embedded framework
|
获取基于STM32 SysTick计数器的时间基准(微秒与毫秒) / Provides a timebase using STM32 SysTick timer (microseconds and milliseconds) More...
#include <stm32_timebase.hpp>
Public Member Functions | |
STM32Timebase () | |
默认构造函数 / Default constructor | |
MicrosecondTimestamp | _get_microseconds () |
获取当前时间(微秒级) / Get current time in microseconds | |
MillisecondTimestamp | _get_milliseconds () |
获取当前时间(毫秒级) / Get current time in milliseconds | |
![]() | |
Timebase (uint64_t max_valid_us=UINT64_MAX, uint32_t max_valid_ms=UINT32_MAX) | |
默认构造函数,初始化全局时间基指针。 Default constructor, initializing the global timebase pointer. | |
Additional Inherited Members | |
![]() | |
static MicrosecondTimestamp | GetMicroseconds () |
获取当前时间的微秒级时间戳。 Gets the current timestamp in microseconds. | |
static MillisecondTimestamp | GetMilliseconds () |
获取当前时间的毫秒级时间戳。 Gets the current timestamp in milliseconds. | |
![]() | |
static Timebase * | timebase = nullptr |
静态指针,用于存储全局时间基对象。 Static pointer storing the global timebase instance. | |
获取基于STM32 SysTick计数器的时间基准(微秒与毫秒) / Provides a timebase using STM32 SysTick timer (microseconds and milliseconds)
Definition at line 13 of file stm32_timebase.hpp.
STM32Timebase::STM32Timebase | ( | ) |
默认构造函数 / Default constructor
Definition at line 5 of file stm32_timebase.cpp.
|
virtual |
获取当前时间(微秒级) / Get current time in microseconds
该函数通过读取SysTick计数器的值和系统滴答定时器的毫秒数,计算当前的微秒时间。 It calculates current microsecond timestamp based on SysTick counter and system tick value.
Implements LibXR::Timebase.
Definition at line 10 of file stm32_timebase.cpp.
|
virtual |
获取当前时间(毫秒级) / Get current time in milliseconds
Implements LibXR::Timebase.
Definition at line 39 of file stm32_timebase.cpp.