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