##// END OF EJS Templates

Compare Commits r69:db74b38fe91c...r75:f5b83fb540b1

Target:

Source:

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