Lines Matching full:header

18  * Ensure that the size of the generic header aligns with the sensor channel specifier . If it
64 * @brief Compute the required header size
66 * This function takes into account alignment of the q31 values that will follow the header.
69 * @return The number of bytes needed for this sample frame's header
90 * @brief Checks if the header already contains a given channel
92 * @param[in] header The header to scan
94 * @param[in] num_channels The number of valid channels in the header so far
97 static inline int check_header_contains_channel(const struct sensor_data_generic_header *header, in check_header_contains_channel() argument
103 if (sensor_chan_spec_eq(header->channels[i], chan_spec)) { in check_header_contains_channel()
143 struct sensor_data_generic_header *header = (struct sensor_data_generic_header *)buf; in sensor_submit_fallback_sync() local
145 header->timestamp_ns = timestamp_ns; in sensor_submit_fallback_sync()
146 header->num_channels = num_output_samples; in sensor_submit_fallback_sync()
147 header->shift = 0; in sensor_submit_fallback_sync()
160 header->channels[sample_idx++] = (struct sensor_chan_spec) { in sensor_submit_fallback_sync()
164 header->channels[sample_idx++] = (struct sensor_chan_spec) { in sensor_submit_fallback_sync()
168 header->channels[sample_idx++] = (struct sensor_chan_spec) { in sensor_submit_fallback_sync()
173 header->channels[sample_idx++] = (struct sensor_chan_spec) { in sensor_submit_fallback_sync()
208 if (header->shift < new_shift) { in sensor_submit_fallback_sync()
215 q[q_idx] = q[q_idx] >> (new_shift - header->shift); in sensor_submit_fallback_sync()
217 header->shift = new_shift; in sensor_submit_fallback_sync()
228 header, header->channels[sample_idx + sample], sample_idx + sample); in sensor_submit_fallback_sync()
244 ((value_u * ((INT64_C(1) << 31) - 1)) / 1000000) >> header->shift; in sensor_submit_fallback_sync()
250 q[sample_idx + sample], header->shift); in sensor_submit_fallback_sync()
254 LOG_DBG("Total channels in header: %" PRIu32, header->num_channels); in sensor_submit_fallback_sync()
317 struct sensor_data_generic_header *header = (struct sensor_data_generic_header *)buffer; in get_frame_count() local
335 for (size_t i = 0; i < header->num_channels; ++i) { in get_frame_count()
336 if (sensor_chan_spec_eq(header->channels[i], channel)) { in get_frame_count()
390 static int get_q31_value(const struct sensor_data_generic_header *header, const q31_t *values, in get_q31_value() argument
393 for (size_t i = 0; i < header->num_channels; ++i) { in get_q31_value()
394 if (sensor_chan_spec_eq(chan_spec, header->channels[i])) { in get_q31_value()
402 static int decode_three_axis(const struct sensor_data_generic_header *header, const q31_t *values, in decode_three_axis() argument
408 data_out->header.base_timestamp_ns = header->timestamp_ns; in decode_three_axis()
409 data_out->header.reading_count = 1; in decode_three_axis()
410 data_out->shift = header->shift; in decode_three_axis()
413 rc = get_q31_value(header, values, (struct sensor_chan_spec){x, channel_idx}, in decode_three_axis()
418 rc = get_q31_value(header, values, (struct sensor_chan_spec){y, channel_idx}, in decode_three_axis()
423 rc = get_q31_value(header, values, (struct sensor_chan_spec){z, channel_idx}, in decode_three_axis()
431 static int decode_q31(const struct sensor_data_generic_header *header, const q31_t *values, in decode_q31() argument
436 data_out->header.base_timestamp_ns = header->timestamp_ns; in decode_q31()
437 data_out->header.reading_count = 1; in decode_q31()
438 data_out->shift = header->shift; in decode_q31()
441 rc = get_q31_value(header, values, chan_spec, &data_out->readings[0].value); in decode_q31()
468 const struct sensor_data_generic_header *header = in decode() local
470 const q31_t *q = (const q31_t *)(buffer + compute_header_size(header->num_channels)); in decode()
487 count = decode_three_axis(header, q, data_out, SENSOR_CHAN_ACCEL_X, in decode()
495 count = decode_three_axis(header, q, data_out, SENSOR_CHAN_GYRO_X, in decode()
503 count = decode_three_axis(header, q, data_out, SENSOR_CHAN_MAGN_X, in decode()
511 count = decode_three_axis(header, q, data_out, SENSOR_CHAN_POS_DX, in decode()
516 count = decode_q31(header, q, data_out, chan_spec); in decode()