##// END OF EJS Templates
timegen-qt project rebuilt
paul -
r167:6c1a4ac855d5 patch rev 2
parent child
Show More
@@ -0,0 +1,9
1 #!/usr/bin/lppmon -e
2
3 proxy.loadSysDriver("AHBUARTplugin","AHBUART");
4 proxy.loadSysDriverToParent("dsu3plugin","AHBUART");
5 proxy.loadSysDriverToParent("APB UART PLUGIN","AHBUART");
6 AHBUART.open("/dev/ttyUSB0",30000000)
7 dsu3plugin0.openFile("/opt/DEV_PLE/FSW-qt/bin/fsw")
8 dsu3plugin0.loadFile()
9 dsu3plugin0.run()
@@ -0,0 +1,13
1 #!/usr/bin/lppmon -e
2
3 proxy.loadSysDriver("RMAPPlugin","RMAPPlugin0");
4 proxy.loadSysDriverToParent("dsu3plugin","RMAPPlugin0");
5
6 BUTTON_selectStarDundee.click()
7 #BUTTON_selectGRESB.click()
8 BUTTON_rmapOpenCommunication.click()
9
10 dsu3plugin0.openFile("/opt/DEV_PLE/FSW-qt/bin/fsw")
11 dsu3plugin0.loadFile()
12 dsu3plugin0.run()
13
@@ -0,0 +1,23
1 #!/usr/bin/lppmon -e
2
3 # LOAD TIMEGEN USING LINK 2
4 RMAPPlugin0.setValueSpaceWireLinkNumber( 2 )
5 RMAPPlugin0.setValueTargetLogicalAddress( 254 )
6
7 dsu3plugin0.openFile("/opt/DEV_PLE/timegen-qt/bin/timegen")
8 dsu3plugin0.loadFile()
9 dsu3plugin0.run()
10
11 # LOAD FSW USING LINK 1
12 RMAPPlugin0.setValueSpaceWireLinkNumber( 1 )
13 RMAPPlugin0.setValueTargetLogicalAddress( 254 )
14
15 dsu3plugin0.openFile("/opt/DEV_PLE/FSW-qt/bin/fsw")
16 dsu3plugin0.loadFile()
17 dsu3plugin0.run()
18
19 # START SENDING TIMECODES AT 1 Hz
20 RMAPPlugin0.sig_sendTimecodePeriodically( 1 )
21
22 # it is possible to change the time code frequency
23 #RMAPPlugin0.changeTimecodeFrequency(2)
@@ -0,0 +1,9
1 #!/usr/bin/lppmon -e
2
3 RMAPPlugin0.setValueSpaceWireLinkNumber( 1 )
4 RMAPPlugin0.setValueTargetLogicalAddress( 254 )
5
6 dsu3plugin0.openFile("/opt/DEV_PLE/FSW-qt/bin/fsw")
7 dsu3plugin0.loadFile()
8 dsu3plugin0.run()
9
@@ -0,0 +1,10
1 #!/usr/bin/lppmon -e
2
3 RMAPPlugin0.setValueSpaceWireLinkNumber( 2 )
4 RMAPPlugin0.setValueTargetLogicalAddress( 254 )
5
6 dsu3plugin0.openFile("/opt/DEV_PLE/timegen-qt/bin/timegen")
7 dsu3plugin0.loadFile()
8 dsu3plugin0.run()
9
10 RMAPPlugin0.setValueSpaceWireLinkNumber( 1 )
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
@@ -0,0 +1,234
1 #############################################################################
2 # Makefile for building: bin/timegen
3 # Generated by qmake (2.01a) (Qt 4.8.6) on: Thu Sep 25 13:22:11 2014
4 # Project: timegen-qt.pro
5 # Template: app
6 # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ CONFIG+=debug -o Makefile timegen-qt.pro
7 #############################################################################
8
9 ####### Compiler, tools and options
10
11 CC = sparc-rtems-gcc
12 CXX = sparc-rtems-g++
13 DEFINES = -DSW_VERSION_N1=0 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=0 -DPRINT_MESSAGES_ON_CONSOLE
14 CFLAGS = -pipe -g -O3 -Wall $(DEFINES)
15 CXXFLAGS = -pipe -O3 -Wall $(DEFINES)
16 INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -Isrc -Iheader -Iheader/processing -Isrc/LFR_basic-parameters
17 LINK = sparc-rtems-g++
18 LFLAGS = -g
19 LIBS = $(SUBLIBS)
20 AR = sparc-rtems-ar rcs
21 RANLIB =
22 QMAKE = /usr/bin/qmake-qt4
23 TAR = tar -cf
24 COMPRESS = gzip -9f
25 COPY = cp -f
26 SED = sed
27 COPY_FILE = $(COPY)
28 COPY_DIR = $(COPY) -r
29 STRIP = sparc-rtems-strip
30 INSTALL_FILE = install -m 644 -p
31 INSTALL_DIR = $(COPY_DIR)
32 INSTALL_PROGRAM = install -m 755 -p
33 DEL_FILE = rm -f
34 SYMLINK = ln -f -s
35 DEL_DIR = rmdir
36 MOVE = mv -f
37 CHK_DIR_EXISTS= test -d
38 MKDIR = mkdir -p
39
40 ####### Output directory
41
42 OBJECTS_DIR = obj/
43
44 ####### Files
45
46 SOURCES = src/tc_handler.c \
47 src/fsw_misc.c \
48 src/fsw_init.c \
49 src/fsw_globals.c \
50 src/fsw_spacewire.c \
51 src/tc_acceptance.c \
52 src/LFR_basic-parameters/basic_parameters.c
53 OBJECTS = obj/tc_handler.o \
54 obj/fsw_misc.o \
55 obj/fsw_init.o \
56 obj/fsw_globals.o \
57 obj/fsw_spacewire.o \
58 obj/tc_acceptance.o \
59 obj/basic_parameters.o
60 DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \
61 /usr/lib64/qt4/mkspecs/common/linux.conf \
62 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
63 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
64 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
65 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
66 /usr/lib64/qt4/mkspecs/qconfig.pri \
67 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \
68 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
69 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
70 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
71 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
72 sparc.pri \
73 /usr/lib64/qt4/mkspecs/features/debug.prf \
74 /usr/lib64/qt4/mkspecs/features/default_post.prf \
75 /usr/lib64/qt4/mkspecs/features/shared.prf \
76 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
77 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
78 /usr/lib64/qt4/mkspecs/features/resources.prf \
79 /usr/lib64/qt4/mkspecs/features/uic.prf \
80 /usr/lib64/qt4/mkspecs/features/yacc.prf \
81 /usr/lib64/qt4/mkspecs/features/lex.prf \
82 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \
83 timegen-qt.pro
84 QMAKE_TARGET = timegen
85 DESTDIR = bin/
86 TARGET = bin/timegen
87
88 first: all
89 ####### Implicit rules
90
91 .SUFFIXES: .o .c .cpp .cc .cxx .C
92
93 .cpp.o:
94 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
95
96 .cc.o:
97 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
98
99 .cxx.o:
100 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
101
102 .C.o:
103 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
104
105 .c.o:
106 $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
107
108 ####### Build rules
109
110 all: Makefile $(TARGET)
111
112 $(TARGET): $(OBJECTS)
113 @$(CHK_DIR_EXISTS) bin/ || $(MKDIR) bin/
114 $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
115 { test -n "$(DESTDIR)" && DESTDIR="$(DESTDIR)" || DESTDIR=.; } && test $$(gdb --version | sed -e 's,[^0-9][^0-9]*\([0-9]\)\.\([0-9]\).*,\1\2,;q') -gt 72 && gdb --nx --batch --quiet -ex 'set confirm off' -ex "save gdb-index $$DESTDIR" -ex quit '$(TARGET)' && test -f $(TARGET).gdb-index && sparc-rtems-objcopy --add-section '.gdb_index=$(TARGET).gdb-index' --set-section-flags '.gdb_index=readonly' '$(TARGET)' '$(TARGET)' && rm -f $(TARGET).gdb-index || true
116
117 Makefile: timegen-qt.pro /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf /usr/lib64/qt4/mkspecs/common/unix.conf \
118 /usr/lib64/qt4/mkspecs/common/linux.conf \
119 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
120 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
121 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
122 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
123 /usr/lib64/qt4/mkspecs/qconfig.pri \
124 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \
125 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
126 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
127 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
128 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
129 sparc.pri \
130 /usr/lib64/qt4/mkspecs/features/debug.prf \
131 /usr/lib64/qt4/mkspecs/features/default_post.prf \
132 /usr/lib64/qt4/mkspecs/features/shared.prf \
133 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
134 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
135 /usr/lib64/qt4/mkspecs/features/resources.prf \
136 /usr/lib64/qt4/mkspecs/features/uic.prf \
137 /usr/lib64/qt4/mkspecs/features/yacc.prf \
138 /usr/lib64/qt4/mkspecs/features/lex.prf \
139 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf
140 $(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ CONFIG+=debug -o Makefile timegen-qt.pro
141 /usr/lib64/qt4/mkspecs/common/unix.conf:
142 /usr/lib64/qt4/mkspecs/common/linux.conf:
143 /usr/lib64/qt4/mkspecs/common/gcc-base.conf:
144 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf:
145 /usr/lib64/qt4/mkspecs/common/g++-base.conf:
146 /usr/lib64/qt4/mkspecs/common/g++-unix.conf:
147 /usr/lib64/qt4/mkspecs/qconfig.pri:
148 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri:
149 /usr/lib64/qt4/mkspecs/features/qt_functions.prf:
150 /usr/lib64/qt4/mkspecs/features/qt_config.prf:
151 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf:
152 /usr/lib64/qt4/mkspecs/features/default_pre.prf:
153 sparc.pri:
154 /usr/lib64/qt4/mkspecs/features/debug.prf:
155 /usr/lib64/qt4/mkspecs/features/default_post.prf:
156 /usr/lib64/qt4/mkspecs/features/shared.prf:
157 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf:
158 /usr/lib64/qt4/mkspecs/features/warn_on.prf:
159 /usr/lib64/qt4/mkspecs/features/resources.prf:
160 /usr/lib64/qt4/mkspecs/features/uic.prf:
161 /usr/lib64/qt4/mkspecs/features/yacc.prf:
162 /usr/lib64/qt4/mkspecs/features/lex.prf:
163 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf:
164 qmake: FORCE
165 @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ CONFIG+=debug -o Makefile timegen-qt.pro
166
167 dist:
168 @$(CHK_DIR_EXISTS) obj/timegen1.0.0 || $(MKDIR) obj/timegen1.0.0
169 $(COPY_FILE) --parents $(SOURCES) $(DIST) obj/timegen1.0.0/ && (cd `dirname obj/timegen1.0.0` && $(TAR) timegen1.0.0.tar timegen1.0.0 && $(COMPRESS) timegen1.0.0.tar) && $(MOVE) `dirname obj/timegen1.0.0`/timegen1.0.0.tar.gz . && $(DEL_FILE) -r obj/timegen1.0.0
170
171
172 clean:compiler_clean
173 -$(DEL_FILE) $(OBJECTS)
174 -$(DEL_FILE) *~ core *.core
175
176
177 ####### Sub-libraries
178
179 distclean: clean
180 -$(DEL_FILE) $(TARGET)
181 -$(DEL_FILE) Makefile
182
183
184 grmon:
185 cd bin && C:/opt/grmon-eval-2.0.29b/win32/bin/grmon.exe -uart COM4 -u
186
187 check: first
188
189 compiler_rcc_make_all:
190 compiler_rcc_clean:
191 compiler_uic_make_all:
192 compiler_uic_clean:
193 compiler_image_collection_make_all: qmake_image_collection.cpp
194 compiler_image_collection_clean:
195 -$(DEL_FILE) qmake_image_collection.cpp
196 compiler_yacc_decl_make_all:
197 compiler_yacc_decl_clean:
198 compiler_yacc_impl_make_all:
199 compiler_yacc_impl_clean:
200 compiler_lex_make_all:
201 compiler_lex_clean:
202 compiler_clean:
203
204 ####### Compile
205
206 obj/tc_handler.o: src/tc_handler.c
207 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_handler.o src/tc_handler.c
208
209 obj/fsw_misc.o: src/fsw_misc.c
210 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_misc.o src/fsw_misc.c
211
212 obj/fsw_init.o: src/fsw_init.c src/fsw_config.c
213 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_init.o src/fsw_init.c
214
215 obj/fsw_globals.o: src/fsw_globals.c
216 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_globals.o src/fsw_globals.c
217
218 obj/fsw_spacewire.o: src/fsw_spacewire.c
219 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_spacewire.o src/fsw_spacewire.c
220
221 obj/tc_acceptance.o: src/tc_acceptance.c
222 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_acceptance.o src/tc_acceptance.c
223
224 obj/basic_parameters.o: src/LFR_basic-parameters/basic_parameters.c
225 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/basic_parameters.o src/LFR_basic-parameters/basic_parameters.c
226
227 ####### Install
228
229 install: FORCE
230
231 uninstall: FORCE
232
233 FORCE:
234
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
1 NO CONTENT: new file 100755, binary diff hidden
NO CONTENT: new file 100755, binary diff hidden
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
@@ -0,0 +1,219
1 #ifndef TC_TYPES_H
2 #define TC_TYPES_H
3
4 #include <ccsds_types.h>
5
6 #define PROTOCOLE_IDENTIFIER 0x02
7
8 // PACKET ID
9 #define TC_LFR_PACKET_ID 0x1ccc // PID 76 CAT 12
10
11 #define PACKET_LENGTH_TC_LFR_RESET (12 - CCSDS_TC_TM_PACKET_OFFSET)
12 #define PACKET_LENGTH_TC_LFR_LOAD_COMMON_PAR (14 - CCSDS_TC_TM_PACKET_OFFSET)
13 #define PACKET_LENGTH_TC_LFR_LOAD_NORMAL_PAR (22 - CCSDS_TC_TM_PACKET_OFFSET)
14 #define PACKET_LENGTH_TC_LFR_LOAD_BURST_PAR (14 - CCSDS_TC_TM_PACKET_OFFSET)
15 #define PACKET_LENGTH_TC_LFR_LOAD_SBM1_PAR (14 - CCSDS_TC_TM_PACKET_OFFSET)
16 #define PACKET_LENGTH_TC_LFR_LOAD_SBM2_PAR (14 - CCSDS_TC_TM_PACKET_OFFSET)
17 #define PACKET_LENGTH_TC_LFR_DUMP_PAR (12 - CCSDS_TC_TM_PACKET_OFFSET)
18 #define PACKET_LENGTH_TC_LFR_ENTER_MODE (20 - CCSDS_TC_TM_PACKET_OFFSET)
19 #define PACKET_LENGTH_TC_LFR_UPDATE_INFO (46 - CCSDS_TC_TM_PACKET_OFFSET)
20 #define PACKET_LENGTH_TC_LFR_ENABLE_CALIBRATION (12 - CCSDS_TC_TM_PACKET_OFFSET)
21 #define PACKET_LENGTH_TC_LFR_DISABLE_CALIBRATION (12 - CCSDS_TC_TM_PACKET_OFFSET)
22 #define PACKET_LENGTH_TC_LFR_UPDATE_TIME (18 - CCSDS_TC_TM_PACKET_OFFSET)
23
24 // TC TYPES
25 #define TC_TYPE_DEFAULT 181
26 #define TC_TYPE_LFR_UPDATE_TIME 9
27
28 // TC SUBTYPES
29 #define TC_SUBTYPE_RESET 1
30 #define TC_SUBTYPE_LOAD_COMMON_PAR 11
31 #define TC_SUBTYPE_LOAD_NORMAL_PAR 13
32 #define TC_SUBTYPE_LOAD_BURST_PAR 19
33 #define TC_SUBTYPE_LOAD_SBM1_PAR 25
34 #define TC_SUBTYPE_LOAD_SBM2_PAR 27
35 #define TC_SUBTYPE_DUMP_PAR 31
36 #define TC_SUBTYPE_ENTER_MODE 41
37 #define TC_SUBTYPE_UPDATE_INFO 51
38 #define TC_SUBTYPE_ENABLE_CALIBRATION 61
39 #define TC_SUBTYPE_DISABLE_CALIBRATION 63
40 #define TC_SUBTYPE_UPDATE_TIME 129
41
42 // OTHER CONSTANTS
43 #define TC_LFR_PACKET_SEQUENCE_CONTROL 0xc000 // PID 76 CAT 12
44 #define TC_LFR_DATA_FIELD_HEADER0 0x19
45 #define TC_LFR_LOAD_COMMON_PAR_SPARE 0x00
46
47 struct Packet_TC_LFR_RESET_str
48 { // the CCSDS header is added by LPPMON
49 unsigned char packetID[2];
50 unsigned char packetSequenceControl[2];
51 unsigned char packetLength[2];
52 // DATA FIELD HEADER
53 unsigned char ccsdsSecHeaderFlag_pusVersion_ack;
54 unsigned char serviceType;
55 unsigned char serviceSubType;
56 unsigned char sourceID;
57 unsigned char crc[2];
58 };
59 typedef struct Packet_TC_LFR_RESET_str Packet_TC_LFR_RESET_t;
60
61 struct Packet_TC_LFR_ENTER_MODE_str
62 { // the CCSDS header is added by LPPMON
63 unsigned char packetID[2];
64 unsigned char packetSequenceControl[2];
65 unsigned char packetLength[2];
66 // DATA FIELD HEADER
67 unsigned char ccsdsSecHeaderFlag_pusVersion_ack;
68 unsigned char serviceType;
69 unsigned char serviceSubType;
70 unsigned char sourceID;
71 unsigned char spare;
72 unsigned char mode;
73 unsigned char enterModeTime[6];
74 unsigned char crc[2];
75 };
76 typedef struct Packet_TC_LFR_ENTER_MODE_str Packet_TC_LFR_ENTER_MODE_t;
77
78 struct Packet_TC_LFR_UPDATE_INFO_str
79 { // the CCSDS header is added by LPPMON
80 unsigned char packetID[2];
81 unsigned char packetSequenceControl[2];
82 unsigned char packetLength[2];
83 // DATA FIELD HEADER
84 unsigned char ccsdsSecHeaderFlag_pusVersion_ack;
85 unsigned char serviceType;
86 unsigned char serviceSubType;
87 unsigned char sourceID;
88 unsigned char set1;
89 unsigned char set2;
90 unsigned char set3_bias_setting_set1[6];
91 unsigned char set3_bias_setting_set2[6];
92 unsigned char set3_bias_voltage[4];
93 unsigned char set4[8];
94 unsigned char set5;
95 unsigned char set6;
96 unsigned char set7[8];
97 unsigned char crc[2];
98 };
99 typedef struct Packet_TC_LFR_UPDATE_INFO_str Packet_TC_LFR_UPDATE_INFO_t;
100
101 struct Packet_TC_LFR_DUMP_PAR_str
102 { // the CCSDS header is added by LPPMON
103 unsigned char packetID[2];
104 unsigned char packetSequenceControl[2];
105 unsigned char packetLength[2];
106 // DATA FIELD HEADER
107 unsigned char ccsdsSecHeaderFlag_pusVersion_ack;
108 unsigned char serviceType;
109 unsigned char serviceSubType;
110 unsigned char sourceID;
111 unsigned char crc[2];
112
113 };
114 typedef struct Packet_TC_LFR_DUMP_PAR_str Packet_TC_LFR_DUMP_PAR_t;
115
116 struct Packet_TC_LFR_LOAD_COMMON_PAR_str
117 { // the CCSDS header is added by LPPMON
118 unsigned char packetID[2];
119 unsigned char packetSequenceControl[2];
120 unsigned char packetLength[2];
121 // DATA FIELD HEADER
122 unsigned char ccsdsSecHeaderFlag_pusVersion_ack;
123 unsigned char serviceType;
124 unsigned char serviceSubType;
125 unsigned char sourceID;
126 unsigned char spare;
127 unsigned char bw_sp0_sp1_r0_r1;
128 unsigned char crc[2];
129
130 };
131 typedef struct Packet_TC_LFR_LOAD_COMMON_PAR_str Packet_TC_LFR_LOAD_COMMON_PAR_t;
132
133 struct Packet_TC_LFR_LOAD_NORMAL_PAR_str
134 { // the CCSDS header is added by LPPMON
135 unsigned char packetID[2];
136 unsigned char packetSequenceControl[2];
137 unsigned char packetLength[2];
138 // DATA FIELD HEADER
139 unsigned char ccsdsSecHeaderFlag_pusVersion_ack;
140 unsigned char serviceType;
141 unsigned char serviceSubType;
142 unsigned char sourceID;
143 unsigned char sy_lfr_n_swf_l[2];
144 unsigned char sy_lfr_n_swf_p[2];
145 unsigned char sy_lfr_n_asm_p[2];
146 unsigned char sy_lfr_n_bp_p0;
147 unsigned char sy_lfr_n_bp_p1;
148 unsigned char sy_lfr_n_cwf_long_f3;
149 unsigned char lfr_normal_parameters_spare;
150 unsigned char crc[2];
151 };
152 typedef struct Packet_TC_LFR_LOAD_NORMAL_PAR_str Packet_TC_LFR_LOAD_NORMAL_PAR_t;
153
154 struct Packet_TC_LFR_LOAD_BURST_SBM1_SBM2_PAR_str
155 { // the CCSDS header is added by LPPMON
156 unsigned char packetID[2];
157 unsigned char packetSequenceControl[2];
158 unsigned char packetLength[2];
159 // DATA FIELD HEADER
160 unsigned char ccsdsSecHeaderFlag_pusVersion_ack;
161 unsigned char serviceType;
162 unsigned char serviceSubType;
163 unsigned char sourceID;
164 unsigned char sy_lfr_bp_p0;
165 unsigned char sy_lfr_bp_p1;
166 unsigned char crc[2];
167 };
168 typedef struct Packet_TC_LFR_LOAD_BURST_SBM1_SBM2_PAR_str Packet_TC_LFR_LOAD_BURST_SBM1_SBM2_PAR_t;
169
170 struct Packet_TC_LFR_ENABLE_DISABLE_CALIBRATION_str
171 { // the CCSDS header is added by LPPMON
172 unsigned char packetID[2];
173 unsigned char packetSequenceControl[2];
174 unsigned char packetLength[2];
175 // DATA FIELD HEADER
176 unsigned char ccsdsSecHeaderFlag_pusVersion_ack;
177 unsigned char serviceType;
178 unsigned char serviceSubType;
179 unsigned char sourceID;
180 unsigned char crc[2];
181 };
182 typedef struct Packet_TC_LFR_ENABLE_DISABLE_CALIBRATION_str Packet_TC_LFR_ENABLE_DISABLE_CALIBRATION_t;
183
184 struct Packet_TC_LFR_UPDATE_TIME_str
185 { // the CCSDS header is added by LPPMON
186 unsigned char packetID[2];
187 unsigned char packetSequenceControl[2];
188 unsigned char packetLength[2];
189 // DATA FIELD HEADER
190 unsigned char ccsdsSecHeaderFlag_pusVersion_ack;
191 unsigned char serviceType;
192 unsigned char serviceSubType;
193 unsigned char sourceID;
194 unsigned char cp_rpw_time[6];
195 unsigned char crc[2];
196 };
197 typedef struct Packet_TC_LFR_UPDATE_TIME_str Packet_TC_LFR_UPDATE_TIME_t;
198
199 struct Packet_TC_LFR_UPDATE_TIME_WITH_HEADER_str
200 {
201 unsigned char targetLogicalAddress;
202 unsigned char protocolIdentifier;
203 unsigned char reserved;
204 unsigned char userApplication;
205 //
206 unsigned char packetID[2];
207 unsigned char packetSequenceControl[2];
208 unsigned char packetLength[2];
209 // DATA FIELD HEADER
210 unsigned char ccsdsSecHeaderFlag_pusVersion_ack;
211 unsigned char serviceType;
212 unsigned char serviceSubType;
213 unsigned char sourceID;
214 unsigned char cp_rpw_time[6];
215 unsigned char crc[2];
216 };
217 typedef struct Packet_TC_LFR_UPDATE_TIME_WITH_HEADER_str Packet_TC_LFR_UPDATE_TIME_WITH_HEADER_t;
218
219 #endif // TC_TYPES_H
This diff has been collapsed as it changes many lines, (665 lines changed) Show them Hide them
@@ -0,0 +1,665
1 #ifndef CCSDS_TYPES_H_INCLUDED
2 #define CCSDS_TYPES_H_INCLUDED
3
4 #include "fsw_params_processing.h"
5
6 #define CCSDS_PROTOCOLE_EXTRA_BYTES 4
7 #define CCSDS_TC_TM_PACKET_OFFSET 7
8 #define CCSDS_TELEMETRY_HEADER_LENGTH 16+4
9 #define CCSDS_TM_PKT_MAX_SIZE 4412
10 #define CCSDS_TELECOMMAND_HEADER_LENGTH 10+4
11 #define CCSDS_TC_PKT_MAX_SIZE 256
12 #define CCSDS_TC_PKT_MIN_SIZE 16
13 #define CCSDS_PROCESS_ID 76
14 #define CCSDS_PACKET_CATEGORY 12
15 #define CCSDS_NODE_ADDRESS 0xfe
16 #define CCSDS_USER_APP 0x00
17
18 #define DEFAULT_SPARE1_PUSVERSION_SPARE2 0x10
19 #define DEFAULT_RESERVED 0x00
20 #define DEFAULT_HKBIA 0x1e // 0001 1110
21
22 // PACKET ID
23 #define APID_TM_TC_EXE 0x0cc1 // PID 76 CAT 1
24 #define APID_TM_HK 0x0cc4 // PID 76 CAT 4
25 #define APID_TM_PARAMETER_DUMP 0x0cc9 // PID 76 CAT 9
26 #define APID_TM_SCIENCE_NORMAL_BURST 0x0ccc // PID 76 CAT 12
27 #define APID_TM_SCIENCE_SBM1_SBM2 0x0cfc // PID 79 CAT 12
28 #define TM_PACKET_PID_DEFAULT 76
29 #define TM_PACKET_PID_BURST_SBM1_SBM2 79
30 #define TM_PACKET_CAT_TC_EXE 1
31 #define TM_PACKET_CAT_HK 4
32 #define TM_PACKET_CAT_PARAMETER_DUMP 9
33 #define TM_PACKET_CAT_SCIENCE 12
34 #define TC_PACKET_CAT 12
35
36 // PACKET SEQUENCE CONTROL
37 #define TM_PACKET_SEQ_CTRL_CONTINUATION 0x00 // [0000 0000]
38 #define TM_PACKET_SEQ_CTRL_FIRST 0x40 // [0100 0000]
39 #define TM_PACKET_SEQ_CTRL_LAST 0x80 // [1000 0000]
40 #define TM_PACKET_SEQ_CTRL_STANDALONE 0xc0 // [1100 0000]
41 #define TM_PACKET_SEQ_CNT_DEFAULT 0x00 // [0000 0000]
42
43 // DESTINATION ID
44 #define TM_DESTINATION_ID_GROUND 0
45 #define TM_DESTINATION_ID_MISSION_TIMELINE 110
46 #define TM_DESTINATION_ID_TC_SEQUENCES 111
47 #define TM_DESTINATION_ID_RECOVERY_ACTION_COMMAND 112
48 #define TM_DESTINATION_ID_BACKUP_MISSION_TIMELINE 113
49 #define TM_DESTINATION_ID_DIRECT_CMD 120
50 #define TM_DESTINATION_ID_SPARE_GRD_SRC1 121
51 #define TM_DESTINATION_ID_SPARE_GRD_SRC2 122
52 #define TM_DESTINATION_ID_OBCP 15
53 #define TM_DESTINATION_ID_SYSTEM_CONTROL 14
54 #define TM_DESTINATION_ID_AOCS 11
55
56 #define CCSDS_DESTINATION_ID 0x01
57 #define CCSDS_PROTOCOLE_ID 0x02
58 #define CCSDS_RESERVED 0x00
59 #define CCSDS_USER_APP 0x00
60
61 #define SIZE_TM_LFR_TC_EXE_NOT_IMPLEMENTED 24
62 #define SIZE_TM_LFR_TC_EXE_CORRUPTED 32
63 #define SIZE_HK_PARAMETERS 112
64
65 // TC TYPES
66 #define TC_TYPE_GEN 181
67 #define TC_TYPE_TIME 9
68
69 // TC SUBTYPES
70 #define TC_SUBTYPE_RESET 1
71 #define TC_SUBTYPE_LOAD_COMM 11
72 #define TC_SUBTYPE_LOAD_NORM 13
73 #define TC_SUBTYPE_LOAD_BURST 19
74 #define TC_SUBTYPE_LOAD_SBM1 25
75 #define TC_SUBTYPE_LOAD_SBM2 27
76 #define TC_SUBTYPE_DUMP 31
77 #define TC_SUBTYPE_ENTER 41
78 #define TC_SUBTYPE_UPDT_INFO 51
79 #define TC_SUBTYPE_EN_CAL 61
80 #define TC_SUBTYPE_DIS_CAL 63
81 #define TC_SUBTYPE_UPDT_TIME 129
82
83 // TC LEN
84 #define TC_LEN_RESET 12
85 #define TC_LEN_LOAD_COMM 14
86 #define TC_LEN_LOAD_NORM 22
87 #define TC_LEN_LOAD_BURST 14
88 #define TC_LEN_LOAD_SBM1 14
89 #define TC_LEN_LOAD_SBM2 14
90 #define TC_LEN_DUMP 12
91 #define TC_LEN_ENTER 20
92 #define TC_LEN_UPDT_INFO 46
93 #define TC_LEN_EN_CAL 12
94 #define TC_LEN_DIS_CAL 12
95 #define TC_LEN_UPDT_TIME 18
96
97 // TM TYPES
98 #define TM_TYPE_TC_EXE 1
99 #define TM_TYPE_HK 3
100 #define TM_TYPE_PARAMETER_DUMP 3
101 #define TM_TYPE_LFR_SCIENCE 21
102
103 // TM SUBTYPES
104 #define TM_SUBTYPE_EXE_OK 7
105 #define TM_SUBTYPE_EXE_NOK 8
106 #define TM_SUBTYPE_HK 25
107 #define TM_SUBTYPE_PARAMETER_DUMP 25
108 #define TM_SUBTYPE_SCIENCE 3
109 #define TM_SUBTYPE_LFR_SCIENCE 3
110
111 // FAILURE CODES
112 #define ILLEGAL_APID 0
113 #define WRONG_LEN_PKT 1
114 #define INCOR_CHECKSUM 2
115 #define ILL_TYPE 3
116 #define ILL_SUBTYPE 4
117 #define WRONG_APP_DATA 5 // 0x00 0x05
118 #define TC_NOT_EXE 42000 // 0xa4 0x10
119 #define WRONG_SRC_ID 42001 // 0xa4 0x11
120 #define FUNCT_NOT_IMPL 42002 // 0xa4 0x12
121 #define FAIL_DETECTED 42003 // 0xa4 0x13
122 #define NOT_ALLOWED 42004 // 0xa4 0x14
123 #define CORRUPTED 42005 // 0xa4 0x15
124 #define CCSDS_TM_VALID 7
125
126 // TC SID
127 #define SID_TC_GROUND 0
128 #define SID_TC_MISSION_TIMELINE 110
129 #define SID_TC_TC_SEQUENCES 111
130 #define SID_TC_RECOVERY_ACTION_CMD 112
131 #define SID_TC_BACKUP_MISSION_TIMELINE 113
132 #define SID_TC_DIRECT_CMD 120
133 #define SID_TC_SPARE_GRD_SRC1 121
134 #define SID_TC_SPARE_GRD_SRC2 122
135 #define SID_TC_OBCP 15
136 #define SID_TC_SYSTEM_CONTROL 14
137 #define SID_TC_AOCS 11
138 #define SID_TC_RPW_INTERNAL 254
139
140 enum apid_destid{
141 GROUND,
142 MISSION_TIMELINE,
143 TC_SEQUENCES,
144 RECOVERY_ACTION_CMD,
145 BACKUP_MISSION_TIMELINE,
146 DIRECT_CMD,
147 SPARE_GRD_SRC1,
148 SPARE_GRD_SRC2,
149 OBCP,
150 SYSTEM_CONTROL,
151 AOCS,
152 RPW_INTERNAL
153 };
154 // SEQUENCE COUNTERS
155 #define SEQ_CNT_MAX 16383
156 #define SEQ_CNT_NB_DEST_ID 12
157
158 // TM SID
159 #define SID_HK 1
160 #define SID_PARAMETER_DUMP 10
161
162 #define SID_NORM_SWF_F0 3
163 #define SID_NORM_SWF_F1 4
164 #define SID_NORM_SWF_F2 5
165 #define SID_NORM_CWF_F3 1
166 #define SID_BURST_CWF_F2 2
167 #define SID_SBM1_CWF_F1 24
168 #define SID_SBM2_CWF_F2 25
169 #define SID_NORM_ASM_F0 11
170 #define SID_NORM_ASM_F1 12
171 #define SID_NORM_ASM_F2 13
172 #define SID_NORM_BP1_F0 14
173 #define SID_NORM_BP1_F1 15
174 #define SID_NORM_BP1_F2 16
175 #define SID_NORM_BP2_F0 19
176 #define SID_NORM_BP2_F1 20
177 #define SID_NORM_BP2_F2 21
178 #define SID_BURST_BP1_F0 17
179 #define SID_BURST_BP2_F0 22
180 #define SID_BURST_BP1_F1 18
181 #define SID_BURST_BP2_F1 23
182 #define SID_SBM1_BP1_F0 28
183 #define SID_SBM1_BP2_F0 31
184 #define SID_SBM2_BP1_F0 29
185 #define SID_SBM2_BP2_F0 32
186 #define SID_SBM2_BP1_F1 30
187 #define SID_SBM2_BP2_F1 33
188 #define SID_NORM_CWF_LONG_F3 34
189
190 // LENGTH (BYTES)
191 #define LENGTH_TM_LFR_TC_EXE_MAX 32
192 #define LENGTH_TM_LFR_HK 126
193
194 // HEADER_LENGTH
195 #define TM_HEADER_LEN 16
196 #define HEADER_LENGTH_TM_LFR_SCIENCE_ASM 28
197 // PACKET_LENGTH
198 #define PACKET_LENGTH_TC_EXE_SUCCESS (20 - CCSDS_TC_TM_PACKET_OFFSET)
199 #define PACKET_LENGTH_TC_EXE_INCONSISTENT (26 - CCSDS_TC_TM_PACKET_OFFSET)
200 #define PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE (26 - CCSDS_TC_TM_PACKET_OFFSET)
201 #define PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED (24 - CCSDS_TC_TM_PACKET_OFFSET)
202 #define PACKET_LENGTH_TC_EXE_ERROR (24 - CCSDS_TC_TM_PACKET_OFFSET)
203 #define PACKET_LENGTH_TC_EXE_CORRUPTED (32 - CCSDS_TC_TM_PACKET_OFFSET)
204 #define PACKET_LENGTH_HK (124 - CCSDS_TC_TM_PACKET_OFFSET)
205 #define PACKET_LENGTH_PARAMETER_DUMP (36 - CCSDS_TC_TM_PACKET_OFFSET)
206 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F0 (2228 - CCSDS_TC_TM_PACKET_OFFSET) // 44 * 25 * 2 + 28
207 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F1 (2628 - CCSDS_TC_TM_PACKET_OFFSET) // 52 * 25 * 2 + 28
208 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F2 (2428 - CCSDS_TC_TM_PACKET_OFFSET) // 48 * 25 * 2 + 28
209 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F0 (126 - CCSDS_TC_TM_PACKET_OFFSET) // 11 * 9 + 27 (1 spare bit in the header)
210 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F0 (356 - CCSDS_TC_TM_PACKET_OFFSET) // 11 * 30 + 26
211 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F1 (144 - CCSDS_TC_TM_PACKET_OFFSET) // 13 * 9 + 27 (1 spare bit in the header)
212 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F1 (416 - CCSDS_TC_TM_PACKET_OFFSET) // 13 * 30 + 26
213 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F2 (134 - CCSDS_TC_TM_PACKET_OFFSET) // 12 * 9 + 26
214 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F2 (386 - CCSDS_TC_TM_PACKET_OFFSET) // 12 * 30 + 26
215 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F0 (224 - CCSDS_TC_TM_PACKET_OFFSET) // 22 * 9 + 26
216 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F0 (686 - CCSDS_TC_TM_PACKET_OFFSET) // 22 * 30 + 26
217 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F1 (260 - CCSDS_TC_TM_PACKET_OFFSET) // 26 * 9 + 26
218 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F1 (806 - CCSDS_TC_TM_PACKET_OFFSET) // 26 * 30 + 26
219
220 #define PACKET_LENGTH_DELTA 11 // 7 + 4
221
222 #define SPARE1_PUSVERSION_SPARE2 0x10
223
224 // R1
225 #define TM_LEN_SCI_SWF_340 4101 // 340 * 12 + 10 + 12 - 1
226 #define TM_LEN_SCI_SWF_8 117 // 8 * 12 + 10 + 12 - 1
227 #define TM_LEN_SCI_CWF_340 4099 // 340 * 12 + 10 + 10 - 1
228 #define TM_LEN_SCI_CWF_8 115 // 8 * 12 + 10 + 10 - 1
229 #define TM_LEN_SCI_CWF3_LIGHT_340 2059 // 340 * 6 + 10 + 10 - 1