Interface: moteiv.tos.lib.timer.Counter
interface Counter<typedef precision_tag, typedef size_type>
A Counter counts time in some units and in some width, signaling
overflow.
A Counter is parameterised by its "precision" (milliseconds,
microseconds, etc), identified by a type. This prevents, e.g.,
unintentionally mixing components expecting milliseconds with those
expecting microseconds as those interfaces have a different type.
A Counter's second parameter is its "width", i.e., the number of
bits used to represent time values. Width is indicated by including
the appropriate size integer type as a Counter parameter.
See TEP102 for more details.
- Parameters:
-
precision_tag
- A type indicating the precision of this Counter.
-
size_type
- An integer type representing time values for this Counter.
- Author:
-
Cory Sharp <cssharp@eecs.berkeley.edu>
Commands
command void clearOverflow()
command size_type get()
command bool isOverflowPending()
Events
event void overflow()
Commands - Details
clearOverflow
command void clearOverflow()
get
command size_type get()
- Returns:
-
Current counter value.
isOverflowPending
command bool isOverflowPending()
- Returns:
-
Counter pending overflow status.
Events - Details
overflow
event void overflow()