##// END OF EJS Templates
sync
paul -
r15:ddd0a6fe16cc default
parent child
Show More
@@ -1,199 +1,205
1 1 #ifndef TC_TYPES_H
2 2 #define TC_TYPES_H
3 3
4 4 #include <ccsds_types.h>
5 5
6 6 #define PROTOCOLE_IDENTIFIER 0x02
7 7
8 8 // PACKET ID
9 9 #define TC_LFR_PACKET_ID 0x1ccc // PID 76 CAT 12
10 10
11 11 #define PACKET_LENGTH_TC_LFR_RESET (12 - CCSDS_TC_TM_PACKET_OFFSET)
12 12 #define PACKET_LENGTH_TC_LFR_LOAD_COMMON_PAR (14 - CCSDS_TC_TM_PACKET_OFFSET)
13 13 #define PACKET_LENGTH_TC_LFR_LOAD_NORMAL_PAR (22 - CCSDS_TC_TM_PACKET_OFFSET)
14 14 #define PACKET_LENGTH_TC_LFR_LOAD_BURST_PAR (14 - CCSDS_TC_TM_PACKET_OFFSET)
15 15 #define PACKET_LENGTH_TC_LFR_LOAD_SBM1_PAR (14 - CCSDS_TC_TM_PACKET_OFFSET)
16 16 #define PACKET_LENGTH_TC_LFR_LOAD_SBM2_PAR (14 - CCSDS_TC_TM_PACKET_OFFSET)
17 17 #define PACKET_LENGTH_TC_LFR_DUMP_PAR (12 - CCSDS_TC_TM_PACKET_OFFSET)
18 18 #define PACKET_LENGTH_TC_LFR_ENTER_MODE (20 - CCSDS_TC_TM_PACKET_OFFSET)
19 19 #define PACKET_LENGTH_TC_LFR_UPDATE_INFO (46 - CCSDS_TC_TM_PACKET_OFFSET)
20 20 #define PACKET_LENGTH_TC_LFR_ENABLE_CALIBRATION (12 - CCSDS_TC_TM_PACKET_OFFSET)
21 21 #define PACKET_LENGTH_TC_LFR_DISABLE_CALIBRATION (12 - CCSDS_TC_TM_PACKET_OFFSET)
22 22 #define PACKET_LENGTH_TC_LFR_UPDATE_TIME (18 - CCSDS_TC_TM_PACKET_OFFSET)
23 23
24 24 // TC TYPES
25 25 #define TC_TYPE_DEFAULT 181
26 26 #define TC_TYPE_LFR_UPDATE_TIME 9
27 27
28 28 // TC SUBTYPES
29 29 #define TC_SUBTYPE_RESET 1
30 30 #define TC_SUBTYPE_LOAD_COMMON_PAR 11
31 31 #define TC_SUBTYPE_LOAD_NORMAL_PAR 13
32 32 #define TC_SUBTYPE_LOAD_BURST_PAR 19
33 33 #define TC_SUBTYPE_LOAD_SBM1_PAR 25
34 34 #define TC_SUBTYPE_LOAD_SBM2_PAR 27
35 35 #define TC_SUBTYPE_DUMP_PAR 31
36 36 #define TC_SUBTYPE_ENTER_MODE 41
37 37 #define TC_SUBTYPE_UPDATE_INFO 51
38 38 #define TC_SUBTYPE_ENABLE_CALIBRATION 61
39 39 #define TC_SUBTYPE_DISABLE_CALIBRATION 63
40 40 #define TC_SUBTYPE_UPDATE_TIME 129
41 41
42 42 // OTHER CONSTANTS
43 43 #define TC_LFR_PACKET_SEQUENCE_CONTROL 0xc000 // PID 76 CAT 12
44 44 #define TC_LFR_DATA_FIELD_HEADER0 0x19
45 45 #define TC_LFR_LOAD_COMMON_PAR_SPARE 0x00
46 46
47 struct Packet_TC_LFR_RESET_str
47 typedef struct
48 48 { // the CCSDS header is added by LPPMON
49 49 unsigned char packetID[2];
50 50 unsigned char packetSequenceControl[2];
51 51 unsigned char packetLength[2];
52 52 // DATA FIELD HEADER
53 53 unsigned char ccsdsSecHeaderFlag_pusVersion_ack;
54 54 unsigned char serviceType;
55 55 unsigned char serviceSubType;
56 56 unsigned char sourceID;
57 57 unsigned char crc[2];
58 };
59 typedef struct Packet_TC_LFR_RESET_str Packet_TC_LFR_RESET_t;
58 } Packet_TC_LFR_RESET_t;
60 59
61 struct Packet_TC_LFR_ENTER_MODE_str
60 typedef struct
62 61 { // the CCSDS header is added by LPPMON
63 62 unsigned char packetID[2];
64 63 unsigned char packetSequenceControl[2];
65 64 unsigned char packetLength[2];
66 65 // DATA FIELD HEADER
67 66 unsigned char ccsdsSecHeaderFlag_pusVersion_ack;
68 67 unsigned char serviceType;
69 68 unsigned char serviceSubType;
70 69 unsigned char sourceID;
71 70 unsigned char spare;
72 71 unsigned char mode;
73 72 unsigned char enterModeTime[6];
74 73 unsigned char crc[2];
75 };
76 typedef struct Packet_TC_LFR_ENTER_MODE_str Packet_TC_LFR_ENTER_MODE_t;
74 } Packet_TC_LFR_ENTER_MODE_t;
77 75
78 struct Packet_TC_LFR_UPDATE_INFO_str
76 typedef struct
79 77 { // the CCSDS header is added by LPPMON
80 78 unsigned char packetID[2];
81 79 unsigned char packetSequenceControl[2];
82 80 unsigned char packetLength[2];
83 81 // DATA FIELD HEADER
84 82 unsigned char ccsdsSecHeaderFlag_pusVersion_ack;
85 83 unsigned char serviceType;
86 84 unsigned char serviceSubType;
87 85 unsigned char sourceID;
88 86 unsigned char set1;
89 87 unsigned char set2;
90 88 unsigned char set3_bias_setting_set1[6];
91 89 unsigned char set3_bias_setting_set2[6];
92 90 unsigned char set3_bias_voltage[4];
93 91 unsigned char set4[8];
94 92 unsigned char set5;
95 93 unsigned char set6;
96 94 unsigned char set7[8];
97 95 unsigned char crc[2];
98 };
99 typedef struct Packet_TC_LFR_UPDATE_INFO_str Packet_TC_LFR_UPDATE_INFO_t;
96 } Packet_TC_LFR_UPDATE_INFO_t;
100 97
101 struct Packet_TC_LFR_DUMP_PAR_str
98 typedef struct
102 99 { // the CCSDS header is added by LPPMON
103 100 unsigned char packetID[2];
104 101 unsigned char packetSequenceControl[2];
105 102 unsigned char packetLength[2];
106 103 // DATA FIELD HEADER
107 104 unsigned char ccsdsSecHeaderFlag_pusVersion_ack;
108 105 unsigned char serviceType;
109 106 unsigned char serviceSubType;
110 107 unsigned char sourceID;
111 108 unsigned char crc[2];
112 109
113 };
114 typedef struct Packet_TC_LFR_DUMP_PAR_str Packet_TC_LFR_DUMP_PAR_t;
110 } Packet_TC_LFR_DUMP_PAR_t;
115 111
116 struct Packet_TC_LFR_LOAD_COMMON_PAR_str
112 typedef struct
117 113 { // the CCSDS header is added by LPPMON
118 114 unsigned char packetID[2];
119 115 unsigned char packetSequenceControl[2];
120 116 unsigned char packetLength[2];
121 117 // DATA FIELD HEADER
122 118 unsigned char ccsdsSecHeaderFlag_pusVersion_ack;
123 119 unsigned char serviceType;
124 120 unsigned char serviceSubType;
125 121 unsigned char sourceID;
126 122 unsigned char spare;
127 123 unsigned char bw_sp0_sp1_r0_r1;
128 124 unsigned char crc[2];
129 125
130 };
131 typedef struct Packet_TC_LFR_LOAD_COMMON_PAR_str Packet_TC_LFR_LOAD_COMMON_PAR_t;
126 } Packet_TC_LFR_LOAD_COMMON_PAR_t;
132 127
133 struct Packet_TC_LFR_LOAD_NORMAL_PAR_str
128 typedef struct
134 129 { // the CCSDS header is added by LPPMON
135 130 unsigned char packetID[2];
136 131 unsigned char packetSequenceControl[2];
137 132 unsigned char packetLength[2];
138 133 // DATA FIELD HEADER
139 134 unsigned char ccsdsSecHeaderFlag_pusVersion_ack;
140 135 unsigned char serviceType;
141 136 unsigned char serviceSubType;
142 137 unsigned char sourceID;
143 138 unsigned char sy_lfr_n_swf_l[2];
144 139 unsigned char sy_lfr_n_swf_p[2];
145 140 unsigned char sy_lfr_n_asm_p[2];
146 141 unsigned char sy_lfr_n_bp_p0;
147 142 unsigned char sy_lfr_n_bp_p1;
148 143 unsigned char sy_lfr_n_cwf_long_f3;
149 144 unsigned char lfr_normal_parameters_spare;
150 145 unsigned char crc[2];
151 };
152 typedef struct Packet_TC_LFR_LOAD_NORMAL_PAR_str Packet_TC_LFR_LOAD_NORMAL_PAR_t;
146 } Packet_TC_LFR_LOAD_NORMAL_PAR_t;
153 147
154 struct Packet_TC_LFR_LOAD_BURST_SBM1_SBM2_PAR_str
148 typedef struct
155 149 { // the CCSDS header is added by LPPMON
156 150 unsigned char packetID[2];
157 151 unsigned char packetSequenceControl[2];
158 152 unsigned char packetLength[2];
159 153 // DATA FIELD HEADER
160 154 unsigned char ccsdsSecHeaderFlag_pusVersion_ack;
161 155 unsigned char serviceType;
162 156 unsigned char serviceSubType;
163 157 unsigned char sourceID;
164 158 unsigned char sy_lfr_bp_p0;
165 159 unsigned char sy_lfr_bp_p1;
166 160 unsigned char crc[2];
167 };
168 typedef struct Packet_TC_LFR_LOAD_BURST_SBM1_SBM2_PAR_str Packet_TC_LFR_LOAD_BURST_SBM1_SBM2_PAR_t;
161 } Packet_TC_LFR_LOAD_BURST_SBM1_SBM2_PAR_t;
169 162
170 struct Packet_TC_LFR_ENABLE_DISABLE_CALIBRATION_str
163 typedef struct
171 164 { // the CCSDS header is added by LPPMON
172 165 unsigned char packetID[2];
173 166 unsigned char packetSequenceControl[2];
174 167 unsigned char packetLength[2];
175 168 // DATA FIELD HEADER
176 169 unsigned char ccsdsSecHeaderFlag_pusVersion_ack;
177 170 unsigned char serviceType;
178 171 unsigned char serviceSubType;
179 172 unsigned char sourceID;
180 173 unsigned char crc[2];
181 };
182 typedef struct Packet_TC_LFR_ENABLE_DISABLE_CALIBRATION_str Packet_TC_LFR_ENABLE_DISABLE_CALIBRATION_t;
174 } Packet_TC_LFR_ENABLE_DISABLE_CALIBRATION_t;
183 175
184 struct Packet_TC_LFR_UPDATE_TIME_str
176 typedef struct
177 { // the CCSDS header is added by LPPMON
178 unsigned char packetID[2];
179 unsigned char packetSequenceControl[2];
180 unsigned char packetLength[2];
181 // DATA FIELD HEADER
182 unsigned char ccsdsSecHeaderFlag_pusVersion_ack;
183 unsigned char serviceType;
184 unsigned char serviceSubType;
185 unsigned char sourceID;
186 unsigned char spare;
187 unsigned char bw_sp0_sp1_r0_r1;
188 unsigned char crc[2];
189 } Packet_TC_LFR_LOAD_KCOEFFICIENT_t;
190
191 typedef struct
185 192 { // the CCSDS header is added by LPPMON
186 193 unsigned char packetID[2];
187 194 unsigned char packetSequenceControl[2];
188 195 unsigned char packetLength[2];
189 196 // DATA FIELD HEADER
190 197 unsigned char ccsdsSecHeaderFlag_pusVersion_ack;
191 198 unsigned char serviceType;
192 199 unsigned char serviceSubType;
193 200 unsigned char sourceID;
194 201 unsigned char cp_rpw_time[6];
195 202 unsigned char crc[2];
196 };
197 typedef struct Packet_TC_LFR_UPDATE_TIME_str Packet_TC_LFR_UPDATE_TIME_t;
203 } Packet_TC_LFR_UPDATE_TIME_t;
198 204
199 205 #endif // TC_TYPES_H
@@ -1,75 +1,76
1 1 #ifndef FSW_PARAMS_PROCESSING_H
2 2 #define FSW_PARAMS_PROCESSING_H
3 3
4 4 #define NB_BINS_PER_SM 128
5 5 #define NB_VALUES_PER_SM 25
6 6 #define TOTAL_SIZE_SM 3200 // 25 * 128 = 0xC80
7 7 #define TOTAL_SIZE_NORM_BP1_F0 99 // 11 * 9 = 99
8 8 #define TOTAL_SIZE_NORM_BP1_F1 117 // 13 * 9 = 117
9 9 #define TOTAL_SIZE_NORM_BP1_F2 108 // 12 * 9 = 108
10 10 #define TOTAL_SIZE_SBM1_BP1_F0 198 // 22 * 9 = 198
11 11 // F0
12 12 #define NB_RING_NODES_SM_F0 20 // AT LEAST 8 due to the way the averaging is done
13 13 #define NB_RING_NODES_ASM_BURST_SBM_F0 10 // AT LEAST 3
14 14 #define NB_RING_NODES_ASM_NORM_F0 10 // AT LEAST 3
15 15 #define NB_RING_NODES_ASM_F0 3 // AT LEAST 3
16 16 // F1
17 17 #define NB_RING_NODES_SM_F1 12 // AT LEAST 8 due to the way the averaging is done
18 18 #define NB_RING_NODES_ASM_BURST_SBM_F1 5 // AT LEAST 3
19 19 #define NB_RING_NODES_ASM_NORM_F1 5 // AT LEAST 3
20 20 #define NB_RING_NODES_ASM_F1 3 // AT LEAST 3
21 21 // F2
22 22 #define NB_RING_NODES_SM_F2 5 // AT LEAST 3
23 23 #define NB_RING_NODES_ASM_NORM_F2 3 // AT LEAST 3
24 24 #define NB_RING_NODES_ASM_F2 3 // AT LEAST 3
25 25 //
26 26 #define NB_BINS_PER_ASM_F0 88
27 27 #define NB_BINS_PER_PKT_ASM_F0 44
28 28 #define TOTAL_SIZE_ASM_F0_IN_BYTES 4400 // 25 * 88 * 2
29 29 #define ASM_F0_INDICE_START 16 // 17 - 1, (-1) due to the VHDL behaviour
30 30 #define ASM_F0_INDICE_STOP 103 // 104 - 1, 2 packets of 44 bins
31 31 //
32 32 #define NB_BINS_PER_ASM_F1 104
33 33 #define NB_BINS_PER_PKT_ASM_F1 52
34 34 #define TOTAL_SIZE_ASM_F1_IN_BYTES 5200 // 25 * 104 * 2
35 35 #define ASM_F1_INDICE_START 5 // 6 - 1, (-1) due to the VHDL behaviour
36 36 #define ASM_F1_INDICE_STOP 108 // 109 - 1, 2 packets of 52 bins
37 37 //
38 38 #define NB_BINS_PER_ASM_F2 96
39 39 #define NB_BINS_PER_PKT_ASM_F2 48
40 40 #define TOTAL_SIZE_ASM_F2_IN_BYTES 4800 // 25 * 96 * 2
41 41 #define ASM_F2_INDICE_START 6 // 7 - 1, (-1) due to the VHDL behaviour
42 42 #define ASM_F2_INDICE_STOP 101 // 102 - 1, 2 packets of 48 bins
43 43 //
44 44 #define NB_BINS_COMPRESSED_SM_F0 11
45 45 #define NB_BINS_COMPRESSED_SM_F1 13
46 46 #define NB_BINS_COMPRESSED_SM_F2 12
47 #define NB_BINS_COMPRESSED_SM 36 // 11 + 12 + 13
47 48 #define NB_BINS_COMPRESSED_SM_SBM_F0 22
48 49 #define NB_BINS_COMPRESSED_SM_SBM_F1 26
49 50 #define NB_BINS_COMPRESSED_SM_SBM_F2 24
50 51 //
51 52 #define NB_BYTES_PER_BP1 9
52 53 #define NB_BYTES_PER_BP2 30
53 54 //
54 55 #define NB_BINS_TO_AVERAGE_ASM_F0 8
55 56 #define NB_BINS_TO_AVERAGE_ASM_F1 8
56 57 #define NB_BINS_TO_AVERAGE_ASM_F2 8
57 58 #define NB_BINS_TO_AVERAGE_ASM_SBM_F0 4
58 59 #define NB_BINS_TO_AVERAGE_ASM_SBM_F1 4
59 60 #define NB_BINS_TO_AVERAGE_ASM_SBM_F2 4
60 61 //
61 62 #define TOTAL_SIZE_COMPRESSED_ASM_NORM_F0 275 // 11 * 25 WORDS
62 63 #define TOTAL_SIZE_COMPRESSED_ASM_NORM_F1 325 // 13 * 25 WORDS
63 64 #define TOTAL_SIZE_COMPRESSED_ASM_NORM_F2 300 // 12 * 25 WORDS
64 65 #define TOTAL_SIZE_COMPRESSED_ASM_SBM_F0 550 // 22 * 25 WORDS
65 66 #define TOTAL_SIZE_COMPRESSED_ASM_SBM_F1 650 // 26 * 25 WORDS
66 67 #define TOTAL_SIZE_BP1_NORM_F0 99 // 9 * 11 UNSIGNED CHAR
67 68 #define TOTAL_SIZE_BP2_NORM_F0 330 // 30 * 11 UNSIGNED CHAR
68 69 #define TOTAL_SIZE_BP1_SBM_F0 198 // 9 * 22 UNSIGNED CHAR
69 70 // GENERAL
70 71 #define NB_SM_BEFORE_AVF0 8 // must be 8 due to the SM_average() function
71 72 #define NB_SM_BEFORE_AVF1 8 // must be 8 due to the SM_average() function
72 73 #define NB_SM_BEFORE_AVF2 1 // must be 1 due to the SM_average_f2() function
73 74
74 75 #endif // FSW_PARAMS_PROCESSING_H
75 76
General Comments 0
You need to be logged in to leave comments. Login now