@@ -196,19 +196,11 @@ class LSM6DS: # pylint: disable=too-many-instance-attributes
196
196
197
197
# ROUnaryStructs:
198
198
_chip_id = ROUnaryStruct (_LSM6DS_WHOAMI , "<b" )
199
- _temperature = ROUnaryStruct (_LSM6DS_OUT_TEMP_L , "<h" )
200
199
200
+ # Structs
201
+ _raw_accel_data = Struct (_LSM6DS_OUTX_L_A , "<hhh" )
202
+ _raw_gyro_data = Struct (_LSM6DS_OUTX_L_G , "<hhh" )
201
203
# RWBits:
202
- _ois_ctrl_from_ui = RWBit (_LSM6DS_FUNC_CFG_ACCESS , 0 )
203
- _shub_reg_access = RWBit (_LSM6DS_FUNC_CFG_ACCESS , 6 )
204
- _func_cfg_access = RWBit (_LSM6DS_FUNC_CFG_ACCESS , 7 )
205
- _sdo_pu_en = RWBit (_LSM6DS_PIN_CTRL , 6 )
206
- _ois_pu_dis = RWBit (_LSM6DS_PIN_CTRL , 7 )
207
- _spi2_read_en = RWBit (_LSM6DS_UI_INT_OIS , 3 )
208
- _den_lh_ois = RWBit (_LSM6DS_UI_INT_OIS , 5 )
209
- _lvl2_ois = RWBit (_LSM6DS_UI_INT_OIS , 6 )
210
- _int2_drdy_ois = RWBit (_LSM6DS_UI_INT_OIS , 7 )
211
- _lpf_xl = RWBit (_LSM6DS_CTRL1_XL , 1 )
212
204
213
205
_accel_range = RWBits (2 , _LSM6DS_CTRL1_XL , 2 )
214
206
_accel_data_rate = RWBits (4 , _LSM6DS_CTRL1_XL , 4 )
@@ -219,36 +211,14 @@ class LSM6DS: # pylint: disable=too-many-instance-attributes
219
211
_gyro_range_4000dps = RWBit (_LSM6DS_CTRL2_G , 0 )
220
212
221
213
_sw_reset = RWBit (_LSM6DS_CTRL3_C , 0 )
222
- _sim = RWBit (_LSM6DS_CTRL3_C , 3 )
223
- _pp_od = RWBit (_LSM6DS_CTRL3_C , 4 )
224
- _h_lactive = RWBit (_LSM6DS_CTRL3_C , 5 )
225
214
_bdu = RWBit (_LSM6DS_CTRL3_C , 6 )
226
215
_boot = RWBit (_LSM6DS_CTRL3_C , 7 )
227
- _st_xl = RWBits (2 , _LSM6DS_CTRL_5_C , 0 )
228
- _st_g = RWBits (2 , _LSM6DS_CTRL_5_C , 2 )
229
- _rounding_status = RWBit (_LSM6DS_CTRL_5_C , 4 )
230
- _rounding = RWBits (2 , _LSM6DS_CTRL_5_C , 5 )
231
- _xl_ulp_en = RWBit (_LSM6DS_CTRL_5_C , 7 )
232
- _aux_sens_on = RWBits (2 , _LSM6DS_MASTER_CONFIG , 0 )
233
- _master_on = RWBit (_LSM6DS_MASTER_CONFIG , 2 )
234
- _shub_pu_en = RWBit (_LSM6DS_MASTER_CONFIG , 3 )
235
- _pass_through_mode = RWBit (_LSM6DS_MASTER_CONFIG , 4 )
236
- _start_config = RWBit (_LSM6DS_MASTER_CONFIG , 5 )
237
- _write_once = RWBit (_LSM6DS_MASTER_CONFIG , 6 )
238
- _rst_master_regs = RWBit (_LSM6DS_MASTER_CONFIG , 7 )
239
- _i3c_disable = RWBit (_LSM6DS_CTRL9_XL , 1 )
240
-
241
- _raw_temp = ROUnaryStruct (_LSM6DS_OUT_TEMP_L , "<h" )
242
- _raw_accel_data = Struct (_LSM6DS_OUTX_L_A , "<hhh" )
243
- _raw_gyro_data = Struct (_LSM6DS_OUTX_L_G , "<hhh" )
244
216
245
- pedometer_steps = ROUnaryStruct ( _LSM6DS_STEP_COUNTER , "<h" )
246
- pedometer_reset = RWBit (_LSM6DS_CTRL10_C , 1 )
247
- _ped_enable = RWBit (_LSM6DS_TAP_CFG , 6 )
217
+ _high_pass_filter = RWBits ( 2 , _LSM6DS_CTRL8_XL , 5 )
218
+ _i3c_disable = RWBit (_LSM6DS_CTRL9_XL , 1 )
219
+ _pedometer_reset = RWBit (_LSM6DS_CTRL10_C , 1 )
248
220
_func_enable = RWBit (_LSM6DS_CTRL10_C , 2 )
249
-
250
- high_pass_filter_enabled = RWBit (_LSM6DS_CTRL8_XL , 2 )
251
- _pass_filter = RWBits (2 , _LSM6DS_CTRL8_XL , 5 )
221
+ _ped_enable = RWBit (_LSM6DS_TAP_CFG , 6 )
252
222
253
223
CHIP_ID = None
254
224
@@ -390,18 +360,18 @@ def pedometer_enable(self):
390
360
def pedometer_enable (self , enable ):
391
361
self ._ped_enable = enable
392
362
self ._func_enable = enable
393
- self .pedometer_reset = enable
363
+ self ._pedometer_reset = enable
394
364
395
365
@property
396
366
def high_pass_filter (self ):
397
367
"""The high pass filter applied to accelerometer data"""
398
- return self ._pass_filter
368
+ return self ._high_pass_filter
399
369
400
370
@high_pass_filter .setter
401
371
def high_pass_filter (self , value ):
402
372
if not AccelHPF .is_valid (value ):
403
373
raise AttributeError ("range must be an `AccelHPF`" )
404
- self ._pass_filter = value
374
+ self ._high_pass_filter = value
405
375
406
376
407
377
class LSM6DSOX (LSM6DS ): # pylint: disable=too-many-instance-attributes
0 commit comments