forked from irusanov/ZenStates-Core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAodData.cs
68 lines (62 loc) · 2.32 KB
/
AodData.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
using System;
using System.Collections.Generic;
namespace ZenStates.Core
{
// [Serializable]
public class AodData
{
public int SMTEn { get; set; }
public int MemClk { get; set; }
public int Tcl { get; set; }
public int Trcd { get; set; }
public int Trp { get; set; }
public int Tras { get; set; }
public int Trc { get; set; }
public int Twr { get; set; }
public int Trfc { get; set; }
public int Trfc2 { get; set; }
public int Trfcsb { get; set; }
public int Trtp { get; set; }
public int TrrdL { get; set; }
public int TrrdS { get; set; }
public int Tfaw { get; set; }
public int TwtrL { get; set; }
public int TwtrS { get; set; }
public int TrdrdScL { get; set; }
public int TrdrdSc { get; set; }
public int TrdrdSd { get; set; }
public int TrdrdDd { get; set; }
public int TwrwrScL { get; set; }
public int TwrwrSc { get; set; }
public int TwrwrSd { get; set; }
public int TwrwrDd { get; set; }
public int Twrrd { get; set; }
public int Trdwr { get; set; }
public int CadBusDrvStren { get; set; }
public int ProcDataDrvStren { get; set; }
public int ProcODT { get; set; }
public int DramDataDrvStren { get; set; }
public int RttNomWr { get; set; }
public int RttNomRd { get; set; }
public int RttWr { get; set; }
public int RttPark { get; set; }
public int RttParkDqs { get; set; }
public int MemVddio { get; set; }
public int MemVddq { get; set; }
public int MemVpp { get; set; }
public int ApuVddio { get; set; }
public static AodData CreateFromByteArray(byte[] byteArray, Dictionary<string, int> fieldDictionary)
{
AodData data = new AodData();
foreach (var entry in fieldDictionary)
{
string fieldName = entry.Key;
int fieldOffset = entry.Value;
// Each property corresponds to 4 bytes in the byte array
int fieldValue = BitConverter.ToInt32(byteArray, fieldOffset);
typeof(AodData).GetProperty(fieldName)?.SetValue(data, fieldValue, null);
}
return data;
}
}
}