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