##// END OF EJS Templates
Removed few unused macros
jeandet -
r71:321ffad81ce6 Next draft
parent child
Show More
@@ -1,907 +1,906
1 1 #ifndef CCSDS_TYPES_H_INCLUDED
2 2 #define CCSDS_TYPES_H_INCLUDED
3 3
4 4 #define TXBDCNT 50
5 5 #define RXBDCNT 10
6 6 #define TXDATASIZE 4096
7 7 #define TXHDRSIZE 34
8 8 #define RXPKTSIZE 200
9 9
10 10 #define SPW_RXSIZE 228
11 11 #define SPW_TXDSIZE 4096
12 12 #define SPW_TXHSIZE 64
13 13
14 14 #define BITS_PID_0 0x07
15 15 #define BITS_PID_1 0x0f
16 16 #define BITS_CAT 0x0f
17 17
18 18 #define CCSDS_PROTOCOLE_EXTRA_BYTES 4
19 19 #define CCSDS_TC_TM_PACKET_OFFSET 7
20 20 #define PROTID_RES_APP 3
21 21 #define CCSDS_TELEMETRY_HEADER_LENGTH (16+4)
22 22 #define CCSDS_TC_HEADER_LENGTH 10
23 23 #define CCSDS_TM_PKT_MAX_SIZE 4412
24 24 #define CCSDS_TELECOMMAND_HEADER_LENGTH (10+4)
25 25 #define CCSDS_TC_PKT_MAX_SIZE 232 // (228+3) with 3 for Prot ID, Reserved and User App bytes, SHALL BE A MULTIPLE OF 4
26 26 #define CCSDS_TC_PKT_MIN_SIZE 16
27 27 #define CCSDS_PROCESS_ID 76
28 28 #define CCSDS_PACKET_CATEGORY 12
29 29 #define CCSDS_NODE_ADDRESS 0xfe
30 30 #define CCSDS_USER_APP 0x00
31 31
32 32 #define DEFAULT_SPARE1_PUSVERSION_SPARE2 0x10
33 33 #define DEFAULT_RESERVED 0x00
34 34 #define DEFAULT_HKBIA 0x1e // 0001 1110
35 35
36 36 // PACKET ID
37 37 #define TM_PACKET_PID_DEFAULT 76
38 38 #define TM_PACKET_PID_BURST_SBM1_SBM2 79
39 39 #define APID_TM_TC_EXE 0x0cc1 // PID 76 CAT 1
40 40 #define APID_TM_HK 0x0cc4 // PID 76 CAT 4
41 41 #define APID_TM_SCIENCE_NORMAL_BURST 0x0ccc // PID 76 CAT 12
42 42 #define APID_TM_SCIENCE_SBM1_SBM2 0x0cfc // PID 79 CAT 12
43 43 #define APID_TM_PARAMETER_DUMP 0x0cc6 // PID 76 CAT 6
44 #define APID_TM_KCOEFFICIENTS_DUMP 0x0cc6 // PID 76 CAT 6
45 44
46 45 // PACKET CAT
47 46 #define TM_PACKET_CAT_TC_EXE 1
48 47 #define TM_PACKET_CAT_HK 4
49 48 #define TM_PACKET_CAT_SCIENCE 12
50 49 #define TM_PACKET_CAT_DUMP 6
51 50
52 51 // PACKET SEQUENCE CONTROL
53 52 #define TM_PACKET_SEQ_CTRL_CONTINUATION 0x00 // [0000 0000]
54 53 #define TM_PACKET_SEQ_CTRL_FIRST 0x40 // [0100 0000]
55 54 #define TM_PACKET_SEQ_CTRL_LAST 0x80 // [1000 0000]
56 55 #define TM_PACKET_SEQ_CTRL_STANDALONE 0xc0 // [1100 0000]
57 56 #define TM_PACKET_SEQ_CNT_DEFAULT 0x00 // [0000 0000]
58 57 #define TM_PACKET_SEQ_SHIFT 8
59 58 #define SEQ_CNT_MAX 16383
60 59 #define SEQ_CNT_NB_DEST_ID 12
61 60 #define SEQ_CNT_MASK 0x3fff // [0011 1111 1111 1111]
62 61
63 62 // DESTINATION ID
64 63 #define TM_DESTINATION_ID_GROUND 0
65 64 #define TM_DESTINATION_ID_MISSION_TIMELINE 110
66 65 #define TM_DESTINATION_ID_TC_SEQUENCES 111
67 66 #define TM_DESTINATION_ID_RECOVERY_ACTION_COMMAND 112
68 67 #define TM_DESTINATION_ID_BACKUP_MISSION_TIMELINE 113
69 68 #define TM_DESTINATION_ID_DIRECT_CMD 120
70 69 #define TM_DESTINATION_ID_SPARE_GRD_SRC1 121
71 70 #define TM_DESTINATION_ID_SPARE_GRD_SRC2 122
72 71 #define TM_DESTINATION_ID_OBCP 15
73 72 #define TM_DESTINATION_ID_SYSTEM_CONTROL 14
74 73 #define TM_DESTINATION_ID_AOCS 11
75 74
76 75 //*********************************************************
77 76 //*** /!\ change CCSDS_DESTINATION_ID before flight /!\ ***
78 77 //*********************************************************
79 78 #ifdef LPP_DPU_DESTID
80 79 #define CCSDS_DESTINATION_ID 32
81 80 #else
82 81 #define CCSDS_DESTINATION_ID 0x01
83 82 #endif
84 83 #define CCSDS_PROTOCOLE_ID 0x02
85 84 #define CCSDS_RESERVED 0x00
86 85 #define CCSDS_USER_APP 0x00
87 86
88 87 #define SIZE_TM_LFR_TC_EXE_NOT_IMPLEMENTED 24
89 88 #define SIZE_TM_LFR_TC_EXE_CORRUPTED 32
90 89 #define SIZE_HK_PARAMETERS 112
91 90
92 91 // TC TYPES
93 92 #define TC_TYPE_GEN 181
94 93 #define TC_TYPE_TIME 9
95 94
96 95 // TC SUBTYPES
97 96 #define TC_SUBTYPE_RESET 1
98 97 #define TC_SUBTYPE_LOAD_COMM 11
99 98 #define TC_SUBTYPE_LOAD_NORM 13
100 99 #define TC_SUBTYPE_LOAD_BURST 19
101 100 #define TC_SUBTYPE_LOAD_SBM1 25
102 101 #define TC_SUBTYPE_LOAD_SBM2 27
103 102 #define TC_SUBTYPE_DUMP 31
104 103 #define TC_SUBTYPE_ENTER 41
105 104 #define TC_SUBTYPE_UPDT_INFO 51
106 105 #define TC_SUBTYPE_EN_CAL 61
107 106 #define TC_SUBTYPE_DIS_CAL 63
108 107 #define TC_SUBTYPE_LOAD_K 93
109 108 #define TC_SUBTYPE_DUMP_K 95
110 109 #define TC_SUBTYPE_LOAD_FBINS 91
111 110 #define TC_SUBTYPE_LOAD_FILTER_PAR 97
112 111 #define TC_SUBTYPE_UPDT_TIME 129
113 112
114 113 // TC LEN
115 114 #define TC_LEN_RESET 12
116 115 #define TC_LEN_LOAD_COMM 14
117 116 #define TC_LEN_LOAD_NORM 22
118 117 #define TC_LEN_LOAD_BURST 14
119 118 #define TC_LEN_LOAD_SBM1 14
120 119 #define TC_LEN_LOAD_SBM2 14
121 120 #define TC_LEN_DUMP 12
122 121 #define TC_LEN_ENTER 20
123 122 #define TC_LEN_UPDT_INFO 110
124 123 #define TC_LEN_EN_CAL 12
125 124 #define TC_LEN_DIS_CAL 12
126 125 #define TC_LEN_LOAD_K 142
127 126 #define TC_LEN_DUMP_K 12
128 127 #define TC_LEN_LOAD_FBINS 60
129 128 #define TC_LEN_LOAD_FILTER_PAR 92
130 129 #define TC_LEN_UPDT_TIME 18
131 130
132 131 // PACKET CODES
133 132 #define TM_CODE_K_DUMP 0xb5600b00 // 181 (0xb5) ** 96 (0x60) ** 11 (0x0b) ** 0 (0x00)
134 133
135 134 // TM TYPES
136 135 #define TM_TYPE_TC_EXE 1
137 136 #define TM_TYPE_HK 3
138 137 #define TM_TYPE_LFR_SCIENCE 21
139 138 #define TM_TYPE_PARAMETER_DUMP 181
140 139 #define TM_TYPE_K_DUMP 181
141 140
142 141 // TM SUBTYPES
143 142 #define TM_SUBTYPE_EXE_OK 7
144 143 #define TM_SUBTYPE_EXE_NOK 8
145 144 #define TM_SUBTYPE_HK 25
146 145 #define TM_SUBTYPE_LFR_SCIENCE_3 3 // TM packets with fixed size
147 146 #define TM_SUBTYPE_LFR_SCIENCE_6 6 // TM packets with variable size
148 147 #define TM_SUBTYPE_PARAMETER_DUMP 32
149 148 #define TM_SUBTYPE_K_DUMP 96
150 149
151 150 // FAILURE CODES
152 151 #define ILLEGAL_APID 0
153 152 #define WRONG_LEN_PKT 1
154 153 #define INCOR_CHECKSUM 2
155 154 #define ILL_TYPE 3
156 155 #define ILL_SUBTYPE 4
157 156 #define WRONG_APP_DATA 5 // 0x00 0x05
158 157 #define TC_NOT_EXE 42000 // 0xa4 0x10
159 158 #define WRONG_SRC_ID 42001 // 0xa4 0x11
160 159 #define FUNCT_NOT_IMPL 42002 // 0xa4 0x12
161 160 #define FAIL_DETECTED 42003 // 0xa4 0x13
162 161 #define NOT_ALLOWED 42004 // 0xa4 0x14
163 162 #define CORRUPTED 42005 // 0xa4 0x15
164 163 #define CCSDS_TM_VALID 7
165 164
166 165 // HK_LFR_LAST_ER_RID
167 166 #define RID_LE_LFR_TIME 42119
168 167 #define RID_LE_LFR_DPU_SPW 42128
169 168 #define RID_LE_LFR_TIMEC 42129
170 169 #define RID_ME_LFR_DPU_SPW 42338
171 170 // HK_LFR_LAST_ER_CODE
172 171 #define CODE_PARITY 1
173 172 #define CODE_DISCONNECT 2
174 173 #define CODE_ESCAPE 3
175 174 #define CODE_CREDIT 4
176 175 #define CODE_WRITE_SYNC 5
177 176 #define CODE_EARLY_EOP_EEP 6
178 177 #define CODE_INVALID_ADDRESS 7
179 178 #define CODE_EEP 8
180 179 #define CODE_RX_TOO_BIG 9
181 180 #define CODE_HEADER_CRC 16
182 181 #define CODE_DATA_CRC 17
183 182 #define CODE_ERRONEOUS 20
184 183 #define CODE_MISSING 21
185 184 #define CODE_INVALID 22
186 185 #define CODE_TIMECODE_IT 24
187 186 #define CODE_NOT_SYNCHRO 25
188 187 #define CODE_TIMECODE_CTR 26
189 188
190 189 // TC SID
191 190 #define SID_TC_GROUND 0
192 191 #define SID_TC_MISSION_TIMELINE 110
193 192 #define SID_TC_TC_SEQUENCES 111
194 193 #define SID_TC_RECOVERY_ACTION_CMD 112
195 194 #define SID_TC_BACKUP_MISSION_TIMELINE 113
196 195 #define SID_TC_DIRECT_CMD 120
197 196 #define SID_TC_SPARE_GRD_SRC1 121
198 197 #define SID_TC_SPARE_GRD_SRC2 122
199 198 #define SID_TC_OBCP 15
200 199 #define SID_TC_SYSTEM_CONTROL 14
201 200 #define SID_TC_AOCS 11
202 201 #define SID_TC_RPW_INTERNAL 254
203 202
204 203 enum apid_destid{
205 204 GROUND,
206 205 MISSION_TIMELINE,
207 206 TC_SEQUENCES,
208 207 RECOVERY_ACTION_CMD,
209 208 BACKUP_MISSION_TIMELINE,
210 209 DIRECT_CMD,
211 210 SPARE_GRD_SRC1,
212 211 SPARE_GRD_SRC2,
213 212 OBCP,
214 213 SYSTEM_CONTROL,
215 214 AOCS,
216 215 RPW_INTERNAL
217 216 };
218 217
219 218 // TM SID
220 219 #define SID_HK 1
221 220
222 221 #define SID_NORM_SWF_F0 3
223 222 #define SID_NORM_SWF_F1 4
224 223 #define SID_NORM_SWF_F2 5
225 224 #define SID_NORM_CWF_F3 1
226 225 #define SID_BURST_CWF_F2 2
227 226 #define SID_SBM1_CWF_F1 24
228 227 #define SID_SBM2_CWF_F2 25
229 228 #define SID_NORM_ASM_F0 11
230 229 #define SID_NORM_ASM_F1 12
231 230 #define SID_NORM_ASM_F2 13
232 231 #define SID_NORM_BP1_F0 14
233 232 #define SID_NORM_BP1_F1 15
234 233 #define SID_NORM_BP1_F2 16
235 234 #define SID_NORM_BP2_F0 19
236 235 #define SID_NORM_BP2_F1 20
237 236 #define SID_NORM_BP2_F2 21
238 237 #define SID_BURST_BP1_F0 17
239 238 #define SID_BURST_BP2_F0 22
240 239 #define SID_BURST_BP1_F1 18
241 240 #define SID_BURST_BP2_F1 23
242 241 #define SID_SBM1_BP1_F0 28
243 242 #define SID_SBM1_BP2_F0 31
244 243 #define SID_SBM2_BP1_F0 29
245 244 #define SID_SBM2_BP2_F0 32
246 245 #define SID_SBM2_BP1_F1 30
247 246 #define SID_SBM2_BP2_F1 33
248 247 #define SID_NORM_CWF_LONG_F3 34
249 248
250 249 #define SID_PARAMETER_DUMP 10
251 250 #define SID_K_DUMP 11
252 251
253 252 // HEADER_LENGTH
254 253 //#define TM_HEADER_LEN 16
255 254 #define HEADER_LENGTH_TM_LFR_SCIENCE_CWF 32
256 255 #define HEADER_LENGTH_TM_LFR_SCIENCE_SWF 34
257 256 #define HEADER_LENGTH_TM_LFR_SCIENCE_ASM 34
258 257 // PACKET_LENGTH
259 258 #define PACKET_LENGTH_TC_EXE_SUCCESS (20 - CCSDS_TC_TM_PACKET_OFFSET)
260 259 #define PACKET_LENGTH_TC_EXE_INCONSISTENT (26 - CCSDS_TC_TM_PACKET_OFFSET)
261 260 #define PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE (26 - CCSDS_TC_TM_PACKET_OFFSET)
262 261 #define PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED (24 - CCSDS_TC_TM_PACKET_OFFSET)
263 262 #define PACKET_LENGTH_TC_EXE_ERROR (24 - CCSDS_TC_TM_PACKET_OFFSET)
264 263 #define PACKET_LENGTH_TC_EXE_CORRUPTED (32 - CCSDS_TC_TM_PACKET_OFFSET)
265 264 #define PACKET_LENGTH_HK (136 - CCSDS_TC_TM_PACKET_OFFSET)
266 265 #define PACKET_LENGTH_PARAMETER_DUMP (212 - CCSDS_TC_TM_PACKET_OFFSET)
267 266 #define PACKET_LENGTH_K_DUMP (3920 - CCSDS_TC_TM_PACKET_OFFSET)
268 267 // SCIENCE ASM
269 268 #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
270 269 #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
271 270 #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
272 271 #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
273 272 #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
274 273 // SCIENCE NORM
275 274 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F0 (150 - CCSDS_TC_TM_PACKET_OFFSET) // 11 * 11 + 29 (1 spare byte in the header)
276 275 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F1 (172 - CCSDS_TC_TM_PACKET_OFFSET) // 13 * 11 + 29 (1 spare byte in the header)
277 276 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F2 (160 - CCSDS_TC_TM_PACKET_OFFSET) // 12 * 11 + 28
278 277 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F0 (358 - CCSDS_TC_TM_PACKET_OFFSET) // 11 * 30 + 28
279 278 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F1 (418 - CCSDS_TC_TM_PACKET_OFFSET) // 13 * 30 + 28
280 279 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F2 (388 - CCSDS_TC_TM_PACKET_OFFSET) // 12 * 30 + 28
281 280 // SCIENCE SBM
282 281 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F0 (270 - CCSDS_TC_TM_PACKET_OFFSET) // 22 * 11 + 28
283 282 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F0 (688 - CCSDS_TC_TM_PACKET_OFFSET) // 22 * 30 + 28
284 283 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F1 (314 - CCSDS_TC_TM_PACKET_OFFSET) // 26 * 11 + 28
285 284 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F1 (808 - CCSDS_TC_TM_PACKET_OFFSET) // 26 * 30 + 28
286 285
287 286 #define PACKET_LENGTH_DELTA 11 // 7 + 4
288 287
289 288 #define SPARE1_PUSVERSION_SPARE2 0x10
290 289
291 290 // R3
292 291 // one snapshot = 2048 samples = 6 packets * 304 + 224
293 292 #define TM_LEN_SCI_SWF_304 (3678 - CCSDS_TC_TM_PACKET_OFFSET) // 304 * 12 + 30
294 293 #define TM_LEN_SCI_SWF_224 (2718 - CCSDS_TC_TM_PACKET_OFFSET) // 224 * 12 + 30
295 294 // one continuous buffer = 2688 samples = 8 packets * 336
296 295 #define TM_LEN_SCI_CWF_336 (4060 - CCSDS_TC_TM_PACKET_OFFSET) // 336 * 12 + 28
297 296 #define TM_LEN_SCI_CWF_672 (4060 - CCSDS_TC_TM_PACKET_OFFSET) // 672 * 6 + 28
298 297 //
299 298 #define PKTCNT_SWF 0x07
300 299 #define PKTCNT_ASM 3
301 300 #define BLK_NR_304 0x0130
302 301 #define BLK_NR_224 0x00e0
303 302 #define BLK_NR_CWF 0x0150 // 336
304 303 #define BLK_NR_CWF_SHORT_F3 0x02a0 // 672
305 304
306 305 enum TM_TYPE{
307 306 TM_LFR_TC_EXE_OK,
308 307 TM_LFR_TC_EXE_ERR,
309 308 TM_LFR_HK,
310 309 TM_LFR_SCI,
311 310 TM_LFR_SCI_SBM,
312 311 TM_LFR_PAR_DUMP
313 312 };
314 313
315 314 #define BYTES_PER_PACKETID 2
316 315 #define BYTES_PER_SEQ_CTRL 2
317 316 #define BYTES_PER_PKT_LEN 2
318 317 #define BYTES_PER_TIME 6
319 318 #define BYTES_PER_ERR_CODE 2
320 319 #define BYTES_PER_STA_WRD 2
321 320 #define BYTES_PER_CRC 2
322 321 #define BYTES_PER_BLKNR 2
323 322 #define BYTES_PER_SW_VER 4
324 323 #define BYTES_PER_VHD_VER 3
325 324 #define COUNTER_2_BYTES 2
326 325 #define BYTES_PER_TYPE 2
327 326 #define BYTES_PER_SUBTYPE 2
328 327 #define BYTES_PER_ADDR 4
329 328 #define BYTES_PER_TEMP 2
330 329 #define BYTES_PER_V 2
331 330 #define BYTES_PER_WORD 4
332 331 #define BYTES_PER_MASK 16
333 332 #define BYTES_PER_MASKS_SET 48 // 4 * 4 * 3
334 333
335 334 #define COUNTER_2_BYTES 2
336 335 #define PARAM_2_BYTES 2
337 336 #define PARAM_4_BYTES 4
338 337
339 338 typedef struct {
340 339 unsigned char targetLogicalAddress;
341 340 unsigned char protocolIdentifier;
342 341 unsigned char reserved;
343 342 unsigned char userApplication;
344 343 // PACKET HEADER
345 344 unsigned char packetID[BYTES_PER_PACKETID];
346 345 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
347 346 unsigned char packetLength[BYTES_PER_PKT_LEN];
348 347 // DATA FIELD HEADER
349 348 unsigned char spare1_pusVersion_spare2;
350 349 unsigned char serviceType;
351 350 unsigned char serviceSubType;
352 351 unsigned char destinationID;
353 352 unsigned char time[BYTES_PER_TIME];
354 353 //
355 354 unsigned char telecommand_pkt_id[BYTES_PER_PACKETID];
356 355 unsigned char pkt_seq_control[BYTES_PER_SEQ_CTRL];
357 356 } Packet_TM_LFR_TC_EXE_SUCCESS_t;
358 357
359 358 typedef struct {
360 359 unsigned char targetLogicalAddress;
361 360 unsigned char protocolIdentifier;
362 361 unsigned char reserved;
363 362 unsigned char userApplication;
364 363 // PACKET HEADER
365 364 unsigned char packetID[BYTES_PER_PACKETID];
366 365 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
367 366 unsigned char packetLength[BYTES_PER_PKT_LEN];
368 367 // DATA FIELD HEADER
369 368 unsigned char spare1_pusVersion_spare2;
370 369 unsigned char serviceType;
371 370 unsigned char serviceSubType;
372 371 unsigned char destinationID;
373 372 unsigned char time[BYTES_PER_TIME];
374 373 //
375 374 unsigned char telecommand_pkt_id[BYTES_PER_PACKETID];
376 375 unsigned char pkt_seq_control[BYTES_PER_SEQ_CTRL];
377 376 unsigned char tc_failure_code[BYTES_PER_ERR_CODE];
378 377 unsigned char tc_service;
379 378 unsigned char tc_subtype;
380 379 unsigned char byte_position;
381 380 unsigned char rcv_value;
382 381 } Packet_TM_LFR_TC_EXE_INCONSISTENT_t;
383 382
384 383 typedef struct {
385 384 unsigned char targetLogicalAddress;
386 385 unsigned char protocolIdentifier;
387 386 unsigned char reserved;
388 387 unsigned char userApplication;
389 388 // PACKET HEADER
390 389 unsigned char packetID[BYTES_PER_PACKETID];
391 390 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
392 391 unsigned char packetLength[BYTES_PER_PKT_LEN];
393 392 // DATA FIELD HEADER
394 393 unsigned char spare1_pusVersion_spare2;
395 394 unsigned char serviceType;
396 395 unsigned char serviceSubType;
397 396 unsigned char destinationID;
398 397 unsigned char time[BYTES_PER_TIME];
399 398 //
400 399 unsigned char telecommand_pkt_id[BYTES_PER_PACKETID];
401 400 unsigned char pkt_seq_control[BYTES_PER_SEQ_CTRL];
402 401 unsigned char tc_failure_code[BYTES_PER_ERR_CODE];
403 402 unsigned char tc_service;
404 403 unsigned char tc_subtype;
405 404 unsigned char lfr_status_word[2];
406 405 } Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_t;
407 406
408 407 typedef struct {
409 408 unsigned char targetLogicalAddress;
410 409 unsigned char protocolIdentifier;
411 410 unsigned char reserved;
412 411 unsigned char userApplication;
413 412 // PACKET HEADER
414 413 unsigned char packetID[BYTES_PER_PACKETID];
415 414 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
416 415 unsigned char packetLength[BYTES_PER_PKT_LEN];
417 416 // DATA FIELD HEADER
418 417 unsigned char spare1_pusVersion_spare2;
419 418 unsigned char serviceType;
420 419 unsigned char serviceSubType;
421 420 unsigned char destinationID;
422 421 unsigned char time[BYTES_PER_TIME];
423 422 //
424 423 unsigned char telecommand_pkt_id[BYTES_PER_PACKETID];
425 424 unsigned char pkt_seq_control[BYTES_PER_SEQ_CTRL];
426 425 unsigned char tc_failure_code[BYTES_PER_ERR_CODE];
427 426 unsigned char tc_service;
428 427 unsigned char tc_subtype;
429 428 } Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_t;
430 429
431 430 typedef struct {
432 431 unsigned char targetLogicalAddress;
433 432 unsigned char protocolIdentifier;
434 433 unsigned char reserved;
435 434 unsigned char userApplication;
436 435 // PACKET HEADER
437 436 unsigned char packetID[BYTES_PER_PACKETID];
438 437 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
439 438 unsigned char packetLength[BYTES_PER_PKT_LEN];
440 439 // DATA FIELD HEADER
441 440 unsigned char spare1_pusVersion_spare2;
442 441 unsigned char serviceType;
443 442 unsigned char serviceSubType;
444 443 unsigned char destinationID;
445 444 unsigned char time[BYTES_PER_TIME];
446 445 //
447 446 unsigned char telecommand_pkt_id[BYTES_PER_PACKETID];
448 447 unsigned char pkt_seq_control[BYTES_PER_SEQ_CTRL];
449 448 unsigned char tc_failure_code[BYTES_PER_ERR_CODE];
450 449 unsigned char tc_service;
451 450 unsigned char tc_subtype;
452 451 } Packet_TM_LFR_TC_EXE_ERROR_t;
453 452
454 453 typedef struct {
455 454 unsigned char targetLogicalAddress;
456 455 unsigned char protocolIdentifier;
457 456 unsigned char reserved;
458 457 unsigned char userApplication;
459 458 // PACKET HEADER
460 459 unsigned char packetID[BYTES_PER_PACKETID];
461 460 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
462 461 unsigned char packetLength[BYTES_PER_PKT_LEN];
463 462 // DATA FIELD HEADER
464 463 unsigned char spare1_pusVersion_spare2;
465 464 unsigned char serviceType;
466 465 unsigned char serviceSubType;
467 466 unsigned char destinationID;
468 467 unsigned char time[BYTES_PER_TIME];
469 468 //
470 469 unsigned char telecommand_pkt_id[BYTES_PER_PACKETID];
471 470 unsigned char pkt_seq_control[BYTES_PER_SEQ_CTRL];
472 471 unsigned char tc_failure_code[BYTES_PER_ERR_CODE];
473 472 unsigned char tc_service;
474 473 unsigned char tc_subtype;
475 474 unsigned char pkt_len_rcv_value[BYTES_PER_PKT_LEN];
476 475 unsigned char pkt_datafieldsize_cnt[BYTES_PER_PKT_LEN];
477 476 unsigned char rcv_crc[BYTES_PER_CRC];
478 477 unsigned char computed_crc[BYTES_PER_CRC];
479 478 } Packet_TM_LFR_TC_EXE_CORRUPTED_t;
480 479
481 480 typedef struct {
482 481 unsigned char targetLogicalAddress;
483 482 unsigned char protocolIdentifier;
484 483 unsigned char reserved;
485 484 unsigned char userApplication;
486 485 unsigned char packetID[BYTES_PER_PACKETID];
487 486 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
488 487 unsigned char packetLength[BYTES_PER_PKT_LEN];
489 488 // DATA FIELD HEADER
490 489 unsigned char spare1_pusVersion_spare2;
491 490 unsigned char serviceType;
492 491 unsigned char serviceSubType;
493 492 unsigned char destinationID;
494 493 unsigned char time[BYTES_PER_TIME];
495 494 // AUXILIARY HEADER
496 495 unsigned char sid;
497 496 unsigned char pa_bia_status_info;
498 497 unsigned char sy_lfr_common_parameters_spare;
499 498 unsigned char sy_lfr_common_parameters;
500 499 unsigned char pktCnt;
501 500 unsigned char pktNr;
502 501 unsigned char acquisitionTime[BYTES_PER_TIME];
503 502 unsigned char blkNr[BYTES_PER_BLKNR];
504 503 } Header_TM_LFR_SCIENCE_SWF_t;
505 504
506 505 //*******************
507 506 // TM_LFR_SCIENCE_CWF
508 507
509 508 #define CWF_BLK_SIZE 6
510 509
511 510 typedef struct {
512 511 unsigned char targetLogicalAddress;
513 512 unsigned char protocolIdentifier;
514 513 unsigned char reserved;
515 514 unsigned char userApplication;
516 515 unsigned char packetID[BYTES_PER_PACKETID];
517 516 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
518 517 unsigned char packetLength[BYTES_PER_PKT_LEN];
519 518 // DATA FIELD HEADER
520 519 unsigned char spare1_pusVersion_spare2;
521 520 unsigned char serviceType;
522 521 unsigned char serviceSubType;
523 522 unsigned char destinationID;
524 523 unsigned char time[BYTES_PER_TIME];
525 524 // AUXILIARY DATA HEADER
526 525 unsigned char sid;
527 526 unsigned char pa_bia_status_info;
528 527 unsigned char sy_lfr_common_parameters_spare;
529 528 unsigned char sy_lfr_common_parameters;
530 529 unsigned char acquisitionTime[BYTES_PER_TIME];
531 530 unsigned char blkNr[BYTES_PER_BLKNR];
532 531 } Header_TM_LFR_SCIENCE_CWF_t;
533 532
534 533 typedef struct {
535 534 unsigned char targetLogicalAddress;
536 535 unsigned char protocolIdentifier;
537 536 unsigned char reserved;
538 537 unsigned char userApplication;
539 538 unsigned char packetID[BYTES_PER_PACKETID];
540 539 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
541 540 unsigned char packetLength[BYTES_PER_PKT_LEN];
542 541 // DATA FIELD HEADER
543 542 unsigned char spare1_pusVersion_spare2;
544 543 unsigned char serviceType;
545 544 unsigned char serviceSubType;
546 545 unsigned char destinationID;
547 546 unsigned char time[BYTES_PER_TIME];
548 547 // AUXILIARY HEADER
549 548 unsigned char sid;
550 549 unsigned char pa_bia_status_info;
551 550 unsigned char sy_lfr_common_parameters_spare;
552 551 unsigned char sy_lfr_common_parameters;
553 552 unsigned char pa_lfr_pkt_cnt_asm;
554 553 unsigned char pa_lfr_pkt_nr_asm;
555 554 unsigned char acquisitionTime[BYTES_PER_TIME];
556 555 unsigned char pa_lfr_asm_blk_nr[BYTES_PER_BLKNR];
557 556 } Header_TM_LFR_SCIENCE_ASM_t;
558 557
559 558 typedef struct {
560 559 unsigned char targetLogicalAddress;
561 560 unsigned char protocolIdentifier;
562 561 unsigned char reserved;
563 562 unsigned char userApplication;
564 563 unsigned char packetID[BYTES_PER_PACKETID];
565 564 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
566 565 unsigned char packetLength[BYTES_PER_PKT_LEN];
567 566 // DATA FIELD HEADER
568 567 unsigned char spare1_pusVersion_spare2;
569 568 unsigned char serviceType;
570 569 unsigned char serviceSubType;
571 570 unsigned char destinationID;
572 571 unsigned char time[BYTES_PER_TIME];
573 572 // AUXILIARY HEADER
574 573 unsigned char sid;
575 574 unsigned char pa_bia_status_info;
576 575 unsigned char sy_lfr_common_parameters_spare;
577 576 unsigned char sy_lfr_common_parameters;
578 577 unsigned char acquisitionTime[BYTES_PER_TIME];
579 578 unsigned char source_data_spare;
580 579 unsigned char pa_lfr_bp_blk_nr[BYTES_PER_BLKNR];
581 580 } Header_TM_LFR_SCIENCE_BP_with_spare_t;
582 581
583 582 typedef struct {
584 583 unsigned char targetLogicalAddress;
585 584 unsigned char protocolIdentifier;
586 585 unsigned char reserved;
587 586 unsigned char userApplication;
588 587 unsigned char packetID[BYTES_PER_PACKETID];
589 588 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
590 589 unsigned char packetLength[BYTES_PER_PKT_LEN];
591 590 // DATA FIELD HEADER
592 591 unsigned char spare1_pusVersion_spare2;
593 592 unsigned char serviceType;
594 593 unsigned char serviceSubType;
595 594 unsigned char destinationID;
596 595 unsigned char time[BYTES_PER_TIME];
597 596 // AUXILIARY HEADER
598 597 unsigned char sid;
599 598 unsigned char pa_bia_status_info;
600 599 unsigned char sy_lfr_common_parameters_spare;
601 600 unsigned char sy_lfr_common_parameters;
602 601 unsigned char acquisitionTime[BYTES_PER_TIME];
603 602 unsigned char pa_lfr_bp_blk_nr[BYTES_PER_BLKNR];
604 603 } Header_TM_LFR_SCIENCE_BP_t;
605 604
606 605 typedef struct {
607 606 // TARGET LOGICAL ADDRESS (targetLogicalAddress) IS REMOVED BY THE GRSPW MODULE
608 607 unsigned char protocolIdentifier;
609 608 unsigned char reserved;
610 609 unsigned char userApplication;
611 610 unsigned char packetID[BYTES_PER_PACKETID];
612 611 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
613 612 unsigned char packetLength[BYTES_PER_PKT_LEN];
614 613 // DATA FIELD HEADER
615 614 unsigned char headerFlag_pusVersion_Ack;
616 615 unsigned char serviceType;
617 616 unsigned char serviceSubType;
618 617 unsigned char sourceID;
619 618 unsigned char dataAndCRC[CCSDS_TC_PKT_MAX_SIZE-CCSDS_TC_HEADER_LENGTH];
620 619 } ccsdsTelecommandPacket_t;
621 620
622 621 //**********
623 622 //**********
624 623 // TM_LFR_HK
625 624
626 625 #define STATUS_WORD_SC_POTENTIAL_FLAG_BIT 0x40 // [0100 0000]
627 626 #define STATUS_WORD_SC_POTENTIAL_FLAG_MASK 0xbf // [1011 1111]
628 627 #define STATUS_WORD_PAS_FILTER_ENABLED_BIT 0x20 // [0010 0000]
629 628 #define STATUS_WORD_PAS_FILTER_ENABLED_MASK 0xdf // [1101 1111]
630 629 #define STATUS_WORD_WATCHDOG_BIT 0x10 // [0001 0000]
631 630 #define STATUS_WORD_WATCHDOG_MASK 0xef // [1110 1111]
632 631 #define STATUS_WORD_CALIB_BIT 0x08 // [0000 1000]
633 632 #define STATUS_WORD_CALIB_MASK 0xf7 // [1111 0111]
634 633 #define STATUS_WORD_RESET_CAUSE_BITS 0x07 // [0000 0111]
635 634 #define STATUS_WORD_RESET_CAUSE_MASK 0xf8 // [1111 1000]
636 635 #define STATUS_WORD_LINK_STATE_BITS 0x07 // [0000 0111]
637 636 #define STATUS_WORD_LINK_STATE_MASK 0xf8 // [1111 1000]
638 637 #define STATUS_WORD_LFR_MODE_SHIFT 4
639 638 #define STATUS_WORD_LFR_MODE_BITS 0xf0 // [1111 0000]
640 639 #define STATUS_WORD_LFR_MODE_MASK 0x0f // [0000 1111]
641 640 #define STATUS_WORD_0_DEFAULT 0x0d // [0000 1101]
642 641
643 642 typedef struct {
644 643 unsigned char targetLogicalAddress;
645 644 unsigned char protocolIdentifier;
646 645 unsigned char reserved;
647 646 unsigned char userApplication;
648 647 unsigned char packetID[BYTES_PER_PACKETID];
649 648 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
650 649 unsigned char packetLength[BYTES_PER_PKT_LEN];
651 650 unsigned char spare1_pusVersion_spare2;
652 651 unsigned char serviceType;
653 652 unsigned char serviceSubType;
654 653 unsigned char destinationID;
655 654 unsigned char time[BYTES_PER_TIME];
656 655 unsigned char sid;
657 656
658 657 //**************
659 658 // HK PARAMETERS
660 659 unsigned char lfr_status_word[BYTES_PER_STA_WRD];
661 660 unsigned char lfr_sw_version[BYTES_PER_SW_VER];
662 661 unsigned char lfr_fpga_version[BYTES_PER_VHD_VER];
663 662 // ressource statistics
664 663 unsigned char hk_lfr_cpu_load;
665 664 unsigned char hk_lfr_cpu_load_max;
666 665 unsigned char hk_lfr_cpu_load_aver;
667 666 unsigned char hk_lfr_q_sd_fifo_size_max;
668 667 unsigned char hk_lfr_q_sd_fifo_size;
669 668 unsigned char hk_lfr_q_rv_fifo_size_max;
670 669 unsigned char hk_lfr_q_rv_fifo_size;
671 670 unsigned char hk_lfr_q_p0_fifo_size_max;
672 671 unsigned char hk_lfr_q_p0_fifo_size;
673 672 unsigned char hk_lfr_q_p1_fifo_size_max;
674 673 unsigned char hk_lfr_q_p1_fifo_size;
675 674 unsigned char hk_lfr_q_p2_fifo_size_max;
676 675 unsigned char hk_lfr_q_p2_fifo_size;
677 676 // tc statistics
678 677 unsigned char hk_lfr_update_info_tc_cnt[COUNTER_2_BYTES];
679 678 unsigned char hk_lfr_update_time_tc_cnt[COUNTER_2_BYTES];
680 679 unsigned char hk_lfr_exe_tc_cnt[COUNTER_2_BYTES];
681 680 unsigned char hk_lfr_rej_tc_cnt[COUNTER_2_BYTES];
682 681 unsigned char hk_lfr_last_exe_tc_id[BYTES_PER_PACKETID];
683 682 unsigned char hk_lfr_last_exe_tc_type[BYTES_PER_TYPE];
684 683 unsigned char hk_lfr_last_exe_tc_subtype[BYTES_PER_SUBTYPE];
685 684 unsigned char hk_lfr_last_exe_tc_time[BYTES_PER_TIME];
686 685 unsigned char hk_lfr_last_rej_tc_id[BYTES_PER_PACKETID];
687 686 unsigned char hk_lfr_last_rej_tc_type[BYTES_PER_TYPE];
688 687 unsigned char hk_lfr_last_rej_tc_subtype[BYTES_PER_SUBTYPE];
689 688 unsigned char hk_lfr_last_rej_tc_time[BYTES_PER_TIME];
690 689 // anomaly statistics
691 690 unsigned char hk_lfr_le_cnt[COUNTER_2_BYTES];
692 691 unsigned char hk_lfr_me_cnt[COUNTER_2_BYTES];
693 692 unsigned char hk_lfr_he_cnt[COUNTER_2_BYTES];
694 693 unsigned char hk_lfr_last_er_rid[COUNTER_2_BYTES];
695 694 unsigned char hk_lfr_last_er_code;
696 695 unsigned char hk_lfr_last_er_time[BYTES_PER_TIME];
697 696 // vhdl_blk_status
698 697 unsigned char hk_lfr_vhdl_aa_sm;
699 698 unsigned char hk_lfr_vhdl_fft_sr;
700 699 unsigned char hk_lfr_vhdl_cic_hk;
701 700 unsigned char hk_lfr_vhdl_iir_cal;
702 701 // spacewire_if_statistics
703 702 unsigned char hk_lfr_dpu_spw_pkt_rcv_cnt[COUNTER_2_BYTES];
704 703 unsigned char hk_lfr_dpu_spw_pkt_sent_cnt[COUNTER_2_BYTES];
705 704 unsigned char hk_lfr_dpu_spw_tick_out_cnt;
706 705 unsigned char hk_lfr_dpu_spw_last_timc;
707 706 // ahb error statistics
708 707 unsigned char hk_lfr_last_fail_addr[BYTES_PER_ADDR];
709 708 // temperatures
710 709 unsigned char hk_lfr_temp_scm[BYTES_PER_TEMP];
711 710 unsigned char hk_lfr_temp_pcb[BYTES_PER_TEMP];
712 711 unsigned char hk_lfr_temp_fpga[BYTES_PER_TEMP];
713 712 // spacecraft potential
714 713 unsigned char hk_lfr_sc_v_f3[BYTES_PER_V];
715 714 unsigned char hk_lfr_sc_e1_f3[BYTES_PER_V];
716 715 unsigned char hk_lfr_sc_e2_f3[BYTES_PER_V];
717 716 // lfr common parameters
718 717 unsigned char sy_lfr_common_parameters_spare;
719 718 unsigned char sy_lfr_common_parameters;
720 719 // error counters
721 720 unsigned char hk_lfr_dpu_spw_parity;
722 721 unsigned char hk_lfr_dpu_spw_disconnect;
723 722 unsigned char hk_lfr_dpu_spw_escape;
724 723 unsigned char hk_lfr_dpu_spw_credit;
725 724 unsigned char hk_lfr_dpu_spw_write_sync;
726 725 unsigned char hk_lfr_dpu_spw_rx_ahb;
727 726 unsigned char hk_lfr_dpu_spw_tx_ahb;
728 727 unsigned char hk_lfr_dpu_spw_early_eop;
729 728 unsigned char hk_lfr_dpu_spw_invalid_addr;
730 729 unsigned char hk_lfr_dpu_spw_eep;
731 730 unsigned char hk_lfr_dpu_spw_rx_too_big;
732 731 // timecode
733 732 unsigned char hk_lfr_timecode_erroneous;
734 733 unsigned char hk_lfr_timecode_missing;
735 734 unsigned char hk_lfr_timecode_invalid;
736 735 // time
737 736 unsigned char hk_lfr_time_timecode_it;
738 737 unsigned char hk_lfr_time_not_synchro;
739 738 unsigned char hk_lfr_time_timecode_ctr;
740 739 // hk_lfr_buffer_dpu_
741 740 unsigned char hk_lfr_buffer_dpu_tc_fifo;
742 741 unsigned char hk_lfr_buffer_dpu_tm_fifo;
743 742 // hk_lfr_ahb_
744 743 unsigned char hk_lfr_ahb_correctable;
745 744 // reaction wheel frequency
746 745 unsigned char hk_lfr_sc_rw1_rw2_f_flags;
747 746 unsigned char hk_lfr_sc_rw3_rw4_f_flags;
748 747 } Packet_TM_LFR_HK_t;
749 748
750 749 //***************
751 750 //***************
752 751 // PARAMETER_DUMP
753 752
754 753 #define BIT_PAS_FILTER_ENABLED 0x01
755 754 #define BIT_CWF_LONG_F3 0x01
756 755
757 756 typedef struct {
758 757 unsigned char targetLogicalAddress;
759 758 unsigned char protocolIdentifier;
760 759 unsigned char reserved;
761 760 unsigned char userApplication;
762 761 unsigned char packetID[BYTES_PER_PACKETID];
763 762 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
764 763 unsigned char packetLength[BYTES_PER_PKT_LEN];
765 764 // DATA FIELD HEADER
766 765 unsigned char spare1_pusVersion_spare2;
767 766 unsigned char serviceType;
768 767 unsigned char serviceSubType;
769 768 unsigned char destinationID;
770 769 unsigned char time[BYTES_PER_TIME];
771 770 unsigned char sid;
772 771
773 772 //******************
774 773 // COMMON PARAMETERS
775 774 unsigned char sy_lfr_common_parameters_spare;
776 775 unsigned char sy_lfr_common_parameters;
777 776
778 777 //******************
779 778 // NORMAL PARAMETERS
780 779 unsigned char sy_lfr_n_swf_l[PARAM_2_BYTES];
781 780 unsigned char sy_lfr_n_swf_p[PARAM_2_BYTES];
782 781 unsigned char sy_lfr_n_asm_p[PARAM_2_BYTES];
783 782 unsigned char sy_lfr_n_bp_p0;
784 783 unsigned char sy_lfr_n_bp_p1;
785 784 unsigned char sy_lfr_n_cwf_long_f3;
786 785 unsigned char pa_rpw_spare8_1;
787 786
788 787 //*****************
789 788 // BURST PARAMETERS
790 789 unsigned char sy_lfr_b_bp_p0;
791 790 unsigned char sy_lfr_b_bp_p1;
792 791
793 792 //****************
794 793 // SBM1 PARAMETERS
795 794 unsigned char sy_lfr_s1_bp_p0;
796 795 unsigned char sy_lfr_s1_bp_p1;
797 796
798 797 //****************
799 798 // SBM2 PARAMETERS
800 799 unsigned char sy_lfr_s2_bp_p0;
801 800 unsigned char sy_lfr_s2_bp_p1;
802 801
803 802 // mask F0
804 803 unsigned char sy_lfr_fbins_f0_word1[BYTES_PER_WORD];
805 804 unsigned char sy_lfr_fbins_f0_word2[BYTES_PER_WORD];
806 805 unsigned char sy_lfr_fbins_f0_word3[BYTES_PER_WORD];
807 806 unsigned char sy_lfr_fbins_f0_word4[BYTES_PER_WORD];
808 807 // mask F1
809 808 unsigned char sy_lfr_fbins_f1_word1[BYTES_PER_WORD];
810 809 unsigned char sy_lfr_fbins_f1_word2[BYTES_PER_WORD];
811 810 unsigned char sy_lfr_fbins_f1_word3[BYTES_PER_WORD];
812 811 unsigned char sy_lfr_fbins_f1_word4[BYTES_PER_WORD];
813 812 // mask F2
814 813 unsigned char sy_lfr_fbins_f2_word1[BYTES_PER_WORD];
815 814 unsigned char sy_lfr_fbins_f2_word2[BYTES_PER_WORD];
816 815 unsigned char sy_lfr_fbins_f2_word3[BYTES_PER_WORD];
817 816 unsigned char sy_lfr_fbins_f2_word4[BYTES_PER_WORD];
818 817
819 818 // PAS FILTER PARAMETERS
820 819 unsigned char pa_rpw_spare8_2;
821 820 unsigned char spare_sy_lfr_pas_filter_enabled;
822 821 unsigned char sy_lfr_pas_filter_modulus;
823 822 unsigned char sy_lfr_pas_filter_tbad[PARAM_4_BYTES];
824 823 unsigned char sy_lfr_pas_filter_offset;
825 824 unsigned char sy_lfr_pas_filter_shift[PARAM_4_BYTES];
826 825 unsigned char sy_lfr_sc_rw_delta_f[PARAM_4_BYTES];
827 826
828 827 // SY_LFR_RWi_Kj REACTION WHEELS K COEFFICIENTS
829 828 // RW1_K
830 829 unsigned char sy_lfr_rw1_k1[4];
831 830 unsigned char sy_lfr_rw1_k2[4];
832 831 unsigned char sy_lfr_rw1_k3[4];
833 832 unsigned char sy_lfr_rw1_k4[4];
834 833 // RW2_K
835 834 unsigned char sy_lfr_rw2_k1[4];
836 835 unsigned char sy_lfr_rw2_k2[4];
837 836 unsigned char sy_lfr_rw2_k3[4];
838 837 unsigned char sy_lfr_rw2_k4[4];
839 838 // RW3_K
840 839 unsigned char sy_lfr_rw3_k1[4];
841 840 unsigned char sy_lfr_rw3_k2[4];
842 841 unsigned char sy_lfr_rw3_k3[4];
843 842 unsigned char sy_lfr_rw3_k4[4];
844 843 // RW4_K
845 844 unsigned char sy_lfr_rw4_k1[4];
846 845 unsigned char sy_lfr_rw4_k2[4];
847 846 unsigned char sy_lfr_rw4_k3[4];
848 847 unsigned char sy_lfr_rw4_k4[4];
849 848
850 849 // LFR_RW_MASK REACTION WHEELS MASKS
851 850 unsigned char sy_lfr_rw_mask_f0_word1[BYTES_PER_WORD];
852 851 unsigned char sy_lfr_rw_mask_f0_word2[BYTES_PER_WORD];
853 852 unsigned char sy_lfr_rw_mask_f0_word3[BYTES_PER_WORD];
854 853 unsigned char sy_lfr_rw_mask_f0_word4[BYTES_PER_WORD];
855 854 // mask F1
856 855 unsigned char sy_lfr_rw_mask_f1_word1[BYTES_PER_WORD];
857 856 unsigned char sy_lfr_rw_mask_f1_word2[BYTES_PER_WORD];
858 857 unsigned char sy_lfr_rw_mask_f1_word3[BYTES_PER_WORD];
859 858 unsigned char sy_lfr_rw_mask_f1_word4[BYTES_PER_WORD];
860 859 // mask F2
861 860 unsigned char sy_lfr_rw_mask_f2_word1[BYTES_PER_WORD];
862 861 unsigned char sy_lfr_rw_mask_f2_word2[BYTES_PER_WORD];
863 862 unsigned char sy_lfr_rw_mask_f2_word3[BYTES_PER_WORD];
864 863 unsigned char sy_lfr_rw_mask_f2_word4[BYTES_PER_WORD];
865 864
866 865 // SPARE
867 866 unsigned char pa_rpw_spare8_3;
868 867 } Packet_TM_LFR_PARAMETER_DUMP_t;
869 868
870 869 //**************************
871 870 //**************************
872 871 // TM_LFR_KCOEFFICIENTS_DUMP
873 872
874 873 #define KCOEFF_BLK_NR_PKT1 30
875 874 #define KCOEFF_BLK_NR_PKT2 6
876 875 #define KCOEFF_BLK_SIZE 130
877 876 #define KCOEFF_PKTCNT 2
878 877 #define PKTNR_1 1
879 878 #define PKTNR_2 2
880 879
881 880 typedef struct {
882 881 unsigned char targetLogicalAddress;
883 882 unsigned char protocolIdentifier;
884 883 unsigned char reserved;
885 884 unsigned char userApplication;
886 885 unsigned char packetID[BYTES_PER_PACKETID];
887 886 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
888 887 unsigned char packetLength[BYTES_PER_PKT_LEN];
889 888 // DATA FIELD HEADER
890 889 unsigned char spare1_pusVersion_spare2;
891 890 unsigned char serviceType;
892 891 unsigned char serviceSubType;
893 892 unsigned char destinationID;
894 893 unsigned char time[BYTES_PER_TIME];
895 894 unsigned char sid;
896 895 unsigned char pkt_cnt;
897 896 unsigned char pkt_nr;
898 897 unsigned char blk_nr;
899 898
900 899 //******************
901 900 // SOURCE DATA repeated N times with N in [0 .. PA_LFR_KCOEFF_BLK_NR]
902 901 // one blk is 2 + 4 * 32 = 130 bytes, 30 blks max in one packet (30 * 130 = 3900)
903 902 unsigned char kcoeff_blks[KCOEFF_BLK_SIZE * KCOEFF_BLK_NR_PKT1];
904 903
905 904 } Packet_TM_LFR_KCOEFFICIENTS_DUMP_t;
906 905
907 906 #endif // CCSDS_TYPES_H_INCLUDED
@@ -1,443 +1,439
1 1 #ifndef FSW_PARAMS_H_INCLUDED
2 2 #define FSW_PARAMS_H_INCLUDED
3 3
4 4 #include "fsw_params_processing.h"
5 5 #include "fsw_params_nb_bytes.h"
6 6 #include "tm_byte_positions.h"
7 7 #include "ccsds_types.h"
8 8 #include "stdint.h"
9 9
10 10 #define GRSPW_DEVICE_NAME "/dev/grspw0"
11 11 #define UART_DEVICE_NAME "/dev/console"
12 12
13 13 //*******
14 14 // MACROS
15 15 #ifdef PRINT_MESSAGES_ON_CONSOLE
16 16 #define PRINTF(x) printf(x);
17 17 #define PRINTF1(x,y) printf(x,y);
18 18 #define PRINTF2(x,y,z) printf(x,y,z);
19 19 #else
20 20 #define PRINTF(x) ;
21 21 #define PRINTF1(x,y) ;
22 22 #define PRINTF2(x,y,z) ;
23 23 #endif
24 24
25 25 #ifdef BOOT_MESSAGES
26 26 #define BOOT_PRINTF(x) printf(x);
27 27 #define BOOT_PRINTF1(x,y) printf(x,y);
28 28 #define BOOT_PRINTF2(x,y,z) printf(x,y,z);
29 29 #else
30 30 #define BOOT_PRINTF(x) ;
31 31 #define BOOT_PRINTF1(x,y) ;
32 32 #define BOOT_PRINTF2(x,y,z) ;
33 33 #endif
34 34
35 35 #ifdef DEBUG_MESSAGES
36 36 #define DEBUG_PRINTF(x) printf(x);
37 37 #define DEBUG_PRINTF1(x,y) printf(x,y);
38 38 #define DEBUG_PRINTF2(x,y,z) printf(x,y,z);
39 39 #else
40 40 #define DEBUG_PRINTF(x) ;
41 41 #define DEBUG_PRINTF1(x,y) ;
42 42 #define DEBUG_PRINTF2(x,y,z) ;
43 43 #endif
44 44
45 45 #define CONST_65536 65536 // 2^16
46 46 #define CONST_2048 2048 // 2^11
47 47 #define CONST_512 512 // 2^9
48 48 #define CONST_256 256 // 2^8
49 49 #define CONST_128 128 // 2^7
50 50 #define UINT8_MAX 255
51 51
52 52 #define FLOAT_MSBYTE 0
53 53 #define FLOAT_LSBYTE 3
54 54 #define BITS_PER_BYTE 8
55 55 #define INIT_FLOAT 0.
56 56 #define INIT_CHAR 0x00
57 57 #define INIT_INT 0
58 58 #define INT8_ALL_F 0xff
59 59 #define INT16_ALL_F 0xffff
60 60 #define INT32_ALL_F 0xffffffff
61 61 #define INT32_ALL_0 0x00000000
62 62 #define SHIFT_1_BYTE 8
63 63 #define SHIFT_2_BYTES 16
64 64 #define SHIFT_3_BYTES 24
65 65 #define SHIFT_4_BYTES 32
66 66 #define SHIFT_5_BYTES 40
67 67 #define SHIFT_2_BITS 2
68 68 #define SHIFT_3_BITS 3
69 69 #define SHIFT_4_BITS 4
70 70 #define SHIFT_5_BITS 5
71 71 #define SHIFT_6_BITS 6
72 72 #define SHIFT_7_BITS 7
73 73 #define BYTE_0 0
74 74 #define BYTE_1 1
75 75 #define BYTE_2 2
76 76 #define BYTE_3 3
77 77 #define BYTE_4 4
78 78 #define BYTE_5 5
79 79 #define BYTE_6 6
80 80 #define BYTE_7 7
81 81 #define BYTE0_MASK 0xff00
82 82 #define BYTE1_MASK 0x00ff
83 83
84 84 enum lfr_transition_type_t{
85 85 TRANSITION_NOT_SPECIFIC,
86 86 TRANSITION_NORM_TO_S1,
87 87 TRANSITION_NORM_TO_S2,
88 88 TRANSITION_S1_TO_NORM,
89 89 TRANSITION_S2_TO_NORM,
90 90 TRANSITION_S1_TO_S2,
91 91 TRANSITION_S2_TO_S1
92 92 };
93 93
94 94 typedef struct ring_node
95 95 {
96 96 struct ring_node *previous;
97 97 struct ring_node *next;
98 98 unsigned int sid;
99 99 unsigned int coarseTime;
100 100 unsigned int fineTime;
101 101 int buffer_address;
102 102 unsigned int status;
103 103 } ring_node;
104 104
105 105 //************************
106 106 // flight software version
107 107 // this parameters is handled by the Qt project options
108 108
109 109 #define NB_PACKETS_PER_GROUP_OF_CWF 8 // 8 packets containing 336 blk
110 110 #define NB_PACKETS_PER_GROUP_OF_CWF_LIGHT 4 // 4 packets containing 672 blk
111 111 #define NB_SAMPLES_PER_SNAPSHOT 2688 // 336 * 8 = 672 * 4 = 2688
112 112 #define TIME_OFFSET 2
113 113 #define TIME_OFFSET_IN_BYTES 8
114 //#define WAVEFORM_EXTENDED_HEADER_OFFSET 22
115 114 #define NB_BYTES_SWF_BLK (2 * 6)
116 115 #define NB_WORDS_SWF_BLK 3
117 116 #define NB_BYTES_CWF3_LIGHT_BLK 6
118 //#define WFRM_INDEX_OF_LAST_PACKET 6 // waveforms are transmitted in groups of 2048 blocks, 6 packets of 340 and 1 of 8
119 117 #define NB_RING_NODES_F0 3 // AT LEAST 3
120 118 #define NB_RING_NODES_F1 5 // AT LEAST 3
121 119 #define NB_RING_NODES_F2 5 // AT LEAST 3
122 120 #define NB_RING_NODES_F3 3 // AT LEAST 3
123 121
124 122 //**********
125 123 // LFR MODES
126 124 #define LFR_MODE_STANDBY 0
127 125 #define LFR_MODE_NORMAL 1
128 126 #define LFR_MODE_BURST 2
129 127 #define LFR_MODE_SBM1 3
130 128 #define LFR_MODE_SBM2 4
131 129
132 130 #define TDS_MODE_LFM 5
133 131 #define TDS_MODE_STANDBY 0
134 132 #define TDS_MODE_NORMAL 1
135 133 #define TDS_MODE_BURST 2
136 134 #define TDS_MODE_SBM1 3
137 135 #define TDS_MODE_SBM2 4
138 136
139 137 #define THR_MODE_STANDBY 0
140 138 #define THR_MODE_NORMAL 1
141 139 #define THR_MODE_BURST 2
142 140
143 141 #define RTEMS_EVENT_MODE_STANDBY RTEMS_EVENT_0
144 142 #define RTEMS_EVENT_MODE_NORMAL RTEMS_EVENT_1
145 143 #define RTEMS_EVENT_MODE_BURST RTEMS_EVENT_2
146 144 #define RTEMS_EVENT_MODE_SBM1 RTEMS_EVENT_3
147 145 #define RTEMS_EVENT_MODE_SBM2 RTEMS_EVENT_4
148 146 #define RTEMS_EVENT_MODE_NORM_S1_S2 RTEMS_EVENT_5
149 147 #define RTEMS_EVENT_NORM_BP1_F0 RTEMS_EVENT_6
150 148 #define RTEMS_EVENT_NORM_BP2_F0 RTEMS_EVENT_7
151 149 #define RTEMS_EVENT_NORM_ASM_F0 RTEMS_EVENT_8 // ASM only in NORM mode
152 150 #define RTEMS_EVENT_NORM_BP1_F1 RTEMS_EVENT_9
153 151 #define RTEMS_EVENT_NORM_BP2_F1 RTEMS_EVENT_10
154 152 #define RTEMS_EVENT_NORM_ASM_F1 RTEMS_EVENT_11 // ASM only in NORM mode
155 153 #define RTEMS_EVENT_NORM_BP1_F2 RTEMS_EVENT_12
156 154 #define RTEMS_EVENT_NORM_BP2_F2 RTEMS_EVENT_13
157 155 #define RTEMS_EVENT_NORM_ASM_F2 RTEMS_EVENT_14 // ASM only in NORM mode
158 156 #define RTEMS_EVENT_SBM_BP1_F0 RTEMS_EVENT_15
159 157 #define RTEMS_EVENT_SBM_BP2_F0 RTEMS_EVENT_16
160 158 #define RTEMS_EVENT_SBM_BP1_F1 RTEMS_EVENT_17
161 159 #define RTEMS_EVENT_SBM_BP2_F1 RTEMS_EVENT_18
162 160 #define RTEMS_EVENT_BURST_BP1_F0 RTEMS_EVENT_19
163 161 #define RTEMS_EVENT_BURST_BP2_F0 RTEMS_EVENT_20
164 162 #define RTEMS_EVENT_BURST_BP1_F1 RTEMS_EVENT_21
165 163 #define RTEMS_EVENT_BURST_BP2_F1 RTEMS_EVENT_22
166 164 #define RTEMS_EVENT_SWF_RESYNCH RTEMS_EVENT_23
167 165 #define RTEMS_EVENT_CAL_SWEEP_WAKE RTEMS_EVENT_24
168 166
169 167 //********************************************
170 168 //********************************************
171 169 // LFR PARAMETERS: DEFAULT, MIN AND MAX VALUES
172 170
173 171 #define DEFAULT_LAST_VALID_TRANSITION_DATE 0xffffffff
174 172
175 173 // COMMON
176 174 #define DEFAULT_SY_LFR_COMMON0 0x00
177 175 #define DEFAULT_SY_LFR_COMMON1 0x20 // default value bw sp0 sp1 r0 r1 r2 = 1 0 0 0 0 0
178 176
179 177 // NORM
180 178 #define DFLT_SY_LFR_N_SWF_L 2048 // nb sample
181 179 #define DFLT_SY_LFR_N_SWF_P 300 // sec
182 180 #define MIN_SY_LFR_N_SWF_P 22 // sec
183 181 #define DFLT_SY_LFR_N_ASM_P 3600 // sec
184 182 #define DFLT_SY_LFR_N_BP_P0 4 // sec
185 183 #define DFLT_SY_LFR_N_BP_P1 20 // sec
186 184 #define DFLT_SY_LFR_N_CWF_LONG_F3 0 // 0 => production of light continuous waveforms at f3
187 185 #define MIN_DELTA_SNAPSHOT 16 // sec
188 186
189 187 // BURST
190 188 #define DEFAULT_SY_LFR_B_BP_P0 1 // sec
191 189 #define DEFAULT_SY_LFR_B_BP_P1 5 // sec
192 190
193 191 // SBM1
194 192 #define S1_BP_P0_SCALE 0.25
195 193 #define DEFAULT_SY_LFR_S1_BP_P0 1 // 0.25 sec
196 194 #define DEFAULT_SY_LFR_S1_BP_P1 1 // sec
197 195
198 196 // SBM2
199 197 #define DEFAULT_SY_LFR_S2_BP_P0 1 // sec
200 198 #define DEFAULT_SY_LFR_S2_BP_P1 5 // sec
201 199
202 200 // ADDITIONAL PARAMETERS
203 201 #define TIME_BETWEEN_TWO_SWF_PACKETS 30 // nb x 10 ms => 300 ms
204 202 #define TIME_BETWEEN_TWO_CWF3_PACKETS 1000 // nb x 10 ms => 10 s
205 203
206 204 // STATUS WORD
207 205 #define DEFAULT_STATUS_WORD_BYTE0 0x0d // [0000] [1] [101] mode 4 bits / SPW enabled 1 bit / state is run 3 bits
208 206
209 207 #define DEFAULT_STATUS_WORD_BYTE1 0x00
210 208 // TC_LFR_LOAD_FILTER_PAR
211 209 #define MIN_PAS_FILTER_MODULUS 4
212 210 #define MAX_PAS_FILTER_MODULUS 8
213 211 #define MIN_PAS_FILTER_TBAD 0.0
214 212 #define MAX_PAS_FILTER_TBAD 4.0
215 213 #define MIN_PAS_FILTER_OFFSET 0
216 214 #define MAX_PAS_FILTER_OFFSET 7
217 215 #define MIN_PAS_FILTER_SHIFT 0.0
218 216 #define MAX_PAS_FILTER_SHIFT 1.0
219 217 #define MIN_SY_LFR_SC_RW_DELTA_F 0
220 218 #define MIN_SY_LFR_RW_K 0
221 219 #define MIN_SY_LFR_RW_F 0
222 220 //
223 221 #define SY_LFR_DPU_CONNECT_TIMEOUT 100 // 100 * 10 ms = 1 s
224 222 #define SY_LFR_DPU_CONNECT_ATTEMPT 3
225 223 //****************************
226 224
227 225 //*****************************
228 226 // APB REGISTERS BASE ADDRESSES
229 227 #define REGS_ADDR_APBUART 0x80000100
230 228 #define REGS_ADDR_GPTIMER 0x80000300
231 229 #define REGS_ADDR_GRSPW 0x80000500
232 230 #define APB_OFFSET_GRSPW_STATUS_REGISTER 0x04
233 231 #define APB_OFFSET_GRSPW_TIME_REGISTER 0x14
234 232 #define REGS_ADDR_TIME_MANAGEMENT 0x80000600
235 233 #define REGS_ADDR_GRGPIO 0x80000b00
236 234
237 235 #define REGS_ADDR_SPECTRAL_MATRIX 0x80000f00
238 236 #define REGS_ADDR_WAVEFORM_PICKER 0x80000f54 // PDB >= 0.1.28
239 237 #define APB_OFFSET_VHDL_REV 0xb0
240 238 #define REGS_ADDR_VHDL_VERSION 0x80000ff0
241 239
242 #define APBUART_CTRL_REG_MASK_DB 0xfffff7ff
243 240 #define APBUART_CTRL_REG_MASK_TE 0x00000002
244 241 // scaler value = system_clock_frequency / ( baud_rate * 8 ) - 1
245 242 #define APBUART_SCALER_RELOAD_VALUE 0x00000050 // 25 MHz => about 38400
246 243
247 244 //**********
248 245 // IRQ LINES
249 246 #define IRQ_GPTIMER_WATCHDOG 9
250 247 #define IRQ_SPARC_GPTIMER_WATCHDOG 0x19 // see sparcv8.pdf p.76 for interrupt levels
251 248 #define IRQ_WAVEFORM_PICKER 14
252 249 #define IRQ_SPARC_WAVEFORM_PICKER 0x1e // see sparcv8.pdf p.76 for interrupt levels
253 250 #define IRQ_SPECTRAL_MATRIX 6
254 251 #define IRQ_SPARC_SPECTRAL_MATRIX 0x16 // see sparcv8.pdf p.76 for interrupt levels
255 252
256 253 //*****
257 254 // TIME
258 255 #define CLKDIV_WATCHDOG (10000000 - 1) // 10.0s => 10 000 000
259 256 #define TIMER_WATCHDOG 1
260 257 #define WATCHDOG_PERIOD 100 // 1s
261 258 #define HK_PERIOD 100 // 100 * 10ms => 1s
262 259 #define AVGV_PERIOD 6 // 6 * 10ms => 60ms (1 / 16 = 62.5ms)
263 260 #define SY_LFR_TIME_SYN_TIMEOUT_in_ticks 200 // 200 * 10 ms = 2 s
264 261 #define HK_SYNC_WAIT 10 // 10 * 10 ms = 100 ms
265 262 #define SPW_LINK_WAIT 10 // 10 * 10 ms = 100 ms
266 263 #define TIMECODE_TIMER_TIMEOUT 120 // 120 * 10 ms = 1.2 s
267 264 #define TIMECODE_TIMER_TIMEOUT_INIT 200 // 200 * 10 ms = 2.0 s
268 265 #define TIMECODE_MASK 0x3f // 0011 1111
269 266
270 267 //**********
271 268 // LPP CODES
272 269 #define LFR_SUCCESSFUL 0
273 270 #define LFR_DEFAULT 1
274 271 #define LFR_EXE_ERROR 2
275 272 #define LFR_DEFAULT_ALT -1
276 273
277 274 //******
278 275 // RTEMS
279 276 #define STACK_SIZE_MULT 2
280 277
281 278 #define TASKID_AVGV 0
282 279 #define TASKID_RECV 1
283 280 #define TASKID_ACTN 2
284 281 #define TASKID_SPIQ 3
285 282 #define TASKID_LOAD 4
286 283 #define TASKID_AVF0 5
287 284 #define TASKID_SWBD 6
288 285 #define TASKID_WFRM 7
289 286 #define TASKID_DUMB 8
290 287 #define TASKID_HOUS 9
291 288 #define TASKID_PRC0 10
292 289 #define TASKID_CWF3 11
293 290 #define TASKID_CWF2 12
294 291 #define TASKID_CWF1 13
295 292 #define TASKID_SEND 14
296 293 #define TASKID_LINK 15
297 294 #define TASKID_AVF1 16
298 295 #define TASKID_PRC1 17
299 296 #define TASKID_AVF2 18
300 297 #define TASKID_PRC2 19
301 298 #define TASKID_SCRB 20
302 299 #define TASKID_CALI 21
303 300
304 301 #define TASK_PRIORITY_SPIQ 5
305 302 #define TASK_PRIORITY_LINK 20
306 303 #define TASK_PRIORITY_AVGV 25
307 304 #define TASK_PRIORITY_HOUS 30
308 305 #define TASK_PRIORITY_CWF1 35 // CWF1 and CWF2 are never running together
309 306 #define TASK_PRIORITY_CWF2 35 //
310 307 #define TASK_PRIORITY_SWBD 37 // SWBD has a lower priority than WFRM, this is to extract the snapshot before sending it
311 308 #define TASK_PRIORITY_WFRM 40
312 309 #define TASK_PRIORITY_CWF3 40 // there is a printf in this function, be careful with its priority wrt CWF1
313 310 #define TASK_PRIORITY_SEND 45
314 311 #define TASK_PRIORITY_RECV 50
315 312 #define TASK_PRIORITY_CALI 50
316 313 #define TASK_PRIORITY_ACTN 50
317 314 #define TASK_PRIORITY_AVF0 60
318 315 #define TASK_PRIORITY_AVF1 70
319 316 #define TASK_PRIORITY_PRC0 100
320 317 #define TASK_PRIORITY_PRC1 100
321 318 #define TASK_PRIORITY_AVF2 110
322 319 #define TASK_PRIORITY_PRC2 110
323 320 #define TASK_PRIORITY_LOAD 190
324 321 #define TASK_PRIORITY_DUMB 200
325 322 #define TASK_PRIORITY_SCRB 210
326 323
327 324 #define MSG_QUEUE_COUNT_RECV 10
328 325 #define MSG_QUEUE_COUNT_SEND 50
329 326 #define MSG_QUEUE_COUNT_PRC0 10
330 327 #define MSG_QUEUE_COUNT_PRC1 10
331 328 #define MSG_QUEUE_COUNT_PRC2 5
332 329 #define MSG_QUEUE_SIZE_SEND 812 // 808 + 4 => TM_LFR_SCIENCE_BURST_BP2_F1
333 #define ACTION_MSG_SPW_IOCTL_SEND_SIZE 24 // hlen *hdr dlen *data sent options
334 330 #define MSG_QUEUE_SIZE_PRC0 36 // two pointers, one rtems_event + 6 integers
335 331 #define MSG_QUEUE_SIZE_PRC1 36 // two pointers, one rtems_event + 6 integers
336 332 #define MSG_QUEUE_SIZE_PRC2 36 // two pointers, one rtems_event + 6 integers
337 333
338 334 #define QUEUE_RECV 0
339 335 #define QUEUE_SEND 1
340 336 #define QUEUE_PRC0 2
341 337 #define QUEUE_PRC1 3
342 338 #define QUEUE_PRC2 4
343 339 #define QUEUE_CALI 5
344 340
345 341 #define CPU_USAGE_REPORT_PERIOD 6 // * 10 s = period
346 342
347 343 struct param_local_str{
348 344 unsigned int local_sbm1_nb_cwf_sent;
349 345 unsigned int local_sbm1_nb_cwf_max;
350 346 unsigned int local_sbm2_nb_cwf_sent;
351 347 unsigned int local_sbm2_nb_cwf_max;
352 348 };
353 349
354 350 //************
355 351 // FBINS MASKS
356 352
357 353 #define BYTES_PER_FBINS_MASK 16
358 354
359 355 typedef struct {
360 356 unsigned char merged_fbins_mask_f0[BYTES_PER_FBINS_MASK];
361 357 unsigned char merged_fbins_mask_f1[BYTES_PER_FBINS_MASK];
362 358 unsigned char merged_fbins_mask_f2[BYTES_PER_FBINS_MASK];
363 359 } fbins_masks_t;
364 360
365 361 #define DEFAULT_SY_LFR_PAS_FILTER_ENABLED 0
366 362 #define DEFAULT_SY_LFR_PAS_FILTER_MODULUS 4
367 363 #define DEFAULT_SY_LFR_PAS_FILTER_TBAD 1.0f
368 364 #define DEFAULT_SY_LFR_PAS_FILTER_OFFSET 0
369 365 #define DEFAULT_SY_LFR_PAS_FILTER_SHIFT 0.5f
370 366 #define DEFAULT_MODULUS 262144 // 65536 * 4
371 367 #define DEFAULT_TBAD 65536 // 65536
372 368 #define DEFAULT_OFFSET 0 // 65536 * 0
373 369 #define DEFAULT_SHIFT 32768 // 65536 / 2
374 370 #define DEFAULT_SY_LFR_SC_RW_DELTA_F 0.045f
375 371 #define DEFAULT_SY_LFR_RW_K1 1.f
376 372 #define DEFAULT_SY_LFR_RW_K2 8.f
377 373 #define DEFAULT_SY_LFR_RW_K3 24.f
378 374 #define DEFAULT_SY_LFR_RW_K4 48.f
379 375
380 376 typedef struct{
381 377 unsigned char spare_sy_lfr_pas_filter_enabled;
382 378 float sy_lfr_pas_filter_tbad;
383 379 float sy_lfr_pas_filter_shift;
384 380 uint64_t modulus_in_finetime;
385 381 uint64_t tbad_in_finetime;
386 382 uint64_t offset_in_finetime;
387 383 uint64_t shift_in_finetime;
388 384 float sy_lfr_sc_rw_delta_f;
389 385 // rw1_k
390 386 float sy_lfr_rw1_k1;
391 387 float sy_lfr_rw1_k2;
392 388 float sy_lfr_rw1_k3;
393 389 float sy_lfr_rw1_k4;
394 390 // rw2_k
395 391 float sy_lfr_rw2_k1;
396 392 float sy_lfr_rw2_k2;
397 393 float sy_lfr_rw2_k3;
398 394 float sy_lfr_rw2_k4;
399 395 // rw3_k
400 396 float sy_lfr_rw3_k1;
401 397 float sy_lfr_rw3_k2;
402 398 float sy_lfr_rw3_k3;
403 399 float sy_lfr_rw3_k4;
404 400 // rw4_k
405 401 float sy_lfr_rw4_k1;
406 402 float sy_lfr_rw4_k2;
407 403 float sy_lfr_rw4_k3;
408 404 float sy_lfr_rw4_k4;
409 405 } filterPar_t;
410 406
411 407 typedef struct{
412 408 // rw1_f
413 409 float cp_rpw_sc_rw1_f1;
414 410 float cp_rpw_sc_rw1_f2;
415 411 float cp_rpw_sc_rw1_f3;
416 412 float cp_rpw_sc_rw1_f4;
417 413 // rw2_f
418 414 float cp_rpw_sc_rw2_f1;
419 415 float cp_rpw_sc_rw2_f2;
420 416 float cp_rpw_sc_rw2_f3;
421 417 float cp_rpw_sc_rw2_f4;
422 418 // rw3_f
423 419 float cp_rpw_sc_rw3_f1;
424 420 float cp_rpw_sc_rw3_f2;
425 421 float cp_rpw_sc_rw3_f3;
426 422 float cp_rpw_sc_rw3_f4;
427 423 // rw4_f
428 424 float cp_rpw_sc_rw4_f1;
429 425 float cp_rpw_sc_rw4_f2;
430 426 float cp_rpw_sc_rw4_f3;
431 427 float cp_rpw_sc_rw4_f4;
432 428 } rw_f_t;
433 429
434 430 #define MATRIX_IS_POLLUTED 0
435 431 #define MATRIX_IS_NOT_POLLUTED 1
436 432 #define ACQUISITION_DURATION_F0 683 // 256 / 24576 * 65536
437 433 #define ACQUISITION_DURATION_F1 4096 // 256 / 4096 * 65536
438 434 #define ACQUISITION_DURATION_F2 65536 // 256 / 256 * 65536
439 435 #define HALF_ACQUISITION_DURATION_F0 341 // 256 / 24576 * 65536 / 2
440 436 #define HALF_ACQUISITION_DURATION_F1 2048 // 256 / 4096 * 65536 / 2
441 437 #define HALF_ACQUISITION_DURATION_F2 32768 // 256 / 256 * 65536 / 2
442 438
443 439 #endif // FSW_PARAMS_H_INCLUDED
@@ -1,108 +1,105
1 1 #ifndef FSW_PARAMS_PROCESSING_H
2 2 #define FSW_PARAMS_PROCESSING_H
3 3
4 4 #define CHANNELF0 0
5 5 #define CHANNELF1 1
6 6 #define CHANNELF2 2
7 7 #define CHANNELF3 3
8 8
9 9 #define NB_SM_PER_S_F0 96
10 10 #define NB_SM_PER_S_F1 16
11 11 #define NB_SM_PER_S_F2 1
12 12 #define NB_SM_PER_S1_BP_P0 24
13 13
14 14 #define ASM_COMP_B1B2 1
15 15 #define ASM_COMP_B1B3 3
16 16 #define ASM_COMP_B1E1 5
17 17 #define ASM_COMP_B1E2 7
18 18 #define ASM_COMP_B2B3 10
19 19 #define ASM_COMP_B2E1 12
20 20 #define ASM_COMP_B2E2 14
21 21 #define ASM_COMP_B3E1 17
22 22 #define ASM_COMP_B3E2 19
23 23 #define ASM_COMP_E1E2 22
24 24 #define ASM_COMP_B1B1 0
25 25 #define ASM_COMP_B2B2 9
26 26 #define ASM_COMP_B3B3 16
27 27 #define ASM_COMP_E1E1 21
28 28 #define ASM_COMP_E2E2 24
29 29
30 30 #define SM_BYTES_PER_VAL 2
31 31 #define NB_BINS_PER_SM 128
32 32 #define NB_VALUES_PER_SM 25
33 33 #define TOTAL_SIZE_SM 3200 // 25 * 128 = 0xC80
34 34 #define TOTAL_SIZE_NORM_BP1_F0 99 // 11 * 9 = 99
35 35 #define TOTAL_SIZE_NORM_BP1_F1 117 // 13 * 9 = 117
36 36 #define TOTAL_SIZE_NORM_BP1_F2 108 // 12 * 9 = 108
37 37 #define TOTAL_SIZE_SBM1_BP1_F0 198 // 22 * 9 = 198
38 38 // F0
39 39 #define NB_RING_NODES_SM_F0 20 // AT LEAST 8 due to the way the averaging is done
40 40 #define NB_RING_NODES_ASM_BURST_SBM_F0 10 // AT LEAST 3
41 41 #define NB_RING_NODES_ASM_NORM_F0 10 // AT LEAST 3
42 42 #define NB_RING_NODES_ASM_F0 3 // AT LEAST 3
43 43 // F1
44 44 #define NB_RING_NODES_SM_F1 12 // AT LEAST 8 due to the way the averaging is done
45 45 #define NB_RING_NODES_ASM_BURST_SBM_F1 5 // AT LEAST 3
46 46 #define NB_RING_NODES_ASM_NORM_F1 5 // AT LEAST 3
47 47 #define NB_RING_NODES_ASM_F1 3 // AT LEAST 3
48 48 // F2
49 49 #define NB_RING_NODES_SM_F2 5 // AT LEAST 3
50 50 #define NB_RING_NODES_ASM_NORM_F2 3 // AT LEAST 3
51 51 #define NB_RING_NODES_ASM_F2 3 // AT LEAST 3
52 52 //
53 53 #define NB_BINS_PER_ASM_F0 88
54 54 #define NB_BINS_PER_PKT_ASM_F0_1 32
55 55 #define NB_BINS_PER_PKT_ASM_F0_2 24
56 56 #define DLEN_ASM_F0_PKT_1 3200 // 32 * 25 * 4, 25 components per matrix, 4 bytes per float
57 57 #define DLEN_ASM_F0_PKT_2 2400 // 24 * 25 * 4, 25 components per matrix, 4 bytes per float
58 58 #define ASM_F0_INDICE_START 16 // 17 - 1, (-1) due to the VHDL behaviour
59 #define ASM_F0_INDICE_STOP 103 // 104 - 1, 2 packets of 44 bins
60 59 //
61 60 #define NB_BINS_PER_ASM_F1 104
62 61 #define NB_BINS_PER_PKT_ASM_F1_1 36
63 62 #define NB_BINS_PER_PKT_ASM_F1_2 32
64 63 #define DLEN_ASM_F1_PKT_1 3600 // 36 * 25 * 4, 25 components per matrix, 4 bytes per float
65 64 #define DLEN_ASM_F1_PKT_2 3200 // 32 * 25 * 4, 25 components per matrix, 4 bytes per float
66 65 #define ASM_F1_INDICE_START 5 // 6 - 1, (-1) due to the VHDL behaviour
67 #define ASM_F1_INDICE_STOP 108 // 109 - 1, 2 packets of 52 bins
68 66 //
69 67 #define NB_BINS_PER_ASM_F2 96
70 68 #define NB_BINS_PER_PKT_ASM_F2 32
71 69 #define DLEN_ASM_F2_PKT 3200 // 32 * 25 * 4, 25 components per matrix, 4 bytes per float
72 70 #define ASM_F2_INDICE_START 6 // 7 - 1, (-1) due to the VHDL behaviour
73 #define ASM_F2_INDICE_STOP 101 // 102 - 1, 2 packets of 48 bins
74 71 //
75 72 #define KCOEFF_BLK_SIZE 130
76 73 #define KCOEFF_FREQ 2
77 74 #define NB_BINS_COMPRESSED_SM_F0 11
78 75 #define NB_BINS_COMPRESSED_SM_F1 13
79 76 #define NB_BINS_COMPRESSED_SM_F2 12
80 77 #define NB_BINS_COMPRESSED_SM 36 // 11 + 12 + 13
81 78 #define NB_BINS_COMPRESSED_SM_SBM_F0 22
82 79 #define NB_BINS_COMPRESSED_SM_SBM_F1 26
83 80 #define NB_BINS_COMPRESSED_SM_SBM_F2 24
84 81 //
85 82 #define NB_BYTES_PER_BP1 9
86 83 #define NB_BYTES_PER_BP2 30
87 84 //
88 85 #define NB_BINS_TO_AVERAGE_ASM_F0 8
89 86 #define NB_BINS_TO_AVERAGE_ASM_F1 8
90 87 #define NB_BINS_TO_AVERAGE_ASM_F2 8
91 88 #define NB_BINS_TO_AVERAGE_ASM_SBM_F0 4
92 89 #define NB_BINS_TO_AVERAGE_ASM_SBM_F1 4
93 90 #define NB_BINS_TO_AVERAGE_ASM_SBM_F2 4
94 91 //
95 92 #define TOTAL_SIZE_COMPRESSED_ASM_NORM_F0 275 // 11 * 25 WORDS
96 93 #define TOTAL_SIZE_COMPRESSED_ASM_NORM_F1 325 // 13 * 25 WORDS
97 94 #define TOTAL_SIZE_COMPRESSED_ASM_NORM_F2 300 // 12 * 25 WORDS
98 95 #define TOTAL_SIZE_COMPRESSED_ASM_SBM_F0 550 // 22 * 25 WORDS
99 96 #define TOTAL_SIZE_COMPRESSED_ASM_SBM_F1 650 // 26 * 25 WORDS
100 97 #define TOTAL_SIZE_BP1_NORM_F0 99 // 9 * 11 UNSIGNED CHAR
101 98 #define TOTAL_SIZE_BP2_NORM_F0 330 // 30 * 11 UNSIGNED CHAR
102 99 #define TOTAL_SIZE_BP1_SBM_F0 198 // 9 * 22 UNSIGNED CHAR
103 100 // GENERAL
104 101 #define NB_SM_BEFORE_AVF0_F1 8 // must be 8 due to the SM_average() function
105 102 #define NB_SM_BEFORE_AVF2 1 // must be 1 due to the SM_average_f2() function
106 103
107 104 #endif // FSW_PARAMS_PROCESSING_H
108 105
General Comments 0
You need to be logged in to leave comments. Login now