uTimerLib
https://github.com/Naguissa/uTimerLib
|
Arduino tiny and cross-device compatible timer library. More...
Public Member Functions | |
uTimerLib () | |
Constructor. | |
void | setInterval_us (void(*)(), unsigned long int) |
Attaches a callback function to be executed each us microseconds. More... | |
void | setInterval_s (void(*)(), unsigned long int) |
Attaches a callback function to be executed each s seconds. More... | |
void | setTimeout_us (void(*)(), unsigned long int) |
Attaches a callback function to be executed once when us microseconds have passed. More... | |
void | setTimeout_s (void(*)(), unsigned long int) |
Attaches a callback function to be executed once when s seconds have passed. More... | |
void | clearTimer () |
Loads last bit of time needed to precisely count until desired time (non complete loop) More... | |
void | _interrupt () |
Internal intermediate function to control timer interrupts. More... | |
Arduino tiny and cross-device compatible timer library.
Timers used by each microcontroller:
You have public TimerLib variable with following methods:
void uTimerLib::_interrupt | ( | ) |
Internal intermediate function to control timer interrupts.
As timers doesn't give us enougth flexibility for large timings, this function implements oferflow control to offer user desired timings.
void uTimerLib::clearTimer | ( | ) |
Loads last bit of time needed to precisely count until desired time (non complete loop)
Note: This is device-dependant
void uTimerLib::setInterval_s | ( | void(*)() | cb, |
unsigned long int | s | ||
) |
Attaches a callback function to be executed each s seconds.
cb | Callback function to be called |
s | Interval in seconds |
void uTimerLib::setInterval_us | ( | void(*)() | cb, |
unsigned long int | us | ||
) |
Attaches a callback function to be executed each us microseconds.
cb | Callback function to be called |
us | Interval in microseconds |
void uTimerLib::setTimeout_s | ( | void(*)() | cb, |
unsigned long int | s | ||
) |
Attaches a callback function to be executed once when s seconds have passed.
cb | Callback function to be called |
s | Timeout in seconds |
void uTimerLib::setTimeout_us | ( | void(*)() | cb, |
unsigned long int | us | ||
) |
Attaches a callback function to be executed once when us microseconds have passed.
cb | Callback function to be called |
us | Timeout in microseconds |