//2013.10.25 /******************************************************************************* * モジュール名称 :APP01 - CMD from DMC to DPU (for 'MSA' task) * * 作成日・作成者 :2012/12/19 Y.K. * * * * 参照 : app01_DPU.c を参照のこと * * 注意 : EDIT権限は、MPPE/MSA組 * ********************************************************************************/ #include "app_common.h" #include "app_MPPE-MSA.h" // *** Prototype - MSA *** unsigned char app01_MSA ( unsigned int, unsigned char * , int); // //unsigned char app01_InitVar_MSA ( void ); //unsigned char app01_ErrClr_MSA ( void ); unsigned char app01_InitVar2_MSA ( void ); // ************************************** // *** MSA: CMD analyses / execution *** // ************************************** unsigned char app01_MSA ( unsigned int ui_Cntl, unsigned char uc_Data[], int i_Size ) { unsigned char uc_flag = 0; struct _s_MSA_Command *pCmd; //コマンド struct _s_MSA_CtrlParam *pCtrl; //制御用のフラグ及びパラメータ pCtrl = &Gst_MSA_ctrl; pCmd = &Gst_MSA_cmd; pCmd->uc_cnt++; pCmd->uc_ans[0] = ui_Cntl >> 8 & 0xff; pCmd->uc_ans[1] = ui_Cntl & 0xff; if (i_Size > 0) pCmd->uc_ans[2] = uc_Data[0]; else pCmd->uc_ans[2] = 0xee; if (i_Size > 1) pCmd->uc_ans[3] = uc_Data[1]; else pCmd->uc_ans[3] = 0xec; if (ui_Cntl == 0x0010) uc_flag = app01_InitVar2_MSA(); //MSA_SWINIT else if (ui_Cntl == 0x0011) { pCmd->uc_err_cnt = 0; //MSA_ERRCLR pCtrl->uc_HK_anmly = 0; } else if (ui_Cntl == 0x0012) { pCtrl->uc_eng_sci = (uc_Data[0])? 1:0; //MSA_DATA_MODE pCtrl->uc_mode = uc_Data[1] & 0x0f; } else if (ui_Cntl == 0x0013) pCtrl->uc_HKmon_ena = uc_Data[1] & 0x01; //MSA_SET_HK_MON else if (ui_Cntl == 0x0002) { //MSA_CNT1_SET if (uc_Data[1] == 0x06) uc_flag = app_PiCmd(Gd_N_MSA, &uc_Data[2], 6); //SEND MSA CMD via MDP if (uc_Data[1] == 0x07) pCtrl->uc_LMlm = uc_Data[3]; //Upper lim else uc_flag = 0xFF; } else uc_flag = 0xFF; // *** Error: CMD not found *** if (uc_flag) pCmd->uc_err_cnt++; //エラーカウンタ return( uc_flag ); } unsigned char app01_InitVar2_MSA() { int i; struct _s_MSA_CtrlParam *pCtrl; //制御用のフラグ及びパラメータ struct _s_MSA_Command *pCmd; //コマンド pCtrl = &Gst_MSA_ctrl; pCmd = &Gst_MSA_cmd; pCtrl->uc_eng_sci = 0; //1:Eng, 0:Sci pCtrl->uc_mode = 0; //1:Eng(0-4), 0:Sci(0-8) pCtrl->uc_HKmon_ena = 0x00; //Monitor OFF pCtrl->uc_HK_anmly = 0; pCtrl->uc_Hmode_trg = 0; pCtrl->uc_Hmode_run = 0; //1:on Hmode, 0: on Mmode pCtrl->uc_Mmode = 1; //M mode# before starting H mode pCtrl->j_rec = 0; pCtrl->uc_LMlm = 2; //1spinの処理パケット数の制限:圧縮無しの場合は2 Gst_MSA_dat.us_Llen_ttl = 0; //Lproduct data長 //コマンドアンサ pCmd->uc_cnt = 0; pCmd->uc_err_cnt = 0; for (i = 0; i < 4; ++i) pCmd->uc_ans[i] = 0; Guc_TLMm_cmp[Gd_N_MSA] = Guc_TLMh_cmp[Gd_N_MSA] = 3; // *** rev 121219 by YK *** - USR圧縮前提 return 0; } // **********************************************************************************************************