Lines Matching refs:fifo_obj

129 struct fifo_obj {  struct
146 static struct fifo_obj fifo_obj; argument
172 accuracy = fifo_obj.data_config[configOffset]; in inv_set_fifo_accuracy()
174 if ((fifo_obj.data_config[configOffset] & INV_32_BIT)) in inv_set_fifo_accuracy()
202 && (fifo_obj.reference_count[kk + refOffset] > 0)) { in inv_set_fifo_reference()
203 fifo_obj.reference_count[kk + refOffset]--; in inv_set_fifo_reference()
210 fifo_obj.reference_count[kk + refOffset]++; in inv_set_fifo_reference()
216 if (fifo_obj.reference_count[kk + refOffset] > 0) in inv_set_fifo_reference()
243 fifo_obj.data_config[configOffset] = elements | accuracy; in inv_construct3_fifo()
267 int *fifo_offsets_ptr = fifo_obj.offsets; in inv_set_footer()
269 fifo_obj.fifo_packet_size = 0; in inv_set_footer()
274 if ((fifo_obj.data_config[i] >> j) & 0x0001) { in inv_set_footer()
326 if (fifo_obj.data_config[i] & INV_32_BIT) { in inv_set_footer()
384 if (fifo_obj.data_config[i] & INV_32_BIT) { in inv_set_footer()
395 fifo_obj.fifo_packet_size += tmp_count; in inv_set_footer()
397 if (fifo_obj.data_config[CONFIG_FOOTER] == 0 && in inv_set_footer()
398 fifo_obj.fifo_packet_size > 0) { in inv_set_footer()
405 fifo_obj.data_config[CONFIG_FOOTER] = 0x0001 | INV_16_BIT; in inv_set_footer()
406 fifo_obj.fifo_packet_size += 2; in inv_set_footer()
407 } else if (fifo_obj.data_config[CONFIG_FOOTER] && in inv_set_footer()
408 (fifo_obj.fifo_packet_size == 2)) { in inv_set_footer()
416 fifo_obj.data_config[CONFIG_FOOTER] = 0; in inv_set_footer()
417 fifo_obj.fifo_packet_size = 0; in inv_set_footer()
428 if (!fifo_obj.data_config[CONFIG_DMP_QUANT_ACCEL]) in inv_decode_quantized_accel()
443 value.u32 = fifo_obj.decoded[REF_QUANT_ACCEL + kk]; in inv_decode_quantized_accel()
449 fifo_obj.decoded_accel[kk][2] = temp.s10 * 64; in inv_decode_quantized_accel()
454 fifo_obj.decoded_accel[kk][1] = temp.s10 * 64; in inv_decode_quantized_accel()
458 fifo_obj.decoded_accel[kk][0] = temp.s10 * 64; in inv_decode_quantized_accel()
487 tmp = (0x20000000L * M_PI) / (fifo_obj.fifo_rate + 1); in inv_state_change_fifo()
513 return fifo_obj.fifo_packet_size; in inv_get_fifo_packet_size()
526 memset(&fifo_obj, 0, sizeof(struct fifo_obj)); in inv_init_fifo_param()
527 fifo_obj.decoded[REF_QUATERNION] = 1073741824L; // Set to Identity in inv_init_fifo_param()
529 fifo_obj.fifo_rate = 20; in inv_init_fifo_param()
530 fifo_obj.sample_step_size_ms = 100; in inv_init_fifo_param()
576 fifo_obj.gyro_source = source; in inv_set_gyro_data_source()
605 if (fifo_obj.fifo_packet_size == 0) in inv_read_and_process_fifo()
612 read = inv_get_fifo((uint_fast16_t) fifo_obj.fifo_packet_size, in inv_read_and_process_fifo()
615 read != fifo_obj.fifo_packet_size - FIFO_FOOTER_SIZE) { in inv_read_and_process_fifo()
618 memset(fifo_obj.decoded, 0, sizeof(fifo_obj.decoded)); in inv_read_and_process_fifo()
639 memset(fifo_obj.decoded, 0, sizeof(fifo_obj.decoded)); in inv_read_and_process_fifo()
640 fifo_obj.cache = 0; in inv_read_and_process_fifo()
642 fifo_obj.decoded[REF_RAW + 4 + kk] = in inv_read_and_process_fifo()
645 fifo_obj.decoded[REF_ACCEL + kk] = in inv_read_and_process_fifo()
647 fifo_obj.decoded[REF_ACCEL + kk] -= in inv_read_and_process_fifo()
655 if ((fifo_obj.fifo_rate < INV_MAX_NUM_ACCEL_SAMPLES) && in inv_read_and_process_fifo()
656 fifo_obj.data_config[CONFIG_DMP_QUANT_ACCEL]) { in inv_read_and_process_fifo()
664 if (fifo_obj.data_config[CONFIG_QUAT]) { in inv_read_and_process_fifo()
715 fifo_obj.fifo_process_cb = func; in inv_set_fifo_processed_callback()
736 p = (unsigned char *)(&fifo_obj.decoded); in inv_process_fifo_packet()
737 N = fifo_obj.fifo_packet_size; in inv_process_fifo_packet()
738 if (N > sizeof(fifo_obj.decoded)) in inv_process_fifo_packet()
741 memset(&fifo_obj.decoded, 0, sizeof(fifo_obj.decoded)); in inv_process_fifo_packet()
744 p[fifo_obj.offsets[kk]] = *dmpData++; in inv_process_fifo_packet()
750 fifo_obj.decoded[kk] = in inv_process_fifo_packet()
751 inv_q30_mult(fifo_obj.decoded[kk], fifo_scale[kk]); in inv_process_fifo_packet()
754 memcpy(&fifo_obj.decoded[REF_QUATERNION_6AXIS], in inv_process_fifo_packet()
755 &fifo_obj.decoded[REF_QUATERNION], 4 * sizeof(long)); in inv_process_fifo_packet()
758 fifo_obj.cache = 0; in inv_process_fifo_packet()
790 if (!fifo_obj.data_config[CONFIG_TEMPERATURE]) { in inv_get_temperature_raw()
793 if ((fifo_obj.cache & FIFO_CACHE_TEMPERATURE) == 0) { in inv_get_temperature_raw()
796 fifo_obj.cache |= FIFO_CACHE_TEMPERATURE; in inv_get_temperature_raw()
804 fifo_obj.decoded[REF_RAW] = ((short)regs[0] << 8) | (regs[1]); in inv_get_temperature_raw()
807 *data = (short)fifo_obj.decoded[REF_RAW]; in inv_get_temperature_raw()
845 if (!fifo_obj.data_config[CONFIG_DMP_QUANT_ACCEL]) in inv_get_unquantized_accel()
850 data[ii * ACCEL_NUM_AXES + kk] = fifo_obj.decoded_accel[ii][kk]; in inv_get_unquantized_accel()
869 if (!fifo_obj.data_config[CONFIG_DMP_QUANT_ACCEL]) in inv_get_quantized_accel()
873 data[ii] = fifo_obj.decoded[REF_QUANT_ACCEL + ii]; in inv_get_quantized_accel()
888 if ((fifo_obj.data_config[CONFIG_RAW_DATA] & 7) != 7) { in inv_get_gyro_sensor()
891 if ((fifo_obj.cache & FIFO_CACHE_GYRO) == 0) { in inv_get_gyro_sensor()
892 fifo_obj.cache |= FIFO_CACHE_GYRO; in inv_get_gyro_sensor()
901 fifo_obj.decoded[REF_RAW + 1] = in inv_get_gyro_sensor()
903 fifo_obj.decoded[REF_RAW + 2] = in inv_get_gyro_sensor()
905 fifo_obj.decoded[REF_RAW + 3] = in inv_get_gyro_sensor()
909 fifo_obj.decoded[REF_RAW + 1] = in inv_get_gyro_sensor()
910 inv_q30_mult(fifo_obj.decoded[REF_RAW + 1], in inv_get_gyro_sensor()
912 fifo_obj.decoded[REF_RAW + 2] = in inv_get_gyro_sensor()
913 inv_q30_mult(fifo_obj.decoded[REF_RAW + 2], in inv_get_gyro_sensor()
915 fifo_obj.decoded[REF_RAW + 3] = in inv_get_gyro_sensor()
916 inv_q30_mult(fifo_obj.decoded[REF_RAW + 3], in inv_get_gyro_sensor()
919 data[0] = fifo_obj.decoded[REF_RAW + 1]; in inv_get_gyro_sensor()
920 data[1] = fifo_obj.decoded[REF_RAW + 2]; in inv_get_gyro_sensor()
921 data[2] = fifo_obj.decoded[REF_RAW + 3]; in inv_get_gyro_sensor()
943 if (!fifo_obj.data_config[CONFIG_RAW_DATA]) in inv_get_gyro_and_accel_sensor()
947 data[ii] = fifo_obj.decoded[REF_RAW + 1 + ii]; in inv_get_gyro_and_accel_sensor()
966 if (!fifo_obj.data_config[CONFIG_RAW_EXTERNAL]) in inv_get_external_sensor_data()
970 data[ii] = fifo_obj.decoded[REF_RAW_EXTERNAL + ii]; in inv_get_external_sensor_data()
1041 fifo_obj.data_config[CONFIG_CONTROL_DATA] = elements | accuracy; in inv_send_cntrl_data()
1088 fifo_obj.data_config[CONFIG_DMP_PACKET_NUMBER] = in inv_send_packet_number()
1092 fifo_obj.data_config[CONFIG_DMP_PACKET_NUMBER] = 0; in inv_send_packet_number()
1153 if (fifo_obj.gyro_source == INV_GYRO_FROM_QUATERNION) { in inv_send_gyro()
1271 fifo_obj.data_config[CONFIG_QUAT] = elements | accuracy; in inv_send_quaternion()
1317 fifo_obj.data_config[CONFIG_TEMPERATURE] = 1 | INV_16_BIT; in inv_send_sensor_data()
1319 fifo_obj.data_config[CONFIG_TEMPERATURE] = 0; in inv_send_sensor_data()
1321 fifo_obj.data_config[CONFIG_RAW_DATA] = in inv_send_sensor_data()
1324 fifo_obj.data_config[CONFIG_RAW_DATA] = 0; in inv_send_sensor_data()
1395 fifo_obj.data_config[CONFIG_TEMPERATURE] = 1 | INV_16_BIT; in inv_send_sensor_data()
1397 fifo_obj.data_config[CONFIG_TEMPERATURE] = 0; in inv_send_sensor_data()
1399 fifo_obj.data_config[CONFIG_RAW_DATA] = in inv_send_sensor_data()
1402 fifo_obj.data_config[CONFIG_RAW_DATA] = 0; in inv_send_sensor_data()
1436 fifo_obj.data_config[CONFIG_RAW_EXTERNAL] = elements | INV_16_BIT; in inv_send_external_sensor_data()
1438 fifo_obj.data_config[CONFIG_RAW_EXTERNAL] = 0; in inv_send_external_sensor_data()
1510 fifo_obj.data_config[CONFIG_DMP_QUANT_ACCEL] = (elements) | INV_32_BIT; in inv_send_quantized_accel()
1512 fifo_obj.data_config[CONFIG_DMP_QUANT_ACCEL] = 0; in inv_send_quantized_accel()
1516 fifo_obj.decoded[REF_QUANT_ACCEL + kk] = 0; in inv_send_quantized_accel()
1518 fifo_obj.decoded_accel[kk][ii] = 0; in inv_send_quantized_accel()
1566 fifo_obj.data_config[CONFIG_EIS] = elements | accuracy; in inv_send_eis()
1594 if ((!fifo_obj.data_config[CONFIG_ACCEL] && in inv_get_accel()
1602 data[kk] = fifo_obj.decoded[REF_ACCEL + kk]; in inv_get_accel()
1623 if (!fifo_obj.data_config[CONFIG_QUAT]) in inv_get_quaternion()
1627 data[kk] = fifo_obj.decoded[REF_QUATERNION + kk]; in inv_get_quaternion()
1646 if (!fifo_obj.data_config[CONFIG_QUAT]) in inv_get_6axis_quaternion()
1650 data[kk] = fifo_obj.decoded[REF_QUATERNION_6AXIS + kk]; in inv_get_6axis_quaternion()
1680 if (fifo_obj.data_config[CONFIG_GYROS]) { in inv_get_gyro()
1682 data[kk] = fifo_obj.decoded[REF_GYROS + kk]; in inv_get_gyro()
1706 if (!fifo_obj.data_config[CONFIG_QUAT]) in inv_get_gravity()
1709 if ((fifo_obj.cache & FIFO_CACHE_GRAVITY_BODY) == 0) { in inv_get_gravity()
1710 fifo_obj.cache |= FIFO_CACHE_GRAVITY_BODY; in inv_get_gravity()
1729 fifo_obj.gravity_cache[ii] = data[ii]; in inv_get_gravity()
1732 data[0] = fifo_obj.gravity_cache[0]; in inv_get_gravity()
1733 data[1] = fifo_obj.gravity_cache[1]; in inv_get_gravity()
1734 data[2] = fifo_obj.gravity_cache[2]; in inv_get_gravity()
1749 fifo_obj.acc_filter_coef = coef; in inv_set_linear_accel_filter_coef()
1781 if ((fifo_obj.cache & FIFO_CACHE_ACC_BIAS) == 0) { in inv_get_linear_accel()
1782 fifo_obj.cache |= FIFO_CACHE_ACC_BIAS; in inv_get_linear_accel()
1787 fifo_obj.acc_bias_filt[kk] = (long)(x * fifo_obj.acc_filter_coef + in inv_get_linear_accel()
1788 fifo_obj.acc_bias_filt[kk] * in inv_get_linear_accel()
1790 fifo_obj.acc_filter_coef)); in inv_get_linear_accel()
1791 data[kk] = x - fifo_obj.acc_bias_filt[kk]; in inv_get_linear_accel()
1795 data[kk] = la[kk] - grav[kk] - fifo_obj.acc_bias_filt[kk]; in inv_get_linear_accel()
1813 if (fifo_obj.data_config[CONFIG_ACCEL] && fifo_obj.data_config[CONFIG_QUAT]) { in inv_get_linear_accel_in_world()
1817 inv_q_mult(&fifo_obj.decoded[REF_QUATERNION], wtemp, wtemp2); in inv_get_linear_accel_in_world()
1818 inv_q_invert(&fifo_obj.decoded[REF_QUATERNION], qi); in inv_get_linear_accel_in_world()
1840 if (!fifo_obj.data_config[CONFIG_CONTROL_DATA]) in inv_get_cntrl_data()
1844 data[kk] = fifo_obj.decoded[REF_CONTROL + kk]; in inv_get_cntrl_data()
1862 if (!fifo_obj.data_config[CONFIG_EIS]) in inv_get_eis()
1866 data[kk] = fifo_obj.decoded[REF_EIS + kk]; in inv_get_eis()
1912 if (!fifo_obj.data_config[CONFIG_QUAT]) in inv_get_quaternion_float()
1916 data[kk] = fifo_obj.decoded[REF_QUATERNION + kk] / 1073741824.0f; in inv_get_quaternion_float()
1967 fifo_obj.fifo_rate = fifoRate; in inv_set_fifo_rate()
1979 fifo_obj.sample_step_size_ms = in inv_set_fifo_rate()
2013 fifo_obj.sample_step_size_ms = (unsigned short)((1000L * 1000L) / data); in inv_set_fifo_rate()
2029 return fifo_obj.fifo_rate; in inv_get_fifo_rate()
2045 return (fifo_obj.fifo_rate + 1) * in inv_get_sample_step_size_ms()
2048 return fifo_obj.sample_step_size_ms; in inv_get_sample_step_size_ms()
2065 (fifo_obj.fifo_rate + 1)); in inv_get_sample_frequency()
2067 return (1000 / fifo_obj.sample_step_size_ms); in inv_get_sample_frequency()
2082 temp = fifo_obj.decoded[REF_GYROS + kk] >> in inv_get_gyro_sum_of_sqr()
2122 fifo_obj.decoded[REF_QUATERNION + kk] = (long)(q[kk] * (1L << 30)); in inv_override_quaternion()
2245 if (fifo_obj.fifo_process_cb) in inv_run_fifo_rate_processes()
2246 fifo_obj.fifo_process_cb(); in inv_run_fifo_rate_processes()