Lines Matching +full:adxl362 +full:- +full:trigger
4 * SPDX-License-Identifier: Apache-2.0
7 #include "adxl362.h"
52 *out = ((data_in - ADXL362_TEMP_BIAS_LSB) / ADXL362_TEMP_LSB_PER_C in adxl362_temp_convert_q31()
72 buffer + sizeof(struct adxl362_fifo_data) + enc_data->fifo_byte_count; in adxl362_decode_stream()
85 if (enc_data->has_tmp) { in adxl362_decode_stream()
89 uint64_t period_ns = accel_period_ns[enc_data->accel_odr]; in adxl362_decode_stream()
93 sample_num = ((uint8_t *)*fit - buffer) / sample_set_size; in adxl362_decode_stream()
108 if (enc_data->has_tmp) { in adxl362_decode_stream()
112 data->header.base_timestamp_ns = enc_data->timestamp; in adxl362_decode_stream()
113 data->header.reading_count = 1; in adxl362_decode_stream()
114 data->shift = 8; in adxl362_decode_stream()
116 data->readings[count].timestamp_delta = in adxl362_decode_stream()
123 adxl362_temp_convert_q31(&data->readings[count].temperature, in adxl362_decode_stream()
132 data->header.base_timestamp_ns = enc_data->timestamp; in adxl362_decode_stream()
133 data->header.reading_count = 1; in adxl362_decode_stream()
134 data->shift = range_to_shift[enc_data->selected_range]; in adxl362_decode_stream()
138 data->readings[count].timestamp_delta = sample_num in adxl362_decode_stream()
146 adxl362_accel_convert_q31(&data->readings[count].x, in adxl362_decode_stream()
147 data_in, enc_data->selected_range); in adxl362_decode_stream()
151 data->readings[count].timestamp_delta = sample_num in adxl362_decode_stream()
159 adxl362_accel_convert_q31(&data->readings[count].y, in adxl362_decode_stream()
160 data_in, enc_data->selected_range); in adxl362_decode_stream()
164 data->readings[count].timestamp_delta = sample_num in adxl362_decode_stream()
171 adxl362_accel_convert_q31(&data->readings[count].z, in adxl362_decode_stream()
172 data_in, enc_data->selected_range); in adxl362_decode_stream()
176 data->readings[count].timestamp_delta = sample_num * period_ns; in adxl362_decode_stream()
183 adxl362_accel_convert_q31(&data->readings[count].x, in adxl362_decode_stream()
184 data_in, enc_data->selected_range); in adxl362_decode_stream()
192 adxl362_accel_convert_q31(&data->readings[count].y, in adxl362_decode_stream()
193 data_in, enc_data->selected_range); in adxl362_decode_stream()
201 adxl362_accel_convert_q31(&data->readings[count].z, in adxl362_decode_stream()
202 data_in, enc_data->selected_range); in adxl362_decode_stream()
206 return -ENOTSUP; in adxl362_decode_stream()
223 int32_t ret = -ENOTSUP; in adxl362_decoder_get_frame_count()
232 if (!data->is_fifo) { in adxl362_decoder_get_frame_count()
248 if (data->fifo_byte_count == 0) { in adxl362_decoder_get_frame_count()
257 if (data->has_tmp) { in adxl362_decoder_get_frame_count()
259 *frame_count = data->fifo_byte_count / 8; in adxl362_decoder_get_frame_count()
262 *frame_count = data->fifo_byte_count / 6; in adxl362_decoder_get_frame_count()
268 if (data->has_tmp) { in adxl362_decoder_get_frame_count()
270 *frame_count = data->fifo_byte_count / 8; in adxl362_decoder_get_frame_count()
291 return -ENOTSUP; in adxl362_decode_sample()
296 adxl362_accel_convert(out, data->acc_x, data->selected_range); in adxl362_decode_sample()
299 adxl362_accel_convert(out, data->acc_y, data->selected_range); in adxl362_decode_sample()
302 adxl362_accel_convert(out, data->acc_z, data->selected_range); in adxl362_decode_sample()
305 adxl362_accel_convert(out++, data->acc_x, data->selected_range); in adxl362_decode_sample()
306 adxl362_accel_convert(out++, data->acc_y, data->selected_range); in adxl362_decode_sample()
307 adxl362_accel_convert(out, data->acc_z, data->selected_range); in adxl362_decode_sample()
310 adxl362_temp_convert(out, data->temp); in adxl362_decode_sample()
313 return -ENOTSUP; in adxl362_decode_sample()
327 if (data->is_fifo) { in adxl362_decoder_decode()
335 static bool adxl362_decoder_has_trigger(const uint8_t *buffer, enum sensor_trigger_type trigger) in adxl362_decoder_has_trigger() argument
339 if (!data->is_fifo) { in adxl362_decoder_has_trigger()
343 switch (trigger) { in adxl362_decoder_has_trigger()
345 return ADXL362_STATUS_CHECK_DATA_READY(data->int_status); in adxl362_decoder_has_trigger()
347 return ADXL362_STATUS_CHECK_FIFO_WTR(data->int_status); in adxl362_decoder_has_trigger()
349 return ADXL362_STATUS_CHECK_FIFO_OVR(data->int_status); in adxl362_decoder_has_trigger()