MCP4726 library

Dependents:   mbed_MCP4726

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

Committer:
yasuyuki
Date:
Wed Oct 15 14:42:50 2014 +0000
Revision:
0:f0980556dfc0
first release

Who changed what in which revision?

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