ccsds_types.h
308 lines
| 9.9 KiB
| text/x-c
|
CLexer
/ header / ccsds_types.h
paul
|
r0 | #ifndef CCSDS_H_INCLUDED | ||
#define CCSDS_H_INCLUDED | ||||
paul@pc-solar1.lab-lpp.local
|
r18 | #define CCSDS_TELEMETRY_HEADER_LENGTH 16+4 | ||
paul@pc-solar1.lab-lpp.local
|
r2 | #define CCSDS_TM_PKT_MAX_SIZE 4412 | ||
paul
|
r0 | #define CCSDS_TELECOMMAND_HEADER_LENGTH 10+4 | ||
paul@pc-solar1.lab-lpp.local
|
r20 | #define CCSDS_TC_PKT_MAX_SIZE 256 | ||
#define CCSDS_TC_PKT_MIN_SIZE 16 | ||||
paul@pc-solar1.lab-lpp.local
|
r2 | #define CCSDS_TC_TM_PACKET_OFFSET 7 | ||
#define CCSDS_PROCESS_ID 76 | ||||
paul@pc-solar1.lab-lpp.local
|
r18 | #define CCSDS_PACKET_CATEGORY 12 | ||
#define CCSDS_NODE_ADDRESS 0xfe | ||||
// | ||||
#define CCSDS_DESTINATION_ID_GROUND 0x00 | ||||
#define CCSDS_DESTINATION_ID 0x01 | ||||
#define CCSDS_DESTINATION_ID_DPU 0x01 | ||||
// | ||||
#define CCSDS_PROTOCOLE_ID 0x02 | ||||
#define CCSDS_USER_APP 0x00 | ||||
#define SIZE_TM_LFR_TC_EXE_NOT_IMPLEMENTED 24 | ||||
paul@pc-solar1.lab-lpp.local
|
r2 | #define SIZE_TM_LFR_TC_EXE_CORRUPTED 32 | ||
paul@pc-solar1.lab-lpp.local
|
r21 | #define SIZE_HK_PARAMETERS 112 | ||
paul
|
r0 | |||
paul@pc-solar1.lab-lpp.local
|
r18 | #define ILLEGAL_APID 0 | ||
#define WRONG_LEN_PACKET 1 | ||||
paul@pc-solar1.lab-lpp.local
|
r2 | #define INCOR_CHECKSUM 2 | ||
#define ILL_TYPE 3 | ||||
paul@pc-solar1.lab-lpp.local
|
r18 | #define ILL_SUBTYPE 4 | ||
#define WRONG_APP_DATA 5 | ||||
#define WRONG_CMD_CODE 6 | ||||
#define CCSDS_TM_VALID 7 | ||||
// TC TYPES | ||||
#define TC_TYPE_GEN 181 | ||||
#define TC_TYPE_TIME 9 | ||||
// TC SUBTYPES | ||||
#define TC_SUBTYPE_RESET 1 | ||||
#define TC_SUBTYPE_LOAD_COMM 11 | ||||
#define TC_SUBTYPE_LOAD_NORM 13 | ||||
#define TC_SUBTYPE_LOAD_BURST 19 | ||||
#define TC_SUBTYPE_LOAD_SBM1 25 | ||||
#define TC_SUBTYPE_LOAD_SBM2 27 | ||||
#define TC_SUBTYPE_DUMP 31 | ||||
#define TC_SUBTYPE_ENTER 41 | ||||
#define TC_SUBTYPE_UPDT_INFO 51 | ||||
#define TC_SUBTYPE_EN_CAL 61 | ||||
#define TC_SUBTYPE_DIS_CAL 63 | ||||
#define TC_SUBTYPE_UPDT_TIME 129 | ||||
// TC LEN | ||||
#define TC_LEN_RESET 12 | ||||
#define TC_LEN_LOAD_COMM 14 | ||||
#define TC_LEN_LOAD_NORM 20 | ||||
#define TC_LEN_LOAD_BURST 14 | ||||
#define TC_LEN_LOAD_SBM1 14 | ||||
#define TC_LEN_LOAD_SBM2 14 | ||||
#define TC_LEN_DUMP 12 | ||||
#define TC_LEN_ENTER 20 | ||||
#define TC_LEN_UPDT_INFO 48 | ||||
#define TC_LEN_EN_CAL 12 | ||||
#define TC_LEN_DIS_CAL 12 | ||||
#define TC_LEN_UPDT_TIME 18 | ||||
// TM TYPES | ||||
#define TM_TYPE_LFR_SCIENCE 21 | ||||
paul@pc-solar1.lab-lpp.local
|
r21 | #define TM_TYPE_HK 3 | ||
paul@pc-solar1.lab-lpp.local
|
r18 | |||
// TM SUBTYPES | ||||
#define TM_SUBTYPE_EXE_OK 7 | ||||
#define TM_SUBTYPE_EXE_NOK 8 | ||||
#define TM_SUBTYPE_HK 25 | ||||
#define TM_SUBTYPE_SCIENCE 3 | ||||
#define TM_SUBTYPE_LFR_SCIENCE 3 | ||||
paul@pc-solar1.lab-lpp.local
|
r21 | // TM SID | ||
paul@pc-solar1.lab-lpp.local
|
r18 | #define SID_DEFAULT 0 | ||
#define SID_HK 1 | ||||
#define SID_EXE_INC 5 | ||||
#define SID_NOT_EXE 40000 | ||||
#define SID_NOT_IMP 40002 | ||||
#define SID_EXE_ERR 40003 | ||||
#define SID_EXE_CORR 40005 | ||||
#define SID_NORM_SWF_F0 3 | ||||
#define SID_NORM_SWF_F1 4 | ||||
#define SID_NORM_SWF_F2 5 | ||||
#define SID_NORM_CWF_F3 1 | ||||
#define SID_BURST_CWF_F2 2 | ||||
#define SID_SBM1_CWF_F1 24 | ||||
#define SID_SBM2_CWF_F2 25 | ||||
#define SID_NORM_ASM_F0 11 | ||||
#define SID_NORM_ASM_F1 12 | ||||
#define SID_NORM_ASM_F2 13 | ||||
#define SID_NORM_BP1_F0 14 | ||||
#define SID_NORM_BP1_F1 15 | ||||
#define SID_NORM_BP1_F2 16 | ||||
#define SID_NORM_BP2_F0 19 | ||||
#define SID_NORM_BP2_F1 20 | ||||
#define SID_NORM_BP2_F2 21 | ||||
#define SID_BURST_BP1_F0 17 | ||||
#define SID_BURST_BP2_F0 22 | ||||
#define SID_BURST_BP1_F1 18 | ||||
#define SID_BURST_BP2_F1 23 | ||||
#define SID_SBM1_BP1_F0 28 | ||||
#define SID_SBM1_BP2_F0 31 | ||||
#define SID_SBM2_BP1_F0 29 | ||||
#define SID_SBM2_BP2_F0 32 | ||||
#define SID_SBM1_BP1_F1 30 | ||||
#define SID_SBM1_BP2_F1 33 | ||||
// LENGTH (BYTES) | ||||
#define LENGTH_TM_LFR_HK 126 | ||||
#define LENGTH_TM_LFR_TC_EXE_MAX 32 | ||||
#define LENGTH_TM_LFR_SCIENCE_NORMAL_WF_MAX 4102 | ||||
// | ||||
#define TM_LEN_EXE 20 - CCSDS_TC_TM_PACKET_OFFSET | ||||
#define TM_LEN_NOT_EXE 26 - CCSDS_TC_TM_PACKET_OFFSET | ||||
#define TM_LEN_NOT_IMP 24 - CCSDS_TC_TM_PACKET_OFFSET | ||||
#define TM_LEN_EXE_ERR 24 - CCSDS_TC_TM_PACKET_OFFSET | ||||
#define TM_LEN_EXE_CORR 32 - CCSDS_TC_TM_PACKET_OFFSET | ||||
#define TM_HEADER_LEN 16 | ||||
#define LEN_TM_LFR_HK 126 + 4 | ||||
#define LEN_TM_LFR_TC_EXE_NOT_IMP 24 +4 | ||||
#define TM_LEN_SCI_NORM_SWF_340 340 * 12 + 6 + 10 - 1 | ||||
#define TM_LEN_SCI_NORM_SWF_8 8 * 12 + 6 + 10 - 1 | ||||
enum TM_TYPE{ | ||||
TM_LFR_TC_EXE_OK, | ||||
TM_LFR_TC_EXE_ERR, | ||||
TM_LFR_HK, | ||||
TM_LFR_SCI, | ||||
TM_LFR_SCI_SBM, | ||||
TM_LFR_PAR_DUMP | ||||
paul@pc-solar1.lab-lpp.local
|
r3 | }; | ||
paul@pc-solar1.lab-lpp.local
|
r18 | |||
paul@pc-solar1.lab-lpp.local
|
r3 | struct TMHeader_str | ||
paul
|
r0 | { | ||
paul@pc-solar1.lab-lpp.local
|
r2 | volatile unsigned char targetLogicalAddress; | ||
volatile unsigned char protocolIdentifier; | ||||
volatile unsigned char reserved; | ||||
volatile unsigned char userApplication; | ||||
volatile unsigned char packetID[2]; | ||||
volatile unsigned char packetSequenceControl[2]; | ||||
volatile unsigned char packetLength[2]; | ||||
paul@pc-solar1.lab-lpp.local
|
r3 | volatile unsigned char dataFieldHeader[10]; | ||
}; | ||||
paul@pc-solar1.lab-lpp.local
|
r18 | typedef struct TMHeader_str TMHeader_t; | ||
paul@pc-solar1.lab-lpp.local
|
r17 | struct Packet_TM_LFR_TC_EXE_str | ||
{ | ||||
volatile unsigned char targetLogicalAddress; | ||||
volatile unsigned char protocolIdentifier; | ||||
volatile unsigned char reserved; | ||||
volatile unsigned char userApplication; | ||||
volatile unsigned char packetID[2]; | ||||
volatile unsigned char packetSequenceControl[2]; | ||||
volatile unsigned char packetLength[2]; | ||||
paul@pc-solar1.lab-lpp.local
|
r18 | volatile unsigned char dataFieldHeader[10]; | ||
paul@pc-solar1.lab-lpp.local
|
r17 | volatile unsigned char data[LENGTH_TM_LFR_TC_EXE_MAX - 10 + 1]; | ||
}; | ||||
paul@pc-solar1.lab-lpp.local
|
r18 | typedef struct Packet_TM_LFR_TC_EXE_str Packet_TM_LFR_TC_EXE_t; | ||
paul@pc-solar1.lab-lpp.local
|
r17 | struct Packet_TM_LFR_SCIENCE_NORMAL_WF_str | ||
{ | ||||
volatile unsigned char targetLogicalAddress; | ||||
volatile unsigned char protocolIdentifier; | ||||
volatile unsigned char reserved; | ||||
volatile unsigned char userApplication; | ||||
volatile unsigned char packetID[2]; | ||||
volatile unsigned char packetSequenceControl[2]; | ||||
volatile unsigned char packetLength[2]; | ||||
paul@pc-solar1.lab-lpp.local
|
r18 | volatile unsigned char dataFieldHeader[10]; | ||
volatile unsigned char auxiliaryHeader[6]; | ||||
paul@pc-solar1.lab-lpp.local
|
r17 | volatile unsigned char data[LENGTH_TM_LFR_SCIENCE_NORMAL_WF_MAX - 10 + 1]; | ||
}; | ||||
paul@pc-solar1.lab-lpp.local
|
r18 | typedef struct Packet_TM_LFR_SCIENCE_NORMAL_WF_str Packet_TM_LFR_SCIENCE_NORMAL_WF_t; | ||
paul@pc-solar1.lab-lpp.local
|
r3 | struct ExtendedTMHeader_str | ||
paul@pc-solar1.lab-lpp.local
|
r18 | { | ||
paul@pc-solar1.lab-lpp.local
|
r3 | volatile unsigned char targetLogicalAddress; | ||
volatile unsigned char protocolIdentifier; | ||||
volatile unsigned char reserved; | ||||
volatile unsigned char userApplication; | ||||
volatile unsigned char packetID[2]; | ||||
volatile unsigned char packetSequenceControl[2]; | ||||
volatile unsigned char packetLength[2]; | ||||
paul@pc-solar1.lab-lpp.local
|
r18 | volatile unsigned char dataFieldHeader[10]; | ||
paul@pc-solar1.lab-lpp.local
|
r3 | volatile unsigned char auxiliaryHeader[6]; | ||
paul
|
r0 | }; | ||
paul@pc-solar1.lab-lpp.local
|
r18 | typedef struct ExtendedTMHeader_str ExtendedTMHeader_t; | ||
paul
|
r0 | |||
paul@pc-solar1.lab-lpp.local
|
r2 | struct ccsdsTelecommandPacket_str | ||
{ | ||||
paul@pc-solar1.lab-lpp.local
|
r3 | //unsigned char targetLogicalAddress; // removed by the grspw module | ||
paul@pc-solar1.lab-lpp.local
|
r2 | volatile unsigned char protocolIdentifier; | ||
volatile unsigned char reserved; | ||||
volatile unsigned char userApplication; | ||||
volatile unsigned char packetID[2]; | ||||
volatile unsigned char packetSequenceControl[2]; | ||||
volatile unsigned char packetLength[2]; | ||||
paul@pc-solar1.lab-lpp.local
|
r18 | volatile unsigned char dataFieldHeader[4]; | ||
paul@pc-solar1.lab-lpp.local
|
r2 | volatile unsigned char dataAndCRC[CCSDS_TC_PKT_MAX_SIZE-10]; | ||
}; | ||||
paul@pc-solar1.lab-lpp.local
|
r18 | typedef struct ccsdsTelecommandPacket_str ccsdsTelecommandPacket_t; | ||
paul
|
r0 | |||
paul@pc-solar1.lab-lpp.local
|
r21 | struct Packet_TM_LFR_HK_str | ||
{ | ||||
volatile unsigned char targetLogicalAddress; | ||||
volatile unsigned char protocolIdentifier; | ||||
volatile unsigned char reserved; | ||||
volatile unsigned char userApplication; | ||||
volatile unsigned char packetID[2]; | ||||
volatile unsigned char packetSequenceControl[2]; | ||||
volatile unsigned char packetLength[2]; | ||||
volatile unsigned char dataFieldHeader[10]; | ||||
volatile unsigned char sid; | ||||
//************** | ||||
// HK PARAMETERS | ||||
paul@pc-solar1.lab-lpp.local
|
r20 | unsigned char lfr_status_word[2]; | ||
unsigned char lfr_sw_version[4]; | ||||
// tc statistics | ||||
unsigned char hk_lfr_update_info_tc_cnt[2]; | ||||
unsigned char hk_lfr_update_time_tc_cnt[2]; | ||||
unsigned char hk_dpu_exe_tc_lfr_cnt[2]; | ||||
unsigned char hk_dpu_rej_tc_lfr_cnt[2]; | ||||
unsigned char hk_lfr_last_exe_tc_id[2]; | ||||
unsigned char hk_lfr_last_exe_tc_type[2]; | ||||
unsigned char hk_lfr_last_exe_tc_subtype[2]; | ||||
unsigned char hk_lfr_last_exe_tc_time[6]; | ||||
unsigned char hk_lfr_last_rej_tc_id[2]; | ||||
unsigned char hk_lfr_last_rej_tc_type[2]; | ||||
unsigned char hk_lfr_last_rej_tc_subtype[2]; | ||||
unsigned char hk_lfr_last_rej_tc_time[6]; | ||||
// anomaly statistics | ||||
unsigned char hk_lfr_le_cnt[2]; | ||||
unsigned char hk_lfr_me_cnt[2]; | ||||
unsigned char hk_lfr_he_cnt[2]; | ||||
unsigned char hk_lfr_last_er_rid[2]; | ||||
unsigned char hk_lfr_last_er_code; | ||||
unsigned char hk_lfr_last_er_time[6]; | ||||
// vhdl_blk_status | ||||
unsigned char hk_lfr_vhdl_aa_sm; | ||||
unsigned char hk_lfr_vhdl_fft_sr; | ||||
unsigned char hk_lfr_vhdl_cic_hk; | ||||
unsigned char hk_lfr_vhdl_iir_cal; | ||||
// spacewire_if_statistics | ||||
unsigned char hk_lfr_dpu_spw_pkt_rcv_cnt[2]; | ||||
unsigned char hk_lfr_dpu_spw_pkt_sent_cnt[2]; | ||||
unsigned char hk_lfr_dpu_spw_tick_out_cnt; | ||||
unsigned char hk_lfr_dpu_spw_last_timc; | ||||
// ahb error statistics | ||||
unsigned int hk_lfr_last_fail_addr; | ||||
// temperatures | ||||
unsigned char hk_lfr_temp_scm[2]; | ||||
unsigned char hk_lfr_temp_pcb[2]; | ||||
unsigned char hk_lfr_temp_fpga[2]; | ||||
// error counters | ||||
unsigned char hk_lfr_dpu_spw_parity; | ||||
unsigned char hk_lfr_dpu_spw_disconnect; | ||||
unsigned char hk_lfr_dpu_spw_escape; | ||||
unsigned char hk_lfr_dpu_spw_credit; | ||||
unsigned char hk_lfr_dpu_spw_write_sync; | ||||
unsigned char hk_lfr_dpu_spw_rx_ahb; | ||||
unsigned char hk_lfr_dpu_spw_tx_ahb; | ||||
unsigned char hk_lfr_dpu_spw_header_crc; | ||||
unsigned char hk_lfr_dpu_spw_data_crc; | ||||
unsigned char hk_lfr_dpu_spw_early_eop; | ||||
unsigned char hk_lfr_dpu_spw_invalid_addr; | ||||
unsigned char hk_lfr_dpu_spw_eep; | ||||
unsigned char hk_lfr_dpu_spw_rx_too_big; | ||||
// timecode | ||||
unsigned char hk_lfr_timecode_erroneous; | ||||
unsigned char hk_lfr_timecode_missing; | ||||
unsigned char hk_lfr_timecode_invalid; | ||||
// time | ||||
unsigned char hk_lfr_time_timecode_it; | ||||
unsigned char hk_lfr_time_not_synchro; | ||||
unsigned char hk_lfr_time_timecode_ctr; | ||||
// hk_lfr_buffer_dpu_ | ||||
unsigned char hk_lfr_buffer_dpu_tc_fifo; | ||||
unsigned char hk_lfr_buffer_dpu_tm_fifo; | ||||
// hk_lfr_ahb_ | ||||
unsigned char hk_lfr_ahb_correctable; | ||||
unsigned char hk_lfr_ahb_uncorrectable; | ||||
unsigned char hk_lfr_ahb_fails_trans; | ||||
// hk_lfr_adc_ | ||||
unsigned char hk_lfr_adc_failure; | ||||
unsigned char hk_lfr_adc_timeout; | ||||
unsigned char hk_lfr_toomany_err; | ||||
// hk_lfr_cpu_ | ||||
unsigned char hk_lfr_cpu_write_err; | ||||
unsigned char hk_lfr_cpu_ins_access_err; | ||||
unsigned char hk_lfr_cpu_illegal_ins; | ||||
unsigned char hk_lfr_cpu_privilegied_ins; | ||||
unsigned char hk_lfr_cpu_register_hw; | ||||
unsigned char hk_lfr_cpu_not_aligned; | ||||
unsigned char hk_lfr_cpu_data_exception; | ||||
unsigned char hk_lfr_cpu_div_exception; | ||||
unsigned char hk_lfr_cpu_arith_overflow; | ||||
}; | ||||
paul@pc-solar1.lab-lpp.local
|
r21 | typedef struct Packet_TM_LFR_HK_str Packet_TM_LFR_HK_t; | ||
paul@pc-solar1.lab-lpp.local
|
r20 | |||
paul
|
r0 | #endif // CCSDS_H_INCLUDED | ||