##// END OF EJS Templates
minor updates
paul -
r48:dad8371a5549 default
parent child
Show More
@@ -1,794 +1,795
1 #ifndef CCSDS_TYPES_H_INCLUDED
1 #ifndef CCSDS_TYPES_H_INCLUDED
2 #define CCSDS_TYPES_H_INCLUDED
2 #define CCSDS_TYPES_H_INCLUDED
3
3
4 #define CCSDS_PROTOCOLE_EXTRA_BYTES 4
4 #define CCSDS_PROTOCOLE_EXTRA_BYTES 4
5 #define CCSDS_TC_TM_PACKET_OFFSET 7
5 #define CCSDS_TC_TM_PACKET_OFFSET 7
6 #define CCSDS_TELEMETRY_HEADER_LENGTH 16+4
6 #define CCSDS_TELEMETRY_HEADER_LENGTH 16+4
7 #define CCSDS_TM_PKT_MAX_SIZE 4412
7 #define CCSDS_TM_PKT_MAX_SIZE 4412
8 #define CCSDS_TELECOMMAND_HEADER_LENGTH 10+4
8 #define CCSDS_TELECOMMAND_HEADER_LENGTH 10+4
9 #define CCSDS_TC_PKT_MAX_SIZE 256
9 #define CCSDS_TC_PKT_MAX_SIZE 256
10 #define CCSDS_TC_PKT_MIN_SIZE 16
10 #define CCSDS_TC_PKT_MIN_SIZE 16
11 #define CCSDS_PROCESS_ID 76
11 #define CCSDS_PROCESS_ID 76
12 #define CCSDS_PACKET_CATEGORY 12
12 #define CCSDS_PACKET_CATEGORY 12
13 #define CCSDS_NODE_ADDRESS 0xfe
13 #define CCSDS_NODE_ADDRESS 0xfe
14 #define CCSDS_USER_APP 0x00
14 #define CCSDS_USER_APP 0x00
15
15
16 #define DEFAULT_SPARE1_PUSVERSION_SPARE2 0x10
16 #define DEFAULT_SPARE1_PUSVERSION_SPARE2 0x10
17 #define DEFAULT_RESERVED 0x00
17 #define DEFAULT_RESERVED 0x00
18 #define DEFAULT_HKBIA 0x1e // 0001 1110
18 #define DEFAULT_HKBIA 0x1e // 0001 1110
19
19
20 // PACKET ID
20 // PACKET ID
21 #define TM_PACKET_PID_DEFAULT 76
21 #define TM_PACKET_PID_DEFAULT 76
22 #define TM_PACKET_PID_BURST_SBM1_SBM2 79
22 #define TM_PACKET_PID_BURST_SBM1_SBM2 79
23 #define APID_TM_TC_EXE 0x0cc1 // PID 76 CAT 1
23 #define APID_TM_TC_EXE 0x0cc1 // PID 76 CAT 1
24 #define APID_TM_HK 0x0cc4 // PID 76 CAT 4
24 #define APID_TM_HK 0x0cc4 // PID 76 CAT 4
25 #define APID_TM_SCIENCE_NORMAL_BURST 0x0ccc // PID 76 CAT 12
25 #define APID_TM_SCIENCE_NORMAL_BURST 0x0ccc // PID 76 CAT 12
26 #define APID_TM_SCIENCE_SBM1_SBM2 0x0cfc // PID 79 CAT 12
26 #define APID_TM_SCIENCE_SBM1_SBM2 0x0cfc // PID 79 CAT 12
27 #define APID_TM_PARAMETER_DUMP 0x0cc6 // PID 76 CAT 6
27 #define APID_TM_PARAMETER_DUMP 0x0cc6 // PID 76 CAT 6
28 #define APID_TM_KCOEFFICIENTS_DUMP 0x0cc6 // PID 76 CAT 6
28 #define APID_TM_KCOEFFICIENTS_DUMP 0x0cc6 // PID 76 CAT 6
29 // PACKET CAT
29 // PACKET CAT
30 #define TM_PACKET_CAT_TC_EXE 1
30 #define TM_PACKET_CAT_TC_EXE 1
31 #define TM_PACKET_CAT_HK 4
31 #define TM_PACKET_CAT_HK 4
32 #define TM_PACKET_CAT_SCIENCE 12
32 #define TM_PACKET_CAT_SCIENCE 12
33 #define TM_PACKET_CAT_DUMP 6
33 #define TM_PACKET_CAT_DUMP 6
34
34
35 // PACKET SEQUENCE CONTROL
35 // PACKET SEQUENCE CONTROL
36 #define TM_PACKET_SEQ_CTRL_CONTINUATION 0x00 // [0000 0000]
36 #define TM_PACKET_SEQ_CTRL_CONTINUATION 0x00 // [0000 0000]
37 #define TM_PACKET_SEQ_CTRL_FIRST 0x40 // [0100 0000]
37 #define TM_PACKET_SEQ_CTRL_FIRST 0x40 // [0100 0000]
38 #define TM_PACKET_SEQ_CTRL_LAST 0x80 // [1000 0000]
38 #define TM_PACKET_SEQ_CTRL_LAST 0x80 // [1000 0000]
39 #define TM_PACKET_SEQ_CTRL_STANDALONE 0xc0 // [1100 0000]
39 #define TM_PACKET_SEQ_CTRL_STANDALONE 0xc0 // [1100 0000]
40 #define TM_PACKET_SEQ_CNT_DEFAULT 0x00 // [0000 0000]
40 #define TM_PACKET_SEQ_CNT_DEFAULT 0x00 // [0000 0000]
41
41
42 // DESTINATION ID
42 // DESTINATION ID
43 #define TM_DESTINATION_ID_GROUND 0
43 #define TM_DESTINATION_ID_GROUND 0
44 #define TM_DESTINATION_ID_MISSION_TIMELINE 110
44 #define TM_DESTINATION_ID_MISSION_TIMELINE 110
45 #define TM_DESTINATION_ID_TC_SEQUENCES 111
45 #define TM_DESTINATION_ID_TC_SEQUENCES 111
46 #define TM_DESTINATION_ID_RECOVERY_ACTION_COMMAND 112
46 #define TM_DESTINATION_ID_RECOVERY_ACTION_COMMAND 112
47 #define TM_DESTINATION_ID_BACKUP_MISSION_TIMELINE 113
47 #define TM_DESTINATION_ID_BACKUP_MISSION_TIMELINE 113
48 #define TM_DESTINATION_ID_DIRECT_CMD 120
48 #define TM_DESTINATION_ID_DIRECT_CMD 120
49 #define TM_DESTINATION_ID_SPARE_GRD_SRC1 121
49 #define TM_DESTINATION_ID_SPARE_GRD_SRC1 121
50 #define TM_DESTINATION_ID_SPARE_GRD_SRC2 122
50 #define TM_DESTINATION_ID_SPARE_GRD_SRC2 122
51 #define TM_DESTINATION_ID_OBCP 15
51 #define TM_DESTINATION_ID_OBCP 15
52 #define TM_DESTINATION_ID_SYSTEM_CONTROL 14
52 #define TM_DESTINATION_ID_SYSTEM_CONTROL 14
53 #define TM_DESTINATION_ID_AOCS 11
53 #define TM_DESTINATION_ID_AOCS 11
54
54
55 //*********************************************************
55 //*********************************************************
56 //*** /!\ change CCSDS_DESTINATION_ID before flight /!\ ***
56 //*** /!\ change CCSDS_DESTINATION_ID before flight /!\ ***
57 //*********************************************************
57 //*********************************************************
58 #ifdef LPP_DPU_DESTID
58 #ifdef LPP_DPU_DESTID
59 #define CCSDS_DESTINATION_ID 32
59 #define CCSDS_DESTINATION_ID 32
60 #else
60 #else
61 #define CCSDS_DESTINATION_ID 0x01
61 #define CCSDS_DESTINATION_ID 0x01
62 #endif
62 #endif
63 #define CCSDS_PROTOCOLE_ID 0x02
63 #define CCSDS_PROTOCOLE_ID 0x02
64 #define CCSDS_RESERVED 0x00
64 #define CCSDS_RESERVED 0x00
65 #define CCSDS_USER_APP 0x00
65 #define CCSDS_USER_APP 0x00
66
66
67 #define SIZE_TM_LFR_TC_EXE_NOT_IMPLEMENTED 24
67 #define SIZE_TM_LFR_TC_EXE_NOT_IMPLEMENTED 24
68 #define SIZE_TM_LFR_TC_EXE_CORRUPTED 32
68 #define SIZE_TM_LFR_TC_EXE_CORRUPTED 32
69 #define SIZE_HK_PARAMETERS 112
69 #define SIZE_HK_PARAMETERS 112
70
70
71 // TC TYPES
71 // TC TYPES
72 #define TC_TYPE_GEN 181
72 #define TC_TYPE_GEN 181
73 #define TC_TYPE_TIME 9
73 #define TC_TYPE_TIME 9
74
74
75 // TC SUBTYPES
75 // TC SUBTYPES
76 #define TC_SUBTYPE_RESET 1
76 #define TC_SUBTYPE_RESET 1
77 #define TC_SUBTYPE_LOAD_COMM 11
77 #define TC_SUBTYPE_LOAD_COMM 11
78 #define TC_SUBTYPE_LOAD_NORM 13
78 #define TC_SUBTYPE_LOAD_NORM 13
79 #define TC_SUBTYPE_LOAD_BURST 19
79 #define TC_SUBTYPE_LOAD_BURST 19
80 #define TC_SUBTYPE_LOAD_SBM1 25
80 #define TC_SUBTYPE_LOAD_SBM1 25
81 #define TC_SUBTYPE_LOAD_SBM2 27
81 #define TC_SUBTYPE_LOAD_SBM2 27
82 #define TC_SUBTYPE_DUMP 31
82 #define TC_SUBTYPE_DUMP 31
83 #define TC_SUBTYPE_ENTER 41
83 #define TC_SUBTYPE_ENTER 41
84 #define TC_SUBTYPE_UPDT_INFO 51
84 #define TC_SUBTYPE_UPDT_INFO 51
85 #define TC_SUBTYPE_EN_CAL 61
85 #define TC_SUBTYPE_EN_CAL 61
86 #define TC_SUBTYPE_DIS_CAL 63
86 #define TC_SUBTYPE_DIS_CAL 63
87 #define TC_SUBTYPE_LOAD_K 93
87 #define TC_SUBTYPE_LOAD_K 93
88 #define TC_SUBTYPE_DUMP_K 95
88 #define TC_SUBTYPE_DUMP_K 95
89 #define TC_SUBTYPE_LOAD_FBINS 91
89 #define TC_SUBTYPE_LOAD_FBINS 91
90 #define TC_SUBTYPE_LOAD_FILTER_PAR 97
90 #define TC_SUBTYPE_LOAD_FILTER_PAR 97
91 #define TC_SUBTYPE_UPDT_TIME 129
91 #define TC_SUBTYPE_UPDT_TIME 129
92
92
93 // TC LEN
93 // TC LEN
94 #define TC_LEN_RESET 12
94 #define TC_LEN_RESET 12
95 #define TC_LEN_LOAD_COMM 14
95 #define TC_LEN_LOAD_COMM 14
96 #define TC_LEN_LOAD_NORM 22
96 #define TC_LEN_LOAD_NORM 22
97 #define TC_LEN_LOAD_BURST 14
97 #define TC_LEN_LOAD_BURST 14
98 #define TC_LEN_LOAD_SBM1 14
98 #define TC_LEN_LOAD_SBM1 14
99 #define TC_LEN_LOAD_SBM2 14
99 #define TC_LEN_LOAD_SBM2 14
100 #define TC_LEN_DUMP 12
100 #define TC_LEN_DUMP 12
101 #define TC_LEN_ENTER 20
101 #define TC_LEN_ENTER 20
102 #define TC_LEN_UPDT_INFO 110
102 #define TC_LEN_UPDT_INFO 110
103 #define TC_LEN_EN_CAL 12
103 #define TC_LEN_EN_CAL 12
104 #define TC_LEN_DIS_CAL 12
104 #define TC_LEN_DIS_CAL 12
105 #define TC_LEN_LOAD_K 142
105 #define TC_LEN_LOAD_K 142
106 #define TC_LEN_DUMP_K 12
106 #define TC_LEN_DUMP_K 12
107 #define TC_LEN_LOAD_FBINS 60
107 #define TC_LEN_LOAD_FBINS 60
108 #define TC_LEN_LOAD_FILTER_PAR 28
108 #define TC_LEN_LOAD_FILTER_PAR 28
109 #define TC_LEN_UPDT_TIME 18
109 #define TC_LEN_UPDT_TIME 18
110
110
111 // PACKET CODES
111 // PACKET CODES
112 #define TM_CODE_K_DUMP 0xb5600b00 // 181 (0xb5) ** 96 (0x60) ** 11 (0x0b) ** 0 (0x00)
112 #define TM_CODE_K_DUMP 0xb5600b00 // 181 (0xb5) ** 96 (0x60) ** 11 (0x0b) ** 0 (0x00)
113
113
114 // TM TYPES
114 // TM TYPES
115 #define TM_TYPE_TC_EXE 1
115 #define TM_TYPE_TC_EXE 1
116 #define TM_TYPE_HK 3
116 #define TM_TYPE_HK 3
117 #define TM_TYPE_LFR_SCIENCE 21
117 #define TM_TYPE_LFR_SCIENCE 21
118 #define TM_TYPE_PARAMETER_DUMP 181
118 #define TM_TYPE_PARAMETER_DUMP 181
119 #define TM_TYPE_K_DUMP 181
119 #define TM_TYPE_K_DUMP 181
120
120
121 // TM SUBTYPES
121 // TM SUBTYPES
122 #define TM_SUBTYPE_EXE_OK 7
122 #define TM_SUBTYPE_EXE_OK 7
123 #define TM_SUBTYPE_EXE_NOK 8
123 #define TM_SUBTYPE_EXE_NOK 8
124 #define TM_SUBTYPE_HK 25
124 #define TM_SUBTYPE_HK 25
125 #define TM_SUBTYPE_LFR_SCIENCE_3 3 // TM packets with fixed size
125 #define TM_SUBTYPE_LFR_SCIENCE_3 3 // TM packets with fixed size
126 #define TM_SUBTYPE_LFR_SCIENCE_6 6 // TM packets with variable size
126 #define TM_SUBTYPE_LFR_SCIENCE_6 6 // TM packets with variable size
127 #define TM_SUBTYPE_PARAMETER_DUMP 32
127 #define TM_SUBTYPE_PARAMETER_DUMP 32
128 #define TM_SUBTYPE_K_DUMP 96
128 #define TM_SUBTYPE_K_DUMP 96
129
129
130 // FAILURE CODES
130 // FAILURE CODES
131 #define ILLEGAL_APID 0
131 #define ILLEGAL_APID 0
132 #define WRONG_LEN_PKT 1
132 #define WRONG_LEN_PKT 1
133 #define INCOR_CHECKSUM 2
133 #define INCOR_CHECKSUM 2
134 #define ILL_TYPE 3
134 #define ILL_TYPE 3
135 #define ILL_SUBTYPE 4
135 #define ILL_SUBTYPE 4
136 #define WRONG_APP_DATA 5 // 0x00 0x05
136 #define WRONG_APP_DATA 5 // 0x00 0x05
137 #define TC_NOT_EXE 42000 // 0xa4 0x10
137 #define TC_NOT_EXE 42000 // 0xa4 0x10
138 #define WRONG_SRC_ID 42001 // 0xa4 0x11
138 #define WRONG_SRC_ID 42001 // 0xa4 0x11
139 #define FUNCT_NOT_IMPL 42002 // 0xa4 0x12
139 #define FUNCT_NOT_IMPL 42002 // 0xa4 0x12
140 #define FAIL_DETECTED 42003 // 0xa4 0x13
140 #define FAIL_DETECTED 42003 // 0xa4 0x13
141 #define NOT_ALLOWED 42004 // 0xa4 0x14
141 #define NOT_ALLOWED 42004 // 0xa4 0x14
142 #define CORRUPTED 42005 // 0xa4 0x15
142 #define CORRUPTED 42005 // 0xa4 0x15
143 #define CCSDS_TM_VALID 7
143 #define CCSDS_TM_VALID 7
144
144
145 // HK_LFR_LAST_ER_RID
145 // HK_LFR_LAST_ER_RID
146 #define RID_LE_LFR_TIME 42119
146 #define RID_LE_LFR_TIME 42119
147 #define RID_LE_LFR_DPU_SPW 42128
147 #define RID_LE_LFR_DPU_SPW 42128
148 #define RID_LE_LFR_TIMEC 42129
148 #define RID_LE_LFR_TIMEC 42129
149 #define RID_ME_LFR_DPU_SPW 42338
149 #define RID_ME_LFR_DPU_SPW 42338
150 // HK_LFR_LAST_ER_CODE
150 // HK_LFR_LAST_ER_CODE
151 #define CODE_PARITY 1
151 #define CODE_PARITY 1
152 #define CODE_DISCONNECT 2
152 #define CODE_DISCONNECT 2
153 #define CODE_ESCAPE 3
153 #define CODE_ESCAPE 3
154 #define CODE_CREDIT 4
154 #define CODE_CREDIT 4
155 #define CODE_WRITE_SYNC 5
155 #define CODE_WRITE_SYNC 5
156 #define CODE_EARLY_EOP_EEP 6
156 #define CODE_EARLY_EOP_EEP 6
157 #define CODE_INVALID_ADDRESS 7
157 #define CODE_INVALID_ADDRESS 7
158 #define CODE_EEP 8
158 #define CODE_EEP 8
159 #define CODE_RX_TOO_BIG 9
159 #define CODE_RX_TOO_BIG 9
160 #define CODE_HEADER_CRC 16
160 #define CODE_HEADER_CRC 16
161 #define CODE_DATA_CRC 17
161 #define CODE_DATA_CRC 17
162 #define CODE_ERRONEOUS 20
162 #define CODE_ERRONEOUS 20
163 #define CODE_MISSING 21
163 #define CODE_MISSING 21
164 #define CODE_INVALID 22
164 #define CODE_INVALID 22
165 #define CODE_TIMECODE_IT 24
165 #define CODE_TIMECODE_IT 24
166 #define CODE_NOT_SYNCHRO 25
166 #define CODE_NOT_SYNCHRO 25
167 #define CODE_TIMECODE_CTR 26
167 #define CODE_TIMECODE_CTR 26
168
168
169 // TC SID
169 // TC SID
170 #define SID_TC_GROUND 0
170 #define SID_TC_GROUND 0
171 #define SID_TC_MISSION_TIMELINE 110
171 #define SID_TC_MISSION_TIMELINE 110
172 #define SID_TC_TC_SEQUENCES 111
172 #define SID_TC_TC_SEQUENCES 111
173 #define SID_TC_RECOVERY_ACTION_CMD 112
173 #define SID_TC_RECOVERY_ACTION_CMD 112
174 #define SID_TC_BACKUP_MISSION_TIMELINE 113
174 #define SID_TC_BACKUP_MISSION_TIMELINE 113
175 #define SID_TC_DIRECT_CMD 120
175 #define SID_TC_DIRECT_CMD 120
176 #define SID_TC_SPARE_GRD_SRC1 121
176 #define SID_TC_SPARE_GRD_SRC1 121
177 #define SID_TC_SPARE_GRD_SRC2 122
177 #define SID_TC_SPARE_GRD_SRC2 122
178 #define SID_TC_OBCP 15
178 #define SID_TC_OBCP 15
179 #define SID_TC_SYSTEM_CONTROL 14
179 #define SID_TC_SYSTEM_CONTROL 14
180 #define SID_TC_AOCS 11
180 #define SID_TC_AOCS 11
181 #define SID_TC_RPW_INTERNAL 254
181 #define SID_TC_RPW_INTERNAL 254
182
182
183 enum apid_destid{
183 enum apid_destid{
184 GROUND,
184 GROUND,
185 MISSION_TIMELINE,
185 MISSION_TIMELINE,
186 TC_SEQUENCES,
186 TC_SEQUENCES,
187 RECOVERY_ACTION_CMD,
187 RECOVERY_ACTION_CMD,
188 BACKUP_MISSION_TIMELINE,
188 BACKUP_MISSION_TIMELINE,
189 DIRECT_CMD,
189 DIRECT_CMD,
190 SPARE_GRD_SRC1,
190 SPARE_GRD_SRC1,
191 SPARE_GRD_SRC2,
191 SPARE_GRD_SRC2,
192 OBCP,
192 OBCP,
193 SYSTEM_CONTROL,
193 SYSTEM_CONTROL,
194 AOCS,
194 AOCS,
195 RPW_INTERNAL
195 RPW_INTERNAL
196 };
196 };
197 // SEQUENCE COUNTERS
197 // SEQUENCE COUNTERS
198 #define SEQ_CNT_MAX 16383
198 #define SEQ_CNT_MAX 16383
199 #define SEQ_CNT_NB_DEST_ID 12
199 #define SEQ_CNT_NB_DEST_ID 12
200
200
201 // TM SID
201 // TM SID
202 #define SID_HK 1
202 #define SID_HK 1
203
203
204 #define SID_NORM_SWF_F0 3
204 #define SID_NORM_SWF_F0 3
205 #define SID_NORM_SWF_F1 4
205 #define SID_NORM_SWF_F1 4
206 #define SID_NORM_SWF_F2 5
206 #define SID_NORM_SWF_F2 5
207 #define SID_NORM_CWF_F3 1
207 #define SID_NORM_CWF_F3 1
208 #define SID_BURST_CWF_F2 2
208 #define SID_BURST_CWF_F2 2
209 #define SID_SBM1_CWF_F1 24
209 #define SID_SBM1_CWF_F1 24
210 #define SID_SBM2_CWF_F2 25
210 #define SID_SBM2_CWF_F2 25
211 #define SID_NORM_ASM_F0 11
211 #define SID_NORM_ASM_F0 11
212 #define SID_NORM_ASM_F1 12
212 #define SID_NORM_ASM_F1 12
213 #define SID_NORM_ASM_F2 13
213 #define SID_NORM_ASM_F2 13
214 #define SID_NORM_BP1_F0 14
214 #define SID_NORM_BP1_F0 14
215 #define SID_NORM_BP1_F1 15
215 #define SID_NORM_BP1_F1 15
216 #define SID_NORM_BP1_F2 16
216 #define SID_NORM_BP1_F2 16
217 #define SID_NORM_BP2_F0 19
217 #define SID_NORM_BP2_F0 19
218 #define SID_NORM_BP2_F1 20
218 #define SID_NORM_BP2_F1 20
219 #define SID_NORM_BP2_F2 21
219 #define SID_NORM_BP2_F2 21
220 #define SID_BURST_BP1_F0 17
220 #define SID_BURST_BP1_F0 17
221 #define SID_BURST_BP2_F0 22
221 #define SID_BURST_BP2_F0 22
222 #define SID_BURST_BP1_F1 18
222 #define SID_BURST_BP1_F1 18
223 #define SID_BURST_BP2_F1 23
223 #define SID_BURST_BP2_F1 23
224 #define SID_SBM1_BP1_F0 28
224 #define SID_SBM1_BP1_F0 28
225 #define SID_SBM1_BP2_F0 31
225 #define SID_SBM1_BP2_F0 31
226 #define SID_SBM2_BP1_F0 29
226 #define SID_SBM2_BP1_F0 29
227 #define SID_SBM2_BP2_F0 32
227 #define SID_SBM2_BP2_F0 32
228 #define SID_SBM2_BP1_F1 30
228 #define SID_SBM2_BP1_F1 30
229 #define SID_SBM2_BP2_F1 33
229 #define SID_SBM2_BP2_F1 33
230 #define SID_NORM_CWF_LONG_F3 34
230 #define SID_NORM_CWF_LONG_F3 34
231
231
232 #define SID_PARAMETER_DUMP 10
232 #define SID_PARAMETER_DUMP 10
233 #define SID_K_DUMP 11
233 #define SID_K_DUMP 11
234
234
235 // HEADER_LENGTH
235 // HEADER_LENGTH
236 //#define TM_HEADER_LEN 16
236 //#define TM_HEADER_LEN 16
237 #define HEADER_LENGTH_TM_LFR_SCIENCE_CWF 32
237 #define HEADER_LENGTH_TM_LFR_SCIENCE_CWF 32
238 #define HEADER_LENGTH_TM_LFR_SCIENCE_SWF 34
238 #define HEADER_LENGTH_TM_LFR_SCIENCE_SWF 34
239 #define HEADER_LENGTH_TM_LFR_SCIENCE_ASM 34
239 #define HEADER_LENGTH_TM_LFR_SCIENCE_ASM 34
240 // PACKET_LENGTH
240 // PACKET_LENGTH
241 #define PACKET_LENGTH_TC_EXE_SUCCESS (20 - CCSDS_TC_TM_PACKET_OFFSET)
241 #define PACKET_LENGTH_TC_EXE_SUCCESS (20 - CCSDS_TC_TM_PACKET_OFFSET)
242 #define PACKET_LENGTH_TC_EXE_INCONSISTENT (26 - CCSDS_TC_TM_PACKET_OFFSET)
242 #define PACKET_LENGTH_TC_EXE_INCONSISTENT (26 - CCSDS_TC_TM_PACKET_OFFSET)
243 #define PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE (26 - CCSDS_TC_TM_PACKET_OFFSET)
243 #define PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE (26 - CCSDS_TC_TM_PACKET_OFFSET)
244 #define PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED (24 - CCSDS_TC_TM_PACKET_OFFSET)
244 #define PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED (24 - CCSDS_TC_TM_PACKET_OFFSET)
245 #define PACKET_LENGTH_TC_EXE_ERROR (24 - CCSDS_TC_TM_PACKET_OFFSET)
245 #define PACKET_LENGTH_TC_EXE_ERROR (24 - CCSDS_TC_TM_PACKET_OFFSET)
246 #define PACKET_LENGTH_TC_EXE_CORRUPTED (32 - CCSDS_TC_TM_PACKET_OFFSET)
246 #define PACKET_LENGTH_TC_EXE_CORRUPTED (32 - CCSDS_TC_TM_PACKET_OFFSET)
247 #define PACKET_LENGTH_HK (136 - CCSDS_TC_TM_PACKET_OFFSET)
247 #define PACKET_LENGTH_HK (136 - CCSDS_TC_TM_PACKET_OFFSET)
248 #define PACKET_LENGTH_PARAMETER_DUMP (148 - CCSDS_TC_TM_PACKET_OFFSET)
248 #define PACKET_LENGTH_PARAMETER_DUMP (148 - CCSDS_TC_TM_PACKET_OFFSET)
249 #define PACKET_LENGTH_K_DUMP (3920 - CCSDS_TC_TM_PACKET_OFFSET)
249 #define PACKET_LENGTH_K_DUMP (3920 - CCSDS_TC_TM_PACKET_OFFSET)
250 // SCIENCE ASM
250 // SCIENCE ASM
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
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 #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
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 #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
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 #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
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 #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
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 // SCIENCE NORM
256 // SCIENCE NORM
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)
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 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F1 (172 - CCSDS_TC_TM_PACKET_OFFSET) // 13 * 11 + 29 (1 spare byte in the header)
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 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F2 (160 - CCSDS_TC_TM_PACKET_OFFSET) // 12 * 11 + 28
259 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F2 (160 - CCSDS_TC_TM_PACKET_OFFSET) // 12 * 11 + 28
260 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F0 (358 - CCSDS_TC_TM_PACKET_OFFSET) // 11 * 30 + 28
260 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F0 (358 - CCSDS_TC_TM_PACKET_OFFSET) // 11 * 30 + 28
261 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F1 (418 - CCSDS_TC_TM_PACKET_OFFSET) // 13 * 30 + 28
261 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F1 (418 - CCSDS_TC_TM_PACKET_OFFSET) // 13 * 30 + 28
262 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F2 (388 - CCSDS_TC_TM_PACKET_OFFSET) // 12 * 30 + 28
262 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F2 (388 - CCSDS_TC_TM_PACKET_OFFSET) // 12 * 30 + 28
263 // SCIENCE SBM
263 // SCIENCE SBM
264 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F0 (270 - CCSDS_TC_TM_PACKET_OFFSET) // 22 * 11 + 28
264 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F0 (270 - CCSDS_TC_TM_PACKET_OFFSET) // 22 * 11 + 28
265 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F0 (688 - CCSDS_TC_TM_PACKET_OFFSET) // 22 * 30 + 28
265 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F0 (688 - CCSDS_TC_TM_PACKET_OFFSET) // 22 * 30 + 28
266 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F1 (314 - CCSDS_TC_TM_PACKET_OFFSET) // 26 * 11 + 28
266 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F1 (314 - CCSDS_TC_TM_PACKET_OFFSET) // 26 * 11 + 28
267 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F1 (808 - CCSDS_TC_TM_PACKET_OFFSET) // 26 * 30 + 28
267 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F1 (808 - CCSDS_TC_TM_PACKET_OFFSET) // 26 * 30 + 28
268
268
269 #define PACKET_LENGTH_DELTA 11 // 7 + 4
269 #define PACKET_LENGTH_DELTA 11 // 7 + 4
270
270
271 #define SPARE1_PUSVERSION_SPARE2 0x10
271 #define SPARE1_PUSVERSION_SPARE2 0x10
272
272
273 // R3
273 // R3
274 // one snapshot = 2048 samples = 6 packets * 304 + 224
274 // one snapshot = 2048 samples = 6 packets * 304 + 224
275 #define TM_LEN_SCI_SWF_304 (3678 - CCSDS_TC_TM_PACKET_OFFSET) // 304 * 12 + 30
275 #define TM_LEN_SCI_SWF_304 (3678 - CCSDS_TC_TM_PACKET_OFFSET) // 304 * 12 + 30
276 #define TM_LEN_SCI_SWF_224 (2718 - CCSDS_TC_TM_PACKET_OFFSET) // 224 * 12 + 30
276 #define TM_LEN_SCI_SWF_224 (2718 - CCSDS_TC_TM_PACKET_OFFSET) // 224 * 12 + 30
277 // one continuous buffer = 2688 samples = 8 packets * 336
277 // one continuous buffer = 2688 samples = 8 packets * 336
278 #define TM_LEN_SCI_CWF_336 (4060 - CCSDS_TC_TM_PACKET_OFFSET) // 336 * 12 + 28
278 #define TM_LEN_SCI_CWF_336 (4060 - CCSDS_TC_TM_PACKET_OFFSET) // 336 * 12 + 28
279 #define TM_LEN_SCI_CWF_672 (4060 - CCSDS_TC_TM_PACKET_OFFSET) // 672 * 6 + 28
279 #define TM_LEN_SCI_CWF_672 (4060 - CCSDS_TC_TM_PACKET_OFFSET) // 672 * 6 + 28
280 //
280 //
281 #define DEFAULT_PKTCNT 0x07
281 #define DEFAULT_PKTCNT 0x07
282 #define BLK_NR_304 0x0130
282 #define BLK_NR_304 0x0130
283 #define BLK_NR_224 0x00e0
283 #define BLK_NR_224 0x00e0
284 #define BLK_NR_CWF 0x0150 // 336
284 #define BLK_NR_CWF 0x0150 // 336
285 #define BLK_NR_CWF_SHORT_F3 0x02a0 // 672
285 #define BLK_NR_CWF_SHORT_F3 0x02a0 // 672
286
286
287 enum TM_TYPE{
287 enum TM_TYPE{
288 TM_LFR_TC_EXE_OK,
288 TM_LFR_TC_EXE_OK,
289 TM_LFR_TC_EXE_ERR,
289 TM_LFR_TC_EXE_ERR,
290 TM_LFR_HK,
290 TM_LFR_HK,
291 TM_LFR_SCI,
291 TM_LFR_SCI,
292 TM_LFR_SCI_SBM,
292 TM_LFR_SCI_SBM,
293 TM_LFR_PAR_DUMP
293 TM_LFR_PAR_DUMP
294 };
294 };
295
295
296 typedef struct {
296 typedef struct {
297 unsigned char targetLogicalAddress;
297 unsigned char targetLogicalAddress;
298 unsigned char protocolIdentifier;
298 unsigned char protocolIdentifier;
299 unsigned char reserved;
299 unsigned char reserved;
300 unsigned char userApplication;
300 unsigned char userApplication;
301 // PACKET HEADER
301 // PACKET HEADER
302 unsigned char packetID[2];
302 unsigned char packetID[2];
303 unsigned char packetSequenceControl[2];
303 unsigned char packetSequenceControl[2];
304 unsigned char packetLength[2];
304 unsigned char packetLength[2];
305 // DATA FIELD HEADER
305 // DATA FIELD HEADER
306 unsigned char spare1_pusVersion_spare2;
306 unsigned char spare1_pusVersion_spare2;
307 unsigned char serviceType;
307 unsigned char serviceType;
308 unsigned char serviceSubType;
308 unsigned char serviceSubType;
309 unsigned char destinationID;
309 unsigned char destinationID;
310 unsigned char time[6];
310 unsigned char time[6];
311 //
311 //
312 unsigned char telecommand_pkt_id[2];
312 unsigned char telecommand_pkt_id[2];
313 unsigned char pkt_seq_control[2];
313 unsigned char pkt_seq_control[2];
314 } Packet_TM_LFR_TC_EXE_SUCCESS_t;
314 } Packet_TM_LFR_TC_EXE_SUCCESS_t;
315
315
316 typedef struct {
316 typedef struct {
317 unsigned char targetLogicalAddress;
317 unsigned char targetLogicalAddress;
318 unsigned char protocolIdentifier;
318 unsigned char protocolIdentifier;
319 unsigned char reserved;
319 unsigned char reserved;
320 unsigned char userApplication;
320 unsigned char userApplication;
321 // PACKET HEADER
321 // PACKET HEADER
322 unsigned char packetID[2];
322 unsigned char packetID[2];
323 unsigned char packetSequenceControl[2];
323 unsigned char packetSequenceControl[2];
324 unsigned char packetLength[2];
324 unsigned char packetLength[2];
325 // DATA FIELD HEADER
325 // DATA FIELD HEADER
326 unsigned char spare1_pusVersion_spare2;
326 unsigned char spare1_pusVersion_spare2;
327 unsigned char serviceType;
327 unsigned char serviceType;
328 unsigned char serviceSubType;
328 unsigned char serviceSubType;
329 unsigned char destinationID;
329 unsigned char destinationID;
330 unsigned char time[6];
330 unsigned char time[6];
331 //
331 //
332 unsigned char telecommand_pkt_id[2];
332 unsigned char telecommand_pkt_id[2];
333 unsigned char pkt_seq_control[2];
333 unsigned char pkt_seq_control[2];
334 unsigned char tc_failure_code[2];
334 unsigned char tc_failure_code[2];
335 unsigned char tc_service;
335 unsigned char tc_service;
336 unsigned char tc_subtype;
336 unsigned char tc_subtype;
337 unsigned char byte_position;
337 unsigned char byte_position;
338 unsigned char rcv_value;
338 unsigned char rcv_value;
339 } Packet_TM_LFR_TC_EXE_INCONSISTENT_t;
339 } Packet_TM_LFR_TC_EXE_INCONSISTENT_t;
340
340
341 typedef struct {
341 typedef struct {
342 unsigned char targetLogicalAddress;
342 unsigned char targetLogicalAddress;
343 unsigned char protocolIdentifier;
343 unsigned char protocolIdentifier;
344 unsigned char reserved;
344 unsigned char reserved;
345 unsigned char userApplication;
345 unsigned char userApplication;
346 // PACKET HEADER
346 // PACKET HEADER
347 unsigned char packetID[2];
347 unsigned char packetID[2];
348 unsigned char packetSequenceControl[2];
348 unsigned char packetSequenceControl[2];
349 unsigned char packetLength[2];
349 unsigned char packetLength[2];
350 // DATA FIELD HEADER
350 // DATA FIELD HEADER
351 unsigned char spare1_pusVersion_spare2;
351 unsigned char spare1_pusVersion_spare2;
352 unsigned char serviceType;
352 unsigned char serviceType;
353 unsigned char serviceSubType;
353 unsigned char serviceSubType;
354 unsigned char destinationID;
354 unsigned char destinationID;
355 unsigned char time[6];
355 unsigned char time[6];
356 //
356 //
357 unsigned char telecommand_pkt_id[2];
357 unsigned char telecommand_pkt_id[2];
358 unsigned char pkt_seq_control[2];
358 unsigned char pkt_seq_control[2];
359 unsigned char tc_failure_code[2];
359 unsigned char tc_failure_code[2];
360 unsigned char tc_service;
360 unsigned char tc_service;
361 unsigned char tc_subtype;
361 unsigned char tc_subtype;
362 unsigned char lfr_status_word[2];
362 unsigned char lfr_status_word[2];
363 } Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_t;
363 } Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_t;
364
364
365 typedef struct {
365 typedef struct {
366 unsigned char targetLogicalAddress;
366 unsigned char targetLogicalAddress;
367 unsigned char protocolIdentifier;
367 unsigned char protocolIdentifier;
368 unsigned char reserved;
368 unsigned char reserved;
369 unsigned char userApplication;
369 unsigned char userApplication;
370 // PACKET HEADER
370 // PACKET HEADER
371 unsigned char packetID[2];
371 unsigned char packetID[2];
372 unsigned char packetSequenceControl[2];
372 unsigned char packetSequenceControl[2];
373 unsigned char packetLength[2];
373 unsigned char packetLength[2];
374 // DATA FIELD HEADER
374 // DATA FIELD HEADER
375 unsigned char spare1_pusVersion_spare2;
375 unsigned char spare1_pusVersion_spare2;
376 unsigned char serviceType;
376 unsigned char serviceType;
377 unsigned char serviceSubType;
377 unsigned char serviceSubType;
378 unsigned char destinationID;
378 unsigned char destinationID;
379 unsigned char time[6];
379 unsigned char time[6];
380 //
380 //
381 unsigned char telecommand_pkt_id[2];
381 unsigned char telecommand_pkt_id[2];
382 unsigned char pkt_seq_control[2];
382 unsigned char pkt_seq_control[2];
383 unsigned char tc_failure_code[2];
383 unsigned char tc_failure_code[2];
384 unsigned char tc_service;
384 unsigned char tc_service;
385 unsigned char tc_subtype;
385 unsigned char tc_subtype;
386 } Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_t;
386 } Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_t;
387
387
388 typedef struct {
388 typedef struct {
389 unsigned char targetLogicalAddress;
389 unsigned char targetLogicalAddress;
390 unsigned char protocolIdentifier;
390 unsigned char protocolIdentifier;
391 unsigned char reserved;
391 unsigned char reserved;
392 unsigned char userApplication;
392 unsigned char userApplication;
393 // PACKET HEADER
393 // PACKET HEADER
394 unsigned char packetID[2];
394 unsigned char packetID[2];
395 unsigned char packetSequenceControl[2];
395 unsigned char packetSequenceControl[2];
396 unsigned char packetLength[2];
396 unsigned char packetLength[2];
397 // DATA FIELD HEADER
397 // DATA FIELD HEADER
398 unsigned char spare1_pusVersion_spare2;
398 unsigned char spare1_pusVersion_spare2;
399 unsigned char serviceType;
399 unsigned char serviceType;
400 unsigned char serviceSubType;
400 unsigned char serviceSubType;
401 unsigned char destinationID;
401 unsigned char destinationID;
402 unsigned char time[6];
402 unsigned char time[6];
403 //
403 //
404 unsigned char telecommand_pkt_id[2];
404 unsigned char telecommand_pkt_id[2];
405 unsigned char pkt_seq_control[2];
405 unsigned char pkt_seq_control[2];
406 unsigned char tc_failure_code[2];
406 unsigned char tc_failure_code[2];
407 unsigned char tc_service;
407 unsigned char tc_service;
408 unsigned char tc_subtype;
408 unsigned char tc_subtype;
409 } Packet_TM_LFR_TC_EXE_ERROR_t;
409 } Packet_TM_LFR_TC_EXE_ERROR_t;
410
410
411 typedef struct {
411 typedef struct {
412 unsigned char targetLogicalAddress;
412 unsigned char targetLogicalAddress;
413 unsigned char protocolIdentifier;
413 unsigned char protocolIdentifier;
414 unsigned char reserved;
414 unsigned char reserved;
415 unsigned char userApplication;
415 unsigned char userApplication;
416 // PACKET HEADER
416 // PACKET HEADER
417 unsigned char packetID[2];
417 unsigned char packetID[2];
418 unsigned char packetSequenceControl[2];
418 unsigned char packetSequenceControl[2];
419 unsigned char packetLength[2];
419 unsigned char packetLength[2];
420 // DATA FIELD HEADER
420 // DATA FIELD HEADER
421 unsigned char spare1_pusVersion_spare2;
421 unsigned char spare1_pusVersion_spare2;
422 unsigned char serviceType;
422 unsigned char serviceType;
423 unsigned char serviceSubType;
423 unsigned char serviceSubType;
424 unsigned char destinationID;
424 unsigned char destinationID;
425 unsigned char time[6];
425 unsigned char time[6];
426 //
426 //
427 unsigned char telecommand_pkt_id[2];
427 unsigned char telecommand_pkt_id[2];
428 unsigned char pkt_seq_control[2];
428 unsigned char pkt_seq_control[2];
429 unsigned char tc_failure_code[2];
429 unsigned char tc_failure_code[2];
430 unsigned char tc_service;
430 unsigned char tc_service;
431 unsigned char tc_subtype;
431 unsigned char tc_subtype;
432 unsigned char pkt_len_rcv_value[2];
432 unsigned char pkt_len_rcv_value[2];
433 unsigned char pkt_datafieldsize_cnt[2];
433 unsigned char pkt_datafieldsize_cnt[2];
434 unsigned char rcv_crc[2];
434 unsigned char rcv_crc[2];
435 unsigned char computed_crc[2];
435 unsigned char computed_crc[2];
436 } Packet_TM_LFR_TC_EXE_CORRUPTED_t;
436 } Packet_TM_LFR_TC_EXE_CORRUPTED_t;
437
437
438 typedef struct {
438 typedef struct {
439 unsigned char targetLogicalAddress;
439 unsigned char targetLogicalAddress;
440 unsigned char protocolIdentifier;
440 unsigned char protocolIdentifier;
441 unsigned char reserved;
441 unsigned char reserved;
442 unsigned char userApplication;
442 unsigned char userApplication;
443 unsigned char packetID[2];
443 unsigned char packetID[2];
444 unsigned char packetSequenceControl[2];
444 unsigned char packetSequenceControl[2];
445 unsigned char packetLength[2];
445 unsigned char packetLength[2];
446 // DATA FIELD HEADER
446 // DATA FIELD HEADER
447 unsigned char spare1_pusVersion_spare2;
447 unsigned char spare1_pusVersion_spare2;
448 unsigned char serviceType;
448 unsigned char serviceType;
449 unsigned char serviceSubType;
449 unsigned char serviceSubType;
450 unsigned char destinationID;
450 unsigned char destinationID;
451 unsigned char time[6];
451 unsigned char time[6];
452 // AUXILIARY HEADER
452 // AUXILIARY HEADER
453 unsigned char sid;
453 unsigned char sid;
454 unsigned char pa_bia_status_info;
454 unsigned char pa_bia_status_info;
455 unsigned char sy_lfr_common_parameters_spare;
455 unsigned char sy_lfr_common_parameters_spare;
456 unsigned char sy_lfr_common_parameters;
456 unsigned char sy_lfr_common_parameters;
457 unsigned char pktCnt;
457 unsigned char pktCnt;
458 unsigned char pktNr;
458 unsigned char pktNr;
459 unsigned char acquisitionTime[6];
459 unsigned char acquisitionTime[6];
460 unsigned char blkNr[2];
460 unsigned char blkNr[2];
461 } Header_TM_LFR_SCIENCE_SWF_t;
461 } Header_TM_LFR_SCIENCE_SWF_t;
462
462
463 typedef struct {
463 typedef struct {
464 unsigned char targetLogicalAddress;
464 unsigned char targetLogicalAddress;
465 unsigned char protocolIdentifier;
465 unsigned char protocolIdentifier;
466 unsigned char reserved;
466 unsigned char reserved;
467 unsigned char userApplication;
467 unsigned char userApplication;
468 unsigned char packetID[2];
468 unsigned char packetID[2];
469 unsigned char packetSequenceControl[2];
469 unsigned char packetSequenceControl[2];
470 unsigned char packetLength[2];
470 unsigned char packetLength[2];
471 // DATA FIELD HEADER
471 // DATA FIELD HEADER
472 unsigned char spare1_pusVersion_spare2;
472 unsigned char spare1_pusVersion_spare2;
473 unsigned char serviceType;
473 unsigned char serviceType;
474 unsigned char serviceSubType;
474 unsigned char serviceSubType;
475 unsigned char destinationID;
475 unsigned char destinationID;
476 unsigned char time[6];
476 unsigned char time[6];
477 // AUXILIARY DATA HEADER
477 // AUXILIARY DATA HEADER
478 unsigned char sid;
478 unsigned char sid;
479 unsigned char pa_bia_status_info;
479 unsigned char pa_bia_status_info;
480 unsigned char sy_lfr_common_parameters_spare;
480 unsigned char sy_lfr_common_parameters_spare;
481 unsigned char sy_lfr_common_parameters;
481 unsigned char sy_lfr_common_parameters;
482 unsigned char acquisitionTime[6];
482 unsigned char acquisitionTime[6];
483 unsigned char blkNr[2];
483 unsigned char blkNr[2];
484 } Header_TM_LFR_SCIENCE_CWF_t;
484 } Header_TM_LFR_SCIENCE_CWF_t;
485
485
486 typedef struct {
486 typedef struct {
487 unsigned char targetLogicalAddress;
487 unsigned char targetLogicalAddress;
488 unsigned char protocolIdentifier;
488 unsigned char protocolIdentifier;
489 unsigned char reserved;
489 unsigned char reserved;
490 unsigned char userApplication;
490 unsigned char userApplication;
491 unsigned char packetID[2];
491 unsigned char packetID[2];
492 unsigned char packetSequenceControl[2];
492 unsigned char packetSequenceControl[2];
493 unsigned char packetLength[2];
493 unsigned char packetLength[2];
494 // DATA FIELD HEADER
494 // DATA FIELD HEADER
495 unsigned char spare1_pusVersion_spare2;
495 unsigned char spare1_pusVersion_spare2;
496 unsigned char serviceType;
496 unsigned char serviceType;
497 unsigned char serviceSubType;
497 unsigned char serviceSubType;
498 unsigned char destinationID;
498 unsigned char destinationID;
499 unsigned char time[6];
499 unsigned char time[6];
500 // AUXILIARY HEADER
500 // AUXILIARY HEADER
501 unsigned char sid;
501 unsigned char sid;
502 unsigned char pa_bia_status_info;
502 unsigned char pa_bia_status_info;
503 unsigned char sy_lfr_common_parameters_spare;
503 unsigned char sy_lfr_common_parameters_spare;
504 unsigned char sy_lfr_common_parameters;
504 unsigned char sy_lfr_common_parameters;
505 unsigned char pa_lfr_pkt_cnt_asm;
505 unsigned char pa_lfr_pkt_cnt_asm;
506 unsigned char pa_lfr_pkt_nr_asm;
506 unsigned char pa_lfr_pkt_nr_asm;
507 unsigned char acquisitionTime[6];
507 unsigned char acquisitionTime[6];
508 unsigned char pa_lfr_asm_blk_nr[2];
508 unsigned char pa_lfr_asm_blk_nr[2];
509 } Header_TM_LFR_SCIENCE_ASM_t;
509 } Header_TM_LFR_SCIENCE_ASM_t;
510
510
511 typedef struct {
511 typedef struct {
512 unsigned char targetLogicalAddress;
512 unsigned char targetLogicalAddress;
513 unsigned char protocolIdentifier;
513 unsigned char protocolIdentifier;
514 unsigned char reserved;
514 unsigned char reserved;
515 unsigned char userApplication;
515 unsigned char userApplication;
516 unsigned char packetID[2];
516 unsigned char packetID[2];
517 unsigned char packetSequenceControl[2];
517 unsigned char packetSequenceControl[2];
518 unsigned char packetLength[2];
518 unsigned char packetLength[2];
519 // DATA FIELD HEADER
519 // DATA FIELD HEADER
520 unsigned char spare1_pusVersion_spare2;
520 unsigned char spare1_pusVersion_spare2;
521 unsigned char serviceType;
521 unsigned char serviceType;
522 unsigned char serviceSubType;
522 unsigned char serviceSubType;
523 unsigned char destinationID;
523 unsigned char destinationID;
524 unsigned char time[6];
524 unsigned char time[6];
525 // AUXILIARY HEADER
525 // AUXILIARY HEADER
526 unsigned char sid;
526 unsigned char sid;
527 unsigned char pa_bia_status_info;
527 unsigned char pa_bia_status_info;
528 unsigned char sy_lfr_common_parameters_spare;
528 unsigned char sy_lfr_common_parameters_spare;
529 unsigned char sy_lfr_common_parameters;
529 unsigned char sy_lfr_common_parameters;
530 unsigned char acquisitionTime[6];
530 unsigned char acquisitionTime[6];
531 unsigned char source_data_spare;
531 unsigned char source_data_spare;
532 unsigned char pa_lfr_bp_blk_nr[2];
532 unsigned char pa_lfr_bp_blk_nr[2];
533 } Header_TM_LFR_SCIENCE_BP_with_spare_t;
533 } Header_TM_LFR_SCIENCE_BP_with_spare_t;
534
534
535 typedef struct {
535 typedef struct {
536 unsigned char targetLogicalAddress;
536 unsigned char targetLogicalAddress;
537 unsigned char protocolIdentifier;
537 unsigned char protocolIdentifier;
538 unsigned char reserved;
538 unsigned char reserved;
539 unsigned char userApplication;
539 unsigned char userApplication;
540 unsigned char packetID[2];
540 unsigned char packetID[2];
541 unsigned char packetSequenceControl[2];
541 unsigned char packetSequenceControl[2];
542 unsigned char packetLength[2];
542 unsigned char packetLength[2];
543 // DATA FIELD HEADER
543 // DATA FIELD HEADER
544 unsigned char spare1_pusVersion_spare2;
544 unsigned char spare1_pusVersion_spare2;
545 unsigned char serviceType;
545 unsigned char serviceType;
546 unsigned char serviceSubType;
546 unsigned char serviceSubType;
547 unsigned char destinationID;
547 unsigned char destinationID;
548 unsigned char time[6];
548 unsigned char time[6];
549 // AUXILIARY HEADER
549 // AUXILIARY HEADER
550 unsigned char sid;
550 unsigned char sid;
551 unsigned char pa_bia_status_info;
551 unsigned char pa_bia_status_info;
552 unsigned char sy_lfr_common_parameters_spare;
552 unsigned char sy_lfr_common_parameters_spare;
553 unsigned char sy_lfr_common_parameters;
553 unsigned char sy_lfr_common_parameters;
554 unsigned char acquisitionTime[6];
554 unsigned char acquisitionTime[6];
555 unsigned char pa_lfr_bp_blk_nr[2];
555 unsigned char pa_lfr_bp_blk_nr[2];
556 } Header_TM_LFR_SCIENCE_BP_t;
556 } Header_TM_LFR_SCIENCE_BP_t;
557
557
558 typedef struct {
558 typedef struct {
559 //targetLogicalAddress is removed by the grspw module
559 //targetLogicalAddress is removed by the grspw module
560 unsigned char protocolIdentifier;
560 unsigned char protocolIdentifier;
561 unsigned char reserved;
561 unsigned char reserved;
562 unsigned char userApplication;
562 unsigned char userApplication;
563 unsigned char packetID[2];
563 unsigned char packetID[2];
564 unsigned char packetSequenceControl[2];
564 unsigned char packetSequenceControl[2];
565 unsigned char packetLength[2];
565 unsigned char packetLength[2];
566 // DATA FIELD HEADER
566 // DATA FIELD HEADER
567 unsigned char headerFlag_pusVersion_Ack;
567 unsigned char headerFlag_pusVersion_Ack;
568 unsigned char serviceType;
568 unsigned char serviceType;
569 unsigned char serviceSubType;
569 unsigned char serviceSubType;
570 unsigned char sourceID;
570 unsigned char sourceID;
571 unsigned char dataAndCRC[CCSDS_TC_PKT_MAX_SIZE-10];
571 unsigned char dataAndCRC[CCSDS_TC_PKT_MAX_SIZE-10];
572 } ccsdsTelecommandPacket_t;
572 } ccsdsTelecommandPacket_t;
573
573
574 typedef struct {
574 typedef struct {
575 unsigned char targetLogicalAddress;
575 unsigned char targetLogicalAddress;
576 unsigned char protocolIdentifier;
576 unsigned char protocolIdentifier;
577 unsigned char reserved;
577 unsigned char reserved;
578 unsigned char userApplication;
578 unsigned char userApplication;
579 unsigned char packetID[2];
579 unsigned char packetID[2];
580 unsigned char packetSequenceControl[2];
580 unsigned char packetSequenceControl[2];
581 unsigned char packetLength[2];
581 unsigned char packetLength[2];
582 unsigned char spare1_pusVersion_spare2;
582 unsigned char spare1_pusVersion_spare2;
583 unsigned char serviceType;
583 unsigned char serviceType;
584 unsigned char serviceSubType;
584 unsigned char serviceSubType;
585 unsigned char destinationID;
585 unsigned char destinationID;
586 unsigned char time[6];
586 unsigned char time[6];
587 unsigned char sid;
587 unsigned char sid;
588
588
589 //**************
589 //**************
590 // HK PARAMETERS
590 // HK PARAMETERS
591 unsigned char lfr_status_word[2];
591 unsigned char lfr_status_word[2];
592 unsigned char lfr_sw_version[4];
592 unsigned char lfr_sw_version[4];
593 unsigned char lfr_fpga_version[3];
593 unsigned char lfr_fpga_version[3];
594 // ressource statistics
594 // ressource statistics
595 unsigned char hk_lfr_cpu_load;
595 unsigned char hk_lfr_cpu_load;
596 unsigned char hk_lfr_cpu_load_max;
596 unsigned char hk_lfr_cpu_load_max;
597 unsigned char hk_lfr_cpu_load_aver;
597 unsigned char hk_lfr_cpu_load_aver;
598 unsigned char hk_lfr_q_sd_fifo_size_max;
598 unsigned char hk_lfr_q_sd_fifo_size_max;
599 unsigned char hk_lfr_q_sd_fifo_size;
599 unsigned char hk_lfr_q_sd_fifo_size;
600 unsigned char hk_lfr_q_rv_fifo_size_max;
600 unsigned char hk_lfr_q_rv_fifo_size_max;
601 unsigned char hk_lfr_q_rv_fifo_size;
601 unsigned char hk_lfr_q_rv_fifo_size;
602 unsigned char hk_lfr_q_p0_fifo_size_max;
602 unsigned char hk_lfr_q_p0_fifo_size_max;
603 unsigned char hk_lfr_q_p0_fifo_size;
603 unsigned char hk_lfr_q_p0_fifo_size;
604 unsigned char hk_lfr_q_p1_fifo_size_max;
604 unsigned char hk_lfr_q_p1_fifo_size_max;
605 unsigned char hk_lfr_q_p1_fifo_size;
605 unsigned char hk_lfr_q_p1_fifo_size;
606 unsigned char hk_lfr_q_p2_fifo_size_max;
606 unsigned char hk_lfr_q_p2_fifo_size_max;
607 unsigned char hk_lfr_q_p2_fifo_size;
607 unsigned char hk_lfr_q_p2_fifo_size;
608 // tc statistics
608 // tc statistics
609 unsigned char hk_lfr_update_info_tc_cnt[2];
609 unsigned char hk_lfr_update_info_tc_cnt[2];
610 unsigned char hk_lfr_update_time_tc_cnt[2];
610 unsigned char hk_lfr_update_time_tc_cnt[2];
611 unsigned char hk_lfr_exe_tc_cnt[2];
611 unsigned char hk_lfr_exe_tc_cnt[2];
612 unsigned char hk_lfr_rej_tc_cnt[2];
612 unsigned char hk_lfr_rej_tc_cnt[2];
613 unsigned char hk_lfr_last_exe_tc_id[2];
613 unsigned char hk_lfr_last_exe_tc_id[2];
614 unsigned char hk_lfr_last_exe_tc_type[2];
614 unsigned char hk_lfr_last_exe_tc_type[2];
615 unsigned char hk_lfr_last_exe_tc_subtype[2];
615 unsigned char hk_lfr_last_exe_tc_subtype[2];
616 unsigned char hk_lfr_last_exe_tc_time[6];
616 unsigned char hk_lfr_last_exe_tc_time[6];
617 unsigned char hk_lfr_last_rej_tc_id[2];
617 unsigned char hk_lfr_last_rej_tc_id[2];
618 unsigned char hk_lfr_last_rej_tc_type[2];
618 unsigned char hk_lfr_last_rej_tc_type[2];
619 unsigned char hk_lfr_last_rej_tc_subtype[2];
619 unsigned char hk_lfr_last_rej_tc_subtype[2];
620 unsigned char hk_lfr_last_rej_tc_time[6];
620 unsigned char hk_lfr_last_rej_tc_time[6];
621 // anomaly statistics
621 // anomaly statistics
622 unsigned char hk_lfr_le_cnt[2];
622 unsigned char hk_lfr_le_cnt[2];
623 unsigned char hk_lfr_me_cnt[2];
623 unsigned char hk_lfr_me_cnt[2];
624 unsigned char hk_lfr_he_cnt[2];
624 unsigned char hk_lfr_he_cnt[2];
625 unsigned char hk_lfr_last_er_rid[2];
625 unsigned char hk_lfr_last_er_rid[2];
626 unsigned char hk_lfr_last_er_code;
626 unsigned char hk_lfr_last_er_code;
627 unsigned char hk_lfr_last_er_time[6];
627 unsigned char hk_lfr_last_er_time[6];
628 // vhdl_blk_status
628 // vhdl_blk_status
629 unsigned char hk_lfr_vhdl_aa_sm;
629 unsigned char hk_lfr_vhdl_aa_sm;
630 unsigned char hk_lfr_vhdl_fft_sr;
630 unsigned char hk_lfr_vhdl_fft_sr;
631 unsigned char hk_lfr_vhdl_cic_hk;
631 unsigned char hk_lfr_vhdl_cic_hk;
632 unsigned char hk_lfr_vhdl_iir_cal;
632 unsigned char hk_lfr_vhdl_iir_cal;
633 // spacewire_if_statistics
633 // spacewire_if_statistics
634 unsigned char hk_lfr_dpu_spw_pkt_rcv_cnt[2];
634 unsigned char hk_lfr_dpu_spw_pkt_rcv_cnt[2];
635 unsigned char hk_lfr_dpu_spw_pkt_sent_cnt[2];
635 unsigned char hk_lfr_dpu_spw_pkt_sent_cnt[2];
636 unsigned char hk_lfr_dpu_spw_tick_out_cnt;
636 unsigned char hk_lfr_dpu_spw_tick_out_cnt;
637 unsigned char hk_lfr_dpu_spw_last_timc;
637 unsigned char hk_lfr_dpu_spw_last_timc;
638 // ahb error statistics
638 // ahb error statistics
639 unsigned char hk_lfr_last_fail_addr[4];
639 unsigned char hk_lfr_last_fail_addr[4];
640 // temperatures
640 // temperatures
641 unsigned char hk_lfr_temp_scm[2];
641 unsigned char hk_lfr_temp_scm[2];
642 unsigned char hk_lfr_temp_pcb[2];
642 unsigned char hk_lfr_temp_pcb[2];
643 unsigned char hk_lfr_temp_fpga[2];
643 unsigned char hk_lfr_temp_fpga[2];
644 // spacecraft potential
644 // spacecraft potential
645 unsigned char hk_lfr_sc_v_f3[2];
645 unsigned char hk_lfr_sc_v_f3[2];
646 unsigned char hk_lfr_sc_e1_f3[2];
646 unsigned char hk_lfr_sc_e1_f3[2];
647 unsigned char hk_lfr_sc_e2_f3[2];
647 unsigned char hk_lfr_sc_e2_f3[2];
648 // lfr common parameters
648 // lfr common parameters
649 unsigned char sy_lfr_common_parameters_spare;
649 unsigned char sy_lfr_common_parameters_spare;
650 unsigned char sy_lfr_common_parameters;
650 unsigned char sy_lfr_common_parameters;
651 // error counters
651 // error counters
652 unsigned char hk_lfr_dpu_spw_parity;
652 unsigned char hk_lfr_dpu_spw_parity;
653 unsigned char hk_lfr_dpu_spw_disconnect;
653 unsigned char hk_lfr_dpu_spw_disconnect;
654 unsigned char hk_lfr_dpu_spw_escape;
654 unsigned char hk_lfr_dpu_spw_escape;
655 unsigned char hk_lfr_dpu_spw_credit;
655 unsigned char hk_lfr_dpu_spw_credit;
656 unsigned char hk_lfr_dpu_spw_write_sync;
656 unsigned char hk_lfr_dpu_spw_write_sync;
657 unsigned char hk_lfr_dpu_spw_rx_ahb;
657 unsigned char hk_lfr_dpu_spw_rx_ahb;
658 unsigned char hk_lfr_dpu_spw_tx_ahb;
658 unsigned char hk_lfr_dpu_spw_tx_ahb;
659 unsigned char hk_lfr_dpu_spw_early_eop;
659 unsigned char hk_lfr_dpu_spw_early_eop;
660 unsigned char hk_lfr_dpu_spw_invalid_addr;
660 unsigned char hk_lfr_dpu_spw_invalid_addr;
661 unsigned char hk_lfr_dpu_spw_eep;
661 unsigned char hk_lfr_dpu_spw_eep;
662 unsigned char hk_lfr_dpu_spw_rx_too_big;
662 unsigned char hk_lfr_dpu_spw_rx_too_big;
663 // timecode
663 // timecode
664 unsigned char hk_lfr_timecode_erroneous;
664 unsigned char hk_lfr_timecode_erroneous;
665 unsigned char hk_lfr_timecode_missing;
665 unsigned char hk_lfr_timecode_missing;
666 unsigned char hk_lfr_timecode_invalid;
666 unsigned char hk_lfr_timecode_invalid;
667 // time
667 // time
668 unsigned char hk_lfr_time_timecode_it;
668 unsigned char hk_lfr_time_timecode_it;
669 unsigned char hk_lfr_time_not_synchro;
669 unsigned char hk_lfr_time_not_synchro;
670 unsigned char hk_lfr_time_timecode_ctr;
670 unsigned char hk_lfr_time_timecode_ctr;
671 // hk_lfr_buffer_dpu_
671 // hk_lfr_buffer_dpu_
672 unsigned char hk_lfr_buffer_dpu_tc_fifo;
672 unsigned char hk_lfr_buffer_dpu_tc_fifo;
673 unsigned char hk_lfr_buffer_dpu_tm_fifo;
673 unsigned char hk_lfr_buffer_dpu_tm_fifo;
674 // hk_lfr_ahb_
674 // hk_lfr_ahb_
675 unsigned char hk_lfr_ahb_correctable;
675 unsigned char hk_lfr_ahb_correctable;
676 unsigned char hk_lfr_ahb_uncorrectable;
676 unsigned char hk_lfr_ahb_uncorrectable;
677 // reaction wheel frequency
677 // reaction wheel frequency
678 unsigned char hk_lfr_sc_rw_f_flags;
678 unsigned char hk_lfr_sc_rw_f_flags;
679 } Packet_TM_LFR_HK_t;
679 } Packet_TM_LFR_HK_t;
680
680
681 typedef struct {
681 typedef struct {
682 unsigned char targetLogicalAddress;
682 unsigned char targetLogicalAddress;
683 unsigned char protocolIdentifier;
683 unsigned char protocolIdentifier;
684 unsigned char reserved;
684 unsigned char reserved;
685 unsigned char userApplication;
685 unsigned char userApplication;
686 unsigned char packetID[2];
686 unsigned char packetID[2];
687 unsigned char packetSequenceControl[2];
687 unsigned char packetSequenceControl[2];
688 unsigned char packetLength[2];
688 unsigned char packetLength[2];
689 // DATA FIELD HEADER
689 // DATA FIELD HEADER
690 unsigned char spare1_pusVersion_spare2;
690 unsigned char spare1_pusVersion_spare2;
691 unsigned char serviceType;
691 unsigned char serviceType;
692 unsigned char serviceSubType;
692 unsigned char serviceSubType;
693 unsigned char destinationID;
693 unsigned char destinationID;
694 unsigned char time[6];
694 unsigned char time[6];
695 unsigned char sid;
695 unsigned char sid;
696
696
697 //******************
697 //******************
698 // COMMON PARAMETERS
698 // COMMON PARAMETERS
699 unsigned char sy_lfr_common_parameters_spare;
699 unsigned char sy_lfr_common_parameters_spare;
700 unsigned char sy_lfr_common_parameters;
700 unsigned char sy_lfr_common_parameters;
701
701
702 //******************
702 //******************
703 // NORMAL PARAMETERS
703 // NORMAL PARAMETERS
704 unsigned char sy_lfr_n_swf_l[2];
704 unsigned char sy_lfr_n_swf_l[2];
705 unsigned char sy_lfr_n_swf_p[2];
705 unsigned char sy_lfr_n_swf_p[2];
706 unsigned char sy_lfr_n_asm_p[2];
706 unsigned char sy_lfr_n_asm_p[2];
707 unsigned char sy_lfr_n_bp_p0;
707 unsigned char sy_lfr_n_bp_p0;
708 unsigned char sy_lfr_n_bp_p1;
708 unsigned char sy_lfr_n_bp_p1;
709 unsigned char sy_lfr_n_cwf_long_f3;
709 unsigned char sy_lfr_n_cwf_long_f3;
710 unsigned char lfr_normal_parameters_spare;
710 unsigned char pa_rpw_spare8_1;
711
711
712 //*****************
712 //*****************
713 // BURST PARAMETERS
713 // BURST PARAMETERS
714 unsigned char sy_lfr_b_bp_p0;
714 unsigned char sy_lfr_b_bp_p0;
715 unsigned char sy_lfr_b_bp_p1;
715 unsigned char sy_lfr_b_bp_p1;
716
716
717 //****************
717 //****************
718 // SBM1 PARAMETERS
718 // SBM1 PARAMETERS
719 unsigned char sy_lfr_s1_bp_p0;
719 unsigned char sy_lfr_s1_bp_p0;
720 unsigned char sy_lfr_s1_bp_p1;
720 unsigned char sy_lfr_s1_bp_p1;
721
721
722 //****************
722 //****************
723 // SBM2 PARAMETERS
723 // SBM2 PARAMETERS
724 unsigned char sy_lfr_s2_bp_p0;
724 unsigned char sy_lfr_s2_bp_p0;
725 unsigned char sy_lfr_s2_bp_p1;
725 unsigned char sy_lfr_s2_bp_p1;
726
726
727 // mask F0
727 // mask F0
728 unsigned char sy_lfr_fbins_f0_word1[4];
728 unsigned char sy_lfr_fbins_f0_word1[4];
729 unsigned char sy_lfr_fbins_f0_word2[4];
729 unsigned char sy_lfr_fbins_f0_word2[4];
730 unsigned char sy_lfr_fbins_f0_word3[4];
730 unsigned char sy_lfr_fbins_f0_word3[4];
731 unsigned char sy_lfr_fbins_f0_word4[4];
731 unsigned char sy_lfr_fbins_f0_word4[4];
732 // mask F1
732 // mask F1
733 unsigned char sy_lfr_fbins_f1_word1[4];
733 unsigned char sy_lfr_fbins_f1_word1[4];
734 unsigned char sy_lfr_fbins_f1_word2[4];
734 unsigned char sy_lfr_fbins_f1_word2[4];
735 unsigned char sy_lfr_fbins_f1_word3[4];
735 unsigned char sy_lfr_fbins_f1_word3[4];
736 unsigned char sy_lfr_fbins_f1_word4[4];
736 unsigned char sy_lfr_fbins_f1_word4[4];
737 // mask F2
737 // mask F2
738 unsigned char sy_lfr_fbins_f2_word1[4];
738 unsigned char sy_lfr_fbins_f2_word1[4];
739 unsigned char sy_lfr_fbins_f2_word2[4];
739 unsigned char sy_lfr_fbins_f2_word2[4];
740 unsigned char sy_lfr_fbins_f2_word3[4];
740 unsigned char sy_lfr_fbins_f2_word3[4];
741 unsigned char sy_lfr_fbins_f2_word4[4];
741 unsigned char sy_lfr_fbins_f2_word4[4];
742
742
743 // PAS FILTER PARAMETERS
743 // PAS FILTER PARAMETERS
744 unsigned char pa_rpw_spare8_2;
744 unsigned char spare_sy_lfr_pas_filter_enabled;
745 unsigned char spare_sy_lfr_pas_filter_enabled;
745 unsigned char sy_lfr_pas_filter_modulus;
746 unsigned char sy_lfr_pas_filter_modulus;
746 unsigned char sy_lfr_pas_filter_tbad[4];
747 unsigned char sy_lfr_pas_filter_tbad[4];
747 unsigned char sy_lfr_pas_filter_offset;
748 unsigned char sy_lfr_pas_filter_offset;
748 unsigned char sy_lfr_pas_filter_shift[4];
749 unsigned char sy_lfr_pas_filter_shift[4];
749 unsigned char sy_lfr_sc_rw_delta_f[4];
750 unsigned char sy_lfr_sc_rw_delta_f[4];
750
751
751 // LFR_RW_MASK
752 // LFR_RW_MASK
752 unsigned char sy_lfr_rw_mask_f0_word1[4];
753 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_word2[4];
754 unsigned char sy_lfr_rw_mask_f0_word3[4];
755 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_f0_word4[4];
756 unsigned char sy_lfr_rw_mask_f1_word1[4];
757 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_word2[4];
758 unsigned char sy_lfr_rw_mask_f1_word3[4];
759 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_f1_word4[4];
760 unsigned char sy_lfr_rw_mask_f2_word1[4];
761 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_word2[4];
762 unsigned char sy_lfr_rw_mask_f2_word3[4];
763 unsigned char sy_lfr_rw_mask_f2_word3[4];
763 unsigned char sy_lfr_rw_mask_f2_word4[4];
764 unsigned char sy_lfr_rw_mask_f2_word4[4];
764
765
765 // SPARE
766 // SPARE
766 unsigned char source_data_spare;
767 unsigned char pa_rpw_spare8_3;
767 } Packet_TM_LFR_PARAMETER_DUMP_t;
768 } Packet_TM_LFR_PARAMETER_DUMP_t;
768
769
769 typedef struct {
770 typedef struct {
770 unsigned char targetLogicalAddress;
771 unsigned char targetLogicalAddress;
771 unsigned char protocolIdentifier;
772 unsigned char protocolIdentifier;
772 unsigned char reserved;
773 unsigned char reserved;
773 unsigned char userApplication;
774 unsigned char userApplication;
774 unsigned char packetID[2];
775 unsigned char packetID[2];
775 unsigned char packetSequenceControl[2];
776 unsigned char packetSequenceControl[2];
776 unsigned char packetLength[2];
777 unsigned char packetLength[2];
777 // DATA FIELD HEADER
778 // DATA FIELD HEADER
778 unsigned char spare1_pusVersion_spare2;
779 unsigned char spare1_pusVersion_spare2;
779 unsigned char serviceType;
780 unsigned char serviceType;
780 unsigned char serviceSubType;
781 unsigned char serviceSubType;
781 unsigned char destinationID;
782 unsigned char destinationID;
782 unsigned char time[6];
783 unsigned char time[6];
783 unsigned char sid;
784 unsigned char sid;
784 unsigned char pkt_cnt;
785 unsigned char pkt_cnt;
785 unsigned char pkt_nr;
786 unsigned char pkt_nr;
786 unsigned char blk_nr;
787 unsigned char blk_nr;
787
788
788 //******************
789 //******************
789 // SOURCE DATA repeated N times with N in [0 .. PA_LFR_KCOEFF_BLK_NR]
790 // SOURCE DATA repeated N times with N in [0 .. PA_LFR_KCOEFF_BLK_NR]
790 unsigned char kcoeff_blks[3900]; // one blk is 2 + 4 * 32 = 130 bytes, 30 blks max in one packet (30 * 130 = 3900)
791 unsigned char kcoeff_blks[3900]; // one blk is 2 + 4 * 32 = 130 bytes, 30 blks max in one packet (30 * 130 = 3900)
791
792
792 } Packet_TM_LFR_KCOEFFICIENTS_DUMP_t;
793 } Packet_TM_LFR_KCOEFFICIENTS_DUMP_t;
793
794
794 #endif // CCSDS_TYPES_H_INCLUDED
795 #endif // CCSDS_TYPES_H_INCLUDED
@@ -1,275 +1,281
1 #ifndef FSW_PARAMS_H_INCLUDED
1 #ifndef FSW_PARAMS_H_INCLUDED
2 #define FSW_PARAMS_H_INCLUDED
2 #define FSW_PARAMS_H_INCLUDED
3
3
4 #include "fsw_params_processing.h"
4 #include "fsw_params_processing.h"
5 #include "fsw_params_nb_bytes.h"
5 #include "fsw_params_nb_bytes.h"
6 #include "tm_byte_positions.h"
6 #include "tm_byte_positions.h"
7 #include "ccsds_types.h"
7 #include "ccsds_types.h"
8
8
9 #define GRSPW_DEVICE_NAME "/dev/grspw0"
9 #define GRSPW_DEVICE_NAME "/dev/grspw0"
10 #define UART_DEVICE_NAME "/dev/console"
10 #define UART_DEVICE_NAME "/dev/console"
11
11
12 enum lfr_transition_type_t{
12 enum lfr_transition_type_t{
13 TRANSITION_NOT_SPECIFIC,
13 TRANSITION_NOT_SPECIFIC,
14 TRANSITION_NORM_TO_S1,
14 TRANSITION_NORM_TO_S1,
15 TRANSITION_NORM_TO_S2,
15 TRANSITION_NORM_TO_S2,
16 TRANSITION_S1_TO_NORM,
16 TRANSITION_S1_TO_NORM,
17 TRANSITION_S2_TO_NORM,
17 TRANSITION_S2_TO_NORM,
18 TRANSITION_S1_TO_S2,
18 TRANSITION_S1_TO_S2,
19 TRANSITION_S2_TO_S1
19 TRANSITION_S2_TO_S1
20 };
20 };
21
21
22 typedef struct ring_node
22 typedef struct ring_node
23 {
23 {
24 struct ring_node *previous;
24 struct ring_node *previous;
25 struct ring_node *next;
25 struct ring_node *next;
26 unsigned int sid;
26 unsigned int sid;
27 unsigned int coarseTime;
27 unsigned int coarseTime;
28 unsigned int fineTime;
28 unsigned int fineTime;
29 int buffer_address;
29 int buffer_address;
30 unsigned int status;
30 unsigned int status;
31 } ring_node;
31 } ring_node;
32
32
33 //************************
33 //************************
34 // flight software version
34 // flight software version
35 // this parameters is handled by the Qt project options
35 // this parameters is handled by the Qt project options
36
36
37 #define NB_PACKETS_PER_GROUP_OF_CWF 8 // 8 packets containing 336 blk
37 #define NB_PACKETS_PER_GROUP_OF_CWF 8 // 8 packets containing 336 blk
38 #define NB_PACKETS_PER_GROUP_OF_CWF_LIGHT 4 // 4 packets containing 672 blk
38 #define NB_PACKETS_PER_GROUP_OF_CWF_LIGHT 4 // 4 packets containing 672 blk
39 #define NB_SAMPLES_PER_SNAPSHOT 2688 // 336 * 8 = 672 * 4 = 2688
39 #define NB_SAMPLES_PER_SNAPSHOT 2688 // 336 * 8 = 672 * 4 = 2688
40 #define TIME_OFFSET 2
40 #define TIME_OFFSET 2
41 #define TIME_OFFSET_IN_BYTES 8
41 #define TIME_OFFSET_IN_BYTES 8
42 //#define WAVEFORM_EXTENDED_HEADER_OFFSET 22
42 //#define WAVEFORM_EXTENDED_HEADER_OFFSET 22
43 #define NB_BYTES_SWF_BLK (2 * 6)
43 #define NB_BYTES_SWF_BLK (2 * 6)
44 #define NB_WORDS_SWF_BLK 3
44 #define NB_WORDS_SWF_BLK 3
45 #define NB_BYTES_CWF3_LIGHT_BLK 6
45 #define NB_BYTES_CWF3_LIGHT_BLK 6
46 //#define WFRM_INDEX_OF_LAST_PACKET 6 // waveforms are transmitted in groups of 2048 blocks, 6 packets of 340 and 1 of 8
46 //#define WFRM_INDEX_OF_LAST_PACKET 6 // waveforms are transmitted in groups of 2048 blocks, 6 packets of 340 and 1 of 8
47 #define NB_RING_NODES_F0 3 // AT LEAST 3
47 #define NB_RING_NODES_F0 3 // AT LEAST 3
48 #define NB_RING_NODES_F1 5 // AT LEAST 3
48 #define NB_RING_NODES_F1 5 // AT LEAST 3
49 #define NB_RING_NODES_F2 5 // AT LEAST 3
49 #define NB_RING_NODES_F2 5 // AT LEAST 3
50 #define NB_RING_NODES_F3 3 // AT LEAST 3
50 #define NB_RING_NODES_F3 3 // AT LEAST 3
51
51
52 //**********
52 //**********
53 // LFR MODES
53 // LFR MODES
54 #define LFR_MODE_STANDBY 0
54 #define LFR_MODE_STANDBY 0
55 #define LFR_MODE_NORMAL 1
55 #define LFR_MODE_NORMAL 1
56 #define LFR_MODE_BURST 2
56 #define LFR_MODE_BURST 2
57 #define LFR_MODE_SBM1 3
57 #define LFR_MODE_SBM1 3
58 #define LFR_MODE_SBM2 4
58 #define LFR_MODE_SBM2 4
59
59
60 #define TDS_MODE_LFM 5
60 #define TDS_MODE_LFM 5
61 #define TDS_MODE_STANDBY 0
61 #define TDS_MODE_STANDBY 0
62 #define TDS_MODE_NORMAL 1
62 #define TDS_MODE_NORMAL 1
63 #define TDS_MODE_BURST 2
63 #define TDS_MODE_BURST 2
64 #define TDS_MODE_SBM1 3
64 #define TDS_MODE_SBM1 3
65 #define TDS_MODE_SBM2 4
65 #define TDS_MODE_SBM2 4
66
66
67 #define THR_MODE_STANDBY 0
67 #define THR_MODE_STANDBY 0
68 #define THR_MODE_NORMAL 1
68 #define THR_MODE_NORMAL 1
69 #define THR_MODE_BURST 2
69 #define THR_MODE_BURST 2
70
70
71 #define RTEMS_EVENT_MODE_STANDBY RTEMS_EVENT_0
71 #define RTEMS_EVENT_MODE_STANDBY RTEMS_EVENT_0
72 #define RTEMS_EVENT_MODE_NORMAL RTEMS_EVENT_1
72 #define RTEMS_EVENT_MODE_NORMAL RTEMS_EVENT_1
73 #define RTEMS_EVENT_MODE_BURST RTEMS_EVENT_2
73 #define RTEMS_EVENT_MODE_BURST RTEMS_EVENT_2
74 #define RTEMS_EVENT_MODE_SBM1 RTEMS_EVENT_3
74 #define RTEMS_EVENT_MODE_SBM1 RTEMS_EVENT_3
75 #define RTEMS_EVENT_MODE_SBM2 RTEMS_EVENT_4
75 #define RTEMS_EVENT_MODE_SBM2 RTEMS_EVENT_4
76 #define RTEMS_EVENT_MODE_NORM_S1_S2 RTEMS_EVENT_5
76 #define RTEMS_EVENT_MODE_NORM_S1_S2 RTEMS_EVENT_5
77 #define RTEMS_EVENT_NORM_BP1_F0 RTEMS_EVENT_6
77 #define RTEMS_EVENT_NORM_BP1_F0 RTEMS_EVENT_6
78 #define RTEMS_EVENT_NORM_BP2_F0 RTEMS_EVENT_7
78 #define RTEMS_EVENT_NORM_BP2_F0 RTEMS_EVENT_7
79 #define RTEMS_EVENT_NORM_ASM_F0 RTEMS_EVENT_8 // ASM only in NORM mode
79 #define RTEMS_EVENT_NORM_ASM_F0 RTEMS_EVENT_8 // ASM only in NORM mode
80 #define RTEMS_EVENT_NORM_BP1_F1 RTEMS_EVENT_9
80 #define RTEMS_EVENT_NORM_BP1_F1 RTEMS_EVENT_9
81 #define RTEMS_EVENT_NORM_BP2_F1 RTEMS_EVENT_10
81 #define RTEMS_EVENT_NORM_BP2_F1 RTEMS_EVENT_10
82 #define RTEMS_EVENT_NORM_ASM_F1 RTEMS_EVENT_11 // ASM only in NORM mode
82 #define RTEMS_EVENT_NORM_ASM_F1 RTEMS_EVENT_11 // ASM only in NORM mode
83 #define RTEMS_EVENT_NORM_BP1_F2 RTEMS_EVENT_12
83 #define RTEMS_EVENT_NORM_BP1_F2 RTEMS_EVENT_12
84 #define RTEMS_EVENT_NORM_BP2_F2 RTEMS_EVENT_13
84 #define RTEMS_EVENT_NORM_BP2_F2 RTEMS_EVENT_13
85 #define RTEMS_EVENT_NORM_ASM_F2 RTEMS_EVENT_14 // ASM only in NORM mode
85 #define RTEMS_EVENT_NORM_ASM_F2 RTEMS_EVENT_14 // ASM only in NORM mode
86 #define RTEMS_EVENT_SBM_BP1_F0 RTEMS_EVENT_15
86 #define RTEMS_EVENT_SBM_BP1_F0 RTEMS_EVENT_15
87 #define RTEMS_EVENT_SBM_BP2_F0 RTEMS_EVENT_16
87 #define RTEMS_EVENT_SBM_BP2_F0 RTEMS_EVENT_16
88 #define RTEMS_EVENT_SBM_BP1_F1 RTEMS_EVENT_17
88 #define RTEMS_EVENT_SBM_BP1_F1 RTEMS_EVENT_17
89 #define RTEMS_EVENT_SBM_BP2_F1 RTEMS_EVENT_18
89 #define RTEMS_EVENT_SBM_BP2_F1 RTEMS_EVENT_18
90 #define RTEMS_EVENT_BURST_BP1_F0 RTEMS_EVENT_19
90 #define RTEMS_EVENT_BURST_BP1_F0 RTEMS_EVENT_19
91 #define RTEMS_EVENT_BURST_BP2_F0 RTEMS_EVENT_20
91 #define RTEMS_EVENT_BURST_BP2_F0 RTEMS_EVENT_20
92 #define RTEMS_EVENT_BURST_BP1_F1 RTEMS_EVENT_21
92 #define RTEMS_EVENT_BURST_BP1_F1 RTEMS_EVENT_21
93 #define RTEMS_EVENT_BURST_BP2_F1 RTEMS_EVENT_22
93 #define RTEMS_EVENT_BURST_BP2_F1 RTEMS_EVENT_22
94 #define RTEMS_EVENT_SWF_RESYNCH RTEMS_EVENT_23
94 #define RTEMS_EVENT_SWF_RESYNCH RTEMS_EVENT_23
95
95
96 //****************************
96 //****************************
97 // LFR DEFAULT MODE PARAMETERS
97 // LFR DEFAULT MODE PARAMETERS
98 #define DEFAULT_LAST_VALID_TRANSITION_DATE 0xffffffff
98 #define DEFAULT_LAST_VALID_TRANSITION_DATE 0xffffffff
99 // COMMON
99 // COMMON
100 #define DEFAULT_SY_LFR_COMMON0 0x00
100 #define DEFAULT_SY_LFR_COMMON0 0x00
101 #define DEFAULT_SY_LFR_COMMON1 0x20 // default value bw sp0 sp1 r0 r1 r2 = 1 0 0 0 0 0
101 #define DEFAULT_SY_LFR_COMMON1 0x20 // default value bw sp0 sp1 r0 r1 r2 = 1 0 0 0 0 0
102 // NORM
102 // NORM
103 #define DFLT_SY_LFR_N_SWF_L 2048 // nb sample
103 #define DFLT_SY_LFR_N_SWF_L 2048 // nb sample
104 #define DFLT_SY_LFR_N_SWF_P 300 // sec
104 #define DFLT_SY_LFR_N_SWF_P 300 // sec
105 #define DFLT_SY_LFR_N_ASM_P 3600 // sec
105 #define DFLT_SY_LFR_N_ASM_P 3600 // sec
106 #define DFLT_SY_LFR_N_BP_P0 4 // sec
106 #define DFLT_SY_LFR_N_BP_P0 4 // sec
107 #define DFLT_SY_LFR_N_BP_P1 20 // sec
107 #define DFLT_SY_LFR_N_BP_P1 20 // sec
108 #define DFLT_SY_LFR_N_CWF_LONG_F3 0 // 0 => production of light continuous waveforms at f3
108 #define DFLT_SY_LFR_N_CWF_LONG_F3 0 // 0 => production of light continuous waveforms at f3
109 #define MIN_DELTA_SNAPSHOT 16 // sec
109 #define MIN_DELTA_SNAPSHOT 16 // sec
110 // BURST
110 // BURST
111 #define DEFAULT_SY_LFR_B_BP_P0 1 // sec
111 #define DEFAULT_SY_LFR_B_BP_P0 1 // sec
112 #define DEFAULT_SY_LFR_B_BP_P1 5 // sec
112 #define DEFAULT_SY_LFR_B_BP_P1 5 // sec
113 // SBM1
113 // SBM1
114 #define DEFAULT_SY_LFR_S1_BP_P0 1 // sec
114 #define DEFAULT_SY_LFR_S1_BP_P0 1 // sec
115 #define DEFAULT_SY_LFR_S1_BP_P1 1 // sec
115 #define DEFAULT_SY_LFR_S1_BP_P1 1 // sec
116 // SBM2
116 // SBM2
117 #define DEFAULT_SY_LFR_S2_BP_P0 1 // sec
117 #define DEFAULT_SY_LFR_S2_BP_P0 1 // sec
118 #define DEFAULT_SY_LFR_S2_BP_P1 5 // sec
118 #define DEFAULT_SY_LFR_S2_BP_P1 5 // sec
119 // ADDITIONAL PARAMETERS
119 // ADDITIONAL PARAMETERS
120 #define TIME_BETWEEN_TWO_SWF_PACKETS 30 // nb x 10 ms => 300 ms
120 #define TIME_BETWEEN_TWO_SWF_PACKETS 30 // nb x 10 ms => 300 ms
121 #define TIME_BETWEEN_TWO_CWF3_PACKETS 1000 // nb x 10 ms => 10 s
121 #define TIME_BETWEEN_TWO_CWF3_PACKETS 1000 // nb x 10 ms => 10 s
122 // STATUS WORD
122 // STATUS WORD
123 #define DEFAULT_STATUS_WORD_BYTE0 0x0d // [0000] [1] [101] mode 4 bits / SPW enabled 1 bit / state is run 3 bits
123 #define DEFAULT_STATUS_WORD_BYTE0 0x0d // [0000] [1] [101] mode 4 bits / SPW enabled 1 bit / state is run 3 bits
124 #define DEFAULT_STATUS_WORD_BYTE1 0x00
124 #define DEFAULT_STATUS_WORD_BYTE1 0x00
125 //
125 //
126 #define SY_LFR_DPU_CONNECT_TIMEOUT 100 // 100 * 10 ms = 1 s
126 #define SY_LFR_DPU_CONNECT_TIMEOUT 100 // 100 * 10 ms = 1 s
127 #define SY_LFR_DPU_CONNECT_ATTEMPT 3
127 #define SY_LFR_DPU_CONNECT_ATTEMPT 3
128 //****************************
128 //****************************
129
129
130 //*****************************
130 //*****************************
131 // APB REGISTERS BASE ADDRESSES
131 // APB REGISTERS BASE ADDRESSES
132 #define REGS_ADDR_APBUART 0x80000100
132 #define REGS_ADDR_APBUART 0x80000100
133 #define REGS_ADDR_GPTIMER 0x80000300
133 #define REGS_ADDR_GPTIMER 0x80000300
134 #define REGS_ADDR_GRSPW 0x80000500
134 #define REGS_ADDR_GRSPW 0x80000500
135 #define APB_OFFSET_GRSPW_STATUS_REGISTER 0x04
135 #define APB_OFFSET_GRSPW_STATUS_REGISTER 0x04
136 #define APB_OFFSET_GRSPW_TIME_REGISTER 0x14
136 #define APB_OFFSET_GRSPW_TIME_REGISTER 0x14
137 #define REGS_ADDR_TIME_MANAGEMENT 0x80000600
137 #define REGS_ADDR_TIME_MANAGEMENT 0x80000600
138 #define REGS_ADDR_GRGPIO 0x80000b00
138 #define REGS_ADDR_GRGPIO 0x80000b00
139
139
140 #define REGS_ADDR_SPECTRAL_MATRIX 0x80000f00
140 #define REGS_ADDR_SPECTRAL_MATRIX 0x80000f00
141 #define REGS_ADDR_WAVEFORM_PICKER 0x80000f54 // PDB >= 0.1.28
141 #define REGS_ADDR_WAVEFORM_PICKER 0x80000f54 // PDB >= 0.1.28
142 #define REGS_ADDR_VHDL_VERSION 0x80000ff0
142 #define REGS_ADDR_VHDL_VERSION 0x80000ff0
143
143
144 #define APBUART_CTRL_REG_MASK_DB 0xfffff7ff
144 #define APBUART_CTRL_REG_MASK_DB 0xfffff7ff
145 #define APBUART_CTRL_REG_MASK_TE 0x00000002
145 #define APBUART_CTRL_REG_MASK_TE 0x00000002
146 // scaler value = system_clock_frequency / ( baud_rate * 8 ) - 1
146 // scaler value = system_clock_frequency / ( baud_rate * 8 ) - 1
147 #define APBUART_SCALER_RELOAD_VALUE 0x00000050 // 25 MHz => about 38400
147 #define APBUART_SCALER_RELOAD_VALUE 0x00000050 // 25 MHz => about 38400
148
148
149 //**********
149 //**********
150 // IRQ LINES
150 // IRQ LINES
151 #define IRQ_GPTIMER_WATCHDOG 9
151 #define IRQ_GPTIMER_WATCHDOG 9
152 #define IRQ_SPARC_GPTIMER_WATCHDOG 0x19 // see sparcv8.pdf p.76 for interrupt levels
152 #define IRQ_SPARC_GPTIMER_WATCHDOG 0x19 // see sparcv8.pdf p.76 for interrupt levels
153 #define IRQ_WAVEFORM_PICKER 14
153 #define IRQ_WAVEFORM_PICKER 14
154 #define IRQ_SPARC_WAVEFORM_PICKER 0x1e // see sparcv8.pdf p.76 for interrupt levels
154 #define IRQ_SPARC_WAVEFORM_PICKER 0x1e // see sparcv8.pdf p.76 for interrupt levels
155 #define IRQ_SPECTRAL_MATRIX 6
155 #define IRQ_SPECTRAL_MATRIX 6
156 #define IRQ_SPARC_SPECTRAL_MATRIX 0x16 // see sparcv8.pdf p.76 for interrupt levels
156 #define IRQ_SPARC_SPECTRAL_MATRIX 0x16 // see sparcv8.pdf p.76 for interrupt levels
157
157
158 //*****
158 //*****
159 // TIME
159 // TIME
160 #define CLKDIV_WATCHDOG (10000000 - 1) // 10.0s => 10 000 000
160 #define CLKDIV_WATCHDOG (10000000 - 1) // 10.0s => 10 000 000
161 #define TIMER_WATCHDOG 1
161 #define TIMER_WATCHDOG 1
162 #define WATCHDOG_PERIOD 100 // 1s
162 #define WATCHDOG_PERIOD 100 // 1s
163 #define HK_PERIOD 100 // 100 * 10ms => 1s
163 #define HK_PERIOD 100 // 100 * 10ms => 1s
164 #define SY_LFR_TIME_SYN_TIMEOUT_in_ticks 200 // 200 * 10 ms = 2 s
164 #define SY_LFR_TIME_SYN_TIMEOUT_in_ticks 200 // 200 * 10 ms = 2 s
165 #define TIMECODE_TIMER_TIMEOUT 120 // 120 * 10 ms = 1.2 s
165 #define TIMECODE_TIMER_TIMEOUT 120 // 120 * 10 ms = 1.2 s
166 #define TIMECODE_TIMER_TIMEOUT_INIT 200 // 200 * 10 ms = 2.0 s
166 #define TIMECODE_TIMER_TIMEOUT_INIT 200 // 200 * 10 ms = 2.0 s
167 #define TIMECODE_MASK 0x3f // 0011 1111
167 #define TIMECODE_MASK 0x3f // 0011 1111
168
168
169 //**********
169 //**********
170 // LPP CODES
170 // LPP CODES
171 #define LFR_SUCCESSFUL 0
171 #define LFR_SUCCESSFUL 0
172 #define LFR_DEFAULT 1
172 #define LFR_DEFAULT 1
173 #define LFR_EXE_ERROR 2
173 #define LFR_EXE_ERROR 2
174
174
175 //******
175 //******
176 // RTEMS
176 // RTEMS
177 #define TASKID_RECV 1
177 #define TASKID_RECV 1
178 #define TASKID_ACTN 2
178 #define TASKID_ACTN 2
179 #define TASKID_SPIQ 3
179 #define TASKID_SPIQ 3
180 #define TASKID_LOAD 4
180 #define TASKID_LOAD 4
181 #define TASKID_AVF0 5
181 #define TASKID_AVF0 5
182 #define TASKID_SWBD 6
182 #define TASKID_SWBD 6
183 #define TASKID_WFRM 7
183 #define TASKID_WFRM 7
184 #define TASKID_DUMB 8
184 #define TASKID_DUMB 8
185 #define TASKID_HOUS 9
185 #define TASKID_HOUS 9
186 #define TASKID_PRC0 10
186 #define TASKID_PRC0 10
187 #define TASKID_CWF3 11
187 #define TASKID_CWF3 11
188 #define TASKID_CWF2 12
188 #define TASKID_CWF2 12
189 #define TASKID_CWF1 13
189 #define TASKID_CWF1 13
190 #define TASKID_SEND 14
190 #define TASKID_SEND 14
191 #define TASKID_LINK 15
191 #define TASKID_LINK 15
192 #define TASKID_AVF1 16
192 #define TASKID_AVF1 16
193 #define TASKID_PRC1 17
193 #define TASKID_PRC1 17
194 #define TASKID_AVF2 18
194 #define TASKID_AVF2 18
195 #define TASKID_PRC2 19
195 #define TASKID_PRC2 19
196
196
197 #define TASK_PRIORITY_SPIQ 5
197 #define TASK_PRIORITY_SPIQ 5
198 #define TASK_PRIORITY_LINK 20
198 #define TASK_PRIORITY_LINK 20
199 #define TASK_PRIORITY_HOUS 30
199 #define TASK_PRIORITY_HOUS 30
200 #define TASK_PRIORITY_CWF1 35 // CWF1 and CWF2 are never running together
200 #define TASK_PRIORITY_CWF1 35 // CWF1 and CWF2 are never running together
201 #define TASK_PRIORITY_CWF2 35 //
201 #define TASK_PRIORITY_CWF2 35 //
202 #define TASK_PRIORITY_SWBD 37 // SWBD has a lower priority than WFRM, this is to extract the snapshot before sending it
202 #define TASK_PRIORITY_SWBD 37 // SWBD has a lower priority than WFRM, this is to extract the snapshot before sending it
203 #define TASK_PRIORITY_WFRM 40
203 #define TASK_PRIORITY_WFRM 40
204 #define TASK_PRIORITY_CWF3 40 // there is a printf in this function, be careful with its priority wrt CWF1
204 #define TASK_PRIORITY_CWF3 40 // there is a printf in this function, be careful with its priority wrt CWF1
205 #define TASK_PRIORITY_SEND 45
205 #define TASK_PRIORITY_SEND 45
206 #define TASK_PRIORITY_RECV 50
206 #define TASK_PRIORITY_RECV 50
207 #define TASK_PRIORITY_ACTN 50
207 #define TASK_PRIORITY_ACTN 50
208 #define TASK_PRIORITY_AVF0 60
208 #define TASK_PRIORITY_AVF0 60
209 #define TASK_PRIORITY_AVF1 70
209 #define TASK_PRIORITY_AVF1 70
210 #define TASK_PRIORITY_PRC0 100
210 #define TASK_PRIORITY_PRC0 100
211 #define TASK_PRIORITY_PRC1 100
211 #define TASK_PRIORITY_PRC1 100
212 #define TASK_PRIORITY_AVF2 110
212 #define TASK_PRIORITY_AVF2 110
213 #define TASK_PRIORITY_PRC2 110
213 #define TASK_PRIORITY_PRC2 110
214 #define TASK_PRIORITY_LOAD 190
214 #define TASK_PRIORITY_LOAD 190
215 #define TASK_PRIORITY_DUMB 200
215 #define TASK_PRIORITY_DUMB 200
216
216
217 #define MSG_QUEUE_COUNT_RECV 10
217 #define MSG_QUEUE_COUNT_RECV 10
218 #define MSG_QUEUE_COUNT_SEND 50
218 #define MSG_QUEUE_COUNT_SEND 50
219 #define MSG_QUEUE_COUNT_PRC0 10
219 #define MSG_QUEUE_COUNT_PRC0 10
220 #define MSG_QUEUE_COUNT_PRC1 10
220 #define MSG_QUEUE_COUNT_PRC1 10
221 #define MSG_QUEUE_COUNT_PRC2 5
221 #define MSG_QUEUE_COUNT_PRC2 5
222 #define MSG_QUEUE_SIZE_SEND 812 // 808 + 4 => TM_LFR_SCIENCE_BURST_BP2_F1
222 #define MSG_QUEUE_SIZE_SEND 812 // 808 + 4 => TM_LFR_SCIENCE_BURST_BP2_F1
223 #define ACTION_MSG_SPW_IOCTL_SEND_SIZE 24 // hlen *hdr dlen *data sent options
223 #define ACTION_MSG_SPW_IOCTL_SEND_SIZE 24 // hlen *hdr dlen *data sent options
224 #define MSG_QUEUE_SIZE_PRC0 28 // two pointers, one rtems_event + 4 integers
224 #define MSG_QUEUE_SIZE_PRC0 28 // two pointers, one rtems_event + 4 integers
225 #define MSG_QUEUE_SIZE_PRC1 28 // two pointers, one rtems_event + 4 integers
225 #define MSG_QUEUE_SIZE_PRC1 28 // two pointers, one rtems_event + 4 integers
226 #define MSG_QUEUE_SIZE_PRC2 28 // two pointers, one rtems_event + 4 integers
226 #define MSG_QUEUE_SIZE_PRC2 28 // two pointers, one rtems_event + 4 integers
227
227
228 #define QUEUE_RECV 0
228 #define QUEUE_RECV 0
229 #define QUEUE_SEND 1
229 #define QUEUE_SEND 1
230 #define QUEUE_PRC0 2
230 #define QUEUE_PRC0 2
231 #define QUEUE_PRC1 3
231 #define QUEUE_PRC1 3
232 #define QUEUE_PRC2 4
232 #define QUEUE_PRC2 4
233
233
234 //*******
234 //*******
235 // MACROS
235 // MACROS
236 #ifdef PRINT_MESSAGES_ON_CONSOLE
236 #ifdef PRINT_MESSAGES_ON_CONSOLE
237 #define PRINTF(x) printf(x);
237 #define PRINTF(x) printf(x);
238 #define PRINTF1(x,y) printf(x,y);
238 #define PRINTF1(x,y) printf(x,y);
239 #define PRINTF2(x,y,z) printf(x,y,z);
239 #define PRINTF2(x,y,z) printf(x,y,z);
240 #else
240 #else
241 #define PRINTF(x) ;
241 #define PRINTF(x) ;
242 #define PRINTF1(x,y) ;
242 #define PRINTF1(x,y) ;
243 #define PRINTF2(x,y,z) ;
243 #define PRINTF2(x,y,z) ;
244 #endif
244 #endif
245
245
246 #ifdef BOOT_MESSAGES
246 #ifdef BOOT_MESSAGES
247 #define BOOT_PRINTF(x) printf(x);
247 #define BOOT_PRINTF(x) printf(x);
248 #define BOOT_PRINTF1(x,y) printf(x,y);
248 #define BOOT_PRINTF1(x,y) printf(x,y);
249 #define BOOT_PRINTF2(x,y,z) printf(x,y,z);
249 #define BOOT_PRINTF2(x,y,z) printf(x,y,z);
250 #else
250 #else
251 #define BOOT_PRINTF(x) ;
251 #define BOOT_PRINTF(x) ;
252 #define BOOT_PRINTF1(x,y) ;
252 #define BOOT_PRINTF1(x,y) ;
253 #define BOOT_PRINTF2(x,y,z) ;
253 #define BOOT_PRINTF2(x,y,z) ;
254 #endif
254 #endif
255
255
256 #ifdef DEBUG_MESSAGES
256 #ifdef DEBUG_MESSAGES
257 #define DEBUG_PRINTF(x) printf(x);
257 #define DEBUG_PRINTF(x) printf(x);
258 #define DEBUG_PRINTF1(x,y) printf(x,y);
258 #define DEBUG_PRINTF1(x,y) printf(x,y);
259 #define DEBUG_PRINTF2(x,y,z) printf(x,y,z);
259 #define DEBUG_PRINTF2(x,y,z) printf(x,y,z);
260 #else
260 #else
261 #define DEBUG_PRINTF(x) ;
261 #define DEBUG_PRINTF(x) ;
262 #define DEBUG_PRINTF1(x,y) ;
262 #define DEBUG_PRINTF1(x,y) ;
263 #define DEBUG_PRINTF2(x,y,z) ;
263 #define DEBUG_PRINTF2(x,y,z) ;
264 #endif
264 #endif
265
265
266 #define CPU_USAGE_REPORT_PERIOD 6 // * 10 s = period
266 #define CPU_USAGE_REPORT_PERIOD 6 // * 10 s = period
267
267
268 struct param_local_str{
268 struct param_local_str{
269 unsigned int local_sbm1_nb_cwf_sent;
269 unsigned int local_sbm1_nb_cwf_sent;
270 unsigned int local_sbm1_nb_cwf_max;
270 unsigned int local_sbm1_nb_cwf_max;
271 unsigned int local_sbm2_nb_cwf_sent;
271 unsigned int local_sbm2_nb_cwf_sent;
272 unsigned int local_sbm2_nb_cwf_max;
272 unsigned int local_sbm2_nb_cwf_max;
273 };
273 };
274
274
275 typedef struct {
276 unsigned char merged_fbins_mask_f0[16];
277 unsigned char merged_fbins_mask_f1[16];
278 unsigned char merged_fbins_mask_f2[16];
279 } fbins_masks_t;
280
275 #endif // FSW_PARAMS_H_INCLUDED
281 #endif // FSW_PARAMS_H_INCLUDED
General Comments 0
You need to be logged in to leave comments. Login now