-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy patheb_common.h
148 lines (117 loc) · 3.16 KB
/
eb_common.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#ifndef EB_COMMON_H
#define EB_COMMON_H
#include <stdbool.h>
//#define EASYBENCH_VERSION "v1.0.0"
#define MAJOR_VERSION 1
#define MINOR_VERSION 0
#define PATCH_VERSION 0
#define DEFAULT_FILE "/var/run/easybench.pid"
#define PCB_TCP_SERVER_IP "192.168.3.188"
#define PCB_TCP_SERVER_PORT 8000
#define SINGLETON 1
#define QT_VERSION_4 0 /* Recommend to use Qt5 strongly */
#define QT_VERSION_5 1
#define SEAT_TEST 1 /* All of configuration files use test files */
#define LANGUAGE_CHINESE 1 /* All the text show as Chinese, please always enable */
#define FIXED_WINDOWN 1 /* Fixed window size or not */
#define WINDOW_DESKTOP
/* #define WINDOW_EMBEDDED */
#if FIXED_WINDOWN
#define FIXED_WINDOWN_WIDTH 1024
#ifdef WINDOW_DESKTOP
#define FIXED_WINDOWN_HEIGHT 720
#else
#define FIXED_WINDOWN_HEIGHT 768
#endif
#endif
#define TITLE_HEIGHT 40
#define CONNECT_STM32 0 /* Connect to base board (STM32) via ethernet */
#ifdef GY_GLOBAL
#define GY_GLOBAL_EXT
#else
#define GY_GLOBAL_EXT extern
#endif
typedef enum TouchType{
TOUCH_NONE = 0,
TOUCH_RESISTIVE,
TOUCH_CAPACITIVE,
TOUCH_OTHER
}TouchType;
//GY_GLOBAL_EXT TouchType TOUCH_TYPE;
//GY_GLOBAL_EXT bool HAS_EEPROM;
//GY_GLOBAL_EXT char gMachineTypeStr[80];
GY_GLOBAL_EXT char gSerialPortStr[32];
//GY_GLOBAL_EXT char gVideoInputStr[32];
//GY_GLOBAL_EXT char BACKLIGHT_NAME[32];
//GY_GLOBAL_EXT unsigned int LCD_WIDTH;
//GY_GLOBAL_EXT unsigned int LCD_HEIGHT;
typedef struct Audio_Parameter {
int frame_size;
int max_frame_size;
int sample_rate;
int buffer_size_ratio;
} Audio_Parameter;
#pragma pack(push)
#pragma pack(1)
typedef struct applyCMD {
unsigned char head;
unsigned char size;
unsigned char type;
unsigned char snum;
unsigned char cmdw;
unsigned char csum;
unsigned char tail;
}applyCMD;
typedef struct controlCMD {
unsigned char head;
unsigned char size;
unsigned char type;
unsigned char snum;
unsigned char cmdw;
unsigned char mode; // 0x00: Standard, 0x01: Debug
unsigned char reserve1[2];
float fanSpeed;
unsigned char reserve2[4];
unsigned char csum;
unsigned char tail;
}controlCMD;
typedef struct readStatusCMD {
unsigned char head;
unsigned char size;
unsigned char type;
unsigned char snum;
unsigned char cmdw;
unsigned char serialStatus; // 0x00: Abnormal, 0x01: Normal
unsigned char reserve1[2];
float temperature1;
float temperature2;
float fanSpeed;
unsigned char reserve2[2];
unsigned char csum;
unsigned char tail;
}readStatusCMD;
typedef struct readVersionCMD {
unsigned char head;
unsigned char size;
unsigned char type;
unsigned char snum;
unsigned char cmdw;
unsigned char reserve1[3];
unsigned char firmwareVer[4];
unsigned char hardwareVer[2];
unsigned char reserve2[2];
unsigned char reserve3[8];
unsigned char csum;
unsigned char tail;
}readVersionCMD;
#pragma pack(pop)
#ifdef __cplusplus
extern "C"{
#endif
unsigned char calcCheckSum(unsigned char *data, unsigned int len);
bool is_singleton(void);
int get_timezone(void);
#ifdef __cplusplus
}
#endif
#endif // EB_COMMON_H