Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
SimpleTimer Class Reference
 SimpleTimer ()
 OSTimer class. More...
 
__forceinline void startMs (uint32_t milliseconds, bool repeating=false)
 Initialise millisecond timer. More...
 
__forceinline void startUs (uint32_t microseconds, bool repeating=false)
 Initialise microsecond timer. More...
 
__forceinline void stop ()
 Stop timer. More...
 
void setCallback (SimpleTimerCallback callback, void *arg=nullptr)
 Set timer trigger function. More...
 

Member Function Documentation

void SimpleTimer::setCallback ( SimpleTimerCallback  callback,
void *  arg = nullptr 
)
inline

Set timer trigger function.

Parameters
interruptFunction to be called on timer trigger
Note
Classic c-type callback method
__forceinline void SimpleTimer::startMs ( uint32_t  milliseconds,
bool  repeating = false 
)
inline

Initialise millisecond timer.

Parameters
millisecondsDuration of timer in milliseconds
callbackFunction to call when timer triggers
Note
Classic c-style callback method
__forceinline void SimpleTimer::startUs ( uint32_t  microseconds,
bool  repeating = false 
)
inline

Initialise microsecond timer.

Parameters
microsecondsDuration of timer in milliseconds
callbackFunction to call when timer triggers
Note
Classic c-style callback method
__forceinline void SimpleTimer::stop ( )
inline

Stop timer.

Note
Stops a running timer. Has no effect on stopped timer.