brazos-trapezoidal
C_Extensions.h
Go to the documentation of this file.
1
6#ifndef C_EXTENSIONS_H // Insure this file is not compiled again
7 #define C_EXTENSIONS_H // after we compile it the first time
8
9//=====================================================================================================================
10//-------------------------------------- PUBLIC (Extern Variables, Constants & Defines) -------------------------------
11//=====================================================================================================================
12// ============================================================
13// --------------- STANDARD SYSTEM DEFINITIONS ----------------
14// ------------------------------------------------------------
15typedef enum _BOOL_TYPE
16{
17 FALSE = 0,
18 TRUE = 1
19} BOOL_TYPE;
20
21typedef BOOL_TYPE T_BOOL;
22
23typedef enum _PASS_FAIL_TYPE
24{
25 FAIL = 0,
26 PASS = 1
27} PASS_FAIL_TYPE;
28
29#define OK ((PASS_FAIL_TYPE)1)
30
31typedef enum _COMPLETE_TYPE
32{
33 INCOMPLETE = 0,
34 COMPLETE = 1
35} COMPLETE_TYPE;
36
37typedef enum _ACTIVE_TYPE
38{
39 INACTIVE = 0,
40 ACTIVE = 1
41} ACTIVE_TYPE;
42
43
44#ifndef ENABLED
45 #define ENABLED (1)
46#endif
47
48#ifndef DISABLED
49 #define DISABLED (0)
50#endif
51
52#ifndef NULL
53 #define NULL (void *)0
54#endif
55
56#ifndef UNAVAILABLE
57 #define UNAVAILABLE (10)
58#endif
59
60#ifndef AVAILABLE
61 #define AVAILABLE (11)
62#endif
63
64// ============================================================
65// ------------------- BYTE AND WORD ACCESS -------------------
66// ------------------------------------------------------------
67#define LOWORD(mem) (unsigned short)((mem)&0xFFFFU)
68#define LOBYTE(mem) (unsigned char)((mem)&0xFFU)
69#define HIWORD(mem) (unsigned short)(( (unsigned long)(mem) >> 16U ) & 0xFFFFU)
70#define HIBYTE(mem) (unsigned char)(( (unsigned short)(mem) >> 8U) & 0xFFU)
71// ============================================================
72// --------------------- BIT MANIPULATION ---------------------
73// ------------------------------------------------------------
74#define BIT_TEST(mem,bit) ((mem)&(1UL<<(bit)))
75#define BIT_SET(mem,bit) ((mem)|=(1UL<<(bit)))
76#define BIT_CLR(mem,bit) ((mem)&=~(1UL<<(bit)))
77#define BIT_TOGGLE(mem,bit) ((mem)^=(1UL<<(bit)))
78
79#include "Compiler_defs.h"
80#include "C_Extensions_prm.h"
81
82#endif
83
Basic description of file contents.