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