Esp32/Components/driver/include/driver/os_timer.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  * os_timer.h
8  *
9  * This implementation mimics the behaviour of the ESP8266 Non-OS SDK timers,
10  * using Timer2 as the reference (which is _not_ in microseconds!)
11  *
12  * The ESP32 IDF contains more sophisticated timer implementations, but also
13  * this same API which it refers to as the 'legacy' timer API.
14  */
15 
16 #pragma once
17 
18 #include <esp32/rom/ets_sys.h>
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
30 typedef ETSTimerFunc os_timer_func_t;
31 typedef ETSTimer os_timer_t;
32 
33 #define os_timer_arm(ptimer, ms, repeat_flag) ets_timer_arm(ptimer, ms, repeat_flag)
34 #define os_timer_arm_us(ptimer, us, repeat_flag) ets_timer_arm_us(ptimer, us, repeat_flag)
35 #define os_timer_disarm(ptimer) ets_timer_disarm(ptimer)
36 #define os_timer_setfn(ptimer, pfunction, parg) ets_timer_setfn(ptimer, pfunction, parg)
37 
47 void os_timer_arm_ticks(os_timer_t* ptimer, uint32_t ticks, bool repeat_flag);
48 
51 #ifdef __cplusplus
52 }
53 #endif
void os_timer_arm_ticks(os_timer_t *ptimer, uint32_t ticks, bool repeat_flag)
Set a software timer using the Timer2 tick value.
ETSTimer os_timer_t
Definition: Esp32/Components/driver/include/driver/os_timer.h:31
ETSTimerFunc os_timer_func_t
Definition: Esp32/Components/driver/include/driver/os_timer.h:30