Zigbee Protocol Controller 1.6.0
etimer.h
Go to the documentation of this file.
1
29/*
30 * Copyright (c) 2004, Swedish Institute of Computer Science.
31 * All rights reserved.
32 *
33 * Redistribution and use in source and binary forms, with or without
34 * modification, are permitted provided that the following conditions
35 * are met:
36 * 1. Redistributions of source code must retain the above copyright
37 * notice, this list of conditions and the following disclaimer.
38 * 2. Redistributions in binary form must reproduce the above copyright
39 * notice, this list of conditions and the following disclaimer in the
40 * documentation and/or other materials provided with the distribution.
41 * 3. Neither the name of the Institute nor the names of its contributors
42 * may be used to endorse or promote products derived from this software
43 * without specific prior written permission.
44 *
45 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
46 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
47 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
48 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
49 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
50 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
51 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
52 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
53 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
54 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
55 * SUCH DAMAGE.
56 *
57 * This file is part of the Contiki operating system.
58 *
59 * Author: Adam Dunkels <adam@sics.se>
60 *
61 * $Id: etimer.h,v 1.3 2008/02/07 23:04:35 oliverschmidt Exp $
62 */
63#ifndef __ETIMER_H__
64#define __ETIMER_H__
65
66#include "sys/timer.h"
67#include "sys/process.h"
68
69#ifdef __cplusplus
70extern "C" {
71#endif
72
81struct etimer {
82 struct timer timer;
83 struct etimer *next;
84 struct process *p;
85};
86
103CCIF void etimer_set(struct etimer *et, clock_time_t interval);
104
120CCIF void etimer_reset(struct etimer *et);
121
137void etimer_restart(struct etimer *et);
138
159void etimer_adjust(struct etimer *et, int td);
160
169
179
188CCIF int etimer_expired(struct etimer *et);
189
200void etimer_stop(struct etimer *et);
201
217void etimer_request_poll(void);
218
227int etimer_pending(void);
228
239
240
244
245#ifdef __cplusplus
246}
247#endif
248
249#endif /* __ETIMER_H__ */
uint32_t clock_time_t
Definition: contiki-conf.h:31
#define CCIF
Definition: contiki-conf.h:24
PROCESS_NAME(etimer_process)
void etimer_restart(struct etimer *et)
Restart an event timer from the current point in time.
Definition: etimer.c:206
clock_time_t etimer_start_time(struct etimer *et)
Get the start time for the event timer.
Definition: etimer.c:232
int etimer_pending(void)
Check if there are any non-expired event timers.
Definition: etimer.c:238
void etimer_reset(struct etimer *et)
Reset an event timer with the same interval as was previously set.
Definition: etimer.c:199
void etimer_request_poll(void)
Make the event timer aware that the clock has changed.
Definition: etimer.c:158
clock_time_t etimer_next_expiration_time(void)
Get next event timer expiration time.
Definition: etimer.c:244
void etimer_stop(struct etimer *et)
Stop a pending event timer.
Definition: etimer.c:250
clock_time_t etimer_expiration_time(struct etimer *et)
Get the expiration time for the event timer.
Definition: etimer.c:226
int etimer_expired(struct etimer *et)
Check if an event timer has expired.
Definition: etimer.c:220
void etimer_set(struct etimer *et, clock_time_t interval)
Set an event timer.
Definition: etimer.c:192
void etimer_adjust(struct etimer *et, int timediff)
Adjust the expiration time for an event timer.
Definition: etimer.c:213
PROCINIT & etimer_process
Definition: procinit.c:36
Definition: etimer.h:81
struct process * p
Definition: etimer.h:84
struct etimer * next
Definition: etimer.h:83
Definition: process.h:327
Definition: timer.h:91