mbed OS5

Fork of UIPEthernet by Zoltan Hudak

Committer:
pilotak
Date:
Sun Aug 06 16:01:26 2017 +0000
Revision:
9:e55652bed36c
Parent:
8:4acb22344932
mBed OS5

Who changed what in which revision?

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