박영준 лет назад: 5
Родитель
Сommit
c17ac52a16

+ 1 - 0
.gitignore

@@ -1 +1,2 @@
1 1
 /Debug/
2
+insight

+ 2 - 2
.settings/language.settings.xml

@@ -4,7 +4,7 @@
4 4
 		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
5 5
 			<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
6 6
 			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
7
-			<provider class="com.atollic.truestudio.mbs.GCCSpecsDetectorAtollicArm" console="false" env-hash="-596634092969854633" id="com.atollic.truestudio.mbs.provider" keep-relative-paths="false" name="Atollic ARM Tools Language Settings" parameter="${COMMAND} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
7
+			<provider class="com.atollic.truestudio.mbs.GCCSpecsDetectorAtollicArm" console="false" env-hash="-1446200846035591216" id="com.atollic.truestudio.mbs.provider" keep-relative-paths="false" name="Atollic ARM Tools Language Settings" parameter="${COMMAND} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
8 8
 				<language-scope id="org.eclipse.cdt.core.gcc"/>
9 9
 				<language-scope id="org.eclipse.cdt.core.g++"/>
10 10
 			</provider>
@@ -14,7 +14,7 @@
14 14
 		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
15 15
 			<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
16 16
 			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
17
-			<provider class="com.atollic.truestudio.mbs.GCCSpecsDetectorAtollicArm" console="false" env-hash="-596634092969854633" id="com.atollic.truestudio.mbs.provider" keep-relative-paths="false" name="Atollic ARM Tools Language Settings" parameter="${COMMAND} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
17
+			<provider class="com.atollic.truestudio.mbs.GCCSpecsDetectorAtollicArm" console="false" env-hash="-1446200846035591216" id="com.atollic.truestudio.mbs.provider" keep-relative-paths="false" name="Atollic ARM Tools Language Settings" parameter="${COMMAND} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
18 18
 				<language-scope id="org.eclipse.cdt.core.gcc"/>
19 19
 				<language-scope id="org.eclipse.cdt.core.g++"/>
20 20
 			</provider>

+ 222 - 0
Bluecell_Inc/Bluecell_operate.h

@@ -87,6 +87,152 @@ typedef enum{
87 87
 	 * PayLoadSTART
88 88
 	 */
89 89
 };
90
+
91
+typedef enum{
92
+	Alarm_Bit_List = 0xE000,
93
+	Alarm_Mask,
94
+	Alarm_Test_Mode,
95
+	Alarm_Test_Dummy,
96
+	CPU_Version,
97
+	ModuleINFORMATION_null1,
98
+	CPU_Current_Bank,
99
+	CPU_Bank_Select_Reboot_by,
100
+	CPU_Bank1_Image_Version,
101
+	CPU_Bank1_Image_BuildTime,
102
+	CPU_Bank1_Image_Name,
103
+	CPU_Bank2_Image_Version,
104
+	CPU_Bank2_Image_BuildTime,
105
+	CPU_Bank2_Image_Name,
106
+	SW_Reset,
107
+	Factory_Set_Initialization,
108
+}ModuleINFORMATION;
109
+
110
+typedef enum{
111
+	Temperature = 0xE010,
112
+	Temperature_Offset,
113
+	Temp_High_Threshold,
114
+	Temp_High_Threshold_Default,
115
+	Temp_High_Alarm,
116
+	LED_TEST,
117
+	Node,
118
+	Type,
119
+	PCB_Version,
120
+	Serial_Number,
121
+	Manufacture,
122
+	Manufacture_Date,
123
+	ENVIRONMENT_INVENTORY_null1,
124
+	Freq_ID,
125
+	Carrier_ID,
126
+	Carrier_ON_OFF,
127
+}ENVIRONMENT_INVENTORY;
128
+
129
+
130
+typedef enum{
131
+	DLI_P1_Level= 0xE020,
132
+	DLI_P2_Level,
133
+	DLI_P3_Level,
134
+	DLI_P4_Level,
135
+	ULO_P1_Level,
136
+	ULO_P2_Level,
137
+	ULO_P3_Level,
138
+	ULO_P4_Level,
139
+}Current_Volt;
140
+typedef enum{
141
+	DLI_RF_Path1_ON_OFF= 0xE030,
142
+	DLI_RF_Path2_ON_OFF,
143
+	DLI_RF_Path3_ON_OFF,
144
+	DLI_RF_Path4_ON_OFF,
145
+	DLI_Gain_Atten1,
146
+	DLI_Gain_Atten2,
147
+	DLI_Gain_Atten3,
148
+	DLI_Gain_Atten4,
149
+	DLI_Gain_Atten_Offset1,
150
+	DLI_Gain_Atten_Offset2,
151
+	DLI_Gain_Atten_Offset3,
152
+	DLI_Gain_Atten_Offset4,
153
+	DLI_Level_High_Threshold,
154
+	DLI_Level_Low_Threshold,
155
+	DLI_Level_High_Low_Threshold_default,
156
+	DLI_Level,
157
+}DL_Ctrl1;
158
+typedef enum{
159
+	DLI_Level_High_Alarm1= 0xE040,
160
+	DLI_Level_High_Alarm2,
161
+	DLI_Level_High_Alarm3,
162
+	DLI_Level_High_Alarm4,
163
+	DLI_Level_Low_Alarm1,
164
+	DLI_Level_Low_Alarm2,
165
+	DLI_Level_Low_Alarm3,
166
+	DLI_Level_Low_Alarm4,
167
+}DL_Ctrl2;
168
+typedef enum{
169
+	DLI_AGC_ON_OFF= 0xE050,
170
+	DLI_AGC_Threshold,
171
+	DLI_AGC_Threshold_Default,
172
+	DLI_Shutdown_ON_OFF,
173
+	DLI_Shutdown_Threshold,
174
+	DLI_Shutdown_Threshold_Default,
175
+	DLI_Shutdown_Count,
176
+	DLI_AGC_Alarm1,
177
+	DLI_AGC_Alarm2,
178
+	DLI_AGC_Alarm3,
179
+	DLI_AGC_Alarm4,
180
+	DLI_Shutdown_Alarm1,
181
+	DLI_Shutdown_Alarm2,
182
+	DLI_Shutdown_Alarm3,
183
+	DLI_Shutdown_Alarm4,
184
+}DL_Ctrl3;
185
+
186
+
187
+typedef enum{
188
+	ULO_RF_Path1_ON_OFF= 0xE060,
189
+	ULO_RF_Path2_ON_OFF,
190
+	ULO_RF_Path3_ON_OFF,
191
+	ULO_RF_Path4_ON_OFF,
192
+	ULO_Gain_Atten1,
193
+	ULO_Gain_Atten2,
194
+	ULO_Gain_Atten3,
195
+	ULO_Gain_Atten4,
196
+	ULO_Gain_Atten_Offset1,
197
+	ULO_Gain_Atten_Offset2,
198
+	ULO_Gain_Atten_Offset3,
199
+	ULO_Gain_Atten_Offset4,
200
+	ULO_Level_High_Threshold,
201
+	UL_Ctrl1_null1,
202
+	ULO_Level_High_Threshold_default,
203
+	ULO_Level,
204
+
205
+}UL_Ctrl1;
206
+typedef enum{
207
+	ULO_Level_High_Alarm1= 0xE070,
208
+	ULO_Level_High_Alarm2,
209
+	ULO_Level_High_Alarm3,
210
+	ULO_Level_High_Alarm4,
211
+
212
+}UL_Ctrl2;
213
+typedef enum{
214
+	ULO_ALC_ON_OFF= 0xE080,
215
+	ULO_ALC_Threshold,
216
+	ULO_ALC_Threshold_Default,
217
+	ULO_Shutdown_ON_OFF,
218
+	ULO_Shutdown_Threshold,
219
+	ULO_Shutdown_Threshold_Default,
220
+	ULO_Shutdown_Retry_Count,
221
+	ULO_ALC_Alarm1,
222
+	ULO_ALC_Alarm2,
223
+	ULO_ALC_Alarm3,
224
+	ULO_ALC_Alarm4,
225
+	ULO_Shutdown_Alarm1,
226
+	ULO_Shutdown_Alarm2,
227
+	ULO_Shutdown_Alarm3,
228
+	ULO_Shutdown_Alarm4,
229
+}UL_Ctrl3;
230
+
231
+
232
+
233
+
234
+
235
+
90 236
 #define MBIC_PREAMBLE0 0x16
91 237
 #define MBIC_PREAMBLE1 0x16
92 238
 #define MBIC_PREAMBLE2 0x16
@@ -104,4 +250,80 @@ typedef enum{
104 250
 #define MBIC_CHECKSHUM
105 251
 #define MBIC_ETX 0x03
106 252
 
253
+
254
+
255
+
256
+/*
257
+ *
258
+ *
259
+ * ALARM LIST
260
+ *
261
+ */
262
+struct Alarm_ENVIRONMENT {
263
+	uint8_t ENVIRONMENT_Temp_High ;
264
+	uint8_t ENVIRONMENT_Reserved0 ;
265
+	uint8_t ENVIRONMENT_Reserved1 ;
266
+	uint8_t ENVIRONMENT_Reserved2 ;
267
+	uint8_t ENVIRONMENT_Reserved3 ;
268
+	uint8_t ENVIRONMENT_Reserved4 ;
269
+	uint8_t ENVIRONMENT_Reserved5 ;
270
+	uint8_t ENVIRONMENT_Reserved6 ;
271
+};
272
+
273
+
274
+struct Alarm_DL {
275
+	uint8_t DLI_P4_Level_Low  ;
276
+	uint8_t DLI_P3_Level_Low  ;
277
+	uint8_t DLI_P2_Level_Low  ;
278
+	uint8_t DLI_P1_Level_Low  ;
279
+	uint8_t ULO_P4_Level_High ;
280
+	uint8_t ULO_P3_Level_High ;
281
+	uint8_t ULO_P2_Level_High ;
282
+	uint8_t ULO_P1_Level_High ;
283
+	uint8_t DLI_P4_AGC_Alarm  ;
284
+	uint8_t DLI_P3_AGC_Alarm  ;
285
+	uint8_t DLI_P2_AGC_Alarm  ;
286
+	uint8_t DLI_P1_AGC_Alarm  ;
287
+	uint8_t DLI_P4_Shutdown_Alarm ;
288
+	uint8_t DLI_P3_Shutdown_Alarm ;
289
+	uint8_t DLI_P2_Shutdown_Alarm ;
290
+	uint8_t DLI_P1_Shutdown_Alarm ;
291
+};
292
+struct Alarm_UL {
293
+	uint8_t Reserved0         ;
294
+	uint8_t Reserved1         ;
295
+	uint8_t Reserved2         ;
296
+	uint8_t Reserved3         ;
297
+	uint8_t ULO_P4_Level_High ;
298
+	uint8_t ULO_P3_Level_High ;
299
+	uint8_t ULO_P2_Level_High ;
300
+	uint8_t ULO_P1_Level_High ;
301
+	uint8_t ULO_P4_ALC_Alarm  ;
302
+	uint8_t ULO_P3_ALC_Alarm  ;
303
+	uint8_t ULO_P2_ALC_Alarm  ;
304
+	uint8_t ULO_P1_ALC_Alarm  ;
305
+	uint8_t ULO_P4_Shutdown   ;
306
+	uint8_t ULO_P3_Shutdown   ;
307
+	uint8_t ULO_P2_Shutdown   ;
308
+	uint8_t ULO_P1_Shutdown   ;
309
+};
310
+
311
+
312
+
313
+#define ALARM_ENVIRONMENT_FLAG 0x80
314
+#define ALARM_DL1_FLAG 0xFF
315
+#define ALARM_DL2_FLAG 0xFF
316
+#define ALARM_UL1_FLAG 0x0F
317
+#define ALARM_UL2_FLAG 0xFF
318
+
319
+typedef enum{
320
+	ENVIRONMENT = 0,
321
+	DL1,
322
+	DL2,
323
+	UL1,
324
+	UL2,
325
+	MAX_ALARM_Len,
326
+}AlarmList;
327
+
328
+
107 329
 #endif /* BLUECELL_OPERATE_H_ */

+ 1 - 0
Bluecell_Inc/uart.h

@@ -33,5 +33,6 @@ void InitUartQueue(pUARTQUEUE pQueue);
33 33
 void GetDataFromUartQueue(UART_HandleTypeDef *huart);
34 34
 bool Get_UartRcv(void);
35 35
 void Set_UartRcv(bool);
36
+void Uart1_Data_Send(uint8_t* data,uint8_t size);
36 37
 
37 38
 #endif /* UART_H_ */

+ 82 - 3
Bluecell_Src/Bluecell_operate.c

@@ -1,8 +1,13 @@
1
+#include <stdio.h>
1 2
 #include "main.h"
2 3
 #include "Bluecell_operate.h"
3 4
 
5
+
6
+uint8_t Alarm_Status[MAX_ALARM_Len] = {0,};
7
+
4 8
 uint8_t ResultData[1024] = {0,};
5
-uint8_t* MBIC_DataSetting(uint8_t* data){
9
+
10
+uint8_t* MBIC_HeaderDataSetting(uint8_t* data){
6 11
 	ResultData[MBIC_PREAMBLE_0] = MBIC_PREAMBLE0;
7 12
 	ResultData[MBIC_PREAMBLE_1] = MBIC_PREAMBLE1;
8 13
 	ResultData[MBIC_PREAMBLE_2] = MBIC_PREAMBLE2;
@@ -30,9 +35,83 @@ uint8_t* MBIC_DataSetting(uint8_t* data){
30 35
 	return ResultData;
31 36
 }
32 37
 bool Bluecell_Operate(uint8_t* data){
33
-	uint8_t datatype = 0;
38
+	uint16_t datatype = 0;
39
+
34 40
 	switch(datatype){
35
-	case 0: break;
41
+		case Alarm_Bit_List:
42
+			// 알림 비트 
43
+			Uart1_Data_Send(&Alarm_Status[0],MAX_ALARM_Len);
44
+		break;
45
+		case Alarm_Mask:
46
+
47
+		break;
48
+		case Alarm_Test_Mode:
49
+
50
+		break;
51
+		case Alarm_Test_Dummy:
52
+
53
+		break;
54
+		case CPU_Version:
55
+
56
+		break;
57
+		case ModuleINFORMATION_null1:
58
+
59
+		break;
60
+		case CPU_Current_Bank:
61
+
62
+		break;
63
+		case CPU_Bank_Select_Reboot_by:
64
+		break;
65
+		case CPU_Bank1_Image_Version:
66
+		break;
67
+		case CPU_Bank1_Image_BuildTime:
68
+		break;
69
+		case CPU_Bank1_Image_Name:
70
+		break;
71
+		case CPU_Bank2_Image_Version:
72
+		break;
73
+		case CPU_Bank2_Image_BuildTime:
74
+		break;
75
+		case CPU_Bank2_Image_Name:
76
+		break;
77
+		case SW_Reset:
78
+		break;
79
+		case Factory_Set_Initialization:
80
+		break;
81
+		case Temperature:
82
+
83
+		break;
84
+		case Temperature_Offset:
85
+			break;
86
+		case Temp_High_Threshold:
87
+			break;
88
+		case Temp_High_Threshold_Default:
89
+			break;
90
+		case Temp_High_Alarm:
91
+			break;
92
+		case LED_TEST:
93
+		break;
94
+		case Node:
95
+			break;
96
+		case Type:
97
+			break;
98
+		case PCB_Version:
99
+			break;
100
+		case Serial_Number:
101
+			break;
102
+		case Manufacture:
103
+			break;
104
+		case Manufacture_Date:
105
+			break;
106
+		case ENVIRONMENT_INVENTORY_null1:
107
+			printf("Function : %s .... Line : %d\r\n",__func__,__LINE__);
108
+			break;
109
+		case Freq_ID:
110
+			break;
111
+		case Carrier_ID:
112
+			break;
113
+		case Carrier_ON_OFF:
114
+			break;
36 115
 
37 116
 	}
38 117
 	return true;

+ 1 - 1
Bluecell_Src/uart.c

@@ -97,6 +97,6 @@ void GetDataFromUartQueue(UART_HandleTypeDef *huart)
97 97
 }
98 98
 
99 99
 void Uart1_Data_Send(uint8_t* data,uint8_t size){
100
-    HAL_UART_Transmit(&huart1, data,size, 10); 
100
+    HAL_UART_Transmit_DMA(&huart1, data,size); 
101 101
 }
102 102