|
OpenWSN Firmware
|
Data Structures | |
| struct | opentimers_t |
| struct | opentimers_vars_t |
Macros | |
| #define | MAX_NUM_TIMERS 10 |
| Maximum number of timers that can run concurrently. More... | |
| #define | MAX_TICKS_IN_SINGLE_CLOCK ((PORT_TIMER_WIDTH)0xFFFFFFFF) |
| #define | TOO_MANY_TIMERS_ERROR 255 |
| #define | opentimer_id_t uint8_t |
Typedefs | |
| typedef void(* | opentimers_cbt )(void) |
Enumerations | |
| enum | timer_type_t { TIMER_PERIODIC, TIMER_ONESHOT } |
| enum | time_type_t { TIME_MS, TIME_TICS } |
Functions | |
| void | opentimers_init (void) |
| Initialize this module. More... | |
| opentimer_id_t | opentimers_start (uint32_t duration, timer_type_t type, time_type_t timetype, opentimers_cbt callback) |
| Start a timer. More... | |
| void | opentimers_setPeriod (opentimer_id_t id, time_type_t timetype, uint32_t newPeriod) |
| Replace the period of a running timer. More... | |
| void | opentimers_stop (opentimer_id_t id) |
| Stop a running timer. More... | |
| void | opentimers_restart (opentimer_id_t id) |
| Restart a stop timer. More... | |
| void | opentimers_sleepTimeCompesation (uint16_t sleepTime) |
| #define MAX_NUM_TIMERS 10 |
Maximum number of timers that can run concurrently.
| #define MAX_TICKS_IN_SINGLE_CLOCK ((PORT_TIMER_WIDTH)0xFFFFFFFF) |
| #define opentimer_id_t uint8_t |
| #define TOO_MANY_TIMERS_ERROR 255 |
| typedef void(* opentimers_cbt)(void) |
| enum time_type_t |
| enum timer_type_t |
| void opentimers_init | ( | void | ) |
Initialize this module.
Initializes data structures and hardware timer.
| void opentimers_restart | ( | opentimer_id_t | id | ) |
Restart a stop timer.
Sets the timer to " running".
| void opentimers_setPeriod | ( | opentimer_id_t | id, |
| time_type_t | timetype, | ||
| uint32_t | newPeriod | ||
| ) |
Replace the period of a running timer.
| void opentimers_sleepTimeCompesation | ( | uint16_t | sleepTime | ) |
| opentimer_id_t opentimers_start | ( | uint32_t | duration, |
| timer_type_t | type, | ||
| time_type_t | timetype, | ||
| opentimers_cbt | callback | ||
| ) |
Start a timer.
The timer works as follows:
| duration | Number milli-seconds after which the timer will fire. |
| type | Type of timer:
|
| timetype | Units of the duration:
|
| callback | The function to call when the timer fires. |
| void opentimers_stop | ( | opentimer_id_t | id | ) |
Stop a running timer.
Sets the timer to "not running". the system recovers even if this was the next timer to expire.