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
|
#ifndef WASTE_H
#define WASTE_H
#include "drivers/I2C_Communication/ADC_MUX/ADC_MUX.h"
#define temp_funcion 0
#define notOK 1
/*
#define SENSORFULL 1
#define SENSOROVERFLOW 1
#define SENSOREMPTY 0
#define SENSORnotFULL 0
#define SENSORnotOVERFLOW 0
#define SENSORnotEMPTY 1
*/
#define PUMPON 1
#define PUMPOFF 0
#define PRECENSE 1
#define NOTPRECENSE 0
typedef unsigned char U8;
typedef enum
{
BLACK,
CYAN,
MAGENTA,
YELLOW,
TRANSPARENT,
SP_1,
CLEANER,
LUBRICANT
} CMYK_color;
typedef enum
{
CarteidgeNotPrecense = 0,
CarteidgePrecense
} CarteidgPrecenseSensorStatus; //WHS_CarteidgPrecenseSensorStatus;
typedef enum
{
WHS_CartridgeCoverCLOSE = 0,
WHS_CartridgeCoverOPEN
} WHS_CarteidgeCoverSensorStatus;
typedef enum
{
SENSORFULL = 0,
SENSORnotFULL
} WHS_FullSensorStatus;
typedef enum
{
SENSORnotEMPTY = 0,
SENSOREMPTY
} WHS_EmptySensorStatus;
typedef enum
{
WHS_empty = 0,
WHS_filling,
WHS_emptying,
WHS_full,
WHS_overflow,
WHS_sttError
} WHS_sttMachin;
typedef enum
{
WHS_no_event = 0,
WHS_overflow_sensor,
WHS_full_sensor,
WHS_empty_sensor,
IFS_INK_presence_sensor,
IFS_INK_authentication_pass,
IFS_INK_authentication_fail,
WHS_waste1_presence_sensor,
WHS_waste2_presence_sensor,
WHS_filter_sensor,
WHS_cartridge_cover_sensor,
WHS_Timeout,
IFS_Timeout,
IFS_Timeout_Second,
IFS_MidTankFull
} WHS_sensor;
typedef enum
{
// WasteEmpty = 0,
// WasteFilling,
// WasteFail,
ColorFull = 0,
ColorUsed,
WasteEmpty,
WasteFilling,
WasteFull,
WasteFail
} cartridge_status;
typedef enum
{
led_on = 0,
led_off,
led_blink,
led_panic
} led_status;
typedef enum
{
no_waste_cartridge = 0,
INK_cartridge ,
waste_cartridge1 ,
waste_cartridge2
} cartridge_name;
typedef enum
{
VALVE_DIR_WASTE_CARTRIDGE1 = 0,
VALVE_DIR_WASTE_CARTRIDGE2
} valve_cartridge_name;
struct WHS_sensors_status
{
WHS_CarteidgeCoverSensorStatus cartridge_cover; /*open(1) ,close(0) */
// WHS_CarteidgPrecenseSensorStatus IFS_Ink_precense_sensor; /*presence(1) ,not_precense(0) */
// bool IFS_Ink_precense_sensor_flag; /* 1=event 0=no enent */
CarteidgPrecenseSensorStatus waste_cartridge1_precense_sensor; /*presence(1) ,not_precense(0) */
bool waste_cartridge1_precense_sensor_flag; /* 1=event 0=no enent */
CarteidgPrecenseSensorStatus waste_cartridge2_precense_sensor; /*presence(1) ,not_precense(0) */
bool waste_cartridge2_precense_sensor_flag; /* 1=event 0=no enent */
bool waste_tank_filter_sensor; /*presence(1) ,not_precense(0) */
WHS_EmptySensorStatus waste_tank_empty_sensor; /*enpty(1) ,not_empty(0) */
WHS_FullSensorStatus waste_tank_full_sensor; /*full(1) ,not_full(0) */
bool waste_tank_over_flow_sensor; /*over_flow(1) ,not_over_flow(0) */
};
struct cartridge_params
{
uint32_t serial_number;
cartridge_status status; /*WasteEmpty, WasteFilling, WasteFail, WasteFull....... */
MidTank_t cart_color;
bool autheticate;
uint32_t time_out;
};
struct pump_params
{
bool status;
uint32_t time;
};
struct WHS_information
{
WHS_sttMachin sttMachine;
struct cartridge_params cartridge_1, cartridge_2;
struct WHS_sensors_status WHS_sensors;
struct pump_params WHS_pump;
valve_cartridge_name WHS_valve;
WHS_sensor event;
cartridge_name active_cartridge;
uint32_t Cartridge_Ink_device_Id;
uint32_t Cartridge_Ink_TimeOut_device_Id;
uint32_t Cartridge_Waste1_device_Id;
uint32_t Cartridge_Waste2_device_Id;
uint32_t Cartridge_Cover_device_Id;
//PBcolor Ink_Led, cartridge_1_Led, cartridge_2_Led;
double MidTank_capacity;
};
struct WHS_information WHS_info;
U8 WHS_init(void);
U8 WHS_HW_test(void);
bool WHS_IsEmptying();
bool WHS_IsContainerFull();
bool WHS_IsContainerEmpty();
bool WHS_IsContainerOverflow();
bool WHS_WasteCartridgeLowerPresent();
bool WHS_WasteCartridgeMiddlePresent();
bool WHS_IsPumpActive();
bool WHS_IsValveOpen();
bool SetWastePump( bool power);
void midtanktest6_ON();
void midtanktest6_OFF();
//bool CartridgeValidationResponseFunc(MessageContainer* requestContainer);
//void ResponseDemo(int MidtankId);
bool RdInkCartridgeSensor();
bool WasteTankCBFunction();
#endif
|