##// END OF EJS Templates
sync
paul -
r16:5467523e44cd default
parent child
Show More
@@ -1,708 +1,735
1 1 #ifndef CCSDS_TYPES_H_INCLUDED
2 2 #define CCSDS_TYPES_H_INCLUDED
3 3
4 4 #define CCSDS_PROTOCOLE_EXTRA_BYTES 4
5 5 #define CCSDS_TC_TM_PACKET_OFFSET 7
6 6 #define CCSDS_TELEMETRY_HEADER_LENGTH 16+4
7 7 #define CCSDS_TM_PKT_MAX_SIZE 4412
8 8 #define CCSDS_TELECOMMAND_HEADER_LENGTH 10+4
9 9 #define CCSDS_TC_PKT_MAX_SIZE 256
10 10 #define CCSDS_TC_PKT_MIN_SIZE 16
11 11 #define CCSDS_PROCESS_ID 76
12 12 #define CCSDS_PACKET_CATEGORY 12
13 13 #define CCSDS_NODE_ADDRESS 0xfe
14 14 #define CCSDS_USER_APP 0x00
15 15
16 16 #define DEFAULT_SPARE1_PUSVERSION_SPARE2 0x10
17 17 #define DEFAULT_RESERVED 0x00
18 18 #define DEFAULT_HKBIA 0x1e // 0001 1110
19 19
20 20 // PACKET ID
21 21 #define APID_TM_TC_EXE 0x0cc1 // PID 76 CAT 1
22 22 #define APID_TM_HK 0x0cc4 // PID 76 CAT 4
23 23 #define APID_TM_SCIENCE_NORMAL_BURST 0x0ccc // PID 76 CAT 12
24 24 #define APID_TM_SCIENCE_SBM1_SBM2 0x0cfc // PID 79 CAT 12
25 25 #define APID_TM_PARAMETER_DUMP 0x0cc6 // PID 76 CAT 6
26 26 #define APID_TM_KCOEFFICIENTS_DUMP 0x0cc6 // PID 76 CAT 6
27 27
28 28 // PACKET SEQUENCE CONTROL
29 29 #define TM_PACKET_SEQ_CTRL_CONTINUATION 0x00 // [0000 0000]
30 30 #define TM_PACKET_SEQ_CTRL_FIRST 0x40 // [0100 0000]
31 31 #define TM_PACKET_SEQ_CTRL_LAST 0x80 // [1000 0000]
32 32 #define TM_PACKET_SEQ_CTRL_STANDALONE 0xc0 // [1100 0000]
33 33 #define TM_PACKET_SEQ_CNT_DEFAULT 0x00 // [0000 0000]
34 34
35 35 // DESTINATION ID
36 36 #define TM_DESTINATION_ID_GROUND 0
37 37 #define TM_DESTINATION_ID_MISSION_TIMELINE 110
38 38 #define TM_DESTINATION_ID_TC_SEQUENCES 111
39 39 #define TM_DESTINATION_ID_RECOVERY_ACTION_COMMAND 112
40 40 #define TM_DESTINATION_ID_BACKUP_MISSION_TIMELINE 113
41 41 #define TM_DESTINATION_ID_DIRECT_CMD 120
42 42 #define TM_DESTINATION_ID_SPARE_GRD_SRC1 121
43 43 #define TM_DESTINATION_ID_SPARE_GRD_SRC2 122
44 44 #define TM_DESTINATION_ID_OBCP 15
45 45 #define TM_DESTINATION_ID_SYSTEM_CONTROL 14
46 46 #define TM_DESTINATION_ID_AOCS 11
47 47
48 48 //*********************************************************
49 49 //*** /!\ change CCSDS_DESTINATION_ID before flight /!\ ***
50 50 //*********************************************************
51 51 #ifdef LPP_DPU_DESTID
52 52 #define CCSDS_DESTINATION_ID 32
53 53 #else
54 54 #define CCSDS_DESTINATION_ID 0x01
55 55 #endif
56 56 #define CCSDS_PROTOCOLE_ID 0x02
57 57 #define CCSDS_RESERVED 0x00
58 58 #define CCSDS_USER_APP 0x00
59 59
60 60 #define SIZE_TM_LFR_TC_EXE_NOT_IMPLEMENTED 24
61 61 #define SIZE_TM_LFR_TC_EXE_CORRUPTED 32
62 62 #define SIZE_HK_PARAMETERS 112
63 63
64 64 // TC TYPES
65 65 #define TC_TYPE_GEN 181
66 66 #define TC_TYPE_TIME 9
67 67
68 68 // TC SUBTYPES
69 69 #define TC_SUBTYPE_RESET 1
70 70 #define TC_SUBTYPE_LOAD_COMM 11
71 71 #define TC_SUBTYPE_LOAD_NORM 13
72 72 #define TC_SUBTYPE_LOAD_BURST 19
73 73 #define TC_SUBTYPE_LOAD_SBM1 25
74 74 #define TC_SUBTYPE_LOAD_SBM2 27
75 75 #define TC_SUBTYPE_DUMP 31
76 76 #define TC_SUBTYPE_ENTER 41
77 77 #define TC_SUBTYPE_UPDT_INFO 51
78 78 #define TC_SUBTYPE_EN_CAL 61
79 79 #define TC_SUBTYPE_DIS_CAL 63
80 80 #define TC_SUBTYPE_LOAD_K 93
81 81 #define TC_SUBTYPE_DUMP_K 95
82 82 #define TC_SUBTYPE_LOAD_FBINS 91
83 83 #define TC_SUBTYPE_UPDT_TIME 129
84 84
85 85 // TC LEN
86 86 #define TC_LEN_RESET 12
87 87 #define TC_LEN_LOAD_COMM 14
88 88 #define TC_LEN_LOAD_NORM 22
89 89 #define TC_LEN_LOAD_BURST 14
90 90 #define TC_LEN_LOAD_SBM1 14
91 91 #define TC_LEN_LOAD_SBM2 14
92 92 #define TC_LEN_DUMP 12
93 93 #define TC_LEN_ENTER 20
94 94 #define TC_LEN_UPDT_INFO 46
95 95 #define TC_LEN_EN_CAL 12
96 96 #define TC_LEN_DIS_CAL 12
97 97 #define TC_LEN_LOAD_K 142
98 98 #define TC_LEN_DUMP_K 12
99 99 #define TC_LEN_LOAD_FBINS 60
100 100 #define TC_LEN_UPDT_TIME 18
101 101
102 // PACKET CODES
103 #define TM_CODE_K_DUMP 0xb5600b00 // 181 (0xb5) ** 96 (0x60) ** 11 (0x0b) ** 0 (0x00)
104
102 105 // TM TYPES
103 106 #define TM_TYPE_TC_EXE 1
104 107 #define TM_TYPE_HK 3
105 108 #define TM_TYPE_LFR_SCIENCE 21
106 109 #define TM_TYPE_PARAMETER_DUMP 181
107 #define TM_TYPE_KCOEFFICIENTD_DUMP 181
110 #define TM_TYPE_K_DUMP 181
108 111
109 112 // TM SUBTYPES
110 113 #define TM_SUBTYPE_EXE_OK 7
111 114 #define TM_SUBTYPE_EXE_NOK 8
112 115 #define TM_SUBTYPE_HK 25
113 116 #define TM_SUBTYPE_LFR_SCIENCE_3 3 // TM packets with fixed size
114 117 #define TM_SUBTYPE_LFR_SCIENCE_6 6 // TM packets with variable size
115 118 #define TM_SUBTYPE_PARAMETER_DUMP 32
116 119 #define TM_SUBTYPE_K_DUMP 96
117 120
118 121 // FAILURE CODES
119 122 #define ILLEGAL_APID 0
120 123 #define WRONG_LEN_PKT 1
121 124 #define INCOR_CHECKSUM 2
122 125 #define ILL_TYPE 3
123 126 #define ILL_SUBTYPE 4
124 127 #define WRONG_APP_DATA 5 // 0x00 0x05
125 128 #define TC_NOT_EXE 42000 // 0xa4 0x10
126 129 #define WRONG_SRC_ID 42001 // 0xa4 0x11
127 130 #define FUNCT_NOT_IMPL 42002 // 0xa4 0x12
128 131 #define FAIL_DETECTED 42003 // 0xa4 0x13
129 132 #define NOT_ALLOWED 42004 // 0xa4 0x14
130 133 #define CORRUPTED 42005 // 0xa4 0x15
131 134 #define CCSDS_TM_VALID 7
132 135
133 136 // TC SID
134 137 #define SID_TC_GROUND 0
135 138 #define SID_TC_MISSION_TIMELINE 110
136 139 #define SID_TC_TC_SEQUENCES 111
137 140 #define SID_TC_RECOVERY_ACTION_CMD 112
138 141 #define SID_TC_BACKUP_MISSION_TIMELINE 113
139 142 #define SID_TC_DIRECT_CMD 120
140 143 #define SID_TC_SPARE_GRD_SRC1 121
141 144 #define SID_TC_SPARE_GRD_SRC2 122
142 145 #define SID_TC_OBCP 15
143 146 #define SID_TC_SYSTEM_CONTROL 14
144 147 #define SID_TC_AOCS 11
145 148 #define SID_TC_RPW_INTERNAL 254
146 149
147 150 enum apid_destid{
148 151 GROUND,
149 152 MISSION_TIMELINE,
150 153 TC_SEQUENCES,
151 154 RECOVERY_ACTION_CMD,
152 155 BACKUP_MISSION_TIMELINE,
153 156 DIRECT_CMD,
154 157 SPARE_GRD_SRC1,
155 158 SPARE_GRD_SRC2,
156 159 OBCP,
157 160 SYSTEM_CONTROL,
158 161 AOCS,
159 162 RPW_INTERNAL
160 163 };
161 164 // SEQUENCE COUNTERS
162 165 #define SEQ_CNT_MAX 16383
163 166 #define SEQ_CNT_NB_DEST_ID 12
164 167
165 168 // TM SID
166 169 #define SID_HK 1
167 170
168 171 #define SID_NORM_SWF_F0 3
169 172 #define SID_NORM_SWF_F1 4
170 173 #define SID_NORM_SWF_F2 5
171 174 #define SID_NORM_CWF_F3 1
172 175 #define SID_BURST_CWF_F2 2
173 176 #define SID_SBM1_CWF_F1 24
174 177 #define SID_SBM2_CWF_F2 25
175 178 #define SID_NORM_ASM_F0 11
176 179 #define SID_NORM_ASM_F1 12
177 180 #define SID_NORM_ASM_F2 13
178 181 #define SID_NORM_BP1_F0 14
179 182 #define SID_NORM_BP1_F1 15
180 183 #define SID_NORM_BP1_F2 16
181 184 #define SID_NORM_BP2_F0 19
182 185 #define SID_NORM_BP2_F1 20
183 186 #define SID_NORM_BP2_F2 21
184 187 #define SID_BURST_BP1_F0 17
185 188 #define SID_BURST_BP2_F0 22
186 189 #define SID_BURST_BP1_F1 18
187 190 #define SID_BURST_BP2_F1 23
188 191 #define SID_SBM1_BP1_F0 28
189 192 #define SID_SBM1_BP2_F0 31
190 193 #define SID_SBM2_BP1_F0 29
191 194 #define SID_SBM2_BP2_F0 32
192 195 #define SID_SBM2_BP1_F1 30
193 196 #define SID_SBM2_BP2_F1 33
194 197 #define SID_NORM_CWF_LONG_F3 34
195 198
196 199 #define SID_PARAMETER_DUMP 10
197 200 #define SID_K_DUMP 11
198 201
199 202 // HEADER_LENGTH
200 203 #define TM_HEADER_LEN 16
201 204 #define HEADER_LENGTH_TM_LFR_SCIENCE_ASM 28
202 205 // PACKET_LENGTH
203 206 #define PACKET_LENGTH_TC_EXE_SUCCESS (20 - CCSDS_TC_TM_PACKET_OFFSET)
204 207 #define PACKET_LENGTH_TC_EXE_INCONSISTENT (26 - CCSDS_TC_TM_PACKET_OFFSET)
205 208 #define PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE (26 - CCSDS_TC_TM_PACKET_OFFSET)
206 209 #define PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED (24 - CCSDS_TC_TM_PACKET_OFFSET)
207 210 #define PACKET_LENGTH_TC_EXE_ERROR (24 - CCSDS_TC_TM_PACKET_OFFSET)
208 211 #define PACKET_LENGTH_TC_EXE_CORRUPTED (32 - CCSDS_TC_TM_PACKET_OFFSET)
209 212 #define PACKET_LENGTH_HK (136 - CCSDS_TC_TM_PACKET_OFFSET)
210 213 #define PACKET_LENGTH_PARAMETER_DUMP (84 - CCSDS_TC_TM_PACKET_OFFSET)
211 214 #define PACKET_LENGTH_K_DUMP (3920 - CCSDS_TC_TM_PACKET_OFFSET)
212 215 // SCIENCE ASM
213 216 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F0 (3230 - CCSDS_TC_TM_PACKET_OFFSET) // 32 * 25 * 4 + 30 => 88 bins (32 + 32 + 24 ), 3 packets
214 217 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F1 (3630 - CCSDS_TC_TM_PACKET_OFFSET) // 52 * 25 * 2 + 30 => 104 bins (36 + 36 + 32 ), 3 packets
215 218 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F2 (3230 - CCSDS_TC_TM_PACKET_OFFSET) // 32 * 25 * 4 + 30 => 96 bins (32 + 32 + 32 ), 3 packets
216 219 // SCIENCE NORM
217 220 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F0 (150 - CCSDS_TC_TM_PACKET_OFFSET) // 11 * 11 + 29 (1 spare byte in the header)
218 221 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F1 (172 - CCSDS_TC_TM_PACKET_OFFSET) // 13 * 11 + 29 (1 spare byte in the header)
219 222 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F2 (160 - CCSDS_TC_TM_PACKET_OFFSET) // 12 * 11 + 28
220 223 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F0 (358 - CCSDS_TC_TM_PACKET_OFFSET) // 11 * 30 + 28
221 224 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F1 (418 - CCSDS_TC_TM_PACKET_OFFSET) // 13 * 30 + 28
222 225 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F2 (388 - CCSDS_TC_TM_PACKET_OFFSET) // 12 * 30 + 28
223 226 // SCIENCE SBM
224 227 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F0 (270 - CCSDS_TC_TM_PACKET_OFFSET) // 22 * 11 + 28
225 228 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F0 (688 - CCSDS_TC_TM_PACKET_OFFSET) // 22 * 30 + 28
226 229 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F1 (314 - CCSDS_TC_TM_PACKET_OFFSET) // 26 * 11 + 28
227 230 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F1 (808 - CCSDS_TC_TM_PACKET_OFFSET) // 26 * 30 + 28
228 231
229 232 #define PACKET_LENGTH_DELTA 11 // 7 + 4
230 233
231 234 #define SPARE1_PUSVERSION_SPARE2 0x10
232 235
233 236 // R3
234 237 // one snapshot = 2048 samples = 6 packets * 304 + 224
235 238 #define TM_LEN_SCI_SWF_304 (3678 - CCSDS_TC_TM_PACKET_OFFSET) // 304 * 12 + 30
236 239 #define TM_LEN_SCI_SWF_224 (2718 - CCSDS_TC_TM_PACKET_OFFSET) // 224 * 12 + 30
237 240 // one continuous buffer = 2688 samples = 8 packets * 336
238 241 #define TM_LEN_SCI_CWF_336 (4060 - CCSDS_TC_TM_PACKET_OFFSET) // 336 * 12 + 28
239 242 #define TM_LEN_SCI_CWF_672 (4060 - CCSDS_TC_TM_PACKET_OFFSET) // 672 * 6 + 28
240 243 //
241 244 #define DEFAULT_PKTCNT 0x07
242 245 #define BLK_NR_304 0x0130
243 246 #define BLK_NR_224 0x00e0
244 247 #define BLK_NR_CWF 0x0150 // 336
245 248 #define BLK_NR_CWF_SHORT_F3 0x02a0 // 672
246 249
247 250 enum TM_TYPE{
248 251 TM_LFR_TC_EXE_OK,
249 252 TM_LFR_TC_EXE_ERR,
250 253 TM_LFR_HK,
251 254 TM_LFR_SCI,
252 255 TM_LFR_SCI_SBM,
253 256 TM_LFR_PAR_DUMP
254 257 };
255 258
256 259 typedef struct {
257 260 unsigned char targetLogicalAddress;
258 261 unsigned char protocolIdentifier;
259 262 unsigned char reserved;
260 263 unsigned char userApplication;
261 264 // PACKET HEADER
262 265 unsigned char packetID[2];
263 266 unsigned char packetSequenceControl[2];
264 267 unsigned char packetLength[2];
265 268 // DATA FIELD HEADER
266 269 unsigned char spare1_pusVersion_spare2;
267 270 unsigned char serviceType;
268 271 unsigned char serviceSubType;
269 272 unsigned char destinationID;
270 273 unsigned char time[6];
271 274 //
272 275 unsigned char telecommand_pkt_id[2];
273 276 unsigned char pkt_seq_control[2];
274 277 } Packet_TM_LFR_TC_EXE_SUCCESS_t;
275 278
276 279 typedef struct {
277 280 unsigned char targetLogicalAddress;
278 281 unsigned char protocolIdentifier;
279 282 unsigned char reserved;
280 283 unsigned char userApplication;
281 284 // PACKET HEADER
282 285 unsigned char packetID[2];
283 286 unsigned char packetSequenceControl[2];
284 287 unsigned char packetLength[2];
285 288 // DATA FIELD HEADER
286 289 unsigned char spare1_pusVersion_spare2;
287 290 unsigned char serviceType;
288 291 unsigned char serviceSubType;
289 292 unsigned char destinationID;
290 293 unsigned char time[6];
291 294 //
292 295 unsigned char tc_failure_code[2];
293 296 unsigned char telecommand_pkt_id[2];
294 297 unsigned char pkt_seq_control[2];
295 298 unsigned char tc_service;
296 299 unsigned char tc_subtype;
297 300 unsigned char byte_position;
298 301 unsigned char rcv_value;
299 302 } Packet_TM_LFR_TC_EXE_INCONSISTENT_t;
300 303
301 304 typedef struct {
302 305 unsigned char targetLogicalAddress;
303 306 unsigned char protocolIdentifier;
304 307 unsigned char reserved;
305 308 unsigned char userApplication;
306 309 // PACKET HEADER
307 310 unsigned char packetID[2];
308 311 unsigned char packetSequenceControl[2];
309 312 unsigned char packetLength[2];
310 313 // DATA FIELD HEADER
311 314 unsigned char spare1_pusVersion_spare2;
312 315 unsigned char serviceType;
313 316 unsigned char serviceSubType;
314 317 unsigned char destinationID;
315 318 unsigned char time[6];
316 319 //
317 320 unsigned char tc_failure_code[2];
318 321 unsigned char telecommand_pkt_id[2];
319 322 unsigned char pkt_seq_control[2];
320 323 unsigned char tc_service;
321 324 unsigned char tc_subtype;
322 325 unsigned char lfr_status_word[2];
323 326 } Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_t;
324 327
325 328 typedef struct {
326 329 unsigned char targetLogicalAddress;
327 330 unsigned char protocolIdentifier;
328 331 unsigned char reserved;
329 332 unsigned char userApplication;
330 333 // PACKET HEADER
331 334 unsigned char packetID[2];
332 335 unsigned char packetSequenceControl[2];
333 336 unsigned char packetLength[2];
334 337 // DATA FIELD HEADER
335 338 unsigned char spare1_pusVersion_spare2;
336 339 unsigned char serviceType;
337 340 unsigned char serviceSubType;
338 341 unsigned char destinationID;
339 342 unsigned char time[6];
340 343 //
341 344 unsigned char tc_failure_code[2];
342 345 unsigned char telecommand_pkt_id[2];
343 346 unsigned char pkt_seq_control[2];
344 347 unsigned char tc_service;
345 348 unsigned char tc_subtype;
346 349 } Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_t;
347 350
348 351 typedef struct {
349 352 unsigned char targetLogicalAddress;
350 353 unsigned char protocolIdentifier;
351 354 unsigned char reserved;
352 355 unsigned char userApplication;
353 356 // PACKET HEADER
354 357 unsigned char packetID[2];
355 358 unsigned char packetSequenceControl[2];
356 359 unsigned char packetLength[2];
357 360 // DATA FIELD HEADER
358 361 unsigned char spare1_pusVersion_spare2;
359 362 unsigned char serviceType;
360 363 unsigned char serviceSubType;
361 364 unsigned char destinationID;
362 365 unsigned char time[6];
363 366 //
364 367 unsigned char tc_failure_code[2];
365 368 unsigned char telecommand_pkt_id[2];
366 369 unsigned char pkt_seq_control[2];
367 370 unsigned char tc_service;
368 371 unsigned char tc_subtype;
369 372 } Packet_TM_LFR_TC_EXE_ERROR_t;
370 373
371 374 typedef struct {
372 375 unsigned char targetLogicalAddress;
373 376 unsigned char protocolIdentifier;
374 377 unsigned char reserved;
375 378 unsigned char userApplication;
376 379 // PACKET HEADER
377 380 unsigned char packetID[2];
378 381 unsigned char packetSequenceControl[2];
379 382 unsigned char packetLength[2];
380 383 // DATA FIELD HEADER
381 384 unsigned char spare1_pusVersion_spare2;
382 385 unsigned char serviceType;
383 386 unsigned char serviceSubType;
384 387 unsigned char destinationID;
385 388 unsigned char time[6];
386 389 //
387 390 unsigned char tc_failure_code[2];
388 391 unsigned char telecommand_pkt_id[2];
389 392 unsigned char pkt_seq_control[2];
390 393 unsigned char tc_service;
391 394 unsigned char tc_subtype;
392 395 unsigned char pkt_len_rcv_value[2];
393 396 unsigned char pkt_datafieldsize_cnt[2];
394 397 unsigned char rcv_crc[2];
395 398 unsigned char computed_crc[2];
396 399 } Packet_TM_LFR_TC_EXE_CORRUPTED_t;
397 400
398 401 typedef struct {
399 402 unsigned char targetLogicalAddress;
400 403 unsigned char protocolIdentifier;
401 404 unsigned char reserved;
402 405 unsigned char userApplication;
403 406 unsigned char packetID[2];
404 407 unsigned char packetSequenceControl[2];
405 408 unsigned char packetLength[2];
406 409 // DATA FIELD HEADER
407 410 unsigned char spare1_pusVersion_spare2;
408 411 unsigned char serviceType;
409 412 unsigned char serviceSubType;
410 413 unsigned char destinationID;
411 414 unsigned char time[6];
412 415 // AUXILIARY HEADER
413 416 unsigned char sid;
414 417 unsigned char hkBIA;
415 418 unsigned char sy_lfr_common_parameters_spare;
416 419 unsigned char sy_lfr_common_parameters;
417 420 unsigned char pktCnt;
418 421 unsigned char pktNr;
419 422 unsigned char acquisitionTime[6];
420 423 unsigned char blkNr[2];
421 424 } Header_TM_LFR_SCIENCE_SWF_t;
422 425
423 426 typedef struct {
424 427 unsigned char targetLogicalAddress;
425 428 unsigned char protocolIdentifier;
426 429 unsigned char reserved;
427 430 unsigned char userApplication;
428 431 unsigned char packetID[2];
429 432 unsigned char packetSequenceControl[2];
430 433 unsigned char packetLength[2];
431 434 // DATA FIELD HEADER
432 435 unsigned char spare1_pusVersion_spare2;
433 436 unsigned char serviceType;
434 437 unsigned char serviceSubType;
435 438 unsigned char destinationID;
436 439 unsigned char time[6];
437 440 // AUXILIARY DATA HEADER
438 441 unsigned char sid;
439 442 unsigned char hkBIA;
440 443 unsigned char sy_lfr_common_parameters_spare;
441 444 unsigned char sy_lfr_common_parameters;
442 445 unsigned char acquisitionTime[6];
443 446 unsigned char blkNr[2];
444 447 } Header_TM_LFR_SCIENCE_CWF_t;
445 448
446 449 typedef struct {
447 450 unsigned char targetLogicalAddress;
448 451 unsigned char protocolIdentifier;
449 452 unsigned char reserved;
450 453 unsigned char userApplication;
451 454 unsigned char packetID[2];
452 455 unsigned char packetSequenceControl[2];
453 456 unsigned char packetLength[2];
454 457 // DATA FIELD HEADER
455 458 unsigned char spare1_pusVersion_spare2;
456 459 unsigned char serviceType;
457 460 unsigned char serviceSubType;
458 461 unsigned char destinationID;
459 462 unsigned char time[6];
460 463 // AUXILIARY HEADER
461 464 unsigned char sid;
462 465 unsigned char biaStatusInfo;
463 466 unsigned char sy_lfr_common_parameters_spare;
464 467 unsigned char sy_lfr_common_parameters;
465 468 unsigned char pa_lfr_pkt_cnt_asm;
466 469 unsigned char pa_lfr_pkt_nr_asm;
467 470 unsigned char acquisitionTime[6];
468 471 unsigned char pa_lfr_asm_blk_nr[2];
469 472 } Header_TM_LFR_SCIENCE_ASM_t;
470 473
471 474 typedef struct {
472 475 unsigned char targetLogicalAddress;
473 476 unsigned char protocolIdentifier;
474 477 unsigned char reserved;
475 478 unsigned char userApplication;
476 479 unsigned char packetID[2];
477 480 unsigned char packetSequenceControl[2];
478 481 unsigned char packetLength[2];
479 482 // DATA FIELD HEADER
480 483 unsigned char spare1_pusVersion_spare2;
481 484 unsigned char serviceType;
482 485 unsigned char serviceSubType;
483 486 unsigned char destinationID;
484 487 unsigned char time[6];
485 488 // AUXILIARY HEADER
486 489 unsigned char sid;
487 490 unsigned char biaStatusInfo;
488 491 unsigned char sy_lfr_common_parameters_spare;
489 492 unsigned char sy_lfr_common_parameters;
490 493 unsigned char acquisitionTime[6];
491 494 unsigned char source_data_spare;
492 495 unsigned char pa_lfr_bp_blk_nr[2];
493 496 } Header_TM_LFR_SCIENCE_BP_with_spare_t;
494 497
495 498 typedef struct {
496 499 unsigned char targetLogicalAddress;
497 500 unsigned char protocolIdentifier;
498 501 unsigned char reserved;
499 502 unsigned char userApplication;
500 503 unsigned char packetID[2];
501 504 unsigned char packetSequenceControl[2];
502 505 unsigned char packetLength[2];
503 506 // DATA FIELD HEADER
504 507 unsigned char spare1_pusVersion_spare2;
505 508 unsigned char serviceType;
506 509 unsigned char serviceSubType;
507 510 unsigned char destinationID;
508 511 unsigned char time[6];
509 512 // AUXILIARY HEADER
510 513 unsigned char sid;
511 514 unsigned char biaStatusInfo;
512 515 unsigned char sy_lfr_common_parameters_spare;
513 516 unsigned char sy_lfr_common_parameters;
514 517 unsigned char acquisitionTime[6];
515 518 unsigned char pa_lfr_bp_blk_nr[2];
516 519 } Header_TM_LFR_SCIENCE_BP_t;
517 520
518 521 typedef struct {
519 522 //targetLogicalAddress is removed by the grspw module
520 523 unsigned char protocolIdentifier;
521 524 unsigned char reserved;
522 525 unsigned char userApplication;
523 526 unsigned char packetID[2];
524 527 unsigned char packetSequenceControl[2];
525 528 unsigned char packetLength[2];
526 529 // DATA FIELD HEADER
527 530 unsigned char headerFlag_pusVersion_Ack;
528 531 unsigned char serviceType;
529 532 unsigned char serviceSubType;
530 533 unsigned char sourceID;
531 534 unsigned char dataAndCRC[CCSDS_TC_PKT_MAX_SIZE-10];
532 535 } ccsdsTelecommandPacket_t;
533 536
534 537 typedef struct {
535 538 unsigned char targetLogicalAddress;
536 539 unsigned char protocolIdentifier;
537 540 unsigned char reserved;
538 541 unsigned char userApplication;
539 542 unsigned char packetID[2];
540 543 unsigned char packetSequenceControl[2];
541 544 unsigned char packetLength[2];
542 545 unsigned char spare1_pusVersion_spare2;
543 546 unsigned char serviceType;
544 547 unsigned char serviceSubType;
545 548 unsigned char destinationID;
546 549 unsigned char time[6];
547 550 unsigned char sid;
548 551
549 552 //**************
550 553 // HK PARAMETERS
551 554 unsigned char lfr_status_word[2];
552 555 unsigned char lfr_sw_version[4];
553 556 unsigned char lfr_fpga_version[3];
554 557 // ressource statistics
555 558 unsigned char hk_lfr_cpu_load;
556 559 unsigned char hk_lfr_cpu_load_max;
557 560 unsigned char hk_lfr_cpu_load_aver;
558 561 unsigned char hk_lfr_q_sd_fifo_size_max;
559 562 unsigned char hk_lfr_q_sd_fifo_size;
560 563 unsigned char hk_lfr_q_rv_fifo_size_max;
561 564 unsigned char hk_lfr_q_rv_fifo_size;
562 565 unsigned char hk_lfr_q_p0_fifo_size_max;
563 566 unsigned char hk_lfr_q_p0_fifo_size;
564 567 unsigned char hk_lfr_q_p1_fifo_size_max;
565 568 unsigned char hk_lfr_q_p1_fifo_size;
566 569 unsigned char hk_lfr_q_p2_fifo_size_max;
567 570 unsigned char hk_lfr_q_p2_fifo_size;
568 571 // tc statistics
569 572 unsigned char hk_lfr_update_info_tc_cnt[2];
570 573 unsigned char hk_lfr_update_time_tc_cnt[2];
571 574 unsigned char hk_lfr_exe_tc_cnt[2];
572 575 unsigned char hk_lfr_rej_tc_cnt[2];
573 576 unsigned char hk_lfr_last_exe_tc_id[2];
574 577 unsigned char hk_lfr_last_exe_tc_type[2];
575 578 unsigned char hk_lfr_last_exe_tc_subtype[2];
576 579 unsigned char hk_lfr_last_exe_tc_time[6];
577 580 unsigned char hk_lfr_last_rej_tc_id[2];
578 581 unsigned char hk_lfr_last_rej_tc_type[2];
579 582 unsigned char hk_lfr_last_rej_tc_subtype[2];
580 583 unsigned char hk_lfr_last_rej_tc_time[6];
581 584 // anomaly statistics
582 585 unsigned char hk_lfr_le_cnt[2];
583 586 unsigned char hk_lfr_me_cnt[2];
584 587 unsigned char hk_lfr_he_cnt[2];
585 588 unsigned char hk_lfr_last_er_rid[2];
586 589 unsigned char hk_lfr_last_er_code;
587 590 unsigned char hk_lfr_last_er_time[6];
588 591 // vhdl_blk_status
589 592 unsigned char hk_lfr_vhdl_aa_sm;
590 593 unsigned char hk_lfr_vhdl_fft_sr;
591 594 unsigned char hk_lfr_vhdl_cic_hk;
592 595 unsigned char hk_lfr_vhdl_iir_cal;
593 596 // spacewire_if_statistics
594 597 unsigned char hk_lfr_dpu_spw_pkt_rcv_cnt[2];
595 598 unsigned char hk_lfr_dpu_spw_pkt_sent_cnt[2];
596 599 unsigned char hk_lfr_dpu_spw_tick_out_cnt;
597 600 unsigned char hk_lfr_dpu_spw_last_timc;
598 601 // ahb error statistics
599 602 unsigned char hk_lfr_last_fail_addr[4];
600 603 // temperatures
601 604 unsigned char hk_lfr_temp_scm[2];
602 605 unsigned char hk_lfr_temp_pcb[2];
603 606 unsigned char hk_lfr_temp_fpga[2];
604 607 // spacecraft potential
605 608 unsigned char hk_lfr_sc_v_f3[2];
606 609 unsigned char hk_lfr_sc_e1_f3[2];
607 610 unsigned char hk_lfr_sc_e2_f3[2];
608 611 // lfr common parameters
609 612 unsigned char sy_lfr_common_parameters_spare;
610 613 unsigned char sy_lfr_common_parameters;
611 614 // error counters
612 615 unsigned char hk_lfr_dpu_spw_parity;
613 616 unsigned char hk_lfr_dpu_spw_disconnect;
614 617 unsigned char hk_lfr_dpu_spw_escape;
615 618 unsigned char hk_lfr_dpu_spw_credit;
616 619 unsigned char hk_lfr_dpu_spw_write_sync;
617 620 unsigned char hk_lfr_dpu_spw_rx_ahb;
618 621 unsigned char hk_lfr_dpu_spw_tx_ahb;
619 622 unsigned char hk_lfr_dpu_spw_early_eop;
620 623 unsigned char hk_lfr_dpu_spw_invalid_addr;
621 624 unsigned char hk_lfr_dpu_spw_eep;
622 625 unsigned char hk_lfr_dpu_spw_rx_too_big;
623 626 // timecode
624 627 unsigned char hk_lfr_timecode_erroneous;
625 628 unsigned char hk_lfr_timecode_missing;
626 629 unsigned char hk_lfr_timecode_invalid;
627 630 // time
628 631 unsigned char hk_lfr_time_timecode_it;
629 632 unsigned char hk_lfr_time_not_synchro;
630 633 unsigned char hk_lfr_time_timecode_ctr;
631 634 // hk_lfr_buffer_dpu_
632 635 unsigned char hk_lfr_buffer_dpu_tc_fifo;
633 636 unsigned char hk_lfr_buffer_dpu_tm_fifo;
634 637 // hk_lfr_ahb_
635 638 unsigned char hk_lfr_ahb_correctable;
636 639 unsigned char hk_lfr_ahb_uncorrectable;
637 640 // spare
638 641 unsigned char parameters_spare;
639 642 } Packet_TM_LFR_HK_t;
640 643
641 644 typedef struct {
642 645 unsigned char targetLogicalAddress;
643 646 unsigned char protocolIdentifier;
644 647 unsigned char reserved;
645 648 unsigned char userApplication;
646 649 unsigned char packetID[2];
647 650 unsigned char packetSequenceControl[2];
648 651 unsigned char packetLength[2];
649 652 // DATA FIELD HEADER
650 653 unsigned char spare1_pusVersion_spare2;
651 654 unsigned char serviceType;
652 655 unsigned char serviceSubType;
653 656 unsigned char destinationID;
654 657 unsigned char time[6];
655 658 unsigned char sid;
656 659
657 660 //******************
658 661 // COMMON PARAMETERS
659 662 unsigned char unused0;
660 663 unsigned char sy_lfr_common_parameters;
661 664
662 665 //******************
663 666 // NORMAL PARAMETERS
664 667 unsigned char sy_lfr_n_swf_l[2];
665 668 unsigned char sy_lfr_n_swf_p[2];
666 669 unsigned char sy_lfr_n_asm_p[2];
667 670 unsigned char sy_lfr_n_bp_p0;
668 671 unsigned char sy_lfr_n_bp_p1;
669 672 unsigned char sy_lfr_n_cwf_long_f3;
670 673 unsigned char lfr_normal_parameters_spare;
671 674
672 675 //*****************
673 676 // BURST PARAMETERS
674 677 unsigned char sy_lfr_b_bp_p0;
675 678 unsigned char sy_lfr_b_bp_p1;
676 679
677 680 //****************
678 681 // SBM1 PARAMETERS
679 682 unsigned char sy_lfr_s1_bp_p0;
680 683 unsigned char sy_lfr_s1_bp_p1;
681 684
682 685 //****************
683 686 // SBM2 PARAMETERS
684 687 unsigned char sy_lfr_s2_bp_p0;
685 688 unsigned char sy_lfr_s2_bp_p1;
686 689
687 690 // mask F0
688 691 unsigned int sy_lfr_fbins_f0_word1;
689 692 unsigned int sy_lfr_fbins_f0_word2;
690 693 unsigned int sy_lfr_fbins_f0_word3;
691 694 unsigned int sy_lfr_fbins_f0_word4;
692 695 // mask F1
693 696 unsigned int sy_lfr_fbins_f1_word1;
694 697 unsigned int sy_lfr_fbins_f1_word2;
695 698 unsigned int sy_lfr_fbins_f1_word3;
696 699 unsigned int sy_lfr_fbins_f1_word4;
697 700 // mask F2
698 701 unsigned int sy_lfr_fbins_f2_word1;
699 702 unsigned int sy_lfr_fbins_f2_word2;
700 703 unsigned int sy_lfr_fbins_f2_word3;
701 704 unsigned int sy_lfr_fbins_f2_word4;
702 705
703 706 // SPARE
704 707 unsigned char source_data_spare;
705 708 } Packet_TM_LFR_PARAMETER_DUMP_t;
706 709
710 typedef struct {
711 unsigned char targetLogicalAddress;
712 unsigned char protocolIdentifier;
713 unsigned char reserved;
714 unsigned char userApplication;
715 unsigned char packetID[2];
716 unsigned char packetSequenceControl[2];
717 unsigned char packetLength[2];
718 // DATA FIELD HEADER
719 unsigned char spare1_pusVersion_spare2;
720 unsigned char serviceType;
721 unsigned char serviceSubType;
722 unsigned char destinationID;
723 unsigned char time[6];
724 unsigned char sid;
725 unsigned char pkt_cnt;
726 unsigned char pkt_nr;
727 unsigned char blk_nr;
728
729 //******************
730 // SOURCE DATA repeated N times with N in [0 .. PA_LFR_KCOEFF_BLK_NR]
731 unsigned char kcoeff_blks[3900]; // one blk is 2 + 4 * 32 = 130 bytes, 30 blks max in one packet (30 * 130 = 3900)
732
733 } Packet_TM_LFR_KCOEFFICIENTS_DUMP_t;
707 734
708 735 #endif // CCSDS_TYPES_H_INCLUDED
@@ -1,37 +1,42
1 1 #ifndef TM_BYTE_POSITIONS_H
2 2 #define TM_BYTE_POSITIONS_H
3 3
4 4 // SEQUENCE_CNT
5 5 #define PACKET_POS_SEQUENCE_CNT 6 // 4 + 2
6 6
7 7 // TC_LFR_LOAD_COMMON_PAR
8 8
9 9 // TC_LFR_LOAD_NORMAL_PAR
10 10 #define DATAFIELD_POS_SY_LFR_N_SWF_L 0
11 11 #define DATAFIELD_POS_SY_LFR_N_SWF_P 2
12 12 #define DATAFIELD_POS_SY_LFR_N_ASM_P 4
13 13 #define DATAFIELD_POS_SY_LFR_N_BP_P0 6
14 14 #define DATAFIELD_POS_SY_LFR_N_BP_P1 7
15 15 #define DATAFIELD_POS_SY_LFR_N_CWF_LONG_F3 8
16 16
17 17 // TC_LFR_LOAD_BURST_PAR
18 18 #define DATAFIELD_POS_SY_LFR_B_BP_P0 0
19 19 #define DATAFIELD_POS_SY_LFR_B_BP_P1 1
20 20
21 21 // TC_LFR_LOAD_SBM1_PAR
22 22 #define DATAFIELD_POS_SY_LFR_S1_BP_P0 0
23 23 #define DATAFIELD_POS_SY_LFR_S1_BP_P1 1
24 24
25 25 // TC_LFR_LOAD_SBM2_PAR
26 26 #define DATAFIELD_POS_SY_LFR_S2_BP_P0 0
27 27 #define DATAFIELD_POS_SY_LFR_S2_BP_P1 1
28 28
29 29 // TC_LFR_UPDATE_INFO
30 30 #define BYTE_POS_UPDATE_INFO_PARAMETERS_SET5 34
31 31 #define BYTE_POS_UPDATE_INFO_PARAMETERS_SET6 35
32 32
33 33 // TC_LFR_ENTER_MODE
34 34 #define BYTE_POS_CP_MODE_LFR_SET 11
35 35 #define BYTE_POS_CP_LFR_ENTER_MODE_TIME 12
36 36
37 // TC_LFR_LOAD_KCOEFFICIENTS
38 #define NB_BYTES_PER_FLOAT 4
39 #define DATAFIELD_POS_SY_LFR_KCOEFF_FREQUENCY 0 // 10 - 10
40 #define DATAFIELD_POS_SY_LFR_KCOEFF_1 2 // 12 - 10
41
37 42 #endif // TM_BYTE_POSITIONS_H
@@ -1,76 +1,77
1 1 #ifndef FSW_PARAMS_PROCESSING_H
2 2 #define FSW_PARAMS_PROCESSING_H
3 3
4 4 #define NB_BINS_PER_SM 128
5 5 #define NB_VALUES_PER_SM 25
6 6 #define TOTAL_SIZE_SM 3200 // 25 * 128 = 0xC80
7 7 #define TOTAL_SIZE_NORM_BP1_F0 99 // 11 * 9 = 99
8 8 #define TOTAL_SIZE_NORM_BP1_F1 117 // 13 * 9 = 117
9 9 #define TOTAL_SIZE_NORM_BP1_F2 108 // 12 * 9 = 108
10 10 #define TOTAL_SIZE_SBM1_BP1_F0 198 // 22 * 9 = 198
11 11 // F0
12 12 #define NB_RING_NODES_SM_F0 20 // AT LEAST 8 due to the way the averaging is done
13 13 #define NB_RING_NODES_ASM_BURST_SBM_F0 10 // AT LEAST 3
14 14 #define NB_RING_NODES_ASM_NORM_F0 10 // AT LEAST 3
15 15 #define NB_RING_NODES_ASM_F0 3 // AT LEAST 3
16 16 // F1
17 17 #define NB_RING_NODES_SM_F1 12 // AT LEAST 8 due to the way the averaging is done
18 18 #define NB_RING_NODES_ASM_BURST_SBM_F1 5 // AT LEAST 3
19 19 #define NB_RING_NODES_ASM_NORM_F1 5 // AT LEAST 3
20 20 #define NB_RING_NODES_ASM_F1 3 // AT LEAST 3
21 21 // F2
22 22 #define NB_RING_NODES_SM_F2 5 // AT LEAST 3
23 23 #define NB_RING_NODES_ASM_NORM_F2 3 // AT LEAST 3
24 24 #define NB_RING_NODES_ASM_F2 3 // AT LEAST 3
25 25 //
26 26 #define NB_BINS_PER_ASM_F0 88
27 27 #define NB_BINS_PER_PKT_ASM_F0 44
28 28 #define TOTAL_SIZE_ASM_F0_IN_BYTES 4400 // 25 * 88 * 2
29 29 #define ASM_F0_INDICE_START 16 // 17 - 1, (-1) due to the VHDL behaviour
30 30 #define ASM_F0_INDICE_STOP 103 // 104 - 1, 2 packets of 44 bins
31 31 //
32 32 #define NB_BINS_PER_ASM_F1 104
33 33 #define NB_BINS_PER_PKT_ASM_F1 52
34 34 #define TOTAL_SIZE_ASM_F1_IN_BYTES 5200 // 25 * 104 * 2
35 35 #define ASM_F1_INDICE_START 5 // 6 - 1, (-1) due to the VHDL behaviour
36 36 #define ASM_F1_INDICE_STOP 108 // 109 - 1, 2 packets of 52 bins
37 37 //
38 38 #define NB_BINS_PER_ASM_F2 96
39 39 #define NB_BINS_PER_PKT_ASM_F2 48
40 40 #define TOTAL_SIZE_ASM_F2_IN_BYTES 4800 // 25 * 96 * 2
41 41 #define ASM_F2_INDICE_START 6 // 7 - 1, (-1) due to the VHDL behaviour
42 42 #define ASM_F2_INDICE_STOP 101 // 102 - 1, 2 packets of 48 bins
43 43 //
44 #define KCOEFF_BLK_SIZE 130
44 45 #define NB_BINS_COMPRESSED_SM_F0 11
45 46 #define NB_BINS_COMPRESSED_SM_F1 13
46 47 #define NB_BINS_COMPRESSED_SM_F2 12
47 48 #define NB_BINS_COMPRESSED_SM 36 // 11 + 12 + 13
48 49 #define NB_BINS_COMPRESSED_SM_SBM_F0 22
49 50 #define NB_BINS_COMPRESSED_SM_SBM_F1 26
50 51 #define NB_BINS_COMPRESSED_SM_SBM_F2 24
51 52 //
52 53 #define NB_BYTES_PER_BP1 9
53 54 #define NB_BYTES_PER_BP2 30
54 55 //
55 56 #define NB_BINS_TO_AVERAGE_ASM_F0 8
56 57 #define NB_BINS_TO_AVERAGE_ASM_F1 8
57 58 #define NB_BINS_TO_AVERAGE_ASM_F2 8
58 59 #define NB_BINS_TO_AVERAGE_ASM_SBM_F0 4
59 60 #define NB_BINS_TO_AVERAGE_ASM_SBM_F1 4
60 61 #define NB_BINS_TO_AVERAGE_ASM_SBM_F2 4
61 62 //
62 63 #define TOTAL_SIZE_COMPRESSED_ASM_NORM_F0 275 // 11 * 25 WORDS
63 64 #define TOTAL_SIZE_COMPRESSED_ASM_NORM_F1 325 // 13 * 25 WORDS
64 65 #define TOTAL_SIZE_COMPRESSED_ASM_NORM_F2 300 // 12 * 25 WORDS
65 66 #define TOTAL_SIZE_COMPRESSED_ASM_SBM_F0 550 // 22 * 25 WORDS
66 67 #define TOTAL_SIZE_COMPRESSED_ASM_SBM_F1 650 // 26 * 25 WORDS
67 68 #define TOTAL_SIZE_BP1_NORM_F0 99 // 9 * 11 UNSIGNED CHAR
68 69 #define TOTAL_SIZE_BP2_NORM_F0 330 // 30 * 11 UNSIGNED CHAR
69 70 #define TOTAL_SIZE_BP1_SBM_F0 198 // 9 * 22 UNSIGNED CHAR
70 71 // GENERAL
71 72 #define NB_SM_BEFORE_AVF0 8 // must be 8 due to the SM_average() function
72 73 #define NB_SM_BEFORE_AVF1 8 // must be 8 due to the SM_average() function
73 74 #define NB_SM_BEFORE_AVF2 1 // must be 1 due to the SM_average_f2() function
74 75
75 76 #endif // FSW_PARAMS_PROCESSING_H
76 77
@@ -1,23 +1,14
1 1 #ifndef TM_BYTE_POSITIONS_H
2 2 #define TM_BYTE_POSITIONS_H
3 3
4 4 #define BYTE_POS_CP_LFR_MODE 11
5 5
6 // TC_LFR_LOAD_COMMON_PAR
7
8 6 // TC_LFR_LOAD_NORMAL_PAR
9 7 #define BYTE_POS_SY_LFR_N_SWF_L 0
10 8 #define BYTE_POS_SY_LFR_N_SWF_P 2
11 9 #define BYTE_POS_SY_LFR_N_ASM_P 4
12 10 #define BYTE_POS_SY_LFR_N_BP_P0 6
13 11 #define BYTE_POS_SY_LFR_N_BP_P1 7
14 12 #define BYTE_POS_SY_LFR_N_CWF_LONG_F3 8
15 13
16 // TC_LFR_LOAD_BURST_PAR
17
18 // TC_LFR_LOAD_SBM1_PAR
19
20 // TC_LFR_LOAD_SBM2_PAR
21
22
23 14 #endif // TM_BYTE_POSITIONS_H
General Comments 0
You need to be logged in to leave comments. Login now