diff options
| author | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
|---|---|---|
| committer | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
| commit | 33613a85afc4b1481367fbe92a17ee59c240250b (patch) | |
| tree | 670b842326116b376b505ec2263878912fca97e2 /Master/Embedded Frameworks/CGlobal.h | |
| download | Studium-33613a85afc4b1481367fbe92a17ee59c240250b.tar.gz Studium-33613a85afc4b1481367fbe92a17ee59c240250b.tar.bz2 | |
Diffstat (limited to 'Master/Embedded Frameworks/CGlobal.h')
| -rw-r--r-- | Master/Embedded Frameworks/CGlobal.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/Master/Embedded Frameworks/CGlobal.h b/Master/Embedded Frameworks/CGlobal.h new file mode 100644 index 0000000..eaa6d18 --- /dev/null +++ b/Master/Embedded Frameworks/CGlobal.h @@ -0,0 +1,48 @@ +#ifndef CGLOBAL_H
+#define CGLOBAL_H
+
+/***********************************************************************
+ * Project : Framework
+ *
+ * File : CGlobal.h
+ * Author : JW
+ * Date : 04.05.2006
+ ***********************************************************************/
+
+/**
+ *
+ * This file contains the common elementar data types used in the
+ * project. Using Int8, Int16 etc. help easiliy porting the codes.
+ * This file does not contain any specific hardware pins or ports
+ */
+
+// comment the line below to avoid including MOST-headers.
+// this could be used to compile the system library without MOST.
+#define USE_MOSTDRIVER
+
+// synonyme for elementar data types
+typedef signed char Int8;
+typedef unsigned char UInt8;
+typedef signed short Int16;
+typedef unsigned short UInt16;
+typedef signed int Int32;
+typedef unsigned int UInt32;
+
+
+// Definition für nullpointer und null character
+#define NULLPTR 0
+#define NULLCHAR 0
+
+// Macro used to round up the memory required due to the alignment
+#define MAKE_ALIGNMENT_SIZE(size) ((( (size) + (sizeof(Int32) - 1) ) \
+ / sizeof(Int32))*sizeof(Int32))
+
+// the follwing macros work for Little and Big-Endian
+#define MAKE_INT16(a,b) Int16( ((UInt16) a << 8) | UInt8(b) )
+#define MAKE_UINT16(a,b) UInt16( ((UInt16) a << 8) | UInt8(b) )
+
+#define LOW_BYTE(w) UInt8(w&0xFF)
+#define HIGH_BYTE(w) UInt8(w >> 8)
+
+
+#endif // CGLOBAL_H
|
