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