all_share.h
8.03 KB
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
//------------------------------------------------------------------------------
// 화일명 : all_share.h
// 프로젝트 :
// 설 명 : 공유 메모리 구조체를 선언한다.
//
// 저작권 : FA리눅스주식회사
// 주 의 :
//------------------------------------------------------------------------------
#ifndef _ALL__SHARE_HEADER_
#define _ALL__SHARE_HEADER_
#define STRUCT_PACK __attribute__ ((packed))
#define SHM_METER_KEY 0xFA1234
#define TRUE 1
#define FALSE 0
#define SWITCH_ON 1
#define SWITCH_OFF 0
typedef unsigned char U8;
typedef unsigned short U16;
typedef unsigned int U32;
typedef unsigned long long U64;
typedef signed short I16;
enum command_enum_t {
CMD_VALUE = 0, // 오븐 값 변경
CMD_ONOFF, // 오븐 스위치 ON/OFF
CMD_CLEAR_ERROR_CNT // 에러 카운트를 초기화
};
enum target_value_t {
TG_OVEN_MODE = 0,
TG_HEAT,
TG_HUMIDITY,
TG_TIME,
TG_CONV_RPM,
TG_INNER_TEMP,
TG_COOK_MODE,
TG_CLEAN_TYPE,
TG_BUNNER1_RPM,
TG_BUNNER2_RPM,
TG_BUNNER3_RPM,
TG_FAN1_RPM,
TG_FAN2_RPM,
TG_FAN1_DIRECTOIN,
TG_FAN2_DIRECTOIN,
TG_BURNER1_1_RPM,
TG_BURNER1_2_RPM,
TG_BURNER23_1_RPM,
TG_BURNER23_2_RPM,
TG_PRODUCT_TYPE,
TG_MODEL_TYPE,
TG_ERROR_CLEAR
};
enum target_onoff_t {
TG_COOKING = 0,
TG_CLEANING,
TG_SYSTEM,
TG_PREHEAT,
TG_OUTHUMIDITY,
TG_INNERWATER,
TG_COOLDOWN,
TG_BITONOFF, //
TG_MANUAL_BURNER1,
TG_MANUAL_BURNER2,
TG_MANUAL_BURNER3,
TG_MANUAL_FAN1,
TG_MANUAL_FAN2,
TG_MANUAL_RELAY,
TG_BUNNER1_MANUAL,
TG_BUNNER2_MANUAL,
TG_BUNNER3_MANUAL,
TG_BUNNER1_FAN,
TG_BUNNER2_FAN,
TG_BUNNER3_FAN,
TG_FAN1_MANUAL,
TG_FAN2_MANUAL,
TG_DV,
TG_CFAN,
TG_WSV,
TG_QNV,
TG_SSV,
TG_SNV,
TG_HL,
TG_DP,
TG_SSP,
TG_UNP,
TG_HDM,
TG_SGNV
};
enum {
HDR_OVEN_CONTROL = 0, // 40000 번지 값, 컨트롤 제어
HDR_OVEN_STATE, // 30000 번지 값, 오븐 상태
HDR_ERROR_CODE // 에러 코드
};
enum {
ERR_SEND_COMMAND = 0, // 명령 전송에 대한 응답이 없음
ERR_RECEIVE_80 // 0x80 코드를 수신했음
};
//
// 시스템 전체 공유 구조체 구조체
//
typedef struct
{
int cmd;
int target;
int value;
} STRUCT_PACK command_t;
typedef struct {
U16 reserved00; // 00
U16 reserved01; // 01
U16 reserved02; // 02
U16 reserved03; // 03
U16 reserved04; // 04
U16 oven_mode; // 05
U16 cooking; // 06
U16 cleaning; // 07
U16 system; // 08
I16 heat; // 09
U16 humidity; // 0A
U16 time; // 0B
U16 preheat; // 0C
U16 outhumidity; // 0D
U16 innerwater; // 0E
U16 conv_rpm; // 0F
U16 cooldown; // 10
I16 inner_temp; // 11
U16 reserved12; // 12
U16 cook_mode; // 13
U16 clean_type; // 14
U16 clean_total; // 15
U16 clean_step; // 16
U16 clean_step_type; // 17
U16 reserved18; // 18
U16 manual_auto; // 19
U16 bunner1_rpm; // 1A
U16 bunner2_rpm; // 1B
U16 bunner3_rpm; // 1C
U16 fan1_rpm; // 1D
U16 fan2_rpm; // 1E
U16 fan1_direction; // 1F
U16 fan2_direction; // 20
U16 manual_onoff21; // 21
U16 manual_onoff22; // 22
U16 reserved23; // 23
U16 reserved24; // 24
U16 reserved25; // 25
U16 reserved26; // 26
U16 reserved27; // 27
U16 burner1_1_rpm; // 28
U16 burner1_2_rpm; // 29
U16 burner23_1_rpm; // 2A
U16 burner23_2_rpm; // 2B
U16 product_type; // 2C
U16 model_type; // 2D
U16 reserved2e; // 2E
U16 reserved2f; // 2F
U16 reserved30; // 30
U16 error_clear; // 31
} STRUCT_PACK oven_control_t;
typedef struct {
U16 firmware_version; // 00
U16 firmware_year; // 01
U16 firmware_month; // 02
U16 firmware_day; // 03
U16 cooking_mode; // 04
I16 cooking_heat; // 05
U16 cooking_humidity; // 06
U16 cooking_time; // 07
I16 curr_heat; // 08
U16 curr_humidity; // 09
U16 curr_time; // 0A
U16 cleaning_sate; // 0B
U16 cleaning_mode; // 0C
U16 cleaning_statge; // 0D
U16 cleaning_sec; // 0E
U16 cleaning_min; // 0F
U16 door_state; // 10
U16 reserved11; // 11
U16 burner1_rpm; // 12
U16 burner2_rpm; // 13
U16 burner3_rpm; // 14
U16 fan1_rpm; // 15
U16 fan2_rpm; // 16
U16 fan1_direction; // 17
U16 fan2_direction; // 18
U16 onoff_state1; // 19
U16 onoff_state2; // 1A
I16 sensor1; // 1B
I16 sensor2; // 1C
I16 sensor3; // 1D
I16 sensor4; // 1E
I16 sensor5; // 1F
I16 sensor6; // 20
I16 sensor7; // 21
I16 sensor8; // 22
I16 sensor9; // 23
I16 sensor10; // 24
U16 sensor11; // 25
U16 sensor12; // 26
I16 sensor13; // 27
I16 sensor14; // 28
U16 sensor15; // 29
U16 sensor16; // 2A
U16 onoff_relay_load; // 2B
U16 reserved2c; // 2C
U16 reserved2d; // 2D
U16 system_error; // 2E
U16 communication_error; // 2F
U16 sensor_error; // 30
U16 reserved31; // 31
U16 burner1_ignition_rpm; // 32
U16 burner2_ignition_rpm; // 33
U16 burner3_ignition_rpm; // 34
U16 burner1_current_rpm; // 35
U16 burner2_current_rpm; // 36
U16 burner3_current_rpm; // 37
U16 controller_error; // 38
U16 error_cnt[16]; // 에러 카운트
} STRUCT_PACK oven_state_t;
typedef struct {
int header;
oven_control_t control;
} STRUCT_PACK gui_oven_control_t;
typedef struct {
int header;
oven_state_t state;
} STRUCT_PACK gui_oven_state_t;
typedef struct {
int header;
int code;
} STRUCT_PACK gui_error_t;
//------------------------------------------------------------------------------
//
// 프레임, 페이로드
//
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
//
// 전역 변수 정의
//
//------------------------------------------------------------------------------
#define INI_SYSTEM "system.ini"
#endif