MPL115A2 library

Dependents:   mbed_MPL115

See http://developer.mbed.org/users/yasuyuki/notebook/MPL115A2/

Committer:
yasuyuki
Date:
Thu Oct 16 16:19:40 2014 +0000
Revision:
1:12912b2da7d9
Parent:
0:ae28484ad07d
fix

Who changed what in which revision?

UserRevisionLine numberNew contents of line
yasuyuki 0:ae28484ad07d 1 //**********************
yasuyuki 0:ae28484ad07d 2 // typedef for mbed
yasuyuki 0:ae28484ad07d 3 //
yasuyuki 0:ae28484ad07d 4 // Condition:
yasuyuki 0:ae28484ad07d 5 //
yasuyuki 0:ae28484ad07d 6 // (C)Copyright 2014 All rights reserved by Y.Onodera
yasuyuki 0:ae28484ad07d 7 // http://einstlab.web.fc2.com
yasuyuki 0:ae28484ad07d 8 //**********************
yasuyuki 0:ae28484ad07d 9 #ifndef TYPEDEF_H
yasuyuki 0:ae28484ad07d 10 #define TYPEDEF_H
yasuyuki 0:ae28484ad07d 11
yasuyuki 0:ae28484ad07d 12 typedef unsigned char BYTE; /* 8-bit unsigned */
yasuyuki 0:ae28484ad07d 13 typedef unsigned short int WORD; /* 16-bit unsigned */
yasuyuki 0:ae28484ad07d 14 typedef unsigned int DWORD; /* 32-bit unsigned */
yasuyuki 0:ae28484ad07d 15 typedef unsigned long long QWORD; /* 64-bit unsigned */
yasuyuki 0:ae28484ad07d 16
yasuyuki 0:ae28484ad07d 17
yasuyuki 0:ae28484ad07d 18 typedef union
yasuyuki 0:ae28484ad07d 19 {
yasuyuki 0:ae28484ad07d 20 WORD Val;
yasuyuki 0:ae28484ad07d 21 BYTE v[2];
yasuyuki 0:ae28484ad07d 22 short S;
yasuyuki 0:ae28484ad07d 23 struct
yasuyuki 0:ae28484ad07d 24 {
yasuyuki 0:ae28484ad07d 25 BYTE LB;
yasuyuki 0:ae28484ad07d 26 BYTE HB;
yasuyuki 0:ae28484ad07d 27 } byte;
yasuyuki 0:ae28484ad07d 28 } WORD_VAL;
yasuyuki 0:ae28484ad07d 29
yasuyuki 0:ae28484ad07d 30 typedef union
yasuyuki 0:ae28484ad07d 31 {
yasuyuki 0:ae28484ad07d 32 DWORD Val;
yasuyuki 0:ae28484ad07d 33 WORD w[2];
yasuyuki 0:ae28484ad07d 34 BYTE v[4];
yasuyuki 0:ae28484ad07d 35 struct
yasuyuki 0:ae28484ad07d 36 {
yasuyuki 0:ae28484ad07d 37 WORD LW;
yasuyuki 0:ae28484ad07d 38 WORD HW;
yasuyuki 0:ae28484ad07d 39 } word;
yasuyuki 0:ae28484ad07d 40 struct
yasuyuki 0:ae28484ad07d 41 {
yasuyuki 0:ae28484ad07d 42 BYTE LB;
yasuyuki 0:ae28484ad07d 43 BYTE HB;
yasuyuki 0:ae28484ad07d 44 BYTE UB;
yasuyuki 0:ae28484ad07d 45 BYTE MB;
yasuyuki 0:ae28484ad07d 46 } byte;
yasuyuki 0:ae28484ad07d 47 struct
yasuyuki 0:ae28484ad07d 48 {
yasuyuki 0:ae28484ad07d 49 WORD_VAL low;
yasuyuki 0:ae28484ad07d 50 WORD_VAL high;
yasuyuki 0:ae28484ad07d 51 }wordUnion;
yasuyuki 0:ae28484ad07d 52
yasuyuki 0:ae28484ad07d 53 } DWORD_VAL;
yasuyuki 0:ae28484ad07d 54
yasuyuki 0:ae28484ad07d 55 #endif /* TYPEDEF_H */