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 ***********************************************************************
cheungderek 0:e083abcfe7a8 3 ** md5.h -- header file for implementation of MD5 **
cheungderek 0:e083abcfe7a8 4 ** RSA Data Security, Inc. MD5 Message-Digest Algorithm **
cheungderek 0:e083abcfe7a8 5 ** Created: 2/17/90 RLR **
cheungderek 0:e083abcfe7a8 6 ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version **
cheungderek 0:e083abcfe7a8 7 ** Revised (for MD5): RLR 4/27/91 **
cheungderek 0:e083abcfe7a8 8 ** -- G modified to have y&~z instead of y&z **
cheungderek 0:e083abcfe7a8 9 ** -- FF, GG, HH modified to add in last register done **
cheungderek 0:e083abcfe7a8 10 ** -- Access pattern: round 2 works mod 5, round 3 works mod 3 **
cheungderek 0:e083abcfe7a8 11 ** -- distinct additive constant for each step **
cheungderek 0:e083abcfe7a8 12 ** -- round 4 added, working mod 7 **
cheungderek 0:e083abcfe7a8 13 ***********************************************************************
cheungderek 0:e083abcfe7a8 14 */
cheungderek 0:e083abcfe7a8 15
cheungderek 0:e083abcfe7a8 16 /*
cheungderek 0:e083abcfe7a8 17 ***********************************************************************
cheungderek 0:e083abcfe7a8 18 ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. **
cheungderek 0:e083abcfe7a8 19 ** **
cheungderek 0:e083abcfe7a8 20 ** License to copy and use this software is granted provided that **
cheungderek 0:e083abcfe7a8 21 ** it is identified as the "RSA Data Security, Inc. MD5 Message- **
cheungderek 0:e083abcfe7a8 22 ** Digest Algorithm" in all material mentioning or referencing this **
cheungderek 0:e083abcfe7a8 23 ** software or this function. **
cheungderek 0:e083abcfe7a8 24 ** **
cheungderek 0:e083abcfe7a8 25 ** License is also granted to make and use derivative works **
cheungderek 0:e083abcfe7a8 26 ** provided that such works are identified as "derived from the RSA **
cheungderek 0:e083abcfe7a8 27 ** Data Security, Inc. MD5 Message-Digest Algorithm" in all **
cheungderek 0:e083abcfe7a8 28 ** material mentioning or referencing the derived work. **
cheungderek 0:e083abcfe7a8 29 ** **
cheungderek 0:e083abcfe7a8 30 ** RSA Data Security, Inc. makes no representations concerning **
cheungderek 0:e083abcfe7a8 31 ** either the merchantability of this software or the suitability **
cheungderek 0:e083abcfe7a8 32 ** of this software for any particular purpose. It is provided "as **
cheungderek 0:e083abcfe7a8 33 ** is" without express or implied warranty of any kind. **
cheungderek 0:e083abcfe7a8 34 ** **
cheungderek 0:e083abcfe7a8 35 ** These notices must be retained in any copies of any part of this **
cheungderek 0:e083abcfe7a8 36 ** documentation and/or software. **
cheungderek 0:e083abcfe7a8 37 ***********************************************************************
cheungderek 0:e083abcfe7a8 38 */
cheungderek 0:e083abcfe7a8 39
cheungderek 0:e083abcfe7a8 40 #ifndef MD5_H
cheungderek 0:e083abcfe7a8 41 #define MD5_H
cheungderek 0:e083abcfe7a8 42
cheungderek 0:e083abcfe7a8 43 /* Data structure for MD5 (Message-Digest) computation */
cheungderek 0:e083abcfe7a8 44 typedef struct {
cheungderek 0:e083abcfe7a8 45 u32_t i[2]; /* number of _bits_ handled mod 2^64 */
cheungderek 0:e083abcfe7a8 46 u32_t buf[4]; /* scratch buffer */
cheungderek 0:e083abcfe7a8 47 unsigned char in[64]; /* input buffer */
cheungderek 0:e083abcfe7a8 48 unsigned char digest[16]; /* actual digest after MD5Final call */
cheungderek 0:e083abcfe7a8 49 } MD5_CTX;
cheungderek 0:e083abcfe7a8 50
cheungderek 0:e083abcfe7a8 51 void MD5Init ( MD5_CTX *mdContext);
cheungderek 0:e083abcfe7a8 52 void MD5Update( MD5_CTX *mdContext, unsigned char *inBuf, unsigned int inLen);
cheungderek 0:e083abcfe7a8 53 void MD5Final ( unsigned char hash[], MD5_CTX *mdContext);
cheungderek 0:e083abcfe7a8 54
cheungderek 0:e083abcfe7a8 55 #endif /* MD5_H */