##// END OF EJS Templates
Minor changes in .h inclusion
paul -
r45:c48d02b72186 default
parent child
Show More
@@ -0,0 +1,24
1 #ifndef TC_ACCEPTANCE_H_INCLUDED
2 #define TC_ACCEPTANCE_H_INCLUDED
3
4 //#include "tm_lfr_tc_exe.h"
5 #include "fsw_params.h"
6
7 //**********************
8 // GENERAL USE FUNCTIONS
9 unsigned int Crc_opt( unsigned char D, unsigned int Chk);
10 void initLookUpTableForCRC( void );
11 void GetCRCAsTwoBytes(unsigned char* data, unsigned char* crcAsTwoBytes, unsigned int sizeOfData);
12
13 //*********************
14 // ACCEPTANCE FUNCTIONS
15 int tc_parser(ccsdsTelecommandPacket_t * TCPacket, unsigned int TC_LEN_RCV, unsigned char *computed_CRC);
16 int tc_check_type( unsigned char packetType );
17 int tc_check_subtype( unsigned char packetType );
18 int tc_check_length( unsigned char packetType, unsigned int length );
19 int tc_check_crc(ccsdsTelecommandPacket_t * TCPacket, unsigned int length , unsigned char *computed_CRC);
20
21 #endif // TC_ACCEPTANCE_H_INCLUDED
22
23
24
@@ -0,0 +1,374
1 /** Functions related to TeleCommand acceptance.
2 *
3 * @file
4 * @author P. LEROY
5 *
6 * A group of functions to handle TeleCommands parsing.\n
7 *
8 */
9
10 #include "tc_acceptance.h"
11
12 unsigned int lookUpTableForCRC[256];
13
14 //**********************
15 // GENERAL USE FUNCTIONS
16 unsigned int Crc_opt( unsigned char D, unsigned int Chk)
17 {
18 /** This function generate the CRC for one byte and returns the value of the new syndrome.
19 *
20 * @param D is the current byte of data.
21 * @param Chk is the current syndrom value.
22 * @return the value of the new syndrome on two bytes.
23 *
24 */
25
26 return(((Chk << 8) & 0xff00)^lookUpTableForCRC [(((Chk >> 8)^D) & 0x00ff)]);
27 }
28
29 void initLookUpTableForCRC( void )
30 {
31 /** This function is used to initiates the look-up table for fast CRC computation.
32 *
33 * The global table lookUpTableForCRC[256] is initiated.
34 *
35 */
36
37 unsigned int i;
38 unsigned int tmp;
39
40 for (i=0; i<256; i++)
41 {
42 tmp = 0;
43 if((i & 1) != 0) {
44 tmp = tmp ^ 0x1021;
45 }
46 if((i & 2) != 0) {
47 tmp = tmp ^ 0x2042;
48 }
49 if((i & 4) != 0) {
50 tmp = tmp ^ 0x4084;
51 }
52 if((i & 8) != 0) {
53 tmp = tmp ^ 0x8108;
54 }
55 if((i & 16) != 0) {
56 tmp = tmp ^ 0x1231;
57 }
58 if((i & 32) != 0) {
59 tmp = tmp ^ 0x2462;
60 }
61 if((i & 64) != 0) {
62 tmp = tmp ^ 0x48c4;
63 }
64 if((i & 128) != 0) {
65 tmp = tmp ^ 0x9188;
66 }
67 lookUpTableForCRC[i] = tmp;
68 }
69 }
70
71 void GetCRCAsTwoBytes(unsigned char* data, unsigned char* crcAsTwoBytes, unsigned int sizeOfData)
72 {
73 /** This function calculates a two bytes Cyclic Redundancy Code.
74 *
75 * @param data points to a buffer containing the data on which to compute the CRC.
76 * @param crcAsTwoBytes points points to a two bytes buffer in which the CRC is stored.
77 * @param sizeOfData is the number of bytes of *data* used to compute the CRC.
78 *
79 * The specification of the Cyclic Redundancy Code is described in the following document: ECSS-E-70-41-A.
80 *
81 */
82
83 unsigned int Chk;
84 int j;
85 Chk = 0xffff; // reset the syndrom to all ones
86 for (j=0; j<sizeOfData; j++) {
87 Chk = Crc_opt(data[j], Chk);
88 }
89 crcAsTwoBytes[0] = (unsigned char) (Chk >> 8);
90 crcAsTwoBytes[1] = (unsigned char) (Chk & 0x00ff);
91 }
92
93 //*********************
94 // ACCEPTANCE FUNCTIONS
95 int tc_parser(ccsdsTelecommandPacket_t * TCPacket, unsigned int TC_LEN_RCV, unsigned char *computed_CRC)
96 {
97 /** This function parses TeleCommands.
98 *
99 * @param TC points to the TeleCommand that will be parsed.
100 * @param TC_LEN_RCV is the received packet length.
101 * @return Status code of the parsing.
102 *
103 * The parsing checks:
104 * - process id
105 * - category
106 * - length: a global check is performed and a per subtype check also
107 * - type
108 * - subtype
109 * - crc
110 *
111 */
112
113 int status;
114 unsigned char pid;
115 unsigned char category;
116 unsigned int length;
117 unsigned char packetType;
118 unsigned char packetSubtype;
119
120 status = CCSDS_TM_VALID;
121
122 // APID check *** APID on 2 bytes
123 pid = ((TCPacket->packetID[0] & 0x07)<<4) + ( (TCPacket->packetID[1]>>4) & 0x0f ); // PID = 11 *** 7 bits xxxxx210 7654xxxx
124 category = (TCPacket->packetID[1] & 0x0f); // PACKET_CATEGORY = 12 *** 4 bits xxxxxxxx xxxx3210
125 length = (TCPacket->packetLength[0] * 256) + TCPacket->packetLength[1];
126 packetType = TCPacket->serviceType;
127 packetSubtype = TCPacket->serviceSubType;
128
129 if ( pid != CCSDS_PROCESS_ID ) // CHECK THE PROCESS ID
130 {
131 status = ILLEGAL_APID;
132 }
133 if (status == CCSDS_TM_VALID) // CHECK THE CATEGORY
134 {
135 if ( category != CCSDS_PACKET_CATEGORY )
136 {
137 status = ILLEGAL_APID;
138 }
139 }
140 if (status == CCSDS_TM_VALID) // CHECK THE PACKET LENGTH FIELD AND THE ACTUAL LENGTH COMPLIANCE
141 {
142 if (length != TC_LEN_RCV ) {
143 status = WRONG_LEN_PACKET;
144 }
145 }
146 if (status == CCSDS_TM_VALID) // CHECK THAT THE PACKET DOES NOT EXCEED THE MAX SIZE
147 {
148 if ( length >= CCSDS_TC_PKT_MAX_SIZE ) {
149 status = WRONG_LEN_PACKET;
150 }
151 }
152 if (status == CCSDS_TM_VALID) // CHECK THE TYPE
153 {
154 status = tc_check_type( packetType );
155 }
156 if (status == CCSDS_TM_VALID) // CHECK THE SUBTYPE
157 {
158 status = tc_check_subtype( packetSubtype );
159 }
160 if (status == CCSDS_TM_VALID) // CHECK THE SUBTYPE AND LENGTH COMPLIANCE
161 {
162 status = tc_check_length( packetSubtype, length );
163 }
164 if (status == CCSDS_TM_VALID ) // CHECK CRC
165 {
166 status = tc_check_crc( TCPacket, length, computed_CRC );
167 }
168
169 return status;
170 }
171
172 int tc_check_type( unsigned char packetType )
173 {
174 /** This function checks that the type of a TeleCommand is valid.
175 *
176 * @param packetType is the type to check.
177 * @return Status code CCSDS_TM_VALID or ILL_TYPE.
178 *
179 */
180
181 int status;
182
183 if ( (packetType == TC_TYPE_GEN) || (packetType == TC_TYPE_TIME))
184 {
185 status = CCSDS_TM_VALID;
186 }
187 else
188 {
189 status = ILL_TYPE;
190 }
191
192 return status;
193 }
194
195 int tc_check_subtype( unsigned char packetSubType )
196 {
197 /** This function checks that the subtype of a TeleCommand is valid.
198 *
199 * @param packetSubType is the subtype to check.
200 * @return Status code CCSDS_TM_VALID or ILL_SUBTYPE.
201 *
202 */
203
204 int status;
205
206 if ( (packetSubType == TC_SUBTYPE_RESET)
207 || (packetSubType == TC_SUBTYPE_LOAD_COMM)
208 || (packetSubType == TC_SUBTYPE_LOAD_NORM) || (packetSubType == TC_SUBTYPE_LOAD_BURST)
209 || (packetSubType == TC_SUBTYPE_LOAD_SBM1) || (packetSubType == TC_SUBTYPE_LOAD_SBM2)
210 || (packetSubType == TC_SUBTYPE_DUMP)
211 || (packetSubType == TC_SUBTYPE_ENTER)
212 || (packetSubType == TC_SUBTYPE_UPDT_INFO) || (packetSubType == TC_SUBTYPE_UPDT_TIME)
213 || (packetSubType == TC_SUBTYPE_EN_CAL) || (packetSubType == TC_SUBTYPE_DIS_CAL) )
214 {
215 status = CCSDS_TM_VALID;
216 }
217 else
218 {
219 status = ILL_TYPE;
220 }
221
222 return status;
223 }
224
225 int tc_check_length( unsigned char packetSubType, unsigned int length )
226 {
227 /** This function checks that the subtype and the length are compliant.
228 *
229 * @param packetSubType is the subtype to check.
230 * @param length is the length to check.
231 * @return Status code CCSDS_TM_VALID or ILL_TYPE.
232 *
233 */
234
235 int status;
236
237 status = LFR_SUCCESSFUL;
238
239 switch(packetSubType)
240 {
241 case TC_SUBTYPE_RESET:
242 if (length!=(TC_LEN_RESET-CCSDS_TC_TM_PACKET_OFFSET)) {
243 status = WRONG_LEN_PACKET;
244 }
245 else {
246 status = CCSDS_TM_VALID;
247 }
248 break;
249 case TC_SUBTYPE_LOAD_COMM:
250 if (length!=(TC_LEN_LOAD_COMM-CCSDS_TC_TM_PACKET_OFFSET)) {
251 status = WRONG_LEN_PACKET;
252 }
253 else {
254 status = CCSDS_TM_VALID;
255 }
256 break;
257 case TC_SUBTYPE_LOAD_NORM:
258 if (length!=(TC_LEN_LOAD_NORM-CCSDS_TC_TM_PACKET_OFFSET)) {
259 status = WRONG_LEN_PACKET;
260 }
261 else {
262 status = CCSDS_TM_VALID;
263 }
264 break;
265 case TC_SUBTYPE_LOAD_BURST:
266 if (length!=(TC_LEN_LOAD_BURST-CCSDS_TC_TM_PACKET_OFFSET)) {
267 status = WRONG_LEN_PACKET;
268 }
269 else {
270 status = CCSDS_TM_VALID;
271 }
272 break;
273 case TC_SUBTYPE_LOAD_SBM1:
274 if (length!=(TC_LEN_LOAD_SBM1-CCSDS_TC_TM_PACKET_OFFSET)) {
275 status = WRONG_LEN_PACKET;
276 }
277 else {
278 status = CCSDS_TM_VALID;
279 }
280 break;
281 case TC_SUBTYPE_LOAD_SBM2:
282 if (length!=(TC_LEN_LOAD_SBM2-CCSDS_TC_TM_PACKET_OFFSET)) {
283 status = WRONG_LEN_PACKET;
284 }
285 else {
286 status = CCSDS_TM_VALID;
287 }
288 break;
289 case TC_SUBTYPE_DUMP:
290 if (length!=(TC_LEN_DUMP-CCSDS_TC_TM_PACKET_OFFSET)) {
291 status = WRONG_LEN_PACKET;
292 }
293 else {
294 status = CCSDS_TM_VALID;
295 }
296 break;
297 case TC_SUBTYPE_ENTER:
298 if (length!=(TC_LEN_ENTER-CCSDS_TC_TM_PACKET_OFFSET)) {
299 status = WRONG_LEN_PACKET;
300 }
301 else {
302 status = CCSDS_TM_VALID;
303 }
304 break;
305 case TC_SUBTYPE_UPDT_INFO:
306 if (length!=(TC_LEN_UPDT_INFO-CCSDS_TC_TM_PACKET_OFFSET)) {
307 status = WRONG_LEN_PACKET;
308 }
309 else {
310 status = CCSDS_TM_VALID;
311 }
312 break;
313 case TC_SUBTYPE_EN_CAL:
314 if (length!=(TC_LEN_EN_CAL-CCSDS_TC_TM_PACKET_OFFSET)) {
315 status = WRONG_LEN_PACKET;
316 }
317 else {
318 status = CCSDS_TM_VALID;
319 }
320 break;
321 case TC_SUBTYPE_DIS_CAL:
322 if (length!=(TC_LEN_DIS_CAL-CCSDS_TC_TM_PACKET_OFFSET)) {
323 status = WRONG_LEN_PACKET;
324 }
325 else {
326 status = CCSDS_TM_VALID;
327 }
328 break;
329 case TC_SUBTYPE_UPDT_TIME:
330 if (length!=(TC_LEN_UPDT_TIME-CCSDS_TC_TM_PACKET_OFFSET)) {
331 status = WRONG_LEN_PACKET;
332 }
333 else {
334 status = CCSDS_TM_VALID;
335 }
336 break;
337 default: // if the subtype is not a legal value, return ILL_SUBTYPE
338 status = ILL_SUBTYPE;
339 break ;
340 }
341
342 return status;
343 }
344
345 int tc_check_crc( ccsdsTelecommandPacket_t * TCPacket, unsigned int length, unsigned char *computed_CRC )
346 {
347 /** This function checks the CRC validity of the corresponding TeleCommand packet.
348 *
349 * @param TCPacket points to the TeleCommand packet to check.
350 * @param length is the length of the TC packet.
351 * @return Status code CCSDS_TM_VALID or INCOR_CHECKSUM.
352 *
353 */
354
355 int status;
356 unsigned char * CCSDSContent;
357
358 CCSDSContent = (unsigned char*) TCPacket->packetID;
359 GetCRCAsTwoBytes(CCSDSContent, computed_CRC, length + CCSDS_TC_TM_PACKET_OFFSET - 2); // 2 CRC bytes removed from the calculation of the CRC
360 if (computed_CRC[0] != CCSDSContent[length + CCSDS_TC_TM_PACKET_OFFSET -2]) {
361 status = INCOR_CHECKSUM;
362 }
363 else if (computed_CRC[1] != CCSDSContent[length + CCSDS_TC_TM_PACKET_OFFSET -1]) {
364 status = INCOR_CHECKSUM;
365 }
366 else {
367 status = CCSDS_TM_VALID;
368 }
369
370 return status;
371 }
372
373
374
@@ -1,243 +1,248
1 1 #############################################################################
2 2 # Makefile for building: bin/fsw
3 # Generated by qmake (2.01a) (Qt 4.8.5) on: Thu Oct 17 13:22:13 2013
3 # Generated by qmake (2.01a) (Qt 4.8.5) on: Fri Oct 18 15:44:51 2013
4 4 # Project: fsw-qt.pro
5 5 # Template: app
6 6 # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
7 7 #############################################################################
8 8
9 9 ####### Compiler, tools and options
10 10
11 11 CC = sparc-rtems-gcc
12 12 CXX = sparc-rtems-g++
13 13 DEFINES = -DSW_VERSION_N1=0 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=16 -DPRINT_MESSAGES_ON_CONSOLE
14 14 CFLAGS = -pipe -O3 -Wall $(DEFINES)
15 15 CXXFLAGS = -pipe -O3 -Wall $(DEFINES)
16 16 INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header
17 17 LINK = sparc-rtems-g++
18 18 LFLAGS =
19 19 LIBS = $(SUBLIBS)
20 20 AR = sparc-rtems-ar rcs
21 21 RANLIB =
22 22 QMAKE = /usr/bin/qmake-qt4
23 23 TAR = tar -cf
24 24 COMPRESS = gzip -9f
25 25 COPY = cp -f
26 26 SED = sed
27 27 COPY_FILE = $(COPY)
28 28 COPY_DIR = $(COPY) -r
29 29 STRIP = sparc-rtems-strip
30 30 INSTALL_FILE = install -m 644 -p
31 31 INSTALL_DIR = $(COPY_DIR)
32 32 INSTALL_PROGRAM = install -m 755 -p
33 33 DEL_FILE = rm -f
34 34 SYMLINK = ln -f -s
35 35 DEL_DIR = rmdir
36 36 MOVE = mv -f
37 37 CHK_DIR_EXISTS= test -d
38 38 MKDIR = mkdir -p
39 39
40 40 ####### Output directory
41 41
42 42 OBJECTS_DIR = obj/
43 43
44 44 ####### Files
45 45
46 46 SOURCES = ../src/wf_handler.c \
47 47 ../src/tc_handler.c \
48 48 ../src/fsw_processing.c \
49 49 ../src/fsw_misc.c \
50 50 ../src/fsw_init.c \
51 51 ../src/fsw_globals.c \
52 52 ../src/fsw_spacewire.c \
53 53 ../src/tc_load_dump_parameters.c \
54 ../src/tm_lfr_tc_exe.c
54 ../src/tm_lfr_tc_exe.c \
55 ../src/tc_acceptance.c
55 56 OBJECTS = obj/wf_handler.o \
56 57 obj/tc_handler.o \
57 58 obj/fsw_processing.o \
58 59 obj/fsw_misc.o \
59 60 obj/fsw_init.o \
60 61 obj/fsw_globals.o \
61 62 obj/fsw_spacewire.o \
62 63 obj/tc_load_dump_parameters.o \
63 obj/tm_lfr_tc_exe.o
64 obj/tm_lfr_tc_exe.o \
65 obj/tc_acceptance.o
64 66 DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \
65 67 /usr/lib64/qt4/mkspecs/common/linux.conf \
66 68 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
67 69 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
68 70 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
69 71 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
70 72 /usr/lib64/qt4/mkspecs/qconfig.pri \
71 73 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \
72 74 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
73 75 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
74 76 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
75 77 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
76 78 sparc.pri \
77 79 /usr/lib64/qt4/mkspecs/features/release.prf \
78 80 /usr/lib64/qt4/mkspecs/features/default_post.prf \
79 81 /usr/lib64/qt4/mkspecs/features/shared.prf \
80 82 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
81 83 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
82 84 /usr/lib64/qt4/mkspecs/features/resources.prf \
83 85 /usr/lib64/qt4/mkspecs/features/uic.prf \
84 86 /usr/lib64/qt4/mkspecs/features/yacc.prf \
85 87 /usr/lib64/qt4/mkspecs/features/lex.prf \
86 88 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \
87 89 fsw-qt.pro
88 90 QMAKE_TARGET = fsw
89 91 DESTDIR = bin/
90 92 TARGET = bin/fsw
91 93
92 94 first: all
93 95 ####### Implicit rules
94 96
95 97 .SUFFIXES: .o .c .cpp .cc .cxx .C
96 98
97 99 .cpp.o:
98 100 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
99 101
100 102 .cc.o:
101 103 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
102 104
103 105 .cxx.o:
104 106 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
105 107
106 108 .C.o:
107 109 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
108 110
109 111 .c.o:
110 112 $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
111 113
112 114 ####### Build rules
113 115
114 116 all: Makefile $(TARGET)
115 117
116 118 $(TARGET): $(OBJECTS)
117 119 @$(CHK_DIR_EXISTS) bin/ || $(MKDIR) bin/
118 120 $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
119 121
120 122 Makefile: fsw-qt.pro /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf /usr/lib64/qt4/mkspecs/common/unix.conf \
121 123 /usr/lib64/qt4/mkspecs/common/linux.conf \
122 124 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
123 125 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
124 126 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
125 127 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
126 128 /usr/lib64/qt4/mkspecs/qconfig.pri \
127 129 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \
128 130 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
129 131 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
130 132 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
131 133 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
132 134 sparc.pri \
133 135 /usr/lib64/qt4/mkspecs/features/release.prf \
134 136 /usr/lib64/qt4/mkspecs/features/default_post.prf \
135 137 /usr/lib64/qt4/mkspecs/features/shared.prf \
136 138 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
137 139 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
138 140 /usr/lib64/qt4/mkspecs/features/resources.prf \
139 141 /usr/lib64/qt4/mkspecs/features/uic.prf \
140 142 /usr/lib64/qt4/mkspecs/features/yacc.prf \
141 143 /usr/lib64/qt4/mkspecs/features/lex.prf \
142 144 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf
143 145 $(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
144 146 /usr/lib64/qt4/mkspecs/common/unix.conf:
145 147 /usr/lib64/qt4/mkspecs/common/linux.conf:
146 148 /usr/lib64/qt4/mkspecs/common/gcc-base.conf:
147 149 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf:
148 150 /usr/lib64/qt4/mkspecs/common/g++-base.conf:
149 151 /usr/lib64/qt4/mkspecs/common/g++-unix.conf:
150 152 /usr/lib64/qt4/mkspecs/qconfig.pri:
151 153 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri:
152 154 /usr/lib64/qt4/mkspecs/features/qt_functions.prf:
153 155 /usr/lib64/qt4/mkspecs/features/qt_config.prf:
154 156 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf:
155 157 /usr/lib64/qt4/mkspecs/features/default_pre.prf:
156 158 sparc.pri:
157 159 /usr/lib64/qt4/mkspecs/features/release.prf:
158 160 /usr/lib64/qt4/mkspecs/features/default_post.prf:
159 161 /usr/lib64/qt4/mkspecs/features/shared.prf:
160 162 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf:
161 163 /usr/lib64/qt4/mkspecs/features/warn_on.prf:
162 164 /usr/lib64/qt4/mkspecs/features/resources.prf:
163 165 /usr/lib64/qt4/mkspecs/features/uic.prf:
164 166 /usr/lib64/qt4/mkspecs/features/yacc.prf:
165 167 /usr/lib64/qt4/mkspecs/features/lex.prf:
166 168 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf:
167 169 qmake: FORCE
168 170 @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
169 171
170 172 dist:
171 173 @$(CHK_DIR_EXISTS) obj/fsw1.0.0 || $(MKDIR) obj/fsw1.0.0
172 174 $(COPY_FILE) --parents $(SOURCES) $(DIST) obj/fsw1.0.0/ && (cd `dirname obj/fsw1.0.0` && $(TAR) fsw1.0.0.tar fsw1.0.0 && $(COMPRESS) fsw1.0.0.tar) && $(MOVE) `dirname obj/fsw1.0.0`/fsw1.0.0.tar.gz . && $(DEL_FILE) -r obj/fsw1.0.0
173 175
174 176
175 177 clean:compiler_clean
176 178 -$(DEL_FILE) $(OBJECTS)
177 179 -$(DEL_FILE) *~ core *.core
178 180
179 181
180 182 ####### Sub-libraries
181 183
182 184 distclean: clean
183 185 -$(DEL_FILE) $(TARGET)
184 186 -$(DEL_FILE) Makefile
185 187
186 188
187 189 grmon:
188 190 cd bin && C:/opt/grmon-eval-2.0.29b/win32/bin/grmon.exe -uart COM4 -u
189 191
190 192 check: first
191 193
192 194 compiler_rcc_make_all:
193 195 compiler_rcc_clean:
194 196 compiler_uic_make_all:
195 197 compiler_uic_clean:
196 198 compiler_image_collection_make_all: qmake_image_collection.cpp
197 199 compiler_image_collection_clean:
198 200 -$(DEL_FILE) qmake_image_collection.cpp
199 201 compiler_yacc_decl_make_all:
200 202 compiler_yacc_decl_clean:
201 203 compiler_yacc_impl_make_all:
202 204 compiler_yacc_impl_clean:
203 205 compiler_lex_make_all:
204 206 compiler_lex_clean:
205 207 compiler_clean:
206 208
207 209 ####### Compile
208 210
209 211 obj/wf_handler.o: ../src/wf_handler.c
210 212 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/wf_handler.o ../src/wf_handler.c
211 213
212 214 obj/tc_handler.o: ../src/tc_handler.c
213 215 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_handler.o ../src/tc_handler.c
214 216
215 obj/fsw_processing.o: ../src/fsw_processing.c
217 obj/fsw_processing.o: ../src/fsw_processing.c ../src/fsw_processing_globals.c
216 218 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_processing.o ../src/fsw_processing.c
217 219
218 220 obj/fsw_misc.o: ../src/fsw_misc.c
219 221 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_misc.o ../src/fsw_misc.c
220 222
221 223 obj/fsw_init.o: ../src/fsw_init.c ../src/fsw_config.c
222 224 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_init.o ../src/fsw_init.c
223 225
224 226 obj/fsw_globals.o: ../src/fsw_globals.c
225 227 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_globals.o ../src/fsw_globals.c
226 228
227 229 obj/fsw_spacewire.o: ../src/fsw_spacewire.c
228 230 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_spacewire.o ../src/fsw_spacewire.c
229 231
230 232 obj/tc_load_dump_parameters.o: ../src/tc_load_dump_parameters.c
231 233 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_load_dump_parameters.o ../src/tc_load_dump_parameters.c
232 234
233 235 obj/tm_lfr_tc_exe.o: ../src/tm_lfr_tc_exe.c
234 236 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tm_lfr_tc_exe.o ../src/tm_lfr_tc_exe.c
235 237
238 obj/tc_acceptance.o: ../src/tc_acceptance.c
239 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_acceptance.o ../src/tc_acceptance.c
240
236 241 ####### Install
237 242
238 243 install: FORCE
239 244
240 245 uninstall: FORCE
241 246
242 247 FORCE:
243 248
1 NO CONTENT: modified file, binary diff hidden
@@ -1,71 +1,74
1 1 TEMPLATE = app
2 2 # CONFIG += console v8 sim
3 3 # CONFIG options = verbose *** boot_messages *** debug_messages *** cpu_usage_report *** stack_report *** gsa
4 4 CONFIG += console verbose
5 5 CONFIG -= qt
6 6
7 7 include(./sparc.pri)
8 8
9 9 # flight software version
10 10 SWVERSION=-0-16
11 11 DEFINES += SW_VERSION_N1=0
12 12 DEFINES += SW_VERSION_N2=0
13 13 DEFINES += SW_VERSION_N3=0
14 14 DEFINES += SW_VERSION_N4=16
15 15
16 16 contains( CONFIG, verbose ) {
17 17 DEFINES += PRINT_MESSAGES_ON_CONSOLE
18 18 }
19 19
20 20 contains( CONFIG, cpu_usage_report ) {
21 21 DEFINES += PRINT_TASK_STATISTICS
22 22 }
23 23
24 24 contains( CONFIG, stack_report ) {
25 25 DEFINES += PRINT_STACK_REPORT
26 26 }
27 27
28 28 contains( CONFIG, boot_messages ) {
29 29 DEFINES += BOOT_MESSAGES
30 30 }
31 31
32 32 #doxygen.target = doxygen
33 33 #doxygen.commands = doxygen ../doc/Doxyfile
34 34 #QMAKE_EXTRA_TARGETS += doxygen
35 35
36 36 TARGET = fsw
37 37 contains( CONFIG, gsa ) {
38 38 DEFINES += GSA
39 39 TARGET = fsw-gsa
40 40 }
41 41
42 42 INCLUDEPATH += \
43 43 ../src \
44 44 ../header
45 45
46 46 SOURCES += \
47 47 ../src/wf_handler.c \
48 48 ../src/tc_handler.c \
49 49 ../src/fsw_processing.c \
50 50 ../src/fsw_misc.c \
51 51 ../src/fsw_init.c \
52 52 ../src/fsw_globals.c \
53 53 ../src/fsw_spacewire.c \
54 54 ../src/tc_load_dump_parameters.c \
55 ../src/tm_lfr_tc_exe.c
55 ../src/tm_lfr_tc_exe.c \
56 ../src/tc_acceptance.c
57
56 58
57 59 HEADERS += \
58 60 ../header/wf_handler.h \
59 61 ../header/tc_handler.h \
60 62 ../header/grlib_regs.h \
61 63 ../header/fsw_processing.h \
62 64 ../header/fsw_params.h \
63 65 ../header/fsw_misc.h \
64 66 ../header/fsw_init.h \
65 67 ../header/ccsds_types.h \
66 68 ../header/fsw_params_processing.h \
67 69 ../header/fsw_spacewire.h \
68 70 ../header/tm_byte_positions.h \
69 71 ../header/tc_load_dump_parameters.h \
70 ../header/tm_lfr_tc_exe.h
72 ../header/tm_lfr_tc_exe.h \
73 ../header/tc_acceptance.h
71 74
@@ -1,305 +1,305
1 1 <?xml version="1.0" encoding="UTF-8"?>
2 2 <!DOCTYPE QtCreatorProject>
3 <!-- Written by QtCreator 2.8.0, 2013-10-17T08:46:24. -->
3 <!-- Written by QtCreator 2.8.0, 2013-10-18T15:44:56. -->
4 4 <qtcreator>
5 5 <data>
6 6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
7 7 <value type="int">0</value>
8 8 </data>
9 9 <data>
10 10 <variable>ProjectExplorer.Project.EditorSettings</variable>
11 11 <valuemap type="QVariantMap">
12 12 <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
13 13 <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
14 14 <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
15 15 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
16 16 <value type="QString" key="language">Cpp</value>
17 17 <valuemap type="QVariantMap" key="value">
18 18 <value type="QString" key="CurrentPreferences">CppGlobal</value>
19 19 </valuemap>
20 20 </valuemap>
21 21 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
22 22 <value type="QString" key="language">QmlJS</value>
23 23 <valuemap type="QVariantMap" key="value">
24 24 <value type="QString" key="CurrentPreferences">QmlJSGlobal</value>
25 25 </valuemap>
26 26 </valuemap>
27 27 <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
28 28 <value type="QByteArray" key="EditorConfiguration.Codec">System</value>
29 29 <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
30 30 <value type="int" key="EditorConfiguration.IndentSize">4</value>
31 31 <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
32 32 <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
33 33 <value type="int" key="EditorConfiguration.PaddingMode">1</value>
34 34 <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
35 35 <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
36 36 <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
37 37 <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
38 38 <value type="int" key="EditorConfiguration.TabSize">8</value>
39 39 <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
40 40 <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
41 41 <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
42 42 <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
43 43 <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
44 44 <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
45 45 </valuemap>
46 46 </data>
47 47 <data>
48 48 <variable>ProjectExplorer.Project.PluginSettings</variable>
49 49 <valuemap type="QVariantMap"/>
50 50 </data>
51 51 <data>
52 52 <variable>ProjectExplorer.Project.Target.0</variable>
53 53 <valuemap type="QVariantMap">
54 54 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop-Qt 4.8.2 in PATH (System)</value>
55 55 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop-Qt 4.8.2 in PATH (System)</value>
56 56 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{5289e843-9ef2-45ce-88c6-ad27d8e08def}</value>
57 57 <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
58 58 <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
59 59 <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">1</value>
60 60 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
61 61 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
62 62 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
63 63 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
64 64 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
65 65 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
66 66 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
67 67 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
68 68 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
69 69 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
70 70 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
71 71 </valuemap>
72 72 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
73 73 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
74 74 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
75 75 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
76 76 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
77 77 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
78 78 <value type="QString">-w</value>
79 79 <value type="QString">-r</value>
80 80 </valuelist>
81 81 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
82 82 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">-r -w -j 4</value>
83 83 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
84 84 </valuemap>
85 85 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
86 86 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
87 87 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
88 88 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
89 89 </valuemap>
90 90 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
91 91 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
92 92 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
93 93 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
94 94 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
95 95 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
96 96 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
97 97 <value type="QString">-w</value>
98 98 <value type="QString">-r</value>
99 99 </valuelist>
100 100 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
101 101 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">-r -w clean</value>
102 102 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
103 103 </valuemap>
104 104 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
105 105 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
106 106 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
107 107 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
108 108 </valuemap>
109 109 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
110 110 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
111 111 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
112 112 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Release</value>
113 113 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
114 114 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
115 115 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
116 116 <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/DEV_PLE/FSW-qt</value>
117 117 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value>
118 118 </valuemap>
119 119 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
120 120 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
121 121 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
122 122 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
123 123 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
124 124 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
125 125 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
126 126 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
127 127 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
128 128 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
129 129 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
130 130 </valuemap>
131 131 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
132 132 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
133 133 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
134 134 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
135 135 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
136 136 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
137 137 <value type="QString">-w</value>
138 138 <value type="QString">-r</value>
139 139 </valuelist>
140 140 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
141 141 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">-r -w </value>
142 142 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
143 143 </valuemap>
144 144 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
145 145 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
146 146 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
147 147 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
148 148 </valuemap>
149 149 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
150 150 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
151 151 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
152 152 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
153 153 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
154 154 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
155 155 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
156 156 <value type="QString">-w</value>
157 157 <value type="QString">-r</value>
158 158 </valuelist>
159 159 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
160 160 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">-r -w clean</value>
161 161 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
162 162 </valuemap>
163 163 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
164 164 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
165 165 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
166 166 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
167 167 </valuemap>
168 168 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
169 169 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
170 170 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
171 171 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Debug</value>
172 172 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
173 173 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
174 174 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
175 175 <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/DEV_PLE/FSW-qt</value>
176 176 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value>
177 177 </valuemap>
178 178 <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
179 179 <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
180 180 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
181 181 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
182 182 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
183 183 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
184 184 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
185 185 </valuemap>
186 186 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
187 187 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">No deployment</value>
188 188 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
189 189 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
190 190 </valuemap>
191 191 <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
192 192 <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
193 193 <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
194 194 <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
195 195 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
196 196 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
197 197 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
198 198 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
199 199 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
200 200 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
201 201 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
202 202 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
203 203 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
204 204 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
205 205 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
206 206 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
207 207 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
208 208 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
209 209 <value type="int">0</value>
210 210 <value type="int">1</value>
211 211 <value type="int">2</value>
212 212 <value type="int">3</value>
213 213 <value type="int">4</value>
214 214 <value type="int">5</value>
215 215 <value type="int">6</value>
216 216 <value type="int">7</value>
217 217 <value type="int">8</value>
218 218 <value type="int">9</value>
219 219 <value type="int">10</value>
220 220 <value type="int">11</value>
221 221 <value type="int">12</value>
222 222 <value type="int">13</value>
223 223 <value type="int">14</value>
224 224 </valuelist>
225 225 <value type="int" key="PE.EnvironmentAspect.Base">2</value>
226 226 <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
227 227 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">fsw-qt</value>
228 228 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
229 229 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/opt/DEV_PLE/FSW-qt/fsw-qt.pro</value>
230 230 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
231 231 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">fsw-qt.pro</value>
232 232 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
233 233 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">true</value>
234 234 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
235 235 <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
236 236 <value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
237 237 <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">false</value>
238 238 <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
239 239 <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
240 240 <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">false</value>
241 241 </valuemap>
242 242 <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.1">
243 243 <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
244 244 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
245 245 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
246 246 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
247 247 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
248 248 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
249 249 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
250 250 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
251 251 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
252 252 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
253 253 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
254 254 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
255 255 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
256 256 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
257 257 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
258 258 <value type="int">0</value>
259 259 <value type="int">1</value>
260 260 <value type="int">2</value>
261 261 <value type="int">3</value>
262 262 <value type="int">4</value>
263 263 <value type="int">5</value>
264 264 <value type="int">6</value>
265 265 <value type="int">7</value>
266 266 <value type="int">8</value>
267 267 <value type="int">9</value>
268 268 <value type="int">10</value>
269 269 <value type="int">11</value>
270 270 <value type="int">12</value>
271 271 <value type="int">13</value>
272 272 <value type="int">14</value>
273 273 </valuelist>
274 274 <value type="int" key="PE.EnvironmentAspect.Base">2</value>
275 275 <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
276 276 <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Arguments"></value>
277 277 <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">doxygen</value>
278 278 <value type="bool" key="ProjectExplorer.CustomExecutableRunConfiguration.UseTerminal">true</value>
279 279 <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory">/opt/DEV_PLE/doc</value>
280 280 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Run doxygen</value>
281 281 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
282 282 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
283 283 <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
284 284 <value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
285 285 <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">false</value>
286 286 <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
287 287 <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
288 288 <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
289 289 </valuemap>
290 290 <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">2</value>
291 291 </valuemap>
292 292 </data>
293 293 <data>
294 294 <variable>ProjectExplorer.Project.TargetCount</variable>
295 295 <value type="int">1</value>
296 296 </data>
297 297 <data>
298 298 <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
299 299 <value type="QByteArray">{2e58a81f-9962-4bba-ae6b-760177f0656c}</value>
300 300 </data>
301 301 <data>
302 302 <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
303 303 <value type="int">14</value>
304 304 </data>
305 305 </qtcreator>
@@ -1,1902 +1,1902
1 1 # Doxyfile 1.8.3.1
2 2
3 3 # This file describes the settings to be used by the documentation system
4 4 # doxygen (www.doxygen.org) for a project
5 5 #
6 6 # All text after a hash (#) is considered a comment and will be ignored
7 7 # The format is:
8 8 # TAG = value [value, ...]
9 9 # For lists items can also be appended using:
10 10 # TAG += value [value, ...]
11 11 # Values that contain spaces should be placed between quotes (" ")
12 12
13 13 #---------------------------------------------------------------------------
14 14 # Project related configuration options
15 15 #---------------------------------------------------------------------------
16 16
17 17 # This tag specifies the encoding used for all characters in the config file
18 18 # that follow. The default is UTF-8 which is also the encoding used for all
19 19 # text before the first occurrence of this tag. Doxygen uses libiconv (or the
20 20 # iconv built into libc) for the transcoding. See
21 21 # http://www.gnu.org/software/libiconv for the list of possible encodings.
22 22
23 23 DOXYFILE_ENCODING = UTF-8
24 24
25 25 # The PROJECT_NAME tag is a single word (or sequence of words) that should
26 26 # identify the project. Note that if you do not use Doxywizard you need
27 27 # to put quotes around the project name if it contains spaces.
28 28
29 29 PROJECT_NAME = DEV_PLE
30 30
31 31 # The PROJECT_NUMBER tag can be used to enter a project or revision number.
32 32 # This could be handy for archiving the generated documentation or
33 33 # if some version control system is used.
34 34
35 35 PROJECT_NUMBER =
36 36
37 37 # Using the PROJECT_BRIEF tag one can provide an optional one line description
38 38 # for a project that appears at the top of each page and should give viewer
39 39 # a quick idea about the purpose of the project. Keep the description short.
40 40
41 41 PROJECT_BRIEF =
42 42
43 43 # With the PROJECT_LOGO tag one can specify an logo or icon that is
44 44 # included in the documentation. The maximum height of the logo should not
45 45 # exceed 55 pixels and the maximum width should not exceed 200 pixels.
46 46 # Doxygen will copy the logo to the output directory.
47 47
48 48 PROJECT_LOGO =
49 49
50 50 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
51 51 # base path where the generated documentation will be put.
52 52 # If a relative path is entered, it will be relative to the location
53 53 # where doxygen was started. If left blank the current directory will be used.
54 54
55 55 OUTPUT_DIRECTORY = /opt/DEV_PLE/doc
56 56
57 57 # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
58 58 # 4096 sub-directories (in 2 levels) under the output directory of each output
59 59 # format and will distribute the generated files over these directories.
60 60 # Enabling this option can be useful when feeding doxygen a huge amount of
61 61 # source files, where putting all generated files in the same directory would
62 62 # otherwise cause performance problems for the file system.
63 63
64 64 CREATE_SUBDIRS = NO
65 65
66 66 # The OUTPUT_LANGUAGE tag is used to specify the language in which all
67 67 # documentation generated by doxygen is written. Doxygen will use this
68 68 # information to generate all constant output in the proper language.
69 69 # The default language is English, other supported languages are:
70 70 # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
71 71 # Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
72 72 # Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
73 73 # messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
74 74 # Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak,
75 75 # Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
76 76
77 77 OUTPUT_LANGUAGE = English
78 78
79 79 # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
80 80 # include brief member descriptions after the members that are listed in
81 81 # the file and class documentation (similar to JavaDoc).
82 82 # Set to NO to disable this.
83 83
84 84 BRIEF_MEMBER_DESC = YES
85 85
86 86 # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
87 87 # the brief description of a member or function before the detailed description.
88 88 # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
89 89 # brief descriptions will be completely suppressed.
90 90
91 91 REPEAT_BRIEF = YES
92 92
93 93 # This tag implements a quasi-intelligent brief description abbreviator
94 94 # that is used to form the text in various listings. Each string
95 95 # in this list, if found as the leading text of the brief description, will be
96 96 # stripped from the text and the result after processing the whole list, is
97 97 # used as the annotated text. Otherwise, the brief description is used as-is.
98 98 # If left blank, the following values are used ("$name" is automatically
99 99 # replaced with the name of the entity): "The $name class" "The $name widget"
100 100 # "The $name file" "is" "provides" "specifies" "contains"
101 101 # "represents" "a" "an" "the"
102 102
103 103 ABBREVIATE_BRIEF = "The $name class" \
104 104 "The $name widget" \
105 105 "The $name file" \
106 106 is \
107 107 provides \
108 108 specifies \
109 109 contains \
110 110 represents \
111 111 a \
112 112 an \
113 113 the
114 114
115 115 # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
116 116 # Doxygen will generate a detailed section even if there is only a brief
117 117 # description.
118 118
119 119 ALWAYS_DETAILED_SEC = NO
120 120
121 121 # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
122 122 # inherited members of a class in the documentation of that class as if those
123 123 # members were ordinary class members. Constructors, destructors and assignment
124 124 # operators of the base classes will not be shown.
125 125
126 126 INLINE_INHERITED_MEMB = NO
127 127
128 128 # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
129 129 # path before files name in the file list and in the header files. If set
130 130 # to NO the shortest path that makes the file name unique will be used.
131 131
132 132 FULL_PATH_NAMES = YES
133 133
134 134 # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
135 135 # can be used to strip a user-defined part of the path. Stripping is
136 136 # only done if one of the specified strings matches the left-hand part of
137 137 # the path. The tag can be used to show relative paths in the file list.
138 138 # If left blank the directory from which doxygen is run is used as the
139 139 # path to strip. Note that you specify absolute paths here, but also
140 140 # relative paths, which will be relative from the directory where doxygen is
141 141 # started.
142 142
143 143 STRIP_FROM_PATH =
144 144
145 145 # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
146 146 # the path mentioned in the documentation of a class, which tells
147 147 # the reader which header file to include in order to use a class.
148 148 # If left blank only the name of the header file containing the class
149 149 # definition is used. Otherwise one should specify the include paths that
150 150 # are normally passed to the compiler using the -I flag.
151 151
152 152 STRIP_FROM_INC_PATH =
153 153
154 154 # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
155 155 # (but less readable) file names. This can be useful if your file system
156 156 # doesn't support long names like on DOS, Mac, or CD-ROM.
157 157
158 158 SHORT_NAMES = NO
159 159
160 160 # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
161 161 # will interpret the first line (until the first dot) of a JavaDoc-style
162 162 # comment as the brief description. If set to NO, the JavaDoc
163 163 # comments will behave just like regular Qt-style comments
164 164 # (thus requiring an explicit @brief command for a brief description.)
165 165
166 166 JAVADOC_AUTOBRIEF = YES
167 167
168 168 # If the QT_AUTOBRIEF tag is set to YES then Doxygen will
169 169 # interpret the first line (until the first dot) of a Qt-style
170 170 # comment as the brief description. If set to NO, the comments
171 171 # will behave just like regular Qt-style comments (thus requiring
172 172 # an explicit \brief command for a brief description.)
173 173
174 174 QT_AUTOBRIEF = NO
175 175
176 176 # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
177 177 # treat a multi-line C++ special comment block (i.e. a block of //! or ///
178 178 # comments) as a brief description. This used to be the default behaviour.
179 179 # The new default is to treat a multi-line C++ comment block as a detailed
180 180 # description. Set this tag to YES if you prefer the old behaviour instead.
181 181
182 182 MULTILINE_CPP_IS_BRIEF = NO
183 183
184 184 # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
185 185 # member inherits the documentation from any documented member that it
186 186 # re-implements.
187 187
188 188 INHERIT_DOCS = YES
189 189
190 190 # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
191 191 # a new page for each member. If set to NO, the documentation of a member will
192 192 # be part of the file/class/namespace that contains it.
193 193
194 194 SEPARATE_MEMBER_PAGES = NO
195 195
196 196 # The TAB_SIZE tag can be used to set the number of spaces in a tab.
197 197 # Doxygen uses this value to replace tabs by spaces in code fragments.
198 198
199 199 TAB_SIZE = 4
200 200
201 201 # This tag can be used to specify a number of aliases that acts
202 202 # as commands in the documentation. An alias has the form "name=value".
203 203 # For example adding "sideeffect=\par Side Effects:\n" will allow you to
204 204 # put the command \sideeffect (or @sideeffect) in the documentation, which
205 205 # will result in a user-defined paragraph with heading "Side Effects:".
206 206 # You can put \n's in the value part of an alias to insert newlines.
207 207
208 208 ALIASES =
209 209
210 210 # This tag can be used to specify a number of word-keyword mappings (TCL only).
211 211 # A mapping has the form "name=value". For example adding
212 212 # "class=itcl::class" will allow you to use the command class in the
213 213 # itcl::class meaning.
214 214
215 215 TCL_SUBST =
216 216
217 217 # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
218 218 # sources only. Doxygen will then generate output that is more tailored for C.
219 219 # For instance, some of the names that are used will be different. The list
220 220 # of all members will be omitted, etc.
221 221
222 222 OPTIMIZE_OUTPUT_FOR_C = YES
223 223
224 224 # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
225 225 # sources only. Doxygen will then generate output that is more tailored for
226 226 # Java. For instance, namespaces will be presented as packages, qualified
227 227 # scopes will look different, etc.
228 228
229 229 OPTIMIZE_OUTPUT_JAVA = NO
230 230
231 231 # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
232 232 # sources only. Doxygen will then generate output that is more tailored for
233 233 # Fortran.
234 234
235 235 OPTIMIZE_FOR_FORTRAN = NO
236 236
237 237 # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
238 238 # sources. Doxygen will then generate output that is tailored for
239 239 # VHDL.
240 240
241 241 OPTIMIZE_OUTPUT_VHDL = NO
242 242
243 243 # Doxygen selects the parser to use depending on the extension of the files it
244 244 # parses. With this tag you can assign which parser to use for a given
245 245 # extension. Doxygen has a built-in mapping, but you can override or extend it
246 246 # using this tag. The format is ext=language, where ext is a file extension,
247 247 # and language is one of the parsers supported by doxygen: IDL, Java,
248 248 # Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C,
249 249 # C++. For instance to make doxygen treat .inc files as Fortran files (default
250 250 # is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note
251 251 # that for custom extensions you also need to set FILE_PATTERNS otherwise the
252 252 # files are not read by doxygen.
253 253
254 254 EXTENSION_MAPPING =
255 255
256 256 # If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all
257 257 # comments according to the Markdown format, which allows for more readable
258 258 # documentation. See http://daringfireball.net/projects/markdown/ for details.
259 259 # The output of markdown processing is further processed by doxygen, so you
260 260 # can mix doxygen, HTML, and XML commands with Markdown formatting.
261 261 # Disable only in case of backward compatibilities issues.
262 262
263 263 MARKDOWN_SUPPORT = YES
264 264
265 265 # When enabled doxygen tries to link words that correspond to documented classes,
266 266 # or namespaces to their corresponding documentation. Such a link can be
267 267 # prevented in individual cases by by putting a % sign in front of the word or
268 268 # globally by setting AUTOLINK_SUPPORT to NO.
269 269
270 270 AUTOLINK_SUPPORT = YES
271 271
272 272 # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
273 273 # to include (a tag file for) the STL sources as input, then you should
274 274 # set this tag to YES in order to let doxygen match functions declarations and
275 275 # definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
276 276 # func(std::string) {}). This also makes the inheritance and collaboration
277 277 # diagrams that involve STL classes more complete and accurate.
278 278
279 279 BUILTIN_STL_SUPPORT = NO
280 280
281 281 # If you use Microsoft's C++/CLI language, you should set this option to YES to
282 282 # enable parsing support.
283 283
284 284 CPP_CLI_SUPPORT = NO
285 285
286 286 # Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
287 287 # Doxygen will parse them like normal C++ but will assume all classes use public
288 288 # instead of private inheritance when no explicit protection keyword is present.
289 289
290 290 SIP_SUPPORT = NO
291 291
292 292 # For Microsoft's IDL there are propget and propput attributes to indicate
293 293 # getter and setter methods for a property. Setting this option to YES (the
294 294 # default) will make doxygen replace the get and set methods by a property in
295 295 # the documentation. This will only work if the methods are indeed getting or
296 296 # setting a simple type. If this is not the case, or you want to show the
297 297 # methods anyway, you should set this option to NO.
298 298
299 299 IDL_PROPERTY_SUPPORT = YES
300 300
301 301 # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
302 302 # tag is set to YES, then doxygen will reuse the documentation of the first
303 303 # member in the group (if any) for the other members of the group. By default
304 304 # all members of a group must be documented explicitly.
305 305
306 306 DISTRIBUTE_GROUP_DOC = NO
307 307
308 308 # Set the SUBGROUPING tag to YES (the default) to allow class member groups of
309 309 # the same type (for instance a group of public functions) to be put as a
310 310 # subgroup of that type (e.g. under the Public Functions section). Set it to
311 311 # NO to prevent subgrouping. Alternatively, this can be done per class using
312 312 # the \nosubgrouping command.
313 313
314 314 SUBGROUPING = YES
315 315
316 316 # When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
317 317 # unions are shown inside the group in which they are included (e.g. using
318 318 # @ingroup) instead of on a separate page (for HTML and Man pages) or
319 319 # section (for LaTeX and RTF).
320 320
321 321 INLINE_GROUPED_CLASSES = NO
322 322
323 323 # When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and
324 324 # unions with only public data fields will be shown inline in the documentation
325 325 # of the scope in which they are defined (i.e. file, namespace, or group
326 326 # documentation), provided this scope is documented. If set to NO (the default),
327 327 # structs, classes, and unions are shown on a separate page (for HTML and Man
328 328 # pages) or section (for LaTeX and RTF).
329 329
330 330 INLINE_SIMPLE_STRUCTS = NO
331 331
332 332 # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
333 333 # is documented as struct, union, or enum with the name of the typedef. So
334 334 # typedef struct TypeS {} TypeT, will appear in the documentation as a struct
335 335 # with name TypeT. When disabled the typedef will appear as a member of a file,
336 336 # namespace, or class. And the struct will be named TypeS. This can typically
337 337 # be useful for C code in case the coding convention dictates that all compound
338 338 # types are typedef'ed and only the typedef is referenced, never the tag name.
339 339
340 340 TYPEDEF_HIDES_STRUCT = NO
341 341
342 342 # The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
343 343 # determine which symbols to keep in memory and which to flush to disk.
344 344 # When the cache is full, less often used symbols will be written to disk.
345 345 # For small to medium size projects (<1000 input files) the default value is
346 346 # probably good enough. For larger projects a too small cache size can cause
347 347 # doxygen to be busy swapping symbols to and from disk most of the time
348 348 # causing a significant performance penalty.
349 349 # If the system has enough physical memory increasing the cache will improve the
350 350 # performance by keeping more symbols in memory. Note that the value works on
351 351 # a logarithmic scale so increasing the size by one will roughly double the
352 352 # memory usage. The cache size is given by this formula:
353 353 # 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
354 354 # corresponding to a cache size of 2^16 = 65536 symbols.
355 355
356 356 SYMBOL_CACHE_SIZE = 0
357 357
358 358 # Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be
359 359 # set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given
360 360 # their name and scope. Since this can be an expensive process and often the
361 361 # same symbol appear multiple times in the code, doxygen keeps a cache of
362 362 # pre-resolved symbols. If the cache is too small doxygen will become slower.
363 363 # If the cache is too large, memory is wasted. The cache size is given by this
364 364 # formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0,
365 365 # corresponding to a cache size of 2^16 = 65536 symbols.
366 366
367 367 LOOKUP_CACHE_SIZE = 0
368 368
369 369 #---------------------------------------------------------------------------
370 370 # Build related configuration options
371 371 #---------------------------------------------------------------------------
372 372
373 373 # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
374 374 # documentation are documented, even if no documentation was available.
375 375 # Private class members and static file members will be hidden unless
376 376 # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
377 377
378 378 EXTRACT_ALL = YES
379 379
380 380 # If the EXTRACT_PRIVATE tag is set to YES all private members of a class
381 381 # will be included in the documentation.
382 382
383 383 EXTRACT_PRIVATE = NO
384 384
385 385 # If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
386 386 # scope will be included in the documentation.
387 387
388 388 EXTRACT_PACKAGE = NO
389 389
390 390 # If the EXTRACT_STATIC tag is set to YES all static members of a file
391 391 # will be included in the documentation.
392 392
393 393 EXTRACT_STATIC = NO
394 394
395 395 # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
396 396 # defined locally in source files will be included in the documentation.
397 397 # If set to NO only classes defined in header files are included.
398 398
399 399 EXTRACT_LOCAL_CLASSES = YES
400 400
401 401 # This flag is only useful for Objective-C code. When set to YES local
402 402 # methods, which are defined in the implementation section but not in
403 403 # the interface are included in the documentation.
404 404 # If set to NO (the default) only methods in the interface are included.
405 405
406 406 EXTRACT_LOCAL_METHODS = NO
407 407
408 408 # If this flag is set to YES, the members of anonymous namespaces will be
409 409 # extracted and appear in the documentation as a namespace called
410 410 # 'anonymous_namespace{file}', where file will be replaced with the base
411 411 # name of the file that contains the anonymous namespace. By default
412 412 # anonymous namespaces are hidden.
413 413
414 414 EXTRACT_ANON_NSPACES = NO
415 415
416 416 # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
417 417 # undocumented members of documented classes, files or namespaces.
418 418 # If set to NO (the default) these members will be included in the
419 419 # various overviews, but no documentation section is generated.
420 420 # This option has no effect if EXTRACT_ALL is enabled.
421 421
422 422 HIDE_UNDOC_MEMBERS = NO
423 423
424 424 # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
425 425 # undocumented classes that are normally visible in the class hierarchy.
426 426 # If set to NO (the default) these classes will be included in the various
427 427 # overviews. This option has no effect if EXTRACT_ALL is enabled.
428 428
429 429 HIDE_UNDOC_CLASSES = NO
430 430
431 431 # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
432 432 # friend (class|struct|union) declarations.
433 433 # If set to NO (the default) these declarations will be included in the
434 434 # documentation.
435 435
436 436 HIDE_FRIEND_COMPOUNDS = NO
437 437
438 438 # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
439 439 # documentation blocks found inside the body of a function.
440 440 # If set to NO (the default) these blocks will be appended to the
441 441 # function's detailed documentation block.
442 442
443 443 HIDE_IN_BODY_DOCS = NO
444 444
445 445 # The INTERNAL_DOCS tag determines if documentation
446 446 # that is typed after a \internal command is included. If the tag is set
447 447 # to NO (the default) then the documentation will be excluded.
448 448 # Set it to YES to include the internal documentation.
449 449
450 450 INTERNAL_DOCS = NO
451 451
452 452 # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
453 453 # file names in lower-case letters. If set to YES upper-case letters are also
454 454 # allowed. This is useful if you have classes or files whose names only differ
455 455 # in case and if your file system supports case sensitive file names. Windows
456 456 # and Mac users are advised to set this option to NO.
457 457
458 458 CASE_SENSE_NAMES = NO
459 459
460 460 # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
461 461 # will show members with their full class and namespace scopes in the
462 462 # documentation. If set to YES the scope will be hidden.
463 463
464 464 HIDE_SCOPE_NAMES = YES
465 465
466 466 # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
467 467 # will put a list of the files that are included by a file in the documentation
468 468 # of that file.
469 469
470 470 SHOW_INCLUDE_FILES = YES
471 471
472 472 # If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
473 473 # will list include files with double quotes in the documentation
474 474 # rather than with sharp brackets.
475 475
476 476 FORCE_LOCAL_INCLUDES = NO
477 477
478 478 # If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
479 479 # is inserted in the documentation for inline members.
480 480
481 481 INLINE_INFO = YES
482 482
483 483 # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
484 484 # will sort the (detailed) documentation of file and class members
485 485 # alphabetically by member name. If set to NO the members will appear in
486 486 # declaration order.
487 487
488 488 SORT_MEMBER_DOCS = YES
489 489
490 490 # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
491 491 # brief documentation of file, namespace and class members alphabetically
492 492 # by member name. If set to NO (the default) the members will appear in
493 493 # declaration order.
494 494
495 495 SORT_BRIEF_DOCS = NO
496 496
497 497 # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
498 498 # will sort the (brief and detailed) documentation of class members so that
499 499 # constructors and destructors are listed first. If set to NO (the default)
500 500 # the constructors will appear in the respective orders defined by
501 501 # SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
502 502 # This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
503 503 # and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
504 504
505 505 SORT_MEMBERS_CTORS_1ST = NO
506 506
507 507 # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
508 508 # hierarchy of group names into alphabetical order. If set to NO (the default)
509 509 # the group names will appear in their defined order.
510 510
511 511 SORT_GROUP_NAMES = NO
512 512
513 513 # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
514 514 # sorted by fully-qualified names, including namespaces. If set to
515 515 # NO (the default), the class list will be sorted only by class name,
516 516 # not including the namespace part.
517 517 # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
518 518 # Note: This option applies only to the class list, not to the
519 519 # alphabetical list.
520 520
521 521 SORT_BY_SCOPE_NAME = NO
522 522
523 523 # If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
524 524 # do proper type resolution of all parameters of a function it will reject a
525 525 # match between the prototype and the implementation of a member function even
526 526 # if there is only one candidate or it is obvious which candidate to choose
527 527 # by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
528 528 # will still accept a match between prototype and implementation in such cases.
529 529
530 530 STRICT_PROTO_MATCHING = NO
531 531
532 532 # The GENERATE_TODOLIST tag can be used to enable (YES) or
533 533 # disable (NO) the todo list. This list is created by putting \todo
534 534 # commands in the documentation.
535 535
536 536 GENERATE_TODOLIST = YES
537 537
538 538 # The GENERATE_TESTLIST tag can be used to enable (YES) or
539 539 # disable (NO) the test list. This list is created by putting \test
540 540 # commands in the documentation.
541 541
542 542 GENERATE_TESTLIST = YES
543 543
544 544 # The GENERATE_BUGLIST tag can be used to enable (YES) or
545 545 # disable (NO) the bug list. This list is created by putting \bug
546 546 # commands in the documentation.
547 547
548 548 GENERATE_BUGLIST = YES
549 549
550 550 # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
551 551 # disable (NO) the deprecated list. This list is created by putting
552 552 # \deprecated commands in the documentation.
553 553
554 554 GENERATE_DEPRECATEDLIST= YES
555 555
556 556 # The ENABLED_SECTIONS tag can be used to enable conditional
557 557 # documentation sections, marked by \if section-label ... \endif
558 558 # and \cond section-label ... \endcond blocks.
559 559
560 560 ENABLED_SECTIONS =
561 561
562 562 # The MAX_INITIALIZER_LINES tag determines the maximum number of lines
563 563 # the initial value of a variable or macro consists of for it to appear in
564 564 # the documentation. If the initializer consists of more lines than specified
565 565 # here it will be hidden. Use a value of 0 to hide initializers completely.
566 566 # The appearance of the initializer of individual variables and macros in the
567 567 # documentation can be controlled using \showinitializer or \hideinitializer
568 568 # command in the documentation regardless of this setting.
569 569
570 570 MAX_INITIALIZER_LINES = 30
571 571
572 572 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated
573 573 # at the bottom of the documentation of classes and structs. If set to YES the
574 574 # list will mention the files that were used to generate the documentation.
575 575
576 576 SHOW_USED_FILES = YES
577 577
578 578 # Set the SHOW_FILES tag to NO to disable the generation of the Files page.
579 579 # This will remove the Files entry from the Quick Index and from the
580 580 # Folder Tree View (if specified). The default is YES.
581 581
582 582 SHOW_FILES = YES
583 583
584 584 # Set the SHOW_NAMESPACES tag to NO to disable the generation of the
585 585 # Namespaces page. This will remove the Namespaces entry from the Quick Index
586 586 # and from the Folder Tree View (if specified). The default is YES.
587 587
588 588 SHOW_NAMESPACES = YES
589 589
590 590 # The FILE_VERSION_FILTER tag can be used to specify a program or script that
591 591 # doxygen should invoke to get the current version for each file (typically from
592 592 # the version control system). Doxygen will invoke the program by executing (via
593 593 # popen()) the command <command> <input-file>, where <command> is the value of
594 594 # the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
595 595 # provided by doxygen. Whatever the program writes to standard output
596 596 # is used as the file version. See the manual for examples.
597 597
598 598 FILE_VERSION_FILTER =
599 599
600 600 # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
601 601 # by doxygen. The layout file controls the global structure of the generated
602 602 # output files in an output format independent way. To create the layout file
603 603 # that represents doxygen's defaults, run doxygen with the -l option.
604 604 # You can optionally specify a file name after the option, if omitted
605 605 # DoxygenLayout.xml will be used as the name of the layout file.
606 606
607 607 LAYOUT_FILE =
608 608
609 609 # The CITE_BIB_FILES tag can be used to specify one or more bib files
610 610 # containing the references data. This must be a list of .bib files. The
611 611 # .bib extension is automatically appended if omitted. Using this command
612 612 # requires the bibtex tool to be installed. See also
613 613 # http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style
614 614 # of the bibliography can be controlled using LATEX_BIB_STYLE. To use this
615 615 # feature you need bibtex and perl available in the search path. Do not use
616 616 # file names with spaces, bibtex cannot handle them.
617 617
618 618 CITE_BIB_FILES =
619 619
620 620 #---------------------------------------------------------------------------
621 621 # configuration options related to warning and progress messages
622 622 #---------------------------------------------------------------------------
623 623
624 624 # The QUIET tag can be used to turn on/off the messages that are generated
625 625 # by doxygen. Possible values are YES and NO. If left blank NO is used.
626 626
627 627 QUIET = NO
628 628
629 629 # The WARNINGS tag can be used to turn on/off the warning messages that are
630 630 # generated by doxygen. Possible values are YES and NO. If left blank
631 631 # NO is used.
632 632
633 633 WARNINGS = YES
634 634
635 635 # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
636 636 # for undocumented members. If EXTRACT_ALL is set to YES then this flag will
637 637 # automatically be disabled.
638 638
639 639 WARN_IF_UNDOCUMENTED = YES
640 640
641 641 # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
642 642 # potential errors in the documentation, such as not documenting some
643 643 # parameters in a documented function, or documenting parameters that
644 644 # don't exist or using markup commands wrongly.
645 645
646 646 WARN_IF_DOC_ERROR = YES
647 647
648 648 # The WARN_NO_PARAMDOC option can be enabled to get warnings for
649 649 # functions that are documented, but have no documentation for their parameters
650 650 # or return value. If set to NO (the default) doxygen will only warn about
651 651 # wrong or incomplete parameter documentation, but not about the absence of
652 652 # documentation.
653 653
654 654 WARN_NO_PARAMDOC = NO
655 655
656 656 # The WARN_FORMAT tag determines the format of the warning messages that
657 657 # doxygen can produce. The string should contain the $file, $line, and $text
658 658 # tags, which will be replaced by the file and line number from which the
659 659 # warning originated and the warning text. Optionally the format may contain
660 660 # $version, which will be replaced by the version of the file (if it could
661 661 # be obtained via FILE_VERSION_FILTER)
662 662
663 663 WARN_FORMAT = "$file:$line: $text"
664 664
665 665 # The WARN_LOGFILE tag can be used to specify a file to which warning
666 666 # and error messages should be written. If left blank the output is written
667 667 # to stderr.
668 668
669 669 WARN_LOGFILE =
670 670
671 671 #---------------------------------------------------------------------------
672 672 # configuration options related to the input files
673 673 #---------------------------------------------------------------------------
674 674
675 675 # The INPUT tag can be used to specify the files and/or directories that contain
676 676 # documented source files. You may enter file names like "myfile.cpp" or
677 677 # directories like "/usr/src/myproject". Separate the files or directories
678 678 # with spaces.
679 679
680 680 INPUT = ../
681 681
682 682 # This tag can be used to specify the character encoding of the source files
683 683 # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
684 684 # also the default input encoding. Doxygen uses libiconv (or the iconv built
685 685 # into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
686 686 # the list of possible encodings.
687 687
688 688 INPUT_ENCODING = UTF-8
689 689
690 690 # If the value of the INPUT tag contains directories, you can use the
691 691 # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
692 692 # and *.h) to filter out the source-files in the directories. If left
693 693 # blank the following patterns are tested:
694 694 # *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
695 695 # *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
696 696 # *.f90 *.f *.for *.vhd *.vhdl
697 697
698 698 FILE_PATTERNS = *.c \
699 699 *.cc \
700 700 *.cxx \
701 701 *.cpp \
702 702 *.c++ \
703 703 *.d \
704 704 *.java \
705 705 *.ii \
706 706 *.ixx \
707 707 *.ipp \
708 708 *.i++ \
709 709 *.inl \
710 710 *.h \
711 711 *.hh \
712 712 *.hxx \
713 713 *.hpp \
714 714 *.h++ \
715 715 *.idl \
716 716 *.odl \
717 717 *.cs \
718 718 *.php \
719 719 *.php3 \
720 720 *.inc \
721 721 *.m \
722 722 *.markdown \
723 723 *.md \
724 724 *.mm \
725 725 *.dox \
726 726 *.py \
727 727 *.f90 \
728 728 *.f \
729 729 *.for \
730 730 *.vhd \
731 731 *.vhdl
732 732
733 733 # The RECURSIVE tag can be used to turn specify whether or not subdirectories
734 734 # should be searched for input files as well. Possible values are YES and NO.
735 735 # If left blank NO is used.
736 736
737 737 RECURSIVE = YES
738 738
739 739 # The EXCLUDE tag can be used to specify files and/or directories that should be
740 740 # excluded from the INPUT source files. This way you can easily exclude a
741 741 # subdirectory from a directory tree whose root is specified with the INPUT tag.
742 742 # Note that relative paths are relative to the directory from which doxygen is
743 743 # run.
744 744
745 745 EXCLUDE =
746 746
747 747 # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
748 748 # directories that are symbolic links (a Unix file system feature) are excluded
749 749 # from the input.
750 750
751 751 EXCLUDE_SYMLINKS = NO
752 752
753 753 # If the value of the INPUT tag contains directories, you can use the
754 754 # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
755 755 # certain files from those directories. Note that the wildcards are matched
756 756 # against the file with absolute path, so to exclude all test directories
757 757 # for example use the pattern */test/*
758 758
759 759 EXCLUDE_PATTERNS =
760 760
761 761 # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
762 762 # (namespaces, classes, functions, etc.) that should be excluded from the
763 763 # output. The symbol name can be a fully qualified name, a word, or if the
764 764 # wildcard * is used, a substring. Examples: ANamespace, AClass,
765 765 # AClass::ANamespace, ANamespace::*Test
766 766
767 767 EXCLUDE_SYMBOLS =
768 768
769 769 # The EXAMPLE_PATH tag can be used to specify one or more files or
770 770 # directories that contain example code fragments that are included (see
771 771 # the \include command).
772 772
773 773 EXAMPLE_PATH =
774 774
775 775 # If the value of the EXAMPLE_PATH tag contains directories, you can use the
776 776 # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
777 777 # and *.h) to filter out the source-files in the directories. If left
778 778 # blank all files are included.
779 779
780 780 EXAMPLE_PATTERNS = *
781 781
782 782 # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
783 783 # searched for input files to be used with the \include or \dontinclude
784 784 # commands irrespective of the value of the RECURSIVE tag.
785 785 # Possible values are YES and NO. If left blank NO is used.
786 786
787 787 EXAMPLE_RECURSIVE = NO
788 788
789 789 # The IMAGE_PATH tag can be used to specify one or more files or
790 790 # directories that contain image that are included in the documentation (see
791 791 # the \image command).
792 792
793 793 IMAGE_PATH =
794 794
795 795 # The INPUT_FILTER tag can be used to specify a program that doxygen should
796 796 # invoke to filter for each input file. Doxygen will invoke the filter program
797 797 # by executing (via popen()) the command <filter> <input-file>, where <filter>
798 798 # is the value of the INPUT_FILTER tag, and <input-file> is the name of an
799 799 # input file. Doxygen will then use the output that the filter program writes
800 800 # to standard output. If FILTER_PATTERNS is specified, this tag will be
801 801 # ignored.
802 802
803 803 INPUT_FILTER =
804 804
805 805 # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
806 806 # basis. Doxygen will compare the file name with each pattern and apply the
807 807 # filter if there is a match. The filters are a list of the form:
808 808 # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
809 809 # info on how filters are used. If FILTER_PATTERNS is empty or if
810 810 # non of the patterns match the file name, INPUT_FILTER is applied.
811 811
812 812 FILTER_PATTERNS =
813 813
814 814 # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
815 815 # INPUT_FILTER) will be used to filter the input files when producing source
816 816 # files to browse (i.e. when SOURCE_BROWSER is set to YES).
817 817
818 818 FILTER_SOURCE_FILES = NO
819 819
820 820 # The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
821 821 # pattern. A pattern will override the setting for FILTER_PATTERN (if any)
822 822 # and it is also possible to disable source filtering for a specific pattern
823 823 # using *.ext= (so without naming a filter). This option only has effect when
824 824 # FILTER_SOURCE_FILES is enabled.
825 825
826 826 FILTER_SOURCE_PATTERNS =
827 827
828 828 # If the USE_MD_FILE_AS_MAINPAGE tag refers to the name of a markdown file that
829 829 # is part of the input, its contents will be placed on the main page (index.html).
830 830 # This can be useful if you have a project on for instance GitHub and want reuse
831 831 # the introduction page also for the doxygen output.
832 832
833 833 USE_MDFILE_AS_MAINPAGE =
834 834
835 835 #---------------------------------------------------------------------------
836 836 # configuration options related to source browsing
837 837 #---------------------------------------------------------------------------
838 838
839 839 # If the SOURCE_BROWSER tag is set to YES then a list of source files will
840 840 # be generated. Documented entities will be cross-referenced with these sources.
841 841 # Note: To get rid of all source code in the generated output, make sure also
842 842 # VERBATIM_HEADERS is set to NO.
843 843
844 844 SOURCE_BROWSER = YES
845 845
846 846 # Setting the INLINE_SOURCES tag to YES will include the body
847 847 # of functions and classes directly in the documentation.
848 848
849 849 INLINE_SOURCES = NO
850 850
851 851 # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
852 852 # doxygen to hide any special comment blocks from generated source code
853 853 # fragments. Normal C, C++ and Fortran comments will always remain visible.
854 854
855 855 STRIP_CODE_COMMENTS = YES
856 856
857 857 # If the REFERENCED_BY_RELATION tag is set to YES
858 858 # then for each documented function all documented
859 859 # functions referencing it will be listed.
860 860
861 861 REFERENCED_BY_RELATION = NO
862 862
863 863 # If the REFERENCES_RELATION tag is set to YES
864 864 # then for each documented function all documented entities
865 865 # called/used by that function will be listed.
866 866
867 867 REFERENCES_RELATION = NO
868 868
869 869 # If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
870 870 # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
871 871 # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
872 872 # link to the source code. Otherwise they will link to the documentation.
873 873
874 874 REFERENCES_LINK_SOURCE = YES
875 875
876 876 # If the USE_HTAGS tag is set to YES then the references to source code
877 877 # will point to the HTML generated by the htags(1) tool instead of doxygen
878 878 # built-in source browser. The htags tool is part of GNU's global source
879 879 # tagging system (see http://www.gnu.org/software/global/global.html). You
880 880 # will need version 4.8.6 or higher.
881 881
882 882 USE_HTAGS = NO
883 883
884 884 # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
885 885 # will generate a verbatim copy of the header file for each class for
886 886 # which an include is specified. Set to NO to disable this.
887 887
888 888 VERBATIM_HEADERS = YES
889 889
890 890 #---------------------------------------------------------------------------
891 891 # configuration options related to the alphabetical class index
892 892 #---------------------------------------------------------------------------
893 893
894 894 # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
895 895 # of all compounds will be generated. Enable this if the project
896 896 # contains a lot of classes, structs, unions or interfaces.
897 897
898 898 ALPHABETICAL_INDEX = YES
899 899
900 900 # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
901 901 # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
902 902 # in which this list will be split (can be a number in the range [1..20])
903 903
904 904 COLS_IN_ALPHA_INDEX = 5
905 905
906 906 # In case all classes in a project start with a common prefix, all
907 907 # classes will be put under the same header in the alphabetical index.
908 908 # The IGNORE_PREFIX tag can be used to specify one or more prefixes that
909 909 # should be ignored while generating the index headers.
910 910
911 911 IGNORE_PREFIX =
912 912
913 913 #---------------------------------------------------------------------------
914 914 # configuration options related to the HTML output
915 915 #---------------------------------------------------------------------------
916 916
917 917 # If the GENERATE_HTML tag is set to YES (the default) Doxygen will
918 918 # generate HTML output.
919 919
920 920 GENERATE_HTML = YES
921 921
922 922 # The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
923 923 # If a relative path is entered the value of OUTPUT_DIRECTORY will be
924 924 # put in front of it. If left blank `html' will be used as the default path.
925 925
926 926 HTML_OUTPUT = html
927 927
928 928 # The HTML_FILE_EXTENSION tag can be used to specify the file extension for
929 929 # each generated HTML page (for example: .htm,.php,.asp). If it is left blank
930 930 # doxygen will generate files with .html extension.
931 931
932 932 HTML_FILE_EXTENSION = .html
933 933
934 934 # The HTML_HEADER tag can be used to specify a personal HTML header for
935 935 # each generated HTML page. If it is left blank doxygen will generate a
936 936 # standard header. Note that when using a custom header you are responsible
937 937 # for the proper inclusion of any scripts and style sheets that doxygen
938 938 # needs, which is dependent on the configuration options used.
939 939 # It is advised to generate a default header using "doxygen -w html
940 940 # header.html footer.html stylesheet.css YourConfigFile" and then modify
941 941 # that header. Note that the header is subject to change so you typically
942 942 # have to redo this when upgrading to a newer version of doxygen or when
943 943 # changing the value of configuration settings such as GENERATE_TREEVIEW!
944 944
945 945 HTML_HEADER =
946 946
947 947 # The HTML_FOOTER tag can be used to specify a personal HTML footer for
948 948 # each generated HTML page. If it is left blank doxygen will generate a
949 949 # standard footer.
950 950
951 951 HTML_FOOTER =
952 952
953 953 # The HTML_STYLESHEET tag can be used to specify a user-defined cascading
954 954 # style sheet that is used by each HTML page. It can be used to
955 955 # fine-tune the look of the HTML output. If left blank doxygen will
956 956 # generate a default style sheet. Note that it is recommended to use
957 957 # HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this
958 958 # tag will in the future become obsolete.
959 959
960 960 HTML_STYLESHEET =
961 961
962 962 # The HTML_EXTRA_STYLESHEET tag can be used to specify an additional
963 963 # user-defined cascading style sheet that is included after the standard
964 964 # style sheets created by doxygen. Using this option one can overrule
965 965 # certain style aspects. This is preferred over using HTML_STYLESHEET
966 966 # since it does not replace the standard style sheet and is therefor more
967 967 # robust against future updates. Doxygen will copy the style sheet file to
968 968 # the output directory.
969 969
970 970 HTML_EXTRA_STYLESHEET =
971 971
972 972 # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
973 973 # other source files which should be copied to the HTML output directory. Note
974 974 # that these files will be copied to the base HTML output directory. Use the
975 975 # $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
976 976 # files. In the HTML_STYLESHEET file, use the file name only. Also note that
977 977 # the files will be copied as-is; there are no commands or markers available.
978 978
979 979 HTML_EXTRA_FILES =
980 980
981 981 # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
982 982 # Doxygen will adjust the colors in the style sheet and background images
983 983 # according to this color. Hue is specified as an angle on a colorwheel,
984 984 # see http://en.wikipedia.org/wiki/Hue for more information.
985 985 # For instance the value 0 represents red, 60 is yellow, 120 is green,
986 986 # 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
987 987 # The allowed range is 0 to 359.
988 988
989 989 HTML_COLORSTYLE_HUE = 220
990 990
991 991 # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
992 992 # the colors in the HTML output. For a value of 0 the output will use
993 993 # grayscales only. A value of 255 will produce the most vivid colors.
994 994
995 995 HTML_COLORSTYLE_SAT = 100
996 996
997 997 # The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
998 998 # the luminance component of the colors in the HTML output. Values below
999 999 # 100 gradually make the output lighter, whereas values above 100 make
1000 1000 # the output darker. The value divided by 100 is the actual gamma applied,
1001 1001 # so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
1002 1002 # and 100 does not change the gamma.
1003 1003
1004 1004 HTML_COLORSTYLE_GAMMA = 80
1005 1005
1006 1006 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
1007 1007 # page will contain the date and time when the page was generated. Setting
1008 1008 # this to NO can help when comparing the output of multiple runs.
1009 1009
1010 1010 HTML_TIMESTAMP = YES
1011 1011
1012 1012 # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
1013 1013 # documentation will contain sections that can be hidden and shown after the
1014 1014 # page has loaded.
1015 1015
1016 1016 HTML_DYNAMIC_SECTIONS = NO
1017 1017
1018 1018 # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of
1019 1019 # entries shown in the various tree structured indices initially; the user
1020 1020 # can expand and collapse entries dynamically later on. Doxygen will expand
1021 1021 # the tree to such a level that at most the specified number of entries are
1022 1022 # visible (unless a fully collapsed tree already exceeds this amount).
1023 1023 # So setting the number of entries 1 will produce a full collapsed tree by
1024 1024 # default. 0 is a special value representing an infinite number of entries
1025 1025 # and will result in a full expanded tree by default.
1026 1026
1027 1027 HTML_INDEX_NUM_ENTRIES = 100
1028 1028
1029 1029 # If the GENERATE_DOCSET tag is set to YES, additional index files
1030 1030 # will be generated that can be used as input for Apple's Xcode 3
1031 1031 # integrated development environment, introduced with OSX 10.5 (Leopard).
1032 1032 # To create a documentation set, doxygen will generate a Makefile in the
1033 1033 # HTML output directory. Running make will produce the docset in that
1034 1034 # directory and running "make install" will install the docset in
1035 1035 # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
1036 1036 # it at startup.
1037 1037 # See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
1038 1038 # for more information.
1039 1039
1040 1040 GENERATE_DOCSET = NO
1041 1041
1042 1042 # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
1043 1043 # feed. A documentation feed provides an umbrella under which multiple
1044 1044 # documentation sets from a single provider (such as a company or product suite)
1045 1045 # can be grouped.
1046 1046
1047 1047 DOCSET_FEEDNAME = "Doxygen generated docs"
1048 1048
1049 1049 # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
1050 1050 # should uniquely identify the documentation set bundle. This should be a
1051 1051 # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
1052 1052 # will append .docset to the name.
1053 1053
1054 1054 DOCSET_BUNDLE_ID = org.doxygen.Project
1055 1055
1056 1056 # When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely
1057 1057 # identify the documentation publisher. This should be a reverse domain-name
1058 1058 # style string, e.g. com.mycompany.MyDocSet.documentation.
1059 1059
1060 1060 DOCSET_PUBLISHER_ID = org.doxygen.Publisher
1061 1061
1062 1062 # The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
1063 1063
1064 1064 DOCSET_PUBLISHER_NAME = Publisher
1065 1065
1066 1066 # If the GENERATE_HTMLHELP tag is set to YES, additional index files
1067 1067 # will be generated that can be used as input for tools like the
1068 1068 # Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
1069 1069 # of the generated HTML documentation.
1070 1070
1071 1071 GENERATE_HTMLHELP = NO
1072 1072
1073 1073 # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
1074 1074 # be used to specify the file name of the resulting .chm file. You
1075 1075 # can add a path in front of the file if the result should not be
1076 1076 # written to the html output directory.
1077 1077
1078 1078 CHM_FILE =
1079 1079
1080 1080 # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
1081 1081 # be used to specify the location (absolute path including file name) of
1082 1082 # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
1083 1083 # the HTML help compiler on the generated index.hhp.
1084 1084
1085 1085 HHC_LOCATION =
1086 1086
1087 1087 # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
1088 1088 # controls if a separate .chi index file is generated (YES) or that
1089 1089 # it should be included in the master .chm file (NO).
1090 1090
1091 1091 GENERATE_CHI = NO
1092 1092
1093 1093 # If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
1094 1094 # is used to encode HtmlHelp index (hhk), content (hhc) and project file
1095 1095 # content.
1096 1096
1097 1097 CHM_INDEX_ENCODING =
1098 1098
1099 1099 # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
1100 1100 # controls whether a binary table of contents is generated (YES) or a
1101 1101 # normal table of contents (NO) in the .chm file.
1102 1102
1103 1103 BINARY_TOC = NO
1104 1104
1105 1105 # The TOC_EXPAND flag can be set to YES to add extra items for group members
1106 1106 # to the contents of the HTML help documentation and to the tree view.
1107 1107
1108 1108 TOC_EXPAND = NO
1109 1109
1110 1110 # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
1111 1111 # QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
1112 1112 # that can be used as input for Qt's qhelpgenerator to generate a
1113 1113 # Qt Compressed Help (.qch) of the generated HTML documentation.
1114 1114
1115 1115 GENERATE_QHP = NO
1116 1116
1117 1117 # If the QHG_LOCATION tag is specified, the QCH_FILE tag can
1118 1118 # be used to specify the file name of the resulting .qch file.
1119 1119 # The path specified is relative to the HTML output folder.
1120 1120
1121 1121 QCH_FILE =
1122 1122
1123 1123 # The QHP_NAMESPACE tag specifies the namespace to use when generating
1124 1124 # Qt Help Project output. For more information please see
1125 1125 # http://doc.trolltech.com/qthelpproject.html#namespace
1126 1126
1127 1127 QHP_NAMESPACE = org.doxygen.Project
1128 1128
1129 1129 # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
1130 1130 # Qt Help Project output. For more information please see
1131 1131 # http://doc.trolltech.com/qthelpproject.html#virtual-folders
1132 1132
1133 1133 QHP_VIRTUAL_FOLDER = doc
1134 1134
1135 1135 # If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
1136 1136 # add. For more information please see
1137 1137 # http://doc.trolltech.com/qthelpproject.html#custom-filters
1138 1138
1139 1139 QHP_CUST_FILTER_NAME =
1140 1140
1141 1141 # The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
1142 1142 # custom filter to add. For more information please see
1143 1143 # <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
1144 1144 # Qt Help Project / Custom Filters</a>.
1145 1145
1146 1146 QHP_CUST_FILTER_ATTRS =
1147 1147
1148 1148 # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
1149 1149 # project's
1150 1150 # filter section matches.
1151 1151 # <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
1152 1152 # Qt Help Project / Filter Attributes</a>.
1153 1153
1154 1154 QHP_SECT_FILTER_ATTRS =
1155 1155
1156 1156 # If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
1157 1157 # be used to specify the location of Qt's qhelpgenerator.
1158 1158 # If non-empty doxygen will try to run qhelpgenerator on the generated
1159 1159 # .qhp file.
1160 1160
1161 1161 QHG_LOCATION =
1162 1162
1163 1163 # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
1164 1164 # will be generated, which together with the HTML files, form an Eclipse help
1165 1165 # plugin. To install this plugin and make it available under the help contents
1166 1166 # menu in Eclipse, the contents of the directory containing the HTML and XML
1167 1167 # files needs to be copied into the plugins directory of eclipse. The name of
1168 1168 # the directory within the plugins directory should be the same as
1169 1169 # the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
1170 1170 # the help appears.
1171 1171
1172 1172 GENERATE_ECLIPSEHELP = NO
1173 1173
1174 1174 # A unique identifier for the eclipse help plugin. When installing the plugin
1175 1175 # the directory name containing the HTML and XML files should also have
1176 1176 # this name.
1177 1177
1178 1178 ECLIPSE_DOC_ID = org.doxygen.Project
1179 1179
1180 1180 # The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs)
1181 1181 # at top of each HTML page. The value NO (the default) enables the index and
1182 1182 # the value YES disables it. Since the tabs have the same information as the
1183 1183 # navigation tree you can set this option to NO if you already set
1184 1184 # GENERATE_TREEVIEW to YES.
1185 1185
1186 1186 DISABLE_INDEX = NO
1187 1187
1188 1188 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
1189 1189 # structure should be generated to display hierarchical information.
1190 1190 # If the tag value is set to YES, a side panel will be generated
1191 1191 # containing a tree-like index structure (just like the one that
1192 1192 # is generated for HTML Help). For this to work a browser that supports
1193 1193 # JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
1194 1194 # Windows users are probably better off using the HTML help feature.
1195 1195 # Since the tree basically has the same information as the tab index you
1196 1196 # could consider to set DISABLE_INDEX to NO when enabling this option.
1197 1197
1198 1198 GENERATE_TREEVIEW = NO
1199 1199
1200 1200 # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
1201 1201 # (range [0,1..20]) that doxygen will group on one line in the generated HTML
1202 1202 # documentation. Note that a value of 0 will completely suppress the enum
1203 1203 # values from appearing in the overview section.
1204 1204
1205 1205 ENUM_VALUES_PER_LINE = 4
1206 1206
1207 1207 # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
1208 1208 # used to set the initial width (in pixels) of the frame in which the tree
1209 1209 # is shown.
1210 1210
1211 1211 TREEVIEW_WIDTH = 250
1212 1212
1213 1213 # When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
1214 1214 # links to external symbols imported via tag files in a separate window.
1215 1215
1216 1216 EXT_LINKS_IN_WINDOW = NO
1217 1217
1218 1218 # Use this tag to change the font size of Latex formulas included
1219 1219 # as images in the HTML documentation. The default is 10. Note that
1220 1220 # when you change the font size after a successful doxygen run you need
1221 1221 # to manually remove any form_*.png images from the HTML output directory
1222 1222 # to force them to be regenerated.
1223 1223
1224 1224 FORMULA_FONTSIZE = 10
1225 1225
1226 1226 # Use the FORMULA_TRANPARENT tag to determine whether or not the images
1227 1227 # generated for formulas are transparent PNGs. Transparent PNGs are
1228 1228 # not supported properly for IE 6.0, but are supported on all modern browsers.
1229 1229 # Note that when changing this option you need to delete any form_*.png files
1230 1230 # in the HTML output before the changes have effect.
1231 1231
1232 1232 FORMULA_TRANSPARENT = YES
1233 1233
1234 1234 # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax
1235 1235 # (see http://www.mathjax.org) which uses client side Javascript for the
1236 1236 # rendering instead of using prerendered bitmaps. Use this if you do not
1237 1237 # have LaTeX installed or if you want to formulas look prettier in the HTML
1238 1238 # output. When enabled you may also need to install MathJax separately and
1239 1239 # configure the path to it using the MATHJAX_RELPATH option.
1240 1240
1241 1241 USE_MATHJAX = NO
1242 1242
1243 1243 # When MathJax is enabled you can set the default output format to be used for
1244 1244 # thA MathJax output. Supported types are HTML-CSS, NativeMML (i.e. MathML) and
1245 1245 # SVG. The default value is HTML-CSS, which is slower, but has the best
1246 1246 # compatibility.
1247 1247
1248 1248 MATHJAX_FORMAT = HTML-CSS
1249 1249
1250 1250 # When MathJax is enabled you need to specify the location relative to the
1251 1251 # HTML output directory using the MATHJAX_RELPATH option. The destination
1252 1252 # directory should contain the MathJax.js script. For instance, if the mathjax
1253 1253 # directory is located at the same level as the HTML output directory, then
1254 1254 # MATHJAX_RELPATH should be ../mathjax. The default value points to
1255 1255 # the MathJax Content Delivery Network so you can quickly see the result without
1256 1256 # installing MathJax. However, it is strongly recommended to install a local
1257 1257 # copy of MathJax from http://www.mathjax.org before deployment.
1258 1258
1259 1259 MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
1260 1260
1261 1261 # The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
1262 1262 # names that should be enabled during MathJax rendering.
1263 1263
1264 1264 MATHJAX_EXTENSIONS =
1265 1265
1266 1266 # When the SEARCHENGINE tag is enabled doxygen will generate a search box
1267 1267 # for the HTML output. The underlying search engine uses javascript
1268 1268 # and DHTML and should work on any modern browser. Note that when using
1269 1269 # HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
1270 1270 # (GENERATE_DOCSET) there is already a search function so this one should
1271 1271 # typically be disabled. For large projects the javascript based search engine
1272 1272 # can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
1273 1273
1274 1274 SEARCHENGINE = YES
1275 1275
1276 1276 # When the SERVER_BASED_SEARCH tag is enabled the search engine will be
1277 1277 # implemented using a web server instead of a web client using Javascript.
1278 1278 # There are two flavours of web server based search depending on the
1279 1279 # EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for
1280 1280 # searching and an index file used by the script. When EXTERNAL_SEARCH is
1281 1281 # enabled the indexing and searching needs to be provided by external tools.
1282 1282 # See the manual for details.
1283 1283
1284 1284 SERVER_BASED_SEARCH = NO
1285 1285
1286 1286 # When EXTERNAL_SEARCH is enabled doxygen will no longer generate the PHP
1287 1287 # script for searching. Instead the search results are written to an XML file
1288 1288 # which needs to be processed by an external indexer. Doxygen will invoke an
1289 1289 # external search engine pointed to by the SEARCHENGINE_URL option to obtain
1290 1290 # the search results. Doxygen ships with an example indexer (doxyindexer) and
1291 1291 # search engine (doxysearch.cgi) which are based on the open source search engine
1292 1292 # library Xapian. See the manual for configuration details.
1293 1293
1294 1294 EXTERNAL_SEARCH = NO
1295 1295
1296 1296 # The SEARCHENGINE_URL should point to a search engine hosted by a web server
1297 1297 # which will returned the search results when EXTERNAL_SEARCH is enabled.
1298 1298 # Doxygen ships with an example search engine (doxysearch) which is based on
1299 1299 # the open source search engine library Xapian. See the manual for configuration
1300 1300 # details.
1301 1301
1302 1302 SEARCHENGINE_URL =
1303 1303
1304 1304 # When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
1305 1305 # search data is written to a file for indexing by an external tool. With the
1306 1306 # SEARCHDATA_FILE tag the name of this file can be specified.
1307 1307
1308 1308 SEARCHDATA_FILE = searchdata.xml
1309 1309
1310 1310 # When SERVER_BASED_SEARCH AND EXTERNAL_SEARCH are both enabled the
1311 1311 # EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
1312 1312 # useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
1313 1313 # projects and redirect the results back to the right project.
1314 1314
1315 1315 EXTERNAL_SEARCH_ID =
1316 1316
1317 1317 # The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
1318 1318 # projects other than the one defined by this configuration file, but that are
1319 1319 # all added to the same external search index. Each project needs to have a
1320 1320 # unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id
1321 1321 # of to a relative location where the documentation can be found.
1322 1322 # The format is: EXTRA_SEARCH_MAPPINGS = id1=loc1 id2=loc2 ...
1323 1323
1324 1324 EXTRA_SEARCH_MAPPINGS =
1325 1325
1326 1326 #---------------------------------------------------------------------------
1327 1327 # configuration options related to the LaTeX output
1328 1328 #---------------------------------------------------------------------------
1329 1329
1330 1330 # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
1331 1331 # generate Latex output.
1332 1332
1333 1333 GENERATE_LATEX = NO
1334 1334
1335 1335 # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
1336 1336 # If a relative path is entered the value of OUTPUT_DIRECTORY will be
1337 1337 # put in front of it. If left blank `latex' will be used as the default path.
1338 1338
1339 1339 LATEX_OUTPUT = latex
1340 1340
1341 1341 # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
1342 1342 # invoked. If left blank `latex' will be used as the default command name.
1343 1343 # Note that when enabling USE_PDFLATEX this option is only used for
1344 1344 # generating bitmaps for formulas in the HTML output, but not in the
1345 1345 # Makefile that is written to the output directory.
1346 1346
1347 1347 LATEX_CMD_NAME = latex
1348 1348
1349 1349 # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
1350 1350 # generate index for LaTeX. If left blank `makeindex' will be used as the
1351 1351 # default command name.
1352 1352
1353 1353 MAKEINDEX_CMD_NAME = makeindex
1354 1354
1355 1355 # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
1356 1356 # LaTeX documents. This may be useful for small projects and may help to
1357 1357 # save some trees in general.
1358 1358
1359 1359 COMPACT_LATEX = NO
1360 1360
1361 1361 # The PAPER_TYPE tag can be used to set the paper type that is used
1362 1362 # by the printer. Possible values are: a4, letter, legal and
1363 1363 # executive. If left blank a4wide will be used.
1364 1364
1365 1365 PAPER_TYPE = a4
1366 1366
1367 1367 # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
1368 1368 # packages that should be included in the LaTeX output.
1369 1369
1370 1370 EXTRA_PACKAGES =
1371 1371
1372 1372 # The LATEX_HEADER tag can be used to specify a personal LaTeX header for
1373 1373 # the generated latex document. The header should contain everything until
1374 1374 # the first chapter. If it is left blank doxygen will generate a
1375 1375 # standard header. Notice: only use this tag if you know what you are doing!
1376 1376
1377 1377 LATEX_HEADER =
1378 1378
1379 1379 # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
1380 1380 # the generated latex document. The footer should contain everything after
1381 1381 # the last chapter. If it is left blank doxygen will generate a
1382 1382 # standard footer. Notice: only use this tag if you know what you are doing!
1383 1383
1384 1384 LATEX_FOOTER =
1385 1385
1386 1386 # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
1387 1387 # is prepared for conversion to pdf (using ps2pdf). The pdf file will
1388 1388 # contain links (just like the HTML output) instead of page references
1389 1389 # This makes the output suitable for online browsing using a pdf viewer.
1390 1390
1391 1391 PDF_HYPERLINKS = YES
1392 1392
1393 1393 # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
1394 1394 # plain latex in the generated Makefile. Set this option to YES to get a
1395 1395 # higher quality PDF documentation.
1396 1396
1397 1397 USE_PDFLATEX = YES
1398 1398
1399 1399 # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
1400 1400 # command to the generated LaTeX files. This will instruct LaTeX to keep
1401 1401 # running if errors occur, instead of asking the user for help.
1402 1402 # This option is also used when generating formulas in HTML.
1403 1403
1404 1404 LATEX_BATCHMODE = NO
1405 1405
1406 1406 # If LATEX_HIDE_INDICES is set to YES then doxygen will not
1407 1407 # include the index chapters (such as File Index, Compound Index, etc.)
1408 1408 # in the output.
1409 1409
1410 1410 LATEX_HIDE_INDICES = NO
1411 1411
1412 1412 # If LATEX_SOURCE_CODE is set to YES then doxygen will include
1413 1413 # source code with syntax highlighting in the LaTeX output.
1414 1414 # Note that which sources are shown also depends on other settings
1415 1415 # such as SOURCE_BROWSER.
1416 1416
1417 1417 LATEX_SOURCE_CODE = NO
1418 1418
1419 1419 # The LATEX_BIB_STYLE tag can be used to specify the style to use for the
1420 1420 # bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See
1421 1421 # http://en.wikipedia.org/wiki/BibTeX for more info.
1422 1422
1423 1423 LATEX_BIB_STYLE = plain
1424 1424
1425 1425 #---------------------------------------------------------------------------
1426 1426 # configuration options related to the RTF output
1427 1427 #---------------------------------------------------------------------------
1428 1428
1429 1429 # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
1430 1430 # The RTF output is optimized for Word 97 and may not look very pretty with
1431 1431 # other RTF readers or editors.
1432 1432
1433 1433 GENERATE_RTF = NO
1434 1434
1435 1435 # The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
1436 1436 # If a relative path is entered the value of OUTPUT_DIRECTORY will be
1437 1437 # put in front of it. If left blank `rtf' will be used as the default path.
1438 1438
1439 1439 RTF_OUTPUT = rtf
1440 1440
1441 1441 # If the COMPACT_RTF tag is set to YES Doxygen generates more compact
1442 1442 # RTF documents. This may be useful for small projects and may help to
1443 1443 # save some trees in general.
1444 1444
1445 1445 COMPACT_RTF = NO
1446 1446
1447 1447 # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
1448 1448 # will contain hyperlink fields. The RTF file will
1449 1449 # contain links (just like the HTML output) instead of page references.
1450 1450 # This makes the output suitable for online browsing using WORD or other
1451 1451 # programs which support those fields.
1452 1452 # Note: wordpad (write) and others do not support links.
1453 1453
1454 1454 RTF_HYPERLINKS = NO
1455 1455
1456 1456 # Load style sheet definitions from file. Syntax is similar to doxygen's
1457 1457 # config file, i.e. a series of assignments. You only have to provide
1458 1458 # replacements, missing definitions are set to their default value.
1459 1459
1460 1460 RTF_STYLESHEET_FILE =
1461 1461
1462 1462 # Set optional variables used in the generation of an rtf document.
1463 1463 # Syntax is similar to doxygen's config file.
1464 1464
1465 1465 RTF_EXTENSIONS_FILE =
1466 1466
1467 1467 #---------------------------------------------------------------------------
1468 1468 # configuration options related to the man page output
1469 1469 #---------------------------------------------------------------------------
1470 1470
1471 1471 # If the GENERATE_MAN tag is set to YES (the default) Doxygen will
1472 1472 # generate man pages
1473 1473
1474 1474 GENERATE_MAN = NO
1475 1475
1476 1476 # The MAN_OUTPUT tag is used to specify where the man pages will be put.
1477 1477 # If a relative path is entered the value of OUTPUT_DIRECTORY will be
1478 1478 # put in front of it. If left blank `man' will be used as the default path.
1479 1479
1480 1480 MAN_OUTPUT = man
1481 1481
1482 1482 # The MAN_EXTENSION tag determines the extension that is added to
1483 1483 # the generated man pages (default is the subroutine's section .3)
1484 1484
1485 1485 MAN_EXTENSION = .3
1486 1486
1487 1487 # If the MAN_LINKS tag is set to YES and Doxygen generates man output,
1488 1488 # then it will generate one additional man file for each entity
1489 1489 # documented in the real man page(s). These additional files
1490 1490 # only source the real man page, but without them the man command
1491 1491 # would be unable to find the correct page. The default is NO.
1492 1492
1493 1493 MAN_LINKS = NO
1494 1494
1495 1495 #---------------------------------------------------------------------------
1496 1496 # configuration options related to the XML output
1497 1497 #---------------------------------------------------------------------------
1498 1498
1499 1499 # If the GENERATE_XML tag is set to YES Doxygen will
1500 1500 # generate an XML file that captures the structure of
1501 1501 # the code including all documentation.
1502 1502
1503 1503 GENERATE_XML = NO
1504 1504
1505 1505 # The XML_OUTPUT tag is used to specify where the XML pages will be put.
1506 1506 # If a relative path is entered the value of OUTPUT_DIRECTORY will be
1507 1507 # put in front of it. If left blank `xml' will be used as the default path.
1508 1508
1509 1509 XML_OUTPUT = xml
1510 1510
1511 1511 # The XML_SCHEMA tag can be used to specify an XML schema,
1512 1512 # which can be used by a validating XML parser to check the
1513 1513 # syntax of the XML files.
1514 1514
1515 1515 XML_SCHEMA =
1516 1516
1517 1517 # The XML_DTD tag can be used to specify an XML DTD,
1518 1518 # which can be used by a validating XML parser to check the
1519 1519 # syntax of the XML files.
1520 1520
1521 1521 XML_DTD =
1522 1522
1523 1523 # If the XML_PROGRAMLISTING tag is set to YES Doxygen will
1524 1524 # dump the program listings (including syntax highlighting
1525 1525 # and cross-referencing information) to the XML output. Note that
1526 1526 # enabling this will significantly increase the size of the XML output.
1527 1527
1528 1528 XML_PROGRAMLISTING = YES
1529 1529
1530 1530 #---------------------------------------------------------------------------
1531 1531 # configuration options for the AutoGen Definitions output
1532 1532 #---------------------------------------------------------------------------
1533 1533
1534 1534 # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
1535 1535 # generate an AutoGen Definitions (see autogen.sf.net) file
1536 1536 # that captures the structure of the code including all
1537 1537 # documentation. Note that this feature is still experimental
1538 1538 # and incomplete at the moment.
1539 1539
1540 1540 GENERATE_AUTOGEN_DEF = NO
1541 1541
1542 1542 #---------------------------------------------------------------------------
1543 1543 # configuration options related to the Perl module output
1544 1544 #---------------------------------------------------------------------------
1545 1545
1546 1546 # If the GENERATE_PERLMOD tag is set to YES Doxygen will
1547 1547 # generate a Perl module file that captures the structure of
1548 1548 # the code including all documentation. Note that this
1549 1549 # feature is still experimental and incomplete at the
1550 1550 # moment.
1551 1551
1552 1552 GENERATE_PERLMOD = NO
1553 1553
1554 1554 # If the PERLMOD_LATEX tag is set to YES Doxygen will generate
1555 1555 # the necessary Makefile rules, Perl scripts and LaTeX code to be able
1556 1556 # to generate PDF and DVI output from the Perl module output.
1557 1557
1558 1558 PERLMOD_LATEX = NO
1559 1559
1560 1560 # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
1561 1561 # nicely formatted so it can be parsed by a human reader. This is useful
1562 1562 # if you want to understand what is going on. On the other hand, if this
1563 1563 # tag is set to NO the size of the Perl module output will be much smaller
1564 1564 # and Perl will parse it just the same.
1565 1565
1566 1566 PERLMOD_PRETTY = YES
1567 1567
1568 1568 # The names of the make variables in the generated doxyrules.make file
1569 1569 # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
1570 1570 # This is useful so different doxyrules.make files included by the same
1571 1571 # Makefile don't overwrite each other's variables.
1572 1572
1573 1573 PERLMOD_MAKEVAR_PREFIX =
1574 1574
1575 1575 #---------------------------------------------------------------------------
1576 1576 # Configuration options related to the preprocessor
1577 1577 #---------------------------------------------------------------------------
1578 1578
1579 1579 # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
1580 1580 # evaluate all C-preprocessor directives found in the sources and include
1581 1581 # files.
1582 1582
1583 1583 ENABLE_PREPROCESSING = YES
1584 1584
1585 1585 # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
1586 1586 # names in the source code. If set to NO (the default) only conditional
1587 1587 # compilation will be performed. Macro expansion can be done in a controlled
1588 1588 # way by setting EXPAND_ONLY_PREDEF to YES.
1589 1589
1590 1590 MACRO_EXPANSION = NO
1591 1591
1592 1592 # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
1593 1593 # then the macro expansion is limited to the macros specified with the
1594 1594 # PREDEFINED and EXPAND_AS_DEFINED tags.
1595 1595
1596 1596 EXPAND_ONLY_PREDEF = NO
1597 1597
1598 1598 # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
1599 1599 # pointed to by INCLUDE_PATH will be searched when a #include is found.
1600 1600
1601 1601 SEARCH_INCLUDES = YES
1602 1602
1603 1603 # The INCLUDE_PATH tag can be used to specify one or more directories that
1604 1604 # contain include files that are not input files but should be processed by
1605 1605 # the preprocessor.
1606 1606
1607 1607 INCLUDE_PATH =
1608 1608
1609 1609 # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
1610 1610 # patterns (like *.h and *.hpp) to filter out the header-files in the
1611 1611 # directories. If left blank, the patterns specified with FILE_PATTERNS will
1612 1612 # be used.
1613 1613
1614 1614 INCLUDE_FILE_PATTERNS =
1615 1615
1616 1616 # The PREDEFINED tag can be used to specify one or more macro names that
1617 1617 # are defined before the preprocessor is started (similar to the -D option of
1618 1618 # gcc). The argument of the tag is a list of macros of the form: name
1619 1619 # or name=definition (no spaces). If the definition and the = are
1620 1620 # omitted =1 is assumed. To prevent a macro definition from being
1621 1621 # undefined via #undef or recursively expanded use the := operator
1622 1622 # instead of the = operator.
1623 1623
1624 1624 PREDEFINED =
1625 1625
1626 1626 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
1627 1627 # this tag can be used to specify a list of macro names that should be expanded.
1628 1628 # The macro definition that is found in the sources will be used.
1629 1629 # Use the PREDEFINED tag if you want to use a different macro definition that
1630 1630 # overrules the definition found in the source code.
1631 1631
1632 1632 EXPAND_AS_DEFINED =
1633 1633
1634 1634 # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
1635 1635 # doxygen's preprocessor will remove all references to function-like macros
1636 1636 # that are alone on a line, have an all uppercase name, and do not end with a
1637 1637 # semicolon, because these will confuse the parser if not removed.
1638 1638
1639 1639 SKIP_FUNCTION_MACROS = YES
1640 1640
1641 1641 #---------------------------------------------------------------------------
1642 1642 # Configuration::additions related to external references
1643 1643 #---------------------------------------------------------------------------
1644 1644
1645 1645 # The TAGFILES option can be used to specify one or more tagfiles. For each
1646 1646 # tag file the location of the external documentation should be added. The
1647 1647 # format of a tag file without this location is as follows:
1648 1648 # TAGFILES = file1 file2 ...
1649 1649 # Adding location for the tag files is done as follows:
1650 1650 # TAGFILES = file1=loc1 "file2 = loc2" ...
1651 1651 # where "loc1" and "loc2" can be relative or absolute paths
1652 1652 # or URLs. Note that each tag file must have a unique name (where the name does
1653 1653 # NOT include the path). If a tag file is not located in the directory in which
1654 1654 # doxygen is run, you must also specify the path to the tagfile here.
1655 1655
1656 1656 TAGFILES =
1657 1657
1658 1658 # When a file name is specified after GENERATE_TAGFILE, doxygen will create
1659 1659 # a tag file that is based on the input files it reads.
1660 1660
1661 1661 GENERATE_TAGFILE =
1662 1662
1663 1663 # If the ALLEXTERNALS tag is set to YES all external classes will be listed
1664 1664 # in the class index. If set to NO only the inherited external classes
1665 1665 # will be listed.
1666 1666
1667 1667 ALLEXTERNALS = NO
1668 1668
1669 1669 # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
1670 1670 # in the modules index. If set to NO, only the current project's groups will
1671 1671 # be listed.
1672 1672
1673 1673 EXTERNAL_GROUPS = YES
1674 1674
1675 1675 # The PERL_PATH should be the absolute path and name of the perl script
1676 1676 # interpreter (i.e. the result of `which perl').
1677 1677
1678 1678 PERL_PATH = /usr/bin/perl
1679 1679
1680 1680 #---------------------------------------------------------------------------
1681 1681 # Configuration options related to the dot tool
1682 1682 #---------------------------------------------------------------------------
1683 1683
1684 1684 # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
1685 1685 # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
1686 1686 # or super classes. Setting the tag to NO turns the diagrams off. Note that
1687 1687 # this option also works with HAVE_DOT disabled, but it is recommended to
1688 1688 # install and use dot, since it yields more powerful graphs.
1689 1689
1690 1690 CLASS_DIAGRAMS = NO
1691 1691
1692 1692 # You can define message sequence charts within doxygen comments using the \msc
1693 1693 # command. Doxygen will then run the mscgen tool (see
1694 1694 # http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
1695 1695 # documentation. The MSCGEN_PATH tag allows you to specify the directory where
1696 1696 # the mscgen tool resides. If left empty the tool is assumed to be found in the
1697 1697 # default search path.
1698 1698
1699 1699 MSCGEN_PATH =
1700 1700
1701 1701 # If set to YES, the inheritance and collaboration graphs will hide
1702 1702 # inheritance and usage relations if the target is undocumented
1703 1703 # or is not a class.
1704 1704
1705 1705 HIDE_UNDOC_RELATIONS = YES
1706 1706
1707 1707 # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
1708 1708 # available from the path. This tool is part of Graphviz, a graph visualization
1709 1709 # toolkit from AT&T and Lucent Bell Labs. The other options in this section
1710 1710 # have no effect if this option is set to NO (the default)
1711 1711
1712 1712 HAVE_DOT = YES
1713 1713
1714 1714 # The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
1715 1715 # allowed to run in parallel. When set to 0 (the default) doxygen will
1716 1716 # base this on the number of processors available in the system. You can set it
1717 1717 # explicitly to a value larger than 0 to get control over the balance
1718 1718 # between CPU load and processing speed.
1719 1719
1720 1720 DOT_NUM_THREADS = 4
1721 1721
1722 1722 # By default doxygen will use the Helvetica font for all dot files that
1723 1723 # doxygen generates. When you want a differently looking font you can specify
1724 1724 # the font name using DOT_FONTNAME. You need to make sure dot is able to find
1725 1725 # the font, which can be done by putting it in a standard location or by setting
1726 1726 # the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
1727 1727 # directory containing the font.
1728 1728
1729 1729 DOT_FONTNAME = Helvetica
1730 1730
1731 1731 # The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
1732 1732 # The default size is 10pt.
1733 1733
1734 1734 DOT_FONTSIZE = 10
1735 1735
1736 1736 # By default doxygen will tell dot to use the Helvetica font.
1737 1737 # If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to
1738 1738 # set the path where dot can find it.
1739 1739
1740 1740 DOT_FONTPATH =
1741 1741
1742 1742 # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
1743 1743 # will generate a graph for each documented class showing the direct and
1744 1744 # indirect inheritance relations. Setting this tag to YES will force the
1745 1745 # CLASS_DIAGRAMS tag to NO.
1746 1746
1747 1747 CLASS_GRAPH = NO
1748 1748
1749 1749 # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
1750 1750 # will generate a graph for each documented class showing the direct and
1751 1751 # indirect implementation dependencies (inheritance, containment, and
1752 1752 # class references variables) of the class with other documented classes.
1753 1753
1754 1754 COLLABORATION_GRAPH = YES
1755 1755
1756 1756 # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
1757 1757 # will generate a graph for groups, showing the direct groups dependencies
1758 1758
1759 1759 GROUP_GRAPHS = YES
1760 1760
1761 1761 # If the UML_LOOK tag is set to YES doxygen will generate inheritance and
1762 1762 # collaboration diagrams in a style similar to the OMG's Unified Modeling
1763 1763 # Language.
1764 1764
1765 1765 UML_LOOK = NO
1766 1766
1767 1767 # If the UML_LOOK tag is enabled, the fields and methods are shown inside
1768 1768 # the class node. If there are many fields or methods and many nodes the
1769 1769 # graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS
1770 1770 # threshold limits the number of items for each type to make the size more
1771 1771 # managable. Set this to 0 for no limit. Note that the threshold may be
1772 1772 # exceeded by 50% before the limit is enforced.
1773 1773
1774 1774 UML_LIMIT_NUM_FIELDS = 10
1775 1775
1776 1776 # If set to YES, the inheritance and collaboration graphs will show the
1777 1777 # relations between templates and their instances.
1778 1778
1779 1779 TEMPLATE_RELATIONS = NO
1780 1780
1781 1781 # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
1782 1782 # tags are set to YES then doxygen will generate a graph for each documented
1783 1783 # file showing the direct and indirect include dependencies of the file with
1784 1784 # other documented files.
1785 1785
1786 1786 INCLUDE_GRAPH = YES
1787 1787
1788 1788 # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
1789 1789 # HAVE_DOT tags are set to YES then doxygen will generate a graph for each
1790 1790 # documented header file showing the documented files that directly or
1791 1791 # indirectly include this file.
1792 1792
1793 1793 INCLUDED_BY_GRAPH = YES
1794 1794
1795 1795 # If the CALL_GRAPH and HAVE_DOT options are set to YES then
1796 1796 # doxygen will generate a call dependency graph for every global function
1797 1797 # or class method. Note that enabling this option will significantly increase
1798 1798 # the time of a run. So in most cases it will be better to enable call graphs
1799 1799 # for selected functions only using the \callgraph command.
1800 1800
1801 1801 CALL_GRAPH = YES
1802 1802
1803 1803 # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
1804 1804 # doxygen will generate a caller dependency graph for every global function
1805 1805 # or class method. Note that enabling this option will significantly increase
1806 1806 # the time of a run. So in most cases it will be better to enable caller
1807 1807 # graphs for selected functions only using the \callergraph command.
1808 1808
1809 CALLER_GRAPH = NO
1809 CALLER_GRAPH = YES
1810 1810
1811 1811 # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
1812 1812 # will generate a graphical hierarchy of all classes instead of a textual one.
1813 1813
1814 1814 GRAPHICAL_HIERARCHY = YES
1815 1815
1816 1816 # If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES
1817 1817 # then doxygen will show the dependencies a directory has on other directories
1818 1818 # in a graphical way. The dependency relations are determined by the #include
1819 1819 # relations between the files in the directories.
1820 1820
1821 1821 DIRECTORY_GRAPH = YES
1822 1822
1823 1823 # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
1824 1824 # generated by dot. Possible values are svg, png, jpg, or gif.
1825 1825 # If left blank png will be used. If you choose svg you need to set
1826 1826 # HTML_FILE_EXTENSION to xhtml in order to make the SVG files
1827 1827 # visible in IE 9+ (other browsers do not have this requirement).
1828 1828
1829 1829 DOT_IMAGE_FORMAT = png
1830 1830
1831 1831 # If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
1832 1832 # enable generation of interactive SVG images that allow zooming and panning.
1833 1833 # Note that this requires a modern browser other than Internet Explorer.
1834 1834 # Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you
1835 1835 # need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
1836 1836 # visible. Older versions of IE do not have SVG support.
1837 1837
1838 1838 INTERACTIVE_SVG = YES
1839 1839
1840 1840 # The tag DOT_PATH can be used to specify the path where the dot tool can be
1841 1841 # found. If left blank, it is assumed the dot tool can be found in the path.
1842 1842
1843 1843 DOT_PATH =
1844 1844
1845 1845 # The DOTFILE_DIRS tag can be used to specify one or more directories that
1846 1846 # contain dot files that are included in the documentation (see the
1847 1847 # \dotfile command).
1848 1848
1849 1849 DOTFILE_DIRS =
1850 1850
1851 1851 # The MSCFILE_DIRS tag can be used to specify one or more directories that
1852 1852 # contain msc files that are included in the documentation (see the
1853 1853 # \mscfile command).
1854 1854
1855 1855 MSCFILE_DIRS =
1856 1856
1857 1857 # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
1858 1858 # nodes that will be shown in the graph. If the number of nodes in a graph
1859 1859 # becomes larger than this value, doxygen will truncate the graph, which is
1860 1860 # visualized by representing a node as a red box. Note that doxygen if the
1861 1861 # number of direct children of the root node in a graph is already larger than
1862 1862 # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
1863 1863 # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
1864 1864
1865 1865 DOT_GRAPH_MAX_NODES = 50
1866 1866
1867 1867 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
1868 1868 # graphs generated by dot. A depth value of 3 means that only nodes reachable
1869 1869 # from the root by following a path via at most 3 edges will be shown. Nodes
1870 1870 # that lay further from the root node will be omitted. Note that setting this
1871 1871 # option to 1 or 2 may greatly reduce the computation time needed for large
1872 1872 # code bases. Also note that the size of a graph can be further restricted by
1873 1873 # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
1874 1874
1875 1875 MAX_DOT_GRAPH_DEPTH = 0
1876 1876
1877 1877 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
1878 1878 # background. This is disabled by default, because dot on Windows does not
1879 1879 # seem to support this out of the box. Warning: Depending on the platform used,
1880 1880 # enabling this option may lead to badly anti-aliased labels on the edges of
1881 1881 # a graph (i.e. they become hard to read).
1882 1882
1883 1883 DOT_TRANSPARENT = NO
1884 1884
1885 1885 # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
1886 1886 # files in one run (i.e. multiple -o and -T options on the command line). This
1887 1887 # makes dot run faster, but since only newer versions of dot (>1.8.10)
1888 1888 # support this, this feature is disabled by default.
1889 1889
1890 1890 DOT_MULTI_TARGETS = NO
1891 1891
1892 1892 # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
1893 1893 # generate a legend page explaining the meaning of the various boxes and
1894 1894 # arrows in the dot generated graphs.
1895 1895
1896 1896 GENERATE_LEGEND = YES
1897 1897
1898 1898 # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
1899 1899 # remove the intermediate dot files that are used to generate
1900 1900 # the various graphs.
1901 1901
1902 1902 DOT_CLEANUP = YES
@@ -1,627 +1,627
1 #ifndef CCSDS_H_INCLUDED
2 #define CCSDS_H_INCLUDED
1 #ifndef CCSDS_TYPES_H_INCLUDED
2 #define CCSDS_TYPES_H_INCLUDED
3 3
4 4 #define CCSDS_PROTOCOLE_EXTRA_BYTES 4
5 5 #define CCSDS_TELEMETRY_HEADER_LENGTH 16+4
6 6 #define CCSDS_TM_PKT_MAX_SIZE 4412
7 7 #define CCSDS_TELECOMMAND_HEADER_LENGTH 10+4
8 8 #define CCSDS_TC_PKT_MAX_SIZE 256
9 9 #define CCSDS_TC_PKT_MIN_SIZE 16
10 10 #define CCSDS_TC_TM_PACKET_OFFSET 7
11 11 #define CCSDS_PROCESS_ID 76
12 12 #define CCSDS_PACKET_CATEGORY 12
13 13 #define CCSDS_NODE_ADDRESS 0xfe
14 14 #define CCSDS_USER_APP 0x00
15 15
16 16 #define DEFAULT_SPARE1_PUSVERSION_SPARE2 0x10
17 17 #define DEFAULT_RESERVED 0x00
18 18 #define DEFAULT_HKBIA 0x1e // 0001 1110
19 19
20 20 // PACKET ID
21 21 #define TM_PACKET_ID_TC_EXE 0x0cc1 // PID 76 CAT 1
22 22 #define TM_PACKET_ID_HK 0x0cc4 // PID 76 CAT 4
23 23 #define TM_PACKET_ID_PARAMETER_DUMP 0x0cc9 // PID 76 CAT 9
24 24 #define TM_PACKET_ID_SCIENCE_NORMAL_BURST 0x0ccc // PID 76 CAT 12
25 25 #define TM_PACKET_ID_SCIENCE_SBM1_SBM2 0x0cfc // PID 79 CAT 12
26 26 #define TM_PACKET_PID_DEFAULT 76
27 27 #define TM_PACKET_PID_BURST_SBM1_SBM2 79
28 28 #define TM_PACKET_CAT_TC_EXE 1
29 29 #define TM_PACKET_CAT_HK 4
30 30 #define TM_PACKET_CAT_PARAMETER_DUMP 9
31 31 #define TM_PACKET_CAT_SCIENCE 12
32 32
33 33 // PACKET SEQUENCE CONTROL
34 34 #define TM_PACKET_SEQ_CTRL_CONTINUATION 0x00 // [0000 0000]
35 35 #define TM_PACKET_SEQ_CTRL_FIRST 0x40 // [0100 0000]
36 36 #define TM_PACKET_SEQ_CTRL_LAST 0x80 // [1000 0000]
37 37 #define TM_PACKET_SEQ_CTRL_STANDALONE 0xc0 // [1100 0000]
38 38 #define TM_PACKET_SEQ_CNT_DEFAULT 0x00 // [0000 0000]
39 39
40 40 // DESTINATION ID
41 41 #define TM_DESTINATION_ID_GROUND 0
42 42 #define TM_DESTINATION_ID_MISSION_TIMELINE 110
43 43 #define TM_DESTINATION_ID_TC_SEQUENCES 111
44 44 #define TM_DESTINATION_ID_RECOVERY_ACTION_COMMAND 112
45 45 #define TM_DESTINATION_ID_BACKUP_MISSION_TIMELINE 113
46 46 #define TM_DESTINATION_ID_DIRECT_CMD 120
47 47 #define TM_DESTINATION_ID_SPARE_GRD_SRC1 121
48 48 #define TM_DESTINATION_ID_SPARE_GRD_SRC2 122
49 49 #define TM_DESTINATION_ID_OBCP 15
50 50 #define TM_DESTINATION_ID_SYSTEM_CONTROL 14
51 51 #define TM_DESTINATION_ID_AOCS 11
52 52
53 53 #define CCSDS_DESTINATION_ID 0x01
54 54 #define CCSDS_PROTOCOLE_ID 0x02
55 55 #define CCSDS_RESERVED 0x00
56 56 #define CCSDS_USER_APP 0x00
57 57
58 58 #define SIZE_TM_LFR_TC_EXE_NOT_IMPLEMENTED 24
59 59 #define SIZE_TM_LFR_TC_EXE_CORRUPTED 32
60 60 #define SIZE_HK_PARAMETERS 112
61 61
62 62 // TC TYPES
63 63 #define TC_TYPE_GEN 181
64 64 #define TC_TYPE_TIME 9
65 65
66 66 // TC SUBTYPES
67 67 #define TC_SUBTYPE_RESET 1
68 68 #define TC_SUBTYPE_LOAD_COMM 11
69 69 #define TC_SUBTYPE_LOAD_NORM 13
70 70 #define TC_SUBTYPE_LOAD_BURST 19
71 71 #define TC_SUBTYPE_LOAD_SBM1 25
72 72 #define TC_SUBTYPE_LOAD_SBM2 27
73 73 #define TC_SUBTYPE_DUMP 31
74 74 #define TC_SUBTYPE_ENTER 41
75 75 #define TC_SUBTYPE_UPDT_INFO 51
76 76 #define TC_SUBTYPE_EN_CAL 61
77 77 #define TC_SUBTYPE_DIS_CAL 63
78 78 #define TC_SUBTYPE_UPDT_TIME 129
79 79
80 80 // TC LEN
81 81 #define TC_LEN_RESET 12
82 82 #define TC_LEN_LOAD_COMM 14
83 83 #define TC_LEN_LOAD_NORM 20
84 84 #define TC_LEN_LOAD_BURST 14
85 85 #define TC_LEN_LOAD_SBM1 14
86 86 #define TC_LEN_LOAD_SBM2 14
87 87 #define TC_LEN_DUMP 12
88 88 #define TC_LEN_ENTER 20
89 89 #define TC_LEN_UPDT_INFO 48
90 90 #define TC_LEN_EN_CAL 12
91 91 #define TC_LEN_DIS_CAL 12
92 92 #define TC_LEN_UPDT_TIME 18
93 93
94 94 // TM TYPES
95 95 #define TM_TYPE_TC_EXE 1
96 96 #define TM_TYPE_HK 3
97 97 #define TM_TYPE_PARAMETER_DUMP 3
98 98 #define TM_TYPE_LFR_SCIENCE 21
99 99
100 100 // TM SUBTYPES
101 101 #define TM_SUBTYPE_EXE_OK 7
102 102 #define TM_SUBTYPE_EXE_NOK 8
103 103 #define TM_SUBTYPE_HK 25
104 104 #define TM_SUBTYPE_PARAMETER_DUMP 25
105 105 #define TM_SUBTYPE_SCIENCE 3
106 106 #define TM_SUBTYPE_LFR_SCIENCE 3
107 107
108 108 // FAILURE CODES
109 109 #define ILLEGAL_APID 0
110 110 #define WRONG_LEN_PACKET 1
111 111 #define INCOR_CHECKSUM 2
112 112 #define ILL_TYPE 3
113 113 #define ILL_SUBTYPE 4
114 114 #define WRONG_APP_DATA 5 // 0x00 0x05
115 115 //
116 116 #define CCSDS_TM_VALID 7
117 117 #define TC_NOT_EXE 42000 // 0xa4 0x10
118 118 #define FUNCT_NOT_IMPL 42002 // 0xa4 0x12
119 119 #define FAIL_DETECTED 42003 // 0xa4 0x13
120 120 #define CORRUPTED 42005 // 0xa4 0x15
121 121
122 122 // TM SID
123 123 #define SID_HK 1
124 124 #define SID_PARAMETER_DUMP 10
125 125
126 126 #define SID_NORM_SWF_F0 3
127 127 #define SID_NORM_SWF_F1 4
128 128 #define SID_NORM_SWF_F2 5
129 129 #define SID_NORM_CWF_F3 1
130 130 #define SID_BURST_CWF_F2 2
131 131 #define SID_SBM1_CWF_F1 24
132 132 #define SID_SBM2_CWF_F2 25
133 133 #define SID_NORM_ASM_F0 11
134 134 #define SID_NORM_ASM_F1 12
135 135 #define SID_NORM_ASM_F2 13
136 136 #define SID_NORM_BP1_F0 14
137 137 #define SID_NORM_BP1_F1 15
138 138 #define SID_NORM_BP1_F2 16
139 139 #define SID_NORM_BP2_F0 19
140 140 #define SID_NORM_BP2_F1 20
141 141 #define SID_NORM_BP2_F2 21
142 142 #define SID_BURST_BP1_F0 17
143 143 #define SID_BURST_BP2_F0 22
144 144 #define SID_BURST_BP1_F1 18
145 145 #define SID_BURST_BP2_F1 23
146 146 #define SID_SBM1_BP1_F0 28
147 147 #define SID_SBM1_BP2_F0 31
148 148 #define SID_SBM2_BP1_F0 29
149 149 #define SID_SBM2_BP2_F0 32
150 150 #define SID_SBM2_BP1_F1 30
151 151 #define SID_SBM2_BP2_F1 33
152 152
153 153 // LENGTH (BYTES)
154 154 #define LENGTH_TM_LFR_TC_EXE_MAX 32
155 155 #define LENGTH_TM_LFR_HK 126
156 156
157 157 // HEADER_LENGTH
158 158 #define TM_HEADER_LEN 16
159 159 #define HEADER_LENGTH_TM_LFR_SCIENCE_ASM 28
160 160 // PACKET_LENGTH
161 161 #define PACKET_LENGTH_TC_EXE_SUCCESS (20 - CCSDS_TC_TM_PACKET_OFFSET)
162 162 #define PACKET_LENGTH_TC_EXE_INCONSISTENT (26 - CCSDS_TC_TM_PACKET_OFFSET)
163 163 #define PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE (26 - CCSDS_TC_TM_PACKET_OFFSET)
164 164 #define PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED (24 - CCSDS_TC_TM_PACKET_OFFSET)
165 165 #define PACKET_LENGTH_TC_EXE_ERROR (24 - CCSDS_TC_TM_PACKET_OFFSET)
166 166 #define PACKET_LENGTH_TC_EXE_CORRUPTED (32 - CCSDS_TC_TM_PACKET_OFFSET)
167 167 #define PACKET_LENGTH_HK (126 - CCSDS_TC_TM_PACKET_OFFSET)
168 168 #define PACKET_LENGTH_PARAMETER_DUMP (34 - CCSDS_TC_TM_PACKET_OFFSET)
169 169 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM (TOTAL_SIZE_SM + HEADER_LENGTH_TM_LFR_SCIENCE_ASM - CCSDS_TC_TM_PACKET_OFFSET)
170 170
171 171 #define SPARE1_PUSVERSION_SPARE2 0x10
172 172
173 173 #define LEN_TM_LFR_HK 130 // 126 + 4
174 174 #define LEN_TM_LFR_TC_EXE_NOT_IMP 28 // 24 + 4
175 175
176 176 #define TM_LEN_SCI_SWF_340 4101 // 340 * 12 + 10 + 12 - 1
177 177 #define TM_LEN_SCI_SWF_8 117 // 8 * 12 + 10 + 12 - 1
178 178 #define TM_LEN_SCI_CWF_340 4099 // 340 * 12 + 10 + 10 - 1
179 179 #define TM_LEN_SCI_CWF_8 115 // 8 * 12 + 10 + 10 - 1
180 180 #define TM_LEN_SCI_CWF3_LIGHT_340 2059 // 340 * 6 + 10 + 10 - 1
181 181 #define TM_LEN_SCI_CWF3_LIGHT_8 67 // 8 * 6 + 10 + 10 - 1
182 182 #define DEFAULT_PKTCNT 0x07
183 183 #define BLK_NR_340 0x0154
184 184 #define BLK_NR_8 0x0008
185 185
186 186 enum TM_TYPE{
187 187 TM_LFR_TC_EXE_OK,
188 188 TM_LFR_TC_EXE_ERR,
189 189 TM_LFR_HK,
190 190 TM_LFR_SCI,
191 191 TM_LFR_SCI_SBM,
192 192 TM_LFR_PAR_DUMP
193 193 };
194 194
195 195 struct TMHeader_str
196 196 {
197 197 volatile unsigned char targetLogicalAddress;
198 198 volatile unsigned char protocolIdentifier;
199 199 volatile unsigned char reserved;
200 200 volatile unsigned char userApplication;
201 201 volatile unsigned char packetID[2];
202 202 volatile unsigned char packetSequenceControl[2];
203 203 volatile unsigned char packetLength[2];
204 204 // DATA FIELD HEADER
205 205 volatile unsigned char spare1_pusVersion_spare2;
206 206 volatile unsigned char serviceType;
207 207 volatile unsigned char serviceSubType;
208 208 volatile unsigned char destinationID;
209 209 volatile unsigned char time[6];
210 210 };
211 211 typedef struct TMHeader_str TMHeader_t;
212 212
213 213 struct Packet_TM_LFR_TC_EXE_str
214 214 {
215 215 volatile unsigned char targetLogicalAddress;
216 216 volatile unsigned char protocolIdentifier;
217 217 volatile unsigned char reserved;
218 218 volatile unsigned char userApplication;
219 219 volatile unsigned char packetID[2];
220 220 volatile unsigned char packetSequenceControl[2];
221 221 volatile unsigned char packetLength[2];
222 222 // DATA FIELD HEADER
223 223 volatile unsigned char spare1_pusVersion_spare2;
224 224 volatile unsigned char serviceType;
225 225 volatile unsigned char serviceSubType;
226 226 volatile unsigned char destinationID;
227 227 volatile unsigned char time[6];
228 228 volatile unsigned char data[LENGTH_TM_LFR_TC_EXE_MAX - 10 + 1];
229 229 };
230 230 typedef struct Packet_TM_LFR_TC_EXE_str Packet_TM_LFR_TC_EXE_t;
231 231
232 232 struct Packet_TM_LFR_TC_EXE_SUCCESS_str
233 233 {
234 234 volatile unsigned char targetLogicalAddress;
235 235 volatile unsigned char protocolIdentifier;
236 236 volatile unsigned char reserved;
237 237 volatile unsigned char userApplication;
238 238 // PACKET HEADER
239 239 volatile unsigned char packetID[2];
240 240 volatile unsigned char packetSequenceControl[2];
241 241 volatile unsigned char packetLength[2];
242 242 // DATA FIELD HEADER
243 243 volatile unsigned char spare1_pusVersion_spare2;
244 244 volatile unsigned char serviceType;
245 245 volatile unsigned char serviceSubType;
246 246 volatile unsigned char destinationID;
247 247 volatile unsigned char time[6];
248 248 //
249 249 volatile unsigned char telecommand_pkt_id[2];
250 250 volatile unsigned char pkt_seq_control[2];
251 251 };
252 252 typedef struct Packet_TM_LFR_TC_EXE_SUCCESS_str Packet_TM_LFR_TC_EXE_SUCCESS_t;
253 253
254 254 struct Packet_TM_LFR_TC_EXE_INCONSISTENT_str
255 255 {
256 256 volatile unsigned char targetLogicalAddress;
257 257 volatile unsigned char protocolIdentifier;
258 258 volatile unsigned char reserved;
259 259 volatile unsigned char userApplication;
260 260 // PACKET HEADER
261 261 volatile unsigned char packetID[2];
262 262 volatile unsigned char packetSequenceControl[2];
263 263 volatile unsigned char packetLength[2];
264 264 // DATA FIELD HEADER
265 265 volatile unsigned char spare1_pusVersion_spare2;
266 266 volatile unsigned char serviceType;
267 267 volatile unsigned char serviceSubType;
268 268 volatile unsigned char destinationID;
269 269 volatile unsigned char time[6];
270 270 //
271 271 volatile unsigned char tc_failure_code[2];
272 272 volatile unsigned char telecommand_pkt_id[2];
273 273 volatile unsigned char pkt_seq_control[2];
274 274 volatile unsigned char tc_service;
275 275 volatile unsigned char tc_subtype;
276 276 volatile unsigned char byte_position;
277 277 volatile unsigned char rcv_value;
278 278 };
279 279 typedef struct Packet_TM_LFR_TC_EXE_INCONSISTENT_str Packet_TM_LFR_TC_EXE_INCONSISTENT_t;
280 280
281 281 struct Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_str
282 282 {
283 283 volatile unsigned char targetLogicalAddress;
284 284 volatile unsigned char protocolIdentifier;
285 285 volatile unsigned char reserved;
286 286 volatile unsigned char userApplication;
287 287 // PACKET HEADER
288 288 volatile unsigned char packetID[2];
289 289 volatile unsigned char packetSequenceControl[2];
290 290 volatile unsigned char packetLength[2];
291 291 // DATA FIELD HEADER
292 292 volatile unsigned char spare1_pusVersion_spare2;
293 293 volatile unsigned char serviceType;
294 294 volatile unsigned char serviceSubType;
295 295 volatile unsigned char destinationID;
296 296 volatile unsigned char time[6];
297 297 //
298 298 volatile unsigned char tc_failure_code[2];
299 299 volatile unsigned char telecommand_pkt_id[2];
300 300 volatile unsigned char pkt_seq_control[2];
301 301 volatile unsigned char tc_service;
302 302 volatile unsigned char tc_subtype;
303 303 volatile unsigned char lfr_status_word[2];
304 304 };
305 305 typedef struct Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_str Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_t;
306 306
307 307 struct Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_str
308 308 {
309 309 volatile unsigned char targetLogicalAddress;
310 310 volatile unsigned char protocolIdentifier;
311 311 volatile unsigned char reserved;
312 312 volatile unsigned char userApplication;
313 313 // PACKET HEADER
314 314 volatile unsigned char packetID[2];
315 315 volatile unsigned char packetSequenceControl[2];
316 316 volatile unsigned char packetLength[2];
317 317 // DATA FIELD HEADER
318 318 volatile unsigned char spare1_pusVersion_spare2;
319 319 volatile unsigned char serviceType;
320 320 volatile unsigned char serviceSubType;
321 321 volatile unsigned char destinationID;
322 322 volatile unsigned char time[6];
323 323 //
324 324 volatile unsigned char tc_failure_code[2];
325 325 volatile unsigned char telecommand_pkt_id[2];
326 326 volatile unsigned char pkt_seq_control[2];
327 327 volatile unsigned char tc_service;
328 328 volatile unsigned char tc_subtype;
329 329 };
330 330 typedef struct Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_str Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_t;
331 331
332 332 struct Packet_TM_LFR_TC_EXE_ERROR_str
333 333 {
334 334 volatile unsigned char targetLogicalAddress;
335 335 volatile unsigned char protocolIdentifier;
336 336 volatile unsigned char reserved;
337 337 volatile unsigned char userApplication;
338 338 // PACKET HEADER
339 339 volatile unsigned char packetID[2];
340 340 volatile unsigned char packetSequenceControl[2];
341 341 volatile unsigned char packetLength[2];
342 342 // DATA FIELD HEADER
343 343 volatile unsigned char spare1_pusVersion_spare2;
344 344 volatile unsigned char serviceType;
345 345 volatile unsigned char serviceSubType;
346 346 volatile unsigned char destinationID;
347 347 volatile unsigned char time[6];
348 348 //
349 349 volatile unsigned char tc_failure_code[2];
350 350 volatile unsigned char telecommand_pkt_id[2];
351 351 volatile unsigned char pkt_seq_control[2];
352 352 volatile unsigned char tc_service;
353 353 volatile unsigned char tc_subtype;
354 354 };
355 355 typedef struct Packet_TM_LFR_TC_EXE_ERROR_str Packet_TM_LFR_TC_EXE_ERROR_t;
356 356
357 357 struct Packet_TM_LFR_TC_EXE_CORRUPTED_str
358 358 {
359 359 volatile unsigned char targetLogicalAddress;
360 360 volatile unsigned char protocolIdentifier;
361 361 volatile unsigned char reserved;
362 362 volatile unsigned char userApplication;
363 363 // PACKET HEADER
364 364 volatile unsigned char packetID[2];
365 365 volatile unsigned char packetSequenceControl[2];
366 366 volatile unsigned char packetLength[2];
367 367 // DATA FIELD HEADER
368 368 volatile unsigned char spare1_pusVersion_spare2;
369 369 volatile unsigned char serviceType;
370 370 volatile unsigned char serviceSubType;
371 371 volatile unsigned char destinationID;
372 372 volatile unsigned char time[6];
373 373 //
374 374 volatile unsigned char tc_failure_code[2];
375 375 volatile unsigned char telecommand_pkt_id[2];
376 376 volatile unsigned char pkt_seq_control[2];
377 377 volatile unsigned char tc_service;
378 378 volatile unsigned char tc_subtype;
379 379 volatile unsigned char pkt_len_rcv_value[2];
380 380 volatile unsigned char pkt_datafieldsize_cnt[2];
381 381 volatile unsigned char rcv_crc[2];
382 382 volatile unsigned char computed_crc[2];
383 383 };
384 384 typedef struct Packet_TM_LFR_TC_EXE_CORRUPTED_str Packet_TM_LFR_TC_EXE_CORRUPTED_t;
385 385
386 386 struct Header_TM_LFR_SCIENCE_SWF_str
387 387 {
388 388 volatile unsigned char targetLogicalAddress;
389 389 volatile unsigned char protocolIdentifier;
390 390 volatile unsigned char reserved;
391 391 volatile unsigned char userApplication;
392 392 volatile unsigned char packetID[2];
393 393 volatile unsigned char packetSequenceControl[2];
394 394 volatile unsigned char packetLength[2];
395 395 // DATA FIELD HEADER
396 396 volatile unsigned char spare1_pusVersion_spare2;
397 397 volatile unsigned char serviceType;
398 398 volatile unsigned char serviceSubType;
399 399 volatile unsigned char destinationID;
400 400 volatile unsigned char time[6];
401 401 // AUXILIARY HEADER
402 402 volatile unsigned char sid;
403 403 volatile unsigned char hkBIA;
404 404 volatile unsigned char pktCnt;
405 405 volatile unsigned char pktNr;
406 406 volatile unsigned char acquisitionTime[6];
407 407 volatile unsigned char blkNr[2];
408 408 };
409 409 typedef struct Header_TM_LFR_SCIENCE_SWF_str Header_TM_LFR_SCIENCE_SWF_t;
410 410
411 411 struct Header_TM_LFR_SCIENCE_CWF_str
412 412 {
413 413 volatile unsigned char targetLogicalAddress;
414 414 volatile unsigned char protocolIdentifier;
415 415 volatile unsigned char reserved;
416 416 volatile unsigned char userApplication;
417 417 volatile unsigned char packetID[2];
418 418 volatile unsigned char packetSequenceControl[2];
419 419 volatile unsigned char packetLength[2];
420 420 // DATA FIELD HEADER
421 421 volatile unsigned char spare1_pusVersion_spare2;
422 422 volatile unsigned char serviceType;
423 423 volatile unsigned char serviceSubType;
424 424 volatile unsigned char destinationID;
425 425 volatile unsigned char time[6];
426 426 // AUXILIARY DATA HEADER
427 427 volatile unsigned char sid;
428 428 volatile unsigned char hkBIA;
429 429 volatile unsigned char acquisitionTime[6];
430 430 volatile unsigned char blkNr[2];
431 431 };
432 432 typedef struct Header_TM_LFR_SCIENCE_CWF_str Header_TM_LFR_SCIENCE_CWF_t;
433 433
434 434 struct Header_TM_LFR_SCIENCE_ASM_str
435 435 {
436 436 volatile unsigned char targetLogicalAddress;
437 437 volatile unsigned char protocolIdentifier;
438 438 volatile unsigned char reserved;
439 439 volatile unsigned char userApplication;
440 440 volatile unsigned char packetID[2];
441 441 volatile unsigned char packetSequenceControl[2];
442 442 volatile unsigned char packetLength[2];
443 443 // DATA FIELD HEADER
444 444 volatile unsigned char spare1_pusVersion_spare2;
445 445 volatile unsigned char serviceType;
446 446 volatile unsigned char serviceSubType;
447 447 volatile unsigned char destinationID;
448 448 volatile unsigned char time[6];
449 449 // AUXILIARY HEADER
450 450 volatile unsigned char sid;
451 451 volatile unsigned char biaStatusInfo;
452 452 volatile unsigned char cntASM;
453 453 volatile unsigned char nrASM;
454 454 volatile unsigned char acquisitionTime[6];
455 455 volatile unsigned char blkNr[2];
456 456 };
457 457 typedef struct Header_TM_LFR_SCIENCE_ASM_str Header_TM_LFR_SCIENCE_ASM_t;
458 458
459 459 struct ccsdsTelecommandPacket_str
460 460 {
461 461 //unsigned char targetLogicalAddress; // removed by the grspw module
462 462 volatile unsigned char protocolIdentifier;
463 463 volatile unsigned char reserved;
464 464 volatile unsigned char userApplication;
465 465 volatile unsigned char packetID[2];
466 466 volatile unsigned char packetSequenceControl[2];
467 467 volatile unsigned char packetLength[2];
468 468 // DATA FIELD HEADER
469 469 volatile unsigned char headerFlag_pusVersion_Ack;
470 470 volatile unsigned char serviceType;
471 471 volatile unsigned char serviceSubType;
472 472 volatile unsigned char sourceID;
473 473 volatile unsigned char dataAndCRC[CCSDS_TC_PKT_MAX_SIZE-10];
474 474 };
475 475 typedef struct ccsdsTelecommandPacket_str ccsdsTelecommandPacket_t;
476 476
477 477 struct Packet_TM_LFR_HK_str
478 478 {
479 479 volatile unsigned char targetLogicalAddress;
480 480 volatile unsigned char protocolIdentifier;
481 481 volatile unsigned char reserved;
482 482 volatile unsigned char userApplication;
483 483 volatile unsigned char packetID[2];
484 484 volatile unsigned char packetSequenceControl[2];
485 485 volatile unsigned char packetLength[2];
486 486 volatile unsigned char spare1_pusVersion_spare2;
487 487 volatile unsigned char serviceType;
488 488 volatile unsigned char serviceSubType;
489 489 volatile unsigned char destinationID;
490 490 volatile unsigned char time[6];
491 491 volatile unsigned char sid;
492 492
493 493 //**************
494 494 // HK PARAMETERS
495 495 unsigned char lfr_status_word[2];
496 496 unsigned char lfr_sw_version[4];
497 497 // tc statistics
498 498 unsigned char hk_lfr_update_info_tc_cnt[2];
499 499 unsigned char hk_lfr_update_time_tc_cnt[2];
500 500 unsigned char hk_dpu_exe_tc_lfr_cnt[2];
501 501 unsigned char hk_dpu_rej_tc_lfr_cnt[2];
502 502 unsigned char hk_lfr_last_exe_tc_id[2];
503 503 unsigned char hk_lfr_last_exe_tc_type[2];
504 504 unsigned char hk_lfr_last_exe_tc_subtype[2];
505 505 unsigned char hk_lfr_last_exe_tc_time[6];
506 506 unsigned char hk_lfr_last_rej_tc_id[2];
507 507 unsigned char hk_lfr_last_rej_tc_type[2];
508 508 unsigned char hk_lfr_last_rej_tc_subtype[2];
509 509 unsigned char hk_lfr_last_rej_tc_time[6];
510 510 // anomaly statistics
511 511 unsigned char hk_lfr_le_cnt[2];
512 512 unsigned char hk_lfr_me_cnt[2];
513 513 unsigned char hk_lfr_he_cnt[2];
514 514 unsigned char hk_lfr_last_er_rid[2];
515 515 unsigned char hk_lfr_last_er_code;
516 516 unsigned char hk_lfr_last_er_time[6];
517 517 // vhdl_blk_status
518 518 unsigned char hk_lfr_vhdl_aa_sm;
519 519 unsigned char hk_lfr_vhdl_fft_sr;
520 520 unsigned char hk_lfr_vhdl_cic_hk;
521 521 unsigned char hk_lfr_vhdl_iir_cal;
522 522 // spacewire_if_statistics
523 523 unsigned char hk_lfr_dpu_spw_pkt_rcv_cnt[2];
524 524 unsigned char hk_lfr_dpu_spw_pkt_sent_cnt[2];
525 525 unsigned char hk_lfr_dpu_spw_tick_out_cnt;
526 526 unsigned char hk_lfr_dpu_spw_last_timc;
527 527 // ahb error statistics
528 528 unsigned int hk_lfr_last_fail_addr;
529 529 // temperatures
530 530 unsigned char hk_lfr_temp_scm[2];
531 531 unsigned char hk_lfr_temp_pcb[2];
532 532 unsigned char hk_lfr_temp_fpga[2];
533 533 // error counters
534 534 unsigned char hk_lfr_dpu_spw_parity;
535 535 unsigned char hk_lfr_dpu_spw_disconnect;
536 536 unsigned char hk_lfr_dpu_spw_escape;
537 537 unsigned char hk_lfr_dpu_spw_credit;
538 538 unsigned char hk_lfr_dpu_spw_write_sync;
539 539 unsigned char hk_lfr_dpu_spw_rx_ahb;
540 540 unsigned char hk_lfr_dpu_spw_tx_ahb;
541 541 unsigned char hk_lfr_dpu_spw_header_crc;
542 542 unsigned char hk_lfr_dpu_spw_data_crc;
543 543 unsigned char hk_lfr_dpu_spw_early_eop;
544 544 unsigned char hk_lfr_dpu_spw_invalid_addr;
545 545 unsigned char hk_lfr_dpu_spw_eep;
546 546 unsigned char hk_lfr_dpu_spw_rx_too_big;
547 547 // timecode
548 548 unsigned char hk_lfr_timecode_erroneous;
549 549 unsigned char hk_lfr_timecode_missing;
550 550 unsigned char hk_lfr_timecode_invalid;
551 551 // time
552 552 unsigned char hk_lfr_time_timecode_it;
553 553 unsigned char hk_lfr_time_not_synchro;
554 554 unsigned char hk_lfr_time_timecode_ctr;
555 555 // hk_lfr_buffer_dpu_
556 556 unsigned char hk_lfr_buffer_dpu_tc_fifo;
557 557 unsigned char hk_lfr_buffer_dpu_tm_fifo;
558 558 // hk_lfr_ahb_
559 559 unsigned char hk_lfr_ahb_correctable;
560 560 unsigned char hk_lfr_ahb_uncorrectable;
561 561 unsigned char hk_lfr_ahb_fails_trans;
562 562 // hk_lfr_adc_
563 563 unsigned char hk_lfr_adc_failure;
564 564 unsigned char hk_lfr_adc_timeout;
565 565 unsigned char hk_lfr_toomany_err;
566 566 // hk_lfr_cpu_
567 567 unsigned char hk_lfr_cpu_write_err;
568 568 unsigned char hk_lfr_cpu_ins_access_err;
569 569 unsigned char hk_lfr_cpu_illegal_ins;
570 570 unsigned char hk_lfr_cpu_privilegied_ins;
571 571 unsigned char hk_lfr_cpu_register_hw;
572 572 unsigned char hk_lfr_cpu_not_aligned;
573 573 unsigned char hk_lfr_cpu_data_exception;
574 574 unsigned char hk_lfr_cpu_div_exception;
575 575 unsigned char hk_lfr_cpu_arith_overflow;
576 576 };
577 577 typedef struct Packet_TM_LFR_HK_str Packet_TM_LFR_HK_t;
578 578
579 579 struct Packet_TM_LFR_PARAMETER_DUMP_str
580 580 {
581 581 volatile unsigned char targetLogicalAddress;
582 582 volatile unsigned char protocolIdentifier;
583 583 volatile unsigned char reserved;
584 584 volatile unsigned char userApplication;
585 585 volatile unsigned char packetID[2];
586 586 volatile unsigned char packetSequenceControl[2];
587 587 volatile unsigned char packetLength[2];
588 588 // DATA FIELD HEADER
589 589 volatile unsigned char spare1_pusVersion_spare2;
590 590 volatile unsigned char serviceType;
591 591 volatile unsigned char serviceSubType;
592 592 volatile unsigned char destinationID;
593 593 volatile unsigned char time[6];
594 594 volatile unsigned char sid;
595 595
596 596 //******************
597 597 // COMMON PARAMETERS
598 598 volatile unsigned char unused0;
599 599 volatile unsigned char bw_sp0_sp1_r0_r1;
600 600
601 601 //******************
602 602 // NORMAL PARAMETERS
603 603 volatile unsigned char sy_lfr_n_swf_l[2];
604 604 volatile unsigned char sy_lfr_n_swf_p[2];
605 605 volatile unsigned char sy_lfr_n_asm_p[2];
606 606 volatile unsigned char sy_lfr_n_bp_p0;
607 607 volatile unsigned char sy_lfr_n_bp_p1;
608 608
609 609 //*****************
610 610 // BURST PARAMETERS
611 611 volatile unsigned char sy_lfr_b_bp_p0;
612 612 volatile unsigned char sy_lfr_b_bp_p1;
613 613
614 614 //****************
615 615 // SBM1 PARAMETERS
616 616 volatile unsigned char sy_lfr_s1_bp_p0;
617 617 volatile unsigned char sy_lfr_s1_bp_p1;
618 618
619 619 //****************
620 620 // SBM2 PARAMETERS
621 621 volatile unsigned char sy_lfr_s2_bp_p0;
622 622 volatile unsigned char sy_lfr_s2_bp_p1;
623 623 };
624 624 typedef struct Packet_TM_LFR_PARAMETER_DUMP_str Packet_TM_LFR_PARAMETER_DUMP_t;
625 625
626 626
627 #endif // CCSDS_H_INCLUDED
627 #endif // CCSDS_TYPES_H_INCLUDED
@@ -1,58 +1,49
1 #ifndef FSW_RTEMS_H_INCLUDED
2 #define FSW_RTEMS_H_INCLUDED
3
4 #include <errno.h>
5 #include <fcntl.h>
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <unistd.h> // for the read call
9 #include <sys/ioctl.h> // for the ioctl call
1 #ifndef FSW_INIT_H_INCLUDED
2 #define FSW_INIT_H_INCLUDED
10 3
11 4 #include <rtems.h>
12 #include <grspw.h>
13 #include <apbuart.h>
14 5 #include <leon.h>
15 6
16 7 #include "fsw_params.h"
17 8 #include "fsw_misc.h"
18 9 #include "fsw_processing.h"
19 10 #include "tc_handler.h"
20 11 #include "wf_handler.h"
21 12
22 13 #include "fsw_spacewire.h"
23 14
24 15 extern rtems_name misc_name[5];
25 16 extern rtems_id misc_id[5];
26 17 extern rtems_name Task_name[20]; /* array of task names */
27 18 extern rtems_id Task_id[20]; /* array of task ids */
28 19 extern unsigned int maxCount;
29 20 extern int fdSPW; // grspw file descriptor
30 21 extern int fdUART; // uart file descriptor
31 22 extern unsigned char lfrCurrentMode;
32 23
33 24 // MODE PARAMETERS
34 25 extern struct param_local_str param_local;
35 26 extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet;
36 27 extern unsigned short sequenceCounters[SEQ_CNT_NB_PID][SEQ_CNT_NB_CAT][SEQ_CNT_NB_DEST_ID];
37 28
38 29 // RTEMS TASKS
39 30 rtems_task Init( rtems_task_argument argument);
40 31
41 32 // OTHER functions
42 33 int create_names( void );
43 34 int create_all_tasks( void );
44 35 int start_all_tasks( void );
45 36 rtems_status_code create_message_queues( void );
46 37 //
47 38 void init_parameter_dump( void );
48 39 void init_local_mode_parameters( void );
49 40 void init_housekeeping_parameters( void );
50 41
51 42 extern int rtems_cpu_usage_report( void );
52 43 extern int rtems_cpu_usage_reset( void );
53 44 extern void rtems_stack_checker_report_usage( void );
54 45
55 46 extern int sched_yield( void );
56 47 extern int errno;
57 48
58 #endif // FSW_RTEMS_CONFIG_H_INCLUDED
49 #endif // FSW_INIT_H_INCLUDED
@@ -1,28 +1,33
1 1 #ifndef FSW_MISC_H_INCLUDED
2 2 #define FSW_MISC_H_INCLUDED
3 3
4 #include "fsw_init.h"
4 #include <rtems.h>
5 #include <stdio.h>
6 #include <grspw.h>
7
8 #include "fsw_params.h"
9 #include "fsw_spacewire.h"
5 10
6 11 rtems_name HK_name; // name of the HK rate monotonic
7 12 rtems_id HK_id; // id of the HK rate monotonic period
13
14 extern rtems_name misc_name[5];
15 time_management_regs_t *time_management_regs;
8 16 extern Packet_TM_LFR_HK_t housekeeping_packet;
9 17
10 18 int configure_timer(gptimer_regs_t *gptimer_regs, unsigned char timer, unsigned int clock_divider,
11 19 unsigned char interrupt_level, rtems_isr (*timer_isr)() );
12 20 int timer_start( gptimer_regs_t *gptimer_regs, unsigned char timer );
13 21 int timer_stop( gptimer_regs_t *gptimer_regs, unsigned char timer );
14 22 int timer_set_clock_divider(gptimer_regs_t *gptimer_regs, unsigned char timer, unsigned int clock_divider);
15 void update_spacewire_statistics();
16 23
17 24 // SERIAL LINK
18 25 int send_console_outputs_on_apbuart_port( void );
19 26 void set_apbuart_scaler_reload_register(unsigned int regs, unsigned int value);
20 27
21 28 // RTEMS TASKS
22 29 rtems_task stat_task(rtems_task_argument argument);
23 30 rtems_task hous_task(rtems_task_argument argument);
24 rtems_task send_task(rtems_task_argument argument);
25
26 rtems_id get_pkts_queue_id( void );
31 rtems_task dumb_task( rtems_task_argument unused );
27 32
28 33 #endif // FSW_MISC_H_INCLUDED
@@ -1,225 +1,225
1 #ifndef FSW_RTEMS_CONFIG_H_INCLUDED
2 #define FSW_RTEMS_CONFIG_H_INCLUDED
1 #ifndef FSW_PARAMS_H_INCLUDED
2 #define FSW_PARAMS_H_INCLUDED
3 3
4 4 #include "grlib_regs.h"
5 5 #include "fsw_params_processing.h"
6 6 #include "tm_byte_positions.h"
7 7 #include "ccsds_types.h"
8 8
9 9 #define GRSPW_DEVICE_NAME "/dev/grspw0"
10 10 #define UART_DEVICE_NAME "/dev/console"
11 11
12 12 //************************
13 13 // flight software version
14 14 // this parameters is handled by the Qt project options
15 15
16 16 //**********
17 17 // LFR MODES
18 18 #define LFR_MODE_STANDBY 0
19 19 #define LFR_MODE_NORMAL 1
20 20 #define LFR_MODE_BURST 2
21 21 #define LFR_MODE_SBM1 3
22 22 #define LFR_MODE_SBM2 4
23 23 #define LFR_MODE_NORMAL_CWF_F3 5
24 24
25 25 #define RTEMS_EVENT_MODE_STANDBY RTEMS_EVENT_0
26 26 #define RTEMS_EVENT_MODE_NORMAL RTEMS_EVENT_1
27 27 #define RTEMS_EVENT_MODE_BURST RTEMS_EVENT_2
28 28 #define RTEMS_EVENT_MODE_SBM1 RTEMS_EVENT_3
29 29 #define RTEMS_EVENT_MODE_SBM2 RTEMS_EVENT_4
30 30 #define RTEMS_EVENT_MODE_SBM2_WFRM RTEMS_EVENT_5
31 31
32 32 //****************************
33 33 // LFR DEFAULT MODE PARAMETERS
34 34 // COMMON
35 35 #define DEFAULT_SY_LFR_COMMON0 0x00
36 36 #define DEFAULT_SY_LFR_COMMON1 0x10 // default value 0 0 0 1 0 0 0 0
37 37 // NORM
38 38 #define DEFAULT_SY_LFR_N_SWF_L 2048 // nb sample
39 39 #define DEFAULT_SY_LFR_N_SWF_P 16 // sec
40 40 #define DEFAULT_SY_LFR_N_ASM_P 16 // sec
41 41 #define DEFAULT_SY_LFR_N_BP_P0 4 // sec
42 42 #define DEFAULT_SY_LFR_N_BP_P1 20 // sec
43 43 #define MIN_DELTA_SNAPSHOT 16 // sec
44 44 // BURST
45 45 #define DEFAULT_SY_LFR_B_BP_P0 1 // sec
46 46 #define DEFAULT_SY_LFR_B_BP_P1 5 // sec
47 47 // SBM1
48 48 #define DEFAULT_SY_LFR_S1_BP_P0 1 // sec
49 49 #define DEFAULT_SY_LFR_S1_BP_P1 1 // sec
50 50 // SBM2
51 51 #define DEFAULT_SY_LFR_S2_BP_P0 1 // sec
52 52 #define DEFAULT_SY_LFR_S2_BP_P1 5 // sec
53 53 // ADDITIONAL PARAMETERS
54 54 #define TIME_BETWEEN_TWO_SWF_PACKETS 30 // nb x 10 ms => 300 ms
55 55 #define TIME_BETWEEN_TWO_CWF3_PACKETS 1000 // nb x 10 ms => 10 s
56 56 //
57 57 //****************************
58 58
59 59 //*****************************
60 60 // APB REGISTERS BASE ADDRESSES
61 61 #define REGS_ADDR_APBUART 0x80000100
62 62 #define REGS_ADDR_GPTIMER 0x80000300
63 63 #define REGS_ADDR_GRSPW 0x80000500
64 64 #define REGS_ADDR_TIME_MANAGEMENT 0x80000600
65 65 #define REGS_ADDR_SPECTRAL_MATRIX 0x80000f00
66 66
67 67 #ifdef GSA
68 68 #else
69 69 #define REGS_ADDR_WAVEFORM_PICKER 0x80000f20
70 70 #endif
71 71
72 72 #define APBUART_CTRL_REG_MASK_DB 0xfffff7ff
73 73 #define APBUART_SCALER_RELOAD_VALUE 0x00000050 // 25 MHz => about 38400 (0x50)
74 74
75 75 //**********
76 76 // IRQ LINES
77 77 #define IRQ_SM 9
78 78 #define IRQ_SPARC_SM 0x19 // see sparcv8.pdf p.76 for interrupt levels
79 79 #define IRQ_WF 10
80 80 #define IRQ_SPARC_WF 0x1a // see sparcv8.pdf p.76 for interrupt levels
81 81 #define IRQ_TIME1 12
82 82 #define IRQ_SPARC_TIME1 0x1c // see sparcv8.pdf p.76 for interrupt levels
83 83 #define IRQ_TIME2 13
84 84 #define IRQ_SPARC_TIME2 0x1d // see sparcv8.pdf p.76 for interrupt levels
85 85 #define IRQ_WAVEFORM_PICKER 14
86 86 #define IRQ_SPARC_WAVEFORM_PICKER 0x1e // see sparcv8.pdf p.76 for interrupt levels
87 87 #define IRQ_SPECTRAL_MATRIX 6
88 88 #define IRQ_SPARC_SPECTRAL_MATRIX 0x16 // see sparcv8.pdf p.76 for interrupt levels
89 89
90 90 //*****
91 91 // TIME
92 92 #define CLKDIV_SM_SIMULATOR (10000 - 1) // 10 ms
93 93 #define CLKDIV_WF_SIMULATOR (10000000 - 1) // 10 000 000 * 1 us = 10 s
94 94 #define TIMER_SM_SIMULATOR 1
95 95 #define TIMER_WF_SIMULATOR 2
96 96 #define HK_PERIOD 100 // 100 * 10ms => 1sec
97 97
98 98 //**********
99 99 // LPP CODES
100 100 #define LFR_SUCCESSFUL 0
101 101 #define LFR_DEFAULT 1
102 102
103 103 //******
104 104 // RTEMS
105 105 #define TASKID_RECV 1
106 106 #define TASKID_ACTN 2
107 107 #define TASKID_SPIQ 3
108 108 #define TASKID_SMIQ 4
109 109 #define TASKID_STAT 5
110 110 #define TASKID_AVF0 6
111 111 #define TASKID_BPF0 7
112 112 #define TASKID_WFRM 8
113 113 #define TASKID_DUMB 9
114 114 #define TASKID_HOUS 10
115 115 #define TASKID_MATR 11
116 116 #define TASKID_CWF3 12
117 117 #define TASKID_CWF2 13
118 118 #define TASKID_CWF1 14
119 119 #define TASKID_SEND 15
120 120
121 121 #define TASK_PRIORITY_SPIQ 5
122 122 #define TASK_PRIORITY_SMIQ 10
123 123 //
124 124 #define TASK_PRIORITY_RECV 20
125 125 #define TASK_PRIORITY_ACTN 30
126 126 //
127 127 #define TASK_PRIORITY_HOUS 40
128 128 #define TASK_PRIORITY_CWF1 40
129 129 #define TASK_PRIORITY_CWF2 40
130 130 #define TASK_PRIORITY_WFRM 40
131 131 #define TASK_PRIORITY_CWF3 40
132 132 //
133 133 #define TASK_PRIORITY_SEND 40
134 134 //
135 135 #define TASK_PRIORITY_AVF0 60
136 136 #define TASK_PRIORITY_BPF0 60
137 137 #define TASK_PRIORITY_MATR 100
138 138 #define TASK_PRIORITY_STAT 200
139 139 #define TASK_PRIORITY_DUMB 200
140 140
141 141 #define ACTION_MSG_QUEUE_COUNT 10
142 142 #define ACTION_MSG_PKTS_COUNT 50
143 143 #define ACTION_MSG_PKTS_MAX_SIZE (PACKET_LENGTH_PARAMETER_DUMP + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES)
144 144 #define ACTION_MSG_SPW_IOCTL_SEND_SIZE 24 // hlen *hdr dlen *data sent options
145 145
146 146 #define QUEUE_RECV 0
147 147 #define QUEUE_SEND 1
148 148
149 149 //*******
150 150 // MACROS
151 151 #ifdef PRINT_MESSAGES_ON_CONSOLE
152 152 #define PRINTF(x) printf(x);
153 153 #define PRINTF1(x,y) printf(x,y);
154 154 #define PRINTF2(x,y,z) printf(x,y,z);
155 155 #else
156 156 #define PRINTF(x) ;
157 157 #define PRINTF1(x,y) ;
158 158 #define PRINTF2(x,y,z) ;
159 159 #endif
160 160
161 161 #ifdef BOOT_MESSAGES
162 162 #define BOOT_PRINTF(x) printf(x);
163 163 #define BOOT_PRINTF1(x,y) printf(x,y);
164 164 #define BOOT_PRINTF2(x,y,z) printf(x,y,z);
165 165 #else
166 166 #define BOOT_PRINTF(x) ;
167 167 #define BOOT_PRINTF1(x,y) ;
168 168 #define BOOT_PRINTF2(x,y,z) ;
169 169 #endif
170 170
171 171 #ifdef DEBUG_MESSAGES
172 172 #define DEBUG_PRINTF(x) printf(x);
173 173 #define DEBUG_PRINTF1(x,y) printf(x,y);
174 174 #define DEBUG_PRINTF2(x,y,z) printf(x,y,z);
175 175 #else
176 176 #define DEBUG_PRINTF(x) ;
177 177 #define DEBUG_PRINTF1(x,y) ;
178 178 #define DEBUG_PRINTF2(x,y,z) ;
179 179 #endif
180 180
181 181 #define CPU_USAGE_REPORT_PERIOD 6 // * 10 s = period
182 182
183 183 #define NB_SAMPLES_PER_SNAPSHOT 2048
184 184 #define TIME_OFFSET 2
185 185 #define WAVEFORM_EXTENDED_HEADER_OFFSET 22
186 186 #define NB_BYTES_SWF_BLK (2 * 6)
187 187 #define NB_WORDS_SWF_BLK 3
188 188 #define NB_BYTES_CWF3_LIGHT_BLK 6
189 189 #define WFRM_INDEX_OF_LAST_PACKET 6 // waveforms are transmitted in groups of 2048 blocks, 6 packets of 340 and 1 of 8
190 190
191 191 //******************
192 192 // SEQUENCE COUNTERS
193 193 #define SEQ_CNT_NB_PID 2
194 194 #define SEQ_CNT_NB_CAT 4
195 195 #define SEQ_CNT_NB_DEST_ID 11
196 196 // pid
197 197 #define SEQ_CNT_PID_76 0
198 198 #define SEQ_CNT_PID_79 1
199 199 //cat
200 200 #define SEQ_CNT_CAT_1 0
201 201 #define SEQ_CNT_CAT_4 1
202 202 #define SEQ_CNT_CAT_9 2
203 203 #define SEQ_CNT_CAT_12 3
204 204 // destination id
205 205 #define SEQ_CNT_DST_ID_GROUND 0
206 206 #define SEQ_CNT_DST_ID_MISSION_TIMELINE 1
207 207 #define SEQ_CNT_DST_ID_TC_SEQUENCES 2
208 208 #define SEQ_CNT_DST_ID_RECOVERY_ACTION_CMD 3
209 209 #define SEQ_CNT_DST_ID_BACKUP_MISSION_TIMELINE 4
210 210 #define SEQ_CNT_DST_ID_DIRECT_CMD 5
211 211 #define SEQ_CNT_DST_ID_SPARE_GRD_SRC1 6
212 212 #define SEQ_CNT_DST_ID_SPARE_GRD_SRC2 7
213 213 #define SEQ_CNT_DST_ID_OBCP 8
214 214 #define SEQ_CNT_DST_ID_SYSTEM_CONTROL 9
215 215 #define SEQ_CNT_DST_ID_AOCS 10
216 216
217 217 struct param_local_str{
218 218 unsigned int local_sbm1_nb_cwf_sent;
219 219 unsigned int local_sbm1_nb_cwf_max;
220 220 unsigned int local_sbm2_nb_cwf_sent;
221 221 unsigned int local_sbm2_nb_cwf_max;
222 222 unsigned int local_nb_interrupt_f0_MAX;
223 223 };
224 224
225 #endif // FSW_RTEMS_CONFIG_H_INCLUDED
225 #endif // FSW_PARAMS_H_INCLUDED
@@ -1,55 +1,65
1 #ifndef FSW_RTEMS_PROCESSING_H_INCLUDED
2 #define FSW_RTEMS_PROCESSING_H_INCLUDED
1 #ifndef FSW_PROCESSING_H_INCLUDED
2 #define FSW_PROCESSING_H_INCLUDED
3 3
4 #include "fsw_init.h"
4 #include <rtems.h>
5 #include <grspw.h>
6 #include <math.h>
7 #include <stdlib.h> // abs() is in the stdlib
8 #include <stdio.h> // printf()
9
10 #include "fsw_params.h"
11
5 12
6 13 extern volatile int spec_mat_f0_0[ ];
7 14 extern volatile int spec_mat_f0_1[ ];
8 15 extern volatile int spec_mat_f0_a[ ];
9 16 extern volatile int spec_mat_f0_b[ ];
10 17 extern volatile int spec_mat_f0_c[ ];
11 18 extern volatile int spec_mat_f0_d[ ];
12 19 extern volatile int spec_mat_f0_e[ ];
13 20 extern volatile int spec_mat_f0_f[ ];
14 21 extern volatile int spec_mat_f0_g[ ];
15 22 extern volatile int spec_mat_f0_h[ ];
16 23
17 24 extern volatile int spec_mat_f1[ ];
18 25 extern volatile int spec_mat_f2[ ];
19 26
20 27 extern volatile int spec_mat_f1_bis[ ];
21 28 extern volatile int spec_mat_f2_bis[ ];
22 29 extern volatile int spec_mat_f0_0_bis[ ];
23 30 extern volatile int spec_mat_f0_1_bis[ ];
24 31
25 32 // parameters
26 33 extern struct param_local_str param_local;
27 34
28 35 // registers
29 36 extern time_management_regs_t *time_management_regs;
30 37 extern spectral_matrix_regs_t *spectral_matrix_regs;
31 38
39 extern rtems_name misc_name[5];
40 extern rtems_id Task_id[20]; /* array of task ids */
41
32 42 // ISR
33 43 rtems_isr spectral_matrices_isr( rtems_vector_number vector );
34 44 rtems_isr spectral_matrices_isr_simu( rtems_vector_number vector );
35 45
36 46 // RTEMS TASKS
37 47 rtems_task spw_bppr_task(rtems_task_argument argument);
38 48 rtems_task avf0_task(rtems_task_argument argument);
39 49 rtems_task bpf0_task(rtems_task_argument argument);
40 50 rtems_task smiq_task(rtems_task_argument argument); // added to test the spectral matrix simulator
41 51 rtems_task matr_task(rtems_task_argument argument);
42 52
43 53 void matrix_compression(volatile float *averaged_spec_mat, unsigned char fChannel, float *compressed_spec_mat);
44 54 void matrix_reset(volatile float *averaged_spec_mat);
45 55 void BP1_set(float * compressed_spec_mat, unsigned char nb_bins_compressed_spec_mat, unsigned char * LFR_BP1);
46 56 void BP2_set(float * compressed_spec_mat, unsigned char nb_bins_compressed_spec_mat);
47 57 //
48 58 void init_header_asm( Header_TM_LFR_SCIENCE_ASM_t *header);
49 59 void send_spectral_matrix(Header_TM_LFR_SCIENCE_ASM_t *header, char *spectral_matrix,
50 60 unsigned int sid, spw_ioctl_pkt_send *spw_ioctl_send, rtems_id queue_id);
51 61 void convert_averaged_spectral_matrix(volatile float *input_matrix, char *output_matrix);
52 62 void fill_averaged_spectral_matrix( void );
53 63 void reset_spectral_matrix_regs();
54 64
55 #endif // FSW_RTEMS_PROCESSING_H_INCLUDED
65 #endif // FSW_PROCESSING_H_INCLUDED
@@ -1,22 +1,36
1 1 #ifndef FSW_SPACEWIRE_H_INCLUDED
2 2 #define FSW_SPACEWIRE_H_INCLUDED
3 3
4 #include "fsw_init.h"
4 #include <rtems.h>
5 #include <grspw.h>
6
7 #include <fcntl.h> // for O_RDWR
8 #include <unistd.h> // for the read call
9 #include <sys/ioctl.h> // for the ioctl call
10 #include <errno.h>
11
12 #include "fsw_params.h"
13 #include "tc_handler.h"
5 14
6 15 extern spw_stats spacewire_stats;
7 16 extern spw_stats spacewire_stats_backup;
17 extern Packet_TM_LFR_HK_t housekeeping_packet;
18 extern rtems_id Task_id[20]; /* array of task ids */
8 19
9 20 // RTEMS TASK
10 21 rtems_task spiq_task(rtems_task_argument argument);
22 rtems_task recv_task( rtems_task_argument unused );
23 rtems_task send_task( rtems_task_argument argument );
11 24
12 25 int spacewire_configure_link( void );
13 26 int spacewire_wait_for_link(void);
14 27 void spacewire_set_NP(unsigned char val, unsigned int regAddr); // No Port force
15 28 void spacewire_set_RE(unsigned char val, unsigned int regAddr); // RMAP Enable
16 29 void spacewire_compute_stats_offsets(void);
30 void spacewire_update_statistics( void );
17 31
18 32 void timecode_irq_handler(void *pDev, void *regs, int minor, unsigned int tc);
19 33
20 34 void (*grspw_timecode_callback) (void *pDev, void *regs, int minor, unsigned int tc);
21 35
22 36 #endif // FSW_SPACEWIRE_H_INCLUDED
@@ -1,74 +1,74
1 #ifndef GRLIBREGS_H_INCLUDED
2 #define GRLIBREGS_H_INCLUDED
1 #ifndef GRLIB_REGS_H_INCLUDED
2 #define GRLIB_REGS_H_INCLUDED
3 3
4 4 #define NB_GPTIMER 3
5 5
6 6 struct apbuart_regs_str{
7 7 volatile unsigned int data;
8 8 volatile unsigned int status;
9 9 volatile unsigned int ctrl;
10 10 volatile unsigned int scaler;
11 11 volatile unsigned int fifoDebug;
12 12 };
13 13
14 14 struct ahbuart_regs_str{
15 15 volatile unsigned int unused;
16 16 volatile unsigned int status;
17 17 volatile unsigned int ctrl;
18 18 volatile unsigned int scaler;
19 19 };
20 20
21 21 struct timer_regs_str
22 22 {
23 23 volatile unsigned int counter;
24 24 volatile unsigned int reload;
25 25 volatile unsigned int ctrl;
26 26 volatile unsigned int unused;
27 27 };
28 28 typedef struct timer_regs_str timer_regs_t;
29 29
30 30 struct gptimer_regs_str
31 31 {
32 32 volatile unsigned int scaler_value;
33 33 volatile unsigned int scaler_reload;
34 34 volatile unsigned int conf;
35 35 volatile unsigned int unused0;
36 36 timer_regs_t timer[NB_GPTIMER];
37 37 };
38 38 typedef struct gptimer_regs_str gptimer_regs_t;
39 39
40 40 struct time_management_regs_str{
41 41 volatile int ctrl; // bit 0 forces the load of the coarse_time_load value and resets the fine_time
42 42 volatile int coarse_time_load;
43 43 volatile int coarse_time;
44 44 volatile int fine_time;
45 45 };
46 46 typedef struct time_management_regs_str time_management_regs_t;
47 47
48 48 struct waveform_picker_regs_str{
49 49 volatile int data_shaping; // 0x00 00 *** R1 R0 SP1 SP0 BW
50 50 volatile int burst_enable; // 0x04 01 *** burst f2, f1, f0 enable f3, f2, f1, f0
51 51 volatile int addr_data_f0; // 0x08 10 ***
52 52 volatile int addr_data_f1; // 0x0c 11 ***
53 53 volatile int addr_data_f2; // 0x10 100 ***
54 54 volatile int addr_data_f3; // 0x14 101 ***
55 55 volatile int status; // 0x18 110 ***
56 56 volatile int delta_snapshot; // 0x1c 111 ***
57 57 volatile int delta_f2_f1; // 0x20 0000 ***
58 58 volatile int delta_f2_f0; // 0x24 0001 ***
59 59 volatile int nb_burst_available;// 0x28 0010 ***
60 60 volatile int nb_snapshot_param; // 0x2c 0011 ***
61 61 };
62 62 typedef struct waveform_picker_regs_str waveform_picker_regs_t;
63 63
64 64 struct spectral_matrix_regs_str{
65 65 volatile int config;
66 66 volatile int status;
67 67 volatile int matrixF0_Address0;
68 68 volatile int matrixFO_Address1;
69 69 volatile int matrixF1_Address;
70 70 volatile int matrixF2_Address;
71 71 };
72 72 typedef struct spectral_matrix_regs_str spectral_matrix_regs_t;
73 73
74 #endif // GRLIBREGS_H_INCLUDED
74 #endif // GRLIB_REGS_H_INCLUDED
@@ -1,71 +1,63
1 1 #ifndef TC_HANDLER_H_INCLUDED
2 2 #define TC_HANDLER_H_INCLUDED
3 3
4 #include "fsw_init.h"
4 #include <rtems.h>
5 #include <leon.h>
6
5 7 #include "tc_load_dump_parameters.h"
8 #include "tc_acceptance.h"
6 9 #include "tm_lfr_tc_exe.h"
10 #include "wf_handler.h"
7 11
8 12 // MODE PARAMETERS
9 13 extern struct param_sbm1_str param_sbm1;
10 14 extern struct param_sbm2_str param_sbm2;
11 15 extern time_management_regs_t *time_management_regs;
12 16 extern waveform_picker_regs_t *waveform_picker_regs;
13 17 extern gptimer_regs_t *gptimer_regs;
18 extern rtems_name misc_name[5];
19 extern rtems_id Task_id[20]; /* array of task ids */
20 extern unsigned char lfrCurrentMode;
21 extern unsigned int maxCount;
22
14 23
15 24 //****
16 25 // ISR
17 26 rtems_isr commutation_isr1( rtems_vector_number vector );
18 27 rtems_isr commutation_isr2( rtems_vector_number vector );
19 28
20 //**********************
21 // GENERAL USE FUNCTIONS
22 unsigned int Crc_opt( unsigned char D, unsigned int Chk);
23 void initLookUpTableForCRC( void );
24 void GetCRCAsTwoBytes(unsigned char* data, unsigned char* crcAsTwoBytes, unsigned int sizeOfData);
25 void updateLFRCurrentMode();
26
27 //*********************
28 // ACCEPTANCE FUNCTIONS
29 int tc_acceptance(ccsdsTelecommandPacket_t *TC, unsigned int TC_LEN_RCV, rtems_id queue_recv_id, rtems_id queue_send_id);
30 int tc_parser(ccsdsTelecommandPacket_t * TCPacket, unsigned int TC_LEN_RCV);
31 int tc_check_type( unsigned char packetType );
32 int tc_check_subtype( unsigned char packetType );
33 int tc_check_length( unsigned char packetType, unsigned int length );
34 int tc_check_crc( ccsdsTelecommandPacket_t * TCPacket, unsigned int length );
35
36 29 //***********
37 30 // RTEMS TASK
38 rtems_task recv_task( rtems_task_argument unused );
39 31 rtems_task actn_task( rtems_task_argument unused );
40 rtems_task dumb_task( rtems_task_argument unused );
41 32
42 33 //***********
43 34 // TC ACTIONS
44 35 int action_reset(ccsdsTelecommandPacket_t *TC, rtems_id queue_id);
45 36 int action_enter_mode(ccsdsTelecommandPacket_t *TC, rtems_id queue_id);
46 37 int action_update_info(ccsdsTelecommandPacket_t *TC, rtems_id queue_id);
47 38 int action_enable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id);
48 39 int action_disable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id);
49 40 int action_update_time(ccsdsTelecommandPacket_t *TC);
50 41
51 42 // mode transition
52 43 int transition_validation(unsigned char requestedMode);
53 44 int stop_current_mode();
54 45 int enter_mode(unsigned char mode, ccsdsTelecommandPacket_t *TC);
55 46 int enter_standby_mode();
56 47 int enter_normal_mode();
57 48 int enter_burst_mode();
58 49 int enter_sbm1_mode();
59 50 int enter_sbm2_mode();
60 51 int restart_science_tasks();
61 52 int suspend_science_tasks();
62 53
63 54 // other functions
55 void updateLFRCurrentMode();
64 56 void update_last_TC_exe(ccsdsTelecommandPacket_t *TC);
65 57 void update_last_TC_rej(ccsdsTelecommandPacket_t *TC);
66 58 void close_action(ccsdsTelecommandPacket_t *TC, int result, rtems_id queue_id);
67 59
68 60 #endif // TC_HANDLER_H_INCLUDED
69 61
70 62
71 63
@@ -1,19 +1,29
1 1 #ifndef TC_LOAD_DUMP_PARAMETERS_H
2 2 #define TC_LOAD_DUMP_PARAMETERS_H
3 3
4 #include "tc_handler.h"
4 #include <rtems.h>
5 #include <stdio.h>
6
7 #include "fsw_params.h"
8 #include "wf_handler.h"
9 #include "tm_lfr_tc_exe.h"
10
11 extern int fdSPW;
12 extern unsigned char lfrCurrentMode;
13 extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet;
14 extern Packet_TM_LFR_HK_t housekeeping_packet;
5 15
6 16 int action_load_common_par( ccsdsTelecommandPacket_t *TC );
7 17 int action_load_normal_par( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
8 18 int action_load_burst_par( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
9 19 int action_load_sbm1_par( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
10 20 int action_load_sbm2_par( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
11 21 int action_dump_par(rtems_id queue_id );
12 22
13 23 int set_sy_lfr_n_swf_l( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
14 24 int set_sy_lfr_n_swf_p( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
15 25 int set_sy_lfr_n_asm_p( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
16 26 int set_sy_lfr_n_bp_p0( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
17 27 int set_sy_lfr_n_bp_p1( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
18 28
19 29 #endif // TC_LOAD_DUMP_PARAMETERS_H
@@ -1,65 +1,78
1 1 #ifndef WF_HANDLER_H_INCLUDED
2 2 #define WF_HANDLER_H_INCLUDED
3 3
4 #include "fsw_init.h"
4 #include <rtems.h>
5 #include <grspw.h>
6 #include <stdio.h>
7 #include <math.h>
5 8
6 #include <math.h>
9 #include "fsw_params.h"
7 10
8 11 #define pi 3.1415
9 12
10 13 extern int fdSPW;
11 14 extern volatile int wf_snap_f0[ ];
12 15 //
13 16 extern volatile int wf_snap_f1[ ];
14 17 extern volatile int wf_snap_f1_bis[ ];
15 18 extern volatile int wf_snap_f1_norm[ ];
16 19 //
17 20 extern volatile int wf_snap_f2[ ];
18 21 extern volatile int wf_snap_f2_bis[ ];
19 22 extern volatile int wf_snap_f2_norm[ ];
20 23 //
21 24 extern volatile int wf_cont_f3[ ];
22 25 extern volatile int wf_cont_f3_bis[ ];
23 26 extern char wf_cont_f3_light[ ];
24 27 extern waveform_picker_regs_t *waveform_picker_regs;
28 extern time_management_regs_t *time_management_regs;
29 extern Packet_TM_LFR_HK_t housekeeping_packet;
30 extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet;
31 extern struct param_local_str param_local;
32
33 extern rtems_name misc_name[5];
34 extern rtems_id Task_id[20]; /* array of task ids */
35 extern unsigned char lfrCurrentMode;
25 36
26 37 rtems_isr waveforms_isr( rtems_vector_number vector );
27 38 rtems_isr waveforms_simulator_isr( rtems_vector_number vector );
28 39 rtems_task wfrm_task( rtems_task_argument argument );
29 40 rtems_task cwf3_task( rtems_task_argument argument );
30 41 rtems_task cwf2_task( rtems_task_argument argument );
31 42 rtems_task cwf1_task( rtems_task_argument argument );
32 43
33 44 //******************
34 45 // general functions
35 46 void init_waveforms( void );
36 47 //
37 48 int init_header_snapshot_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF );
38 49 int init_header_continuous_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF );
39 50 int init_header_continuous_wf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF );
40 51 //
41 52 void reset_waveforms( void );
42
53 //
43 54 int send_waveform_SWF( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF, rtems_id queue_id );
44 55 int send_waveform_CWF( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id );
45 56 int send_waveform_CWF3( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id );
46 57 int send_waveform_CWF3_light( volatile int *waveform, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id );
58 //
59 rtems_id get_pkts_queue_id( void );
47 60
48 61 //**************
49 62 // wfp registers
50 63 void set_wfp_data_shaping();
51 64 char set_wfp_delta_snapshot();
52 65 void set_wfp_burst_enable_register( unsigned char mode);
53 66 void reset_wfp_burst_enable();
54 67 void reset_wfp_status();
55 68 void reset_waveform_picker_regs();
56 69
57 70 //*****************
58 71 // local parameters
59 72 void set_local_sbm1_nb_cwf_max();
60 73 void set_local_sbm2_nb_cwf_max();
61 74 void set_local_nb_interrupt_f0_MAX();
62 75 void reset_local_sbm1_nb_cwf_sent();
63 76 void reset_local_sbm2_nb_cwf_sent();
64 77
65 78 #endif // WF_HANDLER_H_INCLUDED
@@ -1,73 +1,89
1 //#include <fsw_processing.h>
1 /** Global variables of the LFR flight software.
2 *
3 * @file
4 * @author P. LEROY
5 *
6 * Among global variables, there are:
7 * - RTEMS names and id.
8 * - APB configuration registers.
9 * - waveforms global buffers, used by the waveform picker hardware module to store data.
10 * - spectral matrices buffesr, used by the hardware module to store data.
11 * - variable related to LFR modes parameters.
12 * - the global HK packet buffer.
13 * - the global dump parameter buffer.
14 *
15 */
16
2 17 #include <rtems.h>
3 18 #include <grspw.h>
19
4 20 #include "ccsds_types.h"
5 21 #include "grlib_regs.h"
6 22 #include "fsw_params.h"
7 23
8 24 // RTEMS GLOBAL VARIABLES
9 25 rtems_name misc_name[5];
10 26 rtems_id misc_id[5];
11 27 rtems_name Task_name[20]; /* array of task names */
12 28 rtems_id Task_id[20]; /* array of task ids */
13 29 unsigned int maxCount;
14 30 int fdSPW = 0;
15 31 int fdUART = 0;
16 32 unsigned char lfrCurrentMode;
17 33
18 34 // APB CONFIGURATION REGISTERS
19 35 time_management_regs_t *time_management_regs = (time_management_regs_t*) REGS_ADDR_TIME_MANAGEMENT;
20 36 gptimer_regs_t *gptimer_regs = (gptimer_regs_t *) REGS_ADDR_GPTIMER;
21 37 #ifdef GSA
22 38 #else
23 39 waveform_picker_regs_t *waveform_picker_regs = (waveform_picker_regs_t*) REGS_ADDR_WAVEFORM_PICKER;
24 40 #endif
25 41 spectral_matrix_regs_t *spectral_matrix_regs = (spectral_matrix_regs_t*) REGS_ADDR_SPECTRAL_MATRIX;
26 42
27 43 // WAVEFORMS GLOBAL VARIABLES // 2048 * 3 * 4 + 2 * 4 = 24576 + 8 bytes
28 44 volatile int wf_snap_f0[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ];
29 45 //
30 46 volatile int wf_snap_f1[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ];
31 47 volatile int wf_snap_f1_bis[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ];
32 48 volatile int wf_snap_f1_norm[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ];
33 49 //
34 50 volatile int wf_snap_f2[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ];
35 51 volatile int wf_snap_f2_bis[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ];
36 52 volatile int wf_snap_f2_norm[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ];
37 53 //
38 54 volatile int wf_cont_f3[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ];
39 55 volatile int wf_cont_f3_bis[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ];
40 56 char wf_cont_f3_light[ NB_SAMPLES_PER_SNAPSHOT * NB_BYTES_CWF3_LIGHT_BLK ];
41 57
42 58 // SPECTRAL MATRICES GLOBAL VARIABLES
43 59 volatile int spec_mat_f0_0[ SM_HEADER + TOTAL_SIZE_SM ];
44 60 volatile int spec_mat_f0_1[ SM_HEADER + TOTAL_SIZE_SM ];
45 61 volatile int spec_mat_f0_a[ SM_HEADER + TOTAL_SIZE_SM ];
46 62 volatile int spec_mat_f0_b[ SM_HEADER + TOTAL_SIZE_SM ];
47 63 volatile int spec_mat_f0_c[ SM_HEADER + TOTAL_SIZE_SM ];
48 64 volatile int spec_mat_f0_d[ SM_HEADER + TOTAL_SIZE_SM ];
49 65 volatile int spec_mat_f0_e[ SM_HEADER + TOTAL_SIZE_SM ];
50 66 volatile int spec_mat_f0_f[ SM_HEADER + TOTAL_SIZE_SM ];
51 67 volatile int spec_mat_f0_g[ SM_HEADER + TOTAL_SIZE_SM ];
52 68 volatile int spec_mat_f0_h[ SM_HEADER + TOTAL_SIZE_SM ];
53 69 volatile int spec_mat_f0_0_bis[ SM_HEADER + TOTAL_SIZE_SM ];
54 70 volatile int spec_mat_f0_1_bis[ SM_HEADER + TOTAL_SIZE_SM ];
55 71 //
56 72 volatile int spec_mat_f1[ SM_HEADER + TOTAL_SIZE_SM ];
57 73 volatile int spec_mat_f1_bis[ SM_HEADER + TOTAL_SIZE_SM ];
58 74 //
59 75 volatile int spec_mat_f2[ SM_HEADER + TOTAL_SIZE_SM ];
60 76 volatile int spec_mat_f2_bis[ SM_HEADER + TOTAL_SIZE_SM ];
61 77
62 78 // MODE PARAMETERS
63 79 Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet;
64 80 struct param_local_str param_local;
65 81
66 82 // HK PACKETS
67 83 Packet_TM_LFR_HK_t housekeeping_packet;
68 84 // sequence counters are incremented by APID (PID + CAT) and destination ID
69 85 unsigned short sequenceCounters[SEQ_CNT_NB_PID][SEQ_CNT_NB_CAT][SEQ_CNT_NB_DEST_ID];
70 86 spw_stats spacewire_stats;
71 87 spw_stats spacewire_stats_backup;
72 88
73 89
@@ -1,573 +1,605
1 /** This is the RTEMS initialization module.
2 *
3 * @file
4 * @author P. LEROY
5 *
6 * This module contains two very different information:
7 * - specific instructions to configure the compilation of the RTEMS executive
8 * - functions related to the fligth softwre initialization, especially the INIT RTEMS task
9 *
10 */
11
1 12 //*************************
2 13 // GPL reminder to be added
3 14 //*************************
4 15
5 16 #include <rtems.h>
6 17
7 18 /* configuration information */
8 19
9 20 #define CONFIGURE_INIT
10 21
11 22 #include <bsp.h> /* for device driver prototypes */
12 23
13 24 /* configuration information */
14 25
15 26 #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
16 27 #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
17 28
18 29 #define CONFIGURE_MAXIMUM_TASKS 20
19 30 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
20 31 #define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE)
21 32 #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 32
22 33 #define CONFIGURE_INIT_TASK_PRIORITY 1 // instead of 100
23 34 #define CONFIGURE_INIT_TASK_MODE (RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT)
24 35 #define CONFIGURE_MAXIMUM_DRIVERS 16
25 36 #define CONFIGURE_MAXIMUM_PERIODS 5
26 37 #define CONFIGURE_MAXIMUM_TIMERS 5 // STAT (1s), send SWF (0.3s), send CWF3 (1s)
27 38 #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 2
28 39 #ifdef PRINT_STACK_REPORT
29 40 #define CONFIGURE_STACK_CHECKER_ENABLED
30 41 #endif
31 42
32 43 #include <rtems/confdefs.h>
33 44
34 45 /* If --drvmgr was enabled during the configuration of the RTEMS kernel */
35 46 #ifdef RTEMS_DRVMGR_STARTUP
36 47 #ifdef LEON3
37 48 /* Add Timer and UART Driver */
38 49 #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
39 50 #define CONFIGURE_DRIVER_AMBAPP_GAISLER_GPTIMER
40 51 #endif
41 52 #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
42 53 #define CONFIGURE_DRIVER_AMBAPP_GAISLER_APBUART
43 54 #endif
44 55 #endif
45 56 #define CONFIGURE_DRIVER_AMBAPP_GAISLER_GRSPW /* GRSPW Driver */
46 57 #include <drvmgr/drvmgr_confdefs.h>
47 58 #endif
48 59
49 60 #include "fsw_init.h"
50 61 #include "fsw_config.c"
51 62
52 63 rtems_task Init( rtems_task_argument ignored )
53 64 {
65 /** This is the RTEMS INIT taks, it the first task launched by the system.
66 *
67 * @param unused is the starting argument of the RTEMS task
68 *
69 * The INIT task create and run all other RTEMS tasks.
70 *
71 */
72
73
54 74 rtems_status_code status;
55 75 rtems_isr_entry old_isr_handler;
56 76
57 77 BOOT_PRINTF("\n\n\n\n\n")
58 78 BOOT_PRINTF("***************************\n")
59 79 BOOT_PRINTF("** START Flight Software **\n")
60 80 BOOT_PRINTF("***************************\n")
61 81 BOOT_PRINTF("\n\n")
62 82
63 83 //send_console_outputs_on_apbuart_port();
64 84 set_apbuart_scaler_reload_register(REGS_ADDR_APBUART, APBUART_SCALER_RELOAD_VALUE);
65 85
66 86 init_parameter_dump();
67 87 init_local_mode_parameters();
68 88 init_housekeeping_parameters();
69 89
70 90 create_names(); // create all names
71 91
72 92 create_message_queues();
73 93
74 94 status = create_all_tasks(); // create all tasks
75 95 if (status != RTEMS_SUCCESSFUL)
76 96 {
77 97 PRINTF1("in INIT *** ERR in create_all_tasks, code %d", status)
78 98 }
79 99
80 100 status = start_all_tasks(); // start all tasks
81 101 if (status != RTEMS_SUCCESSFUL)
82 102 {
83 103 PRINTF1("in INIT *** ERR in start_all_tasks, code %d", status)
84 104 }
85 105
86 106 status = stop_current_mode(); // go in STANDBY mode
87 107 if (status != RTEMS_SUCCESSFUL)
88 108 {
89 109 PRINTF1("in INIT *** ERR in stop_current_mode, code %d", status)
90 110 }
91 111
92 112 grspw_timecode_callback = &timecode_irq_handler;
93 113
94 114 spacewire_configure_link();
95 115
96 116 #ifdef GSA
97 117 // mask IRQ lines
98 118 LEON_Mask_interrupt( IRQ_SM );
99 119 LEON_Mask_interrupt( IRQ_WF );
100 120 // Spectral Matrices simulator
101 121 configure_timer((gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR, CLKDIV_SM_SIMULATOR,
102 122 IRQ_SPARC_SM, spectral_matrices_isr );
103 123 // WaveForms
104 124 configure_timer((gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_WF_SIMULATOR, CLKDIV_WF_SIMULATOR,
105 125 IRQ_SPARC_WF, waveforms_simulator_isr );
106 126 #else
107 127 // mask IRQ lines
108 128 LEON_Mask_interrupt( IRQ_WAVEFORM_PICKER );
109 129 LEON_Mask_interrupt( IRQ_SPECTRAL_MATRIX );
110 130 // reset configuration registers
111 131 reset_waveform_picker_regs();
112 132 reset_spectral_matrix_regs();
113 133 // configure IRQ handling for the waveform picker unit
114 134 status = rtems_interrupt_catch( waveforms_isr,
115 135 IRQ_SPARC_WAVEFORM_PICKER,
116 136 &old_isr_handler) ;
117 137 // configure IRQ handling for the spectral matrix unit
118 138 // status = rtems_interrupt_catch( spectral_matrices_isr,
119 139 // IRQ_SPARC_SPECTRAL_MATRIX,
120 140 // &old_isr_handler) ;
121 141 // Spectral Matrices simulator
122 142 configure_timer((gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR, CLKDIV_SM_SIMULATOR,
123 143 IRQ_SPARC_SM, spectral_matrices_isr_simu );
124 144 #endif
125 145
126 146 BOOT_PRINTF("delete INIT\n")
127 147
128 148 status = rtems_task_delete(RTEMS_SELF);
129 149
130 150 }
131 151
132 152 void init_parameter_dump( void )
133 153 {
154 /** This function initialize the parameter_dump_packet global variable with default values.
155 *
156 */
157
134 158 parameter_dump_packet.targetLogicalAddress = CCSDS_DESTINATION_ID;
135 159 parameter_dump_packet.protocolIdentifier = CCSDS_PROTOCOLE_ID;
136 160 parameter_dump_packet.reserved = CCSDS_RESERVED;
137 161 parameter_dump_packet.userApplication = CCSDS_USER_APP;
138 162 parameter_dump_packet.packetID[0] = (unsigned char) (TM_PACKET_ID_PARAMETER_DUMP >> 8);
139 163 parameter_dump_packet.packetID[1] = (unsigned char) TM_PACKET_ID_PARAMETER_DUMP;
140 164 parameter_dump_packet.packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE;
141 165 parameter_dump_packet.packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
142 166 parameter_dump_packet.packetLength[0] = (unsigned char) (PACKET_LENGTH_PARAMETER_DUMP >> 8);
143 167 parameter_dump_packet.packetLength[1] = (unsigned char) PACKET_LENGTH_PARAMETER_DUMP;
144 168 // DATA FIELD HEADER
145 169 parameter_dump_packet.spare1_pusVersion_spare2 = SPARE1_PUSVERSION_SPARE2;
146 170 parameter_dump_packet.serviceType = TM_TYPE_PARAMETER_DUMP;
147 171 parameter_dump_packet.serviceSubType = TM_SUBTYPE_PARAMETER_DUMP;
148 172 parameter_dump_packet.destinationID = TM_DESTINATION_ID_GROUND;
149 173 parameter_dump_packet.time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
150 174 parameter_dump_packet.time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
151 175 parameter_dump_packet.time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
152 176 parameter_dump_packet.time[3] = (unsigned char) (time_management_regs->coarse_time);
153 177 parameter_dump_packet.time[4] = (unsigned char) (time_management_regs->fine_time>>8);
154 178 parameter_dump_packet.time[5] = (unsigned char) (time_management_regs->fine_time);
155 179 parameter_dump_packet.sid = SID_PARAMETER_DUMP;
156 180
157 181 //******************
158 182 // COMMON PARAMETERS
159 183 parameter_dump_packet.unused0 = DEFAULT_SY_LFR_COMMON0;
160 184 parameter_dump_packet.bw_sp0_sp1_r0_r1 = DEFAULT_SY_LFR_COMMON1;
161 185
162 186 //******************
163 187 // NORMAL PARAMETERS
164 188 parameter_dump_packet.sy_lfr_n_swf_l[0] = (unsigned char) (DEFAULT_SY_LFR_N_SWF_L >> 8);
165 189 parameter_dump_packet.sy_lfr_n_swf_l[1] = (unsigned char) (DEFAULT_SY_LFR_N_SWF_L );
166 190 parameter_dump_packet.sy_lfr_n_swf_p[0] = (unsigned char) (DEFAULT_SY_LFR_N_SWF_P >> 8);
167 191 parameter_dump_packet.sy_lfr_n_swf_p[1] = (unsigned char) (DEFAULT_SY_LFR_N_SWF_P );
168 192 parameter_dump_packet.sy_lfr_n_asm_p[0] = (unsigned char) (DEFAULT_SY_LFR_N_ASM_P >> 8);
169 193 parameter_dump_packet.sy_lfr_n_asm_p[1] = (unsigned char) (DEFAULT_SY_LFR_N_ASM_P );
170 194 parameter_dump_packet.sy_lfr_n_bp_p0 = (unsigned char) DEFAULT_SY_LFR_N_BP_P0;
171 195 parameter_dump_packet.sy_lfr_n_bp_p1 = (unsigned char) DEFAULT_SY_LFR_N_BP_P1;
172 196
173 197 //*****************
174 198 // BURST PARAMETERS
175 199 parameter_dump_packet.sy_lfr_b_bp_p0 = (unsigned char) DEFAULT_SY_LFR_B_BP_P0;
176 200 parameter_dump_packet.sy_lfr_b_bp_p1 = (unsigned char) DEFAULT_SY_LFR_B_BP_P1;
177 201
178 202 //****************
179 203 // SBM1 PARAMETERS
180 204 parameter_dump_packet.sy_lfr_s1_bp_p0 = (unsigned char) DEFAULT_SY_LFR_S1_BP_P0; // min value is 0.25 s for the period
181 205 parameter_dump_packet.sy_lfr_s1_bp_p1 = (unsigned char) DEFAULT_SY_LFR_S1_BP_P1;
182 206
183 207 //****************
184 208 // SBM2 PARAMETERS
185 209 parameter_dump_packet.sy_lfr_s2_bp_p0 = (unsigned char) DEFAULT_SY_LFR_S2_BP_P0;
186 210 parameter_dump_packet.sy_lfr_s2_bp_p1 = (unsigned char) DEFAULT_SY_LFR_S2_BP_P1;
187 211 }
188 212
189 213 void init_local_mode_parameters( void )
190 214 {
215 /** This function initialize the param_local global variable with default values.
216 *
217 */
218
191 219 // LOCAL PARAMETERS
192 220 set_local_sbm1_nb_cwf_max();
193 221 set_local_sbm2_nb_cwf_max();
194 222 set_local_nb_interrupt_f0_MAX();
195 223
196 224 BOOT_PRINTF1("local_sbm1_nb_cwf_max %d \n", param_local.local_sbm1_nb_cwf_max)
197 225 BOOT_PRINTF1("local_sbm2_nb_cwf_max %d \n", param_local.local_sbm2_nb_cwf_max)
198 226 BOOT_PRINTF1("nb_interrupt_f0_MAX = %d\n", param_local.local_nb_interrupt_f0_MAX)
199 227
200 228 reset_local_sbm1_nb_cwf_sent();
201 229 reset_local_sbm2_nb_cwf_sent();
202 230 }
203 231
204 232 void init_housekeeping_parameters( void )
205 233 {
234 /** This function initialize the housekeeping_packet global variable with default values.
235 *
236 */
237
206 238 unsigned int i = 0;
207 239 unsigned int j = 0;
208 240 unsigned int k = 0;
209 241 char *parameters;
210 242
211 243 parameters = (char*) &housekeeping_packet.lfr_status_word;
212 244 for(i = 0; i< SIZE_HK_PARAMETERS; i++)
213 245 {
214 246 parameters[i] = 0x00;
215 247 }
216 248 // init status word
217 249 housekeeping_packet.lfr_status_word[0] = 0x00;
218 250 housekeeping_packet.lfr_status_word[1] = 0x00;
219 251 // init software version
220 252 housekeeping_packet.lfr_sw_version[0] = SW_VERSION_N1;
221 253 housekeeping_packet.lfr_sw_version[1] = SW_VERSION_N2;
222 254 housekeeping_packet.lfr_sw_version[2] = SW_VERSION_N3;
223 255 housekeeping_packet.lfr_sw_version[3] = SW_VERSION_N4;
224 256 // init sequence counters
225 257 for (i = 0; i<SEQ_CNT_NB_PID; i++)
226 258 {
227 259 for(j = 0; j<SEQ_CNT_NB_CAT; j++)
228 260 {
229 261 for(k = 0; k<SEQ_CNT_NB_DEST_ID; k++)
230 262 {
231 263 sequenceCounters[i][j][k] = 0x00;
232 264 }
233 265 }
234 266 }
235 267 updateLFRCurrentMode();
236 268 }
237 269
238 270 int create_names( void ) // create all names for tasks and queues
239 271 {
240 272 /** This function creates all RTEMS names used in the software for tasks and queues.
241 273 *
242 274 * @return RTEMS directive status codes:
243 * - RTEMS_SUCCESSFUL - message sent successfully
275 * - RTEMS_SUCCESSFUL - successful completion
244 276 *
245 277 */
246 278
247 279 // task names
248 280 Task_name[TASKID_RECV] = rtems_build_name( 'R', 'E', 'C', 'V' );
249 281 Task_name[TASKID_ACTN] = rtems_build_name( 'A', 'C', 'T', 'N' );
250 282 Task_name[TASKID_SPIQ] = rtems_build_name( 'S', 'P', 'I', 'Q' );
251 283 Task_name[TASKID_SMIQ] = rtems_build_name( 'S', 'M', 'I', 'Q' );
252 284 Task_name[TASKID_STAT] = rtems_build_name( 'S', 'T', 'A', 'T' );
253 285 Task_name[TASKID_AVF0] = rtems_build_name( 'A', 'V', 'F', '0' );
254 286 Task_name[TASKID_BPF0] = rtems_build_name( 'B', 'P', 'F', '0' );
255 287 Task_name[TASKID_WFRM] = rtems_build_name( 'W', 'F', 'R', 'M' );
256 288 Task_name[TASKID_DUMB] = rtems_build_name( 'D', 'U', 'M', 'B' );
257 289 Task_name[TASKID_HOUS] = rtems_build_name( 'H', 'O', 'U', 'S' );
258 290 Task_name[TASKID_MATR] = rtems_build_name( 'M', 'A', 'T', 'R' );
259 291 Task_name[TASKID_CWF3] = rtems_build_name( 'C', 'W', 'F', '3' );
260 292 Task_name[TASKID_CWF2] = rtems_build_name( 'C', 'W', 'F', '2' );
261 293 Task_name[TASKID_CWF1] = rtems_build_name( 'C', 'W', 'F', '1' );
262 294 Task_name[TASKID_SEND] = rtems_build_name( 'S', 'E', 'N', 'D' );
263 295
264 296 // rate monotonic period name
265 297 HK_name = rtems_build_name( 'H', 'O', 'U', 'S' );
266 298
267 299 misc_name[QUEUE_RECV] = rtems_build_name( 'Q', 'U', 'E', 'U' );
268 300 misc_name[QUEUE_SEND] = rtems_build_name( 'P', 'K', 'T', 'S' );
269 301
270 302 return RTEMS_SUCCESSFUL;
271 303 }
272 304
273 305 int create_all_tasks( void ) // create all tasks which run in the software
274 306 {
275 307 /** This function creates all RTEMS tasks used in the software.
276 308 *
277 309 * @return RTEMS directive status codes:
278 310 * - RTEMS_SUCCESSFUL - task created successfully
279 311 * - RTEMS_INVALID_ADDRESS - id is NULL
280 312 * - RTEMS_INVALID_NAME - invalid task name
281 313 * - RTEMS_INVALID_PRIORITY - invalid task priority
282 314 * - RTEMS_MP_NOT_CONFIGURED - multiprocessing not configured
283 315 * - RTEMS_TOO_MANY - too many tasks created
284 316 * - RTEMS_UNSATISFIED - not enough memory for stack/FP context
285 317 * - RTEMS_TOO_MANY - too many global objects
286 318 *
287 319 */
288 320
289 321 rtems_status_code status;
290 322
291 323 // RECV
292 324 status = rtems_task_create(
293 325 Task_name[TASKID_RECV], TASK_PRIORITY_RECV, RTEMS_MINIMUM_STACK_SIZE,
294 326 RTEMS_DEFAULT_MODES,
295 327 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_RECV]
296 328 );
297 329
298 330 if (status == RTEMS_SUCCESSFUL) // ACTN
299 331 {
300 332 status = rtems_task_create(
301 333 Task_name[TASKID_ACTN], TASK_PRIORITY_ACTN, RTEMS_MINIMUM_STACK_SIZE,
302 334 RTEMS_DEFAULT_MODES,
303 335 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_ACTN]
304 336 );
305 337 }
306 338 if (status == RTEMS_SUCCESSFUL) // SPIQ
307 339 {
308 340 status = rtems_task_create(
309 341 Task_name[TASKID_SPIQ], TASK_PRIORITY_SPIQ, RTEMS_MINIMUM_STACK_SIZE,
310 342 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
311 343 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SPIQ]
312 344 );
313 345 }
314 346 if (status == RTEMS_SUCCESSFUL) // SMIQ
315 347 {
316 348 status = rtems_task_create(
317 349 Task_name[TASKID_SMIQ], TASK_PRIORITY_SMIQ, RTEMS_MINIMUM_STACK_SIZE,
318 350 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
319 351 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SMIQ]
320 352 );
321 353 }
322 354 if (status == RTEMS_SUCCESSFUL) // STAT
323 355 {
324 356 status = rtems_task_create(
325 357 Task_name[TASKID_STAT], TASK_PRIORITY_STAT, RTEMS_MINIMUM_STACK_SIZE,
326 358 RTEMS_DEFAULT_MODES,
327 359 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_STAT]
328 360 );
329 361 }
330 362 if (status == RTEMS_SUCCESSFUL) // AVF0
331 363 {
332 364 status = rtems_task_create(
333 365 Task_name[TASKID_AVF0], TASK_PRIORITY_AVF0, RTEMS_MINIMUM_STACK_SIZE,
334 366 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
335 367 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_AVF0]
336 368 );
337 369 }
338 370 if (status == RTEMS_SUCCESSFUL) // BPF0
339 371 {
340 372 status = rtems_task_create(
341 373 Task_name[TASKID_BPF0], TASK_PRIORITY_BPF0, RTEMS_MINIMUM_STACK_SIZE,
342 374 RTEMS_DEFAULT_MODES,
343 375 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_BPF0]
344 376 );
345 377 }
346 378 if (status == RTEMS_SUCCESSFUL) // WFRM
347 379 {
348 380 status = rtems_task_create(
349 381 Task_name[TASKID_WFRM], TASK_PRIORITY_WFRM, RTEMS_MINIMUM_STACK_SIZE,
350 382 RTEMS_DEFAULT_MODES,
351 383 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_WFRM]
352 384 );
353 385 }
354 386 if (status == RTEMS_SUCCESSFUL) // DUMB
355 387 {
356 388 status = rtems_task_create(
357 389 Task_name[TASKID_DUMB], TASK_PRIORITY_DUMB, RTEMS_MINIMUM_STACK_SIZE,
358 390 RTEMS_DEFAULT_MODES,
359 391 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_DUMB]
360 392 );
361 393 }
362 394 if (status == RTEMS_SUCCESSFUL) // HOUS
363 395 {
364 396 status = rtems_task_create(
365 397 Task_name[TASKID_HOUS], TASK_PRIORITY_HOUS, RTEMS_MINIMUM_STACK_SIZE,
366 398 RTEMS_DEFAULT_MODES,
367 399 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_HOUS]
368 400 );
369 401 }
370 402 if (status == RTEMS_SUCCESSFUL) // MATR
371 403 {
372 404 status = rtems_task_create(
373 405 Task_name[TASKID_MATR], TASK_PRIORITY_MATR, RTEMS_MINIMUM_STACK_SIZE,
374 406 RTEMS_DEFAULT_MODES,
375 407 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_MATR]
376 408 );
377 409 }
378 410 if (status == RTEMS_SUCCESSFUL) // CWF3
379 411 {
380 412 status = rtems_task_create(
381 413 Task_name[TASKID_CWF3], TASK_PRIORITY_CWF3, RTEMS_MINIMUM_STACK_SIZE,
382 414 RTEMS_DEFAULT_MODES,
383 415 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_CWF3]
384 416 );
385 417 }
386 418 if (status == RTEMS_SUCCESSFUL) // CWF2
387 419 {
388 420 status = rtems_task_create(
389 421 Task_name[TASKID_CWF2], TASK_PRIORITY_CWF2, RTEMS_MINIMUM_STACK_SIZE,
390 422 RTEMS_DEFAULT_MODES,
391 423 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_CWF2]
392 424 );
393 425 }
394 426 if (status == RTEMS_SUCCESSFUL) // CWF1
395 427 {
396 428 status = rtems_task_create(
397 429 Task_name[TASKID_CWF1], TASK_PRIORITY_CWF1, RTEMS_MINIMUM_STACK_SIZE,
398 430 RTEMS_DEFAULT_MODES,
399 431 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_CWF1]
400 432 );
401 433 }
402 434 if (status == RTEMS_SUCCESSFUL) // SEND
403 435 {
404 436 status = rtems_task_create(
405 437 Task_name[TASKID_SEND], TASK_PRIORITY_SEND, RTEMS_MINIMUM_STACK_SIZE,
406 438 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
407 439 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SEND]
408 440 );
409 441 }
410 442
411 443 return status;
412 444 }
413 445
414 446 int start_all_tasks( void )
415 447 {
416 448 /** This function starts all RTEMS tasks used in the software.
417 449 *
418 450 * @return RTEMS directive status codes:
419 451 * - RTEMS_SUCCESSFUL - ask started successfully
420 452 * - RTEMS_INVALID_ADDRESS - invalid task entry point
421 453 * - RTEMS_INVALID_ID - invalid task id
422 454 * - RTEMS_INCORRECT_STATE - task not in the dormant state
423 455 * - RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot start remote task
424 456 *
425 457 */
426 458 // starts all the tasks fot eh flight software
427 459
428 460 rtems_status_code status;
429 461
430 462 status = rtems_task_start( Task_id[TASKID_SPIQ], spiq_task, 1 );
431 463 if (status!=RTEMS_SUCCESSFUL) {
432 464 BOOT_PRINTF("in INIT *** Error starting TASK_SPIQ\n")
433 465 }
434 466
435 467 if (status == RTEMS_SUCCESSFUL) // SMIQ
436 468 {
437 469 status = rtems_task_start( Task_id[TASKID_SMIQ], smiq_task, 1 );
438 470 if (status!=RTEMS_SUCCESSFUL) {
439 471 BOOT_PRINTF("in INIT *** Error starting TASK_BPPR\n")
440 472 }
441 473 }
442 474
443 475 if (status == RTEMS_SUCCESSFUL) // RECV
444 476 {
445 477 status = rtems_task_start( Task_id[TASKID_RECV], recv_task, 1 );
446 478 if (status!=RTEMS_SUCCESSFUL) {
447 479 BOOT_PRINTF("in INIT *** Error starting TASK_RECV\n")
448 480 }
449 481 }
450 482
451 483 if (status == RTEMS_SUCCESSFUL) // SEND
452 484 {
453 485 status = rtems_task_start( Task_id[TASKID_SEND], send_task, 1 );
454 486 if (status!=RTEMS_SUCCESSFUL) {
455 487 BOOT_PRINTF("in INIT *** Error starting TASK_SEND\n")
456 488 }
457 489 }
458 490
459 491 if (status == RTEMS_SUCCESSFUL) // ACTN
460 492 {
461 493 status = rtems_task_start( Task_id[TASKID_ACTN], actn_task, 1 );
462 494 if (status!=RTEMS_SUCCESSFUL) {
463 495 BOOT_PRINTF("in INIT *** Error starting TASK_ACTN\n")
464 496 }
465 497 }
466 498
467 499 if (status == RTEMS_SUCCESSFUL) // STAT
468 500 {
469 501 status = rtems_task_start( Task_id[TASKID_STAT], stat_task, 1 );
470 502 if (status!=RTEMS_SUCCESSFUL) {
471 503 BOOT_PRINTF("in INIT *** Error starting TASK_STAT\n")
472 504 }
473 505 }
474 506
475 507 if (status == RTEMS_SUCCESSFUL) // AVF0
476 508 {
477 509 status = rtems_task_start( Task_id[TASKID_AVF0], avf0_task, 1 );
478 510 if (status!=RTEMS_SUCCESSFUL) {
479 511 BOOT_PRINTF("in INIT *** Error starting TASK_AVF0\n")
480 512 }
481 513 }
482 514
483 515 if (status == RTEMS_SUCCESSFUL) // BPF0
484 516 {
485 517 status = rtems_task_start( Task_id[TASKID_BPF0], bpf0_task, 1 );
486 518 if (status!=RTEMS_SUCCESSFUL) {
487 519 BOOT_PRINTF("in INIT *** Error starting TASK_BPF0\n")
488 520 }
489 521 }
490 522
491 523 if (status == RTEMS_SUCCESSFUL) // WFRM
492 524 {
493 525 status = rtems_task_start( Task_id[TASKID_WFRM], wfrm_task, 1 );
494 526 if (status!=RTEMS_SUCCESSFUL) {
495 527 BOOT_PRINTF("in INIT *** Error starting TASK_WFRM\n")
496 528 }
497 529 }
498 530
499 531 if (status == RTEMS_SUCCESSFUL) // DUMB
500 532 {
501 533 status = rtems_task_start( Task_id[TASKID_DUMB], dumb_task, 1 );
502 534 if (status!=RTEMS_SUCCESSFUL) {
503 535 BOOT_PRINTF("in INIT *** Error starting TASK_DUMB\n")
504 536 }
505 537 }
506 538
507 539 if (status == RTEMS_SUCCESSFUL) // HOUS
508 540 {
509 541 status = rtems_task_start( Task_id[TASKID_HOUS], hous_task, 1 );
510 542 if (status!=RTEMS_SUCCESSFUL) {
511 543 BOOT_PRINTF("in INIT *** Error starting TASK_HOUS\n")
512 544 }
513 545 }
514 546
515 547 if (status == RTEMS_SUCCESSFUL) // MATR
516 548 {
517 549 status = rtems_task_start( Task_id[TASKID_MATR], matr_task, 1 );
518 550 if (status!=RTEMS_SUCCESSFUL) {
519 551 BOOT_PRINTF("in INIT *** Error starting TASK_MATR\n")
520 552 }
521 553 }
522 554
523 555 if (status == RTEMS_SUCCESSFUL) // CWF3
524 556 {
525 557 status = rtems_task_start( Task_id[TASKID_CWF3], cwf3_task, 1 );
526 558 if (status!=RTEMS_SUCCESSFUL) {
527 559 BOOT_PRINTF("in INIT *** Error starting TASK_CWF3\n")
528 560 }
529 561 }
530 562
531 563 if (status == RTEMS_SUCCESSFUL) // CWF2
532 564 {
533 565 status = rtems_task_start( Task_id[TASKID_CWF2], cwf2_task, 1 );
534 566 if (status!=RTEMS_SUCCESSFUL) {
535 567 BOOT_PRINTF("in INIT *** Error starting TASK_CWF2\n")
536 568 }
537 569 }
538 570
539 571 if (status == RTEMS_SUCCESSFUL) // CWF1
540 572 {
541 573 status = rtems_task_start( Task_id[TASKID_CWF1], cwf1_task, 1 );
542 574 if (status!=RTEMS_SUCCESSFUL) {
543 575 BOOT_PRINTF("in INIT *** Error starting TASK_CWF1\n")
544 576 }
545 577 }
546 578
547 579 return status;
548 580 }
549 581
550 582 rtems_status_code create_message_queues( void ) // create the two message queues used in the software
551 583 {
552 584 rtems_status_code status;
553 585 rtems_status_code ret;
554 586 rtems_id queue_id;
555 587
556 588 // create the queue for handling valid TCs
557 589 status = rtems_message_queue_create( misc_name[QUEUE_RECV], ACTION_MSG_QUEUE_COUNT, CCSDS_TC_PKT_MAX_SIZE,
558 590 RTEMS_FIFO | RTEMS_LOCAL, &queue_id );
559 591 if (status != RTEMS_SUCCESSFUL) {
560 592 ret = status;
561 593 BOOT_PRINTF1("in create_message_queues *** ERR creating QUEU queue, %d\n", ret)
562 594 }
563 595
564 596 // create the queue for handling TM packet sending
565 597 ret = rtems_message_queue_create( misc_name[QUEUE_SEND], ACTION_MSG_PKTS_COUNT,
566 598 ACTION_MSG_PKTS_MAX_SIZE,
567 599 RTEMS_FIFO | RTEMS_LOCAL, &queue_id );
568 600 if (ret != RTEMS_SUCCESSFUL) {
569 601 BOOT_PRINTF1("in create_message_queues *** ERR creating PKTS queue, %d\n", ret)
570 602 }
571 603
572 604 return ret;
573 605 }
@@ -1,331 +1,274
1 /** General usage functions and RTEMS tasks.
2 *
3 * @file
4 * @author P. LEROY
5 *
6 */
7
1 8 #include "fsw_misc.h"
2 9
10 char *DumbMessages[6] = {"in DUMB *** default", // RTEMS_EVENT_0
11 "in DUMB *** timecode_irq_handler", // RTEMS_EVENT_1
12 "in DUMB *** waveforms_isr", // RTEMS_EVENT_2
13 "in DUMB *** in SMIQ *** Error sending event to AVF0", // RTEMS_EVENT_3
14 "in DUMB *** spectral_matrices_isr *** Error sending event to SMIQ", // RTEMS_EVENT_4
15 "in DUMB *** waveforms_simulator_isr" // RTEMS_EVENT_5
16 };
17
3 18 int configure_timer(gptimer_regs_t *gptimer_regs, unsigned char timer, unsigned int clock_divider,
4 19 unsigned char interrupt_level, rtems_isr (*timer_isr)() )
5 { // configure the timer for the waveforms simulation
20 {
21 /** This function configures a GPTIMER timer instantiated in the VHDL design.
22 *
23 * @param gptimer_regs points to the APB registers of the GPTIMER IP core.
24 * @param timer is the number of the timer in the IP core (several timers can be instantiated).
25 * @param clock_divider is the divider of the 1 MHz clock that will be configured.
26 * @param interrupt_level is the interrupt level that the timer drives.
27 * @param timer_isr is the interrupt subroutine that will be attached to the IRQ driven by the timer.
28 *
29 * @return
30 *
31 * Interrupt levels are described in the SPARC documentation sparcv8.pdf p.76
32 *
33 */
34
6 35 rtems_status_code status;
7 36 rtems_isr_entry old_isr_handler;
8 37
9 38 status = rtems_interrupt_catch( timer_isr, interrupt_level, &old_isr_handler) ; // see sparcv8.pdf p.76 for interrupt levels
10 39 if (status!=RTEMS_SUCCESSFUL)
11 40 {
12 41 PRINTF("in configure_timer *** ERR rtems_interrupt_catch\n")
13 42 }
14 43
15 44 timer_set_clock_divider( gptimer_regs, timer, clock_divider);
16 45
17 46 return 1;
18 47 }
19 48
20 49 int timer_start(gptimer_regs_t *gptimer_regs, unsigned char timer)
21 50 {
51 /** This function starts a GPTIMER timer.
52 *
53 * @param gptimer_regs points to the APB registers of the GPTIMER IP core.
54 * @param timer is the number of the timer in the IP core (several timers can be instantiated).
55 *
56 * @return 1
57 *
58 */
59
22 60 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000010; // clear pending IRQ if any
23 61 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000004; // LD load value from the reload register
24 62 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000001; // EN enable the timer
25 63 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000002; // RS restart
26 64 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000008; // IE interrupt enable
27 65
28 66 return 1;
29 67 }
30 68
31 69 int timer_stop(gptimer_regs_t *gptimer_regs, unsigned char timer)
32 70 {
71 /** This function stops a GPTIMER timer.
72 *
73 * @param gptimer_regs points to the APB registers of the GPTIMER IP core.
74 * @param timer is the number of the timer in the IP core (several timers can be instantiated).
75 *
76 * @return 1
77 *
78 */
79
33 80 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl & 0xfffffffe; // EN enable the timer
34 81 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl & 0xffffffef; // IE interrupt enable
35 82 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000010; // clear pending IRQ if any
36 83
37 84 return 1;
38 85 }
39 86
40 87 int timer_set_clock_divider(gptimer_regs_t *gptimer_regs, unsigned char timer, unsigned int clock_divider)
41 88 {
89 /** This function sets the clock divider of a GPTIMER timer.
90 *
91 * @param gptimer_regs points to the APB registers of the GPTIMER IP core.
92 * @param timer is the number of the timer in the IP core (several timers can be instantiated).
93 * @param clock_divider is the divider of the 1 MHz clock that will be configured.
94 *
95 * @return 1
96 *
97 */
98
42 99 gptimer_regs->timer[timer].reload = clock_divider; // base clock frequency is 1 MHz
43 100
44 101 return 1;
45 102 }
46 103
47 void update_spacewire_statistics()
48 {
49 rtems_status_code status;
50 spw_stats spacewire_stats_grspw;
51
52 status = ioctl( fdSPW, SPACEWIRE_IOCTRL_GET_STATISTICS, &spacewire_stats_grspw );
53
54 spacewire_stats.packets_received = spacewire_stats_backup.packets_received
55 + spacewire_stats_grspw.packets_received;
56 spacewire_stats.packets_sent = spacewire_stats_backup.packets_sent
57 + spacewire_stats_grspw.packets_sent;
58 spacewire_stats.parity_err = spacewire_stats_backup.parity_err
59 + spacewire_stats_grspw.parity_err;
60 spacewire_stats.disconnect_err = spacewire_stats_backup.disconnect_err
61 + spacewire_stats_grspw.disconnect_err;
62 spacewire_stats.escape_err = spacewire_stats_backup.escape_err
63 + spacewire_stats_grspw.escape_err;
64 spacewire_stats.credit_err = spacewire_stats_backup.credit_err
65 + spacewire_stats_grspw.credit_err;
66 spacewire_stats.write_sync_err = spacewire_stats_backup.write_sync_err
67 + spacewire_stats_grspw.write_sync_err;
68 spacewire_stats.rx_rmap_header_crc_err = spacewire_stats_backup.rx_rmap_header_crc_err
69 + spacewire_stats_grspw.rx_rmap_header_crc_err;
70 spacewire_stats.rx_rmap_data_crc_err = spacewire_stats_backup.rx_rmap_data_crc_err
71 + spacewire_stats_grspw.rx_rmap_data_crc_err;
72 spacewire_stats.early_ep = spacewire_stats_backup.early_ep
73 + spacewire_stats_grspw.early_ep;
74 spacewire_stats.invalid_address = spacewire_stats_backup.invalid_address
75 + spacewire_stats_grspw.invalid_address;
76 spacewire_stats.rx_eep_err = spacewire_stats_backup.rx_eep_err
77 + spacewire_stats_grspw.rx_eep_err;
78 spacewire_stats.rx_truncated = spacewire_stats_backup.rx_truncated
79 + spacewire_stats_grspw.rx_truncated;
80 //spacewire_stats.tx_link_err;
81
82 //****************************
83 // DPU_SPACEWIRE_IF_STATISTICS
84 housekeeping_packet.hk_lfr_dpu_spw_pkt_rcv_cnt[0] = (unsigned char) (spacewire_stats.packets_received >> 8);
85 housekeeping_packet.hk_lfr_dpu_spw_pkt_rcv_cnt[1] = (unsigned char) (spacewire_stats.packets_received);
86 housekeeping_packet.hk_lfr_dpu_spw_pkt_sent_cnt[0] = (unsigned char) (spacewire_stats.packets_sent >> 8);
87 housekeeping_packet.hk_lfr_dpu_spw_pkt_sent_cnt[1] = (unsigned char) (spacewire_stats.packets_sent);
88 //housekeeping_packet.hk_lfr_dpu_spw_tick_out_cnt;
89 //housekeeping_packet.hk_lfr_dpu_spw_last_timc;
90
91 //******************************************
92 // ERROR COUNTERS / SPACEWIRE / LOW SEVERITY
93 housekeeping_packet.hk_lfr_dpu_spw_parity = (unsigned char) spacewire_stats.parity_err;
94 housekeeping_packet.hk_lfr_dpu_spw_disconnect = (unsigned char) spacewire_stats.disconnect_err;
95 housekeeping_packet.hk_lfr_dpu_spw_escape = (unsigned char) spacewire_stats.escape_err;
96 housekeeping_packet.hk_lfr_dpu_spw_credit = (unsigned char) spacewire_stats.credit_err;
97 housekeeping_packet.hk_lfr_dpu_spw_write_sync = (unsigned char) spacewire_stats.write_sync_err;
98 // housekeeping_packet.hk_lfr_dpu_spw_rx_ahb;
99 // housekeeping_packet.hk_lfr_dpu_spw_tx_ahb;
100 housekeeping_packet.hk_lfr_dpu_spw_header_crc = (unsigned char) spacewire_stats.rx_rmap_header_crc_err;
101 housekeeping_packet.hk_lfr_dpu_spw_data_crc = (unsigned char) spacewire_stats.rx_rmap_data_crc_err;
102
103 //*********************************************
104 // ERROR COUNTERS / SPACEWIRE / MEDIUM SEVERITY
105 housekeeping_packet.hk_lfr_dpu_spw_early_eop = (unsigned char) spacewire_stats.early_ep;
106 housekeeping_packet.hk_lfr_dpu_spw_invalid_addr = (unsigned char) spacewire_stats.invalid_address;
107 housekeeping_packet.hk_lfr_dpu_spw_eep = (unsigned char) spacewire_stats.rx_eep_err;
108 housekeeping_packet.hk_lfr_dpu_spw_rx_too_big = (unsigned char) spacewire_stats.rx_truncated;
109
110 }
111
112 104 int send_console_outputs_on_apbuart_port( void ) // Send the console outputs on the apbuart port
113 105 {
114 106 struct apbuart_regs_str *apbuart_regs = (struct apbuart_regs_str *) REGS_ADDR_APBUART;
115 107
116 108 apbuart_regs->ctrl = apbuart_regs->ctrl & APBUART_CTRL_REG_MASK_DB;
117 109 PRINTF("\n\n\n\n\nIn INIT *** Now the console is on port COM1\n")
118 110
119 111 return 0;
120 112 }
121 113
122 114 void set_apbuart_scaler_reload_register(unsigned int regs, unsigned int value)
123 115 {
124 116 /** This function sets the scaler reload register of the apbuart module
125 117 *
126 118 * @param regs is the address of the apbuart registers in memory
127 119 * @param value is the value that will be stored in the scaler register
128 120 *
129 121 * The value shall be set by the software to get data on the serial interface.
130 122 *
131 123 */
132 124
133 125 struct apbuart_regs_str *apbuart_regs = (struct apbuart_regs_str *) regs;
134 126
135 127 apbuart_regs->scaler = value;
136 128 BOOT_PRINTF1("OK *** apbuart port scaler reload register set to 0x%x\n", value)
137 129 }
138 130
139 131 //************
140 132 // RTEMS TASKS
141 133
142 134 rtems_task stat_task(rtems_task_argument argument)
143 135 {
144 136 int i;
145 137 int j;
146 138 i = 0;
147 139 j = 0;
148 140 BOOT_PRINTF("in STAT *** \n")
149 141 while(1){
150 142 rtems_task_wake_after(1000);
151 143 PRINTF1("%d\n", j)
152 144 if (i == CPU_USAGE_REPORT_PERIOD) {
153 145 // #ifdef PRINT_TASK_STATISTICS
154 146 // rtems_cpu_usage_report();
155 147 // rtems_cpu_usage_reset();
156 148 // #endif
157 149 i = 0;
158 150 }
159 151 else i++;
160 152 j++;
161 153 }
162 154 }
163 155
164 156 rtems_task hous_task(rtems_task_argument argument)
165 157 {
166 158 rtems_status_code status;
167 159 spw_ioctl_pkt_send spw_ioctl_send;
168 160 rtems_id queue_id;
169 161
170 162 spw_ioctl_send.hlen = 0;
171 163 spw_ioctl_send.hdr = NULL;
172 164 spw_ioctl_send.dlen = PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES;
173 165 spw_ioctl_send.data = (char*) &housekeeping_packet;
174 166 spw_ioctl_send.options = 0;
175 167
176 168 status = rtems_message_queue_ident( misc_name[QUEUE_SEND], 0, &queue_id );
177 169 if (status != RTEMS_SUCCESSFUL)
178 170 {
179 171 PRINTF1("in HOUS *** ERR %d\n", status)
180 172 }
181 173
182 174 BOOT_PRINTF("in HOUS ***\n")
183 175
184 176 if (rtems_rate_monotonic_ident( HK_name, &HK_id) != RTEMS_SUCCESSFUL) {
185 177 status = rtems_rate_monotonic_create( HK_name, &HK_id );
186 178 if( status != RTEMS_SUCCESSFUL ) {
187 179 PRINTF1( "rtems_rate_monotonic_create failed with status of %d\n", status )
188 180 }
189 181 }
190 182
191 183 housekeeping_packet.targetLogicalAddress = CCSDS_DESTINATION_ID;
192 184 housekeeping_packet.protocolIdentifier = CCSDS_PROTOCOLE_ID;
193 185 housekeeping_packet.reserved = DEFAULT_RESERVED;
194 186 housekeeping_packet.userApplication = CCSDS_USER_APP;
195 187 housekeeping_packet.packetID[0] = (unsigned char) (TM_PACKET_ID_HK >> 8);
196 188 housekeeping_packet.packetID[1] = (unsigned char) (TM_PACKET_ID_HK);
197 189 housekeeping_packet.packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE;
198 190 housekeeping_packet.packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
199 191 housekeeping_packet.packetLength[0] = (unsigned char) (PACKET_LENGTH_HK >> 8);
200 192 housekeeping_packet.packetLength[1] = (unsigned char) (PACKET_LENGTH_HK );
201 193 housekeeping_packet.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
202 194 housekeeping_packet.serviceType = TM_TYPE_HK;
203 195 housekeeping_packet.serviceSubType = TM_SUBTYPE_HK;
204 196 housekeeping_packet.destinationID = TM_DESTINATION_ID_GROUND;
205 197
206 198 status = rtems_rate_monotonic_cancel(HK_id);
207 199 if( status != RTEMS_SUCCESSFUL ) {
208 200 PRINTF1( "ERR *** in HOUS *** rtems_rate_monotonic_cancel(HK_id) ***code: %d\n", status )
209 201 }
210 202 else {
211 203 DEBUG_PRINTF("OK *** in HOUS *** rtems_rate_monotonic_cancel(HK_id)\n")
212 204 }
213 205
214 206 while(1){ // launch the rate monotonic task
215 207 status = rtems_rate_monotonic_period( HK_id, HK_PERIOD );
216 208 if ( status != RTEMS_SUCCESSFUL ) {
217 209 PRINTF1( "ERR *** in HOUS *** rtems_rate_monotonic_period *** code %d\n", status);
218 210 }
219 211 else {
220 212 housekeeping_packet.time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
221 213 housekeeping_packet.time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
222 214 housekeeping_packet.time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
223 215 housekeeping_packet.time[3] = (unsigned char) (time_management_regs->coarse_time);
224 216 housekeeping_packet.time[4] = (unsigned char) (time_management_regs->fine_time>>8);
225 217 housekeeping_packet.time[5] = (unsigned char) (time_management_regs->fine_time);
226 218 housekeeping_packet.sid = SID_HK;
227 219
228 update_spacewire_statistics();
220 spacewire_update_statistics();
229 221
230 222 // SEND PACKET
231 223 status = rtems_message_queue_send( queue_id, &spw_ioctl_send, ACTION_MSG_SPW_IOCTL_SEND_SIZE);
232 224 if (status != RTEMS_SUCCESSFUL) {
233 225 PRINTF1("in HOUS *** ERR %d\n", status)
234 226 }
235 227 }
236 228 }
237 229
238 230 PRINTF("in HOUS *** deleting task\n")
239 231
240 232 status = rtems_task_delete( RTEMS_SELF ); // should not return
241 233 printf( "rtems_task_delete returned with status of %d.\n", status );
242 exit( 1 );
243 }
244
245 rtems_task send_task( rtems_task_argument argument)
246 {
247 rtems_status_code status; // RTEMS status code
248 char incomingData[ACTION_MSG_PKTS_MAX_SIZE]; // incoming data buffer
249 spw_ioctl_pkt_send *spw_ioctl_send;
250 size_t size; // size of the incoming TC packet
251 u_int32_t count;
252 rtems_id queue_id;
253
254 status = rtems_message_queue_ident( misc_name[QUEUE_SEND], 0, &queue_id );
255 if (status != RTEMS_SUCCESSFUL)
256 {
257 PRINTF1("in SEND *** ERR getting queue id, %d\n", status)
234 return;
258 235 }
259 236
260 BOOT_PRINTF("in SEND *** \n")
261
262 while(1)
263 {
264 status = rtems_message_queue_receive( queue_id, incomingData, &size,
265 RTEMS_WAIT, RTEMS_NO_TIMEOUT );
266
267 if (status!=RTEMS_SUCCESSFUL)
268 {
269 PRINTF1("in SEND *** (1) ERR = %d\n", status)
270 }
271 else
272 {
273 if ( incomingData[0] == CCSDS_DESTINATION_ID) // the incoming message is a ccsds packet
237 rtems_task dumb_task( rtems_task_argument unused )
274 238 {
275 status = write( fdSPW, incomingData, size );
276 if (status == -1){
277 PRINTF2("in SEND *** (2.a) ERR = %d, size = %d\n", status, size)
278 }
279 }
280 else // the incoming message is a spw_ioctl_pkt_send structure
281 {
282 spw_ioctl_send = (spw_ioctl_pkt_send*) incomingData;
283 if (spw_ioctl_send->hlen == 0)
239 /** This RTEMS taks is used to print messages without affecting the general behaviour of the software.
240 *
241 * @param unused is the starting argument of the RTEMS task
242 *
243 * The DUMB taks waits for RTEMS events and print messages depending on the incoming events.
244 *
245 */
246
247 unsigned int i;
248 unsigned int intEventOut;
249 unsigned int coarse_time = 0;
250 unsigned int fine_time = 0;
251 rtems_event_set event_out;
252
253 BOOT_PRINTF("in DUMB *** \n")
254
255 while(1){
256 rtems_event_receive(RTEMS_EVENT_0 | RTEMS_EVENT_1 | RTEMS_EVENT_2 | RTEMS_EVENT_3 | RTEMS_EVENT_4 | RTEMS_EVENT_5,
257 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT
258 intEventOut = (unsigned int) event_out;
259 for ( i=0; i<32; i++)
284 260 {
285 status = write( fdSPW, spw_ioctl_send->data, spw_ioctl_send->dlen );
286 if (status == -1){
287 PRINTF2("in SEND *** (2.b) ERR = %d, dlen = %d\n", status, spw_ioctl_send->dlen)
288 }
289 }
290 else
261 if ( ((intEventOut >> i) & 0x0001) != 0)
291 262 {
292 status = ioctl( fdSPW, SPACEWIRE_IOCTRL_SEND, spw_ioctl_send );
293 if (status == -1){
294 PRINTF2("in SEND *** (2.c) ERR = %d, dlen = %d\n", status, spw_ioctl_send->dlen)
295 PRINTF1(" hlen = %d\n", spw_ioctl_send->hlen)
263 coarse_time = time_management_regs->coarse_time;
264 fine_time = time_management_regs->fine_time;
265 printf("in DUMB *** time = coarse: %x, fine: %x, %s\n", coarse_time, fine_time, DumbMessages[i]);
296 266 }
297 267 }
298 268 }
299 269 }
300 270
301 status = rtems_message_queue_get_number_pending( queue_id, &count );
302 if (status != RTEMS_SUCCESSFUL)
303 {
304 PRINTF1("in SEND *** (3) ERR = %d\n", status)
305 }
306 else
307 {
308 if (count > maxCount)
309 {
310 maxCount = count;
311 }
312 }
313 }
314 }
315
316 rtems_id get_pkts_queue_id( void )
317 {
318 rtems_id queue_id;
319 rtems_status_code status;
320
321 status = rtems_message_queue_ident( misc_name[QUEUE_SEND], 0, &queue_id );
322 if (status != RTEMS_SUCCESSFUL)
323 {
324 PRINTF1("in get_pkts_queue_id *** ERR %d\n", status)
325 }
326 return queue_id;
327 }
328 271
329 272
330 273
331 274
@@ -1,669 +1,678
1 /** Functions related to data processing.
2 *
3 * @file
4 * @author P. LEROY
5 *
6 * These function are related to data processing, i.e. spectral matrices averaging and basic parameters computation.
7 *
8 */
9
1 10 #include <fsw_processing.h>
2 11 #include <math.h>
3 12
4 #include <fsw_processing_globals.c>
13 #include "fsw_processing_globals.c"
5 14
6 15 unsigned char LFR_BP1_F0[ NB_BINS_COMPRESSED_SM_F0 * 9 ];
7 16 BP1_t data_BP1[ NB_BINS_COMPRESSED_SM_F0 ];
8 17 float averaged_spec_mat_f0[ TOTAL_SIZE_SM ];
9 18 char averaged_spec_mat_f0_char[ TOTAL_SIZE_SM * 2 ];
10 19 float compressed_spec_mat_f0[ TOTAL_SIZE_COMPRESSED_MATRIX_f0 ];
11 20
12 21 //***********************************************************
13 22 // Interrupt Service Routine for spectral matrices processing
14 23 rtems_isr spectral_matrices_isr( rtems_vector_number vector )
15 24 {
16 25 unsigned char status;
17 26 unsigned char i;
18 27
19 28 status = spectral_matrix_regs->status; //[f2 f1 f0_1 f0_0]
20 29 for (i=0; i<4; i++)
21 30 {
22 31 if ( ( (status >> i) & 0x01) == 1) // (1) buffer rotation
23 32 {
24 33 switch(i)
25 34 {
26 35 case 0:
27 36 if (spectral_matrix_regs->matrixF0_Address0 == (int) spec_mat_f0_0)
28 37 {
29 38 spectral_matrix_regs->matrixF0_Address0 = (int) spec_mat_f0_0_bis;
30 39 }
31 40 else
32 41 {
33 42 spectral_matrix_regs->matrixF0_Address0 = (int) spec_mat_f0_0;
34 43 }
35 44 spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffffe;
36 45 break;
37 46 case 1:
38 47 if (spectral_matrix_regs->matrixFO_Address1 == (int) spec_mat_f0_1)
39 48 {
40 49 spectral_matrix_regs->matrixFO_Address1 = (int) spec_mat_f0_1_bis;
41 50 }
42 51 else
43 52 {
44 53 spectral_matrix_regs->matrixFO_Address1 = (int) spec_mat_f0_1;
45 54 }
46 55 spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffffd;
47 56 break;
48 57 case 2:
49 58 if (spectral_matrix_regs->matrixF1_Address == (int) spec_mat_f1)
50 59 {
51 60 spectral_matrix_regs->matrixF1_Address = (int) spec_mat_f1_bis;
52 61 }
53 62 else
54 63 {
55 64 spectral_matrix_regs->matrixF1_Address = (int) spec_mat_f1;
56 65 }
57 66 spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffffb;
58 67 break;
59 68 case 3:
60 69 if (spectral_matrix_regs->matrixF2_Address == (int) spec_mat_f2)
61 70 {
62 71 spectral_matrix_regs->matrixF2_Address = (int) spec_mat_f2_bis;
63 72 }
64 73 else
65 74 {
66 75 spectral_matrix_regs->matrixF2_Address = (int) spec_mat_f2;
67 76 }
68 77 spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffff7;
69 78 break;
70 79 default:
71 80 break;
72 81 }
73 82 }
74 83 }
75 84
76 85 // reset error codes to 0
77 86 spectral_matrix_regs->status = spectral_matrix_regs->status & 0xffffffcf; // [1100 1111]
78 87
79 88 if (rtems_event_send( Task_id[TASKID_SMIQ], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) {
80 89 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_4 );
81 90 }
82 91 }
83 92
84 93 rtems_isr spectral_matrices_isr_simu( rtems_vector_number vector )
85 94 {
86 95 if (rtems_event_send( Task_id[TASKID_SMIQ], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) {
87 96 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_4 );
88 97 }
89 98 }
90 99
91 100 //************
92 101 // RTEMS TASKS
93 102
94 103 rtems_task smiq_task(rtems_task_argument argument) // process the Spectral Matrices IRQ
95 104 {
96 105 rtems_event_set event_out;
97 106 unsigned int nb_interrupt_f0 = 0;
98 107
99 108 BOOT_PRINTF("in SMIQ *** \n")
100 109
101 110 while(1){
102 111 rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT0
103 112 nb_interrupt_f0 = nb_interrupt_f0 + 1;
104 113 if (nb_interrupt_f0 == NB_SM_TO_RECEIVE_BEFORE_AVF0 ){
105 114 if (rtems_event_send( Task_id[TASKID_AVF0], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL)
106 115 {
107 116 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 );
108 117 }
109 118 nb_interrupt_f0 = 0;
110 119 }
111 120 }
112 121 }
113 122
114 123 //rtems_task smiq_task(rtems_task_argument argument) // process the Spectral Matrices IRQ
115 124 //{
116 125 // rtems_event_set event_out;
117 126 // unsigned int nb_interrupt_f0 = 0;
118 127
119 128 // PRINTF("in SMIQ *** \n")
120 129
121 130 // while(1){
122 131 // rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT0
123 132 // nb_interrupt_f0 = nb_interrupt_f0 + 1;
124 133 // if (nb_interrupt_f0 == param_local.local_nb_interrupt_f0_MAX ){
125 134 // if (rtems_event_send( Task_id[TASKID_MATR], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL)
126 135 // {
127 136 // rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 );
128 137 // }
129 138 // nb_interrupt_f0 = 0;
130 139 // }
131 140 // }
132 141 //}
133 142
134 143 rtems_task spw_bppr_task(rtems_task_argument argument)
135 144 {
136 145 rtems_status_code status;
137 146 rtems_event_set event_out;
138 147
139 148 BOOT_PRINTF("in BPPR ***\n");
140 149
141 150 while( true ){ // wait for an event to begin with the processing
142 151 status = rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out);
143 152 }
144 153 }
145 154
146 155 rtems_task avf0_task(rtems_task_argument argument)
147 156 {
148 157 int i;
149 158 static int nb_average;
150 159 rtems_event_set event_out;
151 160 rtems_status_code status;
152 161
153 162 nb_average = 0;
154 163
155 164 BOOT_PRINTF("in AVFO *** \n")
156 165
157 166 while(1){
158 167 rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT0
159 168 for(i=0; i<TOTAL_SIZE_SM; i++){
160 169 averaged_spec_mat_f0[i] = averaged_spec_mat_f0[i] + spec_mat_f0_a[i]
161 170 + spec_mat_f0_b[i]
162 171 + spec_mat_f0_c[i]
163 172 + spec_mat_f0_d[i]
164 173 + spec_mat_f0_e[i]
165 174 + spec_mat_f0_f[i]
166 175 + spec_mat_f0_g[i]
167 176 + spec_mat_f0_h[i];
168 177 }
169 178 nb_average = nb_average + NB_SM_TO_RECEIVE_BEFORE_AVF0;
170 179 if (nb_average == NB_AVERAGE_NORMAL_f0) {
171 180 nb_average = 0;
172 181 status = rtems_event_send( Task_id[TASKID_MATR], RTEMS_EVENT_0 ); // sending an event to the task 7, BPF0
173 182 if (status != RTEMS_SUCCESSFUL) {
174 183 printf("in AVF0 *** Error sending RTEMS_EVENT_0, code %d\n", status);
175 184 }
176 185 }
177 186 }
178 187 }
179 188
180 189 rtems_task bpf0_task(rtems_task_argument argument)
181 190 {
182 191 rtems_event_set event_out;
183 192
184 193 BOOT_PRINTF("in BPFO *** \n")
185 194
186 195 while(1){
187 196 rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT0
188 197 matrix_compression(averaged_spec_mat_f0, 0, compressed_spec_mat_f0);
189 198 BP1_set(compressed_spec_mat_f0, NB_BINS_COMPRESSED_SM_F0, LFR_BP1_F0);
190 199 //PRINTF("IN TASK BPF0 *** Matrix compressed, parameters calculated\n")
191 200 }
192 201 }
193 202
194 203 rtems_task matr_task(rtems_task_argument argument)
195 204 {
196 205 spw_ioctl_pkt_send spw_ioctl_send_ASM;
197 206 rtems_event_set event_out;
198 207 rtems_status_code status;
199 208 rtems_id queue_id;
200 209 Header_TM_LFR_SCIENCE_ASM_t headerASM;
201 210
202 211 init_header_asm( &headerASM );
203 212
204 213 status = rtems_message_queue_ident( misc_name[QUEUE_SEND], 0, &queue_id );
205 214 if (status != RTEMS_SUCCESSFUL)
206 215 {
207 216 PRINTF1("in MATR *** ERR getting queue id, %d\n", status)
208 217 }
209 218
210 219 BOOT_PRINTF("in MATR *** \n")
211 220
212 221 fill_averaged_spectral_matrix( );
213 222
214 223 while(1){
215 224 rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT0
216 225
217 226 #ifdef GSA
218 227 #else
219 228 fill_averaged_spectral_matrix( );
220 229 #endif
221 230 convert_averaged_spectral_matrix( averaged_spec_mat_f0, averaged_spec_mat_f0_char);
222 231
223 232 send_spectral_matrix( &headerASM, averaged_spec_mat_f0_char, SID_NORM_ASM_F0, &spw_ioctl_send_ASM, queue_id);
224 233 }
225 234 }
226 235
227 236 //*****************************
228 237 // Spectral matrices processing
229 238
230 239 void matrix_reset(volatile float *averaged_spec_mat)
231 240 {
232 241 // int i;
233 242 // for(i=0; i<TOTAL_SIZE_SM; i++){
234 243 // averaged_spec_mat_f0[i] = 0;
235 244 // }
236 245 }
237 246
238 247 void matrix_compression(volatile float *averaged_spec_mat, unsigned char fChannel, float *compressed_spec_mat)
239 248 {
240 249 int i;
241 250 int j;
242 251 switch (fChannel){
243 252 case 0:
244 253 for(i=0;i<NB_BINS_COMPRESSED_SM_F0;i++){
245 254 j = 17 + (i * 8);
246 255 compressed_spec_mat[i] = (averaged_spec_mat[j]
247 256 + averaged_spec_mat[j+1]
248 257 + averaged_spec_mat[j+2]
249 258 + averaged_spec_mat[j+3]
250 259 + averaged_spec_mat[j+4]
251 260 + averaged_spec_mat[j+5]
252 261 + averaged_spec_mat[j+6]
253 262 + averaged_spec_mat[j+7])/(8*NB_AVERAGE_NORMAL_f0);
254 263 }
255 264 break;
256 265 case 1:
257 266 // case fChannel = f1 to be completed later
258 267 break;
259 268 case 2:
260 269 // case fChannel = f1 to be completed later
261 270 break;
262 271 default:
263 272 break;
264 273 }
265 274 }
266 275
267 276 void BP1_set(float * compressed_spec_mat, unsigned char nb_bins_compressed_spec_mat, unsigned char * LFR_BP1){
268 277 int i;
269 278 int j;
270 279 unsigned char tmp_u_char;
271 280 unsigned char * pt_char = NULL;
272 281 float PSDB, PSDE;
273 282 float NVEC_V0;
274 283 float NVEC_V1;
275 284 float NVEC_V2;
276 285 //float significand;
277 286 //int exponent;
278 287 float aux;
279 288 float tr_SB_SB;
280 289 float tmp;
281 290 float sx_re;
282 291 float sx_im;
283 292 float nebx_re = 0;
284 293 float nebx_im = 0;
285 294 float ny = 0;
286 295 float nz = 0;
287 296 float bx_bx_star = 0;
288 297 for(i=0; i<nb_bins_compressed_spec_mat; i++){
289 298 //==============================================
290 299 // BP1 PSD == B PAR_LFR_SC_BP1_PE_FL0 == 16 bits
291 300 PSDB = compressed_spec_mat[i*30] // S11
292 301 + compressed_spec_mat[(i*30) + 10] // S22
293 302 + compressed_spec_mat[(i*30) + 18]; // S33
294 303 //significand = frexp(PSDB, &exponent);
295 304 pt_char = (unsigned char*) &PSDB;
296 305 LFR_BP1[(i*9) + 2] = pt_char[0]; // bits 31 downto 24 of the float
297 306 LFR_BP1[(i*9) + 3] = pt_char[1]; // bits 23 downto 16 of the float
298 307 //==============================================
299 308 // BP1 PSD == E PAR_LFR_SC_BP1_PB_FL0 == 16 bits
300 309 PSDE = compressed_spec_mat[(i*30) + 24] * K44_pe // S44
301 310 + compressed_spec_mat[(i*30) + 28] * K55_pe // S55
302 311 + compressed_spec_mat[(i*30) + 26] * K45_pe_re // S45
303 312 - compressed_spec_mat[(i*30) + 27] * K45_pe_im; // S45
304 313 pt_char = (unsigned char*) &PSDE;
305 314 LFR_BP1[(i*9) + 0] = pt_char[0]; // bits 31 downto 24 of the float
306 315 LFR_BP1[(i*9) + 1] = pt_char[1]; // bits 23 downto 16 of the float
307 316 //==============================================================================
308 317 // BP1 normal wave vector == PAR_LFR_SC_BP1_NVEC_V0_F0 == 8 bits
309 318 // == PAR_LFR_SC_BP1_NVEC_V1_F0 == 8 bits
310 319 // == PAR_LFR_SC_BP1_NVEC_V2_F0 == 1 bits
311 320 tmp = sqrt(
312 321 compressed_spec_mat[(i*30) + 3]*compressed_spec_mat[(i*30) + 3] //Im S12
313 322 +compressed_spec_mat[(i*30) + 5]*compressed_spec_mat[(i*30) + 5] //Im S13
314 323 +compressed_spec_mat[(i*30) + 13]*compressed_spec_mat[(i*30) + 13] //Im S23
315 324 );
316 325 NVEC_V0 = compressed_spec_mat[(i*30) + 13] / tmp; // Im S23
317 326 NVEC_V1 = -compressed_spec_mat[(i*30) + 5] / tmp; // Im S13
318 327 NVEC_V2 = compressed_spec_mat[(i*30) + 3] / tmp; // Im S12
319 328 LFR_BP1[(i*9) + 4] = (char) (NVEC_V0*127);
320 329 LFR_BP1[(i*9) + 5] = (char) (NVEC_V1*127);
321 330 pt_char = (unsigned char*) &NVEC_V2;
322 331 LFR_BP1[(i*9) + 6] = pt_char[0] & 0x80; // extract the sign of NVEC_V2
323 332 //=======================================================
324 333 // BP1 ellipticity == PAR_LFR_SC_BP1_ELLIP_F0 == 4 bits
325 334 aux = 2*tmp / PSDB; // compute the ellipticity
326 335 tmp_u_char = (unsigned char) (aux*(16-1)); // convert the ellipticity
327 336 LFR_BP1[i*9+6] = LFR_BP1[i*9+6] | ((tmp_u_char&0x0f)<<3); // keeps 4 bits of the resulting unsigned char
328 337 //==============================================================
329 338 // BP1 degree of polarization == PAR_LFR_SC_BP1_DOP_F0 == 3 bits
330 339 for(j = 0; j<NB_VALUES_PER_SM;j++){
331 340 tr_SB_SB = compressed_spec_mat[i*30] * compressed_spec_mat[i*30]
332 341 + compressed_spec_mat[(i*30) + 10] * compressed_spec_mat[(i*30) + 10]
333 342 + compressed_spec_mat[(i*30) + 18] * compressed_spec_mat[(i*30) + 18]
334 343 + 2 * compressed_spec_mat[(i*30) + 2] * compressed_spec_mat[(i*30) + 2]
335 344 + 2 * compressed_spec_mat[(i*30) + 3] * compressed_spec_mat[(i*30) + 3]
336 345 + 2 * compressed_spec_mat[(i*30) + 4] * compressed_spec_mat[(i*30) + 4]
337 346 + 2 * compressed_spec_mat[(i*30) + 5] * compressed_spec_mat[(i*30) + 5]
338 347 + 2 * compressed_spec_mat[(i*30) + 12] * compressed_spec_mat[(i*30) + 12]
339 348 + 2 * compressed_spec_mat[(i*30) + 13] * compressed_spec_mat[(i*30) + 13];
340 349 }
341 350 aux = PSDB*PSDB;
342 351 tmp = sqrt( abs( ( 3*tr_SB_SB - aux ) / ( 2 * aux ) ) );
343 352 tmp_u_char = (unsigned char) (NVEC_V0*(8-1));
344 353 LFR_BP1[(i*9) + 6] = LFR_BP1[(i*9) + 6] | (tmp_u_char & 0x07); // keeps 3 bits of the resulting unsigned char
345 354 //=======================================================================================
346 355 // BP1 x-component of the normalized Poynting flux == PAR_LFR_SC_BP1_SZ_F0 == 8 bits (7+1)
347 356 sx_re = compressed_spec_mat[(i*30) + 20] * K34_sx_re
348 357 + compressed_spec_mat[(i*30) + 6] * K14_sx_re
349 358 + compressed_spec_mat[(i*30) + 8] * K15_sx_re
350 359 + compressed_spec_mat[(i*30) + 14] * K24_sx_re
351 360 + compressed_spec_mat[(i*30) + 16] * K25_sx_re
352 361 + compressed_spec_mat[(i*30) + 22] * K35_sx_re;
353 362 sx_im = compressed_spec_mat[(i*30) + 21] * K34_sx_im
354 363 + compressed_spec_mat[(i*30) + 7] * K14_sx_im
355 364 + compressed_spec_mat[(i*30) + 9] * K15_sx_im
356 365 + compressed_spec_mat[(i*30) + 15] * K24_sx_im
357 366 + compressed_spec_mat[(i*30) + 17] * K25_sx_im
358 367 + compressed_spec_mat[(i*30) + 23] * K35_sx_im;
359 368 LFR_BP1[(i*9) + 7] = ((unsigned char) (sx_re * 128)) & 0x7f; // cf DOC for the compression
360 369 if ( abs(sx_re) > abs(sx_im) ) {
361 370 LFR_BP1[(i*9) + 7] = LFR_BP1[(i*9) + 1] | (0x80); // extract the sector of sx
362 371 }
363 372 else {
364 373 LFR_BP1[(i*9) + 7] = LFR_BP1[(i*9) + 1] & (0x7f); // extract the sector of sx
365 374 }
366 375 //======================================================================
367 376 // BP1 phase velocity estimator == PAR_LFR_SC_BP1_VPHI_F0 == 8 bits (7+1)
368 377 ny = sin(Alpha_M)*NVEC_V1 + cos(Alpha_M)*NVEC_V2;
369 378 nz = NVEC_V0;
370 379 bx_bx_star = cos(Alpha_M) * cos(Alpha_M) * compressed_spec_mat[i*30+10] // re S22
371 380 + sin(Alpha_M) * sin(Alpha_M) * compressed_spec_mat[i*30+18] // re S33
372 381 - 2 * sin(Alpha_M) * cos(Alpha_M) * compressed_spec_mat[i*30+12]; // re S23
373 382 nebx_re = ny * (compressed_spec_mat[(i*30) + 14] * K24_ny_re
374 383 +compressed_spec_mat[(i*30) + 16] * K25_ny_re
375 384 +compressed_spec_mat[(i*30) + 20] * K34_ny_re
376 385 +compressed_spec_mat[(i*30) + 22] * K35_ny_re)
377 386 + nz * (compressed_spec_mat[(i*30) + 14] * K24_nz_re
378 387 +compressed_spec_mat[(i*30) + 16] * K25_nz_re
379 388 +compressed_spec_mat[(i*30) + 20] * K34_nz_re
380 389 +compressed_spec_mat[(i*30) + 22] * K35_nz_re);
381 390 nebx_im = ny * (compressed_spec_mat[(i*30) + 15]*K24_ny_re
382 391 +compressed_spec_mat[(i*30) + 17] * K25_ny_re
383 392 +compressed_spec_mat[(i*30) + 21] * K34_ny_re
384 393 +compressed_spec_mat[(i*30) + 23] * K35_ny_re)
385 394 + nz * (compressed_spec_mat[(i*30) + 15] * K24_nz_im
386 395 +compressed_spec_mat[(i*30) + 17] * K25_nz_im
387 396 +compressed_spec_mat[(i*30) + 21] * K34_nz_im
388 397 +compressed_spec_mat[(i*30) + 23] * K35_nz_im);
389 398 tmp = nebx_re / bx_bx_star;
390 399 LFR_BP1[(i*9) + 8] = ((unsigned char) (tmp * 128)) & 0x7f; // cf DOC for the compression
391 400 if ( abs(nebx_re) > abs(nebx_im) ) {
392 401 LFR_BP1[(i*9) + 8] = LFR_BP1[(i*9) + 8] | (0x80); // extract the sector of nebx
393 402 }
394 403 else {
395 404 LFR_BP1[(i*9) + 8] = LFR_BP1[(i*9) + 8] & (0x7f); // extract the sector of nebx
396 405 }
397 406 }
398 407
399 408 }
400 409
401 410 void BP2_set(float * compressed_spec_mat, unsigned char nb_bins_compressed_spec_mat){
402 411 // BP2 autocorrelation
403 412 int i;
404 413 int aux = 0;
405 414
406 415 for(i = 0; i<nb_bins_compressed_spec_mat; i++){
407 416 // S12
408 417 aux = sqrt(compressed_spec_mat[i*30]*compressed_spec_mat[(i*30) + 10]);
409 418 compressed_spec_mat[(i*30) + 2] = compressed_spec_mat[(i*30) + 2] / aux;
410 419 compressed_spec_mat[(i*30) + 3] = compressed_spec_mat[(i*30) + 3] / aux;
411 420 // S13
412 421 aux = sqrt(compressed_spec_mat[i*30]*compressed_spec_mat[(i*30) + 18]);
413 422 compressed_spec_mat[(i*30) + 4] = compressed_spec_mat[(i*30) + 4] / aux;
414 423 compressed_spec_mat[(i*30) + 5] = compressed_spec_mat[(i*30) + 5] / aux;
415 424 // S23
416 425 aux = sqrt(compressed_spec_mat[i*30+12]*compressed_spec_mat[(i*30) + 18]);
417 426 compressed_spec_mat[(i*30) + 12] = compressed_spec_mat[(i*30) + 12] / aux;
418 427 compressed_spec_mat[(i*30) + 13] = compressed_spec_mat[(i*30) + 13] / aux;
419 428 // S45
420 429 aux = sqrt(compressed_spec_mat[i*30+24]*compressed_spec_mat[(i*30) + 28]);
421 430 compressed_spec_mat[(i*30) + 26] = compressed_spec_mat[(i*30) + 26] / aux;
422 431 compressed_spec_mat[(i*30) + 27] = compressed_spec_mat[(i*30) + 27] / aux;
423 432 // S14
424 433 aux = sqrt(compressed_spec_mat[i*30]*compressed_spec_mat[(i*30) +24]);
425 434 compressed_spec_mat[(i*30) + 6] = compressed_spec_mat[(i*30) + 6] / aux;
426 435 compressed_spec_mat[(i*30) + 7] = compressed_spec_mat[(i*30) + 7] / aux;
427 436 // S15
428 437 aux = sqrt(compressed_spec_mat[i*30]*compressed_spec_mat[(i*30) + 28]);
429 438 compressed_spec_mat[(i*30) + 8] = compressed_spec_mat[(i*30) + 8] / aux;
430 439 compressed_spec_mat[(i*30) + 9] = compressed_spec_mat[(i*30) + 9] / aux;
431 440 // S24
432 441 aux = sqrt(compressed_spec_mat[i*10]*compressed_spec_mat[(i*30) + 24]);
433 442 compressed_spec_mat[(i*30) + 14] = compressed_spec_mat[(i*30) + 14] / aux;
434 443 compressed_spec_mat[(i*30) + 15] = compressed_spec_mat[(i*30) + 15] / aux;
435 444 // S25
436 445 aux = sqrt(compressed_spec_mat[i*10]*compressed_spec_mat[(i*30) + 28]);
437 446 compressed_spec_mat[(i*30) + 16] = compressed_spec_mat[(i*30) + 16] / aux;
438 447 compressed_spec_mat[(i*30) + 17] = compressed_spec_mat[(i*30) + 17] / aux;
439 448 // S34
440 449 aux = sqrt(compressed_spec_mat[i*18]*compressed_spec_mat[(i*30) + 24]);
441 450 compressed_spec_mat[(i*30) + 20] = compressed_spec_mat[(i*30) + 20] / aux;
442 451 compressed_spec_mat[(i*30) + 21] = compressed_spec_mat[(i*30) + 21] / aux;
443 452 // S35
444 453 aux = sqrt(compressed_spec_mat[i*18]*compressed_spec_mat[(i*30) + 28]);
445 454 compressed_spec_mat[(i*30) + 22] = compressed_spec_mat[(i*30) + 22] / aux;
446 455 compressed_spec_mat[(i*30) + 23] = compressed_spec_mat[(i*30) + 23] / aux;
447 456 }
448 457 }
449 458
450 459 void init_header_asm( Header_TM_LFR_SCIENCE_ASM_t *header)
451 460 {
452 461 header->targetLogicalAddress = CCSDS_DESTINATION_ID;
453 462 header->protocolIdentifier = CCSDS_PROTOCOLE_ID;
454 463 header->reserved = 0x00;
455 464 header->userApplication = CCSDS_USER_APP;
456 465 header->packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8);
457 466 header->packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST);
458 467 header->packetSequenceControl[0] = 0xc0;
459 468 header->packetSequenceControl[1] = 0x00;
460 469 header->packetLength[0] = 0x00;
461 470 header->packetLength[1] = 0x00;
462 471 // DATA FIELD HEADER
463 472 header->spare1_pusVersion_spare2 = 0x10;
464 473 header->serviceType = TM_TYPE_LFR_SCIENCE; // service type
465 474 header->serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
466 475 header->destinationID = TM_DESTINATION_ID_GROUND;
467 476 // AUXILIARY DATA HEADER
468 477 header->sid = 0x00;
469 478 header->biaStatusInfo = 0x00;
470 479 header->cntASM = 0x00;
471 480 header->nrASM = 0x00;
472 481 header->time[0] = 0x00;
473 482 header->time[0] = 0x00;
474 483 header->time[0] = 0x00;
475 484 header->time[0] = 0x00;
476 485 header->time[0] = 0x00;
477 486 header->time[0] = 0x00;
478 487 header->blkNr[0] = 0x00; // BLK_NR MSB
479 488 header->blkNr[1] = 0x00; // BLK_NR LSB
480 489 }
481 490
482 491 void send_spectral_matrix(Header_TM_LFR_SCIENCE_ASM_t *header, char *spectral_matrix,
483 492 unsigned int sid, spw_ioctl_pkt_send *spw_ioctl_send, rtems_id queue_id)
484 493 {
485 494 unsigned int i;
486 495 unsigned int length = 0;
487 496 rtems_status_code status;
488 497
489 498 header->sid = (unsigned char) sid;
490 499
491 500 for (i=0; i<2; i++)
492 501 {
493 502 // BUILD THE DATA
494 503 spw_ioctl_send->dlen = TOTAL_SIZE_SM;
495 504 spw_ioctl_send->data = &spectral_matrix[ i * TOTAL_SIZE_SM];
496 505 spw_ioctl_send->hlen = HEADER_LENGTH_TM_LFR_SCIENCE_ASM + CCSDS_PROTOCOLE_EXTRA_BYTES;
497 506 spw_ioctl_send->hdr = (char *) header;
498 507 spw_ioctl_send->options = 0;
499 508
500 509 // BUILD THE HEADER
501 510 length = PACKET_LENGTH_TM_LFR_SCIENCE_ASM;
502 511 header->packetLength[0] = (unsigned char) (length>>8);
503 512 header->packetLength[1] = (unsigned char) (length);
504 513 header->sid = (unsigned char) sid; // SID
505 514 header->cntASM = 2;
506 515 header->nrASM = (unsigned char) (i+1);
507 516 header->blkNr[0] =(unsigned char) ( (NB_BINS_PER_SM/2) >> 8 ); // BLK_NR MSB
508 517 header->blkNr[1] = (unsigned char) (NB_BINS_PER_SM/2); // BLK_NR LSB
509 518 // SET PACKET TIME
510 519 header->time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
511 520 header->time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
512 521 header->time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
513 522 header->time[3] = (unsigned char) (time_management_regs->coarse_time);
514 523 header->time[4] = (unsigned char) (time_management_regs->fine_time>>8);
515 524 header->time[5] = (unsigned char) (time_management_regs->fine_time);
516 525 header->acquisitionTime[0] = (unsigned char) (time_management_regs->coarse_time>>24);
517 526 header->acquisitionTime[1] = (unsigned char) (time_management_regs->coarse_time>>16);
518 527 header->acquisitionTime[2] = (unsigned char) (time_management_regs->coarse_time>>8);
519 528 header->acquisitionTime[3] = (unsigned char) (time_management_regs->coarse_time);
520 529 header->acquisitionTime[4] = (unsigned char) (time_management_regs->fine_time>>8);
521 530 header->acquisitionTime[5] = (unsigned char) (time_management_regs->fine_time);
522 531 // SEND PACKET
523 532 status = rtems_message_queue_send( queue_id, spw_ioctl_send, ACTION_MSG_SPW_IOCTL_SEND_SIZE);
524 533 if (status != RTEMS_SUCCESSFUL) {
525 534 printf("in send_spectral_matrix *** ERR %d\n", (int) status);
526 535 }
527 536 }
528 537 }
529 538
530 539 void convert_averaged_spectral_matrix( volatile float *input_matrix, char *output_matrix)
531 540 {
532 541 unsigned int i;
533 542 unsigned int j;
534 543 char * pt_char_input;
535 544 char * pt_char_output;
536 545
537 546 pt_char_input = NULL;
538 547 pt_char_output = NULL;
539 548
540 549 for( i=0; i<NB_BINS_PER_SM; i++)
541 550 {
542 551 for ( j=0; j<NB_VALUES_PER_SM; j++)
543 552 {
544 553 pt_char_input = (char*) &input_matrix[ (i*NB_VALUES_PER_SM) + j ];
545 554 pt_char_output = (char*) &output_matrix[ 2 * ( (i*NB_VALUES_PER_SM) + j ) ];
546 555 pt_char_output[0] = pt_char_input[0]; // bits 31 downto 24 of the float
547 556 pt_char_output[1] = pt_char_input[1]; // bits 23 downto 16 of the float
548 557 }
549 558 }
550 559 }
551 560
552 561 void fill_averaged_spectral_matrix(void)
553 562 {
554 563 /** This function fills spectral matrices related buffers with arbitrary data.
555 564 *
556 565 * This function is for testing purpose only.
557 566 *
558 567 */
559 568
560 569 #ifdef GSA
561 570 float offset = 10.;
562 571 float coeff = 100000.;
563 572
564 573 averaged_spec_mat_f0[ 0 + 25 * 0 ] = 0. + offset;
565 574 averaged_spec_mat_f0[ 0 + 25 * 1 ] = 1. + offset;
566 575 averaged_spec_mat_f0[ 0 + 25 * 2 ] = 2. + offset;
567 576 averaged_spec_mat_f0[ 0 + 25 * 3 ] = 3. + offset;
568 577 averaged_spec_mat_f0[ 0 + 25 * 4 ] = 4. + offset;
569 578 averaged_spec_mat_f0[ 0 + 25 * 5 ] = 5. + offset;
570 579 averaged_spec_mat_f0[ 0 + 25 * 6 ] = 6. + offset;
571 580 averaged_spec_mat_f0[ 0 + 25 * 7 ] = 7. + offset;
572 581 averaged_spec_mat_f0[ 0 + 25 * 8 ] = 8. + offset;
573 582 averaged_spec_mat_f0[ 0 + 25 * 9 ] = 9. + offset;
574 583 averaged_spec_mat_f0[ 0 + 25 * 10 ] = 10. + offset;
575 584 averaged_spec_mat_f0[ 0 + 25 * 11 ] = 11. + offset;
576 585 averaged_spec_mat_f0[ 0 + 25 * 12 ] = 12. + offset;
577 586 averaged_spec_mat_f0[ 0 + 25 * 13 ] = 13. + offset;
578 587 averaged_spec_mat_f0[ 0 + 25 * 14 ] = 14. + offset;
579 588 averaged_spec_mat_f0[ 9 + 25 * 0 ] = -(0. + offset)* coeff;
580 589 averaged_spec_mat_f0[ 9 + 25 * 1 ] = -(1. + offset)* coeff;
581 590 averaged_spec_mat_f0[ 9 + 25 * 2 ] = -(2. + offset)* coeff;
582 591 averaged_spec_mat_f0[ 9 + 25 * 3 ] = -(3. + offset)* coeff;
583 592 averaged_spec_mat_f0[ 9 + 25 * 4 ] = -(4. + offset)* coeff;
584 593 averaged_spec_mat_f0[ 9 + 25 * 5 ] = -(5. + offset)* coeff;
585 594 averaged_spec_mat_f0[ 9 + 25 * 6 ] = -(6. + offset)* coeff;
586 595 averaged_spec_mat_f0[ 9 + 25 * 7 ] = -(7. + offset)* coeff;
587 596 averaged_spec_mat_f0[ 9 + 25 * 8 ] = -(8. + offset)* coeff;
588 597 averaged_spec_mat_f0[ 9 + 25 * 9 ] = -(9. + offset)* coeff;
589 598 averaged_spec_mat_f0[ 9 + 25 * 10 ] = -(10. + offset)* coeff;
590 599 averaged_spec_mat_f0[ 9 + 25 * 11 ] = -(11. + offset)* coeff;
591 600 averaged_spec_mat_f0[ 9 + 25 * 12 ] = -(12. + offset)* coeff;
592 601 averaged_spec_mat_f0[ 9 + 25 * 13 ] = -(13. + offset)* coeff;
593 602 averaged_spec_mat_f0[ 9 + 25 * 14 ] = -(14. + offset)* coeff;
594 603 offset = 10000000;
595 604 averaged_spec_mat_f0[ 16 + 25 * 0 ] = (0. + offset)* coeff;
596 605 averaged_spec_mat_f0[ 16 + 25 * 1 ] = (1. + offset)* coeff;
597 606 averaged_spec_mat_f0[ 16 + 25 * 2 ] = (2. + offset)* coeff;
598 607 averaged_spec_mat_f0[ 16 + 25 * 3 ] = (3. + offset)* coeff;
599 608 averaged_spec_mat_f0[ 16 + 25 * 4 ] = (4. + offset)* coeff;
600 609 averaged_spec_mat_f0[ 16 + 25 * 5 ] = (5. + offset)* coeff;
601 610 averaged_spec_mat_f0[ 16 + 25 * 6 ] = (6. + offset)* coeff;
602 611 averaged_spec_mat_f0[ 16 + 25 * 7 ] = (7. + offset)* coeff;
603 612 averaged_spec_mat_f0[ 16 + 25 * 8 ] = (8. + offset)* coeff;
604 613 averaged_spec_mat_f0[ 16 + 25 * 9 ] = (9. + offset)* coeff;
605 614 averaged_spec_mat_f0[ 16 + 25 * 10 ] = (10. + offset)* coeff;
606 615 averaged_spec_mat_f0[ 16 + 25 * 11 ] = (11. + offset)* coeff;
607 616 averaged_spec_mat_f0[ 16 + 25 * 12 ] = (12. + offset)* coeff;
608 617 averaged_spec_mat_f0[ 16 + 25 * 13 ] = (13. + offset)* coeff;
609 618 averaged_spec_mat_f0[ 16 + 25 * 14 ] = (14. + offset)* coeff;
610 619
611 620 averaged_spec_mat_f0[ (TOTAL_SIZE_SM/2) + 0 ] = averaged_spec_mat_f0[ 0 ];
612 621 averaged_spec_mat_f0[ (TOTAL_SIZE_SM/2) + 1 ] = averaged_spec_mat_f0[ 1 ];
613 622 averaged_spec_mat_f0[ (TOTAL_SIZE_SM/2) + 2 ] = averaged_spec_mat_f0[ 2 ];
614 623 averaged_spec_mat_f0[ (TOTAL_SIZE_SM/2) + 3 ] = averaged_spec_mat_f0[ 3 ];
615 624 averaged_spec_mat_f0[ (TOTAL_SIZE_SM/2) + 4 ] = averaged_spec_mat_f0[ 4 ];
616 625 averaged_spec_mat_f0[ (TOTAL_SIZE_SM/2) + 5 ] = averaged_spec_mat_f0[ 5 ];
617 626 averaged_spec_mat_f0[ (TOTAL_SIZE_SM/2) + 6 ] = averaged_spec_mat_f0[ 6 ];
618 627 averaged_spec_mat_f0[ (TOTAL_SIZE_SM/2) + 7 ] = averaged_spec_mat_f0[ 7 ];
619 628 averaged_spec_mat_f0[ (TOTAL_SIZE_SM/2) + 8 ] = averaged_spec_mat_f0[ 8 ];
620 629 averaged_spec_mat_f0[ (TOTAL_SIZE_SM/2) + 9 ] = averaged_spec_mat_f0[ 9 ];
621 630 averaged_spec_mat_f0[ (TOTAL_SIZE_SM/2) + 10 ] = averaged_spec_mat_f0[ 10 ];
622 631 averaged_spec_mat_f0[ (TOTAL_SIZE_SM/2) + 11 ] = averaged_spec_mat_f0[ 11 ];
623 632 averaged_spec_mat_f0[ (TOTAL_SIZE_SM/2) + 12 ] = averaged_spec_mat_f0[ 12 ];
624 633 averaged_spec_mat_f0[ (TOTAL_SIZE_SM/2) + 13 ] = averaged_spec_mat_f0[ 13 ];
625 634 averaged_spec_mat_f0[ (TOTAL_SIZE_SM/2) + 14 ] = averaged_spec_mat_f0[ 14 ];
626 635 averaged_spec_mat_f0[ (TOTAL_SIZE_SM/2) + 15 ] = averaged_spec_mat_f0[ 15 ];
627 636 #else
628 637 unsigned int i;
629 638
630 639 for(i=0; i<TOTAL_SIZE_SM; i++)
631 640 {
632 641 if (spectral_matrix_regs->matrixF0_Address0 == (int) spec_mat_f0_0)
633 642 averaged_spec_mat_f0[i] = (float) spec_mat_f0_0_bis[ SM_HEADER + i ];
634 643 else
635 644 averaged_spec_mat_f0[i] = (float) spec_mat_f0_0[ SM_HEADER + i ];
636 645 }
637 646 #endif
638 647 }
639 648
640 649 void reset_spectral_matrix_regs()
641 650 {
642 651 /** This function resets the spectral matrices module registers.
643 652 *
644 653 * The registers affected by this function are located at the following offset addresses:
645 654 *
646 655 * - 0x00 config
647 656 * - 0x04 status
648 657 * - 0x08 matrixF0_Address0
649 658 * - 0x10 matrixFO_Address1
650 659 * - 0x14 matrixF1_Address
651 660 * - 0x18 matrixF2_Address
652 661 *
653 662 */
654 663
655 664 #ifdef GSA
656 665 #else
657 666 spectral_matrix_regs->matrixF0_Address0 = (int) spec_mat_f0_0;
658 667 spectral_matrix_regs->matrixFO_Address1 = (int) spec_mat_f0_1;
659 668 spectral_matrix_regs->matrixF1_Address = (int) spec_mat_f1;
660 669 spectral_matrix_regs->matrixF2_Address = (int) spec_mat_f2;
661 670 #endif
662 671 }
663 672
664 673 //******************
665 674 // general functions
666 675
667 676
668 677
669 678
@@ -1,39 +1,46
1 /** Global variables used by the processing functions.
2 *
3 * @file
4 * @author P. LEROY
5 *
6 */
7
1 8 // TOTAL = 32 coefficients * 4 = 128 octets * 3 * 12 = 4608 octets
2 9 // SX 12 coefficients
3 10 float K14_sx_re = 1;
4 11 float K14_sx_im = 1;
5 12 float K15_sx_re = 1;
6 13 float K15_sx_im = 1;
7 14 float K24_sx_re = 1;
8 15 float K24_sx_im = 1;
9 16 float K25_sx_re = 1;
10 17 float K25_sx_im = 1;
11 18 float K34_sx_re = 1;
12 19 float K34_sx_im = 1;
13 20 float K35_sx_re = 1;
14 21 float K35_sx_im = 1;
15 22 // NY 8 coefficients
16 23 float K24_ny_re = 1;
17 24 float K24_ny_im = 1;
18 25 float K25_ny_re = 1;
19 26 float K25_ny_im = 1;
20 27 float K34_ny_re = 1;
21 28 float K34_ny_im = 1;
22 29 float K35_ny_re = 1;
23 30 float K35_ny_im = 1;
24 31 // NZ 8 coefficients
25 32 float K24_nz_re = 1;
26 33 float K24_nz_im = 1;
27 34 float K25_nz_re = 1;
28 35 float K25_nz_im = 1;
29 36 float K34_nz_re = 1;
30 37 float K34_nz_im = 1;
31 38 float K35_nz_re = 1;
32 39 float K35_nz_im = 1;
33 40 // PE 4 coefficients
34 41 float K44_pe = 1;
35 42 float K55_pe = 1;
36 43 float K45_pe_re = 1;
37 44 float K45_pe_im = 1;
38 45
39 46 float Alpha_M = M_PI/4;
@@ -1,207 +1,486
1 /** Functions related to the SpaceWire interface.
2 *
3 * @file
4 * @author P. LEROY
5 *
6 * A group of functions to handle SpaceWire transmissions:
7 * - configuration of the SpaceWire link
8 * - SpaceWire related interruption requests processing
9 * - transmission of TeleMetry packets by a dedicated RTEMS task
10 * - reception of TeleCommands by a dedicated RTEMS task
11 *
12 */
13
1 14 #include "fsw_spacewire.h"
2 15
3 16 char *lstates[6] = {"Error-reset",
4 17 "Error-wait",
5 18 "Ready",
6 19 "Started",
7 20 "Connecting",
8 21 "Run"
9 22 };
10 23
24 //***********
11 25 // RTEMS TASK
12 26 rtems_task spiq_task(rtems_task_argument unused)
13 27 {
28 /** This RTEMS task is dedicated to the handling of interruption requests raised by the SpaceWire driver.
29 *
30 * @param unused is the starting argument of the RTEMS task
31 *
32 */
33
14 34 rtems_event_set event_out;
15 35 rtems_status_code status;
16 36 unsigned char lfrMode;
17 37
18 38 while(true){
19 39 BOOT_PRINTF("in SPIQ *** Waiting for SPW_LINKERR_EVENT\n")
20 40 rtems_event_receive(SPW_LINKERR_EVENT, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an SPW_LINKERR_EVENT
21 41
22 42 lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; // get the current mode
23 43
24 44 status = spacewire_wait_for_link();
25 45
26 46 if (status != RTEMS_SUCCESSFUL)
27 47 {
28 48 //****************
29 49 // STOP THE SYSTEM
30 50 spacewire_compute_stats_offsets();
31 51 stop_current_mode();
32 52 if (rtems_task_suspend(Task_id[TASKID_RECV])!=RTEMS_SUCCESSFUL) { // suspend RECV task
33 53 PRINTF("in SPIQ *** Error suspending RECV Task\n")
34 54 }
35 55 if (rtems_task_suspend(Task_id[TASKID_HOUS])!=RTEMS_SUCCESSFUL) { // suspend HOUS task
36 56 PRINTF("in SPIQ *** Error suspending HOUS Task\n")
37 57 }
38 58
39 59 //***************************
40 60 // RESTART THE SPACEWIRE LINK
41 61 spacewire_configure_link();
42 62
43 63 //*******************
44 64 // RESTART THE SYSTEM
45 65 //ioctl(fdSPW, SPACEWIRE_IOCTRL_CLR_STATISTICS); // clear statistics
46 66 status = rtems_task_restart( Task_id[TASKID_HOUS], 1 );
47 67 if (status != RTEMS_SUCCESSFUL) {
48 68 PRINTF1("in SPIQ *** Error restarting HOUS Task *** code %d\n", status)
49 69 }
50 70 status = rtems_task_restart(Task_id[TASKID_RECV], 1);
51 71 if ( status != RTEMS_SUCCESSFUL) {
52 72 PRINTF("in SPIQ *** Error restarting RECV Task\n")
53 73 }
54 74 enter_mode(lfrMode, NULL); // enter the mode that was running before the SpaceWire interruption
55 75 }
56 76 }
57 77 }
58 78
79 rtems_task recv_task( rtems_task_argument unused )
80 {
81 /** This RTEMS task is dedicated to the reception of incoming TeleCommands.
82 *
83 * @param unused is the starting argument of the RTEMS task
84 *
85 * The RECV task blocks on a call to the read system call, waiting for incoming SpaceWire data. When unblocked:
86 * 1. It reads the incoming data.
87 * 2. Launches the acceptance procedure.
88 * 3. If the Telecommand is valid, sends it to a dedicated RTEMS message queue.
89 *
90 */
91
92 int len;
93 ccsdsTelecommandPacket_t currentTC;
94 unsigned char computed_CRC[ 2 ];
95 unsigned char currentTC_LEN_RCV[ 2 ];
96 unsigned int currentTC_LEN_RCV_AsUnsignedInt;
97 unsigned int parserCode;
98 rtems_status_code status;
99 rtems_id queue_recv_id;
100 rtems_id queue_send_id;
101
102 initLookUpTableForCRC(); // the table is used to compute Cyclic Redundancy Codes
103
104 status = rtems_message_queue_ident( misc_name[QUEUE_RECV], 0, &queue_recv_id );
105 if (status != RTEMS_SUCCESSFUL)
106 {
107 PRINTF1("in RECV *** ERR getting QUEUE_RECV id, %d\n", status)
108 }
109
110 status = rtems_message_queue_ident( misc_name[QUEUE_SEND], 0, &queue_send_id );
111 if (status != RTEMS_SUCCESSFUL)
112 {
113 PRINTF1("in RECV *** ERR getting QUEUE_SEND id, %d\n", status)
114 }
115
116 BOOT_PRINTF("in RECV *** \n")
117
118 while(1)
119 {
120 len = read(fdSPW, (char*) &currentTC, CCSDS_TC_PKT_MAX_SIZE); // the call to read is blocking
121 if (len == -1){ // error during the read call
122 PRINTF("In RECV *** last read call returned -1\n")
123 }
124 else {
125 if ( (len+1) < CCSDS_TC_PKT_MIN_SIZE ) {
126 PRINTF("In RECV *** packet lenght too short\n")
127 }
128 else {
129 currentTC_LEN_RCV_AsUnsignedInt = (unsigned int) (len - CCSDS_TC_TM_PACKET_OFFSET - 3); // => -3 is for Prot ID, Reserved and User App bytes
130 currentTC_LEN_RCV[ 0 ] = (unsigned char) (currentTC_LEN_RCV_AsUnsignedInt >> 8);
131 currentTC_LEN_RCV[ 1 ] = (unsigned char) (currentTC_LEN_RCV_AsUnsignedInt );
132 // CHECK THE TC
133 parserCode = tc_parser( &currentTC, currentTC_LEN_RCV_AsUnsignedInt, computed_CRC ) ;
134 if ( (parserCode == ILLEGAL_APID) || (parserCode == WRONG_LEN_PACKET) || (parserCode == INCOR_CHECKSUM)
135 | (parserCode == ILL_TYPE) || (parserCode == ILL_SUBTYPE) || (parserCode == WRONG_APP_DATA) )
136 { // send TM_LFR_TC_EXE_CORRUPTED
137 send_tm_lfr_tc_exe_corrupted( &currentTC, queue_send_id, computed_CRC, currentTC_LEN_RCV );
138 }
139 else
140 { // send valid TC to the action launcher
141 status = rtems_message_queue_send( queue_recv_id, &currentTC,
142 currentTC_LEN_RCV_AsUnsignedInt + CCSDS_TC_TM_PACKET_OFFSET + 3);
143 }
144 }
145 }
146 }
147 }
148
149 rtems_task send_task( rtems_task_argument argument)
150 {
151 /** This RTEMS task is dedicated to the transmission of TeleMetry packets.
152 *
153 * @param unused is the starting argument of the RTEMS task
154 *
155 * The SEND task waits for a message to become available in the dedicated RTEMS queue. When a message arrives:
156 * - if the first byte is equal to CCSDS_DESTINATION_ID, the message is sent as is using the write system call.
157 * - if the first byte is not equal to CCSDS_DESTINATION_ID, the message is handled as a spw_ioctl_pkt_send. After
158 * analyzis, the packet is sent either using the write system call or using the ioctl call SPACEWIRE_IOCTRL_SEND, depending on the
159 * data it contains.
160 *
161 */
162
163 rtems_status_code status; // RTEMS status code
164 char incomingData[ACTION_MSG_PKTS_MAX_SIZE]; // incoming data buffer
165 spw_ioctl_pkt_send *spw_ioctl_send;
166 size_t size; // size of the incoming TC packet
167 u_int32_t count;
168 rtems_id queue_id;
169
170 status = rtems_message_queue_ident( misc_name[QUEUE_SEND], 0, &queue_id );
171 if (status != RTEMS_SUCCESSFUL)
172 {
173 PRINTF1("in SEND *** ERR getting queue id, %d\n", status)
174 }
175
176 BOOT_PRINTF("in SEND *** \n")
177
178 while(1)
179 {
180 status = rtems_message_queue_receive( queue_id, incomingData, &size,
181 RTEMS_WAIT, RTEMS_NO_TIMEOUT );
182
183 if (status!=RTEMS_SUCCESSFUL)
184 {
185 PRINTF1("in SEND *** (1) ERR = %d\n", status)
186 }
187 else
188 {
189 if ( incomingData[0] == CCSDS_DESTINATION_ID) // the incoming message is a ccsds packet
190 {
191 status = write( fdSPW, incomingData, size );
192 if (status == -1){
193 PRINTF2("in SEND *** (2.a) ERR = %d, size = %d\n", status, size)
194 }
195 }
196 else // the incoming message is a spw_ioctl_pkt_send structure
197 {
198 spw_ioctl_send = (spw_ioctl_pkt_send*) incomingData;
199 if (spw_ioctl_send->hlen == 0)
200 {
201 status = write( fdSPW, spw_ioctl_send->data, spw_ioctl_send->dlen );
202 if (status == -1){
203 PRINTF2("in SEND *** (2.b) ERR = %d, dlen = %d\n", status, spw_ioctl_send->dlen)
204 }
205 }
206 else
207 {
208 status = ioctl( fdSPW, SPACEWIRE_IOCTRL_SEND, spw_ioctl_send );
209 if (status == -1){
210 PRINTF2("in SEND *** (2.c) ERR = %d, dlen = %d\n", status, spw_ioctl_send->dlen)
211 PRINTF1(" hlen = %d\n", spw_ioctl_send->hlen)
212 }
213 }
214 }
215 }
216
217 status = rtems_message_queue_get_number_pending( queue_id, &count );
218 if (status != RTEMS_SUCCESSFUL)
219 {
220 PRINTF1("in SEND *** (3) ERR = %d\n", status)
221 }
222 else
223 {
224 if (count > maxCount)
225 {
226 maxCount = count;
227 }
228 }
229 }
230 }
231
232 //****************
233 // OTHER FUNCTIONS
59 234 int spacewire_configure_link( void )
60 235 {
236 /** This function configures the SpaceWire link.
237 *
238 * @return GR-RTEMS-DRIVER directive status codes:
239 * - 22 EINVAL - Null pointer or an out of range value was given as the argument.
240 * - 16 EBUSY - Only used for SEND. Returned when no descriptors are avialble in non-blocking mode.
241 * - 88 ENOSYS - Returned for SET_DESTKEY if RMAP command handler is not available or if a non-implemented call is used.
242 * - 116 ETIMEDOUT - REturned for SET_PACKET_SIZE and START if the link could not be brought up.
243 * - 12 ENOMEM - Returned for SET_PACKETSIZE if it was unable to allocate the new buffers.
244 * - 5 EIO - Error when writing to grswp hardware registers.
245 * - 2 ENOENT - No such file or directory
246 */
247
61 248 rtems_status_code status;
62 249
63 250 close(fdSPW); // close the device if it is already open
64 251 BOOT_PRINTF("OK *** in configure_spw_link *** try to open "GRSPW_DEVICE_NAME"\n")
65 fdSPW = open(GRSPW_DEVICE_NAME, O_RDWR); // open the device. the open call reset the hardware
252 fdSPW = open(GRSPW_DEVICE_NAME, O_RDWR); // open the device. the open call resets the hardware
66 253 if ( fdSPW<0 ) {
67 PRINTF("ERR *** in configure_spw_link *** Error opening"GRSPW_DEVICE_NAME"\n")
254 PRINTF1("ERR *** in configure_spw_link *** Error opening"GRSPW_DEVICE_NAME" with ERR %d\n", errno)
68 255 }
69 256
70 257 while(ioctl(fdSPW, SPACEWIRE_IOCTRL_START, -1) != RTEMS_SUCCESSFUL){
71 258 PRINTF(".")
72 259 fflush( stdout );
73 260 close( fdSPW ); // close the device
74 261 fdSPW = open( GRSPW_DEVICE_NAME, O_RDWR ); // open the device. the open call reset the hardware
75 262 if (fdSPW<0) {
76 PRINTF("ERR *** In configure_spw_link *** Error opening"GRSPW_DEVICE_NAME"\n")
263 PRINTF1("ERR *** in configure_spw_link *** Error opening"GRSPW_DEVICE_NAME" with ERR %d\n", errno)
77 264 }
78 265 rtems_task_wake_after(100);
79 266 }
80 267
81 268 BOOT_PRINTF("OK *** In configure_spw_link *** "GRSPW_DEVICE_NAME" opened and started successfully\n")
82 269
83 270 spacewire_set_NP(1, REGS_ADDR_GRSPW); // [N]o [P]ort force
84 271 spacewire_set_RE(1, REGS_ADDR_GRSPW); // [R]MAP [E]nable, the dedicated call seems to break the no port force configuration
85 272
86 273 status = ioctl(fdSPW, SPACEWIRE_IOCTRL_SET_RXBLOCK, 1); // sets the blocking mode for reception
87 274 if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_RXBLOCK\n")
88 275 //
89 276 status = ioctl(fdSPW, SPACEWIRE_IOCTRL_SET_EVENT_ID, Task_id[TASKID_SPIQ]); // sets the task ID to which an event is sent when a
90 277 if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_EVENT_ID\n") // link-error interrupt occurs
91 278 //
92 279 status = ioctl(fdSPW, SPACEWIRE_IOCTRL_SET_DISABLE_ERR, 0); // automatic link-disabling due to link-error interrupts
93 280 if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_DISABLE_ERR\n")
94 281 //
95 282 status = ioctl(fdSPW, SPACEWIRE_IOCTRL_SET_LINK_ERR_IRQ, 1); // sets the link-error interrupt bit
96 283 if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_LINK_ERR_IRQ\n")
97 284 //
98 285 status = ioctl(fdSPW, SPACEWIRE_IOCTRL_SET_TXBLOCK, 0); // transmission blocks
99 286 if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_TXBLOCK\n")
100 287 //
101 288 status = ioctl(fdSPW, SPACEWIRE_IOCTRL_SET_TXBLOCK_ON_FULL, 0); // transmission blocks on full
102 289 if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_TXBLOCK_ON_FULL\n")
103 290 //
104 291 status = ioctl(fdSPW, SPACEWIRE_IOCTRL_SET_TCODE_CTRL, 0x0909); // [Time Rx : Time Tx : Link error : Tick-out IRQ]
105 292 if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_TCODE_CTRL,\n")
106 293
107 294 BOOT_PRINTF("OK *** in configure_spw_link *** "GRSPW_DEVICE_NAME" configured successfully\n")
108 295
109 296 return RTEMS_SUCCESSFUL;
110 297 }
111 298
112 299 int spacewire_wait_for_link(void)
113 300 {
301 /** This function is executed when an interruption is raised by the SpaceWire driver.
302 *
303 * @return RTEMS directive status code:
304 * - RTEMS_UNSATISFIED is returned is the link is not in the running state after 10 s.
305 * - RTEMS_SUCCESSFUL is returned if the link is up before the timeout.
306 *
307 */
308
114 309 unsigned int i;
115 310 int linkStatus;
116 311 rtems_status_code status = RTEMS_UNSATISFIED;
117 312
118 313 for(i = 0; i< 10; i++){
119 314 PRINTF(".")
120 315 fflush( stdout );
121 316 ioctl(fdSPW, SPACEWIRE_IOCTRL_GET_LINK_STATUS, &linkStatus); // get the link status
122 317 PRINTF1("in spacewire_wait_for_link *** link status is: %s\n", lstates[linkStatus])
123 318 if ( linkStatus == 5) {
124 319 PRINTF("in spacewire_wait_for_link *** link is running\n")
125 320 status = RTEMS_SUCCESSFUL;
126 321 break;
127 322 }
128 323 rtems_task_wake_after(100);
129 324 }
130 325
131 326 return status;
132 327 }
133 328
134 329 void spacewire_set_NP(unsigned char val, unsigned int regAddr) // [N]o [P]ort force
135 330 {
331 /** This function sets the [N]o [P]ort force bit of the GRSPW control register.
332 *
333 * @param val is the value, 0 or 1, used to set the value of the NP bit.
334 * @param regAddr is the address of the GRSPW control register.
335 *
336 * NP is the bit 20 of the GRSPW control register.
337 *
338 */
339
136 340 unsigned int *spwptr = (unsigned int*) regAddr;
137 341
138 342 if (val == 1) {
139 343 *spwptr = *spwptr | 0x00100000; // [NP] set the No port force bit
140 344 }
141 345 if (val== 0) {
142 346 *spwptr = *spwptr & 0xffdfffff;
143 347 }
144 348 }
145 349
146 350 void spacewire_set_RE(unsigned char val, unsigned int regAddr) // [R]MAP [E]nable
147 351 {
352 /** This function sets the [R]MAP [E]nable bit of the GRSPW control register.
353 *
354 * @param val is the value, 0 or 1, used to set the value of the RE bit.
355 * @param regAddr is the address of the GRSPW control register.
356 *
357 * RE is the bit 16 of the GRSPW control register.
358 *
359 */
360
148 361 unsigned int *spwptr = (unsigned int*) regAddr;
149 362
150 363 if (val == 1)
151 364 {
152 365 *spwptr = *spwptr | 0x00010000; // [RE] set the RMAP Enable bit
153 366 }
154 367 if (val== 0)
155 368 {
156 369 *spwptr = *spwptr & 0xfffdffff;
157 370 }
158 371 }
159 372
160 373 void spacewire_compute_stats_offsets( void )
161 374 {
162 375 /** This function computes the SpaceWire statistics offsets in case of a SpaceWire related interruption raising.
163 376 *
164 377 * The offsets keep a record of the statistics in case of a reset of the statistics. They are added to the current statistics
165 * to keep the counters consistent even after a reset of the SpaceWire driver.
378 * to keep the counters consistent even after a reset of the SpaceWire driver (the counter are set to zero by the driver when it
379 * during the open systel call).
166 380 *
167 381 */
168 382
169 383 spw_stats spacewire_stats_grspw;
170 384 rtems_status_code status;
171 385
172 386 status = ioctl( fdSPW, SPACEWIRE_IOCTRL_GET_STATISTICS, &spacewire_stats_grspw );
173 387
174 388 spacewire_stats_backup.packets_received = spacewire_stats_grspw.packets_received
175 389 + spacewire_stats.packets_received;
176 390 spacewire_stats_backup.packets_sent = spacewire_stats_grspw.packets_sent
177 391 + spacewire_stats.packets_sent;
178 392 spacewire_stats_backup.parity_err = spacewire_stats_grspw.parity_err
179 393 + spacewire_stats.parity_err;
180 394 spacewire_stats_backup.disconnect_err = spacewire_stats_grspw.disconnect_err
181 395 + spacewire_stats.disconnect_err;
182 396 spacewire_stats_backup.escape_err = spacewire_stats_grspw.escape_err
183 397 + spacewire_stats.escape_err;
184 398 spacewire_stats_backup.credit_err = spacewire_stats_grspw.credit_err
185 399 + spacewire_stats.credit_err;
186 400 spacewire_stats_backup.write_sync_err = spacewire_stats_grspw.write_sync_err
187 401 + spacewire_stats.write_sync_err;
188 402 spacewire_stats_backup.rx_rmap_header_crc_err = spacewire_stats_grspw.rx_rmap_header_crc_err
189 403 + spacewire_stats.rx_rmap_header_crc_err;
190 404 spacewire_stats_backup.rx_rmap_data_crc_err = spacewire_stats_grspw.rx_rmap_data_crc_err
191 405 + spacewire_stats.rx_rmap_data_crc_err;
192 406 spacewire_stats_backup.early_ep = spacewire_stats_grspw.early_ep
193 407 + spacewire_stats.early_ep;
194 408 spacewire_stats_backup.invalid_address = spacewire_stats_grspw.invalid_address
195 409 + spacewire_stats.invalid_address;
196 410 spacewire_stats_backup.rx_eep_err = spacewire_stats_grspw.rx_eep_err
197 411 + spacewire_stats.rx_eep_err;
198 412 spacewire_stats_backup.rx_truncated = spacewire_stats_grspw.rx_truncated
199 413 + spacewire_stats.rx_truncated;
200 414 }
201 415
416 void spacewire_update_statistics( void )
417 {
418 rtems_status_code status;
419 spw_stats spacewire_stats_grspw;
420
421 status = ioctl( fdSPW, SPACEWIRE_IOCTRL_GET_STATISTICS, &spacewire_stats_grspw );
422
423 spacewire_stats.packets_received = spacewire_stats_backup.packets_received
424 + spacewire_stats_grspw.packets_received;
425 spacewire_stats.packets_sent = spacewire_stats_backup.packets_sent
426 + spacewire_stats_grspw.packets_sent;
427 spacewire_stats.parity_err = spacewire_stats_backup.parity_err
428 + spacewire_stats_grspw.parity_err;
429 spacewire_stats.disconnect_err = spacewire_stats_backup.disconnect_err
430 + spacewire_stats_grspw.disconnect_err;
431 spacewire_stats.escape_err = spacewire_stats_backup.escape_err
432 + spacewire_stats_grspw.escape_err;
433 spacewire_stats.credit_err = spacewire_stats_backup.credit_err
434 + spacewire_stats_grspw.credit_err;
435 spacewire_stats.write_sync_err = spacewire_stats_backup.write_sync_err
436 + spacewire_stats_grspw.write_sync_err;
437 spacewire_stats.rx_rmap_header_crc_err = spacewire_stats_backup.rx_rmap_header_crc_err
438 + spacewire_stats_grspw.rx_rmap_header_crc_err;
439 spacewire_stats.rx_rmap_data_crc_err = spacewire_stats_backup.rx_rmap_data_crc_err
440 + spacewire_stats_grspw.rx_rmap_data_crc_err;
441 spacewire_stats.early_ep = spacewire_stats_backup.early_ep
442 + spacewire_stats_grspw.early_ep;
443 spacewire_stats.invalid_address = spacewire_stats_backup.invalid_address
444 + spacewire_stats_grspw.invalid_address;
445 spacewire_stats.rx_eep_err = spacewire_stats_backup.rx_eep_err
446 + spacewire_stats_grspw.rx_eep_err;
447 spacewire_stats.rx_truncated = spacewire_stats_backup.rx_truncated
448 + spacewire_stats_grspw.rx_truncated;
449 //spacewire_stats.tx_link_err;
450
451 //****************************
452 // DPU_SPACEWIRE_IF_STATISTICS
453 housekeeping_packet.hk_lfr_dpu_spw_pkt_rcv_cnt[0] = (unsigned char) (spacewire_stats.packets_received >> 8);
454 housekeeping_packet.hk_lfr_dpu_spw_pkt_rcv_cnt[1] = (unsigned char) (spacewire_stats.packets_received);
455 housekeeping_packet.hk_lfr_dpu_spw_pkt_sent_cnt[0] = (unsigned char) (spacewire_stats.packets_sent >> 8);
456 housekeeping_packet.hk_lfr_dpu_spw_pkt_sent_cnt[1] = (unsigned char) (spacewire_stats.packets_sent);
457 //housekeeping_packet.hk_lfr_dpu_spw_tick_out_cnt;
458 //housekeeping_packet.hk_lfr_dpu_spw_last_timc;
459
460 //******************************************
461 // ERROR COUNTERS / SPACEWIRE / LOW SEVERITY
462 housekeeping_packet.hk_lfr_dpu_spw_parity = (unsigned char) spacewire_stats.parity_err;
463 housekeeping_packet.hk_lfr_dpu_spw_disconnect = (unsigned char) spacewire_stats.disconnect_err;
464 housekeeping_packet.hk_lfr_dpu_spw_escape = (unsigned char) spacewire_stats.escape_err;
465 housekeeping_packet.hk_lfr_dpu_spw_credit = (unsigned char) spacewire_stats.credit_err;
466 housekeeping_packet.hk_lfr_dpu_spw_write_sync = (unsigned char) spacewire_stats.write_sync_err;
467 // housekeeping_packet.hk_lfr_dpu_spw_rx_ahb;
468 // housekeeping_packet.hk_lfr_dpu_spw_tx_ahb;
469 housekeeping_packet.hk_lfr_dpu_spw_header_crc = (unsigned char) spacewire_stats.rx_rmap_header_crc_err;
470 housekeeping_packet.hk_lfr_dpu_spw_data_crc = (unsigned char) spacewire_stats.rx_rmap_data_crc_err;
471
472 //*********************************************
473 // ERROR COUNTERS / SPACEWIRE / MEDIUM SEVERITY
474 housekeeping_packet.hk_lfr_dpu_spw_early_eop = (unsigned char) spacewire_stats.early_ep;
475 housekeeping_packet.hk_lfr_dpu_spw_invalid_addr = (unsigned char) spacewire_stats.invalid_address;
476 housekeeping_packet.hk_lfr_dpu_spw_eep = (unsigned char) spacewire_stats.rx_eep_err;
477 housekeeping_packet.hk_lfr_dpu_spw_rx_too_big = (unsigned char) spacewire_stats.rx_truncated;
478
479 }
480
202 481 void timecode_irq_handler(void *pDev, void *regs, int minor, unsigned int tc)
203 482 {
204 483 //if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_1 ) != RTEMS_SUCCESSFUL) {
205 484 // printf("In timecode_irq_handler *** Error sending event to DUMB\n");
206 485 //}
207 486 }
This diff has been collapsed as it changes many lines, (528 lines changed) Show them Hide them
@@ -1,1284 +1,780
1 1 /** Functions and tasks related to TeleCommand handling.
2 2 *
3 3 * @file
4 4 * @author P. LEROY
5 5 *
6 6 * A group of functions to handle TeleCommands:\n
7 7 * action launching\n
8 8 * TC parsing\n
9 9 * ...
10 10 *
11 11 */
12 12
13 13 #include "tc_handler.h"
14 14
15 char *DumbMessages[6] = {"in DUMB *** default", // RTEMS_EVENT_0
16 "in DUMB *** timecode_irq_handler", // RTEMS_EVENT_1
17 "in DUMB *** waveforms_isr", // RTEMS_EVENT_2
18 "in DUMB *** in SMIQ *** Error sending event to AVF0", // RTEMS_EVENT_3
19 "in DUMB *** spectral_matrices_isr *** Error sending event to SMIQ", // RTEMS_EVENT_4
20 "in DUMB *** waveforms_simulator_isr" // RTEMS_EVENT_5
21 };
22
23 unsigned char currentTC_LEN_RCV[2]; // SHALL be equal to the current TC packet estimated packet length field
24 unsigned int currentTC_LEN_RCV_AsUnsignedInt;
25 unsigned int currentTM_length;
26 unsigned char currentTC_processedFlag;
27
28 unsigned int lookUpTableForCRC[256];
29
30 //**********************
31 // GENERAL USE FUNCTIONS
32 unsigned int Crc_opt( unsigned char D, unsigned int Chk)
33 {
34 /** This function generate the CRC for one byte and returns the value of the new syndrome.
35 *
36 * @param D is the current byte of data.
37 * @param Chk is the current syndrom value.
38 * @return the value of the new syndrome on two bytes.
39 *
40 */
41
42 return(((Chk << 8) & 0xff00)^lookUpTableForCRC [(((Chk >> 8)^D) & 0x00ff)]);
43 }
44
45 void initLookUpTableForCRC( void )
46 {
47 /** This function is used to initiates the look-up table for fast CRC computation.
48 *
49 * The global table lookUpTableForCRC[256] is initiated.
50 *
51 */
52
53 unsigned int i;
54 unsigned int tmp;
55
56 for (i=0; i<256; i++)
57 {
58 tmp = 0;
59 if((i & 1) != 0) {
60 tmp = tmp ^ 0x1021;
61 }
62 if((i & 2) != 0) {
63 tmp = tmp ^ 0x2042;
64 }
65 if((i & 4) != 0) {
66 tmp = tmp ^ 0x4084;
67 }
68 if((i & 8) != 0) {
69 tmp = tmp ^ 0x8108;
70 }
71 if((i & 16) != 0) {
72 tmp = tmp ^ 0x1231;
73 }
74 if((i & 32) != 0) {
75 tmp = tmp ^ 0x2462;
76 }
77 if((i & 64) != 0) {
78 tmp = tmp ^ 0x48c4;
79 }
80 if((i & 128) != 0) {
81 tmp = tmp ^ 0x9188;
82 }
83 lookUpTableForCRC[i] = tmp;
84 }
85 }
86
87 void GetCRCAsTwoBytes(unsigned char* data, unsigned char* crcAsTwoBytes, unsigned int sizeOfData)
88 {
89 /** This function calculates a two bytes Cyclic Redundancy Code.
90 *
91 * @param data points to a buffer containing the data on which to compute the CRC.
92 * @param crcAsTwoBytes points points to a two bytes buffer in which the CRC is stored.
93 * @param sizeOfData is the number of bytes of *data* used to compute the CRC.
94 *
95 * The specification of the Cyclic Redundancy Code is described in the following document: ECSS-E-70-41-A.
96 *
97 */
98
99 unsigned int Chk;
100 int j;
101 Chk = 0xffff; // reset the syndrom to all ones
102 for (j=0; j<sizeOfData; j++) {
103 Chk = Crc_opt(data[j], Chk);
104 }
105 crcAsTwoBytes[0] = (unsigned char) (Chk >> 8);
106 crcAsTwoBytes[1] = (unsigned char) (Chk & 0x00ff);
107 }
108
109 void updateLFRCurrentMode()
110 {
111 /** This function updates the value of the global variable lfrCurrentMode.
112 *
113 * lfrCurrentMode is a parameter used by several functions to know in which mode LFR is running.
114 *
115 */
116 // update the local value of lfrCurrentMode with the value contained in the housekeeping_packet structure
117 lfrCurrentMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4;
118 }
119
120 //*********************
121 // ACCEPTANCE FUNCTIONS
122 int tc_acceptance(ccsdsTelecommandPacket_t *TC, unsigned int tc_len_recv, rtems_id queue_recv_id, rtems_id queue_send_id)
123 {
124 /** This function executes the TeleCommand acceptance steps.
125 *
126 * @param TC points to the TeleCommand packet which is under investigation.
127 * @param tc_len_recv contains the length of the packet that has been received.
128 * @param queue_recv_id is the id of the rtems queue in which messages are written if the acceptance is not successful
129 * @param queue_send_id is the id of the rtems queue in which messages are written if the acceptance is successful
130 * @return status code
131 *
132 * The acceptance steps can result in two different actions.
133 * 1. If the acceptance is successful, the TC is sent in the receiving queue for processing.
134 * 2. If the acceptance fails, a TM packet is transmitted to report the error.
135 *
136 */
137
138 int ret = 0;
139 rtems_status_code status;
140 unsigned int parserCode = 0;
141 unsigned char computed_CRC[2];
142
143 GetCRCAsTwoBytes( (unsigned char*) TC->packetID, computed_CRC, tc_len_recv + 5 );
144 parserCode = tc_parser( TC, tc_len_recv ) ;
145 if ( (parserCode == ILLEGAL_APID) | (parserCode == WRONG_LEN_PACKET) | (parserCode == INCOR_CHECKSUM)
146 | (parserCode == ILL_TYPE) | (parserCode == ILL_SUBTYPE) | (parserCode == WRONG_APP_DATA) )
147 { // send TM_LFR_TC_EXE_CORRUPTED
148 send_tm_lfr_tc_exe_corrupted( TC, queue_send_id, computed_CRC, currentTC_LEN_RCV );
149 }
150 else { // send valid TC to the action launcher
151 status = rtems_message_queue_send( queue_recv_id, TC, tc_len_recv + CCSDS_TC_TM_PACKET_OFFSET + 3);
152 ret = LFR_SUCCESSFUL;
153 }
154 return ret;
155 }
156
157 int tc_parser(ccsdsTelecommandPacket_t * TCPacket, unsigned int TC_LEN_RCV)
158 {
159 /** This function parses TeleCommands.
160 *
161 * @param TC points to the TeleCommand that will be parsed.
162 * @param TC_LEN_RCV is the received packet length.
163 * @return Status code of the parsing.
164 *
165 * The parsing checks:
166 * - process id
167 * - category
168 * - length: a global check is performed and a per subtype check also
169 * - type
170 * - subtype
171 * - crc
172 *
173 */
174
175 int status;
176 unsigned char pid;
177 unsigned char category;
178 unsigned int length;
179 unsigned char packetType;
180 unsigned char packetSubtype;
181
182 status = CCSDS_TM_VALID;
183
184 // APID check *** APID on 2 bytes
185 pid = ((TCPacket->packetID[0] & 0x07)<<4) + ( (TCPacket->packetID[1]>>4) & 0x0f ); // PID = 11 *** 7 bits xxxxx210 7654xxxx
186 category = (TCPacket->packetID[1] & 0x0f); // PACKET_CATEGORY = 12 *** 4 bits xxxxxxxx xxxx3210
187 length = (TCPacket->packetLength[0] * 256) + TCPacket->packetLength[1];
188 packetType = TCPacket->serviceType;
189 packetSubtype = TCPacket->serviceSubType;
190
191 if ( pid != CCSDS_PROCESS_ID ) // CHECK THE PROCESS ID
192 {
193 status = ILLEGAL_APID;
194 }
195 if (status == CCSDS_TM_VALID) // CHECK THE CATEGORY
196 {
197 if ( category != CCSDS_PACKET_CATEGORY )
198 {
199 status = ILLEGAL_APID;
200 }
201 }
202 if (status == CCSDS_TM_VALID) // CHECK THE PACKET LENGTH FIELD AND THE ACTUAL LENGTH COMPLIANCE
203 {
204 if (length != TC_LEN_RCV ) {
205 status = WRONG_LEN_PACKET;
206 }
207 }
208 if (status == CCSDS_TM_VALID) // CHECK THAT THE PACKET DOES NOT EXCEED THE MAX SIZE
209 {
210 if ( length >= CCSDS_TC_PKT_MAX_SIZE ) {
211 status = WRONG_LEN_PACKET;
212 }
213 }
214 if (status == CCSDS_TM_VALID) // CHECK THE TYPE
215 {
216 status = tc_check_type( packetType );
217 }
218 if (status == CCSDS_TM_VALID) // CHECK THE SUBTYPE
219 {
220 status = tc_check_subtype( packetSubtype );
221 }
222 if (status == CCSDS_TM_VALID) // CHECK THE SUBTYPE AND LENGTH COMPLIANCE
223 {
224 status = tc_check_length( packetSubtype, length );
225 }
226 if (status == CCSDS_TM_VALID ) // CHECK CRC
227 {
228 status = tc_check_crc( TCPacket, length );
229 }
230
231 return status;
232 }
233
234 int tc_check_type( unsigned char packetType )
235 {
236 /** This function checks that the type of a TeleCommand is valid.
237 *
238 * @param packetType is the type to check.
239 * @return Status code CCSDS_TM_VALID or ILL_TYPE.
240 *
241 */
242
243 int status;
244
245 if ( (packetType == TC_TYPE_GEN) || (packetType == TC_TYPE_TIME))
246 {
247 status = CCSDS_TM_VALID;
248 }
249 else
250 {
251 status = ILL_TYPE;
252 }
253
254 return status;
255 }
256
257 int tc_check_subtype( unsigned char packetSubType )
258 {
259 /** This function checks that the subtype of a TeleCommand is valid.
260 *
261 * @param packetSubType is the subtype to check.
262 * @return Status code CCSDS_TM_VALID or ILL_SUBTYPE.
263 *
264 */
265
266 int status;
267
268 if ( (packetSubType == TC_SUBTYPE_RESET)
269 || (packetSubType == TC_SUBTYPE_LOAD_COMM)
270 || (packetSubType == TC_SUBTYPE_LOAD_NORM) || (packetSubType == TC_SUBTYPE_LOAD_BURST)
271 || (packetSubType == TC_SUBTYPE_LOAD_SBM1) || (packetSubType == TC_SUBTYPE_LOAD_SBM2)
272 || (packetSubType == TC_SUBTYPE_DUMP)
273 || (packetSubType == TC_SUBTYPE_ENTER)
274 || (packetSubType == TC_SUBTYPE_UPDT_INFO) || (packetSubType == TC_SUBTYPE_UPDT_TIME)
275 || (packetSubType == TC_SUBTYPE_EN_CAL) || (packetSubType == TC_SUBTYPE_DIS_CAL) )
276 {
277 status = CCSDS_TM_VALID;
278 }
279 else
280 {
281 status = ILL_TYPE;
282 }
283
284 return status;
285 }
286
287 int tc_check_length( unsigned char packetSubType, unsigned int length )
288 {
289 /** This function checks that the subtype and the length are compliant.
290 *
291 * @param packetSubType is the subtype to check.
292 * @param length is the length to check.
293 * @return Status code CCSDS_TM_VALID or ILL_TYPE.
294 *
295 */
296
297 int status;
298
299 status = LFR_SUCCESSFUL;
300
301 switch(packetSubType)
302 {
303 case TC_SUBTYPE_RESET:
304 if (length!=(TC_LEN_RESET-CCSDS_TC_TM_PACKET_OFFSET)) {
305 status = WRONG_LEN_PACKET;
306 }
307 else {
308 status = CCSDS_TM_VALID;
309 }
310 break;
311 case TC_SUBTYPE_LOAD_COMM:
312 if (length!=(TC_LEN_LOAD_COMM-CCSDS_TC_TM_PACKET_OFFSET)) {
313 status = WRONG_LEN_PACKET;
314 }
315 else {
316 status = CCSDS_TM_VALID;
317 }
318 break;
319 case TC_SUBTYPE_LOAD_NORM:
320 if (length!=(TC_LEN_LOAD_NORM-CCSDS_TC_TM_PACKET_OFFSET)) {
321 status = WRONG_LEN_PACKET;
322 }
323 else {
324 status = CCSDS_TM_VALID;
325 }
326 break;
327 case TC_SUBTYPE_LOAD_BURST:
328 if (length!=(TC_LEN_LOAD_BURST-CCSDS_TC_TM_PACKET_OFFSET)) {
329 status = WRONG_LEN_PACKET;
330 }
331 else {
332 status = CCSDS_TM_VALID;
333 }
334 break;
335 case TC_SUBTYPE_LOAD_SBM1:
336 if (length!=(TC_LEN_LOAD_SBM1-CCSDS_TC_TM_PACKET_OFFSET)) {
337 status = WRONG_LEN_PACKET;
338 }
339 else {
340 status = CCSDS_TM_VALID;
341 }
342 break;
343 case TC_SUBTYPE_LOAD_SBM2:
344 if (length!=(TC_LEN_LOAD_SBM2-CCSDS_TC_TM_PACKET_OFFSET)) {
345 status = WRONG_LEN_PACKET;
346 }
347 else {
348 status = CCSDS_TM_VALID;
349 }
350 break;
351 case TC_SUBTYPE_DUMP:
352 if (length!=(TC_LEN_DUMP-CCSDS_TC_TM_PACKET_OFFSET)) {
353 status = WRONG_LEN_PACKET;
354 }
355 else {
356 status = CCSDS_TM_VALID;
357 }
358 break;
359 case TC_SUBTYPE_ENTER:
360 if (length!=(TC_LEN_ENTER-CCSDS_TC_TM_PACKET_OFFSET)) {
361 status = WRONG_LEN_PACKET;
362 }
363 else {
364 status = CCSDS_TM_VALID;
365 }
366 break;
367 case TC_SUBTYPE_UPDT_INFO:
368 if (length!=(TC_LEN_UPDT_INFO-CCSDS_TC_TM_PACKET_OFFSET)) {
369 status = WRONG_LEN_PACKET;
370 }
371 else {
372 status = CCSDS_TM_VALID;
373 }
374 break;
375 case TC_SUBTYPE_EN_CAL:
376 if (length!=(TC_LEN_EN_CAL-CCSDS_TC_TM_PACKET_OFFSET)) {
377 status = WRONG_LEN_PACKET;
378 }
379 else {
380 status = CCSDS_TM_VALID;
381 }
382 break;
383 case TC_SUBTYPE_DIS_CAL:
384 if (length!=(TC_LEN_DIS_CAL-CCSDS_TC_TM_PACKET_OFFSET)) {
385 status = WRONG_LEN_PACKET;
386 }
387 else {
388 status = CCSDS_TM_VALID;
389 }
390 break;
391 case TC_SUBTYPE_UPDT_TIME:
392 if (length!=(TC_LEN_UPDT_TIME-CCSDS_TC_TM_PACKET_OFFSET)) {
393 status = WRONG_LEN_PACKET;
394 }
395 else {
396 status = CCSDS_TM_VALID;
397 }
398 break;
399 default: // if the subtype is not a legal value, return ILL_SUBTYPE
400 status = ILL_SUBTYPE;
401 break ;
402 }
403
404 return status;
405 }
406
407 int tc_check_crc( ccsdsTelecommandPacket_t * TCPacket, unsigned int length )
408 {
409 /** This function checks the CRC validity of the corresponding TeleCommand packet.
410 *
411 * @param TCPacket points to the TeleCommand packet to check.
412 * @param length is the length of the TC packet.
413 * @return Status code CCSDS_TM_VALID or INCOR_CHECKSUM.
414 *
415 */
416
417 int status;
418 unsigned char * CCSDSContent;
419 unsigned char currentTC_COMPUTED_CRC[2];
420
421 CCSDSContent = (unsigned char*) TCPacket->packetID;
422 GetCRCAsTwoBytes(CCSDSContent, currentTC_COMPUTED_CRC, length + CCSDS_TC_TM_PACKET_OFFSET - 2); // 2 CRC bytes removed from the calculation of the CRC
423 if (currentTC_COMPUTED_CRC[0] != CCSDSContent[length + CCSDS_TC_TM_PACKET_OFFSET -2]) {
424 status = INCOR_CHECKSUM;
425 }
426 else if (currentTC_COMPUTED_CRC[1] != CCSDSContent[length + CCSDS_TC_TM_PACKET_OFFSET -1]) {
427 status = INCOR_CHECKSUM;
428 }
429 else {
430 status = CCSDS_TM_VALID;
431 }
432
433 return status;
434 }
435
436 15 //***********
437 16 // RTEMS TASK
438 rtems_task recv_task( rtems_task_argument unused )
439 {
440 /** This RTEMS task is dedicated to the reception of incoming TeleCommands.
441 *
442 * @param unused is the starting argument of the RTEMS task
443 *
444 * The RECV task blocks on a call to the read system call, waiting for incoming SpaceWire data. When unblocked:
445 * 1. It reads the incoming data.
446 * 2. Launches the acceptance procedure.
447 * 3. If the Telecommand is valid, sends it to the ACTN task using an RTEMS message queue.
448 *
449 */
450
451 int len = 0;
452 unsigned int i = 0;
453 ccsdsTelecommandPacket_t currentTC;
454 char data[100];
455 rtems_status_code status;
456 rtems_id queue_recv_id;
457 rtems_id queue_send_id;
458
459 for(i=0; i<100; i++) data[i] = 0;
460
461 initLookUpTableForCRC(); // the table is used to compute Cyclic Redundancy Codes
462
463 status = rtems_message_queue_ident( misc_name[QUEUE_RECV], 0, &queue_recv_id );
464 if (status != RTEMS_SUCCESSFUL)
465 {
466 PRINTF1("in RECV *** ERR getting QUEUE_RECV id, %d\n", status)
467 }
468
469 status = rtems_message_queue_ident( misc_name[QUEUE_SEND], 0, &queue_send_id );
470 if (status != RTEMS_SUCCESSFUL)
471 {
472 PRINTF1("in RECV *** ERR getting QUEUE_SEND id, %d\n", status)
473 }
474
475 BOOT_PRINTF("in RECV *** \n")
476
477 while(1)
478 {
479 len = read(fdSPW, (char*) &currentTC, CCSDS_TC_PKT_MAX_SIZE); // the call to read is blocking
480 if (len == -1){ // error during the read call
481 PRINTF("In RECV *** last read call returned -1\n")
482 }
483 else {
484 if ( (len+1) < CCSDS_TC_PKT_MIN_SIZE ) {
485 PRINTF("In RECV *** packet lenght too short\n")
486 }
487 else {
488 currentTC_LEN_RCV[0] = 0x00;
489 currentTC_LEN_RCV[1] = (unsigned char) (len - CCSDS_TC_TM_PACKET_OFFSET - 3); // build the corresponding packet size field
490 currentTC_LEN_RCV_AsUnsignedInt = (unsigned int) (len - CCSDS_TC_TM_PACKET_OFFSET - 3); // => -3 is for Prot ID, Reserved and User App bytes
491 // CHECK THE TC
492 tc_acceptance(&currentTC, currentTC_LEN_RCV_AsUnsignedInt, queue_recv_id, queue_send_id);
493 }
494 }
495 }
496 }
497 17
498 18 rtems_task actn_task( rtems_task_argument unused )
499 19 {
500 20 /** This RTEMS task is responsible for launching actions upton the reception of valid TeleCommands.
501 21 *
502 22 * @param unused is the starting argument of the RTEMS task
503 23 *
504 24 * The ACTN task waits for data coming from an RTEMS msesage queue. When data arrives, it launches specific actions depending
505 25 * on the incoming TeleCommand.
506 26 *
507 27 */
508 28
509 29 int result;
510 30 rtems_status_code status; // RTEMS status code
511 31 ccsdsTelecommandPacket_t TC; // TC sent to the ACTN task
512 32 size_t size; // size of the incoming TC packet
513 33 unsigned char subtype; // subtype of the current TC packet
514 34 rtems_id queue_rcv_id;
515 35 rtems_id queue_snd_id;
516 36
517 37 status = rtems_message_queue_ident( misc_name[QUEUE_RECV], 0, &queue_rcv_id );
518 38 if (status != RTEMS_SUCCESSFUL)
519 39 {
520 40 PRINTF1("in ACTN *** ERR getting queue_rcv_id %d\n", status)
521 41 }
522 42
523 43 status = rtems_message_queue_ident( misc_name[QUEUE_SEND], 0, &queue_snd_id );
524 44 if (status != RTEMS_SUCCESSFUL)
525 45 {
526 46 PRINTF1("in ACTN *** ERR getting queue_snd_id %d\n", status)
527 47 }
528 48
529 49 result = LFR_SUCCESSFUL;
530 50 subtype = 0; // subtype of the current TC packet
531 51
532 52 BOOT_PRINTF("in ACTN *** \n")
533 53
534 54 while(1)
535 55 {
536 56 status = rtems_message_queue_receive( queue_rcv_id, (char*) &TC, &size,
537 57 RTEMS_WAIT, RTEMS_NO_TIMEOUT);
538 58 if (status!=RTEMS_SUCCESSFUL) PRINTF1("ERR *** in task ACTN *** error receiving a message, code %d \n", status)
539 59 else
540 60 {
541 61 subtype = TC.serviceSubType;
542 62 switch(subtype)
543 63 {
544 64 case TC_SUBTYPE_RESET:
545 65 result = action_reset( &TC, queue_snd_id );
546 66 close_action( &TC, result, queue_snd_id );
547 67 break;
548 68 //
549 69 case TC_SUBTYPE_LOAD_COMM:
550 70 result = action_load_common_par( &TC );
551 71 close_action( &TC, result, queue_snd_id );
552 72 break;
553 73 //
554 74 case TC_SUBTYPE_LOAD_NORM:
555 75 result = action_load_normal_par( &TC, queue_snd_id );
556 76 close_action( &TC, result, queue_snd_id );
557 77 break;
558 78 //
559 79 case TC_SUBTYPE_LOAD_BURST:
560 80 result = action_load_burst_par( &TC, queue_snd_id );
561 81 close_action( &TC, result, queue_snd_id );
562 82 break;
563 83 //
564 84 case TC_SUBTYPE_LOAD_SBM1:
565 85 result = action_load_sbm1_par( &TC, queue_snd_id );
566 86 close_action( &TC, result, queue_snd_id );
567 87 break;
568 88 //
569 89 case TC_SUBTYPE_LOAD_SBM2:
570 90 result = action_load_sbm2_par( &TC, queue_snd_id );
571 91 close_action( &TC, result, queue_snd_id );
572 92 break;
573 93 //
574 94 case TC_SUBTYPE_DUMP:
575 95 result = action_dump_par( queue_snd_id );
576 96 close_action( &TC, result, queue_snd_id );
577 97 break;
578 98 //
579 99 case TC_SUBTYPE_ENTER:
580 100 result = action_enter_mode( &TC, queue_snd_id );
581 101 close_action( &TC, result, queue_snd_id );
582 102 break;
583 103 //
584 104 case TC_SUBTYPE_UPDT_INFO:
585 105 result = action_update_info( &TC, queue_snd_id );
586 106 close_action( &TC, result, queue_snd_id );
587 107 break;
588 108 //
589 109 case TC_SUBTYPE_EN_CAL:
590 110 result = action_enable_calibration( &TC, queue_snd_id );
591 111 close_action( &TC, result, queue_snd_id );
592 112 break;
593 113 //
594 114 case TC_SUBTYPE_DIS_CAL:
595 115 result = action_disable_calibration( &TC, queue_snd_id );
596 116 close_action( &TC, result, queue_snd_id );
597 117 break;
598 118 //
599 119 case TC_SUBTYPE_UPDT_TIME:
600 120 result = action_update_time( &TC );
601 121 close_action( &TC, result, queue_snd_id );
602 122 break;
603 123 //
604 124 default:
605 125 break;
606 126 }
607 127 }
608 128 }
609 129 }
610 130
611 rtems_task dumb_task( rtems_task_argument unused )
612 {
613 /** This RTEMS taks is used to print messages without affecting the general behaviour of the software.
614 *
615 * @param unused is the starting argument of the RTEMS task
616 *
617 * The DUMB taks waits for RTEMS events and print messages depending on the incoming events.
618 *
619 */
620
621 unsigned int i;
622 unsigned int intEventOut;
623 unsigned int coarse_time = 0;
624 unsigned int fine_time = 0;
625 rtems_event_set event_out;
626
627 BOOT_PRINTF("in DUMB *** \n")
628
629 while(1){
630 rtems_event_receive(RTEMS_EVENT_0 | RTEMS_EVENT_1 | RTEMS_EVENT_2 | RTEMS_EVENT_3 | RTEMS_EVENT_4 | RTEMS_EVENT_5,
631 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT
632 intEventOut = (unsigned int) event_out;
633 for ( i=0; i<32; i++)
634 {
635 if ( ((intEventOut >> i) & 0x0001) != 0)
636 {
637 coarse_time = time_management_regs->coarse_time;
638 fine_time = time_management_regs->fine_time;
639 printf("in DUMB *** time = coarse: %x, fine: %x, %s\n", coarse_time, fine_time, DumbMessages[i]);
640 }
641 }
642 }
643 }
644
645 131 //***********
646 132 // TC ACTIONS
647 133
648 134 int action_reset(ccsdsTelecommandPacket_t *TC, rtems_id queue_id)
649 135 {
650 136 /** This function executes specific actions when a TC_LFR_RESET TeleCommand has been received.
651 137 *
652 138 * @param TC points to the TeleCommand packet that is being processed
653 139 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
654 140 *
655 141 */
656 142
657 143 send_tm_lfr_tc_exe_not_implemented( TC, queue_id );
658 144 return LFR_DEFAULT;
659 145 }
660 146
661 147 int action_enter_mode(ccsdsTelecommandPacket_t *TC, rtems_id queue_id)
662 148 {
663 149 /** This function executes specific actions when a TC_LFR_ENTER_MODE TeleCommand has been received.
664 150 *
665 151 * @param TC points to the TeleCommand packet that is being processed
666 152 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
667 153 *
668 154 */
669 155
670 156 rtems_status_code status;
671 157 unsigned char requestedMode;
672 158
673 159 requestedMode = TC->dataAndCRC[1];
674 160
675 161 if ( (requestedMode != LFR_MODE_STANDBY)
676 162 && (requestedMode != LFR_MODE_NORMAL) && (requestedMode != LFR_MODE_BURST)
677 163 && (requestedMode != LFR_MODE_SBM1) && (requestedMode != LFR_MODE_SBM2) )
678 164 {
679 165 status = RTEMS_UNSATISFIED;
680 166 send_tm_lfr_tc_exe_inconsistent( TC, queue_id, BYTE_POS_CP_LFR_MODE, requestedMode );
681 167 }
682 168 else
683 169 {
684 170 printf("try to enter mode %d\n", requestedMode);
685 171
686 172 #ifdef PRINT_TASK_STATISTICS
687 173 if (requestedMode != LFR_MODE_STANDBY)
688 174 {
689 175 rtems_cpu_usage_reset();
690 176 maxCount = 0;
691 177 }
692 178 #endif
693 179
694 180 status = transition_validation(requestedMode);
695 181
696 182 if ( status == LFR_SUCCESSFUL ) {
697 183 if ( lfrCurrentMode != LFR_MODE_STANDBY)
698 184 {
699 185 status = stop_current_mode();
700 186 }
701 187 if (status != RTEMS_SUCCESSFUL)
702 188 {
703 189 PRINTF("ERR *** in action_enter *** stop_current_mode\n")
704 190 }
705 191 status = enter_mode(requestedMode, TC);
706 192 }
707 193 else
708 194 {
709 195 PRINTF("ERR *** in action_enter *** transition rejected\n")
710 196 send_tm_lfr_tc_exe_not_executable( TC, queue_id );
711 197 }
712 198 }
713 199
714 200 return status;
715 201 }
716 202
717 203 int action_update_info(ccsdsTelecommandPacket_t *TC, rtems_id queue_id)
718 204 {
719 205 /** This function executes specific actions when a TC_LFR_UPDATE_INFO TeleCommand has been received.
720 206 *
721 207 * @param TC points to the TeleCommand packet that is being processed
722 208 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
723 209 *
724 210 */
725 211
726 212 unsigned int val;
727 213 int result;
728 214 unsigned char lfrMode;
729 215
730 216 result = LFR_DEFAULT;
731 217 lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4;
732 218
733 219 if ( (lfrMode == LFR_MODE_STANDBY) ) {
734 220 send_tm_lfr_tc_exe_not_implemented( TC, queue_id );
735 221 result = LFR_DEFAULT;
736 222 }
737 223 else {
738 224 val = housekeeping_packet.hk_lfr_update_info_tc_cnt[0] * 256
739 225 + housekeeping_packet.hk_lfr_update_info_tc_cnt[1];
740 226 val++;
741 227 housekeeping_packet.hk_lfr_update_info_tc_cnt[0] = (unsigned char) (val >> 8);
742 228 housekeeping_packet.hk_lfr_update_info_tc_cnt[1] = (unsigned char) (val);
743 229 result = LFR_SUCCESSFUL;
744 230 }
745 231
746 232 return result;
747 233 }
748 234
749 235 int action_enable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id)
750 236 {
751 237 /** This function executes specific actions when a TC_LFR_ENABLE_CALIBRATION TeleCommand has been received.
752 238 *
753 239 * @param TC points to the TeleCommand packet that is being processed
754 240 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
755 241 *
756 242 */
757 243
758 244 int result;
759 245 unsigned char lfrMode;
760 246
761 247 result = LFR_DEFAULT;
762 248 lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4;
763 249
764 250 if ( (lfrMode == LFR_MODE_STANDBY) | (lfrMode == LFR_MODE_BURST) | (lfrMode == LFR_MODE_SBM2) ) {
765 251 send_tm_lfr_tc_exe_not_executable( TC, queue_id );
766 252 result = LFR_DEFAULT;
767 253 }
768 254 else {
769 255 send_tm_lfr_tc_exe_not_implemented( TC, queue_id );
770 256 result = LFR_DEFAULT;
771 257 }
772 258 return result;
773 259 }
774 260
775 261 int action_disable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id)
776 262 {
777 263 /** This function executes specific actions when a TC_LFR_DISABLE_CALIBRATION TeleCommand has been received.
778 264 *
779 265 * @param TC points to the TeleCommand packet that is being processed
780 266 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
781 267 *
782 268 */
783 269
784 270 int result;
785 271 unsigned char lfrMode;
786 272
787 273 result = LFR_DEFAULT;
788 274 lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4;
789 275
790 276 if ( (lfrMode == LFR_MODE_STANDBY) | (lfrMode == LFR_MODE_BURST) | (lfrMode == LFR_MODE_SBM2) ) {
791 277 send_tm_lfr_tc_exe_not_executable( TC, queue_id );
792 278 result = LFR_DEFAULT;
793 279 }
794 280 else {
795 281 send_tm_lfr_tc_exe_not_implemented( TC, queue_id );
796 282 result = LFR_DEFAULT;
797 283 }
798 284 return result;
799 285 }
800 286
801 287 int action_update_time(ccsdsTelecommandPacket_t *TC)
802 288 {
803 289 /** This function executes specific actions when a TC_LFR_UPDATE_TIME TeleCommand has been received.
804 290 *
805 291 * @param TC points to the TeleCommand packet that is being processed
806 292 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
807 293 *
808 294 */
809 295
810 296 unsigned int val;
811 297
812 298 time_management_regs->coarse_time_load = (TC->dataAndCRC[0] << 24)
813 299 + (TC->dataAndCRC[1] << 16)
814 300 + (TC->dataAndCRC[2] << 8)
815 301 + TC->dataAndCRC[3];
816 302 val = housekeeping_packet.hk_lfr_update_time_tc_cnt[0] * 256
817 303 + housekeeping_packet.hk_lfr_update_time_tc_cnt[1];
818 304 val++;
819 305 housekeeping_packet.hk_lfr_update_time_tc_cnt[0] = (unsigned char) (val >> 8);
820 306 housekeeping_packet.hk_lfr_update_time_tc_cnt[1] = (unsigned char) (val);
821 307 time_management_regs->ctrl = time_management_regs->ctrl | 1;
822 308
823 309 return LFR_SUCCESSFUL;
824 310 }
825 311
826 312 //*******************
827 313 // ENTERING THE MODES
828 314
829 315 int transition_validation(unsigned char requestedMode)
830 316 {
831 317 int status;
832 318
833 319 switch (requestedMode)
834 320 {
835 321 case LFR_MODE_STANDBY:
836 322 if ( lfrCurrentMode == LFR_MODE_STANDBY ) {
837 323 status = LFR_DEFAULT;
838 324 }
839 325 else
840 326 {
841 327 status = LFR_SUCCESSFUL;
842 328 }
843 329 break;
844 330 case LFR_MODE_NORMAL:
845 331 if ( lfrCurrentMode == LFR_MODE_NORMAL ) {
846 332 status = LFR_DEFAULT;
847 333 }
848 334 else {
849 335 status = LFR_SUCCESSFUL;
850 336 }
851 337 break;
852 338 case LFR_MODE_BURST:
853 339 if ( lfrCurrentMode == LFR_MODE_BURST ) {
854 340 status = LFR_DEFAULT;
855 341 }
856 342 else {
857 343 status = LFR_SUCCESSFUL;
858 344 }
859 345 break;
860 346 case LFR_MODE_SBM1:
861 347 if ( lfrCurrentMode == LFR_MODE_SBM1 ) {
862 348 status = LFR_DEFAULT;
863 349 }
864 350 else {
865 351 status = LFR_SUCCESSFUL;
866 352 }
867 353 break;
868 354 case LFR_MODE_SBM2:
869 355 if ( lfrCurrentMode == LFR_MODE_SBM2 ) {
870 356 status = LFR_DEFAULT;
871 357 }
872 358 else {
873 359 status = LFR_SUCCESSFUL;
874 360 }
875 361 break;
876 362 default:
877 363 status = LFR_DEFAULT;
878 364 break;
879 365 }
880 366
881 367 return status;
882 368 }
883 369
884 370 int stop_current_mode()
885 371 {
886 372 /** This function stops the current mode by masking interrupt lines and suspending science tasks.
887 373 *
888 374 * @return RTEMS directive status codes:
889 375 * - RTEMS_SUCCESSFUL - task restarted successfully
890 376 * - RTEMS_INVALID_ID - task id invalid
891 377 * - RTEMS_ALREADY_SUSPENDED - task already suspended
892 378 *
893 379 */
894 380
895 381 rtems_status_code status;
896 382
897 383 status = RTEMS_SUCCESSFUL;
898 384
899 385 // mask all IRQ lines related to signal processing
900 386 LEON_Mask_interrupt( IRQ_SM ); // mask spectral matrices interrupt (coming from the timer VHDL IP)
901 387 LEON_Clear_interrupt( IRQ_SM ); // clear spectral matrices interrupt (coming from the timer VHDL IP)
902 388
903 389 #ifdef GSA
904 390 LEON_Mask_interrupt( IRQ_WF ); // mask waveform interrupt (coming from the timer VHDL IP)
905 391 LEON_Clear_interrupt( IRQ_WF ); // clear waveform interrupt (coming from the timer VHDL IP)
906 392 timer_stop( (gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_WF_SIMULATOR );
907 393 #else
908 394 LEON_Mask_interrupt( IRQ_WAVEFORM_PICKER ); // mask waveform picker interrupt
909 395 LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); // clear waveform picker interrupt
910 396 LEON_Mask_interrupt( IRQ_SPECTRAL_MATRIX ); // mask spectral matrix interrupt
911 397 LEON_Clear_interrupt( IRQ_SPECTRAL_MATRIX ); // clear spectral matrix interrupt
912 398 LEON_Mask_interrupt( IRQ_SM ); // for SM simulation
913 399 LEON_Clear_interrupt( IRQ_SM ); // for SM simulation
914 400 #endif
915 401 //**********************
916 402 // suspend several tasks
917 403 if (lfrCurrentMode != LFR_MODE_STANDBY) {
918 404 status = suspend_science_tasks();
919 405 }
920 406
921 407 if (status != RTEMS_SUCCESSFUL)
922 408 {
923 409 PRINTF1("in stop_current_mode *** in suspend_science_tasks *** ERR code: %d\n", status)
924 410 }
925 411
926 412 //*************************
927 413 // initialize the registers
928 414 #ifdef GSA
929 415 #else
930 416 reset_wfp_burst_enable(); // reset burst and enable bits
931 417 reset_wfp_status(); // reset all the status bits
932 418 #endif
933 419
934 420 return status;
935 421 }
936 422
937 423 int enter_mode(unsigned char mode, ccsdsTelecommandPacket_t *TC )
938 424 {
939 425 rtems_status_code status;
940 426
941 427 status = RTEMS_UNSATISFIED;
942 428
943 429 housekeeping_packet.lfr_status_word[0] = (unsigned char) ((mode << 4) + 0x0d);
944 430 lfrCurrentMode = mode;
945 431
946 432 switch(mode){
947 433 case LFR_MODE_STANDBY:
948 434 status = enter_standby_mode( TC );
949 435 break;
950 436 case LFR_MODE_NORMAL:
951 437 status = enter_normal_mode( TC );
952 438 break;
953 439 case LFR_MODE_BURST:
954 440 status = enter_burst_mode( TC );
955 441 break;
956 442 case LFR_MODE_SBM1:
957 443 status = enter_sbm1_mode( TC );
958 444 break;
959 445 case LFR_MODE_SBM2:
960 446 status = enter_sbm2_mode( TC );
961 447 break;
962 448 default:
963 449 status = RTEMS_UNSATISFIED;
964 450 }
965 451
966 452 if (status != RTEMS_SUCCESSFUL)
967 453 {
968 454 PRINTF("in enter_mode *** ERR\n")
969 455 status = RTEMS_UNSATISFIED;
970 456 }
971 457
972 458 return status;
973 459 }
974 460
975 461 int enter_standby_mode()
976 462 {
977 463 reset_waveform_picker_regs();
978 464
979 465 PRINTF1("maxCount = %d\n", maxCount)
980 466
981 467 #ifdef PRINT_TASK_STATISTICS
982 468 rtems_cpu_usage_report();
983 469 #endif
984 470
985 471 #ifdef PRINT_STACK_REPORT
986 472 rtems_stack_checker_report_usage();
987 473 #endif
988 474
989 475 return LFR_SUCCESSFUL;
990 476 }
991 477
992 478 int enter_normal_mode()
993 479 {
994 480 rtems_status_code status;
995 481
996 482 status = restart_science_tasks();
997 483
998 484 #ifdef GSA
999 485 timer_start( (gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_WF_SIMULATOR );
1000 486 timer_start( (gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR );
1001 487 LEON_Clear_interrupt( IRQ_WF );
1002 488 LEON_Unmask_interrupt( IRQ_WF );
1003 489 //
1004 490 set_local_nb_interrupt_f0_MAX();
1005 491 LEON_Clear_interrupt( IRQ_SM ); // the IRQ_SM seems to be incompatible with the IRQ_WF on the xilinx board
1006 492 LEON_Unmask_interrupt( IRQ_SM );
1007 493 #else
1008 494 //****************
1009 495 // waveform picker
1010 496 LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER );
1011 497 LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER );
1012 498 reset_waveform_picker_regs();
1013 499 set_wfp_burst_enable_register(LFR_MODE_NORMAL);
1014 500 //****************
1015 501 // spectral matrix
1016 502 // set_local_nb_interrupt_f0_MAX();
1017 503 // LEON_Clear_interrupt( IRQ_SPECTRAL_MATRIX ); // the IRQ_SM seems to be incompatible with the IRQ_WF on the xilinx board
1018 504 // LEON_Unmask_interrupt( IRQ_SPECTRAL_MATRIX );
1019 505 // spectral_matrix_regs->config = 0x01;
1020 506 // spectral_matrix_regs->status = 0x00;
1021 507 #endif
1022 508
1023 509 return status;
1024 510 }
1025 511
1026 512 int enter_burst_mode()
1027 513 {
1028 514 rtems_status_code status;
1029 515
1030 516 status = restart_science_tasks();
1031 517
1032 518 #ifdef GSA
1033 519 LEON_Unmask_interrupt( IRQ_SM );
1034 520 #else
1035 521 LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER );
1036 522 LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER );
1037 523 reset_waveform_picker_regs();
1038 524 set_wfp_burst_enable_register(LFR_MODE_BURST);
1039 525 #endif
1040 526
1041 527 return status;
1042 528 }
1043 529
1044 530 int enter_sbm1_mode()
1045 531 {
1046 532 rtems_status_code status;
1047 533
1048 534 status = restart_science_tasks();
1049 535
1050 536 set_local_sbm1_nb_cwf_max();
1051 537
1052 538 reset_local_sbm1_nb_cwf_sent();
1053 539
1054 540 #ifdef GSA
1055 541 LEON_Unmask_interrupt( IRQ_SM );
1056 542 #else
1057 543 LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER );
1058 544 LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER );
1059 545 reset_waveform_picker_regs();
1060 546 set_wfp_burst_enable_register(LFR_MODE_SBM1);
1061 547 // SM simulation
1062 548 // timer_start( (gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR );
1063 549 // LEON_Clear_interrupt( IRQ_SM ); // the IRQ_SM seems to be incompatible with the IRQ_WF on the xilinx board
1064 550 // LEON_Unmask_interrupt( IRQ_SM );
1065 551 #endif
1066 552
1067 553 return status;
1068 554 }
1069 555
1070 556 int enter_sbm2_mode()
1071 557 {
1072 558 rtems_status_code status;
1073 559
1074 560 status = restart_science_tasks();
1075 561
1076 562 set_local_sbm2_nb_cwf_max();
1077 563
1078 564 reset_local_sbm2_nb_cwf_sent();
1079 565
1080 566 #ifdef GSA
1081 567 LEON_Unmask_interrupt( IRQ_SM );
1082 568 #else
1083 569 LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER );
1084 570 LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER );
1085 571 reset_waveform_picker_regs();
1086 572 set_wfp_burst_enable_register(LFR_MODE_SBM2);
1087 573 #endif
1088 574
1089 575 return status;
1090 576 }
1091 577
1092 578 int restart_science_tasks()
1093 579 {
1094 580 rtems_status_code status[6];
1095 581 rtems_status_code ret;
1096 582
1097 583 ret = RTEMS_SUCCESSFUL;
1098 584
1099 585 status[0] = rtems_task_restart( Task_id[TASKID_AVF0], 1 );
1100 586 if (status[0] != RTEMS_SUCCESSFUL)
1101 587 {
1102 588 PRINTF1("in restart_science_task *** 0 ERR %d\n", status[0])
1103 589 }
1104 590
1105 591 status[1] = rtems_task_restart( Task_id[TASKID_BPF0],1 );
1106 592 if (status[1] != RTEMS_SUCCESSFUL)
1107 593 {
1108 594 PRINTF1("in restart_science_task *** 1 ERR %d\n", status[1])
1109 595 }
1110 596
1111 597 status[2] = rtems_task_restart( Task_id[TASKID_WFRM],1 );
1112 598 if (status[2] != RTEMS_SUCCESSFUL)
1113 599 {
1114 600 PRINTF1("in restart_science_task *** 2 ERR %d\n", status[2])
1115 601 }
1116 602
1117 603 status[3] = rtems_task_restart( Task_id[TASKID_CWF3],1 );
1118 604 if (status[3] != RTEMS_SUCCESSFUL)
1119 605 {
1120 606 PRINTF1("in restart_science_task *** 3 ERR %d\n", status[3])
1121 607 }
1122 608
1123 609 status[4] = rtems_task_restart( Task_id[TASKID_CWF2],1 );
1124 610 if (status[4] != RTEMS_SUCCESSFUL)
1125 611 {
1126 612 PRINTF1("in restart_science_task *** 4 ERR %d\n", status[4])
1127 613 }
1128 614
1129 615 status[5] = rtems_task_restart( Task_id[TASKID_CWF1],1 );
1130 616 if (status[5] != RTEMS_SUCCESSFUL)
1131 617 {
1132 618 PRINTF1("in restart_science_task *** 5 ERR %d\n", status[5])
1133 619 }
1134 620
1135 621 if ( (status[0] != RTEMS_SUCCESSFUL) || (status[1] != RTEMS_SUCCESSFUL) || (status[2] != RTEMS_SUCCESSFUL) ||
1136 622 (status[3] != RTEMS_SUCCESSFUL) || (status[4] != RTEMS_SUCCESSFUL) || (status[5] != RTEMS_SUCCESSFUL) )
1137 623 {
1138 624 ret = RTEMS_UNSATISFIED;
1139 625 }
1140 626
1141 627 return ret;
1142 628 }
1143 629
1144 630 int suspend_science_tasks()
1145 631 {
1146 632 /** This function suspends the science tasks.
1147 633 *
1148 634 * @return RTEMS directive status codes:
1149 635 * - RTEMS_SUCCESSFUL - task restarted successfully
1150 636 * - RTEMS_INVALID_ID - task id invalid
1151 637 * - RTEMS_ALREADY_SUSPENDED - task already suspended
1152 638 *
1153 639 */
1154 640
1155 641 rtems_status_code status;
1156 642
1157 643 status = rtems_task_suspend( Task_id[TASKID_AVF0] );
1158 644 if (status != RTEMS_SUCCESSFUL)
1159 645 {
1160 646 PRINTF1("in suspend_science_task *** AVF0 ERR %d\n", status)
1161 647 }
1162 648 if (status == RTEMS_SUCCESSFUL) // suspend BPF0
1163 649 {
1164 650 status = rtems_task_suspend( Task_id[TASKID_BPF0] );
1165 651 if (status != RTEMS_SUCCESSFUL)
1166 652 {
1167 653 PRINTF1("in suspend_science_task *** BPF0 ERR %d\n", status)
1168 654 }
1169 655 }
1170 656 if (status == RTEMS_SUCCESSFUL) // suspend WFRM
1171 657 {
1172 658 status = rtems_task_suspend( Task_id[TASKID_WFRM] );
1173 659 if (status != RTEMS_SUCCESSFUL)
1174 660 {
1175 661 PRINTF1("in suspend_science_task *** WFRM ERR %d\n", status)
1176 662 }
1177 663 }
1178 664
1179 665 if (status == RTEMS_SUCCESSFUL) // suspend CWF3
1180 666 {
1181 667 status = rtems_task_suspend( Task_id[TASKID_CWF3] );
1182 668 if (status != RTEMS_SUCCESSFUL)
1183 669 {
1184 670 PRINTF1("in suspend_science_task *** CWF3 ERR %d\n", status)
1185 671 }
1186 672 }
1187 673 if (status == RTEMS_SUCCESSFUL) // suspend CWF2
1188 674 {
1189 675 status = rtems_task_suspend( Task_id[TASKID_CWF2] );
1190 676 if (status != RTEMS_SUCCESSFUL)
1191 677 {
1192 678 PRINTF1("in suspend_science_task *** CWF2 ERR %d\n", status)
1193 679 }
1194 680 }
1195 681 if (status == RTEMS_SUCCESSFUL) // suspend CWF1
1196 682 {
1197 683 status = rtems_task_suspend( Task_id[TASKID_CWF1] );
1198 684 if (status != RTEMS_SUCCESSFUL)
1199 685 {
1200 686 PRINTF1("in suspend_science_task *** CWF1 ERR %d\n", status)
1201 687 }
1202 688 }
1203 689
1204 690 return status;
1205 691 }
1206 692
1207 693 //****************
1208 694 // CLOSING ACTIONS
1209 695 void update_last_TC_exe(ccsdsTelecommandPacket_t *TC)
1210 696 {
1211 697 housekeeping_packet.hk_lfr_last_exe_tc_id[0] = TC->packetID[0];
1212 698 housekeeping_packet.hk_lfr_last_exe_tc_id[1] = TC->packetID[1];
1213 699 housekeeping_packet.hk_lfr_last_exe_tc_type[0] = 0x00;
1214 700 housekeeping_packet.hk_lfr_last_exe_tc_type[1] = TC->serviceType;
1215 701 housekeeping_packet.hk_lfr_last_exe_tc_subtype[0] = 0x00;
1216 702 housekeeping_packet.hk_lfr_last_exe_tc_subtype[1] = TC->serviceSubType;
1217 703 housekeeping_packet.hk_lfr_last_exe_tc_time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
1218 704 housekeeping_packet.hk_lfr_last_exe_tc_time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
1219 705 housekeeping_packet.hk_lfr_last_exe_tc_time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
1220 706 housekeeping_packet.hk_lfr_last_exe_tc_time[3] = (unsigned char) (time_management_regs->coarse_time);
1221 707 housekeeping_packet.hk_lfr_last_exe_tc_time[4] = (unsigned char) (time_management_regs->fine_time>>8);
1222 708 housekeeping_packet.hk_lfr_last_exe_tc_time[5] = (unsigned char) (time_management_regs->fine_time);
1223 709 }
1224 710
1225 711 void update_last_TC_rej(ccsdsTelecommandPacket_t *TC)
1226 712 {
1227 713 housekeeping_packet.hk_lfr_last_rej_tc_id[0] = TC->packetID[0];
1228 714 housekeeping_packet.hk_lfr_last_rej_tc_id[1] = TC->packetID[1];
1229 715 housekeeping_packet.hk_lfr_last_rej_tc_type[0] = 0x00;
1230 716 housekeeping_packet.hk_lfr_last_rej_tc_type[1] = TC->serviceType;
1231 717 housekeeping_packet.hk_lfr_last_rej_tc_subtype[0] = 0x00;
1232 718 housekeeping_packet.hk_lfr_last_rej_tc_subtype[1] = TC->serviceSubType;
1233 719 housekeeping_packet.hk_lfr_last_rej_tc_time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
1234 720 housekeeping_packet.hk_lfr_last_rej_tc_time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
1235 721 housekeeping_packet.hk_lfr_last_rej_tc_time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
1236 722 housekeeping_packet.hk_lfr_last_rej_tc_time[3] = (unsigned char) (time_management_regs->coarse_time);
1237 723 housekeeping_packet.hk_lfr_last_rej_tc_time[4] = (unsigned char) (time_management_regs->fine_time>>8);
1238 724 housekeeping_packet.hk_lfr_last_rej_tc_time[5] = (unsigned char) (time_management_regs->fine_time);
1239 725 }
1240 726
1241 727 void close_action(ccsdsTelecommandPacket_t *TC, int result, rtems_id queue_id)
1242 728 {
1243 729 unsigned int val = 0;
1244 730 if (result == LFR_SUCCESSFUL)
1245 731 {
1246 732 if ( !( (TC->serviceType==TC_TYPE_TIME) && (TC->serviceSubType==TC_SUBTYPE_UPDT_TIME) ) )
1247 733 {
1248 734 send_tm_lfr_tc_exe_success( TC, queue_id );
1249 735 }
1250 736 update_last_TC_exe( TC );
1251 737 val = housekeeping_packet.hk_dpu_exe_tc_lfr_cnt[0] * 256 + housekeeping_packet.hk_dpu_exe_tc_lfr_cnt[1];
1252 738 val++;
1253 739 housekeeping_packet.hk_dpu_exe_tc_lfr_cnt[0] = (unsigned char) (val >> 8);
1254 740 housekeeping_packet.hk_dpu_exe_tc_lfr_cnt[1] = (unsigned char) (val);
1255 741 }
1256 742 else
1257 743 {
1258 744 update_last_TC_rej( TC );
1259 745 val = housekeeping_packet.hk_dpu_rej_tc_lfr_cnt[0] * 256 + housekeeping_packet.hk_dpu_rej_tc_lfr_cnt[1];
1260 746 val++;
1261 747 housekeeping_packet.hk_dpu_rej_tc_lfr_cnt[0] = (unsigned char) (val >> 8);
1262 748 housekeeping_packet.hk_dpu_rej_tc_lfr_cnt[1] = (unsigned char) (val);
1263 749 }
1264 750 }
1265 751
1266 752 //***************************
1267 753 // Interrupt Service Routines
1268 754 rtems_isr commutation_isr1( rtems_vector_number vector )
1269 755 {
1270 756 if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) {
1271 757 printf("In commutation_isr1 *** Error sending event to DUMB\n");
1272 758 }
1273 759 }
1274 760
1275 761 rtems_isr commutation_isr2( rtems_vector_number vector )
1276 762 {
1277 763 if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) {
1278 764 printf("In commutation_isr2 *** Error sending event to DUMB\n");
1279 765 }
1280 766 }
1281 767
1282
768 //****************
769 // OTHER FUNCTIONS
770 void updateLFRCurrentMode()
771 {
772 /** This function updates the value of the global variable lfrCurrentMode.
773 *
774 * lfrCurrentMode is a parameter used by several functions to know in which mode LFR is running.
775 *
776 */
777 // update the local value of lfrCurrentMode with the value contained in the housekeeping_packet structure
778 lfrCurrentMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4;
779 }
1283 780
1284
@@ -1,377 +1,380
1 1 /** Functions to load and dump parameters in the LFR registers.
2 2 *
3 3 * @file
4 4 * @author P. LEROY
5 5 *
6 6 * A group of functions to handle TC related to parameter loading and dumping.\n
7 7 * TC_LFR_LOAD_COMMON_PAR\n
8 8 * TC_LFR_LOAD_NORMAL_PAR\n
9 9 * TC_LFR_LOAD_BURST_PAR\n
10 10 * TC_LFR_LOAD_SBM1_PAR\n
11 11 * TC_LFR_LOAD_SBM2_PAR\n
12 12 *
13 13 */
14 14
15 15 #include "tc_load_dump_parameters.h"
16 16
17 17 int action_load_common_par(ccsdsTelecommandPacket_t *TC)
18 18 {
19 19 /** This function updates the LFR registers with the incoming common parameters.
20 20 *
21 21 * @param TC points to the TeleCommand packet that is being processed
22 22 *
23 23 *
24 24 */
25
25 26 parameter_dump_packet.unused0 = TC->dataAndCRC[0];
26 27 parameter_dump_packet.bw_sp0_sp1_r0_r1 = TC->dataAndCRC[1];
27 28 set_wfp_data_shaping(parameter_dump_packet.bw_sp0_sp1_r0_r1);
28 29 return LFR_SUCCESSFUL;
29 30 }
30 31
31 32 int action_load_normal_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id)
32 33 {
33 34 /** This function updates the LFR registers with the incoming normal parameters.
34 35 *
35 36 * @param TC points to the TeleCommand packet that is being processed
36 37 * @param queue_id is the id of the queue which handles TM related to this execution step
37 38 *
38 39 */
40
39 41 int result;
40 42 int flag;
41 43
42 44 flag = LFR_SUCCESSFUL;
43 45 result = LFR_SUCCESSFUL;
44 46
45 47 if ( lfrCurrentMode == LFR_MODE_NORMAL ) {
46 48 send_tm_lfr_tc_exe_not_executable( TC, queue_id );
47 49 flag = LFR_DEFAULT;
48 50 }
49 51
50 52 //***************
51 53 // sy_lfr_n_swf_l
52 54 if (flag == LFR_SUCCESSFUL)
53 55 {
54 56 result = set_sy_lfr_n_swf_l( TC, queue_id );
55 57 if (result != LFR_SUCCESSFUL)
56 58 {
57 59 flag = LFR_DEFAULT;
58 60 }
59 61 }
60 62
61 63 //***************
62 64 // sy_lfr_n_swf_p
63 65 if (flag == LFR_SUCCESSFUL)
64 66 {
65 67 result = set_sy_lfr_n_swf_p( TC, queue_id );
66 68 if (result != LFR_SUCCESSFUL)
67 69 {
68 70 flag = LFR_DEFAULT;
69 71 }
70 72 }
71 73
72 74 //***************
73 75 // sy_lfr_n_asm_p
74 76 if (flag == LFR_SUCCESSFUL)
75 77 {
76 78 result = set_sy_lfr_n_asm_p( TC, queue_id );
77 79 if (result != LFR_SUCCESSFUL)
78 80 {
79 81 flag = LFR_DEFAULT;
80 82 }
81 83 }
82 84
83 85 //***************
84 86 // sy_lfr_n_bp_p0
85 87 if (flag == LFR_SUCCESSFUL)
86 88 {
87 89 result = set_sy_lfr_n_bp_p0( TC, queue_id );
88 90 if (result != LFR_SUCCESSFUL)
89 91 {
90 92 flag = LFR_DEFAULT;
91 93 }
92 94 }
93 95
94 96 //***************
95 97 // sy_lfr_n_bp_p1
96 98 if (flag == LFR_SUCCESSFUL)
97 99 {
98 100 result = set_sy_lfr_n_bp_p1( TC, queue_id );
99 101 if (result != LFR_SUCCESSFUL)
100 102 {
101 103 flag = LFR_DEFAULT;
102 104 }
103 105 }
104 106
105 107 return result;
106 108 }
107 109
108 110 int action_load_burst_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id)
109 111 {
110 112 /** This function updates the LFR registers with the incoming burst parameters.
111 113 *
112 114 * @param TC points to the TeleCommand packet that is being processed
113 115 * @param queue_id is the id of the queue which handles TM related to this execution step
114 116 *
115 117 */
118
116 119 int result;
117 120 unsigned char lfrMode;
118 121
119 122 result = LFR_DEFAULT;
120 123 lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4;
121 124
122 125 if ( lfrMode == LFR_MODE_BURST ) {
123 126 send_tm_lfr_tc_exe_not_executable( TC, queue_id );
124 127 result = LFR_DEFAULT;
125 128 }
126 129 else {
127 130 parameter_dump_packet.sy_lfr_b_bp_p0 = TC->dataAndCRC[0];
128 131 parameter_dump_packet.sy_lfr_b_bp_p1 = TC->dataAndCRC[1];
129 132
130 133 result = LFR_SUCCESSFUL;
131 134 }
132 135
133 136 return result;
134 137 }
135 138
136 139 int action_load_sbm1_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id)
137 140 {
138 141 /** This function updates the LFR registers with the incoming sbm1 parameters.
139 142 *
140 143 * @param TC points to the TeleCommand packet that is being processed
141 144 * @param queue_id is the id of the queue which handles TM related to this execution step
142 145 *
143 146 */
144 147 int result;
145 148 unsigned char lfrMode;
146 149
147 150 result = LFR_DEFAULT;
148 151 lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4;
149 152
150 153 if ( lfrMode == LFR_MODE_SBM1 ) {
151 154 send_tm_lfr_tc_exe_not_executable( TC, queue_id );
152 155 result = LFR_DEFAULT;
153 156 }
154 157 else {
155 158 parameter_dump_packet.sy_lfr_s1_bp_p0 = TC->dataAndCRC[0];
156 159 parameter_dump_packet.sy_lfr_s1_bp_p1 = TC->dataAndCRC[1];
157 160
158 161 result = LFR_SUCCESSFUL;
159 162 }
160 163
161 164 return result;
162 165 }
163 166
164 167 int action_load_sbm2_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id)
165 168 {
166 169 /** This function updates the LFR registers with the incoming sbm2 parameters.
167 170 *
168 171 * @param TC points to the TeleCommand packet that is being processed
169 172 * @param queue_id is the id of the queue which handles TM related to this execution step
170 173 *
171 174 */
172 175
173 176 int result;
174 177 unsigned char lfrMode;
175 178
176 179 result = LFR_DEFAULT;
177 180 lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4;
178 181
179 182 if ( lfrMode == LFR_MODE_SBM2 ) {
180 183 send_tm_lfr_tc_exe_not_executable( TC, queue_id );
181 184 result = LFR_DEFAULT;
182 185 }
183 186 else {
184 187 parameter_dump_packet.sy_lfr_s2_bp_p0 = TC->dataAndCRC[0];
185 188 parameter_dump_packet.sy_lfr_s2_bp_p1 = TC->dataAndCRC[1];
186 189
187 190 result = LFR_SUCCESSFUL;
188 191 }
189 192
190 193 return result;
191 194 }
192 195
193 196 int action_dump_par( rtems_id queue_id )
194 197 {
195 198 /** This function dumps the LFR parameters by sending the appropriate TM packet to the dedicated RTEMS message queue.
196 199 *
197 200 * @param queue_id is the id of the queue which handles TM related to this execution step.
198 201 *
199 202 * @return RTEMS directive status codes:
200 203 * - RTEMS_SUCCESSFUL - message sent successfully
201 204 * - RTEMS_INVALID_ID - invalid queue id
202 205 * - RTEMS_INVALID_SIZE - invalid message size
203 206 * - RTEMS_INVALID_ADDRESS - buffer is NULL
204 207 * - RTEMS_UNSATISFIED - out of message buffers
205 208 * - RTEMS_TOO_MANY - queue s limit has been reached
206 209 *
207 210 */
208 211
209 212 int status;
210 213
211 214 // SEND DATA
212 215 status = rtems_message_queue_send( queue_id, &parameter_dump_packet,
213 216 PACKET_LENGTH_PARAMETER_DUMP + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES);
214 217 if (status != RTEMS_SUCCESSFUL) {
215 218 PRINTF1("in action_dump *** ERR sending packet, code %d", status)
216 219 }
217 220
218 221 return status;
219 222 }
220 223
221 224 //***********************
222 225 // NORMAL MODE PARAMETERS
223 226
224 227 int set_sy_lfr_n_swf_l( ccsdsTelecommandPacket_t *TC, rtems_id queue_id )
225 228 {
226 229 /** This function sets the number of points of a snapshot (sy_lfr_n_swf_l).
227 230 *
228 231 * @param TC points to the TeleCommand packet that is being processed
229 232 * @param queue_id is the id of the queue which handles TM related to this execution step
230 233 *
231 234 */
232 235
233 236 unsigned int tmp;
234 237 int result;
235 238 unsigned char msb;
236 239 unsigned char lsb;
237 240
238 241 msb = TC->dataAndCRC[ BYTE_POS_SY_LFR_N_SWF_L ];
239 242 lsb = TC->dataAndCRC[ BYTE_POS_SY_LFR_N_SWF_L+1 ];
240 243
241 244 tmp = ( unsigned int ) floor(
242 245 ( ( msb*256 ) + lsb ) / 16
243 246 ) * 16;
244 247
245 248 if ( (tmp < 16) || (tmp > 2048) ) // the snapshot period is a multiple of 16
246 249 { // 2048 is the maximum limit due to thesize of the buffers
247 250 send_tm_lfr_tc_exe_inconsistent( TC, queue_id, BYTE_POS_SY_LFR_N_SWF_L+10, lsb );
248 251 result = WRONG_APP_DATA;
249 252 }
250 253 else if (tmp != 2048)
251 254 {
252 255 send_tm_lfr_tc_exe_not_implemented( TC, queue_id );
253 256 result = FUNCT_NOT_IMPL;
254 257 }
255 258 else
256 259 {
257 260 parameter_dump_packet.sy_lfr_n_swf_l[0] = (unsigned char) (tmp >> 8);
258 261 parameter_dump_packet.sy_lfr_n_swf_l[1] = (unsigned char) (tmp );
259 262 result = LFR_SUCCESSFUL;
260 263 }
261 264
262 265 return result;
263 266 }
264 267
265 268 int set_sy_lfr_n_swf_p( ccsdsTelecommandPacket_t *TC, rtems_id queue_id )
266 269 {
267 270 /** This function sets the time between two snapshots, in s (sy_lfr_n_swf_p).
268 271 *
269 272 * @param TC points to the TeleCommand packet that is being processed
270 273 * @param queue_id is the id of the queue which handles TM related to this execution step
271 274 *
272 275 */
273 276
274 277 unsigned int tmp;
275 278 int result;
276 279 unsigned char msb;
277 280 unsigned char lsb;
278 281
279 282 msb = TC->dataAndCRC[ BYTE_POS_SY_LFR_N_SWF_P ];
280 283 lsb = TC->dataAndCRC[ BYTE_POS_SY_LFR_N_SWF_P+1 ];
281 284
282 285 tmp = ( unsigned int ) floor(
283 286 ( ( msb*256 ) + lsb ) / 8
284 287 ) * 8;
285 288
286 289 if ( (tmp < 16) || (tmp > 65528) )
287 290 {
288 291 send_tm_lfr_tc_exe_inconsistent( TC, queue_id, BYTE_POS_SY_LFR_N_SWF_P+10, lsb );
289 292 result = WRONG_APP_DATA;
290 293 }
291 294 else
292 295 {
293 296 parameter_dump_packet.sy_lfr_n_swf_p[0] = (unsigned char) (tmp >> 8);
294 297 parameter_dump_packet.sy_lfr_n_swf_p[1] = (unsigned char) (tmp );
295 298 result = LFR_SUCCESSFUL;
296 299 }
297 300
298 301 return result;
299 302 }
300 303
301 304 int set_sy_lfr_n_asm_p( ccsdsTelecommandPacket_t *TC, rtems_id queue_id )
302 305 {
303 306 /** This function sets the time between two full spectral matrices transmission, in s (sy_lfr_n_asm_p).
304 307 *
305 308 * @param TC points to the TeleCommand packet that is being processed
306 309 * @param queue_id is the id of the queue which handles TM related to this execution step
307 310 *
308 311 */
309 312
310 313 int result;
311 314 unsigned char msb;
312 315 unsigned char lsb;
313 316
314 317 msb = TC->dataAndCRC[ BYTE_POS_SY_LFR_N_ASM_P ];
315 318 lsb = TC->dataAndCRC[ BYTE_POS_SY_LFR_N_ASM_P+1 ];
316 319
317 320 parameter_dump_packet.sy_lfr_n_asm_p[0] = msb;
318 321 parameter_dump_packet.sy_lfr_n_asm_p[1] = lsb;
319 322 result = LFR_SUCCESSFUL;
320 323
321 324 return result;
322 325 }
323 326
324 327 int set_sy_lfr_n_bp_p0( ccsdsTelecommandPacket_t *TC, rtems_id queue_id )
325 328 {
326 329 /** This function sets the time between two basic parameter sets, in s (sy_lfr_n_bp_p0).
327 330 *
328 331 * @param TC points to the TeleCommand packet that is being processed
329 332 * @param queue_id is the id of the queue which handles TM related to this execution step
330 333 *
331 334 */
332 335
333 336 int status;
334 337
335 338 status = LFR_SUCCESSFUL;
336 339
337 340 parameter_dump_packet.sy_lfr_n_bp_p0 = TC->dataAndCRC[ BYTE_POS_SY_LFR_N_BP_P0 ];
338 341
339 342 return status;
340 343 }
341 344
342 345 int set_sy_lfr_n_bp_p1(ccsdsTelecommandPacket_t *TC, rtems_id queue_id)
343 346 {
344 347 /** This function sets the time between two basic parameter sets (autocorrelation + crosscorrelation), in s (sy_lfr_n_bp_p1).
345 348 *
346 349 * @param TC points to the TeleCommand packet that is being processed
347 350 * @param queue_id is the id of the queue which handles TM related to this execution step
348 351 *
349 352 */
350 353
351 354 int status;
352 355
353 356 status = LFR_SUCCESSFUL;
354 357
355 358 parameter_dump_packet.sy_lfr_n_bp_p1 = TC->dataAndCRC[ BYTE_POS_SY_LFR_N_BP_P1 ];
356 359
357 360 return status;
358 361 }
359 362
360 363 //**********************
361 364 // BURST MODE PARAMETERS
362 365
363 366 //*********************
364 367 // SBM1 MODE PARAMETERS
365 368
366 369 //*********************
367 370 // SBM2 MODE PARAMETERS
368 371
369 372
370 373
371 374
372 375
373 376
374 377
375 378
376 379
377 380
@@ -1,1106 +1,1171
1 1 /** Functions and tasks related to waveform packet generation.
2 2 *
3 3 * @file
4 4 * @author P. LEROY
5 5 *
6 6 * A group of functions to handle waveforms, in snapshot or continuous format.\n
7 7 *
8 8 */
9 9
10 10 #include "wf_handler.h"
11 11
12 12 // SWF
13 13 Header_TM_LFR_SCIENCE_SWF_t headerSWF_F0[7];
14 14 Header_TM_LFR_SCIENCE_SWF_t headerSWF_F1[7];
15 15 Header_TM_LFR_SCIENCE_SWF_t headerSWF_F2[7];
16 16 // CWF
17 17 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F1[7];
18 18 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F2_BURST[7];
19 19 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F2_SBM2[7];
20 20 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F3[7];
21 21 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F3_light[7];
22 22
23 23 unsigned char doubleSendCWF1 = 0;
24 24 unsigned char doubleSendCWF2 = 0;
25 25
26 26 rtems_isr waveforms_isr( rtems_vector_number vector )
27 27 {
28 /** This is the interrupt sub routine called by the waveform picker core.
29 *
30 * This ISR launch different actions depending mainly on two pieces of information:
31 * 1. the values read in the registers of the waveform picker.
32 * 2. the current LFR mode.
33 *
34 */
28 35
29 36 #ifdef GSA
30 37 #else
31 38 if ( (lfrCurrentMode == LFR_MODE_NORMAL)
32 39 || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) )
33 40 { // in modes other than STANDBY and BURST, send the CWF_F3 data
34 41 if ((waveform_picker_regs->status & 0x08) == 0x08){ // [1000] f3 is full
35 42 // (1) change the receiving buffer for the waveform picker
36 43 if (waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3) {
37 44 waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_bis);
38 45 }
39 46 else {
40 47 waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3);
41 48 }
42 49 // (2) send an event for the waveforms transmission
43 50 if (rtems_event_send( Task_id[TASKID_CWF3], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) {
44 51 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
45 52 }
46 53 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffff777; // reset f3 bits to 0, [1111 0111 0111 0111]
47 54 }
48 55 }
49 56 #endif
50 57
51 58 switch(lfrCurrentMode)
52 59 {
53 60 //********
54 61 // STANDBY
55 62 case(LFR_MODE_STANDBY):
56 63 break;
57 64
58 65 //******
59 66 // NORMAL
60 67 case(LFR_MODE_NORMAL):
61 68 #ifdef GSA
62 69 PRINTF("in waveform_isr *** unexpected waveform picker interruption\n")
63 70 #else
64 71 if ( (waveform_picker_regs->burst_enable & 0x7) == 0x0 ){ // if no channel is enable
65 72 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
66 73 }
67 74 else {
68 75 if ( (waveform_picker_regs->status & 0x7) == 0x7 ){ // f2 f1 and f0 are full
69 76 waveform_picker_regs->burst_enable = waveform_picker_regs->burst_enable & 0x08;
70 77 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) {
71 78 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
72 79 }
73 80 waveform_picker_regs->status = waveform_picker_regs->status & 0x00;
74 81 waveform_picker_regs->burst_enable = waveform_picker_regs->burst_enable | 0x07; // [0111] enable f2 f1 f0
75 82 }
76 83 }
77 84 #endif
78 85 break;
79 86
80 87 //******
81 88 // BURST
82 89 case(LFR_MODE_BURST):
83 90 #ifdef GSA
84 91 PRINTF("in waveform_isr *** unexpected waveform picker interruption\n")
85 92 #else
86 93 if ((waveform_picker_regs->status & 0x04) == 0x04){ // [0100] check the f2 full bit
87 94 // (1) change the receiving buffer for the waveform picker
88 95 if (waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2) {
89 96 waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2_bis);
90 97 }
91 98 else {
92 99 waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2);
93 100 }
94 101 // (2) send an event for the waveforms transmission
95 102 if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_BURST ) != RTEMS_SUCCESSFUL) {
96 103 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
97 104 }
98 105 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bits = 0
99 106 }
100 107 #endif
101 108 break;
102 109
103 110 //*****
104 111 // SBM1
105 112 case(LFR_MODE_SBM1):
106 113 #ifdef GSA
107 114 PRINTF("in waveform_isr *** unexpected waveform picker interruption\n")
108 115 #else
109 116 if ((waveform_picker_regs->status & 0x02) == 0x02){ // [0010] check the f1 full bit
110 117 // (1) change the receiving buffer for the waveform picker
111 118 if ( param_local.local_sbm1_nb_cwf_sent == (param_local.local_sbm1_nb_cwf_max-1) )
112 119 {
113 120 waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1_norm);
114 121 }
115 122 else if ( waveform_picker_regs->addr_data_f1 == (int) wf_snap_f1_norm )
116 123 {
117 124 doubleSendCWF1 = 1;
118 125 waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1);
119 126 }
120 127 else if ( waveform_picker_regs->addr_data_f1 == (int) wf_snap_f1 ) {
121 128 waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1_bis);
122 129 }
123 130 else {
124 131 waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1);
125 132 }
126 133 // (2) send an event for the waveforms transmission
127 134 if (rtems_event_send( Task_id[TASKID_CWF1], RTEMS_EVENT_MODE_SBM1 ) != RTEMS_SUCCESSFUL) {
128 135 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
129 136 }
130 137 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffddd; // [1111 1101 1101 1101] f1 bit = 0
131 138 }
132 139 if ( ( (waveform_picker_regs->status & 0x05) == 0x05 ) ) { // [0101] check the f2 and f0 full bit
133 140 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) {
134 141 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
135 142 }
136 143 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffaaa; // [1111 1010 1010 1010] f2 and f0 bits = 0
137 144 reset_local_sbm1_nb_cwf_sent();
138 145 }
139 146
140 147 #endif
141 148 break;
142 149
143 150 //*****
144 151 // SBM2
145 152 case(LFR_MODE_SBM2):
146 153 #ifdef GSA
147 154 PRINTF("in waveform_isr *** unexpected waveform picker interruption\n")
148 155 #else
149 156 if ((waveform_picker_regs->status & 0x04) == 0x04){ // [0100] check the f2 full bit
150 157 // (1) change the receiving buffer for the waveform picker
151 158 if ( param_local.local_sbm2_nb_cwf_sent == (param_local.local_sbm2_nb_cwf_max-1) )
152 159 {
153 160 waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2_norm);
154 161 }
155 162 else if ( waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2_norm ) {
156 163 waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2);
157 164 doubleSendCWF2 = 1;
158 165 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_SBM2_WFRM ) != RTEMS_SUCCESSFUL) {
159 166 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
160 167 }
161 168 reset_local_sbm2_nb_cwf_sent();
162 169 }
163 170 else if ( waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2 ) {
164 171 waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2_bis);
165 172 }
166 173 else {
167 174 waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2);
168 175 }
169 176 // (2) send an event for the waveforms transmission
170 177 if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_SBM2 ) != RTEMS_SUCCESSFUL) {
171 178 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
172 179 }
173 180 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit = 0
174 181 }
175 182 if ( ( (waveform_picker_regs->status & 0x03) == 0x03 ) ) { // [0011] f3 f2 f1 f0, f1 and f0 are full
176 183 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_SBM2 ) != RTEMS_SUCCESSFUL) {
177 184 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
178 185 }
179 186 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffccc; // [1111 1100 1100 1100] f1, f0 bits = 0
180 187 }
181 188 #endif
182 189 break;
183 190
184 191 //********
185 192 // DEFAULT
186 193 default:
187 194 break;
188 195 }
189 196 }
190 197
191 198 rtems_isr waveforms_simulator_isr( rtems_vector_number vector )
192 199 {
200 /** This is the interrupt sub routine called by the waveform picker simulator.
201 *
202 * This ISR is for debug purpose only.
203 *
204 */
205
193 206 unsigned char lfrMode;
194 207 lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4;
195 208
196 209 switch(lfrMode) {
197 210 case (LFR_MODE_STANDBY):
198 211 break;
199 212 case (LFR_MODE_NORMAL):
200 213 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) {
201 214 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_5 );
202 215 }
203 216 break;
204 217 case (LFR_MODE_BURST):
205 218 break;
206 219 case (LFR_MODE_SBM1):
207 220 break;
208 221 case (LFR_MODE_SBM2):
209 222 break;
210 223 }
211 224 }
212 225
213 226 rtems_task wfrm_task(rtems_task_argument argument) //used with the waveform picker VHDL IP
214 227 {
228 /** This RTEMS task is dedicated to the transmission of snapshots of the NORMAL mode.
229 *
230 * @param unused is the starting argument of the RTEMS task
231 *
232 * The following data packets are sent by this task:
233 * - TM_LFR_SCIENCE_NORMAL_SWF_F0
234 * - TM_LFR_SCIENCE_NORMAL_SWF_F1
235 * - TM_LFR_SCIENCE_NORMAL_SWF_F2
236 *
237 */
238
215 239 rtems_event_set event_out;
216 240 rtems_id queue_id;
217 241 rtems_status_code status;
218 242
219 243 init_header_snapshot_wf_table( SID_NORM_SWF_F0, headerSWF_F0 );
220 244 init_header_snapshot_wf_table( SID_NORM_SWF_F1, headerSWF_F1 );
221 245 init_header_snapshot_wf_table( SID_NORM_SWF_F2, headerSWF_F2 );
222 246
223 247 init_waveforms();
224 248
225 249 status = rtems_message_queue_ident( misc_name[QUEUE_SEND], 0, &queue_id );
226 250 if (status != RTEMS_SUCCESSFUL)
227 251 {
228 252 PRINTF1("in WFRM *** ERR getting queue id, %d\n", status)
229 253 }
230 254
231 255 BOOT_PRINTF("in WFRM ***\n")
232 256
233 257 while(1){
234 258 // wait for an RTEMS_EVENT
235 259 rtems_event_receive(RTEMS_EVENT_MODE_NORMAL | RTEMS_EVENT_MODE_SBM1
236 260 | RTEMS_EVENT_MODE_SBM2 | RTEMS_EVENT_MODE_SBM2_WFRM,
237 261 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
238 262
239 263 if (event_out == RTEMS_EVENT_MODE_NORMAL)
240 264 {
241 265 send_waveform_SWF(wf_snap_f0, SID_NORM_SWF_F0, headerSWF_F0, queue_id);
242 266 send_waveform_SWF(wf_snap_f1, SID_NORM_SWF_F1, headerSWF_F1, queue_id);
243 267 send_waveform_SWF(wf_snap_f2, SID_NORM_SWF_F2, headerSWF_F2, queue_id);
244 268 #ifdef GSA
245 269 waveform_picker_regs->status = waveform_picker_regs->status & 0xf888; // [1111 1000 1000 1000] f2, f1, f0 bits =0
246 270 #endif
247 271 }
248 272 else if (event_out == RTEMS_EVENT_MODE_SBM1)
249 273 {
250 274 send_waveform_SWF(wf_snap_f0, SID_NORM_SWF_F0, headerSWF_F0, queue_id);
251 275 send_waveform_SWF(wf_snap_f1_norm, SID_NORM_SWF_F1, headerSWF_F1, queue_id);
252 276 send_waveform_SWF(wf_snap_f2, SID_NORM_SWF_F2, headerSWF_F2, queue_id);
253 277 #ifdef GSA
254 278 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffaaa; // [1111 1010 1010 1010] f2, f0 bits = 0
255 279 #endif
256 280 }
257 281 else if (event_out == RTEMS_EVENT_MODE_SBM2)
258 282 {
259 283 send_waveform_SWF(wf_snap_f0, SID_NORM_SWF_F0, headerSWF_F0, queue_id);
260 284 send_waveform_SWF(wf_snap_f1, SID_NORM_SWF_F1, headerSWF_F1, queue_id);
261 285 #ifdef GSA
262 286 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffccc; // [1111 1100 1100 1100] f1, f0 bits = 0
263 287 #endif
264 288 }
265 289 else if (event_out == RTEMS_EVENT_MODE_SBM2_WFRM)
266 290 {
267 291 send_waveform_SWF(wf_snap_f2_norm, SID_NORM_SWF_F2, headerSWF_F2, queue_id);
268 292 }
269 293 else
270 294 {
271 295 PRINTF("in WFRM *** unexpected event")
272 296 }
273 297
274 298
275 299 #ifdef GSA
276 300 // irq processed, reset the related register of the timer unit
277 301 gptimer_regs->timer[TIMER_WF_SIMULATOR].ctrl = gptimer_regs->timer[TIMER_WF_SIMULATOR].ctrl | 0x00000010;
278 302 // clear the interruption
279 303 LEON_Unmask_interrupt( IRQ_WF );
280 304 #endif
281 305 }
282 306 }
283 307
284 308 rtems_task cwf3_task(rtems_task_argument argument) //used with the waveform picker VHDL IP
285 309 {
310 /** This RTEMS task is dedicated to the transmission of continuous waveforms at f3.
311 *
312 * @param unused is the starting argument of the RTEMS task
313 *
314 * The following data packet is sent by this task:
315 * - TM_LFR_SCIENCE_NORMAL_CWF_F3
316 *
317 */
318
286 319 rtems_event_set event_out;
287 320 rtems_id queue_id;
288 321
289 322 init_header_continuous_wf_table( SID_NORM_CWF_F3, headerCWF_F3 );
290 323 init_header_continuous_wf3_light_table( headerCWF_F3_light );
291 324
292 325 queue_id = get_pkts_queue_id();
293 326
294 327 BOOT_PRINTF("in CWF3 ***\n")
295 328
296 329 while(1){
297 330 // wait for an RTEMS_EVENT
298 331 rtems_event_receive( RTEMS_EVENT_0,
299 332 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
300 333 PRINTF("send CWF F3 \n")
301 334 #ifdef GSA
302 335 #else
303 336 if (waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3) {
304 337 send_waveform_CWF3_light( wf_cont_f3_bis, headerCWF_F3_light, queue_id );
305 338 }
306 339 else {
307 340 send_waveform_CWF3_light( wf_cont_f3, headerCWF_F3_light, queue_id );
308 341 }
309 342 #endif
310 343 }
311 344 }
312 345
313 346 rtems_task cwf2_task(rtems_task_argument argument) // ONLY USED IN BURST AND SBM2
314 347 {
348 /** This RTEMS task is dedicated to the transmission of continuous waveforms at f2.
349 *
350 * @param unused is the starting argument of the RTEMS task
351 *
352 * The following data packet is sent by this function:
353 * - TM_LFR_SCIENCE_BURST_CWF_F2
354 * - TM_LFR_SCIENCE_SBM2_CWF_F2
355 *
356 */
357
315 358 rtems_event_set event_out;
316 359 rtems_id queue_id;
317 360
318 361 init_header_continuous_wf_table( SID_BURST_CWF_F2, headerCWF_F2_BURST );
319 362 init_header_continuous_wf_table( SID_SBM2_CWF_F2, headerCWF_F2_SBM2 );
320 363
321 364 queue_id = get_pkts_queue_id();
322 365
323 366 BOOT_PRINTF("in CWF2 ***\n")
324 367
325 368 while(1){
326 369 // wait for an RTEMS_EVENT
327 370 rtems_event_receive( RTEMS_EVENT_MODE_BURST | RTEMS_EVENT_MODE_SBM2,
328 371 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
329 372
330 373 if (event_out == RTEMS_EVENT_MODE_BURST)
331 374 {
332 375 // F2
333 376 #ifdef GSA
334 377 #else
335 378 if (waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2) {
336 379 send_waveform_CWF( wf_snap_f2_bis, SID_BURST_CWF_F2, headerCWF_F2_BURST, queue_id );
337 380 }
338 381 else {
339 382 send_waveform_CWF( wf_snap_f2, SID_BURST_CWF_F2, headerCWF_F2_BURST, queue_id );
340 383 }
341 384 #endif
342 385 }
343 386
344 387 else if (event_out == RTEMS_EVENT_MODE_SBM2)
345 388 {
346 389 #ifdef GSA
347 390 #else
348 391 if (doubleSendCWF2 == 1)
349 392 {
350 393 doubleSendCWF2 = 0;
351 394 send_waveform_CWF( wf_snap_f2_norm, SID_SBM2_CWF_F2, headerCWF_F2_SBM2, queue_id );
352 395 }
353 396 else if (waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2) {
354 397 send_waveform_CWF( wf_snap_f2_bis, SID_SBM2_CWF_F2, headerCWF_F2_SBM2, queue_id );
355 398 }
356 399 else {
357 400 send_waveform_CWF( wf_snap_f2, SID_SBM2_CWF_F2, headerCWF_F2_SBM2, queue_id );
358 401 }
359 402 param_local.local_sbm2_nb_cwf_sent ++;
360 403 #endif
361 404 }
362 405 else
363 406 {
364 407 PRINTF1("in CWF2 *** ERR mode = %d\n", lfrCurrentMode)
365 408 }
366 409 }
367 410 }
368 411
369 412 rtems_task cwf1_task(rtems_task_argument argument) // ONLY USED IN SBM1
370 413 {
414 /** This RTEMS task is dedicated to the transmission of continuous waveforms at f1.
415 *
416 * @param unused is the starting argument of the RTEMS task
417 *
418 * The following data packet is sent by this function:
419 * - TM_LFR_SCIENCE_SBM1_CWF_F1
420 *
421 */
422
371 423 rtems_event_set event_out;
372 424 rtems_id queue_id;
373 425
374 426 init_header_continuous_wf_table( SID_SBM1_CWF_F1, headerCWF_F1 );
375 427
376 428 queue_id = get_pkts_queue_id();
377 429
378 430 BOOT_PRINTF("in CWF1 ***\n")
379 431
380 432 while(1){
381 433 // wait for an RTEMS_EVENT
382 434 rtems_event_receive( RTEMS_EVENT_MODE_SBM1,
383 435 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
384 436 if (event_out == RTEMS_EVENT_MODE_SBM1)
385 437 {
386 438 #ifdef GSA
387 439 #else
388 440 if (doubleSendCWF1 == 1)
389 441 {
390 442 doubleSendCWF1 = 0;
391 443 send_waveform_CWF( wf_snap_f1_norm, SID_SBM1_CWF_F1, headerCWF_F1, queue_id );
392 444 }
393 445 else if (waveform_picker_regs->addr_data_f1 == (int) wf_snap_f1) {
394 446 send_waveform_CWF( wf_snap_f1_bis, SID_SBM1_CWF_F1, headerCWF_F1, queue_id );
395 447 }
396 448 else {
397 449 send_waveform_CWF( wf_snap_f1, SID_SBM1_CWF_F1, headerCWF_F1, queue_id );
398 450 }
399 451 param_local.local_sbm1_nb_cwf_sent ++;
400 452 #endif
401 453 }
402 454 else
403 455 {
404 456 PRINTF1("in CWF1 *** ERR mode = %d\n", lfrCurrentMode)
405 457 }
406 458 }
407 459 }
408 460
409 461 //******************
410 462 // general functions
411 463 void init_waveforms( void )
412 464 {
413 465 int i = 0;
414 466
415 467 for (i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++)
416 468 {
417 469 //***
418 470 // F0
419 471 wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x88887777; //
420 472 wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111; //
421 473 wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0x44443333; //
422 474
423 475 //***
424 476 // F1
425 477 wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x22221111;
426 478 wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x44443333;
427 479 wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000;
428 480
429 481 //***
430 482 // F2
431 483 wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x44443333;
432 484 wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111;
433 485 wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000;
434 486
435 487 //***
436 488 // F3
437 489 //wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 0 ] = val1;
438 490 //wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 1 ] = val2;
439 491 //wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 2 ] = 0xaaaa0000;
440 492 }
441 493 }
442 494
443 495 int init_header_snapshot_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF)
444 496 {
445 497 unsigned char i;
446 498
447 499 for (i=0; i<7; i++)
448 500 {
449 501 headerSWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID;
450 502 headerSWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID;
451 503 headerSWF[ i ].reserved = DEFAULT_RESERVED;
452 504 headerSWF[ i ].userApplication = CCSDS_USER_APP;
453 505 headerSWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8);
454 506 headerSWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST);
455 507 if (i == 0)
456 508 {
457 509 headerSWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_FIRST;
458 510 headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_340 >> 8);
459 511 headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_340 );
460 512 headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8);
461 513 headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 );
462 514 }
463 515 else if (i == 6)
464 516 {
465 517 headerSWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_LAST;
466 518 headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_8 >> 8);
467 519 headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_8 );
468 520 headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_8 >> 8);
469 521 headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_8 );
470 522 }
471 523 else
472 524 {
473 525 headerSWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_CONTINUATION;
474 526 headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_340 >> 8);
475 527 headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_340 );
476 528 headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8);
477 529 headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 );
478 530 }
479 531 headerSWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
480 532 headerSWF[ i ].pktCnt = DEFAULT_PKTCNT; // PKT_CNT
481 533 headerSWF[ i ].pktNr = i+1; // PKT_NR
482 534 // DATA FIELD HEADER
483 535 headerSWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
484 536 headerSWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type
485 537 headerSWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
486 538 headerSWF[ i ].destinationID = TM_DESTINATION_ID_GROUND;
487 539 // AUXILIARY DATA HEADER
488 540 headerSWF[ i ].sid = sid;
489 541 headerSWF[ i ].hkBIA = DEFAULT_HKBIA;
490 542 headerSWF[ i ].time[0] = 0x00;
491 543 headerSWF[ i ].time[0] = 0x00;
492 544 headerSWF[ i ].time[0] = 0x00;
493 545 headerSWF[ i ].time[0] = 0x00;
494 546 headerSWF[ i ].time[0] = 0x00;
495 547 headerSWF[ i ].time[0] = 0x00;
496 548 }
497 549 return LFR_SUCCESSFUL;
498 550 }
499 551
500 552 int init_header_continuous_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF )
501 553 {
502 554 unsigned int i;
503 555
504 556 for (i=0; i<7; i++)
505 557 {
506 558 headerCWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID;
507 559 headerCWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID;
508 560 headerCWF[ i ].reserved = DEFAULT_RESERVED;
509 561 headerCWF[ i ].userApplication = CCSDS_USER_APP;
510 562 if ( (sid == SID_SBM1_CWF_F1) || (sid == SID_SBM2_CWF_F2) )
511 563 {
512 564 headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_SBM1_SBM2 >> 8);
513 565 headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_SBM1_SBM2);
514 566 }
515 567 else
516 568 {
517 569 headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8);
518 570 headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST);
519 571 }
520 572 if (i == 0)
521 573 {
522 574 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_FIRST;
523 575 headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_340 >> 8);
524 576 headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_340 );
525 577 headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8);
526 578 headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 );
527 579 }
528 580 else if (i == 6)
529 581 {
530 582 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_LAST;
531 583 headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_8 >> 8);
532 584 headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_8 );
533 585 headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_8 >> 8);
534 586 headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_8 );
535 587 }
536 588 else
537 589 {
538 590 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_CONTINUATION;
539 591 headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_340 >> 8);
540 592 headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_340 );
541 593 headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8);
542 594 headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 );
543 595 }
544 596 headerCWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
545 597 // PKT_CNT
546 598 // PKT_NR
547 599 // DATA FIELD HEADER
548 600 headerCWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
549 601 headerCWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type
550 602 headerCWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
551 603 headerCWF[ i ].destinationID = TM_DESTINATION_ID_GROUND;
552 604 // AUXILIARY DATA HEADER
553 605 headerCWF[ i ].sid = sid;
554 606 headerCWF[ i ].hkBIA = DEFAULT_HKBIA;
555 607 headerCWF[ i ].time[0] = 0x00;
556 608 headerCWF[ i ].time[0] = 0x00;
557 609 headerCWF[ i ].time[0] = 0x00;
558 610 headerCWF[ i ].time[0] = 0x00;
559 611 headerCWF[ i ].time[0] = 0x00;
560 612 headerCWF[ i ].time[0] = 0x00;
561 613 }
562 614 return LFR_SUCCESSFUL;
563 615 }
564 616
565 617 int init_header_continuous_wf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF )
566 618 {
567 619 unsigned int i;
568 620
569 621 for (i=0; i<7; i++)
570 622 {
571 623 headerCWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID;
572 624 headerCWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID;
573 625 headerCWF[ i ].reserved = DEFAULT_RESERVED;
574 626 headerCWF[ i ].userApplication = CCSDS_USER_APP;
575 627
576 628 headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8);
577 629 headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST);
578 630 if (i == 0)
579 631 {
580 632 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_FIRST;
581 633 headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_340 >> 8);
582 634 headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_340 );
583 635 headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8);
584 636 headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 );
585 637 }
586 638 else if (i == 6)
587 639 {
588 640 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_LAST;
589 641 headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_8 >> 8);
590 642 headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_8 );
591 643 headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_8 >> 8);
592 644 headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_8 );
593 645 }
594 646 else
595 647 {
596 648 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_CONTINUATION;
597 649 headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_340 >> 8);
598 650 headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_340 );
599 651 headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8);
600 652 headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 );
601 653 }
602 654 headerCWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
603 655 // DATA FIELD HEADER
604 656 headerCWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
605 657 headerCWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type
606 658 headerCWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
607 659 headerCWF[ i ].destinationID = TM_DESTINATION_ID_GROUND;
608 660 // AUXILIARY DATA HEADER
609 661 headerCWF[ i ].sid = SID_NORM_CWF_F3;
610 662 headerCWF[ i ].hkBIA = DEFAULT_HKBIA;
611 663 headerCWF[ i ].time[0] = 0x00;
612 664 headerCWF[ i ].time[0] = 0x00;
613 665 headerCWF[ i ].time[0] = 0x00;
614 666 headerCWF[ i ].time[0] = 0x00;
615 667 headerCWF[ i ].time[0] = 0x00;
616 668 headerCWF[ i ].time[0] = 0x00;
617 669 }
618 670 return LFR_SUCCESSFUL;
619 671 }
620 672
621 673 void reset_waveforms( void )
622 674 {
623 675 int i = 0;
624 676
625 677 for (i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++)
626 678 {
627 679 wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET] = 0x10002000;
628 680 wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET] = 0x20001000;
629 681 wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET] = 0x40008000;
630 682
631 683 //***
632 684 // F1
633 685 wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET] = 0x1000f000;
634 686 wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET] = 0xf0001000;
635 687 wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET] = 0x40008000;
636 688
637 689 //***
638 690 // F2
639 691 wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET] = 0x40008000;
640 692 wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET] = 0x20001000;
641 693 wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET] = 0x10002000;
642 694
643 695 //***
644 696 // F3
645 697 /*wf_cont_f3[ i* NB_WORDS_SWF_BLK + 0 ] = build_value( i, i ); // v and 1
646 698 wf_cont_f3[ i* NB_WORDS_SWF_BLK + 1 ] = build_value( i, i ); // e2 and b1
647 699 wf_cont_f3[ i* NB_WORDS_SWF_BLK + 2 ] = build_value( i, i ); // b2 and b3*/
648 700 }
649 701 }
650 702
651 703 int send_waveform_SWF( volatile int *waveform, unsigned int sid,
652 704 Header_TM_LFR_SCIENCE_SWF_t *headerSWF, rtems_id queue_id )
653 705 {
654 706 /** This function sends SWF CCSDS packets (F2, F1 or F0).
655 707 *
656 708 * @param waveform points to the buffer containing the data that will be send.
657 709 * @param sid is the source identifier of the data that will be sent.
658 710 * @param headerSWF points to a table of headers that have been prepared for the data transmission.
659 711 * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures
660 712 * contain information to setup the transmission of the data packets.
661 713 *
662 714 * One group of 2048 samples is sent as 7 consecutive packets, 6 packets containing 340 blocks and 8 packets containing 8 blocks.
663 715 *
664 716 */
665 717
666 718 unsigned int i;
667 719 int ret;
668 720 rtems_status_code status;
669 721 spw_ioctl_pkt_send spw_ioctl_send_SWF;
670 722
671 723 spw_ioctl_send_SWF.hlen = TM_HEADER_LEN + 4 + 12; // + 4 is for the protocole extra header, + 12 is for the auxiliary header
672 724 spw_ioctl_send_SWF.options = 0;
673 725
674 726 ret = LFR_DEFAULT;
675 727
676 728 for (i=0; i<7; i++) // send waveform
677 729 {
678 730 spw_ioctl_send_SWF.data = (char*) &waveform[ (i * 340 * NB_WORDS_SWF_BLK) ];
679 731 spw_ioctl_send_SWF.hdr = (char*) &headerSWF[ i ];
680 732 // BUILD THE DATA
681 733 if (i==6) {
682 734 spw_ioctl_send_SWF.dlen = 8 * NB_BYTES_SWF_BLK;
683 735 }
684 736 else {
685 737 spw_ioctl_send_SWF.dlen = 340 * NB_BYTES_SWF_BLK;
686 738 }
687 739 // SET PACKET TIME
688 740 headerSWF[ i ].time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
689 741 headerSWF[ i ].time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
690 742 headerSWF[ i ].time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
691 743 headerSWF[ i ].time[3] = (unsigned char) (time_management_regs->coarse_time);
692 744 headerSWF[ i ].time[4] = (unsigned char) (time_management_regs->fine_time>>8);
693 745 headerSWF[ i ].time[5] = (unsigned char) (time_management_regs->fine_time);
694 746 headerSWF[ i ].acquisitionTime[0] = (unsigned char) (time_management_regs->coarse_time>>24);
695 747 headerSWF[ i ].acquisitionTime[1] = (unsigned char) (time_management_regs->coarse_time>>16);
696 748 headerSWF[ i ].acquisitionTime[2] = (unsigned char) (time_management_regs->coarse_time>>8);
697 749 headerSWF[ i ].acquisitionTime[3] = (unsigned char) (time_management_regs->coarse_time);
698 750 headerSWF[ i ].acquisitionTime[4] = (unsigned char) (time_management_regs->fine_time>>8);
699 751 headerSWF[ i ].acquisitionTime[5] = (unsigned char) (time_management_regs->fine_time);
700 752 // SEND PACKET
701 753 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_SWF, ACTION_MSG_SPW_IOCTL_SEND_SIZE);
702 754 if (status != RTEMS_SUCCESSFUL) {
703 755 printf("%d-%d, ERR %d\n", sid, i, (int) status);
704 756 ret = LFR_DEFAULT;
705 757 }
706 758 rtems_task_wake_after(TIME_BETWEEN_TWO_SWF_PACKETS); // 300 ms between each packet => 7 * 3 = 21 packets => 6.3 seconds
707 759 }
708 760
709 761 return ret;
710 762 }
711 763
712 764 int send_waveform_CWF(volatile int *waveform, unsigned int sid,
713 765 Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id)
714 766 {
715 767 /** This function sends CWF CCSDS packets (F2, F1 or F0).
716 768 *
717 769 * @param waveform points to the buffer containing the data that will be send.
718 770 * @param sid is the source identifier of the data that will be sent.
719 771 * @param headerCWF points to a table of headers that have been prepared for the data transmission.
720 772 * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures
721 773 * contain information to setup the transmission of the data packets.
722 774 *
723 775 * One group of 2048 samples is sent as 7 consecutive packets, 6 packets containing 340 blocks and 8 packets containing 8 blocks.
724 776 *
725 777 */
726 778
727 779 unsigned int i;
728 780 int ret;
729 781 rtems_status_code status;
730 782 spw_ioctl_pkt_send spw_ioctl_send_CWF;
731 783
732 784 spw_ioctl_send_CWF.hlen = TM_HEADER_LEN + 4 + 10; // + 4 is for the protocole extra header, + 10 is for the auxiliary header
733 785 spw_ioctl_send_CWF.options = 0;
734 786
735 787 ret = LFR_DEFAULT;
736 788
737 789 for (i=0; i<7; i++) // send waveform
738 790 {
739 791 int coarseTime = 0x00;
740 792 int fineTime = 0x00;
741 793 spw_ioctl_send_CWF.data = (char*) &waveform[ (i * 340 * NB_WORDS_SWF_BLK) ];
742 794 spw_ioctl_send_CWF.hdr = (char*) &headerCWF[ i ];
743 795 // BUILD THE DATA
744 796 if (i==6) {
745 797 spw_ioctl_send_CWF.dlen = 8 * NB_BYTES_SWF_BLK;
746 798 }
747 799 else {
748 800 spw_ioctl_send_CWF.dlen = 340 * NB_BYTES_SWF_BLK;
749 801 }
750 802 // SET PACKET TIME
751 803 coarseTime = time_management_regs->coarse_time;
752 804 fineTime = time_management_regs->fine_time;
753 805 headerCWF[ i ].time[0] = (unsigned char) (coarseTime>>24);
754 806 headerCWF[ i ].time[1] = (unsigned char) (coarseTime>>16);
755 807 headerCWF[ i ].time[2] = (unsigned char) (coarseTime>>8);
756 808 headerCWF[ i ].time[3] = (unsigned char) (coarseTime);
757 809 headerCWF[ i ].time[4] = (unsigned char) (fineTime>>8);
758 810 headerCWF[ i ].time[5] = (unsigned char) (fineTime);
759 811 headerCWF[ i ].acquisitionTime[0] = (unsigned char) (coarseTime>>24);
760 812 headerCWF[ i ].acquisitionTime[1] = (unsigned char) (coarseTime>>16);
761 813 headerCWF[ i ].acquisitionTime[2] = (unsigned char) (coarseTime>>8);
762 814 headerCWF[ i ].acquisitionTime[3] = (unsigned char) (coarseTime);
763 815 headerCWF[ i ].acquisitionTime[4] = (unsigned char) (fineTime>>8);
764 816 headerCWF[ i ].acquisitionTime[5] = (unsigned char) (fineTime);
765 817 // SEND PACKET
766 818 if (sid == SID_NORM_CWF_F3)
767 819 {
768 820 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF));
769 821 if (status != RTEMS_SUCCESSFUL) {
770 822 printf("%d-%d, ERR %d\n", sid, i, (int) status);
771 823 ret = LFR_DEFAULT;
772 824 }
773 825 rtems_task_wake_after(TIME_BETWEEN_TWO_CWF3_PACKETS);
774 826 }
775 827 else
776 828 {
777 829 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF));
778 830 if (status != RTEMS_SUCCESSFUL) {
779 831 printf("%d-%d, ERR %d\n", sid, i, (int) status);
780 832 ret = LFR_DEFAULT;
781 833 }
782 834 }
783 835 }
784 836
785 837 return ret;
786 838 }
787 839
788 840 int send_waveform_CWF3_light(volatile int *waveform, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id)
789 841 {
790 842 /** This function sends CWF_F3 CCSDS packets without the b1, b2 and b3 data.
791 843 *
792 844 * @param waveform points to the buffer containing the data that will be send.
793 845 * @param headerCWF points to a table of headers that have been prepared for the data transmission.
794 846 * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures
795 847 * contain information to setup the transmission of the data packets.
796 848 *
797 849 * By default, CWF_F3 packet are send without the b1, b2 and b3 data. This function rebuilds a data buffer
798 850 * from the incoming data and sends it in 7 packets, 6 containing 340 blocks and 1 one containing 8 blocks.
799 851 *
800 852 */
801 853
802 854 unsigned int i;
803 855 int ret;
804 856 rtems_status_code status;
805 857 spw_ioctl_pkt_send spw_ioctl_send_CWF;
806 858 char *sample;
807 859
808 860 spw_ioctl_send_CWF.hlen = TM_HEADER_LEN + 4 + 10; // + 4 is for the protocole extra header, + 10 is for the auxiliary header
809 861 spw_ioctl_send_CWF.options = 0;
810 862
811 863 ret = LFR_DEFAULT;
812 864
813 865 //**********************
814 866 // BUILD CWF3_light DATA
815 867 for ( i=0; i< 2048; i++)
816 868 {
817 869 sample = (char*) &waveform[ i * NB_WORDS_SWF_BLK ];
818 870 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) ] = sample[ 0 ];
819 871 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 1 ] = sample[ 1 ];
820 872 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 2 ] = sample[ 2 ];
821 873 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 3 ] = sample[ 3 ];
822 874 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 4 ] = sample[ 4 ];
823 875 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 5 ] = sample[ 5 ];
824 876 }
825 877
826 878 //*********************
827 879 // SEND CWF3_light DATA
828 880
829 881 for (i=0; i<7; i++) // send waveform
830 882 {
831 883 int coarseTime = 0x00;
832 884 int fineTime = 0x00;
833 885 spw_ioctl_send_CWF.data = (char*) &wf_cont_f3_light[ (i * 340 * NB_BYTES_CWF3_LIGHT_BLK) ];
834 886 spw_ioctl_send_CWF.hdr = (char*) &headerCWF[ i ];
835 887 // BUILD THE DATA
836 888 if ( i == WFRM_INDEX_OF_LAST_PACKET ) {
837 889 spw_ioctl_send_CWF.dlen = 8 * NB_BYTES_CWF3_LIGHT_BLK;
838 890 }
839 891 else {
840 892 spw_ioctl_send_CWF.dlen = 340 * NB_BYTES_CWF3_LIGHT_BLK;
841 893 }
842 894 // SET PACKET TIME
843 895 coarseTime = time_management_regs->coarse_time;
844 896 fineTime = time_management_regs->fine_time;
845 897 headerCWF[ i ].time[0] = (unsigned char) (coarseTime>>24);
846 898 headerCWF[ i ].time[1] = (unsigned char) (coarseTime>>16);
847 899 headerCWF[ i ].time[2] = (unsigned char) (coarseTime>>8);
848 900 headerCWF[ i ].time[3] = (unsigned char) (coarseTime);
849 901 headerCWF[ i ].time[4] = (unsigned char) (fineTime>>8);
850 902 headerCWF[ i ].time[5] = (unsigned char) (fineTime);
851 903 headerCWF[ i ].acquisitionTime[0] = (unsigned char) (coarseTime>>24);
852 904 headerCWF[ i ].acquisitionTime[1] = (unsigned char) (coarseTime>>16);
853 905 headerCWF[ i ].acquisitionTime[2] = (unsigned char) (coarseTime>>8);
854 906 headerCWF[ i ].acquisitionTime[3] = (unsigned char) (coarseTime);
855 907 headerCWF[ i ].acquisitionTime[4] = (unsigned char) (fineTime>>8);
856 908 headerCWF[ i ].acquisitionTime[5] = (unsigned char) (fineTime);
857 909 // SEND PACKET
858 910 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF));
859 911 if (status != RTEMS_SUCCESSFUL) {
860 912 printf("%d-%d, ERR %d\n", SID_NORM_CWF_F3, i, (int) status);
861 913 ret = LFR_DEFAULT;
862 914 }
863 915 rtems_task_wake_after(TIME_BETWEEN_TWO_CWF3_PACKETS);
864 916 }
865 917
866 918 return ret;
867 919 }
868 920
869 921
870 922 //**************
871 923 // wfp registers
872 924 void set_wfp_data_shaping()
873 925 {
874 926 /** This function sets the data_shaping register of the waveform picker module.
875 927 *
876 928 * The value is read from one field of the parameter_dump_packet structure:\n
877 929 * bw_sp0_sp1_r0_r1
878 930 *
879 931 */
880 932
881 933 unsigned char data_shaping;
882 934
883 935 // get the parameters for the data shaping [BW SP0 SP1 R0 R1] in sy_lfr_common1 and configure the register
884 936 // waveform picker : [R1 R0 SP1 SP0 BW]
885 937
886 938 data_shaping = parameter_dump_packet.bw_sp0_sp1_r0_r1;
887 939
888 940 #ifdef GSA
889 941 #else
890 942 waveform_picker_regs->data_shaping =
891 943 ( (data_shaping & 0x10) >> 4 ) // BW
892 944 + ( (data_shaping & 0x08) >> 2 ) // SP0
893 945 + ( (data_shaping & 0x04) ) // SP1
894 946 + ( (data_shaping & 0x02) << 2 ) // R0
895 947 + ( (data_shaping & 0x01) << 4 ); // R1
896 948 #endif
897 949 }
898 950
899 951 char set_wfp_delta_snapshot()
900 952 {
901 953 /** This function sets the delta_snapshot register of the waveform picker module.
902 954 *
903 * The value is read from two (unsigned char) of the parameter_dump_packet structure:\n
904 * sy_lfr_n_swf_p[0] \n
905 * sy_lfr_n_swf_p[1]
955 * The value is read from two (unsigned char) of the parameter_dump_packet structure:
956 * - sy_lfr_n_swf_p[0]
957 * - sy_lfr_n_swf_p[1]
906 958 *
907 959 */
908 960
909 961 char ret;
910 962 unsigned int delta_snapshot;
911 963 unsigned int aux;
912 964
913 965 aux = 0;
914 966 ret = LFR_DEFAULT;
915 967
916 968 delta_snapshot = parameter_dump_packet.sy_lfr_n_swf_p[0]*256
917 969 + parameter_dump_packet.sy_lfr_n_swf_p[1];
918 970
919 971 #ifdef GSA
920 972 #else
921 973 if ( delta_snapshot < MIN_DELTA_SNAPSHOT )
922 974 {
923 975 aux = MIN_DELTA_SNAPSHOT;
924 976 ret = LFR_DEFAULT;
925 977 }
926 978 else
927 979 {
928 980 aux = delta_snapshot ;
929 981 ret = LFR_SUCCESSFUL;
930 982 }
931 waveform_picker_regs->delta_snapshot = aux; // max 2 bytes
983 waveform_picker_regs->delta_snapshot = aux - 1; // max 2 bytes
932 984 #endif
933 985
934 986 return ret;
935 987 }
936 988
937 989 void set_wfp_burst_enable_register( unsigned char mode)
938 990 {
939 991 /** This function sets the waveform picker burst_enable register depending on the mode.
940 992 *
941 993 * @param mode is the LFR mode to launch.
942 994 *
943 995 * The burst bits shall be before the enable bits.
944 996 *
945 997 */
946 998
947 999 #ifdef GSA
948 1000 #else
949 1001 // [0000 0000] burst f2, f1, f0 enable f3 f2 f1 f0
950 1002 // the burst bits shall be set first, before the enable bits
951 1003 switch(mode) {
952 1004 case(LFR_MODE_NORMAL):
953 1005 waveform_picker_regs->burst_enable = 0x00; // [0000 0000] no burst enable
954 1006 waveform_picker_regs->burst_enable = 0x0f; // [0000 1111] enable f3 f2 f1 f0
955 1007 break;
956 1008 case(LFR_MODE_BURST):
957 1009 waveform_picker_regs->burst_enable = 0x40; // [0100 0000] f2 burst enabled
958 1010 waveform_picker_regs->burst_enable = waveform_picker_regs->burst_enable | 0x04; // [0100] enable f2
959 1011 break;
960 1012 case(LFR_MODE_SBM1):
961 1013 waveform_picker_regs->burst_enable = 0x20; // [0010 0000] f1 burst enabled
962 1014 waveform_picker_regs->burst_enable = waveform_picker_regs->burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0
963 1015 break;
964 1016 case(LFR_MODE_SBM2):
965 1017 waveform_picker_regs->burst_enable = 0x40; // [0100 0000] f2 burst enabled
966 1018 waveform_picker_regs->burst_enable = waveform_picker_regs->burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0
967 1019 break;
968 1020 default:
969 1021 waveform_picker_regs->burst_enable = 0x00; // [0000 0000] no burst enabled, no waveform enabled
970 1022 break;
971 1023 }
972 1024 #endif
973 1025 }
974 1026
975 1027 void reset_wfp_burst_enable()
976 1028 {
977 1029 /** This function resets the waveform picker burst_enable register.
978 1030 *
979 1031 * The burst bits [f2 f1 f0] and the enable bits [f3 f2 f1 f0] are set to 0.
980 1032 *
981 1033 */
982 1034
983 1035 #ifdef GSA
984 1036 #else
985 1037 waveform_picker_regs->burst_enable = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0
986 1038 #endif
987 1039 }
988 1040
989 1041 void reset_wfp_status()
990 1042 {
991 1043 /** This function resets the waveform picker status register.
992 1044 *
993 1045 * All status bits are set to 0 [new_err full_err full].
994 1046 *
995 1047 */
996 1048
997 1049 #ifdef GSA
998 1050 #else
999 1051 waveform_picker_regs->status = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0
1000 1052 #endif
1001 1053 }
1002 1054
1003 1055 void reset_waveform_picker_regs()
1004 1056 {
1005 1057 /** This function resets the waveform picker module registers.
1006 1058 *
1007 1059 * The registers affected by this function are located at the following offset addresses:
1008 1060 * - 0x00 data_shaping
1009 1061 * - 0x04 burst_enable
1010 1062 * - 0x08 addr_data_f0
1011 1063 * - 0x0C addr_data_f1
1012 1064 * - 0x10 addr_data_f2
1013 1065 * - 0x14 addr_data_f3
1014 1066 * - 0x18 status
1015 1067 * - 0x1C delta_snapshot
1016 1068 * - 0x20 delta_f2_f1
1017 1069 * - 0x24 delta_f2_f0
1018 1070 * - 0x28 nb_burst
1019 1071 * - 0x2C nb_snapshot
1020 1072 *
1021 1073 */
1022 1074
1023 1075 #ifdef GSA
1024 1076 #else
1025 1077 set_wfp_data_shaping();
1026 1078 reset_wfp_burst_enable();
1027 1079 waveform_picker_regs->addr_data_f0 = (int) (wf_snap_f0); //
1028 1080 waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1); //
1029 1081 waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2); //
1030 1082 waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3); //
1031 1083 set_wfp_delta_snapshot(); // time in seconds between two snapshots
1032 1084 waveform_picker_regs->delta_f2_f1 = 0xffff; // 0x16800 => 92160 (max 4 bytes)
1033 1085 waveform_picker_regs->delta_f2_f0 = 0x17c00; // 97 280 (max 5 bytes)
1034 1086 waveform_picker_regs->nb_burst_available = 0x180; // max 3 bytes, size of the buffer in burst (1 burst = 16 x 4 octets)
1035 1087 waveform_picker_regs->nb_snapshot_param = 0x7ff; // max 3 octets, 2048 - 1
1036 1088 waveform_picker_regs->status = 0x00; //
1037 1089 #endif
1038 1090 }
1039 1091
1040 1092 //*****************
1041 1093 // local parameters
1042 1094 void set_local_sbm1_nb_cwf_max()
1043 1095 {
1044 1096 /** This function sets the value of the sbm1_nb_cwf_max local parameter.
1045 1097 *
1046 1098 * The sbm1_nb_cwf_max parameter counts the number of CWF_F1 records that have been sent.\n
1047 1099 * This parameter is used to send CWF_F1 data as normal data when the SBM1 is active.\n\n
1048 1100 * (2 snapshots of 2048 points per seconds) * (period of the NORM snashots) - 8 s (duration of the f2 snapshot)
1049 1101 *
1050 1102 */
1051 1103 param_local.local_sbm1_nb_cwf_max = 2 *
1052 1104 (parameter_dump_packet.sy_lfr_n_swf_p[0] * 256
1053 1105 + parameter_dump_packet.sy_lfr_n_swf_p[1]) - 8; // 16 CWF1 parts during 1 SWF2
1054 1106 }
1055 1107
1056 1108 void set_local_sbm2_nb_cwf_max()
1057 1109 {
1058 1110 /** This function sets the value of the sbm1_nb_cwf_max local parameter.
1059 1111 *
1060 1112 * The sbm1_nb_cwf_max parameter counts the number of CWF_F1 records that have been sent.\n
1061 1113 * This parameter is used to send CWF_F2 data as normal data when the SBM2 is active.\n\n
1062 1114 * (period of the NORM snashots) / (8 seconds per snapshot at f2 = 256 Hz)
1063 1115 *
1064 1116 */
1065 1117
1066 1118 param_local.local_sbm2_nb_cwf_max = (parameter_dump_packet.sy_lfr_n_swf_p[0] * 256
1067 1119 + parameter_dump_packet.sy_lfr_n_swf_p[1]) / 8;
1068 1120 }
1069 1121
1070 1122 void set_local_nb_interrupt_f0_MAX()
1071 1123 {
1072 1124 /** This function sets the value of the nb_interrupt_f0_MAX local parameter.
1073 1125 *
1074 1126 * This parameter is used for the SM validation only.\n
1075 1127 * The software waits param_local.local_nb_interrupt_f0_MAX interruptions from the spectral matrices
1076 1128 * module before launching a basic processing.
1077 1129 *
1078 1130 */
1079 1131
1080 1132 param_local.local_nb_interrupt_f0_MAX = ( (parameter_dump_packet.sy_lfr_n_asm_p[0]) * 256
1081 1133 + parameter_dump_packet.sy_lfr_n_asm_p[1] ) * 100;
1082 1134 }
1083 1135
1084 1136 void reset_local_sbm1_nb_cwf_sent()
1085 1137 {
1086 1138 /** This function resets the value of the sbm1_nb_cwf_sent local parameter.
1087 1139 *
1088 1140 * The sbm1_nb_cwf_sent parameter counts the number of CWF_F1 records that have been sent.\n
1089 1141 * This parameter is used to send CWF_F1 data as normal data when the SBM1 is active.
1090 1142 *
1091 1143 */
1092 1144
1093 1145 param_local.local_sbm1_nb_cwf_sent = 0;
1094 1146 }
1095 1147
1096 1148 void reset_local_sbm2_nb_cwf_sent()
1097 1149 {
1098 1150 /** This function resets the value of the sbm2_nb_cwf_sent local parameter.
1099 1151 *
1100 1152 * The sbm2_nb_cwf_sent parameter counts the number of CWF_F2 records that have been sent.\n
1101 1153 * This parameter is used to send CWF_F2 data as normal data when the SBM2 mode is active.
1102 1154 *
1103 1155 */
1104 1156
1105 1157 param_local.local_sbm2_nb_cwf_sent = 0;
1106 1158 }
1159
1160 rtems_id get_pkts_queue_id( void )
1161 {
1162 rtems_id queue_id;
1163 rtems_status_code status;
1164
1165 status = rtems_message_queue_ident( misc_name[QUEUE_SEND], 0, &queue_id );
1166 if (status != RTEMS_SUCCESSFUL)
1167 {
1168 PRINTF1("in get_pkts_queue_id *** ERR %d\n", status)
1169 }
1170 return queue_id;
1171 }
General Comments 0
You need to be logged in to leave comments. Login now