Lines Matching refs:buffer
138 static int lsm6dsv16x_decoder_get_frame_count(const uint8_t *buffer, in lsm6dsv16x_decoder_get_frame_count() argument
142 struct lsm6dsv16x_fifo_data *data = (struct lsm6dsv16x_fifo_data *)buffer; in lsm6dsv16x_decoder_get_frame_count()
171 const struct lsm6dsv16x_fifo_data *edata = (const struct lsm6dsv16x_fifo_data *)buffer; in lsm6dsv16x_decoder_get_frame_count()
181 buffer += sizeof(struct lsm6dsv16x_fifo_data); in lsm6dsv16x_decoder_get_frame_count()
182 buffer_end = buffer + LSM6DSV16X_FIFO_SIZE(edata->fifo_count); in lsm6dsv16x_decoder_get_frame_count()
185 while (buffer < buffer_end) { in lsm6dsv16x_decoder_get_frame_count()
186 fifo_tag = (buffer[0] >> 3); in lsm6dsv16x_decoder_get_frame_count()
213 buffer += LSM6DSV16X_FIFO_ITEM_LEN; in lsm6dsv16x_decoder_get_frame_count()
255 static int lsm6dsv16x_decode_fifo(const uint8_t *buffer, struct sensor_chan_spec chan_spec, in lsm6dsv16x_decode_fifo() argument
258 const struct lsm6dsv16x_fifo_data *edata = (const struct lsm6dsv16x_fifo_data *)buffer; in lsm6dsv16x_decode_fifo()
273 ret = lsm6dsv16x_decoder_get_frame_count(buffer, chan_spec, &tot_chan_fifo_words); in lsm6dsv16x_decode_fifo()
278 buffer += sizeof(struct lsm6dsv16x_fifo_data); in lsm6dsv16x_decode_fifo()
279 buffer_end = buffer + LSM6DSV16X_FIFO_SIZE(edata->fifo_count); in lsm6dsv16x_decode_fifo()
308 while (count < max_count && buffer < buffer_end) { in lsm6dsv16x_decode_fifo()
309 const uint8_t *frame_end = buffer; in lsm6dsv16x_decode_fifo()
315 fifo_tag = (buffer[0] >> 3); in lsm6dsv16x_decode_fifo()
324 if ((uintptr_t)buffer < *fit) { in lsm6dsv16x_decode_fifo()
326 buffer = frame_end; in lsm6dsv16x_decode_fifo()
331 buffer = frame_end; in lsm6dsv16x_decode_fifo()
338 x = *(int16_t *)&buffer[1]; in lsm6dsv16x_decode_fifo()
339 y = *(int16_t *)&buffer[3]; in lsm6dsv16x_decode_fifo()
340 z = *(int16_t *)&buffer[5]; in lsm6dsv16x_decode_fifo()
355 if ((uintptr_t)buffer < *fit) { in lsm6dsv16x_decode_fifo()
357 buffer = frame_end; in lsm6dsv16x_decode_fifo()
362 buffer = frame_end; in lsm6dsv16x_decode_fifo()
369 x = *(int16_t *)&buffer[1]; in lsm6dsv16x_decode_fifo()
370 y = *(int16_t *)&buffer[3]; in lsm6dsv16x_decode_fifo()
371 z = *(int16_t *)&buffer[5]; in lsm6dsv16x_decode_fifo()
387 if ((uintptr_t)buffer < *fit) { in lsm6dsv16x_decode_fifo()
389 buffer = frame_end; in lsm6dsv16x_decode_fifo()
394 buffer = frame_end; in lsm6dsv16x_decode_fifo()
401 t = *(int16_t *)&buffer[1]; in lsm6dsv16x_decode_fifo()
416 if ((uintptr_t)buffer < *fit) { in lsm6dsv16x_decode_fifo()
418 buffer = frame_end; in lsm6dsv16x_decode_fifo()
423 buffer = frame_end; in lsm6dsv16x_decode_fifo()
430 x.i = lsm6dsv16x_from_f16_to_f32(buffer[1] | (buffer[2] << 8)); in lsm6dsv16x_decode_fifo()
431 y.i = lsm6dsv16x_from_f16_to_f32(buffer[3] | (buffer[4] << 8)); in lsm6dsv16x_decode_fifo()
432 z.i = lsm6dsv16x_from_f16_to_f32(buffer[5] | (buffer[6] << 8)); in lsm6dsv16x_decode_fifo()
473 if ((uintptr_t)buffer < *fit) { in lsm6dsv16x_decode_fifo()
475 buffer = frame_end; in lsm6dsv16x_decode_fifo()
480 buffer = frame_end; in lsm6dsv16x_decode_fifo()
487 x = buffer[1] | (buffer[2] << 8); in lsm6dsv16x_decode_fifo()
488 y = buffer[3] | (buffer[4] << 8); in lsm6dsv16x_decode_fifo()
489 z = buffer[5] | (buffer[6] << 8); in lsm6dsv16x_decode_fifo()
504 if ((uintptr_t)buffer < *fit) { in lsm6dsv16x_decode_fifo()
506 buffer = frame_end; in lsm6dsv16x_decode_fifo()
511 buffer = frame_end; in lsm6dsv16x_decode_fifo()
518 x = lsm6dsv16x_from_sflp_to_mg(buffer[1] | (buffer[2] << 8)); in lsm6dsv16x_decode_fifo()
519 y = lsm6dsv16x_from_sflp_to_mg(buffer[3] | (buffer[4] << 8)); in lsm6dsv16x_decode_fifo()
520 z = lsm6dsv16x_from_sflp_to_mg(buffer[5] | (buffer[6] << 8)); in lsm6dsv16x_decode_fifo()
532 buffer = frame_end; in lsm6dsv16x_decode_fifo()
537 buffer = frame_end; in lsm6dsv16x_decode_fifo()
546 static int lsm6dsv16x_decode_sample(const uint8_t *buffer, struct sensor_chan_spec chan_spec, in lsm6dsv16x_decode_sample() argument
549 const struct lsm6dsv16x_rtio_data *edata = (const struct lsm6dsv16x_rtio_data *)buffer; in lsm6dsv16x_decode_sample()
634 static int lsm6dsv16x_decoder_decode(const uint8_t *buffer, struct sensor_chan_spec chan_spec, in lsm6dsv16x_decoder_decode() argument
639 (const struct lsm6dsv16x_decoder_header *)buffer; in lsm6dsv16x_decoder_decode()
642 return lsm6dsv16x_decode_fifo(buffer, chan_spec, fit, max_count, data_out); in lsm6dsv16x_decoder_decode()
646 return lsm6dsv16x_decode_sample(buffer, chan_spec, fit, max_count, data_out); in lsm6dsv16x_decoder_decode()
673 static bool lsm6dsv16x_decoder_has_trigger(const uint8_t *buffer, enum sensor_trigger_type trigger) in lsm6dsv16x_decoder_has_trigger() argument