uIP 1.0 based webserver for LPC1114 + ENC28J60

Committer:
ban4jp
Date:
Mon Jun 30 16:00:08 2014 +0000
Revision:
3:a2715e9c7737
Parent:
0:685224d2f66d
backported from Contiki 2.7

### Who changed what in which revision?

UserRevisionLine numberNew contents of line
ban4jp 0:685224d2f66d 1 /**
ban4jp 0:685224d2f66d 2 * \defgroup clock Clock interface
ban4jp 0:685224d2f66d 3 *
ban4jp 0:685224d2f66d 4 * The clock interface is the interface between the \ref timer "timer library"
ban4jp 0:685224d2f66d 5 * and the platform specific clock functionality. The clock
ban4jp 0:685224d2f66d 6 * interface must be implemented for each platform that uses the \ref
ban4jp 0:685224d2f66d 7 * timer "timer library".
ban4jp 0:685224d2f66d 8 *
ban4jp 0:685224d2f66d 9 * The clock interface does only one this: it measures time. The clock
ban4jp 0:685224d2f66d 10 * interface provides a macro, CLOCK_SECOND, which corresponds to one
ban4jp 0:685224d2f66d 11 * second of system time.
ban4jp 0:685224d2f66d 12 *
ban4jp 0:685224d2f66d 13 * \sa \ref timer "Timer library"
ban4jp 0:685224d2f66d 14 *
ban4jp 0:685224d2f66d 15 * @{
ban4jp 0:685224d2f66d 16 */
ban4jp 0:685224d2f66d 17
ban4jp 0:685224d2f66d 18 /*
ban4jp 0:685224d2f66d 19 * Copyright (c) 2004, Swedish Institute of Computer Science.
ban4jp 0:685224d2f66d 21 *
ban4jp 0:685224d2f66d 22 * Redistribution and use in source and binary forms, with or without
ban4jp 0:685224d2f66d 23 * modification, are permitted provided that the following conditions
ban4jp 0:685224d2f66d 24 * are met:
ban4jp 0:685224d2f66d 25 * 1. Redistributions of source code must retain the above copyright
ban4jp 0:685224d2f66d 26 * notice, this list of conditions and the following disclaimer.
ban4jp 0:685224d2f66d 27 * 2. Redistributions in binary form must reproduce the above copyright
ban4jp 0:685224d2f66d 28 * notice, this list of conditions and the following disclaimer in the
ban4jp 0:685224d2f66d 29 * documentation and/or other materials provided with the distribution.
ban4jp 0:685224d2f66d 30 * 3. Neither the name of the Institute nor the names of its contributors
ban4jp 0:685224d2f66d 31 * may be used to endorse or promote products derived from this software
ban4jp 0:685224d2f66d 32 * without specific prior written permission.
ban4jp 0:685224d2f66d 33 *
ban4jp 0:685224d2f66d 34 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS AS IS'' AND
ban4jp 0:685224d2f66d 35 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
ban4jp 0:685224d2f66d 36 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ban4jp 0:685224d2f66d 37 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
ban4jp 0:685224d2f66d 38 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
ban4jp 0:685224d2f66d 39 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
ban4jp 0:685224d2f66d 40 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
ban4jp 0:685224d2f66d 41 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
ban4jp 0:685224d2f66d 42 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
ban4jp 0:685224d2f66d 43 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
ban4jp 0:685224d2f66d 44 * SUCH DAMAGE.
ban4jp 0:685224d2f66d 45 *
ban4jp 0:685224d2f66d 46 * This file is part of the uIP TCP/IP stack
ban4jp 0:685224d2f66d 47 *
ban4jp 0:685224d2f66d 49 *
ban4jp 0:685224d2f66d 50 * $Id: clock.h,v 1.3 2006/06/11 21:46:39 adam Exp$
ban4jp 0:685224d2f66d 51 */
ban4jp 0:685224d2f66d 52 #ifndef __CLOCK_H__
ban4jp 0:685224d2f66d 53 #define __CLOCK_H__
ban4jp 0:685224d2f66d 54
ban4jp 0:685224d2f66d 55 #include "clock-arch.h"
ban4jp 0:685224d2f66d 56
ban4jp 0:685224d2f66d 57 /**
ban4jp 0:685224d2f66d 58 * Initialize the clock library.
ban4jp 0:685224d2f66d 59 *
ban4jp 0:685224d2f66d 60 * This function initializes the clock library and should be called
ban4jp 0:685224d2f66d 61 * from the main() function of the system.
ban4jp 0:685224d2f66d 62 *
ban4jp 0:685224d2f66d 63 */
ban4jp 0:685224d2f66d 64 void clock_init(void);
ban4jp 0:685224d2f66d 65
ban4jp 0:685224d2f66d 66 /**
ban4jp 0:685224d2f66d 67 * Get the current clock time.
ban4jp 0:685224d2f66d 68 *
ban4jp 0:685224d2f66d 69 * This function returns the current system clock time.
ban4jp 0:685224d2f66d 70 *
ban4jp 0:685224d2f66d 71 * \return The current clock time, measured in system ticks.
ban4jp 0:685224d2f66d 72 */
ban4jp 0:685224d2f66d 73 clock_time_t clock_time(void);
ban4jp 0:685224d2f66d 74
ban4jp 0:685224d2f66d 75 /**
ban4jp 0:685224d2f66d 76 * A second, measured in system clock time.
ban4jp 0:685224d2f66d 77 *
ban4jp 0:685224d2f66d 78 * \hideinitializer
ban4jp 0:685224d2f66d 79 */
ban4jp 0:685224d2f66d 80 #ifdef CLOCK_CONF_SECOND
ban4jp 0:685224d2f66d 81 #define CLOCK_SECOND CLOCK_CONF_SECOND
ban4jp 0:685224d2f66d 82 #else
ban4jp 0:685224d2f66d 83 #define CLOCK_SECOND (clock_time_t)32
ban4jp 0:685224d2f66d 84 #endif
ban4jp 0:685224d2f66d 85
ban4jp 0:685224d2f66d 86 #endif /* __CLOCK_H__ */
ban4jp 0:685224d2f66d 87
ban4jp 0:685224d2f66d 88 /** @} */