Esempio n. 1
0
        ///
        ///
        /// 將MIPI class內容輸出到textbox
        ///
        ///

        private void mipi_out_form()
        {
            from_delegate controlform = new from_delegate();

            int[]  porch         = dut.get_porch_setting();
            bool[] blanking_type = dut.get_blanking_type();
            controlform.Settextbox(textbox_hbp, porch[0].ToString());
            controlform.Settextbox(textbox_hfp, porch[1].ToString());
            controlform.Settextbox(textbox_hsa, porch[2].ToString());
            controlform.Settextbox(textbox_hact, porch[3].ToString());
            controlform.Settextbox(textbox_vbp, porch[4].ToString());
            controlform.Settextbox(textbox_vfp, porch[5].ToString());
            controlform.Settextbox(textbox_vsa, porch[6].ToString());
            controlform.Settextbox(textbox_vact, porch[7].ToString());
            controlform.Settextbox(textbox_symrate, (dut.get_symbolrate() / 1E6).ToString());
            controlform.Settextbox(textbox_framerate, dut.get_framerate().ToString());
            if (blanking_type[0])
            {
                controlform.Settextbox(textbox_hsa, Color.Aqua);
            }
            else
            {
                controlform.Settextbox(textbox_hsa, Color.DodgerBlue);
            }
            if (blanking_type[0])
            {
                controlform.Settextbox(textbox_hbp, Color.Aqua);
            }
            else
            {
                controlform.Settextbox(textbox_hbp, Color.DodgerBlue);
            }
            if (blanking_type[0])
            {
                controlform.Settextbox(textbox_hfp, Color.Aqua);
            }
            else
            {
                controlform.Settextbox(textbox_hfp, Color.DodgerBlue);
            }
            if (blanking_type[0])
            {
                controlform.Settextbox(textbox_vsa, Color.Aqua);
                controlform.Settextbox(textbox_vbp, Color.Aqua);
                controlform.Settextbox(textbox_vfp, Color.Aqua);
            }
            else
            {
                controlform.Settextbox(textbox_vsa, Color.DodgerBlue);
                controlform.Settextbox(textbox_vbp, Color.DodgerBlue);
                controlform.Settextbox(textbox_vfp, Color.DodgerBlue);
            }
        }
Esempio n. 2
0
        public int set_prameter(MIPI mipi)
        {
            int rc = client.Connect("", SERVER_PORT);

            if (rc < 0)
            {
                return(0);
            }
            int[]  porch = mipi.get_porch_setting();
            double fr    = mipi.get_framerate();

            double[] phy_volt      = mipi.get_phy_volt();
            bool[]   video_type    = mipi.get_video_type();
            bool[]   blanking_type = mipi.get_blanking_type();

            //**HS,LP電壓,symbol rate , lp freq , lane數
            RPCCmd(RPCCmds.START_EDIT_CONFIG);
            RPCCmd(RPCCmds.SET_DT_MODE, RPCDefs.DT_HS);
            RPCCmd(RPCCmds.SET_LP_FREQ, mipi.get_lp_freq());
            RPCCmd(RPCCmds.SET_HS_SYM_RATE, mipi.get_symbolrate());
            RPCCmd(RPCCmds.SET_LANE_CNT, mipi.get_lane());
            RPCCmd(RPCCmds.SET_HS_HIGH_VOLT, 1, phy_volt[0]);
            RPCCmd(RPCCmds.SET_HS_LOW_VOLT, 1, phy_volt[1]);
            RPCCmd(RPCCmds.SET_LP_HIGH_VOLT, phy_volt[2]);
            RPCCmd(RPCCmds.SET_LP_LOW_VOLT, phy_volt[3]);
            RPCCmd(RPCCmds.END_EDIT_CONFIG);


            ///porch,resolution寫進PG
            RPCCmd(RPCCmds.SET_TIMING_HBPORCH, porch[0]);
            RPCCmd(RPCCmds.SET_TIMING_HFPORCH, porch[1]);
            RPCCmd(RPCCmds.SET_TIMING_HSYNC, porch[2]);
            RPCCmd(RPCCmds.SET_TIMING_HACTIVE, porch[3]);
            RPCCmd(RPCCmds.SET_TIMING_VBPORCH, porch[4]);
            RPCCmd(RPCCmds.SET_TIMING_VFPORCH, porch[5]);
            RPCCmd(RPCCmds.SET_TIMING_VSYNC, porch[6]);
            RPCCmd(RPCCmds.SET_TIMING_VACTIVE, porch[7]);
            RPCCmd(RPCCmds.SET_TIMING_FRAME_RATE, mipi.get_framerate());

            ////Video type,blanking type寫入
            RPCCmd(RPCCmds.SET_TIMING_ENABLE_DSI_BURST_MODE, video_type[0]);
            RPCCmd(RPCCmds.SET_TIMING_ENABLE_DSI_PULSE_MODE, video_type[1]);
            RPCCmd(RPCCmds.SET_TIMING_HSYNC_BLANKING_MODE, blanking_type[0] ? 1 : 2);
            RPCCmd(RPCCmds.SET_TIMING_HBPORCH_BLANKING_MODE, blanking_type[1] ? 1 : 2);
            RPCCmd(RPCCmds.SET_TIMING_HFPORCH_BLANKING_MODE, blanking_type[2] ? 1 : 2);
            RPCCmd(RPCCmds.SET_TIMING_VERTICAL_BLANKING_MODE, blanking_type[3] ? 1 : 2);

            return(0);
        }