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