##// END OF EJS Templates
sync
paul -
r16:5467523e44cd default
parent child
Show More
@@ -1,708 +1,735
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 APID_TM_TC_EXE 0x0cc1 // PID 76 CAT 1
21 #define APID_TM_TC_EXE 0x0cc1 // PID 76 CAT 1
22 #define APID_TM_HK 0x0cc4 // PID 76 CAT 4
22 #define APID_TM_HK 0x0cc4 // PID 76 CAT 4
23 #define APID_TM_SCIENCE_NORMAL_BURST 0x0ccc // PID 76 CAT 12
23 #define APID_TM_SCIENCE_NORMAL_BURST 0x0ccc // PID 76 CAT 12
24 #define APID_TM_SCIENCE_SBM1_SBM2 0x0cfc // PID 79 CAT 12
24 #define APID_TM_SCIENCE_SBM1_SBM2 0x0cfc // PID 79 CAT 12
25 #define APID_TM_PARAMETER_DUMP 0x0cc6 // PID 76 CAT 6
25 #define APID_TM_PARAMETER_DUMP 0x0cc6 // PID 76 CAT 6
26 #define APID_TM_KCOEFFICIENTS_DUMP 0x0cc6 // PID 76 CAT 6
26 #define APID_TM_KCOEFFICIENTS_DUMP 0x0cc6 // PID 76 CAT 6
27
27
28 // PACKET SEQUENCE CONTROL
28 // PACKET SEQUENCE CONTROL
29 #define TM_PACKET_SEQ_CTRL_CONTINUATION 0x00 // [0000 0000]
29 #define TM_PACKET_SEQ_CTRL_CONTINUATION 0x00 // [0000 0000]
30 #define TM_PACKET_SEQ_CTRL_FIRST 0x40 // [0100 0000]
30 #define TM_PACKET_SEQ_CTRL_FIRST 0x40 // [0100 0000]
31 #define TM_PACKET_SEQ_CTRL_LAST 0x80 // [1000 0000]
31 #define TM_PACKET_SEQ_CTRL_LAST 0x80 // [1000 0000]
32 #define TM_PACKET_SEQ_CTRL_STANDALONE 0xc0 // [1100 0000]
32 #define TM_PACKET_SEQ_CTRL_STANDALONE 0xc0 // [1100 0000]
33 #define TM_PACKET_SEQ_CNT_DEFAULT 0x00 // [0000 0000]
33 #define TM_PACKET_SEQ_CNT_DEFAULT 0x00 // [0000 0000]
34
34
35 // DESTINATION ID
35 // DESTINATION ID
36 #define TM_DESTINATION_ID_GROUND 0
36 #define TM_DESTINATION_ID_GROUND 0
37 #define TM_DESTINATION_ID_MISSION_TIMELINE 110
37 #define TM_DESTINATION_ID_MISSION_TIMELINE 110
38 #define TM_DESTINATION_ID_TC_SEQUENCES 111
38 #define TM_DESTINATION_ID_TC_SEQUENCES 111
39 #define TM_DESTINATION_ID_RECOVERY_ACTION_COMMAND 112
39 #define TM_DESTINATION_ID_RECOVERY_ACTION_COMMAND 112
40 #define TM_DESTINATION_ID_BACKUP_MISSION_TIMELINE 113
40 #define TM_DESTINATION_ID_BACKUP_MISSION_TIMELINE 113
41 #define TM_DESTINATION_ID_DIRECT_CMD 120
41 #define TM_DESTINATION_ID_DIRECT_CMD 120
42 #define TM_DESTINATION_ID_SPARE_GRD_SRC1 121
42 #define TM_DESTINATION_ID_SPARE_GRD_SRC1 121
43 #define TM_DESTINATION_ID_SPARE_GRD_SRC2 122
43 #define TM_DESTINATION_ID_SPARE_GRD_SRC2 122
44 #define TM_DESTINATION_ID_OBCP 15
44 #define TM_DESTINATION_ID_OBCP 15
45 #define TM_DESTINATION_ID_SYSTEM_CONTROL 14
45 #define TM_DESTINATION_ID_SYSTEM_CONTROL 14
46 #define TM_DESTINATION_ID_AOCS 11
46 #define TM_DESTINATION_ID_AOCS 11
47
47
48 //*********************************************************
48 //*********************************************************
49 //*** /!\ change CCSDS_DESTINATION_ID before flight /!\ ***
49 //*** /!\ change CCSDS_DESTINATION_ID before flight /!\ ***
50 //*********************************************************
50 //*********************************************************
51 #ifdef LPP_DPU_DESTID
51 #ifdef LPP_DPU_DESTID
52 #define CCSDS_DESTINATION_ID 32
52 #define CCSDS_DESTINATION_ID 32
53 #else
53 #else
54 #define CCSDS_DESTINATION_ID 0x01
54 #define CCSDS_DESTINATION_ID 0x01
55 #endif
55 #endif
56 #define CCSDS_PROTOCOLE_ID 0x02
56 #define CCSDS_PROTOCOLE_ID 0x02
57 #define CCSDS_RESERVED 0x00
57 #define CCSDS_RESERVED 0x00
58 #define CCSDS_USER_APP 0x00
58 #define CCSDS_USER_APP 0x00
59
59
60 #define SIZE_TM_LFR_TC_EXE_NOT_IMPLEMENTED 24
60 #define SIZE_TM_LFR_TC_EXE_NOT_IMPLEMENTED 24
61 #define SIZE_TM_LFR_TC_EXE_CORRUPTED 32
61 #define SIZE_TM_LFR_TC_EXE_CORRUPTED 32
62 #define SIZE_HK_PARAMETERS 112
62 #define SIZE_HK_PARAMETERS 112
63
63
64 // TC TYPES
64 // TC TYPES
65 #define TC_TYPE_GEN 181
65 #define TC_TYPE_GEN 181
66 #define TC_TYPE_TIME 9
66 #define TC_TYPE_TIME 9
67
67
68 // TC SUBTYPES
68 // TC SUBTYPES
69 #define TC_SUBTYPE_RESET 1
69 #define TC_SUBTYPE_RESET 1
70 #define TC_SUBTYPE_LOAD_COMM 11
70 #define TC_SUBTYPE_LOAD_COMM 11
71 #define TC_SUBTYPE_LOAD_NORM 13
71 #define TC_SUBTYPE_LOAD_NORM 13
72 #define TC_SUBTYPE_LOAD_BURST 19
72 #define TC_SUBTYPE_LOAD_BURST 19
73 #define TC_SUBTYPE_LOAD_SBM1 25
73 #define TC_SUBTYPE_LOAD_SBM1 25
74 #define TC_SUBTYPE_LOAD_SBM2 27
74 #define TC_SUBTYPE_LOAD_SBM2 27
75 #define TC_SUBTYPE_DUMP 31
75 #define TC_SUBTYPE_DUMP 31
76 #define TC_SUBTYPE_ENTER 41
76 #define TC_SUBTYPE_ENTER 41
77 #define TC_SUBTYPE_UPDT_INFO 51
77 #define TC_SUBTYPE_UPDT_INFO 51
78 #define TC_SUBTYPE_EN_CAL 61
78 #define TC_SUBTYPE_EN_CAL 61
79 #define TC_SUBTYPE_DIS_CAL 63
79 #define TC_SUBTYPE_DIS_CAL 63
80 #define TC_SUBTYPE_LOAD_K 93
80 #define TC_SUBTYPE_LOAD_K 93
81 #define TC_SUBTYPE_DUMP_K 95
81 #define TC_SUBTYPE_DUMP_K 95
82 #define TC_SUBTYPE_LOAD_FBINS 91
82 #define TC_SUBTYPE_LOAD_FBINS 91
83 #define TC_SUBTYPE_UPDT_TIME 129
83 #define TC_SUBTYPE_UPDT_TIME 129
84
84
85 // TC LEN
85 // TC LEN
86 #define TC_LEN_RESET 12
86 #define TC_LEN_RESET 12
87 #define TC_LEN_LOAD_COMM 14
87 #define TC_LEN_LOAD_COMM 14
88 #define TC_LEN_LOAD_NORM 22
88 #define TC_LEN_LOAD_NORM 22
89 #define TC_LEN_LOAD_BURST 14
89 #define TC_LEN_LOAD_BURST 14
90 #define TC_LEN_LOAD_SBM1 14
90 #define TC_LEN_LOAD_SBM1 14
91 #define TC_LEN_LOAD_SBM2 14
91 #define TC_LEN_LOAD_SBM2 14
92 #define TC_LEN_DUMP 12
92 #define TC_LEN_DUMP 12
93 #define TC_LEN_ENTER 20
93 #define TC_LEN_ENTER 20
94 #define TC_LEN_UPDT_INFO 46
94 #define TC_LEN_UPDT_INFO 46
95 #define TC_LEN_EN_CAL 12
95 #define TC_LEN_EN_CAL 12
96 #define TC_LEN_DIS_CAL 12
96 #define TC_LEN_DIS_CAL 12
97 #define TC_LEN_LOAD_K 142
97 #define TC_LEN_LOAD_K 142
98 #define TC_LEN_DUMP_K 12
98 #define TC_LEN_DUMP_K 12
99 #define TC_LEN_LOAD_FBINS 60
99 #define TC_LEN_LOAD_FBINS 60
100 #define TC_LEN_UPDT_TIME 18
100 #define TC_LEN_UPDT_TIME 18
101
101
102 // PACKET CODES
103 #define TM_CODE_K_DUMP 0xb5600b00 // 181 (0xb5) ** 96 (0x60) ** 11 (0x0b) ** 0 (0x00)
104
102 // TM TYPES
105 // TM TYPES
103 #define TM_TYPE_TC_EXE 1
106 #define TM_TYPE_TC_EXE 1
104 #define TM_TYPE_HK 3
107 #define TM_TYPE_HK 3
105 #define TM_TYPE_LFR_SCIENCE 21
108 #define TM_TYPE_LFR_SCIENCE 21
106 #define TM_TYPE_PARAMETER_DUMP 181
109 #define TM_TYPE_PARAMETER_DUMP 181
107 #define TM_TYPE_KCOEFFICIENTD_DUMP 181
110 #define TM_TYPE_K_DUMP 181
108
111
109 // TM SUBTYPES
112 // TM SUBTYPES
110 #define TM_SUBTYPE_EXE_OK 7
113 #define TM_SUBTYPE_EXE_OK 7
111 #define TM_SUBTYPE_EXE_NOK 8
114 #define TM_SUBTYPE_EXE_NOK 8
112 #define TM_SUBTYPE_HK 25
115 #define TM_SUBTYPE_HK 25
113 #define TM_SUBTYPE_LFR_SCIENCE_3 3 // TM packets with fixed size
116 #define TM_SUBTYPE_LFR_SCIENCE_3 3 // TM packets with fixed size
114 #define TM_SUBTYPE_LFR_SCIENCE_6 6 // TM packets with variable size
117 #define TM_SUBTYPE_LFR_SCIENCE_6 6 // TM packets with variable size
115 #define TM_SUBTYPE_PARAMETER_DUMP 32
118 #define TM_SUBTYPE_PARAMETER_DUMP 32
116 #define TM_SUBTYPE_K_DUMP 96
119 #define TM_SUBTYPE_K_DUMP 96
117
120
118 // FAILURE CODES
121 // FAILURE CODES
119 #define ILLEGAL_APID 0
122 #define ILLEGAL_APID 0
120 #define WRONG_LEN_PKT 1
123 #define WRONG_LEN_PKT 1
121 #define INCOR_CHECKSUM 2
124 #define INCOR_CHECKSUM 2
122 #define ILL_TYPE 3
125 #define ILL_TYPE 3
123 #define ILL_SUBTYPE 4
126 #define ILL_SUBTYPE 4
124 #define WRONG_APP_DATA 5 // 0x00 0x05
127 #define WRONG_APP_DATA 5 // 0x00 0x05
125 #define TC_NOT_EXE 42000 // 0xa4 0x10
128 #define TC_NOT_EXE 42000 // 0xa4 0x10
126 #define WRONG_SRC_ID 42001 // 0xa4 0x11
129 #define WRONG_SRC_ID 42001 // 0xa4 0x11
127 #define FUNCT_NOT_IMPL 42002 // 0xa4 0x12
130 #define FUNCT_NOT_IMPL 42002 // 0xa4 0x12
128 #define FAIL_DETECTED 42003 // 0xa4 0x13
131 #define FAIL_DETECTED 42003 // 0xa4 0x13
129 #define NOT_ALLOWED 42004 // 0xa4 0x14
132 #define NOT_ALLOWED 42004 // 0xa4 0x14
130 #define CORRUPTED 42005 // 0xa4 0x15
133 #define CORRUPTED 42005 // 0xa4 0x15
131 #define CCSDS_TM_VALID 7
134 #define CCSDS_TM_VALID 7
132
135
133 // TC SID
136 // TC SID
134 #define SID_TC_GROUND 0
137 #define SID_TC_GROUND 0
135 #define SID_TC_MISSION_TIMELINE 110
138 #define SID_TC_MISSION_TIMELINE 110
136 #define SID_TC_TC_SEQUENCES 111
139 #define SID_TC_TC_SEQUENCES 111
137 #define SID_TC_RECOVERY_ACTION_CMD 112
140 #define SID_TC_RECOVERY_ACTION_CMD 112
138 #define SID_TC_BACKUP_MISSION_TIMELINE 113
141 #define SID_TC_BACKUP_MISSION_TIMELINE 113
139 #define SID_TC_DIRECT_CMD 120
142 #define SID_TC_DIRECT_CMD 120
140 #define SID_TC_SPARE_GRD_SRC1 121
143 #define SID_TC_SPARE_GRD_SRC1 121
141 #define SID_TC_SPARE_GRD_SRC2 122
144 #define SID_TC_SPARE_GRD_SRC2 122
142 #define SID_TC_OBCP 15
145 #define SID_TC_OBCP 15
143 #define SID_TC_SYSTEM_CONTROL 14
146 #define SID_TC_SYSTEM_CONTROL 14
144 #define SID_TC_AOCS 11
147 #define SID_TC_AOCS 11
145 #define SID_TC_RPW_INTERNAL 254
148 #define SID_TC_RPW_INTERNAL 254
146
149
147 enum apid_destid{
150 enum apid_destid{
148 GROUND,
151 GROUND,
149 MISSION_TIMELINE,
152 MISSION_TIMELINE,
150 TC_SEQUENCES,
153 TC_SEQUENCES,
151 RECOVERY_ACTION_CMD,
154 RECOVERY_ACTION_CMD,
152 BACKUP_MISSION_TIMELINE,
155 BACKUP_MISSION_TIMELINE,
153 DIRECT_CMD,
156 DIRECT_CMD,
154 SPARE_GRD_SRC1,
157 SPARE_GRD_SRC1,
155 SPARE_GRD_SRC2,
158 SPARE_GRD_SRC2,
156 OBCP,
159 OBCP,
157 SYSTEM_CONTROL,
160 SYSTEM_CONTROL,
158 AOCS,
161 AOCS,
159 RPW_INTERNAL
162 RPW_INTERNAL
160 };
163 };
161 // SEQUENCE COUNTERS
164 // SEQUENCE COUNTERS
162 #define SEQ_CNT_MAX 16383
165 #define SEQ_CNT_MAX 16383
163 #define SEQ_CNT_NB_DEST_ID 12
166 #define SEQ_CNT_NB_DEST_ID 12
164
167
165 // TM SID
168 // TM SID
166 #define SID_HK 1
169 #define SID_HK 1
167
170
168 #define SID_NORM_SWF_F0 3
171 #define SID_NORM_SWF_F0 3
169 #define SID_NORM_SWF_F1 4
172 #define SID_NORM_SWF_F1 4
170 #define SID_NORM_SWF_F2 5
173 #define SID_NORM_SWF_F2 5
171 #define SID_NORM_CWF_F3 1
174 #define SID_NORM_CWF_F3 1
172 #define SID_BURST_CWF_F2 2
175 #define SID_BURST_CWF_F2 2
173 #define SID_SBM1_CWF_F1 24
176 #define SID_SBM1_CWF_F1 24
174 #define SID_SBM2_CWF_F2 25
177 #define SID_SBM2_CWF_F2 25
175 #define SID_NORM_ASM_F0 11
178 #define SID_NORM_ASM_F0 11
176 #define SID_NORM_ASM_F1 12
179 #define SID_NORM_ASM_F1 12
177 #define SID_NORM_ASM_F2 13
180 #define SID_NORM_ASM_F2 13
178 #define SID_NORM_BP1_F0 14
181 #define SID_NORM_BP1_F0 14
179 #define SID_NORM_BP1_F1 15
182 #define SID_NORM_BP1_F1 15
180 #define SID_NORM_BP1_F2 16
183 #define SID_NORM_BP1_F2 16
181 #define SID_NORM_BP2_F0 19
184 #define SID_NORM_BP2_F0 19
182 #define SID_NORM_BP2_F1 20
185 #define SID_NORM_BP2_F1 20
183 #define SID_NORM_BP2_F2 21
186 #define SID_NORM_BP2_F2 21
184 #define SID_BURST_BP1_F0 17
187 #define SID_BURST_BP1_F0 17
185 #define SID_BURST_BP2_F0 22
188 #define SID_BURST_BP2_F0 22
186 #define SID_BURST_BP1_F1 18
189 #define SID_BURST_BP1_F1 18
187 #define SID_BURST_BP2_F1 23
190 #define SID_BURST_BP2_F1 23
188 #define SID_SBM1_BP1_F0 28
191 #define SID_SBM1_BP1_F0 28
189 #define SID_SBM1_BP2_F0 31
192 #define SID_SBM1_BP2_F0 31
190 #define SID_SBM2_BP1_F0 29
193 #define SID_SBM2_BP1_F0 29
191 #define SID_SBM2_BP2_F0 32
194 #define SID_SBM2_BP2_F0 32
192 #define SID_SBM2_BP1_F1 30
195 #define SID_SBM2_BP1_F1 30
193 #define SID_SBM2_BP2_F1 33
196 #define SID_SBM2_BP2_F1 33
194 #define SID_NORM_CWF_LONG_F3 34
197 #define SID_NORM_CWF_LONG_F3 34
195
198
196 #define SID_PARAMETER_DUMP 10
199 #define SID_PARAMETER_DUMP 10
197 #define SID_K_DUMP 11
200 #define SID_K_DUMP 11
198
201
199 // HEADER_LENGTH
202 // HEADER_LENGTH
200 #define TM_HEADER_LEN 16
203 #define TM_HEADER_LEN 16
201 #define HEADER_LENGTH_TM_LFR_SCIENCE_ASM 28
204 #define HEADER_LENGTH_TM_LFR_SCIENCE_ASM 28
202 // PACKET_LENGTH
205 // PACKET_LENGTH
203 #define PACKET_LENGTH_TC_EXE_SUCCESS (20 - CCSDS_TC_TM_PACKET_OFFSET)
206 #define PACKET_LENGTH_TC_EXE_SUCCESS (20 - CCSDS_TC_TM_PACKET_OFFSET)
204 #define PACKET_LENGTH_TC_EXE_INCONSISTENT (26 - CCSDS_TC_TM_PACKET_OFFSET)
207 #define PACKET_LENGTH_TC_EXE_INCONSISTENT (26 - CCSDS_TC_TM_PACKET_OFFSET)
205 #define PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE (26 - CCSDS_TC_TM_PACKET_OFFSET)
208 #define PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE (26 - CCSDS_TC_TM_PACKET_OFFSET)
206 #define PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED (24 - CCSDS_TC_TM_PACKET_OFFSET)
209 #define PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED (24 - CCSDS_TC_TM_PACKET_OFFSET)
207 #define PACKET_LENGTH_TC_EXE_ERROR (24 - CCSDS_TC_TM_PACKET_OFFSET)
210 #define PACKET_LENGTH_TC_EXE_ERROR (24 - CCSDS_TC_TM_PACKET_OFFSET)
208 #define PACKET_LENGTH_TC_EXE_CORRUPTED (32 - CCSDS_TC_TM_PACKET_OFFSET)
211 #define PACKET_LENGTH_TC_EXE_CORRUPTED (32 - CCSDS_TC_TM_PACKET_OFFSET)
209 #define PACKET_LENGTH_HK (136 - CCSDS_TC_TM_PACKET_OFFSET)
212 #define PACKET_LENGTH_HK (136 - CCSDS_TC_TM_PACKET_OFFSET)
210 #define PACKET_LENGTH_PARAMETER_DUMP (84 - CCSDS_TC_TM_PACKET_OFFSET)
213 #define PACKET_LENGTH_PARAMETER_DUMP (84 - CCSDS_TC_TM_PACKET_OFFSET)
211 #define PACKET_LENGTH_K_DUMP (3920 - CCSDS_TC_TM_PACKET_OFFSET)
214 #define PACKET_LENGTH_K_DUMP (3920 - CCSDS_TC_TM_PACKET_OFFSET)
212 // SCIENCE ASM
215 // SCIENCE ASM
213 #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
216 #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
214 #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
217 #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
215 #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
218 #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
216 // SCIENCE NORM
219 // SCIENCE NORM
217 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F0 (150 - CCSDS_TC_TM_PACKET_OFFSET) // 11 * 11 + 29 (1 spare byte in the header)
220 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F0 (150 - CCSDS_TC_TM_PACKET_OFFSET) // 11 * 11 + 29 (1 spare byte in the header)
218 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F1 (172 - CCSDS_TC_TM_PACKET_OFFSET) // 13 * 11 + 29 (1 spare byte in the header)
221 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F1 (172 - CCSDS_TC_TM_PACKET_OFFSET) // 13 * 11 + 29 (1 spare byte in the header)
219 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F2 (160 - CCSDS_TC_TM_PACKET_OFFSET) // 12 * 11 + 28
222 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F2 (160 - CCSDS_TC_TM_PACKET_OFFSET) // 12 * 11 + 28
220 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F0 (358 - CCSDS_TC_TM_PACKET_OFFSET) // 11 * 30 + 28
223 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F0 (358 - CCSDS_TC_TM_PACKET_OFFSET) // 11 * 30 + 28
221 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F1 (418 - CCSDS_TC_TM_PACKET_OFFSET) // 13 * 30 + 28
224 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F1 (418 - CCSDS_TC_TM_PACKET_OFFSET) // 13 * 30 + 28
222 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F2 (388 - CCSDS_TC_TM_PACKET_OFFSET) // 12 * 30 + 28
225 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F2 (388 - CCSDS_TC_TM_PACKET_OFFSET) // 12 * 30 + 28
223 // SCIENCE SBM
226 // SCIENCE SBM
224 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F0 (270 - CCSDS_TC_TM_PACKET_OFFSET) // 22 * 11 + 28
227 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F0 (270 - CCSDS_TC_TM_PACKET_OFFSET) // 22 * 11 + 28
225 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F0 (688 - CCSDS_TC_TM_PACKET_OFFSET) // 22 * 30 + 28
228 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F0 (688 - CCSDS_TC_TM_PACKET_OFFSET) // 22 * 30 + 28
226 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F1 (314 - CCSDS_TC_TM_PACKET_OFFSET) // 26 * 11 + 28
229 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F1 (314 - CCSDS_TC_TM_PACKET_OFFSET) // 26 * 11 + 28
227 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F1 (808 - CCSDS_TC_TM_PACKET_OFFSET) // 26 * 30 + 28
230 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F1 (808 - CCSDS_TC_TM_PACKET_OFFSET) // 26 * 30 + 28
228
231
229 #define PACKET_LENGTH_DELTA 11 // 7 + 4
232 #define PACKET_LENGTH_DELTA 11 // 7 + 4
230
233
231 #define SPARE1_PUSVERSION_SPARE2 0x10
234 #define SPARE1_PUSVERSION_SPARE2 0x10
232
235
233 // R3
236 // R3
234 // one snapshot = 2048 samples = 6 packets * 304 + 224
237 // one snapshot = 2048 samples = 6 packets * 304 + 224
235 #define TM_LEN_SCI_SWF_304 (3678 - CCSDS_TC_TM_PACKET_OFFSET) // 304 * 12 + 30
238 #define TM_LEN_SCI_SWF_304 (3678 - CCSDS_TC_TM_PACKET_OFFSET) // 304 * 12 + 30
236 #define TM_LEN_SCI_SWF_224 (2718 - CCSDS_TC_TM_PACKET_OFFSET) // 224 * 12 + 30
239 #define TM_LEN_SCI_SWF_224 (2718 - CCSDS_TC_TM_PACKET_OFFSET) // 224 * 12 + 30
237 // one continuous buffer = 2688 samples = 8 packets * 336
240 // one continuous buffer = 2688 samples = 8 packets * 336
238 #define TM_LEN_SCI_CWF_336 (4060 - CCSDS_TC_TM_PACKET_OFFSET) // 336 * 12 + 28
241 #define TM_LEN_SCI_CWF_336 (4060 - CCSDS_TC_TM_PACKET_OFFSET) // 336 * 12 + 28
239 #define TM_LEN_SCI_CWF_672 (4060 - CCSDS_TC_TM_PACKET_OFFSET) // 672 * 6 + 28
242 #define TM_LEN_SCI_CWF_672 (4060 - CCSDS_TC_TM_PACKET_OFFSET) // 672 * 6 + 28
240 //
243 //
241 #define DEFAULT_PKTCNT 0x07
244 #define DEFAULT_PKTCNT 0x07
242 #define BLK_NR_304 0x0130
245 #define BLK_NR_304 0x0130
243 #define BLK_NR_224 0x00e0
246 #define BLK_NR_224 0x00e0
244 #define BLK_NR_CWF 0x0150 // 336
247 #define BLK_NR_CWF 0x0150 // 336
245 #define BLK_NR_CWF_SHORT_F3 0x02a0 // 672
248 #define BLK_NR_CWF_SHORT_F3 0x02a0 // 672
246
249
247 enum TM_TYPE{
250 enum TM_TYPE{
248 TM_LFR_TC_EXE_OK,
251 TM_LFR_TC_EXE_OK,
249 TM_LFR_TC_EXE_ERR,
252 TM_LFR_TC_EXE_ERR,
250 TM_LFR_HK,
253 TM_LFR_HK,
251 TM_LFR_SCI,
254 TM_LFR_SCI,
252 TM_LFR_SCI_SBM,
255 TM_LFR_SCI_SBM,
253 TM_LFR_PAR_DUMP
256 TM_LFR_PAR_DUMP
254 };
257 };
255
258
256 typedef struct {
259 typedef struct {
257 unsigned char targetLogicalAddress;
260 unsigned char targetLogicalAddress;
258 unsigned char protocolIdentifier;
261 unsigned char protocolIdentifier;
259 unsigned char reserved;
262 unsigned char reserved;
260 unsigned char userApplication;
263 unsigned char userApplication;
261 // PACKET HEADER
264 // PACKET HEADER
262 unsigned char packetID[2];
265 unsigned char packetID[2];
263 unsigned char packetSequenceControl[2];
266 unsigned char packetSequenceControl[2];
264 unsigned char packetLength[2];
267 unsigned char packetLength[2];
265 // DATA FIELD HEADER
268 // DATA FIELD HEADER
266 unsigned char spare1_pusVersion_spare2;
269 unsigned char spare1_pusVersion_spare2;
267 unsigned char serviceType;
270 unsigned char serviceType;
268 unsigned char serviceSubType;
271 unsigned char serviceSubType;
269 unsigned char destinationID;
272 unsigned char destinationID;
270 unsigned char time[6];
273 unsigned char time[6];
271 //
274 //
272 unsigned char telecommand_pkt_id[2];
275 unsigned char telecommand_pkt_id[2];
273 unsigned char pkt_seq_control[2];
276 unsigned char pkt_seq_control[2];
274 } Packet_TM_LFR_TC_EXE_SUCCESS_t;
277 } Packet_TM_LFR_TC_EXE_SUCCESS_t;
275
278
276 typedef struct {
279 typedef struct {
277 unsigned char targetLogicalAddress;
280 unsigned char targetLogicalAddress;
278 unsigned char protocolIdentifier;
281 unsigned char protocolIdentifier;
279 unsigned char reserved;
282 unsigned char reserved;
280 unsigned char userApplication;
283 unsigned char userApplication;
281 // PACKET HEADER
284 // PACKET HEADER
282 unsigned char packetID[2];
285 unsigned char packetID[2];
283 unsigned char packetSequenceControl[2];
286 unsigned char packetSequenceControl[2];
284 unsigned char packetLength[2];
287 unsigned char packetLength[2];
285 // DATA FIELD HEADER
288 // DATA FIELD HEADER
286 unsigned char spare1_pusVersion_spare2;
289 unsigned char spare1_pusVersion_spare2;
287 unsigned char serviceType;
290 unsigned char serviceType;
288 unsigned char serviceSubType;
291 unsigned char serviceSubType;
289 unsigned char destinationID;
292 unsigned char destinationID;
290 unsigned char time[6];
293 unsigned char time[6];
291 //
294 //
292 unsigned char tc_failure_code[2];
295 unsigned char tc_failure_code[2];
293 unsigned char telecommand_pkt_id[2];
296 unsigned char telecommand_pkt_id[2];
294 unsigned char pkt_seq_control[2];
297 unsigned char pkt_seq_control[2];
295 unsigned char tc_service;
298 unsigned char tc_service;
296 unsigned char tc_subtype;
299 unsigned char tc_subtype;
297 unsigned char byte_position;
300 unsigned char byte_position;
298 unsigned char rcv_value;
301 unsigned char rcv_value;
299 } Packet_TM_LFR_TC_EXE_INCONSISTENT_t;
302 } Packet_TM_LFR_TC_EXE_INCONSISTENT_t;
300
303
301 typedef struct {
304 typedef struct {
302 unsigned char targetLogicalAddress;
305 unsigned char targetLogicalAddress;
303 unsigned char protocolIdentifier;
306 unsigned char protocolIdentifier;
304 unsigned char reserved;
307 unsigned char reserved;
305 unsigned char userApplication;
308 unsigned char userApplication;
306 // PACKET HEADER
309 // PACKET HEADER
307 unsigned char packetID[2];
310 unsigned char packetID[2];
308 unsigned char packetSequenceControl[2];
311 unsigned char packetSequenceControl[2];
309 unsigned char packetLength[2];
312 unsigned char packetLength[2];
310 // DATA FIELD HEADER
313 // DATA FIELD HEADER
311 unsigned char spare1_pusVersion_spare2;
314 unsigned char spare1_pusVersion_spare2;
312 unsigned char serviceType;
315 unsigned char serviceType;
313 unsigned char serviceSubType;
316 unsigned char serviceSubType;
314 unsigned char destinationID;
317 unsigned char destinationID;
315 unsigned char time[6];
318 unsigned char time[6];
316 //
319 //
317 unsigned char tc_failure_code[2];
320 unsigned char tc_failure_code[2];
318 unsigned char telecommand_pkt_id[2];
321 unsigned char telecommand_pkt_id[2];
319 unsigned char pkt_seq_control[2];
322 unsigned char pkt_seq_control[2];
320 unsigned char tc_service;
323 unsigned char tc_service;
321 unsigned char tc_subtype;
324 unsigned char tc_subtype;
322 unsigned char lfr_status_word[2];
325 unsigned char lfr_status_word[2];
323 } Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_t;
326 } Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_t;
324
327
325 typedef struct {
328 typedef struct {
326 unsigned char targetLogicalAddress;
329 unsigned char targetLogicalAddress;
327 unsigned char protocolIdentifier;
330 unsigned char protocolIdentifier;
328 unsigned char reserved;
331 unsigned char reserved;
329 unsigned char userApplication;
332 unsigned char userApplication;
330 // PACKET HEADER
333 // PACKET HEADER
331 unsigned char packetID[2];
334 unsigned char packetID[2];
332 unsigned char packetSequenceControl[2];
335 unsigned char packetSequenceControl[2];
333 unsigned char packetLength[2];
336 unsigned char packetLength[2];
334 // DATA FIELD HEADER
337 // DATA FIELD HEADER
335 unsigned char spare1_pusVersion_spare2;
338 unsigned char spare1_pusVersion_spare2;
336 unsigned char serviceType;
339 unsigned char serviceType;
337 unsigned char serviceSubType;
340 unsigned char serviceSubType;
338 unsigned char destinationID;
341 unsigned char destinationID;
339 unsigned char time[6];
342 unsigned char time[6];
340 //
343 //
341 unsigned char tc_failure_code[2];
344 unsigned char tc_failure_code[2];
342 unsigned char telecommand_pkt_id[2];
345 unsigned char telecommand_pkt_id[2];
343 unsigned char pkt_seq_control[2];
346 unsigned char pkt_seq_control[2];
344 unsigned char tc_service;
347 unsigned char tc_service;
345 unsigned char tc_subtype;
348 unsigned char tc_subtype;
346 } Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_t;
349 } Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_t;
347
350
348 typedef struct {
351 typedef struct {
349 unsigned char targetLogicalAddress;
352 unsigned char targetLogicalAddress;
350 unsigned char protocolIdentifier;
353 unsigned char protocolIdentifier;
351 unsigned char reserved;
354 unsigned char reserved;
352 unsigned char userApplication;
355 unsigned char userApplication;
353 // PACKET HEADER
356 // PACKET HEADER
354 unsigned char packetID[2];
357 unsigned char packetID[2];
355 unsigned char packetSequenceControl[2];
358 unsigned char packetSequenceControl[2];
356 unsigned char packetLength[2];
359 unsigned char packetLength[2];
357 // DATA FIELD HEADER
360 // DATA FIELD HEADER
358 unsigned char spare1_pusVersion_spare2;
361 unsigned char spare1_pusVersion_spare2;
359 unsigned char serviceType;
362 unsigned char serviceType;
360 unsigned char serviceSubType;
363 unsigned char serviceSubType;
361 unsigned char destinationID;
364 unsigned char destinationID;
362 unsigned char time[6];
365 unsigned char time[6];
363 //
366 //
364 unsigned char tc_failure_code[2];
367 unsigned char tc_failure_code[2];
365 unsigned char telecommand_pkt_id[2];
368 unsigned char telecommand_pkt_id[2];
366 unsigned char pkt_seq_control[2];
369 unsigned char pkt_seq_control[2];
367 unsigned char tc_service;
370 unsigned char tc_service;
368 unsigned char tc_subtype;
371 unsigned char tc_subtype;
369 } Packet_TM_LFR_TC_EXE_ERROR_t;
372 } Packet_TM_LFR_TC_EXE_ERROR_t;
370
373
371 typedef struct {
374 typedef struct {
372 unsigned char targetLogicalAddress;
375 unsigned char targetLogicalAddress;
373 unsigned char protocolIdentifier;
376 unsigned char protocolIdentifier;
374 unsigned char reserved;
377 unsigned char reserved;
375 unsigned char userApplication;
378 unsigned char userApplication;
376 // PACKET HEADER
379 // PACKET HEADER
377 unsigned char packetID[2];
380 unsigned char packetID[2];
378 unsigned char packetSequenceControl[2];
381 unsigned char packetSequenceControl[2];
379 unsigned char packetLength[2];
382 unsigned char packetLength[2];
380 // DATA FIELD HEADER
383 // DATA FIELD HEADER
381 unsigned char spare1_pusVersion_spare2;
384 unsigned char spare1_pusVersion_spare2;
382 unsigned char serviceType;
385 unsigned char serviceType;
383 unsigned char serviceSubType;
386 unsigned char serviceSubType;
384 unsigned char destinationID;
387 unsigned char destinationID;
385 unsigned char time[6];
388 unsigned char time[6];
386 //
389 //
387 unsigned char tc_failure_code[2];
390 unsigned char tc_failure_code[2];
388 unsigned char telecommand_pkt_id[2];
391 unsigned char telecommand_pkt_id[2];
389 unsigned char pkt_seq_control[2];
392 unsigned char pkt_seq_control[2];
390 unsigned char tc_service;
393 unsigned char tc_service;
391 unsigned char tc_subtype;
394 unsigned char tc_subtype;
392 unsigned char pkt_len_rcv_value[2];
395 unsigned char pkt_len_rcv_value[2];
393 unsigned char pkt_datafieldsize_cnt[2];
396 unsigned char pkt_datafieldsize_cnt[2];
394 unsigned char rcv_crc[2];
397 unsigned char rcv_crc[2];
395 unsigned char computed_crc[2];
398 unsigned char computed_crc[2];
396 } Packet_TM_LFR_TC_EXE_CORRUPTED_t;
399 } Packet_TM_LFR_TC_EXE_CORRUPTED_t;
397
400
398 typedef struct {
401 typedef struct {
399 unsigned char targetLogicalAddress;
402 unsigned char targetLogicalAddress;
400 unsigned char protocolIdentifier;
403 unsigned char protocolIdentifier;
401 unsigned char reserved;
404 unsigned char reserved;
402 unsigned char userApplication;
405 unsigned char userApplication;
403 unsigned char packetID[2];
406 unsigned char packetID[2];
404 unsigned char packetSequenceControl[2];
407 unsigned char packetSequenceControl[2];
405 unsigned char packetLength[2];
408 unsigned char packetLength[2];
406 // DATA FIELD HEADER
409 // DATA FIELD HEADER
407 unsigned char spare1_pusVersion_spare2;
410 unsigned char spare1_pusVersion_spare2;
408 unsigned char serviceType;
411 unsigned char serviceType;
409 unsigned char serviceSubType;
412 unsigned char serviceSubType;
410 unsigned char destinationID;
413 unsigned char destinationID;
411 unsigned char time[6];
414 unsigned char time[6];
412 // AUXILIARY HEADER
415 // AUXILIARY HEADER
413 unsigned char sid;
416 unsigned char sid;
414 unsigned char hkBIA;
417 unsigned char hkBIA;
415 unsigned char sy_lfr_common_parameters_spare;
418 unsigned char sy_lfr_common_parameters_spare;
416 unsigned char sy_lfr_common_parameters;
419 unsigned char sy_lfr_common_parameters;
417 unsigned char pktCnt;
420 unsigned char pktCnt;
418 unsigned char pktNr;
421 unsigned char pktNr;
419 unsigned char acquisitionTime[6];
422 unsigned char acquisitionTime[6];
420 unsigned char blkNr[2];
423 unsigned char blkNr[2];
421 } Header_TM_LFR_SCIENCE_SWF_t;
424 } Header_TM_LFR_SCIENCE_SWF_t;
422
425
423 typedef struct {
426 typedef struct {
424 unsigned char targetLogicalAddress;
427 unsigned char targetLogicalAddress;
425 unsigned char protocolIdentifier;
428 unsigned char protocolIdentifier;
426 unsigned char reserved;
429 unsigned char reserved;
427 unsigned char userApplication;
430 unsigned char userApplication;
428 unsigned char packetID[2];
431 unsigned char packetID[2];
429 unsigned char packetSequenceControl[2];
432 unsigned char packetSequenceControl[2];
430 unsigned char packetLength[2];
433 unsigned char packetLength[2];
431 // DATA FIELD HEADER
434 // DATA FIELD HEADER
432 unsigned char spare1_pusVersion_spare2;
435 unsigned char spare1_pusVersion_spare2;
433 unsigned char serviceType;
436 unsigned char serviceType;
434 unsigned char serviceSubType;
437 unsigned char serviceSubType;
435 unsigned char destinationID;
438 unsigned char destinationID;
436 unsigned char time[6];
439 unsigned char time[6];
437 // AUXILIARY DATA HEADER
440 // AUXILIARY DATA HEADER
438 unsigned char sid;
441 unsigned char sid;
439 unsigned char hkBIA;
442 unsigned char hkBIA;
440 unsigned char sy_lfr_common_parameters_spare;
443 unsigned char sy_lfr_common_parameters_spare;
441 unsigned char sy_lfr_common_parameters;
444 unsigned char sy_lfr_common_parameters;
442 unsigned char acquisitionTime[6];
445 unsigned char acquisitionTime[6];
443 unsigned char blkNr[2];
446 unsigned char blkNr[2];
444 } Header_TM_LFR_SCIENCE_CWF_t;
447 } Header_TM_LFR_SCIENCE_CWF_t;
445
448
446 typedef struct {
449 typedef struct {
447 unsigned char targetLogicalAddress;
450 unsigned char targetLogicalAddress;
448 unsigned char protocolIdentifier;
451 unsigned char protocolIdentifier;
449 unsigned char reserved;
452 unsigned char reserved;
450 unsigned char userApplication;
453 unsigned char userApplication;
451 unsigned char packetID[2];
454 unsigned char packetID[2];
452 unsigned char packetSequenceControl[2];
455 unsigned char packetSequenceControl[2];
453 unsigned char packetLength[2];
456 unsigned char packetLength[2];
454 // DATA FIELD HEADER
457 // DATA FIELD HEADER
455 unsigned char spare1_pusVersion_spare2;
458 unsigned char spare1_pusVersion_spare2;
456 unsigned char serviceType;
459 unsigned char serviceType;
457 unsigned char serviceSubType;
460 unsigned char serviceSubType;
458 unsigned char destinationID;
461 unsigned char destinationID;
459 unsigned char time[6];
462 unsigned char time[6];
460 // AUXILIARY HEADER
463 // AUXILIARY HEADER
461 unsigned char sid;
464 unsigned char sid;
462 unsigned char biaStatusInfo;
465 unsigned char biaStatusInfo;
463 unsigned char sy_lfr_common_parameters_spare;
466 unsigned char sy_lfr_common_parameters_spare;
464 unsigned char sy_lfr_common_parameters;
467 unsigned char sy_lfr_common_parameters;
465 unsigned char pa_lfr_pkt_cnt_asm;
468 unsigned char pa_lfr_pkt_cnt_asm;
466 unsigned char pa_lfr_pkt_nr_asm;
469 unsigned char pa_lfr_pkt_nr_asm;
467 unsigned char acquisitionTime[6];
470 unsigned char acquisitionTime[6];
468 unsigned char pa_lfr_asm_blk_nr[2];
471 unsigned char pa_lfr_asm_blk_nr[2];
469 } Header_TM_LFR_SCIENCE_ASM_t;
472 } Header_TM_LFR_SCIENCE_ASM_t;
470
473
471 typedef struct {
474 typedef struct {
472 unsigned char targetLogicalAddress;
475 unsigned char targetLogicalAddress;
473 unsigned char protocolIdentifier;
476 unsigned char protocolIdentifier;
474 unsigned char reserved;
477 unsigned char reserved;
475 unsigned char userApplication;
478 unsigned char userApplication;
476 unsigned char packetID[2];
479 unsigned char packetID[2];
477 unsigned char packetSequenceControl[2];
480 unsigned char packetSequenceControl[2];
478 unsigned char packetLength[2];
481 unsigned char packetLength[2];
479 // DATA FIELD HEADER
482 // DATA FIELD HEADER
480 unsigned char spare1_pusVersion_spare2;
483 unsigned char spare1_pusVersion_spare2;
481 unsigned char serviceType;
484 unsigned char serviceType;
482 unsigned char serviceSubType;
485 unsigned char serviceSubType;
483 unsigned char destinationID;
486 unsigned char destinationID;
484 unsigned char time[6];
487 unsigned char time[6];
485 // AUXILIARY HEADER
488 // AUXILIARY HEADER
486 unsigned char sid;
489 unsigned char sid;
487 unsigned char biaStatusInfo;
490 unsigned char biaStatusInfo;
488 unsigned char sy_lfr_common_parameters_spare;
491 unsigned char sy_lfr_common_parameters_spare;
489 unsigned char sy_lfr_common_parameters;
492 unsigned char sy_lfr_common_parameters;
490 unsigned char acquisitionTime[6];
493 unsigned char acquisitionTime[6];
491 unsigned char source_data_spare;
494 unsigned char source_data_spare;
492 unsigned char pa_lfr_bp_blk_nr[2];
495 unsigned char pa_lfr_bp_blk_nr[2];
493 } Header_TM_LFR_SCIENCE_BP_with_spare_t;
496 } Header_TM_LFR_SCIENCE_BP_with_spare_t;
494
497
495 typedef struct {
498 typedef struct {
496 unsigned char targetLogicalAddress;
499 unsigned char targetLogicalAddress;
497 unsigned char protocolIdentifier;
500 unsigned char protocolIdentifier;
498 unsigned char reserved;
501 unsigned char reserved;
499 unsigned char userApplication;
502 unsigned char userApplication;
500 unsigned char packetID[2];
503 unsigned char packetID[2];
501 unsigned char packetSequenceControl[2];
504 unsigned char packetSequenceControl[2];
502 unsigned char packetLength[2];
505 unsigned char packetLength[2];
503 // DATA FIELD HEADER
506 // DATA FIELD HEADER
504 unsigned char spare1_pusVersion_spare2;
507 unsigned char spare1_pusVersion_spare2;
505 unsigned char serviceType;
508 unsigned char serviceType;
506 unsigned char serviceSubType;
509 unsigned char serviceSubType;
507 unsigned char destinationID;
510 unsigned char destinationID;
508 unsigned char time[6];
511 unsigned char time[6];
509 // AUXILIARY HEADER
512 // AUXILIARY HEADER
510 unsigned char sid;
513 unsigned char sid;
511 unsigned char biaStatusInfo;
514 unsigned char biaStatusInfo;
512 unsigned char sy_lfr_common_parameters_spare;
515 unsigned char sy_lfr_common_parameters_spare;
513 unsigned char sy_lfr_common_parameters;
516 unsigned char sy_lfr_common_parameters;
514 unsigned char acquisitionTime[6];
517 unsigned char acquisitionTime[6];
515 unsigned char pa_lfr_bp_blk_nr[2];
518 unsigned char pa_lfr_bp_blk_nr[2];
516 } Header_TM_LFR_SCIENCE_BP_t;
519 } Header_TM_LFR_SCIENCE_BP_t;
517
520
518 typedef struct {
521 typedef struct {
519 //targetLogicalAddress is removed by the grspw module
522 //targetLogicalAddress is removed by the grspw module
520 unsigned char protocolIdentifier;
523 unsigned char protocolIdentifier;
521 unsigned char reserved;
524 unsigned char reserved;
522 unsigned char userApplication;
525 unsigned char userApplication;
523 unsigned char packetID[2];
526 unsigned char packetID[2];
524 unsigned char packetSequenceControl[2];
527 unsigned char packetSequenceControl[2];
525 unsigned char packetLength[2];
528 unsigned char packetLength[2];
526 // DATA FIELD HEADER
529 // DATA FIELD HEADER
527 unsigned char headerFlag_pusVersion_Ack;
530 unsigned char headerFlag_pusVersion_Ack;
528 unsigned char serviceType;
531 unsigned char serviceType;
529 unsigned char serviceSubType;
532 unsigned char serviceSubType;
530 unsigned char sourceID;
533 unsigned char sourceID;
531 unsigned char dataAndCRC[CCSDS_TC_PKT_MAX_SIZE-10];
534 unsigned char dataAndCRC[CCSDS_TC_PKT_MAX_SIZE-10];
532 } ccsdsTelecommandPacket_t;
535 } ccsdsTelecommandPacket_t;
533
536
534 typedef struct {
537 typedef struct {
535 unsigned char targetLogicalAddress;
538 unsigned char targetLogicalAddress;
536 unsigned char protocolIdentifier;
539 unsigned char protocolIdentifier;
537 unsigned char reserved;
540 unsigned char reserved;
538 unsigned char userApplication;
541 unsigned char userApplication;
539 unsigned char packetID[2];
542 unsigned char packetID[2];
540 unsigned char packetSequenceControl[2];
543 unsigned char packetSequenceControl[2];
541 unsigned char packetLength[2];
544 unsigned char packetLength[2];
542 unsigned char spare1_pusVersion_spare2;
545 unsigned char spare1_pusVersion_spare2;
543 unsigned char serviceType;
546 unsigned char serviceType;
544 unsigned char serviceSubType;
547 unsigned char serviceSubType;
545 unsigned char destinationID;
548 unsigned char destinationID;
546 unsigned char time[6];
549 unsigned char time[6];
547 unsigned char sid;
550 unsigned char sid;
548
551
549 //**************
552 //**************
550 // HK PARAMETERS
553 // HK PARAMETERS
551 unsigned char lfr_status_word[2];
554 unsigned char lfr_status_word[2];
552 unsigned char lfr_sw_version[4];
555 unsigned char lfr_sw_version[4];
553 unsigned char lfr_fpga_version[3];
556 unsigned char lfr_fpga_version[3];
554 // ressource statistics
557 // ressource statistics
555 unsigned char hk_lfr_cpu_load;
558 unsigned char hk_lfr_cpu_load;
556 unsigned char hk_lfr_cpu_load_max;
559 unsigned char hk_lfr_cpu_load_max;
557 unsigned char hk_lfr_cpu_load_aver;
560 unsigned char hk_lfr_cpu_load_aver;
558 unsigned char hk_lfr_q_sd_fifo_size_max;
561 unsigned char hk_lfr_q_sd_fifo_size_max;
559 unsigned char hk_lfr_q_sd_fifo_size;
562 unsigned char hk_lfr_q_sd_fifo_size;
560 unsigned char hk_lfr_q_rv_fifo_size_max;
563 unsigned char hk_lfr_q_rv_fifo_size_max;
561 unsigned char hk_lfr_q_rv_fifo_size;
564 unsigned char hk_lfr_q_rv_fifo_size;
562 unsigned char hk_lfr_q_p0_fifo_size_max;
565 unsigned char hk_lfr_q_p0_fifo_size_max;
563 unsigned char hk_lfr_q_p0_fifo_size;
566 unsigned char hk_lfr_q_p0_fifo_size;
564 unsigned char hk_lfr_q_p1_fifo_size_max;
567 unsigned char hk_lfr_q_p1_fifo_size_max;
565 unsigned char hk_lfr_q_p1_fifo_size;
568 unsigned char hk_lfr_q_p1_fifo_size;
566 unsigned char hk_lfr_q_p2_fifo_size_max;
569 unsigned char hk_lfr_q_p2_fifo_size_max;
567 unsigned char hk_lfr_q_p2_fifo_size;
570 unsigned char hk_lfr_q_p2_fifo_size;
568 // tc statistics
571 // tc statistics
569 unsigned char hk_lfr_update_info_tc_cnt[2];
572 unsigned char hk_lfr_update_info_tc_cnt[2];
570 unsigned char hk_lfr_update_time_tc_cnt[2];
573 unsigned char hk_lfr_update_time_tc_cnt[2];
571 unsigned char hk_lfr_exe_tc_cnt[2];
574 unsigned char hk_lfr_exe_tc_cnt[2];
572 unsigned char hk_lfr_rej_tc_cnt[2];
575 unsigned char hk_lfr_rej_tc_cnt[2];
573 unsigned char hk_lfr_last_exe_tc_id[2];
576 unsigned char hk_lfr_last_exe_tc_id[2];
574 unsigned char hk_lfr_last_exe_tc_type[2];
577 unsigned char hk_lfr_last_exe_tc_type[2];
575 unsigned char hk_lfr_last_exe_tc_subtype[2];
578 unsigned char hk_lfr_last_exe_tc_subtype[2];
576 unsigned char hk_lfr_last_exe_tc_time[6];
579 unsigned char hk_lfr_last_exe_tc_time[6];
577 unsigned char hk_lfr_last_rej_tc_id[2];
580 unsigned char hk_lfr_last_rej_tc_id[2];
578 unsigned char hk_lfr_last_rej_tc_type[2];
581 unsigned char hk_lfr_last_rej_tc_type[2];
579 unsigned char hk_lfr_last_rej_tc_subtype[2];
582 unsigned char hk_lfr_last_rej_tc_subtype[2];
580 unsigned char hk_lfr_last_rej_tc_time[6];
583 unsigned char hk_lfr_last_rej_tc_time[6];
581 // anomaly statistics
584 // anomaly statistics
582 unsigned char hk_lfr_le_cnt[2];
585 unsigned char hk_lfr_le_cnt[2];
583 unsigned char hk_lfr_me_cnt[2];
586 unsigned char hk_lfr_me_cnt[2];
584 unsigned char hk_lfr_he_cnt[2];
587 unsigned char hk_lfr_he_cnt[2];
585 unsigned char hk_lfr_last_er_rid[2];
588 unsigned char hk_lfr_last_er_rid[2];
586 unsigned char hk_lfr_last_er_code;
589 unsigned char hk_lfr_last_er_code;
587 unsigned char hk_lfr_last_er_time[6];
590 unsigned char hk_lfr_last_er_time[6];
588 // vhdl_blk_status
591 // vhdl_blk_status
589 unsigned char hk_lfr_vhdl_aa_sm;
592 unsigned char hk_lfr_vhdl_aa_sm;
590 unsigned char hk_lfr_vhdl_fft_sr;
593 unsigned char hk_lfr_vhdl_fft_sr;
591 unsigned char hk_lfr_vhdl_cic_hk;
594 unsigned char hk_lfr_vhdl_cic_hk;
592 unsigned char hk_lfr_vhdl_iir_cal;
595 unsigned char hk_lfr_vhdl_iir_cal;
593 // spacewire_if_statistics
596 // spacewire_if_statistics
594 unsigned char hk_lfr_dpu_spw_pkt_rcv_cnt[2];
597 unsigned char hk_lfr_dpu_spw_pkt_rcv_cnt[2];
595 unsigned char hk_lfr_dpu_spw_pkt_sent_cnt[2];
598 unsigned char hk_lfr_dpu_spw_pkt_sent_cnt[2];
596 unsigned char hk_lfr_dpu_spw_tick_out_cnt;
599 unsigned char hk_lfr_dpu_spw_tick_out_cnt;
597 unsigned char hk_lfr_dpu_spw_last_timc;
600 unsigned char hk_lfr_dpu_spw_last_timc;
598 // ahb error statistics
601 // ahb error statistics
599 unsigned char hk_lfr_last_fail_addr[4];
602 unsigned char hk_lfr_last_fail_addr[4];
600 // temperatures
603 // temperatures
601 unsigned char hk_lfr_temp_scm[2];
604 unsigned char hk_lfr_temp_scm[2];
602 unsigned char hk_lfr_temp_pcb[2];
605 unsigned char hk_lfr_temp_pcb[2];
603 unsigned char hk_lfr_temp_fpga[2];
606 unsigned char hk_lfr_temp_fpga[2];
604 // spacecraft potential
607 // spacecraft potential
605 unsigned char hk_lfr_sc_v_f3[2];
608 unsigned char hk_lfr_sc_v_f3[2];
606 unsigned char hk_lfr_sc_e1_f3[2];
609 unsigned char hk_lfr_sc_e1_f3[2];
607 unsigned char hk_lfr_sc_e2_f3[2];
610 unsigned char hk_lfr_sc_e2_f3[2];
608 // lfr common parameters
611 // lfr common parameters
609 unsigned char sy_lfr_common_parameters_spare;
612 unsigned char sy_lfr_common_parameters_spare;
610 unsigned char sy_lfr_common_parameters;
613 unsigned char sy_lfr_common_parameters;
611 // error counters
614 // error counters
612 unsigned char hk_lfr_dpu_spw_parity;
615 unsigned char hk_lfr_dpu_spw_parity;
613 unsigned char hk_lfr_dpu_spw_disconnect;
616 unsigned char hk_lfr_dpu_spw_disconnect;
614 unsigned char hk_lfr_dpu_spw_escape;
617 unsigned char hk_lfr_dpu_spw_escape;
615 unsigned char hk_lfr_dpu_spw_credit;
618 unsigned char hk_lfr_dpu_spw_credit;
616 unsigned char hk_lfr_dpu_spw_write_sync;
619 unsigned char hk_lfr_dpu_spw_write_sync;
617 unsigned char hk_lfr_dpu_spw_rx_ahb;
620 unsigned char hk_lfr_dpu_spw_rx_ahb;
618 unsigned char hk_lfr_dpu_spw_tx_ahb;
621 unsigned char hk_lfr_dpu_spw_tx_ahb;
619 unsigned char hk_lfr_dpu_spw_early_eop;
622 unsigned char hk_lfr_dpu_spw_early_eop;
620 unsigned char hk_lfr_dpu_spw_invalid_addr;
623 unsigned char hk_lfr_dpu_spw_invalid_addr;
621 unsigned char hk_lfr_dpu_spw_eep;
624 unsigned char hk_lfr_dpu_spw_eep;
622 unsigned char hk_lfr_dpu_spw_rx_too_big;
625 unsigned char hk_lfr_dpu_spw_rx_too_big;
623 // timecode
626 // timecode
624 unsigned char hk_lfr_timecode_erroneous;
627 unsigned char hk_lfr_timecode_erroneous;
625 unsigned char hk_lfr_timecode_missing;
628 unsigned char hk_lfr_timecode_missing;
626 unsigned char hk_lfr_timecode_invalid;
629 unsigned char hk_lfr_timecode_invalid;
627 // time
630 // time
628 unsigned char hk_lfr_time_timecode_it;
631 unsigned char hk_lfr_time_timecode_it;
629 unsigned char hk_lfr_time_not_synchro;
632 unsigned char hk_lfr_time_not_synchro;
630 unsigned char hk_lfr_time_timecode_ctr;
633 unsigned char hk_lfr_time_timecode_ctr;
631 // hk_lfr_buffer_dpu_
634 // hk_lfr_buffer_dpu_
632 unsigned char hk_lfr_buffer_dpu_tc_fifo;
635 unsigned char hk_lfr_buffer_dpu_tc_fifo;
633 unsigned char hk_lfr_buffer_dpu_tm_fifo;
636 unsigned char hk_lfr_buffer_dpu_tm_fifo;
634 // hk_lfr_ahb_
637 // hk_lfr_ahb_
635 unsigned char hk_lfr_ahb_correctable;
638 unsigned char hk_lfr_ahb_correctable;
636 unsigned char hk_lfr_ahb_uncorrectable;
639 unsigned char hk_lfr_ahb_uncorrectable;
637 // spare
640 // spare
638 unsigned char parameters_spare;
641 unsigned char parameters_spare;
639 } Packet_TM_LFR_HK_t;
642 } Packet_TM_LFR_HK_t;
640
643
641 typedef struct {
644 typedef struct {
642 unsigned char targetLogicalAddress;
645 unsigned char targetLogicalAddress;
643 unsigned char protocolIdentifier;
646 unsigned char protocolIdentifier;
644 unsigned char reserved;
647 unsigned char reserved;
645 unsigned char userApplication;
648 unsigned char userApplication;
646 unsigned char packetID[2];
649 unsigned char packetID[2];
647 unsigned char packetSequenceControl[2];
650 unsigned char packetSequenceControl[2];
648 unsigned char packetLength[2];
651 unsigned char packetLength[2];
649 // DATA FIELD HEADER
652 // DATA FIELD HEADER
650 unsigned char spare1_pusVersion_spare2;
653 unsigned char spare1_pusVersion_spare2;
651 unsigned char serviceType;
654 unsigned char serviceType;
652 unsigned char serviceSubType;
655 unsigned char serviceSubType;
653 unsigned char destinationID;
656 unsigned char destinationID;
654 unsigned char time[6];
657 unsigned char time[6];
655 unsigned char sid;
658 unsigned char sid;
656
659
657 //******************
660 //******************
658 // COMMON PARAMETERS
661 // COMMON PARAMETERS
659 unsigned char unused0;
662 unsigned char unused0;
660 unsigned char sy_lfr_common_parameters;
663 unsigned char sy_lfr_common_parameters;
661
664
662 //******************
665 //******************
663 // NORMAL PARAMETERS
666 // NORMAL PARAMETERS
664 unsigned char sy_lfr_n_swf_l[2];
667 unsigned char sy_lfr_n_swf_l[2];
665 unsigned char sy_lfr_n_swf_p[2];
668 unsigned char sy_lfr_n_swf_p[2];
666 unsigned char sy_lfr_n_asm_p[2];
669 unsigned char sy_lfr_n_asm_p[2];
667 unsigned char sy_lfr_n_bp_p0;
670 unsigned char sy_lfr_n_bp_p0;
668 unsigned char sy_lfr_n_bp_p1;
671 unsigned char sy_lfr_n_bp_p1;
669 unsigned char sy_lfr_n_cwf_long_f3;
672 unsigned char sy_lfr_n_cwf_long_f3;
670 unsigned char lfr_normal_parameters_spare;
673 unsigned char lfr_normal_parameters_spare;
671
674
672 //*****************
675 //*****************
673 // BURST PARAMETERS
676 // BURST PARAMETERS
674 unsigned char sy_lfr_b_bp_p0;
677 unsigned char sy_lfr_b_bp_p0;
675 unsigned char sy_lfr_b_bp_p1;
678 unsigned char sy_lfr_b_bp_p1;
676
679
677 //****************
680 //****************
678 // SBM1 PARAMETERS
681 // SBM1 PARAMETERS
679 unsigned char sy_lfr_s1_bp_p0;
682 unsigned char sy_lfr_s1_bp_p0;
680 unsigned char sy_lfr_s1_bp_p1;
683 unsigned char sy_lfr_s1_bp_p1;
681
684
682 //****************
685 //****************
683 // SBM2 PARAMETERS
686 // SBM2 PARAMETERS
684 unsigned char sy_lfr_s2_bp_p0;
687 unsigned char sy_lfr_s2_bp_p0;
685 unsigned char sy_lfr_s2_bp_p1;
688 unsigned char sy_lfr_s2_bp_p1;
686
689
687 // mask F0
690 // mask F0
688 unsigned int sy_lfr_fbins_f0_word1;
691 unsigned int sy_lfr_fbins_f0_word1;
689 unsigned int sy_lfr_fbins_f0_word2;
692 unsigned int sy_lfr_fbins_f0_word2;
690 unsigned int sy_lfr_fbins_f0_word3;
693 unsigned int sy_lfr_fbins_f0_word3;
691 unsigned int sy_lfr_fbins_f0_word4;
694 unsigned int sy_lfr_fbins_f0_word4;
692 // mask F1
695 // mask F1
693 unsigned int sy_lfr_fbins_f1_word1;
696 unsigned int sy_lfr_fbins_f1_word1;
694 unsigned int sy_lfr_fbins_f1_word2;
697 unsigned int sy_lfr_fbins_f1_word2;
695 unsigned int sy_lfr_fbins_f1_word3;
698 unsigned int sy_lfr_fbins_f1_word3;
696 unsigned int sy_lfr_fbins_f1_word4;
699 unsigned int sy_lfr_fbins_f1_word4;
697 // mask F2
700 // mask F2
698 unsigned int sy_lfr_fbins_f2_word1;
701 unsigned int sy_lfr_fbins_f2_word1;
699 unsigned int sy_lfr_fbins_f2_word2;
702 unsigned int sy_lfr_fbins_f2_word2;
700 unsigned int sy_lfr_fbins_f2_word3;
703 unsigned int sy_lfr_fbins_f2_word3;
701 unsigned int sy_lfr_fbins_f2_word4;
704 unsigned int sy_lfr_fbins_f2_word4;
702
705
703 // SPARE
706 // SPARE
704 unsigned char source_data_spare;
707 unsigned char source_data_spare;
705 } Packet_TM_LFR_PARAMETER_DUMP_t;
708 } Packet_TM_LFR_PARAMETER_DUMP_t;
706
709
710 typedef struct {
711 unsigned char targetLogicalAddress;
712 unsigned char protocolIdentifier;
713 unsigned char reserved;
714 unsigned char userApplication;
715 unsigned char packetID[2];
716 unsigned char packetSequenceControl[2];
717 unsigned char packetLength[2];
718 // DATA FIELD HEADER
719 unsigned char spare1_pusVersion_spare2;
720 unsigned char serviceType;
721 unsigned char serviceSubType;
722 unsigned char destinationID;
723 unsigned char time[6];
724 unsigned char sid;
725 unsigned char pkt_cnt;
726 unsigned char pkt_nr;
727 unsigned char blk_nr;
728
729 //******************
730 // SOURCE DATA repeated N times with N in [0 .. PA_LFR_KCOEFF_BLK_NR]
731 unsigned char kcoeff_blks[3900]; // one blk is 2 + 4 * 32 = 130 bytes, 30 blks max in one packet (30 * 130 = 3900)
732
733 } Packet_TM_LFR_KCOEFFICIENTS_DUMP_t;
707
734
708 #endif // CCSDS_TYPES_H_INCLUDED
735 #endif // CCSDS_TYPES_H_INCLUDED
@@ -1,37 +1,42
1 #ifndef TM_BYTE_POSITIONS_H
1 #ifndef TM_BYTE_POSITIONS_H
2 #define TM_BYTE_POSITIONS_H
2 #define TM_BYTE_POSITIONS_H
3
3
4 // SEQUENCE_CNT
4 // SEQUENCE_CNT
5 #define PACKET_POS_SEQUENCE_CNT 6 // 4 + 2
5 #define PACKET_POS_SEQUENCE_CNT 6 // 4 + 2
6
6
7 // TC_LFR_LOAD_COMMON_PAR
7 // TC_LFR_LOAD_COMMON_PAR
8
8
9 // TC_LFR_LOAD_NORMAL_PAR
9 // TC_LFR_LOAD_NORMAL_PAR
10 #define DATAFIELD_POS_SY_LFR_N_SWF_L 0
10 #define DATAFIELD_POS_SY_LFR_N_SWF_L 0
11 #define DATAFIELD_POS_SY_LFR_N_SWF_P 2
11 #define DATAFIELD_POS_SY_LFR_N_SWF_P 2
12 #define DATAFIELD_POS_SY_LFR_N_ASM_P 4
12 #define DATAFIELD_POS_SY_LFR_N_ASM_P 4
13 #define DATAFIELD_POS_SY_LFR_N_BP_P0 6
13 #define DATAFIELD_POS_SY_LFR_N_BP_P0 6
14 #define DATAFIELD_POS_SY_LFR_N_BP_P1 7
14 #define DATAFIELD_POS_SY_LFR_N_BP_P1 7
15 #define DATAFIELD_POS_SY_LFR_N_CWF_LONG_F3 8
15 #define DATAFIELD_POS_SY_LFR_N_CWF_LONG_F3 8
16
16
17 // TC_LFR_LOAD_BURST_PAR
17 // TC_LFR_LOAD_BURST_PAR
18 #define DATAFIELD_POS_SY_LFR_B_BP_P0 0
18 #define DATAFIELD_POS_SY_LFR_B_BP_P0 0
19 #define DATAFIELD_POS_SY_LFR_B_BP_P1 1
19 #define DATAFIELD_POS_SY_LFR_B_BP_P1 1
20
20
21 // TC_LFR_LOAD_SBM1_PAR
21 // TC_LFR_LOAD_SBM1_PAR
22 #define DATAFIELD_POS_SY_LFR_S1_BP_P0 0
22 #define DATAFIELD_POS_SY_LFR_S1_BP_P0 0
23 #define DATAFIELD_POS_SY_LFR_S1_BP_P1 1
23 #define DATAFIELD_POS_SY_LFR_S1_BP_P1 1
24
24
25 // TC_LFR_LOAD_SBM2_PAR
25 // TC_LFR_LOAD_SBM2_PAR
26 #define DATAFIELD_POS_SY_LFR_S2_BP_P0 0
26 #define DATAFIELD_POS_SY_LFR_S2_BP_P0 0
27 #define DATAFIELD_POS_SY_LFR_S2_BP_P1 1
27 #define DATAFIELD_POS_SY_LFR_S2_BP_P1 1
28
28
29 // TC_LFR_UPDATE_INFO
29 // TC_LFR_UPDATE_INFO
30 #define BYTE_POS_UPDATE_INFO_PARAMETERS_SET5 34
30 #define BYTE_POS_UPDATE_INFO_PARAMETERS_SET5 34
31 #define BYTE_POS_UPDATE_INFO_PARAMETERS_SET6 35
31 #define BYTE_POS_UPDATE_INFO_PARAMETERS_SET6 35
32
32
33 // TC_LFR_ENTER_MODE
33 // TC_LFR_ENTER_MODE
34 #define BYTE_POS_CP_MODE_LFR_SET 11
34 #define BYTE_POS_CP_MODE_LFR_SET 11
35 #define BYTE_POS_CP_LFR_ENTER_MODE_TIME 12
35 #define BYTE_POS_CP_LFR_ENTER_MODE_TIME 12
36
36
37 // TC_LFR_LOAD_KCOEFFICIENTS
38 #define NB_BYTES_PER_FLOAT 4
39 #define DATAFIELD_POS_SY_LFR_KCOEFF_FREQUENCY 0 // 10 - 10
40 #define DATAFIELD_POS_SY_LFR_KCOEFF_1 2 // 12 - 10
41
37 #endif // TM_BYTE_POSITIONS_H
42 #endif // TM_BYTE_POSITIONS_H
@@ -1,76 +1,77
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 44
28 #define TOTAL_SIZE_ASM_F0_IN_BYTES 4400 // 25 * 88 * 2
28 #define TOTAL_SIZE_ASM_F0_IN_BYTES 4400 // 25 * 88 * 2
29 #define ASM_F0_INDICE_START 16 // 17 - 1, (-1) due to the VHDL behaviour
29 #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
30 #define ASM_F0_INDICE_STOP 103 // 104 - 1, 2 packets of 44 bins
31 //
31 //
32 #define NB_BINS_PER_ASM_F1 104
32 #define NB_BINS_PER_ASM_F1 104
33 #define NB_BINS_PER_PKT_ASM_F1 52
33 #define NB_BINS_PER_PKT_ASM_F1 52
34 #define TOTAL_SIZE_ASM_F1_IN_BYTES 5200 // 25 * 104 * 2
34 #define TOTAL_SIZE_ASM_F1_IN_BYTES 5200 // 25 * 104 * 2
35 #define ASM_F1_INDICE_START 5 // 6 - 1, (-1) due to the VHDL behaviour
35 #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
36 #define ASM_F1_INDICE_STOP 108 // 109 - 1, 2 packets of 52 bins
37 //
37 //
38 #define NB_BINS_PER_ASM_F2 96
38 #define NB_BINS_PER_ASM_F2 96
39 #define NB_BINS_PER_PKT_ASM_F2 48
39 #define NB_BINS_PER_PKT_ASM_F2 48
40 #define TOTAL_SIZE_ASM_F2_IN_BYTES 4800 // 25 * 96 * 2
40 #define TOTAL_SIZE_ASM_F2_IN_BYTES 4800 // 25 * 96 * 2
41 #define ASM_F2_INDICE_START 6 // 7 - 1, (-1) due to the VHDL behaviour
41 #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
42 #define ASM_F2_INDICE_STOP 101 // 102 - 1, 2 packets of 48 bins
43 //
43 //
44 #define KCOEFF_BLK_SIZE 130
44 #define NB_BINS_COMPRESSED_SM_F0 11
45 #define NB_BINS_COMPRESSED_SM_F0 11
45 #define NB_BINS_COMPRESSED_SM_F1 13
46 #define NB_BINS_COMPRESSED_SM_F1 13
46 #define NB_BINS_COMPRESSED_SM_F2 12
47 #define NB_BINS_COMPRESSED_SM_F2 12
47 #define NB_BINS_COMPRESSED_SM 36 // 11 + 12 + 13
48 #define NB_BINS_COMPRESSED_SM 36 // 11 + 12 + 13
48 #define NB_BINS_COMPRESSED_SM_SBM_F0 22
49 #define NB_BINS_COMPRESSED_SM_SBM_F0 22
49 #define NB_BINS_COMPRESSED_SM_SBM_F1 26
50 #define NB_BINS_COMPRESSED_SM_SBM_F1 26
50 #define NB_BINS_COMPRESSED_SM_SBM_F2 24
51 #define NB_BINS_COMPRESSED_SM_SBM_F2 24
51 //
52 //
52 #define NB_BYTES_PER_BP1 9
53 #define NB_BYTES_PER_BP1 9
53 #define NB_BYTES_PER_BP2 30
54 #define NB_BYTES_PER_BP2 30
54 //
55 //
55 #define NB_BINS_TO_AVERAGE_ASM_F0 8
56 #define NB_BINS_TO_AVERAGE_ASM_F0 8
56 #define NB_BINS_TO_AVERAGE_ASM_F1 8
57 #define NB_BINS_TO_AVERAGE_ASM_F1 8
57 #define NB_BINS_TO_AVERAGE_ASM_F2 8
58 #define NB_BINS_TO_AVERAGE_ASM_F2 8
58 #define NB_BINS_TO_AVERAGE_ASM_SBM_F0 4
59 #define NB_BINS_TO_AVERAGE_ASM_SBM_F0 4
59 #define NB_BINS_TO_AVERAGE_ASM_SBM_F1 4
60 #define NB_BINS_TO_AVERAGE_ASM_SBM_F1 4
60 #define NB_BINS_TO_AVERAGE_ASM_SBM_F2 4
61 #define NB_BINS_TO_AVERAGE_ASM_SBM_F2 4
61 //
62 //
62 #define TOTAL_SIZE_COMPRESSED_ASM_NORM_F0 275 // 11 * 25 WORDS
63 #define TOTAL_SIZE_COMPRESSED_ASM_NORM_F0 275 // 11 * 25 WORDS
63 #define TOTAL_SIZE_COMPRESSED_ASM_NORM_F1 325 // 13 * 25 WORDS
64 #define TOTAL_SIZE_COMPRESSED_ASM_NORM_F1 325 // 13 * 25 WORDS
64 #define TOTAL_SIZE_COMPRESSED_ASM_NORM_F2 300 // 12 * 25 WORDS
65 #define TOTAL_SIZE_COMPRESSED_ASM_NORM_F2 300 // 12 * 25 WORDS
65 #define TOTAL_SIZE_COMPRESSED_ASM_SBM_F0 550 // 22 * 25 WORDS
66 #define TOTAL_SIZE_COMPRESSED_ASM_SBM_F0 550 // 22 * 25 WORDS
66 #define TOTAL_SIZE_COMPRESSED_ASM_SBM_F1 650 // 26 * 25 WORDS
67 #define TOTAL_SIZE_COMPRESSED_ASM_SBM_F1 650 // 26 * 25 WORDS
67 #define TOTAL_SIZE_BP1_NORM_F0 99 // 9 * 11 UNSIGNED CHAR
68 #define TOTAL_SIZE_BP1_NORM_F0 99 // 9 * 11 UNSIGNED CHAR
68 #define TOTAL_SIZE_BP2_NORM_F0 330 // 30 * 11 UNSIGNED CHAR
69 #define TOTAL_SIZE_BP2_NORM_F0 330 // 30 * 11 UNSIGNED CHAR
69 #define TOTAL_SIZE_BP1_SBM_F0 198 // 9 * 22 UNSIGNED CHAR
70 #define TOTAL_SIZE_BP1_SBM_F0 198 // 9 * 22 UNSIGNED CHAR
70 // GENERAL
71 // GENERAL
71 #define NB_SM_BEFORE_AVF0 8 // must be 8 due to the SM_average() function
72 #define NB_SM_BEFORE_AVF0 8 // must be 8 due to the SM_average() function
72 #define NB_SM_BEFORE_AVF1 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
73 #define NB_SM_BEFORE_AVF2 1 // must be 1 due to the SM_average_f2() function
74 #define NB_SM_BEFORE_AVF2 1 // must be 1 due to the SM_average_f2() function
74
75
75 #endif // FSW_PARAMS_PROCESSING_H
76 #endif // FSW_PARAMS_PROCESSING_H
76
77
@@ -1,23 +1,14
1 #ifndef TM_BYTE_POSITIONS_H
1 #ifndef TM_BYTE_POSITIONS_H
2 #define TM_BYTE_POSITIONS_H
2 #define TM_BYTE_POSITIONS_H
3
3
4 #define BYTE_POS_CP_LFR_MODE 11
4 #define BYTE_POS_CP_LFR_MODE 11
5
5
6 // TC_LFR_LOAD_COMMON_PAR
7
8 // TC_LFR_LOAD_NORMAL_PAR
6 // TC_LFR_LOAD_NORMAL_PAR
9 #define BYTE_POS_SY_LFR_N_SWF_L 0
7 #define BYTE_POS_SY_LFR_N_SWF_L 0
10 #define BYTE_POS_SY_LFR_N_SWF_P 2
8 #define BYTE_POS_SY_LFR_N_SWF_P 2
11 #define BYTE_POS_SY_LFR_N_ASM_P 4
9 #define BYTE_POS_SY_LFR_N_ASM_P 4
12 #define BYTE_POS_SY_LFR_N_BP_P0 6
10 #define BYTE_POS_SY_LFR_N_BP_P0 6
13 #define BYTE_POS_SY_LFR_N_BP_P1 7
11 #define BYTE_POS_SY_LFR_N_BP_P1 7
14 #define BYTE_POS_SY_LFR_N_CWF_LONG_F3 8
12 #define BYTE_POS_SY_LFR_N_CWF_LONG_F3 8
15
13
16 // TC_LFR_LOAD_BURST_PAR
17
18 // TC_LFR_LOAD_SBM1_PAR
19
20 // TC_LFR_LOAD_SBM2_PAR
21
22
23 #endif // TM_BYTE_POSITIONS_H
14 #endif // TM_BYTE_POSITIONS_H
General Comments 0
You need to be logged in to leave comments. Login now