Lines Matching +full:channel +full:- +full:count

4  * SPDX-License-Identifier: Apache-2.0
40 buffer + sizeof(struct adxl372_fifo_data) + enc_data->fifo_byte_count; in adxl372_decode_stream()
41 int count = 0; in adxl372_decode_stream() local
51 data->header.base_timestamp_ns = enc_data->timestamp; in adxl372_decode_stream()
52 data->header.reading_count = 1; in adxl372_decode_stream()
53 data->header.shift = 11; /* Sensor shift */ in adxl372_decode_stream()
57 uint8_t sample_set_size = enc_data->sample_set_size; in adxl372_decode_stream()
58 uint64_t period_ns = accel_period_ns[enc_data->accel_odr]; in adxl372_decode_stream()
62 sample_num = ((uint8_t *)*fit - buffer) / sample_set_size; in adxl372_decode_stream()
65 while (count < max_count && buffer < buffer_end) { in adxl372_decode_stream()
78 if (enc_data->has_x) { in adxl372_decode_stream()
79 data->readings[count].timestamp_delta = sample_num * period_ns; in adxl372_decode_stream()
80 adxl372_accel_convert_q31(&data->readings[count].x, buffer); in adxl372_decode_stream()
84 if (enc_data->has_y) { in adxl372_decode_stream()
87 /* If packet has X channel, then Y channel has offset. */ in adxl372_decode_stream()
88 if (enc_data->has_x) { in adxl372_decode_stream()
91 data->readings[count].timestamp_delta = sample_num * period_ns; in adxl372_decode_stream()
92 adxl372_accel_convert_q31(&data->readings[count].y, in adxl372_decode_stream()
97 if (enc_data->has_z) { in adxl372_decode_stream()
100 /* If packet has X channel and/or Y channel, in adxl372_decode_stream()
101 * then Z channel has offset. in adxl372_decode_stream()
103 if (enc_data->has_x) { in adxl372_decode_stream()
107 if (enc_data->has_y) { in adxl372_decode_stream()
110 data->readings[count].timestamp_delta = sample_num * period_ns; in adxl372_decode_stream()
111 adxl372_accel_convert_q31(&data->readings[count].z, in adxl372_decode_stream()
116 data->readings[count].timestamp_delta = sample_num * period_ns; in adxl372_decode_stream()
119 if (enc_data->has_x) { in adxl372_decode_stream()
120 adxl372_accel_convert_q31(&data->readings[count].x, buffer); in adxl372_decode_stream()
124 if (enc_data->has_y) { in adxl372_decode_stream()
125 adxl372_accel_convert_q31(&data->readings[count].y, in adxl372_decode_stream()
131 if (enc_data->has_z) { in adxl372_decode_stream()
132 adxl372_accel_convert_q31(&data->readings[count].z, in adxl372_decode_stream()
137 return -ENOTSUP; in adxl372_decode_stream()
142 count++; in adxl372_decode_stream()
144 return count; in adxl372_decode_stream()
152 int32_t ret = -ENOTSUP; in adxl372_decoder_get_frame_count()
161 if (!data->is_fifo) { in adxl372_decoder_get_frame_count()
177 if (data->fifo_byte_count == 0) { in adxl372_decoder_get_frame_count()
183 if (data->has_x) { in adxl372_decoder_get_frame_count()
185 data->fifo_byte_count / data->sample_set_size; in adxl372_decoder_get_frame_count()
190 if (data->has_y) { in adxl372_decoder_get_frame_count()
192 data->fifo_byte_count / data->sample_set_size; in adxl372_decoder_get_frame_count()
197 if (data->has_z) { in adxl372_decoder_get_frame_count()
199 data->fifo_byte_count / data->sample_set_size; in adxl372_decoder_get_frame_count()
204 if (data->has_x || data->has_y || data->has_z) { in adxl372_decoder_get_frame_count()
206 data->fifo_byte_count / data->sample_set_size; in adxl372_decoder_get_frame_count()
228 return -ENOTSUP; in adxl372_decode_sample()
233 adxl372_accel_convert(out, data->x); in adxl372_decode_sample()
236 adxl372_accel_convert(out, data->y); in adxl372_decode_sample()
239 adxl372_accel_convert(out, data->z); in adxl372_decode_sample()
242 adxl372_accel_convert(out++, data->x); in adxl372_decode_sample()
243 adxl372_accel_convert(out++, data->y); in adxl372_decode_sample()
244 adxl372_accel_convert(out, data->z); in adxl372_decode_sample()
247 return -ENOTSUP; in adxl372_decode_sample()
261 if (data->is_fifo) { in adxl372_decoder_decode()
273 if (!data->is_fifo) { in adxl372_decoder_has_trigger()
279 return FIELD_GET(ADXL372_INT1_MAP_DATA_RDY_MSK, data->int_status); in adxl372_decoder_has_trigger()
282 return FIELD_GET(ADXL372_INT1_MAP_FIFO_FULL_MSK, data->int_status); in adxl372_decoder_has_trigger()