File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -340,16 +340,16 @@ def _read_u8(self, address):
340
340
# Read an 8-bit unsigned value from the specified 8-bit address.
341
341
with self ._device as i2c :
342
342
self ._BUFFER [0 ] = (address | _COMMAND_BIT ) & 0xFF
343
- i2c .write (self ._BUFFER , end = 1 , stop = False )
344
- i2c . readinto ( self . _BUFFER , end = 1 )
343
+ i2c .write_then_readinto (self ._BUFFER , self . _BUFFER ,
344
+ out_end = 1 , in_end = 1 )
345
345
return self ._BUFFER [0 ]
346
346
347
347
def _read_u16 (self , address ):
348
348
# Read a 16-bit unsigned value from the specified 8-bit address.
349
349
with self ._device as i2c :
350
350
self ._BUFFER [0 ] = (address | _COMMAND_BIT ) & 0xFF
351
- i2c .write (self ._BUFFER , end = 1 , stop = False )
352
- i2c . readinto ( self . _BUFFER , end = 2 )
351
+ i2c .write_then_readinto (self ._BUFFER , self . _BUFFER ,
352
+ out_end = 1 , in_end = 2 )
353
353
return (self ._BUFFER [1 ] << 8 ) | self ._BUFFER [0 ]
354
354
355
355
def _write_u8 (self , address , val ):
You can’t perform that action at this time.
0 commit comments