From 33613a85afc4b1481367fbe92a17ee59c240250b Mon Sep 17 00:00:00 2001 From: Sven Eisenhauer Date: Fri, 10 Nov 2023 15:11:48 +0100 Subject: add new repo --- Master/Embedded Frameworks/CGlobal.h | 48 ++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Master/Embedded Frameworks/CGlobal.h (limited to 'Master/Embedded Frameworks/CGlobal.h') 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 -- cgit v1.2.3