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