// $RCSfile: hs_hdl.h,v $Revision: 1.25 $Date: 2005/03/11 15:08:57 #ifndef __TUNING_H__ #define __TUNING_H__ //---------- Tasks defined in this module ------------------------- extern void vm_mon ( void ); extern void hs_hdl ( void ); // functions extern int wbs_integrate (unsigned int, int, int); extern int hrs_integrate (unsigned int, int, int); extern void task_hs_hdl_sleep (unsigned int sleep_time); extern int check_fifo_pending_frames (void); extern void reset_vm_mon ( unsigned int this_hif_n_wbs ); extern void asynchronous_ls_access(unsigned int * cmd_address); // variables extern K_SEMA Sema_Wait_Group[]; extern int mixer_magnet_data[MAX_MIXMAG_DATA]; extern int dip_scan_if_data[MAX_DIPSCAN_DATA]; extern int mixer_mag_steps_performed; extern int dip_scan_if_cur_step; extern int current_command_number; // progressive number attached to the current command extern int fifo_0_pending_frames; // counter of the frames for this fifo still being processed by the OBS HS system extern int fifo_1_pending_frames; extern int fifo_2_pending_frames; extern int fifo_3_pending_frames; extern int fifo_0_command_number; // command_number for which the last frame was requested extern int fifo_1_command_number; extern int fifo_2_command_number; extern int fifo_3_command_number; extern int abort_is_running; extern int perform_goto_safe_after_abort; // global defines #define WAIT_LS_END_TIME 3 #define COMMAND_TRANSMIT_TIME 1 // Parameters for the tuning messages: #define STEPTIME_IDX 0 #define CH1_C0_IDX 1 #define CV1_C0_IDX 2 #define STEPSIZE_IDX 3 #define HFDH1_MXBAND_IDX 4 #define NMAGNET_IDX 8 #define MIX_MAG_HKDATA 8 #define MIX_MAG_HKOFFSET 9 #define MIX_MAG_DATA 10 #define DIP_SCAN_HKOFFSET 8 #define DIP_SCAN_DATA 24 // number of 16-bit words to be repeated HIF_Ndiplexer times in // a diplexer scan with if power report // these are the actions performed by task hs_hdl. I.e. the possible values for the switched variable #define HRS_ATTSETT_ID 18 #define WBS_ATTSETT_ID 19 #define ZSCAN_ID 20 #define TUNE_HMIXMAG_ID 21 #define TUNE_WMIXMAG_ID 22 #define DIP_SCAN_IF_ID 23 #define HRS_ATTSETT2_ID 33 #define WBS_ATTSETT2_ID 34 #define WBS_ATTSETT3_ID 35 #define START_SPECTR_WBS_COMB_ID 36 #define START_SPECTR_WBS_ZERO_ID 37 #define WBS_COMB_STEP1_ID 38 // id for the first step of the wbs calibration proc #define WBS_COMB_STEP2_ID 39 // id for the second step of the wbs calibration proc #define SPECTROSCOPY_WBS_ZERO_ID 40 // id for the wbs zero measurement #define MKSTEP_MEM_DUMP 41 // id for making a step of the mem dumping #define MKSTEP_SIM_SCI 42 // id for making a step of simulated science #define PEAKUP_ACQUIRE_HRS 43 #define PEAKUP_ACQUIRE_WBS 44 #define MKSTEP_CHECK_PM 45 // id for making a step of the check PM command #define ENG_SCAN_ID 46 #define START_HRS_FUNCTEST 47 // hrs functional test #define HRS_FUNCTEST 48 // AID_spectroscopy for hrs functional test #define HRS_TUNE_INIT 49 // AID_spectroscopy for hrs tuning initial step #define LCU_MEM_DUMP_ID 50 #define START_NEW_CALIB_INIT 51 // codes of hs_hdl for new calibrate #define MKSTEP_NEW_CALIB_INIT 52 #define START_NEW_CALIB_RUN 53 #define MKSTEP_NEW_CALIB_RUN 54 #define NEW_CALIB_INIT_AID 55 // codes of aid_spectroscopy for new calibrate #define NEW_CALIB_RUN_AID 56 #define NEW_CALIB_CLOSE_AID 57 #define START_HRS_TUNING 100 // id for starting the hrs tuning command #define START_TOTAL_POWER 101 // id for starting the total power command #define START_SLOW_CHOP 102 // id for starting the slow chop command #define START_FREQ_SWITCH 103 // id for starting the freq switch command #define START_WBS_TUNING 104 // id for starting the hrs tuning command #define START_DIPSCAN_IFP 105 // id for starting diplexer scan with if power #define START_HRS_MIXMAG 106 // id for starting the hrs mixer magnet tuning command #define START_WBS_MIXMAG 107 // id for starting the wbs mixer magnet tuning command #define START_ABORT 108 // id for starting the wbs mixer magnet tuning command #define START_FAST_CHOP 109 // id for starting the fast chop command #define START_MEM_LOAD 110 // id for starting the memory load command #define START_MEM_CHECK 111 // id for starting the memory check command #define START_MEM_DUMP 112 // id for starting the memory dump command #define START_MEM_ABORT_DUMP 113 // id for starting the abort memory dump command #define START_SIM_SCI 114 // id for starting the simulated science #define ACQUIRE_PEAKUP_HRS 116 // id for peakup acquire hrs #define ACQUIRE_PEAKUP_WBS 117 // id for peakup acquire wbs #define START_GOTO_SAFE 119 // id for goto safe #define START_CHECK_PM 120 // id for starting the check program memory command #define START_COPY_OBS 121 // id for starting the copy whole OBS #define VM_CODE_UPLOAD 122 // id for vm code upload #define START_VM_PROGRAM 123 // id for starting vm on a specified program #define START_EEPROM_WRITE 124 #define START_ENGSCAN_ROUTINE 125 // id for starting an engineering scan #define ENGSCAN_ROUTINE 126 // id for performing the body of the engineering scan #define ENGSCAN_REPORT 127 // id for sending the final report packets of an engineering scan #define SEND_MEM_DUMP_LCU_REPORT 128 // id for sending the final report of an LCU dump memory // these are additional possible values for AID_spectroscopy #define REQUIRING_HK 0 // AID_spectroscopy value when the HK task needs to request HK data to HS systems #define STOPPING_HK 1000 // AID_spectroscopy value when the HK task needs to stop making requests for HK data to HS systems #define STOPPING_VM 2000 #define STOPPING_OBS 3000 #endif // __TUNING_H__