AM2320 library
Dependents: mbed_AM2320 Fungi Fungi Nucleo_SSD1306_DS1302_ESP8266_AM2320_BME280 ... more
See http://developer.mbed.org/users/yasuyuki/notebook/AM2320/
Diff: typedef.h
- Revision:
- 0:2cb35c995095
- Child:
- 1:766868b34d56
diff -r 000000000000 -r 2cb35c995095 typedef.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/typedef.h Sat Mar 14 17:21:25 2015 +0000 @@ -0,0 +1,54 @@ +//********************** +// typedef for mbed +// +// Condition: +// +// (C)Copyright 2014 All rights reserved by Y.Onodera +// http://einstlab.web.fc2.com +//********************** +#ifndef TYPEDEF_H +#define TYPEDEF_H + +typedef unsigned char BYTE; /* 8-bit unsigned */ +typedef unsigned short int WORD; /* 16-bit unsigned */ +typedef unsigned int DWORD; /* 32-bit unsigned */ +typedef unsigned long long QWORD; /* 64-bit unsigned */ + + +typedef union +{ + WORD Val; + BYTE v[2]; + struct + { + BYTE LB; + BYTE HB; + } byte; +} WORD_VAL; + +typedef union +{ + DWORD Val; + WORD w[2]; + BYTE v[4]; + struct + { + WORD LW; + WORD HW; + } word; + struct + { + BYTE LB; + BYTE HB; + BYTE UB; + BYTE MB; + } byte; + struct + { + WORD_VAL low; + WORD_VAL high; + }wordUnion; + +} DWORD_VAL; + +#endif /* TYPEDEF_H */