Lines Matching +full:accel +full:- +full:odr

4  * SPDX-License-Identifier: Apache-2.0
17 #define ACCEL_ALIAS(i) DT_ALIAS(_CONCAT(accel, i))
65 if (cqe->result != 0) { in print_accels_stream()
66 printk("async read failed %d\n", cqe->result); in print_accels_stream()
67 return cqe->result; in print_accels_stream()
94 rc = decoder->get_frame_count(buf, in print_accels_stream()
103 if (decoder->has_trigger(buf, SENSOR_TRIG_TAP)) { in print_accels_stream()
104 printk("Tap! Sensor %s\n", dev->name); in print_accels_stream()
109 decoder->decode(buf, (struct sensor_chan_spec) {SENSOR_CHAN_ACCEL_XYZ, 0}, in print_accels_stream()
112 printk("Accel data for %s (%" PRIq(6) ", %" PRIq(6) in print_accels_stream()
113 ", %" PRIq(6) ") %lluns\n", dev->name, in print_accels_stream()
137 struct sensor_value accel[3]; in print_accels() local
141 printk("%s: sensor_sample_fetch() failed: %d\n", dev->name, ret); in print_accels()
146 ret = sensor_channel_get(dev, channels[i], &accel[i]); in print_accels()
148 printk("%s: sensor_channel_get(%c) failed: %d\n", dev->name, 'X' + i, ret); in print_accels()
153 printk("%16s [m/s^2]: (%12.6f, %12.6f, %12.6f)\n", dev->name, in print_accels()
154 sensor_value_to_double(&accel[0]), sensor_value_to_double(&accel[1]), in print_accels()
155 sensor_value_to_double(&accel[2])); in print_accels()
164 struct sensor_value odr; in set_sampling_freq() local
166 ret = sensor_attr_get(dev, SENSOR_CHAN_ACCEL_XYZ, SENSOR_ATTR_SAMPLING_FREQUENCY, &odr); in set_sampling_freq()
169 if (ret != 0 || (odr.val1 == 0 && odr.val2 == 0)) { in set_sampling_freq()
170 odr.val1 = 100; in set_sampling_freq()
171 odr.val2 = 0; in set_sampling_freq()
174 &odr); in set_sampling_freq()
177 printk("%s : failed to set sampling frequency\n", dev->name); in set_sampling_freq()
190 printk("sensor: device %s not ready.\n", sensors[i]->name);