Lines Matching +full:settling +full:- +full:time

4  * SPDX-License-Identifier: Apache-2.0
25 * @param dev - The device structure.
26 * @param axis_reg_h - The high part of the activity register.
27 * @param act - The activity config structure.
36 struct adxl372_data *data = dev->data; in adxl372_set_activity_threshold()
38 ret = data->hw_tf->write_reg(dev, axis_reg_h++, act->thresh >> 3); in adxl372_set_activity_threshold()
47 val = (act->thresh << 5) | (act->referenced << 1) | act->enable; in adxl372_set_activity_threshold()
50 val = (act->thresh << 5) | act->enable; in adxl372_set_activity_threshold()
53 return data->hw_tf->write_reg(dev, axis_reg_h, val); in adxl372_set_activity_threshold()
57 * Set the threshold for activity detection for all 3-axis
58 * @param dev - The device structure.
59 * @param axis_reg_h - The high part of the activity register.
60 * @param act - The activity config structure.
82 * @param dev - The device structure.
83 * @param op_mode - Mode of operation.
92 struct adxl372_data *data = dev->data; in adxl372_set_op_mode()
94 int ret = data->hw_tf->write_reg_mask(dev, ADXL372_POWER_CTL, in adxl372_set_op_mode()
100 data->pwr_reg &= ~ADXL372_POWER_CTL_MODE_MSK; in adxl372_set_op_mode()
101 data->pwr_reg |= ADXL372_POWER_CTL_MODE(op_mode); in adxl372_set_op_mode()
110 * wake-up mode automatically upon detection of inactivity.
111 * @param dev - The device structure.
112 * @param enable - Accepted values: true
118 struct adxl372_data *data = dev->data; in adxl372_set_autosleep()
120 return data->hw_tf->write_reg_mask(dev, ADXL372_MEASURE, in adxl372_set_autosleep()
127 * @param dev - The device structure.
128 * @param bw - bandwidth.
142 struct adxl372_data *data = dev->data; in adxl372_set_bandwidth()
150 ret = data->hw_tf->write_reg_mask(dev, ADXL372_POWER_CTL, in adxl372_set_bandwidth()
157 data->pwr_reg &= ~ADXL372_POWER_CTL_LPF_DIS_MSK; in adxl372_set_bandwidth()
158 data->pwr_reg |= mask; in adxl372_set_bandwidth()
161 return data->hw_tf->write_reg_mask(dev, ADXL372_MEASURE, in adxl372_set_bandwidth()
167 * Select the desired high-pass filter corner.
168 * @param dev - The device structure.
169 * @param c - bandwidth.
183 struct adxl372_data *data = dev->data; in adxl372_set_hpf_corner()
191 ret = data->hw_tf->write_reg_mask(dev, ADXL372_POWER_CTL, in adxl372_set_hpf_corner()
198 data->pwr_reg &= ~ADXL372_POWER_CTL_HPF_DIS_MSK; in adxl372_set_hpf_corner()
199 data->pwr_reg |= mask; in adxl372_set_hpf_corner()
202 return data->hw_tf->write_reg(dev, ADXL372_HPF, ADXL372_HPF_CORNER(c)); in adxl372_set_hpf_corner()
208 * @param dev - The device structure.
209 * @param mode - Mode of operation.
218 struct adxl372_data *data = dev->data; in adxl372_set_act_proc_mode()
220 return data->hw_tf->write_reg_mask(dev, ADXL372_MEASURE, in adxl372_set_act_proc_mode()
227 * @param dev - The device structure.
228 * @param odr - Output data rate.
238 struct adxl372_data *data = dev->data; in adxl372_set_odr()
240 return data->hw_tf->write_reg_mask(dev, ADXL372_TIMING, in adxl372_set_odr()
247 * @param dev - The device structure.
248 * @param mode - 0 = low threshold, 1 = high threshold.
256 struct adxl372_data *data = dev->data; in adxl372_set_instant_on_th()
258 int ret = data->hw_tf->write_reg_mask(dev, ADXL372_POWER_CTL, in adxl372_set_instant_on_th()
264 data->pwr_reg &= ~ADXL372_POWER_CTL_INSTANT_ON_TH_MSK; in adxl372_set_instant_on_th()
265 data->pwr_reg |= ADXL372_POWER_CTL_INSTANT_ON_TH_MODE(mode); in adxl372_set_instant_on_th()
273 * Set the Timer Rate for Wake-Up Mode.
274 * @param dev - The device structure.
275 * @param wur - wake up mode rate
289 struct adxl372_data *data = dev->data; in adxl372_set_wakeup_rate()
291 return data->hw_tf->write_reg_mask(dev, ADXL372_TIMING, in adxl372_set_wakeup_rate()
298 * @param dev - The device structure.
299 * @param time - The value set in this register.
302 static int adxl372_set_activity_time(const struct device *dev, uint8_t time) in adxl372_set_activity_time() argument
304 struct adxl372_data *data = dev->data; in adxl372_set_activity_time()
306 return data->hw_tf->write_reg(dev, ADXL372_TIME_ACT, time); in adxl372_set_activity_time()
311 * @param dev - The device structure.
312 * @param time - is the 16-bit value set by the TIME_INACT_L register
317 uint16_t time) in adxl372_set_inactivity_time() argument
320 struct adxl372_data *data = dev->data; in adxl372_set_inactivity_time()
322 ret = data->hw_tf->write_reg(dev, ADXL372_TIME_INACT_H, time >> 8); in adxl372_set_inactivity_time()
327 return data->hw_tf->write_reg(dev, ADXL372_TIME_INACT_L, time & 0xFF); in adxl372_set_inactivity_time()
331 * Set the filter settling period.
332 * @param dev - The device structure.
333 * @param mode - settle period
341 struct adxl372_data *data = dev->data; in adxl372_set_filter_settle()
343 int ret = data->hw_tf->write_reg_mask(dev, ADXL372_POWER_CTL, in adxl372_set_filter_settle()
349 data->pwr_reg &= ~ADXL372_POWER_CTL_FIL_SETTLE_MSK; in adxl372_set_filter_settle()
350 data->pwr_reg |= ADXL372_POWER_CTL_FIL_SETTLE_MODE(mode); in adxl372_set_filter_settle()
359 * @param dev - The device structure.
360 * @param int1 - INT1 interrupt pins.
361 * @param int2 - INT2 interrupt pins.
369 struct adxl372_data *data = dev->data; in adxl372_interrupt_config()
371 ret = data->hw_tf->write_reg(dev, ADXL372_INT1_MAP, int1); in adxl372_interrupt_config()
376 return data->hw_tf->write_reg(dev, ADXL372_INT2_MAP, int2); in adxl372_interrupt_config()
382 * @param dev - The device structure.
383 * @param status1 - Data stored in the STATUS1 register
384 * @param status2 - Data stored in the STATUS2 register
385 * @param fifo_entries - Number of valid data samples present in the
394 struct adxl372_data *data = dev->data; in adxl372_get_status()
415 ret = data->hw_tf->read_reg_multiple(dev, ADXL372_STATUS_1, buf, length); in adxl372_get_status()
432 * @param dev - The device structure.
438 struct adxl372_data *data = dev->data; in adxl372_reset()
445 ret = data->hw_tf->write_reg(dev, ADXL372_RESET, ADXL372_RESET_CODE); in adxl372_reset()
453 * @param dev - The device structure.
454 * @param mode - FIFO Mode. Specifies FIFO operating mode.
459 * @param format - FIFO Format. Specifies the data is stored in the FIFO buffer.
468 * @param fifo_samples - FIFO Samples. Watermark number of FIFO samples that
476 struct adxl372_data *data = dev->data; in adxl372_configure_fifo()
481 return -EINVAL; in adxl372_configure_fifo()
496 ret = data->hw_tf->write_reg(dev, ADXL372_FIFO_CTL, fifo_config); in adxl372_configure_fifo()
500 ret = data->hw_tf->write_reg(dev, ADXL372_FIFO_SAMPLES, fifo_samples & 0xFF); in adxl372_configure_fifo()
505 data->fifo_config.fifo_format = format; in adxl372_configure_fifo()
506 data->fifo_config.fifo_mode = mode; in adxl372_configure_fifo()
507 data->fifo_config.fifo_samples = fifo_samples; in adxl372_configure_fifo()
513 * Retrieve 3-axis acceleration data
514 * @param dev - The device structure.
515 * @param maxpeak - Retrieve the highest magnitude (x, y, z) sample recorded
517 * @param accel_data - pointer to a variable of type adxl372_xyz_accel_data
524 struct adxl372_data *data = dev->data; in adxl372_get_accel_data()
535 ret = data->hw_tf->read_reg_multiple(dev, maxpeak ? ADXL372_X_MAXPEAK_H : in adxl372_get_accel_data()
538 accel_data->is_fifo = 0; in adxl372_get_accel_data()
540 accel_data->x = (buf[0] << 8) | (buf[1] & 0xF0); in adxl372_get_accel_data()
541 accel_data->y = (buf[2] << 8) | (buf[3] & 0xF0); in adxl372_get_accel_data()
542 accel_data->z = (buf[4] << 8) | (buf[5] & 0xF0); in adxl372_get_accel_data()
553 struct adxl372_dev_config *cfg = (struct adxl372_dev_config *)dev->config; in adxl372_attr_set_odr()
555 switch (val->val1) { in adxl372_attr_set_odr()
572 return -EINVAL; in adxl372_attr_set_odr()
578 cfg->odr = odr; in adxl372_attr_set_odr()
589 const struct adxl372_dev_config *cfg = dev->config; in adxl372_attr_set_thresh()
593 int64_t micro_ms2 = val->val1 * 1000000LL + val->val2; in adxl372_attr_set_thresh()
599 return -EINVAL; in adxl372_attr_set_thresh()
605 threshold.enable = cfg->activity_th.enable; in adxl372_attr_set_thresh()
606 threshold.referenced = cfg->activity_th.referenced; in adxl372_attr_set_thresh()
625 return -ENOTSUP; in adxl372_attr_set_thresh()
641 return -ENOTSUP; in adxl372_attr_set()
648 const struct adxl372_dev_config *cfg = dev->config; in adxl372_sample_fetch()
649 struct adxl372_data *data = dev->data; in adxl372_sample_fetch()
651 return adxl372_get_accel_data(dev, cfg->max_peak_detect_mode, in adxl372_sample_fetch()
652 &data->sample); in adxl372_sample_fetch()
658 * Sensor resolution is 100mg/LSB, 12-bit value needs to be right in adxl372_accel_convert()
663 val->val1 = micro_ms2 / 1000000; in adxl372_accel_convert()
664 val->val2 = micro_ms2 % 1000000; in adxl372_accel_convert()
671 struct adxl372_data *data = dev->data; in adxl372_channel_get()
675 adxl372_accel_convert(val, data->sample.x); in adxl372_channel_get()
678 adxl372_accel_convert(val, data->sample.y); in adxl372_channel_get()
681 adxl372_accel_convert(val, data->sample.z); in adxl372_channel_get()
684 adxl372_accel_convert(val++, data->sample.x); in adxl372_channel_get()
685 adxl372_accel_convert(val++, data->sample.y); in adxl372_channel_get()
686 adxl372_accel_convert(val, data->sample.z); in adxl372_channel_get()
689 return -ENOTSUP; in adxl372_channel_get()
711 const struct adxl372_dev_config *cfg = dev->config; in adxl372_probe()
712 struct adxl372_data *data = dev->data; in adxl372_probe()
716 ret = data->hw_tf->read_reg(dev, ADXL372_DEVID, &dev_id); in adxl372_probe()
720 ret = data->hw_tf->read_reg(dev, ADXL372_PARTID, &part_id); in adxl372_probe()
727 return -ENODEV; in adxl372_probe()
731 data->act_proc_mode = ADXL372_LINKED, in adxl372_probe()
733 data->act_proc_mode = ADXL372_LOOPED, in adxl372_probe()
747 ret = adxl372_set_hpf_corner(dev, cfg->hpf); in adxl372_probe()
752 ret = adxl372_set_bandwidth(dev, cfg->bw); in adxl372_probe()
757 ret = adxl372_set_odr(dev, cfg->odr); in adxl372_probe()
762 ret = adxl372_set_wakeup_rate(dev, cfg->wur); in adxl372_probe()
767 ret = adxl372_set_autosleep(dev, cfg->autosleep); in adxl372_probe()
772 ret = adxl372_set_instant_on_th(dev, cfg->th_mode); in adxl372_probe()
778 &cfg->activity_th); in adxl372_probe()
784 &cfg->inactivity_th); in adxl372_probe()
789 ret = adxl372_set_activity_time(dev, cfg->activity_time); in adxl372_probe()
794 ret = adxl372_set_inactivity_time(dev, cfg->inactivity_time); in adxl372_probe()
799 ret = adxl372_set_filter_settle(dev, cfg->filter_settle); in adxl372_probe()
804 ret = adxl372_configure_fifo(dev, cfg->fifo_config.fifo_mode, in adxl372_probe()
805 cfg->fifo_config.fifo_format, in adxl372_probe()
806 cfg->fifo_config.fifo_samples); in adxl372_probe()
814 return -EIO; in adxl372_probe()
818 ret = adxl372_interrupt_config(dev, cfg->int1_config, cfg->int2_config); in adxl372_probe()
823 ret = adxl372_set_op_mode(dev, cfg->op_mode); in adxl372_probe()
828 return adxl372_set_act_proc_mode(dev, data->act_proc_mode); in adxl372_probe()
834 const struct adxl372_dev_config *cfg = dev->config; in adxl372_init()
836 ret = cfg->bus_init(dev); in adxl372_init()
843 return -ENODEV; in adxl372_init()
947 * bus-specific macro at preprocessor time.