@@ -189,7 +189,6 @@ class LSM6DS: #pylint: disable=too-many-instance-attributes
189
189
_gyro_range_4000dps = RWBit (_LSM6DS_CTRL2_G , 0 )
190
190
191
191
_sw_reset = RWBit (_LSM6DS_CTRL3_C , 0 )
192
- _if_inc = RWBit (_LSM6DS_CTRL3_C , 2 )
193
192
_sim = RWBit (_LSM6DS_CTRL3_C , 3 )
194
193
_pp_od = RWBit (_LSM6DS_CTRL3_C , 4 )
195
194
_h_lactive = RWBit (_LSM6DS_CTRL3_C , 5 )
@@ -223,18 +222,16 @@ def __init__(self, i2c_bus, address=_LSM6DS_DEFAULT_ADDRESS):
223
222
self .reset ()
224
223
225
224
self ._bdu = True
226
- self ._i3c_disable = True
227
- self ._if_inc = True
228
225
229
- self ._accel_data_rate = Rate .RATE_104_HZ #pylint: disable=no-member
230
- self ._gyro_data_rate = Rate .RATE_104_HZ #pylint: disable=no-member
226
+ self .accel_data_rate = Rate .RATE_104_HZ #pylint: disable=no-member
227
+ self .gyro_data_rate = Rate .RATE_104_HZ #pylint: disable=no-member
228
+
229
+ self .accel_range = AccelRange .RANGE_4G #pylint: disable=no-member
230
+ self .gyro_range = GyroRange .RANGE_250_DPS #pylint: disable=no-member
231
231
232
- self ._accel_range = AccelRange .RANGE_4G #pylint: disable=no-member
233
232
self ._cached_accel_range = self ._accel_range
234
- self ._gyro_range = GyroRange .RANGE_250_DPS #pylint: disable=no-member
235
233
self ._cached_gyro_range = self ._gyro_range
236
234
237
-
238
235
def reset (self ):
239
236
"Resets the sensor's configuration into an initial state"
240
237
self ._sw_reset = True
@@ -244,12 +241,6 @@ def reset(self):
244
241
while self ._boot :
245
242
sleep (0.001 )
246
243
247
- @property
248
- def is_lsm6dsox (self ):
249
- """Returns `True` if the connected sensor is an LSM6DSOX,
250
- `False` if not, it's an ICM330DHCT"""
251
- return self ._chip_id is _LSM6DS_CHIP_ID
252
-
253
244
@property
254
245
def acceleration (self ):
255
246
"""The x, y, z acceleration values returned in a 3-tuple and are in m / s ^ 2."""
@@ -358,6 +349,9 @@ class LSM6DSOX(LSM6DS): #pylint: disable=too-many-instance-attributes
358
349
359
350
"""
360
351
CHIP_ID = _LSM6DS_CHIP_ID
352
+ def __init__ (self , i2c_bus , address = _LSM6DS_DEFAULT_ADDRESS ):
353
+ super ().__init__ (i2c_bus , address )
354
+ self ._i3c_disable = True
361
355
362
356
class LSM6DS33 (LSM6DS ): #pylint: disable=too-many-instance-attributes
363
357
@@ -378,3 +372,8 @@ class ISM330DHCT(LSM6DS): #pylint: disable=too-many-instance-attributes
378
372
379
373
"""
380
374
CHIP_ID = _ISM330DHCT_CHIP_ID
375
+ def __init__ (self , i2c_bus , address = _LSM6DS_DEFAULT_ADDRESS ):
376
+ super ().__init__ (i2c_bus , address )
377
+
378
+ # Called DEVICE_CONF in the datasheet, but it recommends setting it
379
+ self ._i3c_disable = True
0 commit comments