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