This short program illustrates how to use the DS130x_I2C library. My objective is to share the same RTC with Microchip 18F MCU.

Dependencies:   mbed DebugLibrary

Committer:
Yann
Date:
Wed Feb 09 13:57:49 2011 +0000
Revision:
0:f30e2135b0db
V0.0.0.1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Yann 0:f30e2135b0db 1 /*
Yann 0:f30e2135b0db 2 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
Yann 0:f30e2135b0db 3 * All rights reserved.
Yann 0:f30e2135b0db 4 *
Yann 0:f30e2135b0db 5 * Redistribution and use in source and binary forms, with or without modification,
Yann 0:f30e2135b0db 6 * are permitted provided that the following conditions are met:
Yann 0:f30e2135b0db 7 *
Yann 0:f30e2135b0db 8 * 1. Redistributions of source code must retain the above copyright notice,
Yann 0:f30e2135b0db 9 * this list of conditions and the following disclaimer.
Yann 0:f30e2135b0db 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
Yann 0:f30e2135b0db 11 * this list of conditions and the following disclaimer in the documentation
Yann 0:f30e2135b0db 12 * and/or other materials provided with the distribution.
Yann 0:f30e2135b0db 13 * 3. The name of the author may not be used to endorse or promote products
Yann 0:f30e2135b0db 14 * derived from this software without specific prior written permission.
Yann 0:f30e2135b0db 15 *
Yann 0:f30e2135b0db 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
Yann 0:f30e2135b0db 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
Yann 0:f30e2135b0db 18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
Yann 0:f30e2135b0db 19 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
Yann 0:f30e2135b0db 20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
Yann 0:f30e2135b0db 21 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
Yann 0:f30e2135b0db 22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
Yann 0:f30e2135b0db 23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
Yann 0:f30e2135b0db 24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
Yann 0:f30e2135b0db 25 * OF SUCH DAMAGE.
Yann 0:f30e2135b0db 26 *
Yann 0:f30e2135b0db 27 * This file is part of the lwIP TCP/IP stack.
Yann 0:f30e2135b0db 28 *
Yann 0:f30e2135b0db 29 * Author: Adam Dunkels <adam@sics.se>
Yann 0:f30e2135b0db 30 *
Yann 0:f30e2135b0db 31 */
Yann 0:f30e2135b0db 32 #ifndef __LWIP_INIT_H__
Yann 0:f30e2135b0db 33 #define __LWIP_INIT_H__
Yann 0:f30e2135b0db 34
Yann 0:f30e2135b0db 35 #include "lwip/opt.h"
Yann 0:f30e2135b0db 36
Yann 0:f30e2135b0db 37 #ifdef __cplusplus
Yann 0:f30e2135b0db 38 extern "C" {
Yann 0:f30e2135b0db 39 #endif
Yann 0:f30e2135b0db 40
Yann 0:f30e2135b0db 41 /** X.x.x: Major version of the stack */
Yann 0:f30e2135b0db 42 #define LWIP_VERSION_MAJOR 1U
Yann 0:f30e2135b0db 43 /** x.X.x: Minor version of the stack */
Yann 0:f30e2135b0db 44 #define LWIP_VERSION_MINOR 4U
Yann 0:f30e2135b0db 45 /** x.x.X: Revision of the stack */
Yann 0:f30e2135b0db 46 #define LWIP_VERSION_REVISION 0U
Yann 0:f30e2135b0db 47 /** For release candidates, this is set to 1..254
Yann 0:f30e2135b0db 48 * For official releases, this is set to 255 (LWIP_RC_RELEASE)
Yann 0:f30e2135b0db 49 * For development versions (CVS), this is set to 0 (LWIP_RC_DEVELOPMENT) */
Yann 0:f30e2135b0db 50 #define LWIP_VERSION_RC 1U
Yann 0:f30e2135b0db 51
Yann 0:f30e2135b0db 52 /** LWIP_VERSION_RC is set to LWIP_RC_RELEASE for official releases */
Yann 0:f30e2135b0db 53 #define LWIP_RC_RELEASE 255U
Yann 0:f30e2135b0db 54 /** LWIP_VERSION_RC is set to LWIP_RC_DEVELOPMENT for CVS versions */
Yann 0:f30e2135b0db 55 #define LWIP_RC_DEVELOPMENT 0U
Yann 0:f30e2135b0db 56
Yann 0:f30e2135b0db 57 #define LWIP_VERSION_IS_RELEASE (LWIP_VERSION_RC == LWIP_RC_RELEASE)
Yann 0:f30e2135b0db 58 #define LWIP_VERSION_IS_DEVELOPMENT (LWIP_VERSION_RC == LWIP_RC_DEVELOPMENT)
Yann 0:f30e2135b0db 59 #define LWIP_VERSION_IS_RC ((LWIP_VERSION_RC != LWIP_RC_RELEASE) && (LWIP_VERSION_RC != LWIP_RC_DEVELOPMENT))
Yann 0:f30e2135b0db 60
Yann 0:f30e2135b0db 61 /** Provides the version of the stack */
Yann 0:f30e2135b0db 62 #define LWIP_VERSION (LWIP_VERSION_MAJOR << 24 | LWIP_VERSION_MINOR << 16 | \
Yann 0:f30e2135b0db 63 LWIP_VERSION_REVISION << 8 | LWIP_VERSION_RC)
Yann 0:f30e2135b0db 64
Yann 0:f30e2135b0db 65 /* Modules initialization */
Yann 0:f30e2135b0db 66 void lwip_init(void);
Yann 0:f30e2135b0db 67
Yann 0:f30e2135b0db 68 #ifdef __cplusplus
Yann 0:f30e2135b0db 69 }
Yann 0:f30e2135b0db 70 #endif
Yann 0:f30e2135b0db 71
Yann 0:f30e2135b0db 72 #endif /* __LWIP_INIT_H__ */