It allows Lua to execute timer specific operations (delay, read timer value,
start timer, get time difference).
tmr.delay( id, delay ): uses timer 'id' to wait for 'delay' us.
Data = tmr.read( id ): reads the value of timer 'id'. The returned value is
platform dependent.
Data = tmr.start( id ): start the timer 'id', and also returns its value at
the moment of start. The returned value is platform dependent.
diff = tmr.diff( id, end, start ): returns the time difference (in us) between
the timer values 'end' and 'start' (obtained from calling tmr.start or
tmr.read). The order of end/start is irrelevant.
Data = tmr.mindelay( id ): returns the minimum delay (in us ) that can be
achieved by calling the tmr.delay function. If the return value is 0, the
platform layer is capable of executing sub-microsecond delays.
Data = tmr.maxdelay( id ): returns the maximum delay (in us) that can be
achieved by calling the tmr.delay function.
Data = tmr.setclock( id, clock ): sets the clock of the given timer. Returns the
actual clock set for the timer.
Data = tmr.getclock( id ): return the clock of the given timer.