ztimer mock clock backend
More...
ztimer mock clock backend
This ztimer module implements a virtual clock that can be used for unittests. It can be manually adjusted to different timestamps and manually fired to simulate different scenarios and test the ztimer implementation using this as a backing timer.
|
file | mock.h |
| ztimer mock clock backend API
|
|
◆ ztimer_mock_advance()
Advance the mock clock counter and update target.
This will call ztimer_handler if the target was passed.
- Parameters
-
[in] | self | instance to operate on |
[in] | val | counter increment value |
◆ ztimer_mock_fire()
Trigger the timer handlers.
This is equivalent to a hardware timer interrupt
- Parameters
-
[in] | self | instance to operate on |
◆ ztimer_mock_init()
Constructor.
- Parameters
-
[in] | self | instance to operate on |
[in] | width | counter width, 1 <= width <= 32 |
◆ ztimer_mock_jump()
Set the mock clock counter value without updating timer target.
This will not touch the timer target.
- Parameters
-
[in] | self | instance to operate on |
[in] | target | new absolute counter value |