Apps     Components     Interfaces     All Files     Source Tree     source: apps.HighFrequencySampling.MicroTimer.nc

Interface: MicroTimer

This interface provides a generic timer that can be used to generate events at regular intervals. This interface is for high-precision, but limited duration, intervals
Author: Sam Madden
  based on TIMER.comp by Su Ping

Components providing this interface:
apps.HighFrequencySampling.MicroTimerM

Components requiring this interface:
apps.HighFrequencySampling.Sample

Commands

Events

Commands - Details

start

result_t start(uint32_t interval)

Start the timer.

Parameters:

interval - The timer interval in microseconds (1/1024 second). Note that the timer cannot support an arbitrary range of intervals. (Unfortunately this interface does not specify the valid range of timer intervals, which are specific to a platform.)

Returns: Returns SUCCESS if the timer could be started with the given interval.

stop

result_t stop(void)

Stop the timer, preventing it from firing again. Note that the timer might still fire before stop returns.
Returns: SUCCESS if the timer could be stopped, or FAIL if the timer is not running.