@@ -157,12 +157,12 @@ public static void ResetPageAddress(Smbus device) {
157157 /// <param name="eepromPageNumber">Page number</param>
158158 private static void SetPageAddress ( Smbus device , UInt8 eepromPageNumber ) {
159159
160- if ( device . MaxSpdSize != 0 && device . MaxSpdSize < ( UInt16 ) Ram . SpdSize . DDR4 ) {
160+ if ( device . MaxSpdSize != 0 && device . MaxSpdSize < ( UInt16 ) Spd . DataLength . DDR4 ) {
161161 return ;
162162 }
163163
164- if ( device . MaxSpdSize == ( UInt16 ) Ram . SpdSize . DDR4 && eepromPageNumber > 1 ||
165- device . MaxSpdSize == ( UInt16 ) Ram . SpdSize . DDR5 && eepromPageNumber > 15 ) {
164+ if ( device . MaxSpdSize == ( UInt16 ) Spd . DataLength . DDR4 && eepromPageNumber > 1 ||
165+ device . MaxSpdSize == ( UInt16 ) Spd . DataLength . DDR5 && eepromPageNumber > 15 ) {
166166 throw new ArgumentOutOfRangeException ( nameof ( eepromPageNumber ) ) ;
167167 }
168168
@@ -185,19 +185,19 @@ private static UInt8 GetPageAddress() {
185185 /// <param name="offset">Byte position</param>
186186 private static void AdjustPageAddress ( Smbus device , UInt16 offset ) {
187187
188- if ( device . MaxSpdSize >= ( UInt16 ) Ram . SpdSize . MINIMUM ) {
188+ if ( device . MaxSpdSize >= ( UInt16 ) Spd . DataLength . MINIMUM ) {
189189 if ( offset > device . MaxSpdSize ) {
190190 throw new IndexOutOfRangeException ( $ "Invalid offset") ;
191191 }
192192
193- if ( device . MaxSpdSize < ( UInt16 ) Spd . GetSpdSize ( Ram . Type . DDR4 ) ) {
193+ if ( device . MaxSpdSize < ( UInt16 ) Spd . GetSpdSize ( Spd . RamType . DDR4 ) ) {
194194 return ;
195195 }
196196 }
197197
198198 byte targetPage = 0 ;
199199
200- if ( device . MaxSpdSize == ( UInt16 ) Ram . SpdSize . DDR4 ) {
200+ if ( device . MaxSpdSize == ( UInt16 ) Spd . DataLength . DDR4 ) {
201201 targetPage = ( byte ) ( offset >> 8 ) ;
202202 }
203203
@@ -271,11 +271,11 @@ public static bool SetRswp(Smbus device) {
271271 /// <returns><see langword="true"/> when the write protection has been enabled on block <paramref name="block"/></returns>
272272 public static bool SetRswp ( Smbus device , UInt8 block ) {
273273
274- if ( device . MaxSpdSize == ( UInt16 ) Ram . SpdSize . MINIMUM && block >= 1 ) {
274+ if ( device . MaxSpdSize == ( UInt16 ) Spd . DataLength . MINIMUM && block >= 1 ) {
275275 throw new ArgumentOutOfRangeException ( nameof ( block ) ) ;
276276 }
277277
278- if ( device . MaxSpdSize == ( UInt16 ) Ram . SpdSize . DDR4 && block >= 4 ) {
278+ if ( device . MaxSpdSize == ( UInt16 ) Spd . DataLength . DDR4 && block >= 4 ) {
279279 throw new ArgumentOutOfRangeException ( nameof ( block ) ) ;
280280 }
281281
@@ -318,7 +318,7 @@ public static bool GetPswp(Smbus device) {
318318 /// <param name="offset">Byte offset</param>
319319 /// <returns>Byte value at <paramref name="offset"/></returns>
320320 public static byte ReadByte ( Arduino device , UInt16 offset ) {
321- if ( offset > ( int ) Ram . SpdSize . DDR5 ) {
321+ if ( offset > ( int ) Spd . DataLength . DDR5 ) {
322322 throw new IndexOutOfRangeException ( $ "Invalid offset") ;
323323 }
324324
@@ -343,7 +343,7 @@ public static byte ReadByte(Arduino device, UInt16 offset) {
343343 /// <param name="count">Total number of bytes to read from <paramref name="offset"/> </param>
344344 /// <returns>A byte array containing byte values</returns>
345345 public static byte [ ] ReadByte ( Arduino device , UInt16 offset , UInt8 count ) {
346- if ( offset > ( int ) Ram . SpdSize . DDR5 ) {
346+ if ( offset > ( int ) Spd . DataLength . DDR5 ) {
347347 throw new IndexOutOfRangeException ( $ "Invalid offset") ;
348348 }
349349 if ( count == 0 ) {
@@ -372,7 +372,7 @@ public static byte[] ReadByte(Arduino device, UInt16 offset, UInt8 count) {
372372 /// <param name="value">Byte value</param>
373373 /// <returns><see langword="true"/> if <paramref name="value"/> is written to <paramref name="offset"/> </returns>
374374 public static bool WriteByte ( Arduino device , UInt16 offset , byte value ) {
375- if ( offset > ( int ) Ram . SpdSize . DDR5 ) {
375+ if ( offset > ( int ) Spd . DataLength . DDR5 ) {
376376 throw new IndexOutOfRangeException ( $ "Invalid offset") ;
377377 }
378378 try {
@@ -397,7 +397,7 @@ public static bool WriteByte(Arduino device, UInt16 offset, byte value) {
397397 /// <param name="value">Page contents</param>
398398 /// <returns><see langword="true"/> if <paramref name="value"/> is written to <paramref name="offset"/> </returns>
399399 public static bool WriteByte ( Arduino device , UInt16 offset , byte [ ] value ) {
400- if ( offset > ( int ) Ram . SpdSize . DDR5 ) {
400+ if ( offset > ( int ) Spd . DataLength . DDR5 ) {
401401 throw new IndexOutOfRangeException ( $ "Invalid offset") ;
402402 }
403403 if ( value . Length > 16 || value . Length == 0 ) {
@@ -447,7 +447,7 @@ public static bool UpdateByte(Arduino device, UInt16 offset, byte value) {
447447 /// <param name="value">Page contents</param>
448448 /// <returns><see langword="true"/> if page read at <paramref name="offset"/> matches <paramref name="value"/> values</returns>
449449 public static bool UpdateByte ( Arduino device , UInt16 offset , byte [ ] value ) {
450- if ( offset > ( int ) Ram . SpdSize . DDR5 ) {
450+ if ( offset > ( int ) Spd . DataLength . DDR5 ) {
451451 throw new IndexOutOfRangeException ( $ "Invalid offset") ;
452452 }
453453 if ( value . Length > 16 || value . Length == 0 ) {
0 commit comments