Exemple #1
0
        private void updateButton_Click(object sender, EventArgs e)
        {
            Args        = new uint[6];
            RyzenAccess = new RyzenSmu.RyzenSmu();
            RyzenAccess.Initialize();
            if (RyzenAccess.SendPsmu(0x66, ref Args) == RyzenSmu.RyzenSmu.Status.OK)
            {
                Address = Args[0];
                Args[0] = 0;
                if (RyzenAccess.SendPsmu(0x65, ref Args) == RyzenSmu.RyzenSmu.Status.OK)
                {
                    String MonitoringText = "";

                    for (int i = 0; i < 410; i++)
                    {
                        RyzenSmu.RyzenSmu.CounterIndex CurrentOffset = (RyzenSmu.RyzenSmu.CounterIndex)(i * 4);
                        if (CurrentOffset.ToString() != "")
                        {
                            MonitoringText += CurrentOffset.ToString() + ": " + (RyzenAccess.ReadFloat(Address, 0x0)).ToString() + "\n";
                        }
                    }
                    monitoringTextBox.Text = MonitoringText;
                }
            }
        }
Exemple #2
0
        public RMT()
        {
            InitializeComponent();
            fastLimit                     = -1;
            slowLimit                     = -1;
            stapmLimit                    = -1;
            slowTime                      = -1;
            stapmTime                     = -1;
            currentLimit                  = -1;
            upDownTctlTemp.Enabled        = false;
            upDownStapmLimit.Enabled      = false;
            upDownSlowTime.Enabled        = false;
            upDownStapmTime.Enabled       = false;
            upDownCurrentLimit.Enabled    = false;
            upDownSlowLimit.Enabled       = false;
            upDownFastLimit.Enabled       = false;
            upDownMaxCurrentLimit.Enabled = false;

            if (true)
            {
                Args        = new uint[6];
                RyzenAccess = new RyzenSmu.RyzenSmu();
                RyzenAccess.Initialize();
                if (RyzenAccess.SendPsmu(0x66, ref Args) == RyzenSmu.RyzenSmu.Status.OK)
                {
                    Address = Args[0];
                    Args[0] = 0;
                    if (RyzenAccess.SendPsmu(0x65, ref Args) == RyzenSmu.RyzenSmu.Status.OK)
                    {
                        upDownStapmLimit.Value = (decimal)(RyzenAccess.ReadFloat(Address, 0x0));
                        upDownFastLimit.Value  = (decimal)(RyzenAccess.ReadFloat(Address, 0x2));
                        upDownSlowLimit.Value  = (decimal)(RyzenAccess.ReadFloat(Address, 0x4));

                        upDownSlowTime.Value  = (decimal)(RyzenAccess.ReadFloat(Address, 0x221));
                        upDownStapmTime.Value = (decimal)(RyzenAccess.ReadFloat(Address, 0x220));

                        upDownTctlTemp.Value        = (decimal)(RyzenAccess.ReadFloat(Address, 0x10));
                        upDownCurrentLimit.Value    = (decimal)(RyzenAccess.ReadFloat(Address, 0x8));
                        upDownMaxCurrentLimit.Value = (decimal)(RyzenAccess.ReadFloat(Address, 0xC));

                        //upDownSocCurrentLimit.Value = (decimal)(RyzenAccess.ReadFloat(Address, 0xA));
                        //upDownSocMaxCurrentLimit.Value = (decimal)(RyzenAccess.ReadFloat(Address, 0xE));
                    }
                }
            }
        }
Exemple #3
0
        private void ApplySettings_Click(object sender, EventArgs e)
        {
            RyzenAccess = new RyzenSmu.RyzenSmu();

            RyzenAccess.Initialize();

            String exe = Directory.GetCurrentDirectory() + "\\smu-tool\\smu-tool.exe";

            int i = 0;

            RyzenSmu.RyzenSmu.Status[] Statuses = new RyzenSmu.RyzenSmu.Status[8];
            Args = new uint[6];

            if (checkStapmLimit.Checked)
            {
                //Set Msg and Args
                Msg     = 0x14;
                Args[0] = (uint)Convert.ToInt32(upDownStapmLimit.Value * 1000);

                //Send msg
                Statuses[i++] = RyzenAccess.SendMp1(Msg, ref Args);

                //args = String.Format("--message=0x14 --arg0={0:0}000", upDownStapmLimit.Value);
                //var proc = System.Diagnostics.Process.Start(exe, args);
            }

            if (checkFastLimit.Checked)
            {
                //Set Msg and Args
                Msg     = 0x15;
                Args[0] = (uint)Convert.ToInt32(upDownFastLimit.Value * 1000);

                //Send msg
                Statuses[i++] = RyzenAccess.SendMp1(Msg, ref Args);

                //args = String.Format("--message=0x15 --arg0={0:0}000", upDownFastLimit.Value);
                //var proc = System.Diagnostics.Process.Start(exe, args);
            }

            if (checkSlowLimit.Checked)
            {
                //Set Msg and Args
                Msg     = 0x16;
                Args[0] = (uint)Convert.ToInt32(upDownSlowLimit.Value * 1000);

                //Send msg
                Statuses[i++] = RyzenAccess.SendMp1(Msg, ref Args);

                //args = String.Format("--message=0x16 --arg0={0:0}000", upDownSlowLimit.Value);
                //var proc = System.Diagnostics.Process.Start(exe, args);
            }

            if (checkSlowTime.Checked)
            {
                //Set Msg and Args
                Msg     = 0x17;
                Args[0] = (uint)Convert.ToInt32(upDownSlowTime.Value);

                //Send msg
                Statuses[i++] = RyzenAccess.SendMp1(Msg, ref Args);

                //args = String.Format("--message=0x17 --arg0={0:0}", upDownSlowTime.Value);
                //var proc = System.Diagnostics.Process.Start(exe, args);
            }

            if (checkStapmTime.Checked)
            {
                //Set Msg and Args
                Msg     = 0x18;
                Args[0] = (uint)Convert.ToInt32(upDownStapmTime.Value);

                //Send msg
                Statuses[i++] = RyzenAccess.SendMp1(Msg, ref Args);

                //args = String.Format("--message=0x18 --arg0={0:0}", upDownStapmTime.Value);
                //var proc = System.Diagnostics.Process.Start(exe, args);
            }

            if (checkTctlTemp.Checked)
            {
                //Set Msg and Args
                Msg     = 0x19;
                Args[0] = (uint)Convert.ToInt32(upDownTctlTemp.Value);

                //Send msg
                Statuses[i++] = RyzenAccess.SendMp1(Msg, ref Args);

                //args = String.Format("--message=0x19 --arg0={0:0}", upDownTctlTemp.Value);
                //var proc = System.Diagnostics.Process.Start(exe, args);
            }

            if (checkCurrentLimit.Checked)
            {
                //Set Msg and Args
                Msg     = 0x1A;
                Args[0] = (uint)Convert.ToInt32(upDownCurrentLimit.Value * 1000);

                //Send msg
                Statuses[i++] = RyzenAccess.SendMp1(Msg, ref Args);

                //args = String.Format("--message=0x1A --arg0={0:0}000", upDownCurrentLimit.Value);
                //var proc = System.Diagnostics.Process.Start(exe, args);
            }
            if (checkMaxCurrentLimit.Checked)
            {
                //Set Msg and Args
                Msg     = 0x1C;
                Args[0] = (uint)Convert.ToInt32(upDownMaxCurrentLimit.Value * 1000);

                //Send msg
                Statuses[i++] = RyzenAccess.SendMp1(Msg, ref Args);

                //args = String.Format("--message=0x1C --arg0={0:0}000", upDownMaxCurrentLimit.Value);
                //var proc = System.Diagnostics.Process.Start(exe, args);
            }

            /*
             * IF "%Stapm%" NEQ "" smu-tool.exe -m --message=0x14 --arg0=%Stapm%000
             * IF "%Fast%" NEQ "" smu-tool.exe -m --message=0x15 --arg0=%Fast%000
             * IF "%Slow%" NEQ "" smu-tool.exe -m --message=0x16 --arg0=%Slow%000
             * IF "%SlowTime%" NEQ "" smu-tool.exe -m --message=0x17 --arg0=%SlowTime%
             * IF "%StapmTime%" NEQ "" smu-tool.exe -m --message=0x18 --arg0=%StapmTime%
             * IF "%Tctl%" NEQ "" smu-tool.exe -m --message=0x19 --arg0=%Tctl%
             * IF "%Current%" NEQ "" smu-tool.exe -m --message=0x1A --arg0=%Current%000
             * IF "%MaxCurrent%" NEQ "" smu-tool.exe -m --message=0x1C --arg0=%MaxCurrent%000
             */

            for (int j = 0; j < i; j++)
            {/*
              * if (Statuses[j] != RyzenSmu.RyzenSmu.Status.OK)
              * {
              *     throw new ApplicationException($"{j:D}-Status: " + Statuses[j].ToString());
              * }*/
            }

            RyzenAccess.Deinitialize();
        }