Read NTP time from Ethernet and drive six 7-segment LEDs using a MAX7221 to show time, date, month, week, year etc....

Dependencies:   NTPClient_NetServices mbed

Committer:
cheungderek
Date:
Wed Jun 22 01:31:47 2011 +0000
Revision:
0:e083abcfe7a8
First release.
Just some testing but working code to read NTP time and drive 6 LEDs to display time, date, month, year etc...

Who changed what in which revision?

UserRevisionLine numberNew contents of line
cheungderek 0:e083abcfe7a8 1 /*****************************************************************************
cheungderek 0:e083abcfe7a8 2 * magic.h - Network Random Number Generator header file.
cheungderek 0:e083abcfe7a8 3 *
cheungderek 0:e083abcfe7a8 4 * Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc.
cheungderek 0:e083abcfe7a8 5 * portions Copyright (c) 1997 Global Election Systems Inc.
cheungderek 0:e083abcfe7a8 6 *
cheungderek 0:e083abcfe7a8 7 * The authors hereby grant permission to use, copy, modify, distribute,
cheungderek 0:e083abcfe7a8 8 * and license this software and its documentation for any purpose, provided
cheungderek 0:e083abcfe7a8 9 * that existing copyright notices are retained in all copies and that this
cheungderek 0:e083abcfe7a8 10 * notice and the following disclaimer are included verbatim in any
cheungderek 0:e083abcfe7a8 11 * distributions. No written agreement, license, or royalty fee is required
cheungderek 0:e083abcfe7a8 12 * for any of the authorized uses.
cheungderek 0:e083abcfe7a8 13 *
cheungderek 0:e083abcfe7a8 14 * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR
cheungderek 0:e083abcfe7a8 15 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
cheungderek 0:e083abcfe7a8 16 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
cheungderek 0:e083abcfe7a8 17 * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
cheungderek 0:e083abcfe7a8 18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
cheungderek 0:e083abcfe7a8 19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
cheungderek 0:e083abcfe7a8 20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
cheungderek 0:e083abcfe7a8 21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
cheungderek 0:e083abcfe7a8 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
cheungderek 0:e083abcfe7a8 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
cheungderek 0:e083abcfe7a8 24 *
cheungderek 0:e083abcfe7a8 25 ******************************************************************************
cheungderek 0:e083abcfe7a8 26 * REVISION HISTORY
cheungderek 0:e083abcfe7a8 27 *
cheungderek 0:e083abcfe7a8 28 * 03-01-01 Marc Boucher <marc@mbsi.ca>
cheungderek 0:e083abcfe7a8 29 * Ported to lwIP.
cheungderek 0:e083abcfe7a8 30 * 97-12-04 Guy Lancaster <glanca@gesn.com>, Global Election Systems Inc.
cheungderek 0:e083abcfe7a8 31 * Original derived from BSD codes.
cheungderek 0:e083abcfe7a8 32 *****************************************************************************/
cheungderek 0:e083abcfe7a8 33 /*
cheungderek 0:e083abcfe7a8 34 * magic.h - PPP Magic Number definitions.
cheungderek 0:e083abcfe7a8 35 *
cheungderek 0:e083abcfe7a8 36 * Copyright (c) 1989 Carnegie Mellon University.
cheungderek 0:e083abcfe7a8 37 * All rights reserved.
cheungderek 0:e083abcfe7a8 38 *
cheungderek 0:e083abcfe7a8 39 * Redistribution and use in source and binary forms are permitted
cheungderek 0:e083abcfe7a8 40 * provided that the above copyright notice and this paragraph are
cheungderek 0:e083abcfe7a8 41 * duplicated in all such forms and that any documentation,
cheungderek 0:e083abcfe7a8 42 * advertising materials, and other materials related to such
cheungderek 0:e083abcfe7a8 43 * distribution and use acknowledge that the software was developed
cheungderek 0:e083abcfe7a8 44 * by Carnegie Mellon University. The name of the
cheungderek 0:e083abcfe7a8 45 * University may not be used to endorse or promote products derived
cheungderek 0:e083abcfe7a8 46 * from this software without specific prior written permission.
cheungderek 0:e083abcfe7a8 47 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
cheungderek 0:e083abcfe7a8 48 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
cheungderek 0:e083abcfe7a8 49 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
cheungderek 0:e083abcfe7a8 50 *
cheungderek 0:e083abcfe7a8 51 * $Id: magic.h,v 1.3 2010/01/18 20:49:43 goldsimon Exp $
cheungderek 0:e083abcfe7a8 52 */
cheungderek 0:e083abcfe7a8 53
cheungderek 0:e083abcfe7a8 54 #ifndef MAGIC_H
cheungderek 0:e083abcfe7a8 55 #define MAGIC_H
cheungderek 0:e083abcfe7a8 56
cheungderek 0:e083abcfe7a8 57 /* Initialize the magic number generator */
cheungderek 0:e083abcfe7a8 58 void magicInit(void);
cheungderek 0:e083abcfe7a8 59
cheungderek 0:e083abcfe7a8 60 /* Returns the next magic number */
cheungderek 0:e083abcfe7a8 61 u32_t magic(void);
cheungderek 0:e083abcfe7a8 62
cheungderek 0:e083abcfe7a8 63 #endif /* MAGIC_H */