@@ -301,9 +301,8 @@ def distance_mode(self, mode):
301
301
def roi_xy (self ):
302
302
"""Returns the x and y coordinates of the sensor's region of interest"""
303
303
temp = self ._read_register (_ROI_CONFIG__USER_ROI_REQUESTED_GLOBAL_XY_SIZE )
304
-
305
- x = (int .from_bytes (temp ) & 0x0F ) + 1
306
- y = ((int .from_bytes (temp ) & 0xF0 ) >> 4 ) + 1
304
+ x = (int .from_bytes (temp , 'little' ) & 0x0F ) + 1
305
+ y = ((int .from_bytes (temp , 'little' ) & 0xF0 ) >> 4 ) + 1
307
306
308
307
return x , y
309
308
@@ -319,22 +318,22 @@ def roi_xy(self, data):
319
318
optical_center = 199
320
319
321
320
self ._write_register (
322
- _ROI_CONFIG__USER_ROI_CENTRE_SPAD , optical_center .to_bytes ()
321
+ _ROI_CONFIG__USER_ROI_CENTRE_SPAD , optical_center .to_bytes (1 , 'little' )
323
322
)
324
323
self ._write_register (
325
324
_ROI_CONFIG__USER_ROI_REQUESTED_GLOBAL_XY_SIZE ,
326
- ((y - 1 ) << 4 | (x - 1 )).to_bytes (),
325
+ ((y - 1 ) << 4 | (x - 1 )).to_bytes (1 , 'little' ),
327
326
)
328
327
329
328
@property
330
329
def roi_center (self ):
331
330
"""Returns the center of the sensor's region of interest"""
332
331
temp = self ._read_register (_ROI_CONFIG__USER_ROI_CENTRE_SPAD )
333
- return int .from_bytes (temp )
332
+ return int .from_bytes (temp , 'little' )
334
333
335
334
@roi_center .setter
336
335
def roi_center (self , center ):
337
- self ._write_register (_ROI_CONFIG__USER_ROI_CENTRE_SPAD , center .to_bytes ())
336
+ self ._write_register (_ROI_CONFIG__USER_ROI_CENTRE_SPAD , center .to_bytes (1 , 'little' ))
338
337
339
338
def _write_register (self , address , data , length = None ):
340
339
if length is None :
0 commit comments