Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of UIPEthernet by
uip_timer.h
00001 /** 00002 * \defgroup timer Timer library 00003 * 00004 * The timer library provides functions for setting, resetting and 00005 * restarting timers, and for checking if a timer has expired. An 00006 * application must "manually" check if its timers have expired; this 00007 * is not done automatically. 00008 * 00009 * A timer is declared as a \c struct \c timer and all access to the 00010 * timer is made by a pointer to the declared timer. 00011 * 00012 * \note The timer library uses the \ref clock "Clock library" to 00013 * measure time. Intervals should be specified in the format used by 00014 * the clock library. 00015 * 00016 * @{ 00017 */ 00018 /** 00019 * \file 00020 * Timer library header file. 00021 * \author 00022 * Adam Dunkels <adam@sics.se> 00023 */ 00024 /* 00025 * Copyright (c) 2004, Swedish Institute of Computer Science. 00026 * All rights reserved. 00027 * 00028 * Redistribution and use in source and binary forms, with or without 00029 * modification, are permitted provided that the following conditions 00030 * are met: 00031 * 1. Redistributions of source code must retain the above copyright 00032 * notice, this list of conditions and the following disclaimer. 00033 * 2. Redistributions in binary form must reproduce the above copyright 00034 * notice, this list of conditions and the following disclaimer in the 00035 * documentation and/or other materials provided with the distribution. 00036 * 3. Neither the name of the Institute nor the names of its contributors 00037 * may be used to endorse or promote products derived from this software 00038 * without specific prior written permission. 00039 * 00040 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 00041 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00042 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00043 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 00044 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00045 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 00046 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00047 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00048 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 00049 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00050 * SUCH DAMAGE. 00051 * 00052 * This file is part of the UIP TCP/IP stack 00053 * 00054 * Author: Adam Dunkels <adam@sics.se> 00055 * 00056 * $Id: timer.h,v 1.3 2006/06/11 21:46:39 adam Exp $ 00057 */ 00058 #ifndef __UIP_TIMER_H__ 00059 #define __UIP_TIMER_H__ 00060 00061 #include "uip_clock.h" 00062 00063 /** 00064 * A timer. 00065 * 00066 * This structure is used for declaring a timer. The timer must be set 00067 * with timer_set() before it can be used. 00068 * 00069 * \hideinitializer 00070 */ 00071 struct uip_timer 00072 { 00073 clock_time_t start; 00074 clock_time_t interval; 00075 }; 00076 00077 void uip_timer_set(struct uip_timer* t, clock_time_t interval); 00078 void uip_timer_reset(struct uip_timer* t); 00079 void uip_timer_restart(struct uip_timer* t); 00080 int uip_timer_expired(struct uip_timer* t); 00081 #endif /* __UIP_TIMER_H__ */ 00082 00083 /** @} */
Generated on Tue Jul 12 2022 18:10:58 by
