##// END OF EJS Templates

Compare Commits r69:db74b38fe91c...r75:f5b83fb540b1

Target:

Source:

Compare was calculated based on this common ancestor commit: e904b329ff97
Time Author Commit Description
7 commits hidden, click expand to show them.
@@ -1,3 +1,27
1 /*------------------------------------------------------------------------------
2 -- Solar Orbiter's Low Frequency Receiver Flight Software (LFR FSW),
3 -- This file is a part of the LFR FSW
4 -- Copyright (C) 2012-2018, Plasma Physics Laboratory - CNRS
5 --
6 -- This program is free software; you can redistribute it and/or modify
7 -- it under the terms of the GNU General Public License as published by
8 -- the Free Software Foundation; either version 2 of the License, or
9 -- (at your option) any later version.
10 --
11 -- This program is distributed in the hope that it will be useful,
12 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
13 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 -- GNU General Public License for more details.
15 --
16 -- You should have received a copy of the GNU General Public License
17 -- along with this program; if not, write to the Free Software
18 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 -------------------------------------------------------------------------------*/
20 /*-- Author : Paul Leroy
21 -- Contact : Alexis Jeandet
22 -- Mail : alexis.jeandet@lpp.polytechnique.fr
23 ----------------------------------------------------------------------------*/
24
1 #ifndef CCSDS_TYPES_H_INCLUDED
25 #ifndef CCSDS_TYPES_H_INCLUDED
2 #define CCSDS_TYPES_H_INCLUDED
26 #define CCSDS_TYPES_H_INCLUDED
3
27
@@ -18,15 +42,11
18 #define CCSDS_PROTOCOLE_EXTRA_BYTES 4
42 #define CCSDS_PROTOCOLE_EXTRA_BYTES 4
19 #define CCSDS_TC_TM_PACKET_OFFSET 7
43 #define CCSDS_TC_TM_PACKET_OFFSET 7
20 #define PROTID_RES_APP 3
44 #define PROTID_RES_APP 3
21 #define CCSDS_TELEMETRY_HEADER_LENGTH (16+4)
22 #define CCSDS_TC_HEADER_LENGTH 10
45 #define CCSDS_TC_HEADER_LENGTH 10
23 #define CCSDS_TM_PKT_MAX_SIZE 4412
24 #define CCSDS_TELECOMMAND_HEADER_LENGTH (10+4)
25 #define CCSDS_TC_PKT_MAX_SIZE 232 // (228+3) with 3 for Prot ID, Reserved and User App bytes, SHALL BE A MULTIPLE OF 4
46 #define CCSDS_TC_PKT_MAX_SIZE 232 // (228+3) with 3 for Prot ID, Reserved and User App bytes, SHALL BE A MULTIPLE OF 4
26 #define CCSDS_TC_PKT_MIN_SIZE 16
47 #define CCSDS_TC_PKT_MIN_SIZE 16
27 #define CCSDS_PROCESS_ID 76
48 #define CCSDS_PROCESS_ID 76
28 #define CCSDS_PACKET_CATEGORY 12
49 #define CCSDS_PACKET_CATEGORY 12
29 #define CCSDS_NODE_ADDRESS 0xfe
30 #define CCSDS_USER_APP 0x00
50 #define CCSDS_USER_APP 0x00
31
51
32 #define DEFAULT_SPARE1_PUSVERSION_SPARE2 0x10
52 #define DEFAULT_SPARE1_PUSVERSION_SPARE2 0x10
@@ -34,25 +54,13
34 #define DEFAULT_HKBIA 0x1e // 0001 1110
54 #define DEFAULT_HKBIA 0x1e // 0001 1110
35
55
36 // PACKET ID
56 // PACKET ID
37 #define TM_PACKET_PID_DEFAULT 76
38 #define TM_PACKET_PID_BURST_SBM1_SBM2 79
39 #define APID_TM_TC_EXE 0x0cc1 // PID 76 CAT 1
57 #define APID_TM_TC_EXE 0x0cc1 // PID 76 CAT 1
40 #define APID_TM_HK 0x0cc4 // PID 76 CAT 4
58 #define APID_TM_HK 0x0cc4 // PID 76 CAT 4
41 #define APID_TM_SCIENCE_NORMAL_BURST 0x0ccc // PID 76 CAT 12
59 #define APID_TM_SCIENCE_NORMAL_BURST 0x0ccc // PID 76 CAT 12
42 #define APID_TM_SCIENCE_SBM1_SBM2 0x0cfc // PID 79 CAT 12
60 #define APID_TM_SCIENCE_SBM1_SBM2 0x0cfc // PID 79 CAT 12
43 #define APID_TM_PARAMETER_DUMP 0x0cc6 // PID 76 CAT 6
61 #define APID_TM_PARAMETER_DUMP 0x0cc6 // PID 76 CAT 6
44 #define APID_TM_KCOEFFICIENTS_DUMP 0x0cc6 // PID 76 CAT 6
45
46 // PACKET CAT
47 #define TM_PACKET_CAT_TC_EXE 1
48 #define TM_PACKET_CAT_HK 4
49 #define TM_PACKET_CAT_SCIENCE 12
50 #define TM_PACKET_CAT_DUMP 6
51
62
52 // PACKET SEQUENCE CONTROL
63 // PACKET SEQUENCE CONTROL
53 #define TM_PACKET_SEQ_CTRL_CONTINUATION 0x00 // [0000 0000]
54 #define TM_PACKET_SEQ_CTRL_FIRST 0x40 // [0100 0000]
55 #define TM_PACKET_SEQ_CTRL_LAST 0x80 // [1000 0000]
56 #define TM_PACKET_SEQ_CTRL_STANDALONE 0xc0 // [1100 0000]
64 #define TM_PACKET_SEQ_CTRL_STANDALONE 0xc0 // [1100 0000]
57 #define TM_PACKET_SEQ_CNT_DEFAULT 0x00 // [0000 0000]
65 #define TM_PACKET_SEQ_CNT_DEFAULT 0x00 // [0000 0000]
58 #define TM_PACKET_SEQ_SHIFT 8
66 #define TM_PACKET_SEQ_SHIFT 8
@@ -62,16 +70,6
62
70
63 // DESTINATION ID
71 // DESTINATION ID
64 #define TM_DESTINATION_ID_GROUND 0
72 #define TM_DESTINATION_ID_GROUND 0
65 #define TM_DESTINATION_ID_MISSION_TIMELINE 110
66 #define TM_DESTINATION_ID_TC_SEQUENCES 111
67 #define TM_DESTINATION_ID_RECOVERY_ACTION_COMMAND 112
68 #define TM_DESTINATION_ID_BACKUP_MISSION_TIMELINE 113
69 #define TM_DESTINATION_ID_DIRECT_CMD 120
70 #define TM_DESTINATION_ID_SPARE_GRD_SRC1 121
71 #define TM_DESTINATION_ID_SPARE_GRD_SRC2 122
72 #define TM_DESTINATION_ID_OBCP 15
73 #define TM_DESTINATION_ID_SYSTEM_CONTROL 14
74 #define TM_DESTINATION_ID_AOCS 11
75
73
76 //*********************************************************
74 //*********************************************************
77 //*** /!\ change CCSDS_DESTINATION_ID before flight /!\ ***
75 //*** /!\ change CCSDS_DESTINATION_ID before flight /!\ ***
@@ -85,10 +83,6
85 #define CCSDS_RESERVED 0x00
83 #define CCSDS_RESERVED 0x00
86 #define CCSDS_USER_APP 0x00
84 #define CCSDS_USER_APP 0x00
87
85
88 #define SIZE_TM_LFR_TC_EXE_NOT_IMPLEMENTED 24
89 #define SIZE_TM_LFR_TC_EXE_CORRUPTED 32
90 #define SIZE_HK_PARAMETERS 112
91
92 // TC TYPES
86 // TC TYPES
93 #define TC_TYPE_GEN 181
87 #define TC_TYPE_GEN 181
94 #define TC_TYPE_TIME 9
88 #define TC_TYPE_TIME 9
@@ -159,7 +153,6
159 #define WRONG_SRC_ID 42001 // 0xa4 0x11
153 #define WRONG_SRC_ID 42001 // 0xa4 0x11
160 #define FUNCT_NOT_IMPL 42002 // 0xa4 0x12
154 #define FUNCT_NOT_IMPL 42002 // 0xa4 0x12
161 #define FAIL_DETECTED 42003 // 0xa4 0x13
155 #define FAIL_DETECTED 42003 // 0xa4 0x13
162 #define NOT_ALLOWED 42004 // 0xa4 0x14
163 #define CORRUPTED 42005 // 0xa4 0x15
156 #define CORRUPTED 42005 // 0xa4 0x15
164 #define CCSDS_TM_VALID 7
157 #define CCSDS_TM_VALID 7
165
158
@@ -251,7 +244,6 enum apid_destid{
251 #define SID_K_DUMP 11
244 #define SID_K_DUMP 11
252
245
253 // HEADER_LENGTH
246 // HEADER_LENGTH
254 //#define TM_HEADER_LEN 16
255 #define HEADER_LENGTH_TM_LFR_SCIENCE_CWF 32
247 #define HEADER_LENGTH_TM_LFR_SCIENCE_CWF 32
256 #define HEADER_LENGTH_TM_LFR_SCIENCE_SWF 34
248 #define HEADER_LENGTH_TM_LFR_SCIENCE_SWF 34
257 #define HEADER_LENGTH_TM_LFR_SCIENCE_ASM 34
249 #define HEADER_LENGTH_TM_LFR_SCIENCE_ASM 34
@@ -264,7 +256,6 enum apid_destid{
264 #define PACKET_LENGTH_TC_EXE_CORRUPTED (32 - CCSDS_TC_TM_PACKET_OFFSET)
256 #define PACKET_LENGTH_TC_EXE_CORRUPTED (32 - CCSDS_TC_TM_PACKET_OFFSET)
265 #define PACKET_LENGTH_HK (136 - CCSDS_TC_TM_PACKET_OFFSET)
257 #define PACKET_LENGTH_HK (136 - CCSDS_TC_TM_PACKET_OFFSET)
266 #define PACKET_LENGTH_PARAMETER_DUMP (212 - CCSDS_TC_TM_PACKET_OFFSET)
258 #define PACKET_LENGTH_PARAMETER_DUMP (212 - CCSDS_TC_TM_PACKET_OFFSET)
267 #define PACKET_LENGTH_K_DUMP (3920 - CCSDS_TC_TM_PACKET_OFFSET)
268 // SCIENCE ASM
259 // SCIENCE ASM
269 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F0_1 (3230 - CCSDS_TC_TM_PACKET_OFFSET) // 32 * 25 * 4 + 30 => 32 bins (32 + 32 + 24 ), 3 packets
260 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F0_1 (3230 - CCSDS_TC_TM_PACKET_OFFSET) // 32 * 25 * 4 + 30 => 32 bins (32 + 32 + 24 ), 3 packets
270 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F0_2 (2430 - CCSDS_TC_TM_PACKET_OFFSET) // 24 * 25 * 4 + 30 => 24 bins (32 + 32 + 24 ), 3 packets
261 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F0_2 (2430 - CCSDS_TC_TM_PACKET_OFFSET) // 24 * 25 * 4 + 30 => 24 bins (32 + 32 + 24 ), 3 packets
@@ -636,9 +627,7 typedef struct {
636 #define STATUS_WORD_LINK_STATE_BITS 0x07 // [0000 0111]
627 #define STATUS_WORD_LINK_STATE_BITS 0x07 // [0000 0111]
637 #define STATUS_WORD_LINK_STATE_MASK 0xf8 // [1111 1000]
628 #define STATUS_WORD_LINK_STATE_MASK 0xf8 // [1111 1000]
638 #define STATUS_WORD_LFR_MODE_SHIFT 4
629 #define STATUS_WORD_LFR_MODE_SHIFT 4
639 #define STATUS_WORD_LFR_MODE_BITS 0xf0 // [1111 0000]
640 #define STATUS_WORD_LFR_MODE_MASK 0x0f // [0000 1111]
630 #define STATUS_WORD_LFR_MODE_MASK 0x0f // [0000 1111]
641 #define STATUS_WORD_0_DEFAULT 0x0d // [0000 1101]
642
631
643 typedef struct {
632 typedef struct {
644 unsigned char targetLogicalAddress;
633 unsigned char targetLogicalAddress;
@@ -1,3 +1,27
1 /*------------------------------------------------------------------------------
2 -- Solar Orbiter's Low Frequency Receiver Flight Software (LFR FSW),
3 -- This file is a part of the LFR FSW
4 -- Copyright (C) 2012-2018, Plasma Physics Laboratory - CNRS
5 --
6 -- This program is free software; you can redistribute it and/or modify
7 -- it under the terms of the GNU General Public License as published by
8 -- the Free Software Foundation; either version 2 of the License, or
9 -- (at your option) any later version.
10 --
11 -- This program is distributed in the hope that it will be useful,
12 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
13 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 -- GNU General Public License for more details.
15 --
16 -- You should have received a copy of the GNU General Public License
17 -- along with this program; if not, write to the Free Software
18 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 -------------------------------------------------------------------------------*/
20 /*-- Author : Paul Leroy
21 -- Contact : Alexis Jeandet
22 -- Mail : alexis.jeandet@lpp.polytechnique.fr
23 ----------------------------------------------------------------------------*/
24
1 #ifndef FSW_PARAMS_H_INCLUDED
25 #ifndef FSW_PARAMS_H_INCLUDED
2 #define FSW_PARAMS_H_INCLUDED
26 #define FSW_PARAMS_H_INCLUDED
3
27
@@ -7,8 +31,30
7 #include "ccsds_types.h"
31 #include "ccsds_types.h"
8 #include "stdint.h"
32 #include "stdint.h"
9
33
34 /*
35 * RTEMS CONFIG
36 *
37 */
10 #define GRSPW_DEVICE_NAME "/dev/grspw0"
38 #define GRSPW_DEVICE_NAME "/dev/grspw0"
11 #define UART_DEVICE_NAME "/dev/console"
39
40 #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
41 #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
42
43 #define CONFIGURE_MAXIMUM_TASKS 23 // number of tasks concurrently active including INIT
44 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
45 #define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE)
46 #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 32
47 #define CONFIGURE_INIT_TASK_PRIORITY 1 // instead of 100
48 #define CONFIGURE_INIT_TASK_MODE (RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT)
49 #define CONFIGURE_INIT_TASK_ATTRIBUTES (RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT)
50 #define CONFIGURE_MAXIMUM_DRIVERS 16
51 #define CONFIGURE_MAXIMUM_PERIODS 6 // [hous] [load] [avgv]
52 #define CONFIGURE_MAXIMUM_TIMERS 6 // [spiq] [link] [spacewire_reset_link]
53 #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 5
54 #ifdef PRINT_STACK_REPORT
55 #define CONFIGURE_STACK_CHECKER_ENABLED
56 #endif
57
12
58
13 //*******
59 //*******
14 // MACROS
60 // MACROS
@@ -46,10 +92,10
46 #define CONST_2048 2048 // 2^11
92 #define CONST_2048 2048 // 2^11
47 #define CONST_512 512 // 2^9
93 #define CONST_512 512 // 2^9
48 #define CONST_256 256 // 2^8
94 #define CONST_256 256 // 2^8
49 #define CONST_128 128 // 2^7
95 #ifndef UINT8_MAX
50 #define UINT8_MAX 255
96 #define UINT8_MAX 255
97 #endif
51
98
52 #define FLOAT_MSBYTE 0
53 #define FLOAT_LSBYTE 3
99 #define FLOAT_LSBYTE 3
54 #define BITS_PER_BYTE 8
100 #define BITS_PER_BYTE 8
55 #define INIT_FLOAT 0.
101 #define INIT_FLOAT 0.
@@ -68,7 +114,6
68 #define SHIFT_3_BITS 3
114 #define SHIFT_3_BITS 3
69 #define SHIFT_4_BITS 4
115 #define SHIFT_4_BITS 4
70 #define SHIFT_5_BITS 5
116 #define SHIFT_5_BITS 5
71 #define SHIFT_6_BITS 6
72 #define SHIFT_7_BITS 7
117 #define SHIFT_7_BITS 7
73 #define BYTE_0 0
118 #define BYTE_0 0
74 #define BYTE_1 1
119 #define BYTE_1 1
@@ -110,12 +155,9 typedef struct ring_node
110 #define NB_PACKETS_PER_GROUP_OF_CWF_LIGHT 4 // 4 packets containing 672 blk
155 #define NB_PACKETS_PER_GROUP_OF_CWF_LIGHT 4 // 4 packets containing 672 blk
111 #define NB_SAMPLES_PER_SNAPSHOT 2688 // 336 * 8 = 672 * 4 = 2688
156 #define NB_SAMPLES_PER_SNAPSHOT 2688 // 336 * 8 = 672 * 4 = 2688
112 #define TIME_OFFSET 2
157 #define TIME_OFFSET 2
113 #define TIME_OFFSET_IN_BYTES 8
114 //#define WAVEFORM_EXTENDED_HEADER_OFFSET 22
115 #define NB_BYTES_SWF_BLK (2 * 6)
158 #define NB_BYTES_SWF_BLK (2 * 6)
116 #define NB_WORDS_SWF_BLK 3
159 #define NB_WORDS_SWF_BLK 3
117 #define NB_BYTES_CWF3_LIGHT_BLK 6
160 #define NB_BYTES_CWF3_LIGHT_BLK 6
118 //#define WFRM_INDEX_OF_LAST_PACKET 6 // waveforms are transmitted in groups of 2048 blocks, 6 packets of 340 and 1 of 8
119 #define NB_RING_NODES_F0 3 // AT LEAST 3
161 #define NB_RING_NODES_F0 3 // AT LEAST 3
120 #define NB_RING_NODES_F1 5 // AT LEAST 3
162 #define NB_RING_NODES_F1 5 // AT LEAST 3
121 #define NB_RING_NODES_F2 5 // AT LEAST 3
163 #define NB_RING_NODES_F2 5 // AT LEAST 3
@@ -140,10 +182,8 typedef struct ring_node
140 #define THR_MODE_NORMAL 1
182 #define THR_MODE_NORMAL 1
141 #define THR_MODE_BURST 2
183 #define THR_MODE_BURST 2
142
184
143 #define RTEMS_EVENT_MODE_STANDBY RTEMS_EVENT_0
144 #define RTEMS_EVENT_MODE_NORMAL RTEMS_EVENT_1
185 #define RTEMS_EVENT_MODE_NORMAL RTEMS_EVENT_1
145 #define RTEMS_EVENT_MODE_BURST RTEMS_EVENT_2
186 #define RTEMS_EVENT_MODE_BURST RTEMS_EVENT_2
146 #define RTEMS_EVENT_MODE_SBM1 RTEMS_EVENT_3
147 #define RTEMS_EVENT_MODE_SBM2 RTEMS_EVENT_4
187 #define RTEMS_EVENT_MODE_SBM2 RTEMS_EVENT_4
148 #define RTEMS_EVENT_MODE_NORM_S1_S2 RTEMS_EVENT_5
188 #define RTEMS_EVENT_MODE_NORM_S1_S2 RTEMS_EVENT_5
149 #define RTEMS_EVENT_NORM_BP1_F0 RTEMS_EVENT_6
189 #define RTEMS_EVENT_NORM_BP1_F0 RTEMS_EVENT_6
@@ -164,6 +204,7 typedef struct ring_node
164 #define RTEMS_EVENT_BURST_BP1_F1 RTEMS_EVENT_21
204 #define RTEMS_EVENT_BURST_BP1_F1 RTEMS_EVENT_21
165 #define RTEMS_EVENT_BURST_BP2_F1 RTEMS_EVENT_22
205 #define RTEMS_EVENT_BURST_BP2_F1 RTEMS_EVENT_22
166 #define RTEMS_EVENT_SWF_RESYNCH RTEMS_EVENT_23
206 #define RTEMS_EVENT_SWF_RESYNCH RTEMS_EVENT_23
207 #define RTEMS_EVENT_CAL_SWEEP_WAKE RTEMS_EVENT_24
167
208
168 //********************************************
209 //********************************************
169 //********************************************
210 //********************************************
@@ -183,7 +224,6 typedef struct ring_node
183 #define DFLT_SY_LFR_N_BP_P0 4 // sec
224 #define DFLT_SY_LFR_N_BP_P0 4 // sec
184 #define DFLT_SY_LFR_N_BP_P1 20 // sec
225 #define DFLT_SY_LFR_N_BP_P1 20 // sec
185 #define DFLT_SY_LFR_N_CWF_LONG_F3 0 // 0 => production of light continuous waveforms at f3
226 #define DFLT_SY_LFR_N_CWF_LONG_F3 0 // 0 => production of light continuous waveforms at f3
186 #define MIN_DELTA_SNAPSHOT 16 // sec
187
227
188 // BURST
228 // BURST
189 #define DEFAULT_SY_LFR_B_BP_P0 1 // sec
229 #define DEFAULT_SY_LFR_B_BP_P0 1 // sec
@@ -198,10 +238,6 typedef struct ring_node
198 #define DEFAULT_SY_LFR_S2_BP_P0 1 // sec
238 #define DEFAULT_SY_LFR_S2_BP_P0 1 // sec
199 #define DEFAULT_SY_LFR_S2_BP_P1 5 // sec
239 #define DEFAULT_SY_LFR_S2_BP_P1 5 // sec
200
240
201 // ADDITIONAL PARAMETERS
202 #define TIME_BETWEEN_TWO_SWF_PACKETS 30 // nb x 10 ms => 300 ms
203 #define TIME_BETWEEN_TWO_CWF3_PACKETS 1000 // nb x 10 ms => 10 s
204
205 // STATUS WORD
241 // STATUS WORD
206 #define DEFAULT_STATUS_WORD_BYTE0 0x0d // [0000] [1] [101] mode 4 bits / SPW enabled 1 bit / state is run 3 bits
242 #define DEFAULT_STATUS_WORD_BYTE0 0x0d // [0000] [1] [101] mode 4 bits / SPW enabled 1 bit / state is run 3 bits
207
243
@@ -216,7 +252,6 typedef struct ring_node
216 #define MIN_PAS_FILTER_SHIFT 0.0
252 #define MIN_PAS_FILTER_SHIFT 0.0
217 #define MAX_PAS_FILTER_SHIFT 1.0
253 #define MAX_PAS_FILTER_SHIFT 1.0
218 #define MIN_SY_LFR_SC_RW_DELTA_F 0
254 #define MIN_SY_LFR_SC_RW_DELTA_F 0
219 #define MIN_SY_LFR_RW_K 0
220 #define MIN_SY_LFR_RW_F 0
255 #define MIN_SY_LFR_RW_F 0
221 //
256 //
222 #define SY_LFR_DPU_CONNECT_TIMEOUT 100 // 100 * 10 ms = 1 s
257 #define SY_LFR_DPU_CONNECT_TIMEOUT 100 // 100 * 10 ms = 1 s
@@ -231,17 +266,15 typedef struct ring_node
231 #define APB_OFFSET_GRSPW_STATUS_REGISTER 0x04
266 #define APB_OFFSET_GRSPW_STATUS_REGISTER 0x04
232 #define APB_OFFSET_GRSPW_TIME_REGISTER 0x14
267 #define APB_OFFSET_GRSPW_TIME_REGISTER 0x14
233 #define REGS_ADDR_TIME_MANAGEMENT 0x80000600
268 #define REGS_ADDR_TIME_MANAGEMENT 0x80000600
234 #define REGS_ADDR_GRGPIO 0x80000b00
235
269
236 #define REGS_ADDR_SPECTRAL_MATRIX 0x80000f00
270 #define REGS_ADDR_SPECTRAL_MATRIX 0x80000f00
237 #define REGS_ADDR_WAVEFORM_PICKER 0x80000f54 // PDB >= 0.1.28
271 #define REGS_ADDR_WAVEFORM_PICKER 0x80000f54 // PDB >= 0.1.28
238 #define APB_OFFSET_VHDL_REV 0xb0
272 #define APB_OFFSET_VHDL_REV 0xb0
239 #define REGS_ADDR_VHDL_VERSION 0x80000ff0
273 #define REGS_ADDR_VHDL_VERSION 0x80000ff0
240
274
241 #define APBUART_CTRL_REG_MASK_DB 0xfffff7ff
242 #define APBUART_CTRL_REG_MASK_TE 0x00000002
275 #define APBUART_CTRL_REG_MASK_TE 0x00000002
243 // scaler value = system_clock_frequency / ( baud_rate * 8 ) - 1
276 // scaler value = system_clock_frequency / ( baud_rate * 8 ) - 1
244 #define APBUART_SCALER_RELOAD_VALUE 0x00000050 // 25 MHz => about 38400
277 #define APBUART_SCALER_RELOAD_VALUE 0x0000001B // 25 MHz => about 115200
245
278
246 //**********
279 //**********
247 // IRQ LINES
280 // IRQ LINES
@@ -271,7 +304,6 typedef struct ring_node
271 #define LFR_SUCCESSFUL 0
304 #define LFR_SUCCESSFUL 0
272 #define LFR_DEFAULT 1
305 #define LFR_DEFAULT 1
273 #define LFR_EXE_ERROR 2
306 #define LFR_EXE_ERROR 2
274 #define LFR_DEFAULT_ALT -1
275
307
276 //******
308 //******
277 // RTEMS
309 // RTEMS
@@ -297,6 +329,8 typedef struct ring_node
297 #define TASKID_PRC1 17
329 #define TASKID_PRC1 17
298 #define TASKID_AVF2 18
330 #define TASKID_AVF2 18
299 #define TASKID_PRC2 19
331 #define TASKID_PRC2 19
332 #define TASKID_SCRB 20
333 #define TASKID_CALI 21
300
334
301 #define TASK_PRIORITY_SPIQ 5
335 #define TASK_PRIORITY_SPIQ 5
302 #define TASK_PRIORITY_LINK 20
336 #define TASK_PRIORITY_LINK 20
@@ -309,6 +343,7 typedef struct ring_node
309 #define TASK_PRIORITY_CWF3 40 // there is a printf in this function, be careful with its priority wrt CWF1
343 #define TASK_PRIORITY_CWF3 40 // there is a printf in this function, be careful with its priority wrt CWF1
310 #define TASK_PRIORITY_SEND 45
344 #define TASK_PRIORITY_SEND 45
311 #define TASK_PRIORITY_RECV 50
345 #define TASK_PRIORITY_RECV 50
346 #define TASK_PRIORITY_CALI 50
312 #define TASK_PRIORITY_ACTN 50
347 #define TASK_PRIORITY_ACTN 50
313 #define TASK_PRIORITY_AVF0 60
348 #define TASK_PRIORITY_AVF0 60
314 #define TASK_PRIORITY_AVF1 70
349 #define TASK_PRIORITY_AVF1 70
@@ -318,6 +353,7 typedef struct ring_node
318 #define TASK_PRIORITY_PRC2 110
353 #define TASK_PRIORITY_PRC2 110
319 #define TASK_PRIORITY_LOAD 190
354 #define TASK_PRIORITY_LOAD 190
320 #define TASK_PRIORITY_DUMB 200
355 #define TASK_PRIORITY_DUMB 200
356 #define TASK_PRIORITY_SCRB 210
321
357
322 #define MSG_QUEUE_COUNT_RECV 10
358 #define MSG_QUEUE_COUNT_RECV 10
323 #define MSG_QUEUE_COUNT_SEND 50
359 #define MSG_QUEUE_COUNT_SEND 50
@@ -325,7 +361,6 typedef struct ring_node
325 #define MSG_QUEUE_COUNT_PRC1 10
361 #define MSG_QUEUE_COUNT_PRC1 10
326 #define MSG_QUEUE_COUNT_PRC2 5
362 #define MSG_QUEUE_COUNT_PRC2 5
327 #define MSG_QUEUE_SIZE_SEND 812 // 808 + 4 => TM_LFR_SCIENCE_BURST_BP2_F1
363 #define MSG_QUEUE_SIZE_SEND 812 // 808 + 4 => TM_LFR_SCIENCE_BURST_BP2_F1
328 #define ACTION_MSG_SPW_IOCTL_SEND_SIZE 24 // hlen *hdr dlen *data sent options
329 #define MSG_QUEUE_SIZE_PRC0 36 // two pointers, one rtems_event + 6 integers
364 #define MSG_QUEUE_SIZE_PRC0 36 // two pointers, one rtems_event + 6 integers
330 #define MSG_QUEUE_SIZE_PRC1 36 // two pointers, one rtems_event + 6 integers
365 #define MSG_QUEUE_SIZE_PRC1 36 // two pointers, one rtems_event + 6 integers
331 #define MSG_QUEUE_SIZE_PRC2 36 // two pointers, one rtems_event + 6 integers
366 #define MSG_QUEUE_SIZE_PRC2 36 // two pointers, one rtems_event + 6 integers
@@ -336,8 +371,6 typedef struct ring_node
336 #define QUEUE_PRC1 3
371 #define QUEUE_PRC1 3
337 #define QUEUE_PRC2 4
372 #define QUEUE_PRC2 4
338
373
339 #define CPU_USAGE_REPORT_PERIOD 6 // * 10 s = period
340
341 struct param_local_str{
374 struct param_local_str{
342 unsigned int local_sbm1_nb_cwf_sent;
375 unsigned int local_sbm1_nb_cwf_sent;
343 unsigned int local_sbm1_nb_cwf_max;
376 unsigned int local_sbm1_nb_cwf_max;
@@ -358,18 +391,18 typedef struct {
358
391
359 #define DEFAULT_SY_LFR_PAS_FILTER_ENABLED 0
392 #define DEFAULT_SY_LFR_PAS_FILTER_ENABLED 0
360 #define DEFAULT_SY_LFR_PAS_FILTER_MODULUS 4
393 #define DEFAULT_SY_LFR_PAS_FILTER_MODULUS 4
361 #define DEFAULT_SY_LFR_PAS_FILTER_TBAD 1.0
394 #define DEFAULT_SY_LFR_PAS_FILTER_TBAD 1.0f
362 #define DEFAULT_SY_LFR_PAS_FILTER_OFFSET 0
395 #define DEFAULT_SY_LFR_PAS_FILTER_OFFSET 0
363 #define DEFAULT_SY_LFR_PAS_FILTER_SHIFT 0.5
396 #define DEFAULT_SY_LFR_PAS_FILTER_SHIFT 0.5f
364 #define DEFAULT_MODULUS 262144 // 65536 * 4
397 #define DEFAULT_MODULUS 262144 // 65536 * 4
365 #define DEFAULT_TBAD 65536 // 65536
398 #define DEFAULT_TBAD 65536 // 65536
366 #define DEFAULT_OFFSET 0 // 65536 * 0
399 #define DEFAULT_OFFSET 0 // 65536 * 0
367 #define DEFAULT_SHIFT 32768 // 65536 / 2
400 #define DEFAULT_SHIFT 32768 // 65536 / 2
368 #define DEFAULT_SY_LFR_SC_RW_DELTA_F 0.045
401 #define DEFAULT_SY_LFR_SC_RW_DELTA_F 0.045f
369 #define DEFAULT_SY_LFR_RW_K1 1.
402 #define DEFAULT_SY_LFR_RW_K1 1.f
370 #define DEFAULT_SY_LFR_RW_K2 8.
403 #define DEFAULT_SY_LFR_RW_K2 8.f
371 #define DEFAULT_SY_LFR_RW_K3 24.
404 #define DEFAULT_SY_LFR_RW_K3 24.f
372 #define DEFAULT_SY_LFR_RW_K4 48.
405 #define DEFAULT_SY_LFR_RW_K4 48.f
373
406
374 typedef struct{
407 typedef struct{
375 unsigned char spare_sy_lfr_pas_filter_enabled;
408 unsigned char spare_sy_lfr_pas_filter_enabled;
@@ -1,3 +1,27
1 /*------------------------------------------------------------------------------
2 -- Solar Orbiter's Low Frequency Receiver Flight Software (LFR FSW),
3 -- This file is a part of the LFR FSW
4 -- Copyright (C) 2012-2018, Plasma Physics Laboratory - CNRS
5 --
6 -- This program is free software; you can redistribute it and/or modify
7 -- it under the terms of the GNU General Public License as published by
8 -- the Free Software Foundation; either version 2 of the License, or
9 -- (at your option) any later version.
10 --
11 -- This program is distributed in the hope that it will be useful,
12 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
13 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 -- GNU General Public License for more details.
15 --
16 -- You should have received a copy of the GNU General Public License
17 -- along with this program; if not, write to the Free Software
18 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 -------------------------------------------------------------------------------*/
20 /*-- Author : Paul Leroy
21 -- Contact : Alexis Jeandet
22 -- Mail : alexis.jeandet@lpp.polytechnique.fr
23 ----------------------------------------------------------------------------*/
24
1 #ifndef FSW_PARAMS_NB_BYTES_H
25 #ifndef FSW_PARAMS_NB_BYTES_H
2 #define FSW_PARAMS_NB_BYTES_H
26 #define FSW_PARAMS_NB_BYTES_H
3
27
@@ -71,7 +95,6
71 // TC_LFR_LOAD_FILTER_PAR
95 // TC_LFR_LOAD_FILTER_PAR
72 #define NB_RW_K_COEFFS 16
96 #define NB_RW_K_COEFFS 16
73 #define NB_BYTES_PER_RW_K_COEFF 4
97 #define NB_BYTES_PER_RW_K_COEFF 4
74 #define DATAFIELD_POS_PA_RPW_SPARE8_2 0 // 8 bits
75 #define DATAFIELD_POS_SY_LFR_PAS_FILTER_ENABLED 1 // 8 bits
98 #define DATAFIELD_POS_SY_LFR_PAS_FILTER_ENABLED 1 // 8 bits
76 #define DATAFIELD_POS_SY_LFR_PAS_FILTER_MODULUS 2 // 8 bits
99 #define DATAFIELD_POS_SY_LFR_PAS_FILTER_MODULUS 2 // 8 bits
77 #define DATAFIELD_POS_SY_LFR_PAS_FILTER_TBAD 3 // 32 bits
100 #define DATAFIELD_POS_SY_LFR_PAS_FILTER_TBAD 3 // 32 bits
@@ -1,3 +1,27
1 /*------------------------------------------------------------------------------
2 -- Solar Orbiter's Low Frequency Receiver Flight Software (LFR FSW),
3 -- This file is a part of the LFR FSW
4 -- Copyright (C) 2012-2018, Plasma Physics Laboratory - CNRS
5 --
6 -- This program is free software; you can redistribute it and/or modify
7 -- it under the terms of the GNU General Public License as published by
8 -- the Free Software Foundation; either version 2 of the License, or
9 -- (at your option) any later version.
10 --
11 -- This program is distributed in the hope that it will be useful,
12 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
13 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 -- GNU General Public License for more details.
15 --
16 -- You should have received a copy of the GNU General Public License
17 -- along with this program; if not, write to the Free Software
18 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 -------------------------------------------------------------------------------*/
20 /*-- Author : Paul Leroy
21 -- Contact : Alexis Jeandet
22 -- Mail : alexis.jeandet@lpp.polytechnique.fr
23 ----------------------------------------------------------------------------*/
24
1 #ifndef FSW_PARAMS_PROCESSING_H
25 #ifndef FSW_PARAMS_PROCESSING_H
2 #define FSW_PARAMS_PROCESSING_H
26 #define FSW_PARAMS_PROCESSING_H
3
27
@@ -8,7 +32,6
8
32
9 #define NB_SM_PER_S_F0 96
33 #define NB_SM_PER_S_F0 96
10 #define NB_SM_PER_S_F1 16
34 #define NB_SM_PER_S_F1 16
11 #define NB_SM_PER_S_F2 1
12 #define NB_SM_PER_S1_BP_P0 24
35 #define NB_SM_PER_S1_BP_P0 24
13
36
14 #define ASM_COMP_B1B2 1
37 #define ASM_COMP_B1B2 1
@@ -31,10 +54,6
31 #define NB_BINS_PER_SM 128
54 #define NB_BINS_PER_SM 128
32 #define NB_VALUES_PER_SM 25
55 #define NB_VALUES_PER_SM 25
33 #define TOTAL_SIZE_SM 3200 // 25 * 128 = 0xC80
56 #define TOTAL_SIZE_SM 3200 // 25 * 128 = 0xC80
34 #define TOTAL_SIZE_NORM_BP1_F0 99 // 11 * 9 = 99
35 #define TOTAL_SIZE_NORM_BP1_F1 117 // 13 * 9 = 117
36 #define TOTAL_SIZE_NORM_BP1_F2 108 // 12 * 9 = 108
37 #define TOTAL_SIZE_SBM1_BP1_F0 198 // 22 * 9 = 198
38 // F0
57 // F0
39 #define NB_RING_NODES_SM_F0 20 // AT LEAST 8 due to the way the averaging is done
58 #define NB_RING_NODES_SM_F0 20 // AT LEAST 8 due to the way the averaging is done
40 #define NB_RING_NODES_ASM_BURST_SBM_F0 10 // AT LEAST 3
59 #define NB_RING_NODES_ASM_BURST_SBM_F0 10 // AT LEAST 3
@@ -50,27 +69,21
50 #define NB_RING_NODES_ASM_NORM_F2 3 // AT LEAST 3
69 #define NB_RING_NODES_ASM_NORM_F2 3 // AT LEAST 3
51 #define NB_RING_NODES_ASM_F2 3 // AT LEAST 3
70 #define NB_RING_NODES_ASM_F2 3 // AT LEAST 3
52 //
71 //
53 #define NB_BINS_PER_ASM_F0 88
54 #define NB_BINS_PER_PKT_ASM_F0_1 32
72 #define NB_BINS_PER_PKT_ASM_F0_1 32
55 #define NB_BINS_PER_PKT_ASM_F0_2 24
73 #define NB_BINS_PER_PKT_ASM_F0_2 24
56 #define DLEN_ASM_F0_PKT_1 3200 // 32 * 25 * 4, 25 components per matrix, 4 bytes per float
74 #define DLEN_ASM_F0_PKT_1 3200 // 32 * 25 * 4, 25 components per matrix, 4 bytes per float
57 #define DLEN_ASM_F0_PKT_2 2400 // 24 * 25 * 4, 25 components per matrix, 4 bytes per float
75 #define DLEN_ASM_F0_PKT_2 2400 // 24 * 25 * 4, 25 components per matrix, 4 bytes per float
58 #define ASM_F0_INDICE_START 16 // 17 - 1, (-1) due to the VHDL behaviour
76 #define ASM_F0_INDICE_START 16 // 17 - 1, (-1) due to the VHDL behaviour
59 #define ASM_F0_INDICE_STOP 103 // 104 - 1, 2 packets of 44 bins
60 //
77 //
61 #define NB_BINS_PER_ASM_F1 104
62 #define NB_BINS_PER_PKT_ASM_F1_1 36
78 #define NB_BINS_PER_PKT_ASM_F1_1 36
63 #define NB_BINS_PER_PKT_ASM_F1_2 32
79 #define NB_BINS_PER_PKT_ASM_F1_2 32
64 #define DLEN_ASM_F1_PKT_1 3600 // 36 * 25 * 4, 25 components per matrix, 4 bytes per float
80 #define DLEN_ASM_F1_PKT_1 3600 // 36 * 25 * 4, 25 components per matrix, 4 bytes per float
65 #define DLEN_ASM_F1_PKT_2 3200 // 32 * 25 * 4, 25 components per matrix, 4 bytes per float
81 #define DLEN_ASM_F1_PKT_2 3200 // 32 * 25 * 4, 25 components per matrix, 4 bytes per float
66 #define ASM_F1_INDICE_START 5 // 6 - 1, (-1) due to the VHDL behaviour
82 #define ASM_F1_INDICE_START 5 // 6 - 1, (-1) due to the VHDL behaviour
67 #define ASM_F1_INDICE_STOP 108 // 109 - 1, 2 packets of 52 bins
68 //
83 //
69 #define NB_BINS_PER_ASM_F2 96
70 #define NB_BINS_PER_PKT_ASM_F2 32
84 #define NB_BINS_PER_PKT_ASM_F2 32
71 #define DLEN_ASM_F2_PKT 3200 // 32 * 25 * 4, 25 components per matrix, 4 bytes per float
85 #define DLEN_ASM_F2_PKT 3200 // 32 * 25 * 4, 25 components per matrix, 4 bytes per float
72 #define ASM_F2_INDICE_START 6 // 7 - 1, (-1) due to the VHDL behaviour
86 #define ASM_F2_INDICE_START 6 // 7 - 1, (-1) due to the VHDL behaviour
73 #define ASM_F2_INDICE_STOP 101 // 102 - 1, 2 packets of 48 bins
74 //
87 //
75 #define KCOEFF_BLK_SIZE 130
88 #define KCOEFF_BLK_SIZE 130
76 #define KCOEFF_FREQ 2
89 #define KCOEFF_FREQ 2
@@ -80,26 +93,18
80 #define NB_BINS_COMPRESSED_SM 36 // 11 + 12 + 13
93 #define NB_BINS_COMPRESSED_SM 36 // 11 + 12 + 13
81 #define NB_BINS_COMPRESSED_SM_SBM_F0 22
94 #define NB_BINS_COMPRESSED_SM_SBM_F0 22
82 #define NB_BINS_COMPRESSED_SM_SBM_F1 26
95 #define NB_BINS_COMPRESSED_SM_SBM_F1 26
83 #define NB_BINS_COMPRESSED_SM_SBM_F2 24
84 //
85 #define NB_BYTES_PER_BP1 9
86 #define NB_BYTES_PER_BP2 30
87 //
96 //
88 #define NB_BINS_TO_AVERAGE_ASM_F0 8
97 #define NB_BINS_TO_AVERAGE_ASM_F0 8
89 #define NB_BINS_TO_AVERAGE_ASM_F1 8
98 #define NB_BINS_TO_AVERAGE_ASM_F1 8
90 #define NB_BINS_TO_AVERAGE_ASM_F2 8
99 #define NB_BINS_TO_AVERAGE_ASM_F2 8
91 #define NB_BINS_TO_AVERAGE_ASM_SBM_F0 4
100 #define NB_BINS_TO_AVERAGE_ASM_SBM_F0 4
92 #define NB_BINS_TO_AVERAGE_ASM_SBM_F1 4
101 #define NB_BINS_TO_AVERAGE_ASM_SBM_F1 4
93 #define NB_BINS_TO_AVERAGE_ASM_SBM_F2 4
94 //
102 //
95 #define TOTAL_SIZE_COMPRESSED_ASM_NORM_F0 275 // 11 * 25 WORDS
103 #define TOTAL_SIZE_COMPRESSED_ASM_NORM_F0 275 // 11 * 25 WORDS
96 #define TOTAL_SIZE_COMPRESSED_ASM_NORM_F1 325 // 13 * 25 WORDS
104 #define TOTAL_SIZE_COMPRESSED_ASM_NORM_F1 325 // 13 * 25 WORDS
97 #define TOTAL_SIZE_COMPRESSED_ASM_NORM_F2 300 // 12 * 25 WORDS
105 #define TOTAL_SIZE_COMPRESSED_ASM_NORM_F2 300 // 12 * 25 WORDS
98 #define TOTAL_SIZE_COMPRESSED_ASM_SBM_F0 550 // 22 * 25 WORDS
106 #define TOTAL_SIZE_COMPRESSED_ASM_SBM_F0 550 // 22 * 25 WORDS
99 #define TOTAL_SIZE_COMPRESSED_ASM_SBM_F1 650 // 26 * 25 WORDS
107 #define TOTAL_SIZE_COMPRESSED_ASM_SBM_F1 650 // 26 * 25 WORDS
100 #define TOTAL_SIZE_BP1_NORM_F0 99 // 9 * 11 UNSIGNED CHAR
101 #define TOTAL_SIZE_BP2_NORM_F0 330 // 30 * 11 UNSIGNED CHAR
102 #define TOTAL_SIZE_BP1_SBM_F0 198 // 9 * 22 UNSIGNED CHAR
103 // GENERAL
108 // GENERAL
104 #define NB_SM_BEFORE_AVF0_F1 8 // must be 8 due to the SM_average() function
109 #define NB_SM_BEFORE_AVF0_F1 8 // must be 8 due to the SM_average() function
105 #define NB_SM_BEFORE_AVF2 1 // must be 1 due to the SM_average_f2() function
110 #define NB_SM_BEFORE_AVF2 1 // must be 1 due to the SM_average_f2() function
@@ -1,14 +1,31
1 /*------------------------------------------------------------------------------
2 -- Solar Orbiter's Low Frequency Receiver Flight Software (LFR FSW),
3 -- This file is a part of the LFR FSW
4 -- Copyright (C) 2012-2018, Plasma Physics Laboratory - CNRS
5 --
6 -- This program is free software; you can redistribute it and/or modify
7 -- it under the terms of the GNU General Public License as published by
8 -- the Free Software Foundation; either version 2 of the License, or
9 -- (at your option) any later version.
10 --
11 -- This program is distributed in the hope that it will be useful,
12 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
13 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 -- GNU General Public License for more details.
15 --
16 -- You should have received a copy of the GNU General Public License
17 -- along with this program; if not, write to the Free Software
18 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 -------------------------------------------------------------------------------*/
20 /*-- Author : Paul Leroy
21 -- Contact : Alexis Jeandet
22 -- Mail : alexis.jeandet@lpp.polytechnique.fr
23 ----------------------------------------------------------------------------*/
24
1 #ifndef TM_BYTE_POSITIONS_H
25 #ifndef TM_BYTE_POSITIONS_H
2 #define TM_BYTE_POSITIONS_H
26 #define TM_BYTE_POSITIONS_H
3
27
4 #define BYTE_POS_CP_LFR_MODE 11
5
6 // TC_LFR_LOAD_NORMAL_PAR
28 // TC_LFR_LOAD_NORMAL_PAR
7 #define BYTE_POS_SY_LFR_N_SWF_L 0
8 #define BYTE_POS_SY_LFR_N_SWF_P 2
9 #define BYTE_POS_SY_LFR_N_ASM_P 4
10 #define BYTE_POS_SY_LFR_N_BP_P0 6
11 #define BYTE_POS_SY_LFR_N_BP_P1 7
12 #define BYTE_POS_SY_LFR_N_CWF_LONG_F3 8
29 #define BYTE_POS_SY_LFR_N_CWF_LONG_F3 8
13
30
14 // TM_LFR_HK
31 // TM_LFR_HK