// $RCSfile: configura.h,v $Revision: 1.69 $Date: 2005/03/11 15:08:57 //! To hold constant definition and typdef data structures. #ifndef __CONFIG_H__ #define __CONFIG_H__ #define TRUE 1 #define FALSE 0 #define RC_NOK 3 // used for communication between cmd_seq and cmd_exec in addition to RC_FAIL and RC_OK /* ----------- HIFI Service Types --------------------------------------------*/ #define TC_VERIFICATION 0x0001 #define HK_DIAG_REPORT 0x0003 #define EVENT_REPORT 0x0005 #define MEMORY_MANAGEMENT 0x0006 #define FUNC_STATUS_REPORT 0x0008 #define TIME_MANAGEMENT 0x0009 #define PACKET_TX_CONTROL 0x000E #define TEST_SERVICE 0x0011 #define SCIENCE_DATA 0x0015 /* ----------- HIFI Telemetry Service Subtypes ------------------------------*/ #define TC_ACCREP_SUCCESS 0x0001 #define TC_ACCREP_FAILURE 0x0002 #define TC_EXEC_COMPLETED 0x0007 #define TC_EXEC_FAILURE 0x0008 #define HK_DIAG_SUBTYPE 0x0019 #define EVENT_EVENT_REPORT 0x0001 #define EVENT_EXCEP_REPORT 0x0002 #define EVENT_ALARM_REPORT 0x0004 #define MEMORY_DUMP_REPORT 0x0006 #define MEMORY_CHECK_REPORT 0x000A #define FUNC_STATUS_SUBTYPE 0x0006 #define TIME_VERIFICATION 0x0009 #define PACKET_GEN_REPORT 0x0004 #define LINK_CONNECT_REPORT 0x0002 #define SCIENCE_DATA_SUBTYPE 0x0001 /* ----------- SIDs ----------------------------------------------*/ #define ESSENTIAL_HK_SID 0x0001 #define PERIODIC_HK_SID 0x0404 // changed to 1028 according to SCR 876 #define NON_PER_FCU_HK_SID 0x0011 // changed to 17 according to document tm icd 1.4 #define NON_PER_LCU_HK_SID 0x0012 // changed to 18 according to document tm icd 1.4 #define NON_PER_LCU_MEM_SID1 0x0013 // LCU_macro_tuning_HK #define NON_PER_LCU_MEM_SID2 0x0014 // LCU_macro_buffers_HK #define NON_PER_LCU_MEM_SID3 0x0015 // LCU_macro_buffers_HK #define NON_PER_LCU_MEM_SID_PAGE_7A 0x0016 // Read LCU page 7A #define HRSH_IF1_SID 0x0019 #define HRSH_IF2_SID 0x001A #define HRSV_IF1_SID 0x001B #define HRSV_IF2_SID 0x001C #define WBSH_IF1_SID 0x001D #define WBSH_IF2_SID 0x001E #define WBSV_IF1_SID 0x001F #define WBSV_IF2_SID 0x0020 #define VEC_SCAN_REP_SID 0x0110 /* ----------- Event IDs of event report packets ----------------------------------------------*/ #define HIFI_READY_EVID 0x8008 // Exception report packets #define PM_TEST_EVID 0x8001 // Alarm report packets #define DATA_MEMORY_EVID 0x8002 // Alarm report packets #define EEPROM_EVID 0x8003 // Alarm report packets #define TC_ERROR_EVID 0x8004 // Alarm report packets #define LOAD_EEPROM__EVID 0x8005 // Alarm report packets #define LOAD_DM_EVID 0x8006 // Alarm report packets #define BOOT_ERROR_EVID 0x8007 // Alarm report packets #define RUNTIME_ERROR_EVID 0xA000 // Event report packets #define PEAKUP_EVID 0xC000 // Peakup event packets /* ----------- Function Status report packets: ----------------------------------------------*/ // 16-bit word resulting from combination of FID and AID #define CONF_SPECTROSCOPY_NEW_REP 0x0B11 #define SPEC_SLOW_CHOP_REP 0x0B03 #define SPEC_FAST_CHOP_REP 0x0B02 #define SPEC_FREQ_SWITCH_REP 0x0B04 #define SINGLE_CMD_REP 0x0C1A #define CH1_DHTR_C_REP 0x0C1B #define CV1_DHTR_C_REP 0x0C1C #define HL_SWITCH_ON_REP 0x0C1D #define LO_TUNE_REPORT_SID 534 #define VECSCAN_NOMIN_REP_FID_AID 0x0C17 #define VECSCAN_DIAGN_REP_FID_AID 0x0C18 // the following have been introduced for the new configure ss tc having fid = 12. The ID is constructed from the FID (8bit) and the AID (other 8 bits) #define CONF_FCU_REPORT_NEW 0x0C01 #define CONF_FCU_POW_REPORT_NEW 0x0C0B #define CONF_HRSH_ATT_LO_REP_NEW 0x0C07 #define CONF_HRSH_BLOCKS_REP_NEW 0x0C08 #define CONF_HRSV_ATT_LO_REP_NEW 0x0C09 #define CONF_HRSV_BLOCKS_REP_NEW 0x0C0A #define CONF_WBSH_REP_NEW 0x0C04 #define CONF_WBSV_REP_NEW 0x0C05 #define CONF_LCU_OFF_REP 0x0C0C #define CONF_LCU_INT_REP 0x0C0D #define CONF_LSU_REP 0x0C0E #define CONF_LCU_NOMIN_REP 0x0C1E #define CONF_LCU_DIAGN_REP 0x0C1F #define CONF_LCU_TABLES_REP 0x0C20 #define CONF_FCU_RESTRI_REP 0x0C21 ///////////////////////////////////////////////////////////////////////////////////// /////////// SIDs for Science start frame packets ////////////////////////////////// #define START_HRSH1_SID 0x0001 #define START_HRSH2_SID 0x0002 #define START_HRSV1_SID 0x0003 #define START_HRSV2_SID 0x0004 #define START_WBSH1_SID 0x0005 #define START_WBSH2_SID 0x0006 #define START_WBSV1_SID 0x0007 #define START_WBSV2_SID 0x0008 ///////////////////////////////////////////////////////////////////////////////////// /////////// SIDs for Science Data packets (16 bits) ////////////////////////////////// #define WBSH1_16BIT_SID 0x000D #define WBSH2_16BIT_SID 0x000E #define WBSV1_16BIT_SID 0x000F #define WBSV2_16BIT_SID 0x0010 ///////////////////////////////////////////////////////////////////////////////////// /////////// SIDs for Science Data packets (24 bits) ////////////////////////////////// #define HRSH1_24BIT_SID 0x0011 #define HRSH2_24BIT_SID 0x0012 #define HRSV1_24BIT_SID 0x0013 #define HRSV2_24BIT_SID 0x0014 #define WBSH1_24BIT_SID 0x0015 #define WBSH2_24BIT_SID 0x0016 #define WBSV1_24BIT_SID 0x0017 #define WBSV2_24BIT_SID 0x0018 ///////////////////////////////////////////////////////////////////////////////////// /////////// SIDs for Diagnostic Science Data packets ////////////////////////////////// #define HRS_H_TUNE_REP 0x0104 #define HRS_V_TUNE_REP 0x0105 #define WBS_H_TUNE_REP 0x0106 #define WBS_V_TUNE_REP 0x0107 #define MIX_MAG_HRS_REP 0x010B #define MIX_MAG_WBS_REP 0x010C #define ENG_SCAN_REP 0x010f // 271: ENGSCAN_REPORT_SID #define DIP_SCAN_FAST_1_REP 0x011f // 287: dipscan fast REPORT_SID #define DIP_SCAN_FAST_2_REP 0x0120 // 288: dipscan fast REPORT_SID #define FAST_SCAN_H_SID 0x124 // 292 fast engineering scan #define FAST_SCAN_V_SID 0x125 // 293 fast engineering scan //////////////////////////////////////////////////////////////////////////////// ///// defines and structure to be used for TM packet transmission control ///// #define ENABLED 1 #define DISABLED 0 #define DIM_PKT_ENAB_VECT 124 // number of elements in the array pkt_enab[] defined in tables.c for packet trx control typedef struct { unsigned int type; unsigned int subtype; unsigned int pktid; unsigned int enab; } TM_PKT_ENAB; //////////////////////////////////////////////////////////////////////////////// ///// structure to be used for TC length check ///////////////////////////////// typedef struct { int type; int subtype; int fid; int aid; int len; // to contain the total TC length expressed in bytes } TC_len_info; #define DIM_TC_LEN_TAB 99 // number of elements in the array TC_len_tab[] defined in tables.c for TC len check /////////////////////////////////////////////////////////////////////////////// #define HRS_TRANSF_TIME 42 // msec necessary to transfer 4200 hrs data #define WBS_TRANSF_TIME 900 // msec necessary to transfer 8210 wbs data /////////////////////////////////////////////////////////////////////////////// // IDs of the subsystems #define HRS_V_ID 3 #define HRS_H_ID 2 #define WBS_V_ID 1 #define WBS_H_ID 0 #define FIFO0_SS_MASK 0x08 // FIFO 0 bit on IRQ vector register #define FIFO1_SS_MASK 0x10 // FIFO 1 bit on IRQ vector register #define FIFO2_SS_MASK 0x20 // FIFO 2 bit on IRQ vector register #define FIFO3_SS_MASK 0x40 // FIFO 3 bit on IRQ vector register /////////////////////////////////////////////////// IRQs // number of HW IRQ X bit in IRPTL CPU register #define IRQ3_N 5 // timer #define IRQ2_N 6 // 1553 #define IRQ1_N 7 // 1355 #define IRQ0_N 8 // hw fifo /////////////////////////////////////////////////// MEMORY POOLS // Telecommands #define TC_BLOCK_LEN_BYTES 512 #define TC_BLOCK_LEN_WORDS TC_BLOCK_LEN_BYTES/4 #define TC_POOL_DEPTH 8 // HK #define HK_BLOCK_LEN_BYTES 2048 #define HK_BLOCK_LEN_WORDS HK_BLOCK_LEN_BYTES/4 #define HK_POOL_DEPTH 24 // SD #define SD_BLOCK_MIN_BYTES 512 #define SD_BLOCK_MIN_WORDS SD_BLOCK_MIN_BYTES/4 #define SD_BLOCK_MAX_BYTES 32960 #define SD_BLOCK_MAX_WORDS SD_BLOCK_MAX_BYTES/4 #define SD_POOL_DEPTH 32 /////////////////////////////////////////////////////// PACKET RELATED CONSTANTS // ESA Source Packet Header length (in words, taking into account packetization) #define SPH_WLEN 3 // Data field header (in bytes) #define DFH_LEN 10 // Data field header (in words, taking into account packetization) #define DFH_WLEN 5 // Source Data header (in bytes) #define SDH_HK_LEN 10 // Source Data header (in 16 bit words, taking into account packetization) #define SDH_HK_WLEN 5 // Source data header for spectrometry science data (in bytes) #define SDH_SD_LEN 18 //TM ICD Issue 0.5 (was 22 in preceding issues) // Source data header for spectrometry science data //(in words, taking into account packetization) #define SDH_SD_WLEN 9 //TM ICD Issue 0.5 (was 11 in preceding issues) #define SDH_HRSSF_LEN 13 #define SDH_WBSSF_LEN 21 // Max number of data bytes in a TM science packet #define SD_TM_MAX_PKT 988 //ADG - SD TM reports in TM ICD Issue 0.5 // Max number of data bytes in a TM HK packet #define HK_TM_MAX_PKT 996 // header before data in SD packet in 16-bit words #define SD_TM_HEADER (SPH_WLEN+DFH_WLEN+SDH_SD_WLEN) // header before data in HK packet in 16 bit words #define HK_TM_HEADER SPH_WLEN+DFH_WLEN+SDH_HK_WLEN /////////////////////////////////////////////////// WBS constants // number of SD blocks in a WBS frame #define WBS_BLOCK_NUM 4 // length of a SD WBS block in words #define WBS_BLOCK_DATA_LEN 2048 // length of a WBS SD frame in words // ADG: Integration counter included #define WBS_DATA_LEN WBS_BLOCK_DATA_LEN*WBS_BLOCK_NUM // length of a HK WBS block in words #define WBS_HK_LEN 18 //ADG - to avoid packing/unpacking of data // Structure Identifiers #define WBSH_INT_BUF1_SF 5 // WBSH Integration buffer #1 Start Frame #define WBSH_INT_BUF2_SF 6 // WBSH Integration buffer #2 Start Frame #define WBSV_INT_BUF1_SF 7 // WBSV Integration buffer #1 Start Frame #define WBSV_INT_BUF2_SF 8 // WBSV Integration buffer #2 Start Frame #define WBSH_INT_BUF1_16 13 // WBSH Integration buffer #1 - 16 bit #define WBSH_INT_BUF2_16 14 // WBSH Integration buffer #2 - 16 bit #define WBSV_INT_BUF1_16 15 // WBSV Integration buffer #1 - 16 bit #define WBSV_INT_BUF2_16 16 // WBSV Integration buffer #2 - 16 bit #define WBSH_INT_BUF1_24 21 // WBSH Integration buffer #1 - 24 bit #define WBSH_INT_BUF2_24 22 // WBSH Integration buffer #2 - 24 bit #define WBSV_INT_BUF1_24 23 // WBSV Integration buffer #1 - 24 bit #define WBSV_INT_BUF2_24 24 // WBSV Integration buffer #2 - 24 bit #define WBSH_IFHK_BUF1 29 // IF HK Mod1 #define WBSH_IFHK_BUF2 30 // IF HK Mod2 #define WBSV_IFHK_BUF1 31 // IF HK Mod1 #define WBSV_IFHK_BUF2 32 // IF HK Mod2 #define WBS_MAIN_ATT_STEPS 16 //linked to the WBS_Main table dimensions #define WBS_BANDS_ATT_STEPS 8 //linked to the WBS_BANDS_ATT table dimensions //////////////////////////////////////////////////// HRS constants // number of SD blocks in a HRS frame #define HRS_BLOCK_NUM 8 // length of a SD HRS block in words #define HRS_BLOCK_DATA_LEN 516 // length of a SD HRS sub-block in words #define HRS_SUBBLOCK_DATA_LEN (HRS_BLOCK_DATA_LEN / 2) // length of a HRS SD frame in words #define HRS_DATA_LEN HRS_BLOCK_DATA_LEN*HRS_BLOCK_NUM // length of a HK HRS block in words #define HRS_HK_NUM 32 #define HRS_HK_LEN 64 //ADG - to avoid packing - unpacking of data // Structure Identifiers #define HRSH_INT_BUF1_SF 1 // HRSH Integration buffer #1 Start Frame #define HRSH_INT_BUF2_SF 2 // HRSH Integration buffer #2 Start Frame #define HRSV_INT_BUF1_SF 3 // HRSV Integration buffer #1 Start Frame #define HRSV_INT_BUF2_SF 4 // HRSV Integration buffer #2 Start Frame #define HRSH_INT_BUF1_16 9 // HRSH Integration buffer #1 - 16 bit: not used #define HRSH_INT_BUF2_16 10 // HRSH Integration buffer #2 - 16 bit: not used #define HRSV_INT_BUF1_16 11 // HRSV Integration buffer #1 - 16 bit: not used #define HRSV_INT_BUF2_16 12 // HRSV Integration buffer #2 - 16 bit: not used #define HRSH_INT_BUF1_24 17 // HRSH Integration buffer #1 - 24 bit #define HRSH_INT_BUF2_24 18 // HRSH Integration buffer #2 - 24 bit #define HRSV_INT_BUF1_24 19 // HRSV Integration buffer #1 - 24 bit #define HRSV_INT_BUF2_24 20 // HRSV Integration buffer #2 - 24 bit #define HRSH_IFHK_BUF1 25 // IF HK Mod1 #define HRSH_IFHK_BUF2 26 // IF HK Mod2 #define HRSV_IFHK_BUF1 27 // IF HK Mod1 #define HRSV_IFHK_BUF2 28 // IF HK Mod2 // HRS attenuators table length #define HRS_ATTVAL1_LEN 17 #define HRS_ATTVAL2_LEN 18 //////////////////////////////////////////// SD, TC and HK buffer handlers structures // FRAME BUFFER HANDLER // structure that holds the handles for the science-data and housekeeping frame buffers. typedef struct { int duration; // number of total frames for a measurement unsigned int coadded; // number of coadded frames (meaningless for HK) unsigned int int_num; // number of coadditions on the buffer (meaningless for HK) unsigned int isn; // integration sequence number unsigned int range_sel; // index of the first range selection parameter (meaningless for HK) unsigned int linker; // this field tells which subsystem corresponds to this FIFO unsigned int APID; // APID } FRAME_BUF_HDL; // FRAME_BUFfer_HanDLer typedef struct { K_BLOCK block; // block handling structure int len; // length of frame int offset; int free; } TC_BUF_HDL; // TeleCommand_BUFfer_HanDLer // lengths of tables vectors in words. IF CHANGED CHANGE ALSO THE VM INCLUDE FILE. #define WNUM_Spectroscopy_table 128 #define WNUM_SPEC_TAB_INI 29 ///////////////////////////////////////////////// LSS PORT #define LS_RECEIVE_ERROR 0X0000EEEE // when some flag in receive register was wrong ///////////////////////////////////////// CMD_SEQ CONSTANTS AND DEFINITIONS #define SEGM_FLAG_MSK 0x0000C000 // 2 bits raised for segmentation flag #define FCU_PSCAN_SID 266 // FCU PAR. SCAN, according to document tm icd 1.4 #define DIP_SCAN_IF_REP_SID 258 // SID of the report of a diplexer scan with if power #define DIP_SCAN_NOIF_REP_SID 270 // SID of the report of a diplexer scan without if power #define PEAKUP_ACQUIRE_REP_SID 289 // SID of the report of a peakup acquire #define PEAKUP_CHOP_COR_REP_SID 290 // SID of the report of a peakup tune chopper #define PEAKUP_AOCS_COR_REP_SID 291 // SID of the report of a peakup aocs correction #define PEAKUP_EVENT_SID 0xC000 // SID of the peakup event #define LCU_IV_SID 259 // LCU_IV CURVE #define HRSH_TUNE_SID 260 // HRS TUNE REPORT #define HRSV_TUNE_SID 261 // HRS TUNE REPORT #define WBSH_TUNE_SID 262 // WBS TUNE REPORT #define WBSV_TUNE_SID 263 // WBS TUNE REPORT #define MXMAGH_TUNE_SID 267 // MX mag HRS TUNE REPORT #define MXMAGW_TUNE_SID 268 // MX mag WBS TUNE REPORT #define TC_DATA_MAX 118 /* Max size (in 16 bits words) of Application Data */ #define TM_DATA_MAX 503 /* field in a TC and TM packet */ #define TM_EVENT_MAX 22 /* and event TM packet (PS-ICD) */ #define TC_DATA_HEADER_LEN 2 #define TM_DATA_HEADER_LEN 5 // Incoming TC from TM_TC on as-it-is basis (packed data): typedef struct { unsigned int id; /* Packet ID */ unsigned int seqctrl; /* Packet Sequence Control */ unsigned int packet_length; /* Packet data Length in bytes - 1*/ unsigned int data_field_header[TC_DATA_HEADER_LEN]; /* Data Field Header */ unsigned int data[TC_DATA_MAX]; /* Source Data */ unsigned int error_ctrl; /* Packet Error Control */ unsigned int chk_len; /* 16 bit words read from 1553 */ } TC_packet; typedef struct { unsigned int start_address; unsigned int end_address; } data_for_EEPROM; // Global data structure for TC verification reporting // (for performance reasons, and to allow inspection via memory dump commands // this is global rather than passed as a function argument // This is the Time Stamp formatted to fit three 16 bit words as needed by TM packets typedef struct { unsigned int seconds_high; unsigned int seconds_low; unsigned int fraction; } PACKD_TIME_STAMP; // This is the data structure that needs to be put in the start frame of every frame typedef struct { PACKD_TIME_STAMP time_stamp; unsigned int HK_rot_1; unsigned int HK_rot_2; unsigned int HK_freq; unsigned int HK_main_ms; unsigned int HK_main_lo; unsigned int HK_off_lo; } START_FRAME_DATA; /////////////////// TIME_TASK Structures struct time_struct_at_sync { int clock_at_sync; /* number of clocks at sync reception */ unsigned int seconds; /* seconds */ unsigned int fractions; /* fractions of seconds (in 1/65536) */ }; typedef struct { unsigned int type_PUS; unsigned int subtype_spare; PACKD_TIME_STAMP TS; // Time Stamp (48 bits = 3 * 16bits words) } TM_DATA_FIELD_HEADER; typedef struct { unsigned int TC_packet_ID; unsigned int packet_seq_ctrl; unsigned int length; } TM_HEADER; typedef struct { TM_HEADER packet_header; TM_DATA_FIELD_HEADER data_field_header; unsigned int data_1; unsigned int data_2; unsigned int data_3; unsigned int data_4; } TC_verify, // TC acceptance service TM_MEM_CHK; // Service Memory check - report (6,6) typedef struct { TM_HEADER packet_header; TM_DATA_FIELD_HEADER data_field_header; unsigned int data_1; unsigned int data_2; unsigned int data_3; } TM_MEM_dump_dh; // Service Memory dump- source data header typedef struct { TM_HEADER packet_header; TM_DATA_FIELD_HEADER data_field_header; PACKD_TIME_STAMP time_stamp; } TM_time; typedef struct { TM_HEADER packet_header; TM_DATA_FIELD_HEADER data_field_header; unsigned int structure_ID; unsigned int obs_ID[2]; unsigned int bb_ID[2]; } TM_ST3_HEADER; // Service Type 3 header (Housekeeping) typedef struct { TM_HEADER packet_header; TM_DATA_FIELD_HEADER data_field_header; unsigned int event_ID; unsigned int structure_ID; unsigned int obs_ID[2]; unsigned int bb_ID[2]; unsigned int counter; unsigned int parameter; } TM_ST5_HEADER; // Service Type 5 header (Event, Error, Exceptions) typedef struct { TM_HEADER packet_header; TM_DATA_FIELD_HEADER data_field_header; unsigned int structure_ID; unsigned int obs_ID[2]; unsigned int bb_ID[2]; unsigned int int_seq_n; // integration sequence number unsigned int n_pack_fr; // number of packets in frame unsigned int pack_n; // packet number in frame unsigned int f_ch_n; // first channel number } TM_SPECT_HEADER; // Spectrom. Science data rep. header TMICD 0.5 // WBS start frame structure typedef struct { TM_HEADER packet_header; TM_DATA_FIELD_HEADER data_field_header; unsigned int structure_ID; unsigned int obs_ID[2]; unsigned int bb_ID[2]; unsigned int int_seq_n; // integration sequence number unsigned int n_pack_fr; // number of packets in frame PACKD_TIME_STAMP TS; // Time Stamp (48 bits = 3 * 16bits words) unsigned int HIF_N_WBS_INTEGR; unsigned int HIF_WBS_rshift; unsigned int HIF_WBS_OFFSET1; unsigned int HIF_WBS_WIDTH1; unsigned int HIF_WBS_OFFSET2; unsigned int HIF_WBS_WIDTH2; unsigned int HIF_WBS_OFFSET3; unsigned int HIF_WBS_WIDTH3; unsigned int HIF_WBS_OFFSET4; unsigned int HIF_WBS_WIDTH4; unsigned int int_scan_cnt; // new packing - now 16 bit field unsigned int dark_pix[16]; unsigned int frame_tranf_cnt; } TM_WBS_SDSF; // HRS start frame structure typedef struct { TM_HEADER packet_header; TM_DATA_FIELD_HEADER data_field_header; unsigned int structure_ID; unsigned int obs_ID[2]; unsigned int bb_ID[2]; unsigned int int_seq_n; // integration sequence number unsigned int n_pack_fr; // number of packets in frame PACKD_TIME_STAMP TS; // Time Stamp (48 bits = 3 * 16bits words) unsigned int HIF_N_HRS_INTEGR; unsigned int HIF_HRS_rshift; unsigned int HIF_HRS_SEL; unsigned int head_chan[48]; unsigned int frame_tranf_cnt; } TM_HRS_SDSF; // Indexes and definitions to access Source sequence counters // the indexes indicate the position in the Source_counter array, the // global variable used to maintain the Source sequence counters // APIDs #define APID1024 1024 #define APID1026 1026 #define APID1028 1028 #define APID1029 1029 #define APID1030 1030 #define APID1031 1031 #define TM_APID_HK APID1026 #define TM_APID_ESS_HK 1024 /*!< APID for essential HK */ // Mask for increment modulo 14 bits #define MOD14 0x00004000 // 14 bit modulo mask // Bit masks of single ss into enable mask (for ss status) // see HIFI command specification sect. 3.8.2 #define HRS_H_MASK 0x1 // Bit 0 (7 in ESA dialect) #define HRS_V_MASK 0x2 // 1 #define WBS_H_MASK 0x4 // 2 #define WBS_V_MASK 0x8 // 3 #define LCU_MASK 0x10 // 4 #define FCU_MASK 0x20 // 5 #define LCU_OFF_MASK 0xFFFFFFEF #define WBS_H_VALIDITY_MASK 0x1 // Bit 0 (7 in ESA dialect) #define WBS_V_VALIDITY_MASK 0x2 // 1 #define HRS_H_VALIDITY_MASK 0x4 // 2 #define HRS_V_VALIDITY_MASK 0x8 // 3 // TM constants: #define TM_DATA_MAX 503 // field in a TC and TM packet #define TM_EVENT_MAX 22 // and event TM packet (PS-ICD) #define TM_DFHF_REGULAR 1 // Data field header flag for all but one packets #define TM_DFHF_TIMEPKT 0 // Data field header flag for Time packets #define TM_CTEST_TYPE 17 // Type of connection test packets #define TM_CTEST_SUBT 2 // Subtype of connection test packets #define TM_HK_TYPE 3 // Type of TM periodic HK reports #define TM_HK_SUBT 25 // Subtype of TM periodic HK reports #define TM_SD_TYPE 21 // Type of TM SD #define TM_SD_SUBT 1 // Subtype of TM SD #define TM_CONN_TEST_LEN 11 // Length field of the connection test TM packet (no data). #define TM_ACK_LEN 15 // Length of ACK TM packet (10 dfh + 4(2 data)+2 (crc)-1) #define TM_HEADER_NWORDS 3 // # of words in the TM header #define TM_MCHK_LEN 19 // Length of the memory check report TM packet (4 data) #define TM_MEM_DUMP_TYPE 6 // Type of TM memory dump packets #define TM_MEM_DUMP_SUBT 6 // SubType of TM memory dump packets #define TM_DATAHEADER_NWORDS 5 // # of 16 bits words in the TM data field header #define MAX_N_REP_PAR 10 // max number of parameters in an event report application data field #define MAX_N_ECHO_PAR 50 // max number of parameters in an event report application data field #define TM_FS_TYPE 8 // Type of TM periodic HK reports #define TM_FS_SUBT 6 // Subtype of TM periodic HK reports #define SHORT_BLOCK_SIZE 128 /////////////////////////////////////////// SPECTROSCOPY TABLE INDEXES // Total Power #define HIF_N_WBS_START_IDX 0 //Number of WBS starts during the whole measurement #define HIF_R_HRS_IDX 1 //Number of HRS-accumulations during one WBS accumulation #define HIF_N_WBS_INTEGR_IDX 2 //Number of integrations in WBS-coaddition buffer per packetization #define HIF_N_HRS_INTEGR_IDX 3 //Number of integrations in HRS-coaddition buffer per packetization #define HIF_DEL_HRS_IDX 4 //Delay time before start-HRS command #define HIF_DEL_WBS_IDX 5 //Delay time before start-WBS command #define HIF_T_ACC_WBS_IDX 6 //Accumulation time of WBS #define HIF_T_ACC_HRS_IDX 7 //Accumulation time of HRS #define HIF_WBSH_OFFSET1_IDX 8 //Specifies first channel of WBS_H output range 1 #define HIF_WBSH_WIDTH1_IDX 9 //Specifies number of channels in WBS_H output range 1 #define HIF_WBSH_OFFSET2_IDX 10 //Specifies first channel of WBS_H output range 2 #define HIF_WBSH_WIDTH2_IDX 11 //Specifies number of channels in WBS_H output range 2 #define HIF_WBSH_OFFSET3_IDX 12 //Specifies first channel of WBS_H output range 3 #define HIF_WBSH_WIDTH3_IDX 13 //Specifies number of channels in WBS_H output range 3 #define HIF_WBSH_OFFSET4_IDX 14 //Specifies first channel of WBS_H output range 4 #define HIF_WBSH_WIDTH4_IDX 15 //Specifies number of channels in WBS_H output range 4 #define HIF_WBSV_OFFSET1_IDX 16 //Specifies first channel of WBS_V output range 1 #define HIF_WBSV_WIDTH1_IDX 17 //Specifies number of channels in WBS_V output range 1 #define HIF_WBSV_OFFSET2_IDX 18 //Specifies first channel of WBS_V output range 2 #define HIF_WBSV_WIDTH2_IDX 19 //Specifies number of channels in WBS_V output range 2 #define HIF_WBSV_OFFSET3_IDX 20 //Specifies first channel of WBS_V output range 3 #define HIF_WBSV_WIDTH3_IDX 21 //Specifies number of channels in WBS_V output range 3 #define HIF_WBSV_OFFSET4_IDX 22 //Specifies first channel of WBS_V output range 4 #define HIF_WBSV_WIDTH4_IDX 23 //Specifies number of channels in WBS_V output range 4 #define HIF_HRS_rshift_IDX 24 //Specifies number of bits for HRS right-shift #define HIF_WBS_rshift_IDX 25 //Specifies number of bits for WBS right-shift #define HIF_HRSH_SEL_IDX 26 //8 bit word selects banks to be packetized for HRS-H #define HIF_HRSV_SEL_IDX 27 //8 bit word selects banks to be packetized for HRS-V #define HIF_WBS_packing_IDX 28 //Specifies to telemeter 24 or 16 bits WBS-data /////////////////////////////////////////// LCU-FCU params TABLEs INDICES // FCU param. scan #define HF_CH1_MXBIAS_V_IDX 0 // table FCU_PS_CMD #define HF_CH1_MX_MG_C_IDX 1 // #define HF_CV1_MXBIAS_V_IDX 2 // #define HF_CV1_MX_MG_C_IDX 3 // #define HF_DH1_MXBAND_IDX 0 // table FCU_PS_HK #define HF_DV1_MXBAND_IDX 1 // #define HF_CH1_DPACT_C_IDX 37 // index of diplexer position command in FCU_config[] #define HF_CV1_DPACT_C_IDX 38 #define MAX_MIXMAG_DATA 498 // max number of 16-bit parameters in a mixer magnet tune report // calculated from the max total length of a tm packet (1024 bytes) #define MAX_NUMB_MAG_CUR_STEP 48 // max possible number of steps in a mixer magnet tuning; 48 comes // from the above MAX_MIXMAG_DATA. // the following are some constants for diplexer scan #define MAX_DIPSCAN_DATA 503 // max number of 16-bit words (starting with sid) in a diplexer scan report // calculated from the max total length of a tm packet (1024 bytes) #define MAX_NSTEP_DIPSCAN_IF 20 // max possible number of steps in a diplexer scan with if power: // it comes from the max total length of a tm packet (1024 bytes). #define MAX_NSTEP_DIPSCAN_NOIFP 61 // max possible number of steps in a diplexer scan without if power: // it comes from the max total length of a tm packet (1024 bytes). #define TM_N_DIPLEXER_IDX 11 #define TM_CH1_DP_POS0_IDX 6 #define TM_CH2_DP_POS0_IDX 7 #define TM_DP_STEP_IDX 8 #define TM_DP_STEP_TIME_IDX 5 ////////////////////////////////// Spectrometers Commands TABLEs INDICES #define DATA_TRANS_IDX 0 #define START_INT_IDX 1 #define STOP_INT_IDX 2 #define ZERO_ON_IDX 3 #define ZERO_OFF_IDX 4 #define COMB_ON_IDX 5 #define COMB_OFF_IDX 6 #define ATT_MAX_IDX 7 #define ATT_ZERO_IDX 8 #define ATT_COMB_MEAS_IDX 10 #define ATT_RESTORE_COMB_IDX 11 #define ATT_RESTORE_ZERO_IDX 12 #define RESET_A_IDX 3 #define SEL_A_IDX 5 #define SEL_B_IDX 6 ////////////////////////////////////////////////////////// TMTC TASK #define SCI 0 #define HK 1 #define EVT 2 #define MEM 3 // Telecommand/Telemetry Packet definition struct TM_packet { //1+1+1+5+n+1 unsigned int id; // Packet ID unsigned int seqctrl; // Packet Sequence Control unsigned int packet_length; // Packet Length in byte (divide it by 2) unsigned int data_field_header[TM_DATA_HEADER_LEN]; /* Data Field Header */ unsigned int data[TM_DATA_MAX]; /* Source Data */ unsigned int error_ctrl; /* Packet Error Control */ }; struct TM_event { //1+1+1+5+n+1 int id; /* Packet ID */ int seqctrl; /* Packet Sequence Control */ int packet_length; /* Packet Length in byte (divide it by 2)*/ int data_field_header[TM_DATA_HEADER_LEN]; /* Data Field Header */ int data[TM_EVENT_MAX]; /* Source Data */ int error_ctrl; /* Packet Error Control */ }; #define STOP 0x00000000 #define CONTINUE 0x00000001 #define ISFREE 0xFFFFFFFF #define TC_BLOCK_MSG 1 #endif //__CONFIG_H__