Twitter client, with TextLCD, Ethernet Connection, and USB Host for keyboard.

Dependencies:   EthernetNetIf TextLCD mbed

Committer:
blmarket
Date:
Thu Apr 21 05:54:26 2011 +0000
Revision:
0:70571fd24107
Initial Release

Who changed what in which revision?

UserRevisionLine numberNew contents of line
blmarket 0:70571fd24107 1
blmarket 0:70571fd24107 2 typedef unsigned char u8;
blmarket 0:70571fd24107 3 typedef unsigned short u16;
blmarket 0:70571fd24107 4 typedef unsigned long u32;
blmarket 0:70571fd24107 5
blmarket 0:70571fd24107 6 void DelayMS(int ms);
blmarket 0:70571fd24107 7
blmarket 0:70571fd24107 8 void printfBytes(const char* label,const u8* data, int len);
blmarket 0:70571fd24107 9 void printHex(const u8* d, int len);
blmarket 0:70571fd24107 10
blmarket 0:70571fd24107 11 #ifndef min
blmarket 0:70571fd24107 12 #define min(_a,_b) ((_a) < (_b) ? (_a) : (_b))
blmarket 0:70571fd24107 13 #endif
blmarket 0:70571fd24107 14
blmarket 0:70571fd24107 15 inline int LE16(const u8* d)
blmarket 0:70571fd24107 16 {
blmarket 0:70571fd24107 17 return d[0] | (d[1] << 8);
blmarket 0:70571fd24107 18 }
blmarket 0:70571fd24107 19
blmarket 0:70571fd24107 20 inline u32 BE32(const u8* d)
blmarket 0:70571fd24107 21 {
blmarket 0:70571fd24107 22 return (d[0] << 24) | (d[1] << 16) | (d[2] << 8) | d[3];
blmarket 0:70571fd24107 23 }
blmarket 0:70571fd24107 24
blmarket 0:70571fd24107 25 inline void BE32(u32 n, u8* d)
blmarket 0:70571fd24107 26 {
blmarket 0:70571fd24107 27 d[0] = (u8)(n >> 24);
blmarket 0:70571fd24107 28 d[1] = (u8)(n >> 16);
blmarket 0:70571fd24107 29 d[2] = (u8)(n >> 8);
blmarket 0:70571fd24107 30 d[3] = (u8)n;
blmarket 0:70571fd24107 31 }
blmarket 0:70571fd24107 32
blmarket 0:70571fd24107 33 inline void BE16(u32 n, u8* d)
blmarket 0:70571fd24107 34 {
blmarket 0:70571fd24107 35 d[0] = (u8)(n >> 8);
blmarket 0:70571fd24107 36 d[1] = (u8)n;
blmarket 0:70571fd24107 37 }