Lines Matching refs:lis2dh

16 LOG_MODULE_REGISTER(lis2dh, CONFIG_SENSOR_LOG_LEVEL);
54 struct lis2dh_data *lis2dh = dev->data; in lis2dh_sample_fetch_temp() local
58 ret = lis2dh->hw_tf->read_data(dev, cfg->temperature.dout_addr, raw, in lis2dh_sample_fetch_temp()
72 lis2dh->temperature.val1 = (int32_t)((int8_t)raw[1]); in lis2dh_sample_fetch_temp()
74 lis2dh->temperature.val2 = 0; in lis2dh_sample_fetch_temp()
76 lis2dh->temperature.val2 = in lis2dh_sample_fetch_temp()
78 lis2dh->temperature.val2 = (lis2dh->temperature.val2 * 1000000); in lis2dh_sample_fetch_temp()
79 lis2dh->temperature.val2 >>= cfg->temperature.fractional_bits; in lis2dh_sample_fetch_temp()
80 if (lis2dh->temperature.val1 < 0) { in lis2dh_sample_fetch_temp()
81 lis2dh->temperature.val2 *= -1; in lis2dh_sample_fetch_temp()
96 struct lis2dh_data *lis2dh = dev->data; in lis2dh_channel_get() local
117 memcpy(val, &lis2dh->temperature, sizeof(*val)); in lis2dh_channel_get()
125 lis2dh_convert(lis2dh->sample.xyz[i], lis2dh->scale, val); in lis2dh_channel_get()
134 struct lis2dh_data *lis2dh = dev->data; in lis2dh_fetch_xyz() local
141 status = lis2dh->hw_tf->read_data(dev, LIS2DH_REG_STATUS, in lis2dh_fetch_xyz()
142 lis2dh->sample.raw, in lis2dh_fetch_xyz()
143 sizeof(lis2dh->sample.raw)); in lis2dh_fetch_xyz()
151 (int16_t *)&lis2dh->sample.raw[1 + i]; in lis2dh_fetch_xyz()
156 if (lis2dh->sample.status & LIS2DH_STATUS_DRDY_MASK) { in lis2dh_fetch_xyz()
258 struct lis2dh_data *lis2dh = dev->data; in lis2dh_acc_range_set() local
266 lis2dh->scale = lis2dh_reg_val_to_scale[fs]; in lis2dh_acc_range_set()
268 return lis2dh->hw_tf->update_reg(dev, LIS2DH_REG_CTRL4, in lis2dh_acc_range_set()
334 struct lis2dh_data *lis2dh = dev->data; in lis2dh_init() local
345 status = lis2dh->hw_tf->read_reg(dev, LIS2DH_REG_WAI, &id); in lis2dh_init()
365 status = lis2dh->hw_tf->update_reg(dev, LIS2DH_REG_CTRL0, in lis2dh_init()
382 status = lis2dh->hw_tf->write_data(dev, LIS2DH_REG_CTRL1, raw, in lis2dh_init()
391 lis2dh->scale = lis2dh_reg_val_to_scale[LIS2DH_FS_IDX]; in lis2dh_init()
393 status = lis2dh->hw_tf->write_reg(dev, LIS2DH_REG_CTRL4, in lis2dh_init()
396 status = lis2dh->hw_tf->write_reg(dev, LIS2DH_REG_CTRL4, LIS2DH_FS_BITS | LIS2DH_HR_BIT); in lis2dh_init()
405 status = lis2dh->hw_tf->update_reg(dev, cfg->temperature.cfg_addr, in lis2dh_init()
426 (uint8_t)LIS2DH_LP_EN_BIT, lis2dh->scale); in lis2dh_init()
429 return lis2dh->hw_tf->write_reg(dev, LIS2DH_REG_CTRL1, in lis2dh_init()
439 struct lis2dh_data *lis2dh = dev->data; in lis2dh_pm_action() local
445 status = lis2dh->hw_tf->read_reg(dev, LIS2DH_REG_REFERENCE, &regdata); in lis2dh_pm_action()
452 status = lis2dh->hw_tf->write_reg(dev, LIS2DH_REG_CTRL1, in lis2dh_pm_action()
453 lis2dh->reg_ctrl1_active_val); in lis2dh_pm_action()
461 status = lis2dh->hw_tf->read_reg(dev, LIS2DH_REG_CTRL1, in lis2dh_pm_action()
462 &lis2dh->reg_ctrl1_active_val); in lis2dh_pm_action()
467 status = lis2dh->hw_tf->write_reg(dev, LIS2DH_REG_CTRL1, in lis2dh_pm_action()