@@ -45,7 +45,7 @@ public TemperatureSourceData(Enum source, ushort register, ushort halfRegister =
4545 private readonly ushort [ ] _voltageRegisters ;
4646 private readonly ushort _voltageVBatRegister ;
4747
48- public Nct677X ( Chip chip , byte revision , ushort port , LpcPort lpcPort )
48+ public Nct677X ( LpcPort lpcPort , Chip chip , byte revision , ushort port )
4949 {
5050 Chip = chip ;
5151 _revision = revision ;
@@ -65,7 +65,7 @@ public Nct677X(Chip chip, byte revision, ushort port, LpcPort lpcPort)
6565 }
6666 else if ( chip is Chip . NCT6683D or Chip . NCT6686D or Chip . NCT6687D ) //These work on older NCT6687D boards, but only fans 0, 1 and 3 on newer (X870 and Z890) motherboards. Unsure of controls for "next pack of 8".
6767 {
68- FAN_PWM_OUT_REG = new ushort [ ] { 0x160 , 0x161 , 0x162 , 0x163 , 0x164 , 0x165 , 0x166 , 0x167 } ; // Next 8 fans will be 0xE00, 0xE01, 0xE02, 0xE03, 0xE04, 0xE05, 0xE06, 0xE07
68+ FAN_PWM_OUT_REG = new ushort [ ] { 0x160 , 0x161 , 0x162 , 0x163 , 0x164 , 0x165 , 0x166 , 0x167 } ; // Next 8 fans will be 0xE00, 0xE01, 0xE02, 0xE03, 0xE04, 0xE05, 0xE06, 0xE07
6969 FAN_PWM_COMMAND_REG = new ushort [ ] { 0xA28 , 0xA29 , 0xA2A , 0xA2B , 0xA2C , 0xA2D , 0xA2E , 0xA2F } ; // Possibly 0X260, 0X261, 0X262, 0X263, 0X264, 0X265, 0X266, 0X267 but can't confirm
7070 FAN_CONTROL_MODE_REG = new ushort [ ] { 0xA00 , 0xA00 , 0xA00 , 0xA00 , 0xA00 , 0xA00 , 0xA00 , 0xA00 } ; // Not sure of next 8, MSI won't provide info
7171 FAN_PWM_REQUEST_REG = new ushort [ ] { 0xA01 , 0xA01 , 0xA01 , 0xA01 , 0xA01 , 0xA01 , 0xA01 , 0xA01 } ; // Not sure of next 8, MSI won't provide info
@@ -82,7 +82,7 @@ public Nct677X(Chip chip, byte revision, ushort port, LpcPort lpcPort)
8282 VENDOR_ID_HIGH_REGISTER = 0x804F ;
8383 VENDOR_ID_LOW_REGISTER = 0x004F ;
8484
85- FAN_PWM_OUT_REG = chip is Chip . NCT6797D or Chip . NCT6798D or Chip . NCT6799D
85+ FAN_PWM_OUT_REG = chip is Chip . NCT6797D or Chip . NCT6798D or Chip . NCT6799D or Chip . NCT6796DS or Chip . NCT5585D
8686 ? new ushort [ ] { 0x001 , 0x003 , 0x011 , 0x013 , 0x015 , 0xA09 , 0xB09 }
8787 : new ushort [ ] { 0x001 , 0x003 , 0x011 , 0x013 , 0x015 , 0x017 , 0x029 } ;
8888
@@ -149,10 +149,12 @@ public Nct677X(Chip chip, byte revision, ushort port, LpcPort lpcPort)
149149 case Chip . NCT6795D :
150150 case Chip . NCT6796D : // 16 voltages
151151 case Chip . NCT6796DR : // 16 voltages
152+ case Chip . NCT6796DS :
152153 case Chip . NCT6797D :
153154 case Chip . NCT6798D :
154155 case Chip . NCT6799D :
155156 case Chip . NCT6701D :
157+ case Chip . NCT5585D :
156158 switch ( chip )
157159 {
158160 case Chip . NCT6779D :
@@ -161,10 +163,12 @@ public Nct677X(Chip chip, byte revision, ushort port, LpcPort lpcPort)
161163 break ;
162164
163165 case Chip . NCT6796DR :
166+ case Chip . NCT6796DS :
164167 case Chip . NCT6797D :
165168 case Chip . NCT6798D :
166169 case Chip . NCT6799D :
167170 case Chip . NCT6701D :
171+ case Chip . NCT5585D :
168172 Fans = new float ? [ 7 ] ;
169173 Controls = new float ? [ 7 ] ;
170174 break ;
@@ -190,12 +194,47 @@ public Nct677X(Chip chip, byte revision, ushort port, LpcPort lpcPort)
190194
191195 switch ( chip )
192196 {
197+ case Chip . NCT6791D :
198+ case Chip . NCT6792D :
199+ case Chip . NCT6793D :
200+ case Chip . NCT6795D :
193201 case Chip . NCT6796D :
194202 case Chip . NCT6796DR :
195203 case Chip . NCT6797D :
204+ case Chip . NCT6701D :
205+ temperaturesSources . AddRange ( new TemperatureSourceData [ ]
206+ {
207+ new ( SourceNct67Xxd . PECI_0 , 0x073 , 0x074 , 7 , 0x100 ) ,
208+ new ( SourceNct67Xxd . CPUTIN , 0x075 , 0x076 , 7 , 0x200 , 0x491 ) ,
209+ new ( SourceNct67Xxd . SYSTIN , 0x077 , 0x078 , 7 , 0x300 , 0x490 ) ,
210+ new ( SourceNct67Xxd . AUXTIN0 , 0x079 , 0x07A , 7 , 0x800 , 0x492 ) ,
211+ new ( SourceNct67Xxd . AUXTIN1 , 0x07B , 0x07C , 7 , 0x900 , 0x493 ) ,
212+ new ( SourceNct67Xxd . AUXTIN2 , 0x07D , 0x07E , 7 , 0xA00 , 0x494 ) ,
213+ new ( SourceNct67Xxd . AUXTIN3 , 0x4A0 , 0x49E , 6 , 0xB00 , 0x495 ) ,
214+ new ( SourceNct67Xxd . AUXTIN4 , 0x027 , 0 , - 1 , 0x621 ) ,
215+ new ( SourceNct67Xxd . PCH_CHIP_CPU_MAX_TEMP , 0x674 , 0 , - 1 , 0xC28 , 0x400 ) ,
216+ new ( SourceNct67Xxd . PCH_CHIP_TEMP , 0x676 , 0 , - 1 , 0xC29 , 0x401 ) ,
217+ new ( SourceNct67Xxd . PCH_CPU_TEMP , 0x678 , 0 , - 1 , 0xC2A , 0x402 ) ,
218+ new ( SourceNct67Xxd . PCH_MCH_TEMP , 0x67A , 0 , - 1 , 0xC2B , 0x404 ) ,
219+ new ( SourceNct67Xxd . AGENT0_DIMM0 , 0x405 , 0 , - 1 ) ,
220+ new ( SourceNct67Xxd . AGENT0_DIMM1 , 0x406 , 0 , - 1 ) ,
221+ new ( SourceNct67Xxd . AGENT1_DIMM0 , 0x407 , 0 , - 1 ) ,
222+ new ( SourceNct67Xxd . AGENT1_DIMM1 , 0x408 , 0 , - 1 ) ,
223+ new ( SourceNct67Xxd . SMBUSMASTER0 , 0x150 , 0x151 , 7 , 0x622 ) ,
224+ new ( SourceNct67Xxd . SMBUSMASTER1 , 0x670 , 0 , - 1 , 0xC26 ) ,
225+ new ( SourceNct67Xxd . PECI_1 , 0x672 , 0 , - 1 , 0xC27 ) ,
226+ new ( SourceNct67Xxd . BYTE_TEMP0 , 0x419 , 0 , - 1 ) ,
227+ new ( SourceNct67Xxd . BYTE_TEMP1 , 0x41A , 0 , - 1 ) ,
228+ new ( SourceNct67Xxd . PECI_0_CAL , 0x4F4 , 0 , - 1 ) ,
229+ new ( SourceNct67Xxd . PECI_1_CAL , 0x4F5 , 0 , - 1 ) ,
230+ new ( SourceNct67Xxd . VIRTUAL_TEMP , 0 ) ,
231+ new ( SourceNct67Xxd . SPARE_TEMP , 0 ) ,
232+ new ( SourceNct67Xxd . SPARE_TEMP2 , 0 )
233+ } ) ;
234+ break ;
235+
196236 case Chip . NCT6798D :
197237 case Chip . NCT6799D :
198- case Chip . NCT6701D :
199238 temperaturesSources . AddRange ( new TemperatureSourceData [ ]
200239 {
201240 new ( SourceNct67Xxd . PECI_0 , 0x073 , 0x074 , 7 , 0x100 ) ,
@@ -214,18 +253,47 @@ public Nct677X(Chip chip, byte revision, ushort port, LpcPort lpcPort)
214253 new ( SourceNct67Xxd . PCH_CHIP_TEMP , 0x676 , 0 , - 1 , 0xC29 , 0x401 ) ,
215254 new ( SourceNct67Xxd . PCH_CPU_TEMP , 0x678 , 0 , - 1 , 0xC2A , 0x402 ) ,
216255 new ( SourceNct67Xxd . PCH_MCH_TEMP , 0x67A , 0 , - 1 , 0xC2B , 0x404 ) ,
217- new ( SourceNct67Xxd . AGENT0_DIMM0 , 0 ) ,
218- new ( SourceNct67Xxd . AGENT0_DIMM1 , 0 ) ,
219- new ( SourceNct67Xxd . AGENT1_DIMM0 , 0 ) ,
220- new ( SourceNct67Xxd . AGENT1_DIMM1 , 0 ) ,
221- new ( SourceNct67Xxd . BYTE_TEMP0 , 0 ) ,
222- new ( SourceNct67Xxd . BYTE_TEMP1 , 0 ) ,
223- new ( SourceNct67Xxd . PECI_0_CAL , 0 ) ,
224- new ( SourceNct67Xxd . PECI_1_CAL , 0 ) ,
256+ new ( SourceNct67Xxd . AGENT0_DIMM0 , 0x405 , 0 , - 1 ) ,
257+ new ( SourceNct67Xxd . AGENT0_DIMM1 , 0x406 , 0 , - 1 ) ,
258+ new ( SourceNct67Xxd . AGENT1_DIMM0 , 0x407 , 0 , - 1 ) ,
259+ new ( SourceNct67Xxd . AGENT1_DIMM1 , 0x408 , 0 , - 1 ) ,
260+ new ( SourceNct67Xxd . BYTE_TEMP0 , 0x419 , 0 , - 1 ) ,
261+ new ( SourceNct67Xxd . BYTE_TEMP1 , 0x41A , 0 , - 1 ) ,
262+ new ( SourceNct67Xxd . PECI_0_CAL , 0x4F4 , 0 , - 1 ) ,
263+ new ( SourceNct67Xxd . PECI_1_CAL , 0x4F5 , 0 , - 1 ) ,
264+ new ( SourceNct67Xxd . VIRTUAL_TEMP , 0 ) ,
265+ new ( SourceNct67Xxd . SPARE_TEMP , 0 ) ,
266+ new ( SourceNct67Xxd . SPARE_TEMP2 , 0 )
267+ } ) ;
268+ break ;
269+
270+ case Chip . NCT6796DS :
271+ temperaturesSources . AddRange ( new TemperatureSourceData [ ]
272+ {
273+ new ( SourceNct67Xxd . CPUTIN , 0x073 , 0x074 , 7 , 0x100 , 0x491 ) ,
274+ new ( SourceNct67Xxd . SYSTIN , 0x075 , 0x076 , 7 , 0x200 , 0x490 ) ,
275+ new ( SourceNct67Xxd . AUXTIN0 , 0x077 , 0x078 , 7 , 0x300 , 0x492 ) ,
276+ new ( SourceNct67Xxd . AUXTIN1 , 0x079 , 0x07A , 7 , 0x800 , 0x493 ) ,
277+ new ( SourceNct67Xxd . AUXTIN2 , 0x07B , 0x07C , 7 , 0x900 , 0x494 ) ,
278+ new ( SourceNct67Xxd . AUXTIN3 , 0x07D , 0x07E , 7 , 0xA00 , 0x495 ) ,
279+ new ( SourceNct67Xxd . AUXTIN4 , 0x027 , 0 , 4 , 0xC16 , 0x496 ) ,
280+ new ( SourceNct67Xxd . AUXTIN5 , 0x449 , 0 , 4 , 0x100 , 0x4A2 ) ,
281+ new ( SourceNct67Xxd . SMBUSMASTER0 , 0x150 , 0x151 , 7 , 0x622 ) ,
282+ new ( SourceNct67Xxd . PECI_0 , 0x0720 , 0 , - 1 , 0 ) ,
225283 new ( SourceNct67Xxd . VIRTUAL_TEMP , 0 )
226284 } ) ;
227285 break ;
228286
287+ case Chip . NCT5585D :
288+ temperaturesSources . AddRange ( new TemperatureSourceData [ ]
289+ {
290+ new ( SourceNct67Xxd . PECI_0 , 0x0720 , 0 , - 1 , 0x100 ) ,
291+ new ( SourceNct67Xxd . CPUTIN , 0x075 , 0x076 , 7 , 0x000 , 0x073 ) ,
292+ new ( SourceNct67Xxd . AUXTIN1 , 0x07B , 0x07C , 7 , 0x900 , 0x493 ) ,
293+ new ( SourceNct67Xxd . AUXTIN3 , 0x4A0 , 0x49E , 6 , 0xB00 , 0x495 ) ,
294+ } ) ;
295+ break ;
296+
229297 default :
230298 temperaturesSources . AddRange ( new TemperatureSourceData [ ]
231299 {
@@ -562,9 +630,11 @@ public void Update()
562630
563631 case Chip . NCT6796D :
564632 case Chip . NCT6796DR :
633+ case Chip . NCT6796DS :
565634 case Chip . NCT6797D :
566635 case Chip . NCT6798D :
567636 case Chip . NCT6799D :
637+ case Chip . NCT5585D :
568638 if ( _temperaturesSource [ i ] . Register == 0 )
569639 {
570640 System . Diagnostics . Debug . WriteLine ( "Temperature register {0} skipped, address 0." , i ) ;
@@ -921,7 +991,7 @@ private byte ReadByte(ushort address)
921991 if ( access == EC_SPACE_PAGE_SELECT || DateTime . UtcNow > timeout )
922992 break ;
923993
924- System . Threading . Thread . Sleep ( 1 ) ;
994+ Thread . Sleep ( 1 ) ;
925995 }
926996
927997 if ( access != EC_SPACE_PAGE_SELECT )
@@ -998,8 +1068,8 @@ private void Set6687DRControl(int index, byte? value)
9981068 int targetFanCurveAddr = initFanCurveReg ; // Address of the Current Fan Curve Register we're writing to
9991069 ushort targetFanCurveReg ; // Integer value of the current fan curve register address, not the value within
10001070 byte currentSpeed = ReadByte ( FAN_PWM_OUT_REG [ index ] ) ; // Current Speed of the target fan
1001-
1002- // If current fan duty cycle matches requested duty cycle, skip re-writing the fan curve
1071+
1072+ // If current fan duty cycle matches requested duty cycle, skip re-writing the fan curve
10031073 if ( currentSpeed == value . Value )
10041074 {
10051075 return ;
@@ -1083,9 +1153,11 @@ not Chip.NCT6793D and
10831153 not Chip . NCT6795D and
10841154 not Chip . NCT6796D and
10851155 not Chip . NCT6796DR and
1156+ not Chip . NCT6796DS and
10861157 not Chip . NCT6797D and
10871158 not Chip . NCT6798D and
1088- not Chip . NCT6799D )
1159+ not Chip . NCT6799D and
1160+ not Chip . NCT5585D )
10891161 {
10901162 return ;
10911163 }
@@ -1127,9 +1199,15 @@ private enum SourceNct67Xxd : byte
11271199 AUXTIN2 = 5 ,
11281200 AUXTIN3 = 6 ,
11291201 AUXTIN4 = 7 ,
1202+ TSENSOR = 10 ,
11301203 SMBUSMASTER0 = 8 ,
11311204 SMBUSMASTER1 = 9 ,
1132- TSENSOR = 10 ,
1205+ RESERVED_1 = 10 ,
1206+ RESERVED_2 = 11 ,
1207+ RESERVED_3 = 12 ,
1208+ RESERVED_4 = 13 ,
1209+ RESERVED_5 = 14 ,
1210+ RESERVED_6 = 15 ,
11331211 PECI_0 = 16 ,
11341212 PECI_1 = 17 ,
11351213 PCH_CHIP_CPU_MAX_TEMP = 18 ,
@@ -1144,7 +1222,11 @@ private enum SourceNct67Xxd : byte
11441222 BYTE_TEMP1 = 27 ,
11451223 PECI_0_CAL = 28 ,
11461224 PECI_1_CAL = 29 ,
1147- VIRTUAL_TEMP = 31
1225+ RESERVED_7 = 30 ,
1226+ VIRTUAL_TEMP = 31 ,
1227+ SPARE_TEMP = 32 ,
1228+ SPARE_TEMP2 = 33 ,
1229+ AUXTIN5 = 34 ,
11481230 }
11491231
11501232 [ SuppressMessage ( "ReSharper" , "InconsistentNaming" ) ]
0 commit comments