libepaper 2.0.0
A C++23 library for controlling Waveshare e-paper displays on Raspberry Pi, featuring transparent sleep/wake management and a fluent builder API.
Loading...
Searching...
No Matches
mock_delay.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4#include <cstdint>
5
6namespace epaper::hal {
7
23class MockDelay {
24public:
30 static auto delay_ms(std::uint32_t ms) -> void {
31 total_delay_ms_ += ms;
32 delay_count_++;
33 }
34
39 [[nodiscard]] static auto total_delay_ms() -> std::uint32_t { return total_delay_ms_; }
40
45 [[nodiscard]] static auto delay_count() -> std::size_t { return delay_count_; }
46
50 static auto reset() -> void {
51 total_delay_ms_ = 0;
52 delay_count_ = 0;
53 }
54
55private:
56 inline static std::uint32_t total_delay_ms_ = 0;
57 inline static std::size_t delay_count_ = 0;
58};
59
60} // namespace epaper::hal
Definition mock_delay.hpp:23
static auto total_delay_ms() -> std::uint32_t
Get total accumulated delay time.
Definition mock_delay.hpp:39
static auto reset() -> void
Reset delay tracking for new test.
Definition mock_delay.hpp:50
static auto delay_ms(std::uint32_t ms) -> void
Mock millisecond delay (records but doesn't block).
Definition mock_delay.hpp:30
static auto delay_count() -> std::size_t
Get total number of delay calls.
Definition mock_delay.hpp:45
Definition gpio.hpp:62