Timers.h
Go to the documentation of this file.
1 /****
2  * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development.
3  * Created 2015 by Skurydin Alexey
4  * http://github.com/SmingHub/Sming
5  * All files of the Sming Core are provided under the LGPL v3 license.
6  *
7  * PolledTimer.h - template class to assist with measurement of elapsed time periods
8  *
9  * @author mikee47 <mike@sillyhouse.net>
10  *
11  * Developed from the excellent esp8266 Arduino project's PolledTimer.h
12  * Copyright (c) 2018 Daniel Salazar. All rights reserved.
13  * https://github.com/esp8266/Arduino/blob/master/cores/esp8266/PolledTimeout.h
14  *
15  * Generally Sming uses timer callbacks but for some applications a polled timer
16  * is more appropriate, especially if timer intervals are less than few hundred
17  * microseconds, or even in nanoseconds.
18  *
19  ****/
20 
21 #pragma once
22 
23 #include <PolledTimer.h>
24 #include "Clocks.h"
25 
30 /*
31  * Elapse timers
32  */
33 
34 template <NanoTime::Unit unit> using OneShotElapseTimer = PolledTimer::OneShot<Timer2Clock, unit>;
35 template <NanoTime::Unit unit> using PeriodicElapseTimer = PolledTimer::Periodic<Timer2Clock, unit>;
36 
39 
41 
42 /*
43  * CPU Cycle timers
44  */
45 
52 
53 /*
54  * Arduino-compatible types
55  */
56 
Template class to implement a polled timer.
Definition: PolledTimer.h:67
#define SMING_DEPRECATED
Definition: sming_attr.h:30
OneShotElapseTimer< NanoTime::Microseconds > OneShotFastUs
Definition: Timers.h:38