@@ -1,6 +1,6 | |||||
1 | ############################################################################# |
|
1 | ############################################################################# | |
2 | # Makefile for building: bin/fsw |
|
2 | # Makefile for building: bin/fsw | |
3 |
# Generated by qmake (2.01a) (Qt 4.8. |
|
3 | # Generated by qmake (2.01a) (Qt 4.8.5) on: Mon Sep 30 15:28:56 2013 | |
4 | # Project: fsw-qt.pro |
|
4 | # Project: fsw-qt.pro | |
5 | # Template: app |
|
5 | # Template: app | |
6 | # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro |
|
6 | # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro | |
@@ -10,7 +10,7 | |||||
10 |
|
10 | |||
11 | CC = sparc-rtems-gcc |
|
11 | CC = sparc-rtems-gcc | |
12 | CXX = sparc-rtems-g++ |
|
12 | CXX = sparc-rtems-g++ | |
13 |
DEFINES = -DSW_VERSION_N1=0 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=1 |
|
13 | DEFINES = -DSW_VERSION_N1=0 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=13 -DPRINT_MESSAGES_ON_CONSOLE | |
14 | CFLAGS = -pipe -O3 -Wall $(DEFINES) |
|
14 | CFLAGS = -pipe -O3 -Wall $(DEFINES) | |
15 | CXXFLAGS = -pipe -O3 -Wall $(DEFINES) |
|
15 | CXXFLAGS = -pipe -O3 -Wall $(DEFINES) | |
16 | INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header |
|
16 | INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header | |
@@ -48,13 +48,15 SOURCES = ../src/wf_handler.c \ | |||||
48 | ../src/fsw_processing.c \ |
|
48 | ../src/fsw_processing.c \ | |
49 | ../src/fsw_misc.c \ |
|
49 | ../src/fsw_misc.c \ | |
50 | ../src/fsw_init.c \ |
|
50 | ../src/fsw_init.c \ | |
51 | ../src/fsw_globals.c |
|
51 | ../src/fsw_globals.c \ | |
|
52 | ../src/fsw_spacewire.c | |||
52 | OBJECTS = obj/wf_handler.o \ |
|
53 | OBJECTS = obj/wf_handler.o \ | |
53 | obj/tc_handler.o \ |
|
54 | obj/tc_handler.o \ | |
54 | obj/fsw_processing.o \ |
|
55 | obj/fsw_processing.o \ | |
55 | obj/fsw_misc.o \ |
|
56 | obj/fsw_misc.o \ | |
56 | obj/fsw_init.o \ |
|
57 | obj/fsw_init.o \ | |
57 | obj/fsw_globals.o |
|
58 | obj/fsw_globals.o \ | |
|
59 | obj/fsw_spacewire.o | |||
58 | DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \ |
|
60 | DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \ | |
59 | /usr/lib64/qt4/mkspecs/common/linux.conf \ |
|
61 | /usr/lib64/qt4/mkspecs/common/linux.conf \ | |
60 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf \ |
|
62 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf \ | |
@@ -70,6 +72,7 DIST = /usr/lib64/qt4/mkspecs/c | |||||
70 | sparc.pri \ |
|
72 | sparc.pri \ | |
71 | /usr/lib64/qt4/mkspecs/features/release.prf \ |
|
73 | /usr/lib64/qt4/mkspecs/features/release.prf \ | |
72 | /usr/lib64/qt4/mkspecs/features/default_post.prf \ |
|
74 | /usr/lib64/qt4/mkspecs/features/default_post.prf \ | |
|
75 | /usr/lib64/qt4/mkspecs/features/shared.prf \ | |||
73 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ |
|
76 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ | |
74 | /usr/lib64/qt4/mkspecs/features/warn_on.prf \ |
|
77 | /usr/lib64/qt4/mkspecs/features/warn_on.prf \ | |
75 | /usr/lib64/qt4/mkspecs/features/resources.prf \ |
|
78 | /usr/lib64/qt4/mkspecs/features/resources.prf \ | |
@@ -125,6 +128,7 Makefile: fsw-qt.pro /usr/lib64/qt4/mks | |||||
125 | sparc.pri \ |
|
128 | sparc.pri \ | |
126 | /usr/lib64/qt4/mkspecs/features/release.prf \ |
|
129 | /usr/lib64/qt4/mkspecs/features/release.prf \ | |
127 | /usr/lib64/qt4/mkspecs/features/default_post.prf \ |
|
130 | /usr/lib64/qt4/mkspecs/features/default_post.prf \ | |
|
131 | /usr/lib64/qt4/mkspecs/features/shared.prf \ | |||
128 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ |
|
132 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ | |
129 | /usr/lib64/qt4/mkspecs/features/warn_on.prf \ |
|
133 | /usr/lib64/qt4/mkspecs/features/warn_on.prf \ | |
130 | /usr/lib64/qt4/mkspecs/features/resources.prf \ |
|
134 | /usr/lib64/qt4/mkspecs/features/resources.prf \ | |
@@ -148,6 +152,7 Makefile: fsw-qt.pro /usr/lib64/qt4/mks | |||||
148 | sparc.pri: |
|
152 | sparc.pri: | |
149 | /usr/lib64/qt4/mkspecs/features/release.prf: |
|
153 | /usr/lib64/qt4/mkspecs/features/release.prf: | |
150 | /usr/lib64/qt4/mkspecs/features/default_post.prf: |
|
154 | /usr/lib64/qt4/mkspecs/features/default_post.prf: | |
|
155 | /usr/lib64/qt4/mkspecs/features/shared.prf: | |||
151 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf: |
|
156 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf: | |
152 | /usr/lib64/qt4/mkspecs/features/warn_on.prf: |
|
157 | /usr/lib64/qt4/mkspecs/features/warn_on.prf: | |
153 | /usr/lib64/qt4/mkspecs/features/resources.prf: |
|
158 | /usr/lib64/qt4/mkspecs/features/resources.prf: | |
@@ -215,6 +220,9 obj/fsw_init.o: ../src/fsw_init.c | |||||
215 | obj/fsw_globals.o: ../src/fsw_globals.c |
|
220 | obj/fsw_globals.o: ../src/fsw_globals.c | |
216 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_globals.o ../src/fsw_globals.c |
|
221 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_globals.o ../src/fsw_globals.c | |
217 |
|
222 | |||
|
223 | obj/fsw_spacewire.o: ../src/fsw_spacewire.c | |||
|
224 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_spacewire.o ../src/fsw_spacewire.c | |||
|
225 | ||||
218 | ####### Install |
|
226 | ####### Install | |
219 |
|
227 | |||
220 | install: FORCE |
|
228 | install: FORCE |
1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
@@ -7,11 +7,11 CONFIG -= qt | |||||
7 | include(./sparc.pri) |
|
7 | include(./sparc.pri) | |
8 |
|
8 | |||
9 | # flight software version |
|
9 | # flight software version | |
10 |
SWVERSION=-0-1 |
|
10 | SWVERSION=-0-13 | |
11 | DEFINES += SW_VERSION_N1=0 |
|
11 | DEFINES += SW_VERSION_N1=0 | |
12 | DEFINES += SW_VERSION_N2=0 |
|
12 | DEFINES += SW_VERSION_N2=0 | |
13 | DEFINES += SW_VERSION_N3=0 |
|
13 | DEFINES += SW_VERSION_N3=0 | |
14 |
DEFINES += SW_VERSION_N4=1 |
|
14 | DEFINES += SW_VERSION_N4=13 | |
15 |
|
15 | |||
16 | contains( CONFIG, verbose ) { |
|
16 | contains( CONFIG, verbose ) { | |
17 | DEFINES += PRINT_MESSAGES_ON_CONSOLE |
|
17 | DEFINES += PRINT_MESSAGES_ON_CONSOLE | |
@@ -37,7 +37,8 SOURCES += \ | |||||
37 | ../src/fsw_processing.c \ |
|
37 | ../src/fsw_processing.c \ | |
38 | ../src/fsw_misc.c \ |
|
38 | ../src/fsw_misc.c \ | |
39 | ../src/fsw_init.c \ |
|
39 | ../src/fsw_init.c \ | |
40 | ../src/fsw_globals.c |
|
40 | ../src/fsw_globals.c \ | |
|
41 | ../src/fsw_spacewire.c | |||
41 |
|
42 | |||
42 | HEADERS += \ |
|
43 | HEADERS += \ | |
43 | ../header/wf_handler.h \ |
|
44 | ../header/wf_handler.h \ | |
@@ -48,5 +49,6 HEADERS += \ | |||||
48 | ../header/fsw_misc.h \ |
|
49 | ../header/fsw_misc.h \ | |
49 | ../header/fsw_init.h \ |
|
50 | ../header/fsw_init.h \ | |
50 | ../header/ccsds_types.h \ |
|
51 | ../header/ccsds_types.h \ | |
51 | ../header/fsw_params_processing.h |
|
52 | ../header/fsw_params_processing.h \ | |
|
53 | ../header/fsw_spacewire.h | |||
52 |
|
54 |
@@ -1,6 +1,6 | |||||
1 | <?xml version="1.0" encoding="UTF-8"?> |
|
1 | <?xml version="1.0" encoding="UTF-8"?> | |
2 | <!DOCTYPE QtCreatorProject> |
|
2 | <!DOCTYPE QtCreatorProject> | |
3 |
<!-- Written by QtCreator 2.8.0, 2013- |
|
3 | <!-- Written by QtCreator 2.8.0, 2013-10-01T07:01:25. --> | |
4 | <qtcreator> |
|
4 | <qtcreator> | |
5 | <data> |
|
5 | <data> | |
6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> |
|
6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> |
@@ -3,35 +3,61 | |||||
3 |
|
3 | |||
4 | #include <ccsds_types.h> |
|
4 | #include <ccsds_types.h> | |
5 |
|
5 | |||
|
6 | #define PROTOCOLE_IDENTIFIER 0x02 | |||
|
7 | ||||
6 | // PACKET ID |
|
8 | // PACKET ID | |
7 | #define TC_LFR_PACKET_ID 0x1ccc // PID 76 CAT 12 |
|
9 | #define TC_LFR_PACKET_ID 0x1ccc // PID 76 CAT 12 | |
8 |
|
10 | |||
9 |
#define PACKET_LENGTH_TC_LFR_ |
|
11 | #define PACKET_LENGTH_TC_LFR_RESET (12 - CCSDS_TC_TM_PACKET_OFFSET) | |
10 |
#define PACKET_LENGTH_TC_LFR_LOAD_ |
|
12 | #define PACKET_LENGTH_TC_LFR_LOAD_COMMON_PAR (14 - CCSDS_TC_TM_PACKET_OFFSET) | |
11 |
#define PACKET_LENGTH_TC_LFR_LOAD_ |
|
13 | #define PACKET_LENGTH_TC_LFR_LOAD_NORMAL_PAR (20 - CCSDS_TC_TM_PACKET_OFFSET) | |
12 |
#define PACKET_LENGTH_TC_LFR_LOAD_ |
|
14 | #define PACKET_LENGTH_TC_LFR_LOAD_BURST_PAR (14 - CCSDS_TC_TM_PACKET_OFFSET) | |
13 |
#define PACKET_LENGTH_TC_LFR_LOAD_SBM |
|
15 | #define PACKET_LENGTH_TC_LFR_LOAD_SBM1_PAR (14 - CCSDS_TC_TM_PACKET_OFFSET) | |
14 |
#define PACKET_LENGTH_TC_LFR_ |
|
16 | #define PACKET_LENGTH_TC_LFR_LOAD_SBM2_PAR (14 - CCSDS_TC_TM_PACKET_OFFSET) | |
15 |
#define PACKET_LENGTH_TC_LFR_ |
|
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 (48 - 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) | |||
16 |
|
23 | |||
17 | // TC TYPES |
|
24 | // TC TYPES | |
18 | #define TC_TYPE_DEFAULT 181 |
|
25 | #define TC_TYPE_DEFAULT 181 | |
19 | #define TC_TYPE_LFR_UPDATE_TIME 9 |
|
26 | #define TC_TYPE_LFR_UPDATE_TIME 9 | |
20 |
|
27 | |||
21 | // TC SUBTYPES |
|
28 | // TC SUBTYPES | |
22 | #define TC_SUBTYPE_LOAD_COMMON_PAR 11 |
|
29 | #define TC_SUBTYPE_RESET 1 | |
23 |
#define TC_SUBTYPE_LOAD_ |
|
30 | #define TC_SUBTYPE_LOAD_COMMON_PAR 11 | |
24 |
#define TC_SUBTYPE_LOAD_ |
|
31 | #define TC_SUBTYPE_LOAD_NORMAL_PAR 13 | |
25 |
#define TC_SUBTYPE_LOAD_ |
|
32 | #define TC_SUBTYPE_LOAD_BURST_PAR 19 | |
26 |
#define TC_SUBTYPE_LOAD_SBM |
|
33 | #define TC_SUBTYPE_LOAD_SBM1_PAR 25 | |
27 |
#define TC_SUBTYPE_ |
|
34 | #define TC_SUBTYPE_LOAD_SBM2_PAR 27 | |
28 |
#define TC_SUBTYPE_ |
|
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 | |||
29 |
|
41 | |||
30 | // OTHER CONSTANTS |
|
42 | // OTHER CONSTANTS | |
31 | #define TC_LFR_PACKET_SEQUENCE_CONTROL 0xc000 // PID 76 CAT 12 |
|
43 | #define TC_LFR_PACKET_SEQUENCE_CONTROL 0xc000 // PID 76 CAT 12 | |
32 | #define TC_LFR_DATA_FIELD_HEADER0 0x19 |
|
44 | #define TC_LFR_DATA_FIELD_HEADER0 0x19 | |
33 | #define TC_LFR_LOAD_COMMON_PAR_SPARE 0x00 |
|
45 | #define TC_LFR_LOAD_COMMON_PAR_SPARE 0x00 | |
34 |
|
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 | ||||
35 | struct Packet_TC_LFR_ENTER_MODE_str |
|
61 | struct Packet_TC_LFR_ENTER_MODE_str | |
36 | { // the CCSDS header is added by LPPMON |
|
62 | { // the CCSDS header is added by LPPMON | |
37 | unsigned char packetID[2]; |
|
63 | unsigned char packetID[2]; | |
@@ -49,6 +75,29 struct Packet_TC_LFR_ENTER_MODE_str | |||||
49 | }; |
|
75 | }; | |
50 | typedef struct Packet_TC_LFR_ENTER_MODE_str Packet_TC_LFR_ENTER_MODE_t; |
|
76 | typedef struct Packet_TC_LFR_ENTER_MODE_str Packet_TC_LFR_ENTER_MODE_t; | |
51 |
|
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 | ||||
52 | struct Packet_TC_LFR_DUMP_PAR_str |
|
101 | struct Packet_TC_LFR_DUMP_PAR_str | |
53 | { // the CCSDS header is added by LPPMON |
|
102 | { // the CCSDS header is added by LPPMON | |
54 | unsigned char packetID[2]; |
|
103 | unsigned char packetID[2]; | |
@@ -116,4 +165,33 struct Packet_TC_LFR_LOAD_BURST_SBM1_SBM | |||||
116 | }; |
|
165 | }; | |
117 | typedef struct Packet_TC_LFR_LOAD_BURST_SBM1_SBM2_PAR_str Packet_TC_LFR_LOAD_BURST_SBM1_SBM2_PAR_t; |
|
166 | typedef struct Packet_TC_LFR_LOAD_BURST_SBM1_SBM2_PAR_str Packet_TC_LFR_LOAD_BURST_SBM1_SBM2_PAR_t; | |
118 |
|
167 | |||
|
168 | struct Packet_TC_LFR_ENABLE_DISABLE_CALIBRATION_str | |||
|
169 | { // the CCSDS header is added by LPPMON | |||
|
170 | unsigned char packetID[2]; | |||
|
171 | unsigned char packetSequenceControl[2]; | |||
|
172 | unsigned char packetLength[2]; | |||
|
173 | // DATA FIELD HEADER | |||
|
174 | unsigned char ccsdsSecHeaderFlag_pusVersion_ack; | |||
|
175 | unsigned char serviceType; | |||
|
176 | unsigned char serviceSubType; | |||
|
177 | unsigned char sourceID; | |||
|
178 | unsigned char crc[2]; | |||
|
179 | }; | |||
|
180 | typedef struct Packet_TC_LFR_ENABLE_DISABLE_CALIBRATION_str Packet_TC_LFR_ENABLE_DISABLE_CALIBRATION_t; | |||
|
181 | ||||
|
182 | struct Packet_TC_LFR_UPDATE_TIME_str | |||
|
183 | { // the CCSDS header is added by LPPMON | |||
|
184 | unsigned char packetID[2]; | |||
|
185 | unsigned char packetSequenceControl[2]; | |||
|
186 | unsigned char packetLength[2]; | |||
|
187 | // DATA FIELD HEADER | |||
|
188 | unsigned char ccsdsSecHeaderFlag_pusVersion_ack; | |||
|
189 | unsigned char serviceType; | |||
|
190 | unsigned char serviceSubType; | |||
|
191 | unsigned char sourceID; | |||
|
192 | unsigned char cp_rpw_time[6]; | |||
|
193 | unsigned char crc[2]; | |||
|
194 | }; | |||
|
195 | typedef struct Packet_TC_LFR_UPDATE_TIME_str Packet_TC_LFR_UPDATE_TIME_t; | |||
|
196 | ||||
119 | #endif // TC_TYPES_H |
|
197 | #endif // TC_TYPES_H |
@@ -13,20 +13,31 | |||||
13 | #define CCSDS_NODE_ADDRESS 0xfe |
|
13 | #define CCSDS_NODE_ADDRESS 0xfe | |
14 | #define CCSDS_USER_APP 0x00 |
|
14 | #define CCSDS_USER_APP 0x00 | |
15 |
|
15 | |||
|
16 | #define DEFAULT_SPARE1_PUSVERSION_SPARE2 0x10 | |||
|
17 | #define DEFAULT_RESERVED 0x00 | |||
|
18 | #define DEFAULT_HKBIA 0x1f | |||
|
19 | ||||
16 | // PACKET ID |
|
20 | // PACKET ID | |
17 | #define TM_PACKET_ID_TC_EXE 0x0cc1 // PID 76 CAT 1 |
|
21 | #define TM_PACKET_ID_TC_EXE 0x0cc1 // PID 76 CAT 1 | |
18 | #define TM_PACKET_ID_HK 0x0cc4 // PID 76 CAT 4 |
|
22 | #define TM_PACKET_ID_HK 0x0cc4 // PID 76 CAT 4 | |
19 | #define TM_PACKET_ID_PARAMETER_DUMP 0x0cc9 // PID 76 CAT 9 |
|
23 | #define TM_PACKET_ID_PARAMETER_DUMP 0x0cc9 // PID 76 CAT 9 | |
20 | #define TM_PACKET_ID_SCIENCE_NORMAL 0x0ccc // PID 76 CAT 12 |
|
24 | #define TM_PACKET_ID_SCIENCE_NORMAL 0x0ccc // PID 76 CAT 12 | |
21 | #define TM_PACKET_ID_SCIENCE_BURST_SBM1_SBM2 0x0cfc // PID 79 CAT 12 |
|
25 | #define TM_PACKET_ID_SCIENCE_BURST_SBM1_SBM2 0x0cfc // PID 79 CAT 12 | |
|
26 | #define TM_PACKET_PID_DEFAULT 76 | |||
|
27 | #define TM_PACKET_PID_BURST_SBM1_SBM2 79 | |||
|
28 | #define TM_PACKET_CAT_TC_EXE 1 | |||
|
29 | #define TM_PACKET_CAT_HK 4 | |||
|
30 | #define TM_PACKET_CAT_PARAMETER_DUMP 9 | |||
|
31 | #define TM_PACKET_CAT_SCIENCE 12 | |||
22 |
|
32 | |||
23 | // PACKET SEQUENCE CONTROL |
|
33 | // PACKET SEQUENCE CONTROL | |
24 | #define TM_PACKET_SEQ_CTRL_CONTINUATION 0 |
|
34 | #define TM_PACKET_SEQ_CTRL_CONTINUATION 0x00 // [0000 0000] | |
25 | #define TM_PACKET_SEQ_CTRL_FIRST 1 |
|
35 | #define TM_PACKET_SEQ_CTRL_FIRST 0x40 // [0100 0000] | |
26 |
#define TM_PACKET_SEQ_CTRL_LAST |
|
36 | #define TM_PACKET_SEQ_CTRL_LAST 0x80 // [1000 0000] | |
27 |
#define TM_PACKET_SEQ_CTRL_STANDALONE |
|
37 | #define TM_PACKET_SEQ_CTRL_STANDALONE 0xc0 // [1100 0000] | |
|
38 | #define TM_PACKET_SEQ_CNT_DEFAULT 0x00 // [0000 0000] | |||
28 |
|
39 | |||
29 | // |
|
40 | // DESTINATION ID | |
30 | #define TM_DESTINATION_ID_GROUND 0 |
|
41 | #define TM_DESTINATION_ID_GROUND 0 | |
31 | #define TM_DESTINATION_ID_MISSION_TIMELINE 110 |
|
42 | #define TM_DESTINATION_ID_MISSION_TIMELINE 110 | |
32 | #define TM_DESTINATION_ID_TC_SEQUENCES 111 |
|
43 | #define TM_DESTINATION_ID_TC_SEQUENCES 111 | |
@@ -48,15 +59,6 | |||||
48 | #define SIZE_TM_LFR_TC_EXE_CORRUPTED 32 |
|
59 | #define SIZE_TM_LFR_TC_EXE_CORRUPTED 32 | |
49 | #define SIZE_HK_PARAMETERS 112 |
|
60 | #define SIZE_HK_PARAMETERS 112 | |
50 |
|
61 | |||
51 | #define ILLEGAL_APID 0 |
|
|||
52 | #define WRONG_LEN_PACKET 1 |
|
|||
53 | #define INCOR_CHECKSUM 2 |
|
|||
54 | #define ILL_TYPE 3 |
|
|||
55 | #define ILL_SUBTYPE 4 |
|
|||
56 | #define WRONG_APP_DATA 5 |
|
|||
57 | #define WRONG_CMD_CODE 6 |
|
|||
58 | #define CCSDS_TM_VALID 7 |
|
|||
59 |
|
||||
60 | // TC TYPES |
|
62 | // TC TYPES | |
61 | #define TC_TYPE_GEN 181 |
|
63 | #define TC_TYPE_GEN 181 | |
62 | #define TC_TYPE_TIME 9 |
|
64 | #define TC_TYPE_TIME 9 | |
@@ -104,11 +106,21 | |||||
104 | #define TM_SUBTYPE_LFR_SCIENCE 3 |
|
106 | #define TM_SUBTYPE_LFR_SCIENCE 3 | |
105 |
|
107 | |||
106 | // FAILURE CODES |
|
108 | // FAILURE CODES | |
|
109 | #define ILLEGAL_APID 0 | |||
|
110 | #define WRONG_LEN_PACKET 1 | |||
|
111 | #define INCOR_CHECKSUM 2 | |||
|
112 | #define ILL_TYPE 3 | |||
|
113 | #define ILL_SUBTYPE 4 | |||
|
114 | #define WRONG_APP_DATA 5 | |||
|
115 | // | |||
|
116 | #define WRONG_CMD_CODE 6 | |||
|
117 | #define CCSDS_TM_VALID 7 | |||
107 | #define FAILURE_CODE_INCONSISTENT 5 // 0x00 0x05 |
|
118 | #define FAILURE_CODE_INCONSISTENT 5 // 0x00 0x05 | |
108 | #define FAILURE_CODE_NOT_EXECUTABLE 42000 // 0xa4 0x10 |
|
119 | #define FAILURE_CODE_NOT_EXECUTABLE 42000 // 0xa4 0x10 | |
109 | #define FAILURE_CODE_NOT_IMPLEMENTED 42002 // 0xa4 0x12 |
|
120 | #define FAILURE_CODE_NOT_IMPLEMENTED 42002 // 0xa4 0x12 | |
110 | #define FAILURE_CODE_ERROR 42003 // 0xa4 0x13 |
|
121 | #define FAILURE_CODE_ERROR 42003 // 0xa4 0x13 | |
111 | #define FAILURE_CODE_CORRUPTED 42005 // 0xa4 0x15 |
|
122 | #define FAILURE_CODE_CORRUPTED 42005 // 0xa4 0x15 | |
|
123 | ||||
112 | // TM SID |
|
124 | // TM SID | |
113 | #define SID_DEFAULT 0 |
|
125 | #define SID_DEFAULT 0 | |
114 | #define SID_EXE_INC 5 |
|
126 | #define SID_EXE_INC 5 | |
@@ -143,8 +155,8 | |||||
143 | #define SID_SBM1_BP2_F0 31 |
|
155 | #define SID_SBM1_BP2_F0 31 | |
144 | #define SID_SBM2_BP1_F0 29 |
|
156 | #define SID_SBM2_BP1_F0 29 | |
145 | #define SID_SBM2_BP2_F0 32 |
|
157 | #define SID_SBM2_BP2_F0 32 | |
146 |
#define SID_SBM |
|
158 | #define SID_SBM2_BP1_F1 30 | |
147 |
#define SID_SBM |
|
159 | #define SID_SBM2_BP2_F1 33 | |
148 |
|
160 | |||
149 | // LENGTH (BYTES) |
|
161 | // LENGTH (BYTES) | |
150 | #define LENGTH_TM_LFR_TC_EXE_MAX 32 |
|
162 | #define LENGTH_TM_LFR_TC_EXE_MAX 32 | |
@@ -166,13 +178,16 | |||||
166 |
|
178 | |||
167 | #define SPARE1_PUSVERSION_SPARE2 0x10 |
|
179 | #define SPARE1_PUSVERSION_SPARE2 0x10 | |
168 |
|
180 | |||
169 | #define LEN_TM_LFR_HK 126 + 4 |
|
181 | #define LEN_TM_LFR_HK 126 + 4 | |
170 | #define LEN_TM_LFR_TC_EXE_NOT_IMP 24 +4 |
|
182 | #define LEN_TM_LFR_TC_EXE_NOT_IMP 24 +4 | |
171 |
|
183 | |||
172 | #define TM_LEN_SCI_SWF_340 340 * 12 + 10 + 12 - 1 |
|
184 | #define TM_LEN_SCI_SWF_340 (340 * 12 + 10 + 12 - 1) | |
173 | #define TM_LEN_SCI_SWF_8 8 * 12 + 10 + 12 - 1 |
|
185 | #define TM_LEN_SCI_SWF_8 (8 * 12 + 10 + 12 - 1) | |
174 | #define TM_LEN_SCI_CWF_340 340 * 12 + 10 + 10 - 1 |
|
186 | #define TM_LEN_SCI_CWF_340 (340 * 12 + 10 + 10 - 1) | |
175 | #define TM_LEN_SCI_CWF_8 8 * 12 + 10 + 10 - 1 |
|
187 | #define TM_LEN_SCI_CWF_8 (8 * 12 + 10 + 10 - 1) | |
|
188 | #define DEFAULT_PKTCNT 0x07 | |||
|
189 | #define BLK_NR_340 0x0154 | |||
|
190 | #define BLK_NR_8 0x0008 | |||
176 |
|
191 | |||
177 | enum TM_TYPE{ |
|
192 | enum TM_TYPE{ | |
178 | TM_LFR_TC_EXE_OK, |
|
193 | TM_LFR_TC_EXE_OK, | |
@@ -220,6 +235,35 struct Packet_TM_LFR_TC_EXE_str | |||||
220 | }; |
|
235 | }; | |
221 | typedef struct Packet_TM_LFR_TC_EXE_str Packet_TM_LFR_TC_EXE_t; |
|
236 | typedef struct Packet_TM_LFR_TC_EXE_str Packet_TM_LFR_TC_EXE_t; | |
222 |
|
237 | |||
|
238 | struct Packet_TM_LFR_TC_EXE_CORRUPTED_str | |||
|
239 | { | |||
|
240 | volatile unsigned char targetLogicalAddress; | |||
|
241 | volatile unsigned char protocolIdentifier; | |||
|
242 | volatile unsigned char reserved; | |||
|
243 | volatile unsigned char userApplication; | |||
|
244 | // PACKET HEADER | |||
|
245 | volatile unsigned char packetID[2]; | |||
|
246 | volatile unsigned char packetSequenceControl[2]; | |||
|
247 | volatile unsigned char packetLength[2]; | |||
|
248 | // DATA FIELD HEADER | |||
|
249 | volatile unsigned char spare1_pusVersion_spare2; | |||
|
250 | volatile unsigned char serviceType; | |||
|
251 | volatile unsigned char serviceSubType; | |||
|
252 | volatile unsigned char destinationID; | |||
|
253 | volatile unsigned char time[6]; | |||
|
254 | // | |||
|
255 | volatile unsigned char tc_failure_code[2]; | |||
|
256 | volatile unsigned char telecommand_pkt_id[2]; | |||
|
257 | volatile unsigned char pkt_seq_control[2]; | |||
|
258 | volatile unsigned char tc_service; | |||
|
259 | volatile unsigned char tc_subtype; | |||
|
260 | volatile unsigned char pkt_len_rcv_value[2]; | |||
|
261 | volatile unsigned char pkt_datafieldsize_cnt[2]; | |||
|
262 | volatile unsigned char rcv_crc[2]; | |||
|
263 | volatile unsigned char computed_crc[2]; | |||
|
264 | }; | |||
|
265 | typedef struct Packet_TM_LFR_TC_EXE_CORRUPTED_str Packet_TM_LFR_TC_EXE_CORRUPTED_t; | |||
|
266 | ||||
223 | struct Header_TM_LFR_SCIENCE_SWF_str |
|
267 | struct Header_TM_LFR_SCIENCE_SWF_str | |
224 | { |
|
268 | { | |
225 | volatile unsigned char targetLogicalAddress; |
|
269 | volatile unsigned char targetLogicalAddress; | |
@@ -320,7 +364,11 struct Packet_TM_LFR_HK_str | |||||
320 | volatile unsigned char packetID[2]; |
|
364 | volatile unsigned char packetID[2]; | |
321 | volatile unsigned char packetSequenceControl[2]; |
|
365 | volatile unsigned char packetSequenceControl[2]; | |
322 | volatile unsigned char packetLength[2]; |
|
366 | volatile unsigned char packetLength[2]; | |
323 |
volatile unsigned char |
|
367 | volatile unsigned char spare1_pusVersion_spare2; | |
|
368 | volatile unsigned char serviceType; | |||
|
369 | volatile unsigned char serviceSubType; | |||
|
370 | volatile unsigned char destinationID; | |||
|
371 | volatile unsigned char time[6]; | |||
324 | volatile unsigned char sid; |
|
372 | volatile unsigned char sid; | |
325 |
|
373 | |||
326 | //************** |
|
374 | //************** |
@@ -9,13 +9,15 | |||||
9 | #include <grspw.h> |
|
9 | #include <grspw.h> | |
10 | #include <apbuart.h> |
|
10 | #include <apbuart.h> | |
11 |
|
11 | |||
12 |
#include |
|
12 | #include "fsw_params.h" | |
13 |
#include |
|
13 | #include "fsw_misc.h" | |
14 |
#include |
|
14 | #include "fsw_processing.h" | |
15 |
#include |
|
15 | #include "tc_handler.h" | |
16 |
#include |
|
16 | #include "wf_handler.h" | |
17 |
#include |
|
17 | #include "grlib_regs.h" | |
18 |
#include |
|
18 | #include "ccsds_types.h" | |
|
19 | ||||
|
20 | #include "fsw_spacewire.h" | |||
19 |
|
21 | |||
20 | extern int sched_yield( void ); |
|
22 | extern int sched_yield( void ); | |
21 | extern int errno; |
|
23 | extern int errno; | |
@@ -24,41 +26,30 extern rtems_name Task_name[ ]; /* a | |||||
24 | extern rtems_name misc_name[ ]; /* arry of miscellaneous names for rtems objects */ |
|
26 | extern rtems_name misc_name[ ]; /* arry of miscellaneous names for rtems objects */ | |
25 | extern int fdSPW; // grspw file descriptor |
|
27 | extern int fdSPW; // grspw file descriptor | |
26 | extern int fdUART; // uart file descriptor |
|
28 | extern int fdUART; // uart file descriptor | |
27 |
|
29 | extern unsigned char lfrCurrentMode; | ||
28 | void timecode_irq_handler(void *pDev, void *regs, int minor, unsigned int tc); |
|
|||
29 |
|
30 | |||
30 | // MODE PARAMETERS |
|
31 | // MODE PARAMETERS | |
31 | extern struct param_local_str param_local; |
|
32 | extern struct param_local_str param_local; | |
32 | extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet; |
|
33 | extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet; | |
33 | extern Packet_TM_LFR_HK_t housekeeping_packet; |
|
|||
34 | extern unsigned short sequenceCounters[SEQ_CNT_NB_PID][SEQ_CNT_NB_CAT][SEQ_CNT_NB_DEST_ID]; |
|
34 | extern unsigned short sequenceCounters[SEQ_CNT_NB_PID][SEQ_CNT_NB_CAT][SEQ_CNT_NB_DEST_ID]; | |
35 |
|
35 | |||
36 | // RTEMS TASKS |
|
36 | // RTEMS TASKS | |
37 | rtems_task Init( rtems_task_argument argument); /* forward declaration needed */ |
|
37 | rtems_task Init( rtems_task_argument argument); /* forward declaration needed */ | |
38 | rtems_task recv_task(rtems_task_argument argument); |
|
38 | rtems_task recv_task(rtems_task_argument argument); | |
39 | rtems_task spiq_task(rtems_task_argument argument); |
|
|||
40 | rtems_task stat_task(rtems_task_argument argument); |
|
39 | rtems_task stat_task(rtems_task_argument argument); | |
41 | rtems_task wfrm_task(rtems_task_argument argument); |
|
40 | rtems_task wfrm_task(rtems_task_argument argument); | |
42 | int create_names( void ); |
|
41 | int create_names( void ); | |
43 | int create_all_tasks( void ); |
|
42 | int create_all_tasks( void ); | |
44 | int start_all_tasks( void ); |
|
43 | int start_all_tasks( void ); | |
45 | int create_message_queue( void ); |
|
44 | int create_message_queue( void ); | |
|
45 | int create_message_queues( void ); | |||
46 |
|
46 | |||
47 | // OTHER functions |
|
47 | // OTHER functions | |
48 | void init_parameter_dump( void ); |
|
48 | void init_parameter_dump( void ); | |
49 | void init_local_mode_parameters( void ); |
|
49 | void init_local_mode_parameters( void ); | |
50 | void init_housekeeping_parameters( void ); |
|
50 | void init_housekeeping_parameters( void ); | |
51 |
|
51 | |||
52 | int spacewire_configure_link( void ); |
|
|||
53 | int spacewire_wait_for_link(void); |
|
|||
54 | void spacewire_set_NP(unsigned char val, unsigned int regAddr); // No Port force |
|
|||
55 | void spacewire_set_RE(unsigned char val, unsigned int regAddr); // RMAP Enable |
|
|||
56 | void spacewire_compute_stats_offsets(); |
|
|||
57 |
|
||||
58 | extern int rtems_cpu_usage_report( void ); |
|
52 | extern int rtems_cpu_usage_report( void ); | |
59 | extern int rtems_cpu_usage_reset( void ); |
|
53 | extern int rtems_cpu_usage_reset( void ); | |
60 |
|
54 | |||
61 | rtems_status_code write_spw(spw_ioctl_pkt_send* spw_ioctl_send); |
|
|||
62 | void (*grspw_timecode_callback) (void *pDev, void *regs, int minor, unsigned int tc); |
|
|||
63 |
|
||||
64 | #endif // FSW_RTEMS_CONFIG_H_INCLUDED |
|
55 | #endif // FSW_RTEMS_CONFIG_H_INCLUDED |
@@ -4,16 +4,16 | |||||
4 | #include <rtems.h> |
|
4 | #include <rtems.h> | |
5 | #include <stdio.h> |
|
5 | #include <stdio.h> | |
6 |
|
6 | |||
7 | #include <fsw_init.h> |
|
|||
8 | #include <fsw_params.h> |
|
|||
9 | #include <grlib_regs.h> |
|
|||
10 | #include <grspw.h> |
|
7 | #include <grspw.h> | |
11 | #include <ccsds_types.h> |
|
8 | ||
|
9 | #include "fsw_init.h" | |||
|
10 | #include "fsw_params.h" | |||
|
11 | #include "grlib_regs.h" | |||
|
12 | #include "ccsds_types.h" | |||
12 |
|
13 | |||
13 | rtems_name HK_name; // name of the HK rate monotonic |
|
14 | rtems_name HK_name; // name of the HK rate monotonic | |
14 | rtems_id HK_id; // id of the HK rate monotonic period |
|
15 | rtems_id HK_id; // id of the HK rate monotonic period | |
15 | extern spw_stats spacewire_stats; |
|
16 | extern Packet_TM_LFR_HK_t housekeeping_packet; | |
16 | extern spw_stats spacewire_stats_backup; |
|
|||
17 |
|
17 | |||
18 | int configure_timer(gptimer_regs_t *gptimer_regs, unsigned char timer, unsigned int clock_divider, |
|
18 | int configure_timer(gptimer_regs_t *gptimer_regs, unsigned char timer, unsigned int clock_divider, | |
19 | unsigned char interrupt_level, rtems_isr (*timer_isr)() ); |
|
19 | unsigned char interrupt_level, rtems_isr (*timer_isr)() ); | |
@@ -29,5 +29,6 int set_apbuart_scaler_reload_register(u | |||||
29 | // RTEMS TASKS |
|
29 | // RTEMS TASKS | |
30 | rtems_task stat_task(rtems_task_argument argument); |
|
30 | rtems_task stat_task(rtems_task_argument argument); | |
31 | rtems_task hous_task(rtems_task_argument argument); |
|
31 | rtems_task hous_task(rtems_task_argument argument); | |
|
32 | rtems_task send_task(rtems_task_argument argument); | |||
32 |
|
33 | |||
33 | #endif // FSW_MISC_H_INCLUDED |
|
34 | #endif // FSW_MISC_H_INCLUDED |
@@ -24,7 +24,6 | |||||
24 | #define RTEMS_EVENT_MODE_BURST RTEMS_EVENT_2 |
|
24 | #define RTEMS_EVENT_MODE_BURST RTEMS_EVENT_2 | |
25 | #define RTEMS_EVENT_MODE_SBM1 RTEMS_EVENT_3 |
|
25 | #define RTEMS_EVENT_MODE_SBM1 RTEMS_EVENT_3 | |
26 | #define RTEMS_EVENT_MODE_SBM2 RTEMS_EVENT_4 |
|
26 | #define RTEMS_EVENT_MODE_SBM2 RTEMS_EVENT_4 | |
27 | #define RTEMS_EVENT_MODE_NORMAL_CWF_F3 RTEMS_EVENT_5 |
|
|||
28 |
|
27 | |||
29 | //**************************** |
|
28 | //**************************** | |
30 | // LFR DEFAULT MODE PARAMETERS |
|
29 | // LFR DEFAULT MODE PARAMETERS | |
@@ -47,6 +46,11 | |||||
47 | // SBM2 |
|
46 | // SBM2 | |
48 | #define DEFAULT_SY_LFR_S2_BP_P0 1 // sec |
|
47 | #define DEFAULT_SY_LFR_S2_BP_P0 1 // sec | |
49 | #define DEFAULT_SY_LFR_S2_BP_P1 5 // sec |
|
48 | #define DEFAULT_SY_LFR_S2_BP_P1 5 // sec | |
|
49 | // ADDITIONAL PARAMETERS | |||
|
50 | #define TIME_BETWEEN_TWO_SWF_PACKETS 30 // nb x 10 ms => 300 ms | |||
|
51 | #define TIME_BETWEEN_TWO_CWF3_PACKETS 1000 // nb x 10 ms => 10 s | |||
|
52 | // | |||
|
53 | //**************************** | |||
50 |
|
54 | |||
51 | //***************************** |
|
55 | //***************************** | |
52 | // APB REGISTERS BASE ADDRESSES |
|
56 | // APB REGISTERS BASE ADDRESSES | |
@@ -106,8 +110,32 | |||||
106 | #define TASKID_HOUS 10 |
|
110 | #define TASKID_HOUS 10 | |
107 | #define TASKID_MATR 11 |
|
111 | #define TASKID_MATR 11 | |
108 | #define TASKID_CWF3 12 |
|
112 | #define TASKID_CWF3 12 | |
|
113 | #define TASKID_CWF2 13 | |||
|
114 | #define TASKID_CWF1 14 | |||
|
115 | #define TASKID_SEND 15 | |||
|
116 | ||||
|
117 | //********************************************************************* | |||
|
118 | // ALL TASKS THAT USE THE SPACEWIRE DIRVER SHALL HAVE THE SAME PRIORITY | |||
|
119 | // OR CHANGE THE SEMAPHORE CREATION IN THE DRIVER... | |||
|
120 | #define TASK_PRIORITY_SPIQ 5 | |||
|
121 | #define TASK_PRIORITY_SMIQ 10 | |||
|
122 | #define TASK_PRIORITY_SEND 11 | |||
|
123 | #define TASK_PRIORITY_RECV 12 | |||
|
124 | #define TASK_PRIORITY_ACTN 12 | |||
|
125 | #define TASK_PRIORITY_CWF1 14 | |||
|
126 | #define TASK_PRIORITY_HOUS 15 | |||
|
127 | #define TASK_PRIORITY_CWF2 15 | |||
|
128 | #define TASK_PRIORITY_WFRM 15 | |||
|
129 | #define TASK_PRIORITY_CWF3 15 | |||
|
130 | #define TASK_PRIORITY_AVF0 50 | |||
|
131 | #define TASK_PRIORITY_BPF0 50 | |||
|
132 | #define TASK_PRIORITY_MATR 250 | |||
|
133 | #define TASK_PRIORITY_STAT 251 | |||
|
134 | #define TASK_PRIORITY_DUMB 251 | |||
109 |
|
135 | |||
110 | #define ACTION_MSG_QUEUE_COUNT 10 |
|
136 | #define ACTION_MSG_QUEUE_COUNT 10 | |
|
137 | #define ACTION_MSG_PKTS_COUNT 50 | |||
|
138 | #define ACTION_MSG_PKTS_SIZE | |||
111 |
|
139 | |||
112 | //******* |
|
140 | //******* | |
113 | // MACROS |
|
141 | // MACROS | |
@@ -121,6 +149,8 | |||||
121 | #define PRINTF2(x,y,z) ; |
|
149 | #define PRINTF2(x,y,z) ; | |
122 | #endif |
|
150 | #endif | |
123 |
|
151 | |||
|
152 | #define CPU_USAGE_REPORT_PERIOD 6 // * 10 s = period | |||
|
153 | ||||
124 | #define NB_SAMPLES_PER_SNAPSHOT 2048 |
|
154 | #define NB_SAMPLES_PER_SNAPSHOT 2048 | |
125 | #define TIME_OFFSET 2 |
|
155 | #define TIME_OFFSET 2 | |
126 | #define WAVEFORM_EXTENDED_HEADER_OFFSET 22 |
|
156 | #define WAVEFORM_EXTENDED_HEADER_OFFSET 22 |
@@ -8,9 +8,12 | |||||
8 | #include <sys/ioctl.h> // for the ioctl call |
|
8 | #include <sys/ioctl.h> // for the ioctl call | |
9 | #include <ccsds_types.h> |
|
9 | #include <ccsds_types.h> | |
10 | #include <grspw.h> |
|
10 | #include <grspw.h> | |
11 | #include <fsw_init.h> |
|
11 | ||
|
12 | #include "fsw_init.h" | |||
|
13 | #include "fsw_misc.h" | |||
12 |
|
14 | |||
13 | extern int fdSPW; |
|
15 | extern int fdSPW; | |
|
16 | extern unsigned char lfrCurrentMode; | |||
14 | extern rtems_name misc_name[ ]; |
|
17 | extern rtems_name misc_name[ ]; | |
15 | extern rtems_name misc_id[ ]; |
|
18 | extern rtems_name misc_id[ ]; | |
16 | extern rtems_id Task_id[ ]; // array of task ids |
|
19 | extern rtems_id Task_id[ ]; // array of task ids | |
@@ -18,7 +21,6 extern rtems_id Task_id[ ]; // a | |||||
18 | extern struct param_sbm1_str param_sbm1; |
|
21 | extern struct param_sbm1_str param_sbm1; | |
19 | extern struct param_sbm2_str param_sbm2; |
|
22 | extern struct param_sbm2_str param_sbm2; | |
20 | extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet; |
|
23 | extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet; | |
21 | extern Packet_TM_LFR_HK_t housekeeping_packet; |
|
|||
22 | extern time_management_regs_t *time_management_regs; |
|
24 | extern time_management_regs_t *time_management_regs; | |
23 | extern waveform_picker_regs_t *waveform_picker_regs; |
|
25 | extern waveform_picker_regs_t *waveform_picker_regs; | |
24 | extern gptimer_regs_t *gptimer_regs; |
|
26 | extern gptimer_regs_t *gptimer_regs; | |
@@ -30,8 +32,10 rtems_isr commutation_isr2( rtems_vector | |||||
30 |
|
32 | |||
31 | //********************** |
|
33 | //********************** | |
32 | // GENERAL USE FUNCTIONS |
|
34 | // GENERAL USE FUNCTIONS | |
|
35 | unsigned int Crc_opt( unsigned char D, unsigned int Chk); | |||
33 | void initLookUpTableForCRC( void ); |
|
36 | void initLookUpTableForCRC( void ); | |
34 | void GetCRCAsTwoBytes(unsigned char* data, unsigned char* crcAsTwoBytes, unsigned int sizeOfData); |
|
37 | void GetCRCAsTwoBytes(unsigned char* data, unsigned char* crcAsTwoBytes, unsigned int sizeOfData); | |
|
38 | void updateLFRCurrentMode(); | |||
35 |
|
39 | |||
36 | //********************* |
|
40 | //********************* | |
37 | // ACCEPTANCE FUNCTIONS |
|
41 | // ACCEPTANCE FUNCTIONS | |
@@ -40,41 +44,40 unsigned char TC_parser(ccsdsTelecommand | |||||
40 |
|
44 | |||
41 | unsigned char TM_build_header( enum TM_TYPE tm_type, unsigned int packetLength, |
|
45 | unsigned char TM_build_header( enum TM_TYPE tm_type, unsigned int packetLength, | |
42 | TMHeader_t *TMHeader, unsigned char tc_sid); |
|
46 | TMHeader_t *TMHeader, unsigned char tc_sid); | |
43 | unsigned char TM_build_data(ccsdsTelecommandPacket_t *TC, char* data, unsigned int SID, unsigned char *computed_CRC); |
|
|||
44 |
|
47 | |||
45 | //*********** |
|
48 | //*********** | |
46 | // RTEMS TASK |
|
49 | // RTEMS TASK | |
47 | rtems_task recv_task( rtems_task_argument unused ); |
|
50 | rtems_task recv_task( rtems_task_argument unused ); | |
48 | rtems_task actn_task( rtems_task_argument unused ); |
|
51 | rtems_task actn_task( rtems_task_argument unused ); | |
49 | rtems_task dumb_task( rtems_task_argument unused ); |
|
52 | rtems_task dumb_task( rtems_task_argument unused ); | |
50 | int create_message_queue( void ); |
|
|||
51 |
|
53 | |||
52 | //*********** |
|
54 | //*********** | |
53 | // TC ACTIONS |
|
55 | // TC ACTIONS | |
54 |
int action_ |
|
56 | int action_reset(ccsdsTelecommandPacket_t *TC); | |
55 |
int action_ |
|
57 | int action_load_common_par(ccsdsTelecommandPacket_t *TC); | |
56 |
int action_ |
|
58 | int action_load_normal_par(ccsdsTelecommandPacket_t *TC); | |
|
59 | int action_load_burst_par(ccsdsTelecommandPacket_t *TC); | |||
|
60 | int action_load_sbm1_par(ccsdsTelecommandPacket_t *TC); | |||
|
61 | int action_load_sbm2_par(ccsdsTelecommandPacket_t *TC); | |||
|
62 | int action_dump_par(ccsdsTelecommandPacket_t *TC); | |||
|
63 | int action_enter_mode(ccsdsTelecommandPacket_t *TC); | |||
|
64 | int action_update_info(ccsdsTelecommandPacket_t *TC); | |||
57 | int action_enable_calibration(ccsdsTelecommandPacket_t *TC); |
|
65 | int action_enable_calibration(ccsdsTelecommandPacket_t *TC); | |
58 | int action_disable_calibration(ccsdsTelecommandPacket_t *TC); |
|
66 | int action_disable_calibration(ccsdsTelecommandPacket_t *TC); | |
59 | int action_updt_time(ccsdsTelecommandPacket_t *TC); |
|
67 | int action_update_time(ccsdsTelecommandPacket_t *TC); | |
|
68 | ||||
60 | // mode transition |
|
69 | // mode transition | |
61 | int transition_validation(unsigned char requestedMode); |
|
70 | int transition_validation(unsigned char requestedMode); | |
62 | int stop_current_mode(); |
|
71 | int stop_current_mode(); | |
63 | int enter_mode(unsigned char mode, ccsdsTelecommandPacket_t *TC); |
|
72 | int enter_mode(unsigned char mode, ccsdsTelecommandPacket_t *TC); | |
64 |
int enter_standby_mode( |
|
73 | int enter_standby_mode(); | |
65 |
int enter_normal_mode( |
|
74 | int enter_normal_mode(); | |
66 |
int enter_burst_mode( |
|
75 | int enter_burst_mode(); | |
67 |
int enter_sbm1_mode( |
|
76 | int enter_sbm1_mode(); | |
68 |
int enter_sbm2_mode( |
|
77 | int enter_sbm2_mode(); | |
69 | int restart_science_tasks(); |
|
78 | int restart_science_tasks(); | |
70 | int suspend_science_tasks(); |
|
79 | int suspend_science_tasks(); | |
71 | // parameters loading |
|
80 | ||
72 | int action_load_comm(ccsdsTelecommandPacket_t *TC); |
|
|||
73 | int action_load_norm(ccsdsTelecommandPacket_t *TC); |
|
|||
74 | int action_load_burst(ccsdsTelecommandPacket_t *TC); |
|
|||
75 | int action_load_sbm1(ccsdsTelecommandPacket_t *TC); |
|
|||
76 | int action_load_sbm2(ccsdsTelecommandPacket_t *TC); |
|
|||
77 | int action_dump(ccsdsTelecommandPacket_t *TC); |
|
|||
78 | // other functions |
|
81 | // other functions | |
79 | void update_last_TC_exe(ccsdsTelecommandPacket_t *TC); |
|
82 | void update_last_TC_exe(ccsdsTelecommandPacket_t *TC); | |
80 | void update_last_TC_rej(ccsdsTelecommandPacket_t *TC); |
|
83 | void update_last_TC_rej(ccsdsTelecommandPacket_t *TC); |
@@ -2,14 +2,16 | |||||
2 | #define WF_HANDLER_H_INCLUDED |
|
2 | #define WF_HANDLER_H_INCLUDED | |
3 |
|
3 | |||
4 | #include <rtems.h> |
|
4 | #include <rtems.h> | |
5 | #include <fsw_params.h> |
|
|||
6 | #include <grspw.h> |
|
5 | #include <grspw.h> | |
7 | #include <grlib_regs.h> |
|
6 | ||
8 | #include <ccsds_types.h> |
|
|||
9 | #include <stdio.h> |
|
7 | #include <stdio.h> | |
10 | #include <fsw_init.h> |
|
|||
11 | #include <math.h> |
|
8 | #include <math.h> | |
12 |
|
9 | |||
|
10 | #include "fsw_params.h" | |||
|
11 | #include "grlib_regs.h" | |||
|
12 | #include "ccsds_types.h" | |||
|
13 | #include "fsw_init.h" | |||
|
14 | ||||
13 | #define pi 3.1415 |
|
15 | #define pi 3.1415 | |
14 |
|
16 | |||
15 | //#include <sys/ioctl.h> |
|
17 | //#include <sys/ioctl.h> | |
@@ -17,35 +19,38 | |||||
17 | extern rtems_id Task_id[]; /* array of task ids */ |
|
19 | extern rtems_id Task_id[]; /* array of task ids */ | |
18 | extern int fdSPW; |
|
20 | extern int fdSPW; | |
19 | extern volatile int wf_snap_f0[ ]; |
|
21 | extern volatile int wf_snap_f0[ ]; | |
|
22 | // | |||
20 | extern volatile int wf_snap_f1[ ]; |
|
23 | extern volatile int wf_snap_f1[ ]; | |
21 | extern volatile int wf_snap_f1_bis[ ]; |
|
24 | extern volatile int wf_snap_f1_bis[ ]; | |
|
25 | extern volatile int wf_snap_f1_norm[ ]; | |||
|
26 | // | |||
22 | extern volatile int wf_snap_f2[ ]; |
|
27 | extern volatile int wf_snap_f2[ ]; | |
23 | extern volatile int wf_snap_f2_bis[ ]; |
|
28 | extern volatile int wf_snap_f2_bis[ ]; | |
|
29 | extern volatile int wf_snap_f2_norm[ ]; | |||
|
30 | // | |||
24 | extern volatile int wf_cont_f3[ ]; |
|
31 | extern volatile int wf_cont_f3[ ]; | |
25 | extern volatile int wf_cont_f3_bis[ ]; |
|
32 | extern volatile int wf_cont_f3_bis[ ]; | |
26 | extern waveform_picker_regs_t *waveform_picker_regs; |
|
33 | extern waveform_picker_regs_t *waveform_picker_regs; | |
|
34 | extern unsigned char lfrCurrentMode; | |||
27 |
|
35 | |||
28 | rtems_isr waveforms_isr( rtems_vector_number vector ); |
|
36 | rtems_isr waveforms_isr( rtems_vector_number vector ); | |
29 | rtems_isr waveforms_simulator_isr( rtems_vector_number vector ); |
|
37 | rtems_isr waveforms_simulator_isr( rtems_vector_number vector ); | |
30 | rtems_task wfrm_task(rtems_task_argument argument); |
|
38 | rtems_task wfrm_task(rtems_task_argument argument); | |
31 | rtems_task cwf3_task(rtems_task_argument argument); |
|
39 | rtems_task cwf3_task(rtems_task_argument argument); | |
|
40 | rtems_task cwf2_task(rtems_task_argument argument); | |||
|
41 | rtems_task cwf1_task(rtems_task_argument argument); | |||
32 |
|
42 | |||
33 | //****************** |
|
43 | //****************** | |
34 | // general functions |
|
44 | // general functions | |
35 | void init_waveforms( void ); |
|
45 | void init_waveforms( void ); | |
36 | void init_header_snapshot_wf( Header_TM_LFR_SCIENCE_SWF_t *header ); |
|
46 | // | |
37 | void init_header_continuous_wf( Header_TM_LFR_SCIENCE_CWF_t *header ); |
|
47 | int init_header_snapshot_wf_table( unsigned int sid ); | |
|
48 | int init_header_continuous_wf_table(unsigned int sid , Header_TM_LFR_SCIENCE_CWF_t *headerCWF); | |||
|
49 | // | |||
38 | void reset_waveforms( void ); |
|
50 | void reset_waveforms( void ); | |
39 | void send_waveform_norm( Header_TM_LFR_SCIENCE_SWF_t *header, spw_ioctl_pkt_send *spw_ioctl_send ); |
|
|||
40 | void send_waveform_burst( Header_TM_LFR_SCIENCE_CWF_t *header, spw_ioctl_pkt_send *spw_ioctl_send ); |
|
|||
41 | void send_waveform_sbm1( Header_TM_LFR_SCIENCE_CWF_t *header, spw_ioctl_pkt_send *spw_ioctl_send ); |
|
|||
42 | void send_waveform_sbm2( Header_TM_LFR_SCIENCE_CWF_t *header, spw_ioctl_pkt_send *spw_ioctl_send ); |
|
|||
43 | void send_waveform_norm_cwf_f3(Header_TM_LFR_SCIENCE_CWF_t *header, spw_ioctl_pkt_send *spw_ioctl_send ); |
|
|||
44 |
|
51 | |||
45 | void send_waveform_SWF( Header_TM_LFR_SCIENCE_SWF_t *header, volatile int *waveform, |
|
52 | int send_waveform_SWF(volatile int *waveform, unsigned int sid); | |
46 | unsigned int sid, spw_ioctl_pkt_send *spw_ioctl_send ); |
|
53 | int send_waveform_CWF(volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF); | |
47 | void send_waveform_CWF( Header_TM_LFR_SCIENCE_CWF_t *header, volatile int *waveform, |
|
|||
48 | unsigned int sid, spw_ioctl_pkt_send *spw_ioctl_send ); |
|
|||
49 |
|
54 | |||
50 | //************** |
|
55 | //************** | |
51 | // wfp registers |
|
56 | // wfp registers | |
@@ -53,6 +58,7 void set_wfp_data_shaping(); | |||||
53 | char set_wfp_delta_snapshot(); |
|
58 | char set_wfp_delta_snapshot(); | |
54 | void set_wfp_burst_enable_register( unsigned char mode); |
|
59 | void set_wfp_burst_enable_register( unsigned char mode); | |
55 | void reset_wfp_burst_enable(); |
|
60 | void reset_wfp_burst_enable(); | |
|
61 | void reset_wfp_status(); | |||
56 | void reset_waveform_picker_regs(); |
|
62 | void reset_waveform_picker_regs(); | |
57 |
|
63 | |||
58 | //***************** |
|
64 |