private void numUP_Input0_ValueChanged(object sender, EventArgs e) { reg[inputBF[0]].BFValue = (uint)Math.Round((double)this.numUP_Input0.Value * Math.Pow(2, 23)); myRegOp.RegWrite(reg); myRegOp.UpdateRegSettingSource(); }
private void btn_Update_Click(object sender, EventArgs e) { try { regList[0]["ae[25:0]"].BFValue = ae; regList[0]["(1-ae)[25:0]"].BFValue = we; regList[1]["aa[25:0]"].BFValue = aa; regList[1]["(1-aa)[25:0]"].BFValue = wa; regList[2]["ad[25:0]"].BFValue = ad; regList[2]["(1-ad)[25:0]"].BFValue = wd; regList[3].RegValue = T_ThresholddB; regList[4].RegValue = K_slopedB; regList[5].RegValue = O_offsetdB; regList[6][bf_DRC_EN].BFValue = DRC_EN ? 1u : 0u; myRegOp.RegWrite(regList.ToArray()); myRegOp.UpdateRegSettingSource(); } catch { MessageBox.Show("Update failed!!!"); } }
private void numUP_Input_ValueChanged(object sender, EventArgs e) { reg[inputBF].BFValue = (uint)Math.Round((double)this.numUP_Input.Value * Math.Pow(2, format_FractionalCount)); myRegOp.RegWrite(reg); myRegOp.UpdateRegSettingSource(); }
private void rdbtn_CHL_Source_CheckedChanged(object sender, EventArgs e) { if (regMap == null) { return; } uint bfValue = 0; bfValue = rdbtn_CHL_SourceL.Checked ? 0u : (rdbtn_CHL_SourceR.Checked ? 1u : 2u); if (regMap[0x20]["SDIN_TO_CH1"].BFValue != bfValue) { regMap[0x20]["SDIN_TO_CH1"].BFValue = bfValue; myRegOp.RegWrite(regMap[0x20]); myRegOp.UpdateRegSettingSource(); } }
private void btn_Download_Param_Click(object sender, EventArgs e) { #region GUI control switch (mode) { case 0: this.grb_2p0.Visible = true; this.grb_2p1.Visible = false; this.grb_PBTL.Visible = false; //this.grb_2p0.Location = new Point(12, 12); //this.Size = new Size(this.grb_2p0.Width + 40, this.grb_2p0.Height + 60); //this.MaximumSize = this.Size; //this.MinimumSize = this.Size; if (!CheckOutputUnique(cmb_2p0_Out1, cmb_2p0_Out2, cmb_2p0_Out3, cmb_2p0_Out4)) { MessageBox.Show("Please make sure all output item is unique and try again!"); return; } break; case 1: this.grb_2p0.Visible = false; this.grb_2p1.Visible = true; this.grb_PBTL.Visible = false; //this.grb_2p1.Location = new Point(12, 12); //this.Size = new Size(this.grb_2p1.Width + 40, this.grb_2p1.Height + 60); //this.MaximumSize = this.Size; //this.MinimumSize = this.Size; if (!CheckOutputUnique(cmb_2p1_Out1, cmb_2p1_Out2, cmb_2p1_Out3, cmb_2p1_Out4)) { MessageBox.Show("Please make sure all output item is unique and try again!"); return; } break; case 2: this.grb_2p0.Visible = false; this.grb_2p1.Visible = false; this.grb_PBTL.Visible = true; //this.grb_PBTL.Location = new Point(12, 12); //this.Size = new Size(this.grb_PBTL.Width + 40, this.grb_PBTL.Height + 60); //this.MaximumSize = this.Size; //this.MinimumSize = this.Size; if (!CheckOutputUnique(cmb_PBTL_Out1, cmb_PBTL_Out2, cmb_PBTL_Out3, cmb_PBTL_Out4)) { MessageBox.Show("Please make sure all output item is unique and try again!"); return; } break; } #endregion Register tempReg = regMap[0x25]; switch (mode) { case 0: // 2.0 PWM 1 3 2 4 RegSetting(this.cmb_2p0_Out1.SelectedIndex, 0x00); RegSetting(this.cmb_2p0_Out2.SelectedIndex, 0x02); RegSetting(this.cmb_2p0_Out3.SelectedIndex, 0x01); RegSetting(this.cmb_2p0_Out4.SelectedIndex, 0x03); break; case 1: // 2.1 PWM 1 2 3 4 RegSetting(this.cmb_2p1_Out1.SelectedIndex, 0x00); RegSetting(this.cmb_2p1_Out2.SelectedIndex, 0x01); RegSetting(this.cmb_2p1_Out3.SelectedIndex, 0x02); RegSetting(this.cmb_2p1_Out4.SelectedIndex, 0x03); break; case 2: // PBTL PWM 1 1 3 3 RegSetting(this.cmb_PBTL_Out1.SelectedIndex, 0x00); RegSetting(this.cmb_PBTL_Out2.SelectedIndex, 0x00); RegSetting(this.cmb_PBTL_Out3.SelectedIndex, 0x02); RegSetting(this.cmb_PBTL_Out4.SelectedIndex, 0x02); break; } //Console.WriteLine("Reg25 Reg:" + tempReg.RegValueString); //Console.WriteLine("OutA:"+ tempReg.GetBFValue("MUX_TO_OUT_A")); //Console.WriteLine("OutB:" + tempReg.GetBFValue("MUX_TO_OUT_B")); //Console.WriteLine("OutC:" + tempReg.GetBFValue("MUX_TO_OUT_C")); //Console.WriteLine("OutD:" + tempReg.GetBFValue("MUX_TO_OUT_D")); myRegOp.RegWrite(0x25); myRegOp.UpdateRegSettingSource(); }
private void btn_ReadReg_Click(object sender, EventArgs e) { myRegOp.RegRead(this.regAddrList); myRegOp.UpdateRegSettingSource(); }