Lines Matching refs:edata

185 	struct icm42688_encoded_data *edata = (struct icm42688_encoded_data *)buf;  in icm42688_encode()  local
187 edata->channels = 0; in icm42688_encode()
190 edata->channels |= icm42688_encode_channel(channels[i].chan_type); in icm42688_encode()
193 edata->header.is_fifo = false; in icm42688_encode()
194 edata->header.accel_fs = data->cfg.accel_fs; in icm42688_encode()
195 edata->header.gyro_fs = data->cfg.gyro_fs; in icm42688_encode()
196 edata->header.timestamp = k_ticks_to_ns_floor64(k_uptime_ticks()); in icm42688_encode()
351 const struct icm42688_fifo_data *edata = (const struct icm42688_fifo_data *)buffer; in icm42688_fifo_decode() local
352 const uint8_t *buffer_end = buffer + sizeof(struct icm42688_fifo_data) + edata->fifo_count; in icm42688_fifo_decode()
362 ((struct sensor_data_header *)data_out)->base_timestamp_ns = edata->header.timestamp; in icm42688_fifo_decode()
396 accel_period_ns[edata->accel_odr] * (accel_frame_count - 1); in icm42688_fifo_decode()
399 gyro_period_ns[edata->gyro_odr] * (gyro_frame_count - 1); in icm42688_fifo_decode()
407 uint64_t period_ns = accel_period_ns[edata->accel_odr]; in icm42688_fifo_decode()
409 icm42688_get_shift(SENSOR_CHAN_ACCEL_XYZ, edata->header.accel_fs, in icm42688_fifo_decode()
410 edata->header.gyro_fs, &data->shift); in icm42688_fifo_decode()
413 rc = icm42688_read_imu_from_packet(buffer, true, edata->header.accel_fs, 0, in icm42688_fifo_decode()
415 rc |= icm42688_read_imu_from_packet(buffer, true, edata->header.accel_fs, 1, in icm42688_fifo_decode()
417 rc |= icm42688_read_imu_from_packet(buffer, true, edata->header.accel_fs, 2, in icm42688_fifo_decode()
428 uint64_t period_ns = accel_period_ns[edata->gyro_odr]; in icm42688_fifo_decode()
430 icm42688_get_shift(SENSOR_CHAN_GYRO_XYZ, edata->header.accel_fs, in icm42688_fifo_decode()
431 edata->header.gyro_fs, &data->shift); in icm42688_fifo_decode()
434 rc = icm42688_read_imu_from_packet(buffer, false, edata->header.gyro_fs, 0, in icm42688_fifo_decode()
436 rc |= icm42688_read_imu_from_packet(buffer, false, edata->header.gyro_fs, 1, in icm42688_fifo_decode()
438 rc |= icm42688_read_imu_from_packet(buffer, false, edata->header.gyro_fs, 2, in icm42688_fifo_decode()
456 const struct icm42688_encoded_data *edata = (const struct icm42688_encoded_data *)buffer; in icm42688_one_shot_decode() local
457 const struct icm42688_decoder_header *header = &edata->header; in icm42688_one_shot_decode()
459 .accel_fs = edata->header.accel_fs, in icm42688_one_shot_decode()
460 .gyro_fs = edata->header.gyro_fs, in icm42688_one_shot_decode()
478 if ((channel_request & edata->channels) != channel_request) { in icm42688_one_shot_decode()
484 out->header.base_timestamp_ns = edata->header.timestamp; in icm42688_one_shot_decode()
494 edata->readings[icm42688_get_channel_position(SENSOR_CHAN_ACCEL_X)], in icm42688_one_shot_decode()
498 edata->readings[icm42688_get_channel_position(SENSOR_CHAN_ACCEL_Y)], in icm42688_one_shot_decode()
502 edata->readings[icm42688_get_channel_position(SENSOR_CHAN_ACCEL_Z)], in icm42688_one_shot_decode()
512 if ((channel_request & edata->channels) != channel_request) { in icm42688_one_shot_decode()
518 out->header.base_timestamp_ns = edata->header.timestamp; in icm42688_one_shot_decode()
529 edata->readings[icm42688_get_channel_position(SENSOR_CHAN_GYRO_X)], in icm42688_one_shot_decode()
533 edata->readings[icm42688_get_channel_position(SENSOR_CHAN_GYRO_Y)], in icm42688_one_shot_decode()
537 edata->readings[icm42688_get_channel_position(SENSOR_CHAN_GYRO_Z)], in icm42688_one_shot_decode()
544 if ((channel_request & edata->channels) != channel_request) { in icm42688_one_shot_decode()
550 out->header.base_timestamp_ns = edata->header.timestamp; in icm42688_one_shot_decode()
561 edata->readings[icm42688_get_channel_position(SENSOR_CHAN_DIE_TEMP)], in icm42688_one_shot_decode()
670 const struct icm42688_fifo_data *edata = (const struct icm42688_fifo_data *)buffer; in icm24688_decoder_has_trigger() local
672 if (!edata->header.is_fifo) { in icm24688_decoder_has_trigger()
678 return FIELD_GET(BIT_INT_STATUS_DATA_RDY, edata->int_status); in icm24688_decoder_has_trigger()
680 return FIELD_GET(BIT_INT_STATUS_FIFO_THS, edata->int_status); in icm24688_decoder_has_trigger()
682 return FIELD_GET(BIT_INT_STATUS_FIFO_FULL, edata->int_status); in icm24688_decoder_has_trigger()