Home | History | Annotate | Download | only in libsensors_iio

Lines Matching refs:mpu

228     LOGV_IF(EXTRA_VERBOSE, "HAL:gyro temperature path: %s", mpu.temperature);
229 gyro_temperature_fd = open(mpu.temperature, O_RDONLY);
234 "HAL:temperature_fd opened: %s", mpu.temperature);
242 "HAL:sysfs:cat %s (%lld)", mpu.accel_fsr, getTimestamp());
244 fd = open(mpu.accel_fsr, O_RDONLY);
377 write_sysfs_int(mpu.in_timestamp_en, 1);
381 mpu.trigger_name, getTimestamp());
382 tempFp = fopen(mpu.trigger_name, "r");
393 iio_trigger_name, mpu.current_trigger, getTimestamp());
394 tempFp = fopen(mpu.current_trigger, "w");
403 write_sysfs_int(mpu.buffer_length, IIO_BUFFER_LENGTH);
571 "HAL:sysfs:cat %s (%lld)", mpu.firmware_loaded, getTimestamp());
572 fd = open(mpu.firmware_loaded, O_RDONLY);
582 LOGV_IF(EXTRA_VERBOSE, "HAL:load dmp: %s", mpu.dmp_firmware);
583 fptr = fopen(mpu.dmp_firmware, "w");
585 LOGE("HAL:could open %s for write. %s", mpu.dmp_firmware, strerror(errno));
605 "HAL:sysfs:cat %s (%lld)", mpu.gyro_orient, getTimestamp());
606 fptr = fopen(mpu.gyro_orient, "r");
634 "HAL:sysfs:cat %s (%lld)", mpu.accel_orient, getTimestamp());
635 fptr = fopen(mpu.accel_orient, "r");
685 if(write_sysfs_int(mpu.chip_enable, 0) < 0) {
711 HW_GYRO_RATE_HZ, mpu.gyro_fifo_rate, getTimestamp());
712 int fd = open(mpu.gyro_fifo_rate, O_RDWR);
716 mpu.gyro_fifo_rate, strerror(res), res);
722 mpu.gyro_fifo_rate, HW_GYRO_RATE_HZ);
763 en, mpu.power_state, getTimestamp());
764 res = read_sysfs_int(mpu.power_state, &curr_power_state);
771 if((res = write_sysfs_int(mpu.power_state, en)) < 0) {
796 mpu.firmware_loaded, getTimestamp());
797 res = read_sysfs_int(mpu.firmware_loaded, &status);
802 LOGV_IF(SYSFS_VERBOSE, "HAL:sysfs: %s status=%d", mpu.firmware_loaded, status);
807 mpu.dmp_on, getTimestamp());
808 if (read_sysfs_int(mpu.dmp_on, &status) < 0) {
811 res = write_sysfs_int(mpu.dmp_on, en);
813 if (write_sysfs_int(mpu.dmp_int_on, en) < 0) {
858 res = write_sysfs_int(mpu.quaternion_on, en);
866 write_sysfs_int(mpu.in_quat_r_en, en);
867 write_sysfs_int(mpu.in_quat_x_en, en);
868 write_sysfs_int(mpu.in_quat_y_en, en);
869 write_sysfs_int(mpu.in_quat_z_en, en);
904 return write_sysfs_int(mpu.chip_enable, en);
915 res = write_sysfs_int(mpu.gyro_enable, en);
921 write_sysfs_int(mpu.gyro_x_fifo_enable, en);
922 write_sysfs_int(mpu.gyro_y_fifo_enable, en);
923 res = write_sysfs_int(mpu.gyro_z_fifo_enable, en);
937 res = write_sysfs_int(mpu.accel_enable, en);
943 write_sysfs_int(mpu.accel_x_fifo_enable, en);
944 write_sysfs_int(mpu.accel_y_fifo_enable, en);
945 res = write_sysfs_int(mpu.accel_z_fifo_enable, en);
1103 if (write_sysfs_int(mpu.dmp_event_int_on, 0) < 0) {
1136 if (write_sysfs_int(mpu.dmp_event_int_on, 1) < 0) {
1644 1000000000.f / tempRate, mpu.gyro_fifo_rate,
1646 tempFd = open(mpu.gyro_fifo_rate, O_RDWR);
1655 wanted_3rd_party_sensor / 1000000L, mpu.accel_fifo_rate,
1657 tempFd = open(mpu.accel_fifo_rate, O_RDWR);
1681 1000000000.f / wanted, mpu.gyro_fifo_rate, getTimestamp());
1682 tempFd = open(mpu.gyro_fifo_rate, O_RDWR);
1704 1000000000.f / wanted, mpu.accel_fifo_rate, getTimestamp());
1705 tempFd = open(mpu.accel_fifo_rate, O_RDWR);
2122 char *accel_fifo_enable[3] = {mpu.accel_x_fifo_enable,
2123 mpu.accel_y_fifo_enable, mpu.accel_z_fifo_enable};
2153 if (write_sysfs_int(mpu.display_orientation_on, en) < 0) {
2165 if (write_sysfs_int(mpu.dmp_output_rate, 5) < 0) {
2170 if (write_sysfs_int(mpu.accel_fifo_rate, 200) < 0) {
2208 dmp_orient_fd = open(mpu.event_display_orientation, O_RDONLY| O_NONBLOCK);
2241 fp = fopen(mpu.event_display_orientation, "r");
2296 write_sysfs_int(mpu.dmp_output_rate, 1000000000.f / *wanted);
2692 dptr = (char**)&mpu;
2699 // get proper (in absolute/relative) IIO path & build MPU's sysfs paths
2711 sprintf(mpu.key, "%s%s", sysfs_path, "/key");
2712 sprintf(mpu.chip_enable, "%s%s", sysfs_path, "/buffer/enable");
2713 sprintf(mpu.buffer_length, "%s%s", sysfs_path, "/buffer/length");
2714 sprintf(mpu.power_state, "%s%s", sysfs_path, "/power_state");
2715 sprintf(mpu.in_timestamp_en, "%s%s", sysfs_path, "/scan_elements/in_timestamp_en");
2716 sprintf(mpu.trigger_name, "%s%s", iio_trigger_path, "/name");
2717 sprintf(mpu.current_trigger, "%s%s", sysfs_path, "/trigger/current_trigger");
2719 sprintf(mpu.dmp_firmware, "%s%s", sysfs_path,"/dmp_firmware");
2720 sprintf(mpu.firmware_loaded,"%s%s", sysfs_path, "/firmware_loaded");
2721 sprintf(mpu.dmp_on,"%s%s", sysfs_path, "/dmp_on");
2722 sprintf(mpu.dmp_int_on,"%s%s", sysfs_path, "/dmp_int_on");
2723 sprintf(mpu.dmp_event_int_on,"%s%s", sysfs_path, "/dmp_event_int_on");
2724 sprintf(mpu.dmp_output_rate,"%s%s", sysfs_path, "/dmp_output_rate");
2725 sprintf(mpu.tap_on, "%s%s", sysfs_path, "/tap_on");
2728 sprintf(mpu.self_test, "%s%s", sysfs_path, "/self_test");
2730 sprintf(mpu.temperature, "%s%s", sysfs_path, "/temperature");
2731 sprintf(mpu.gyro_enable, "%s%s", sysfs_path, "/gyro_enable");
2732 sprintf(mpu.gyro_fifo_rate, "%s%s", sysfs_path, "/sampling_frequency");
2733 sprintf(mpu.gyro_orient, "%s%s", sysfs_path, "/gyro_matrix");
2734 sprintf(mpu.gyro_x_fifo_enable, "%s%s", sysfs_path, "/scan_elements/in_anglvel_x_en");
2735 sprintf(mpu.gyro_y_fifo_enable, "%s%s", sysfs_path, "/scan_elements/in_anglvel_y_en");
2736 sprintf(mpu.gyro_z_fifo_enable, "%s%s", sysfs_path, "/scan_elements/in_anglvel_z_en");
2738 sprintf(mpu.accel_enable, "%s%s", sysfs_path, "/accl_enable");
2739 sprintf(mpu.accel_fifo_rate, "%s%s", sysfs_path, "/sampling_frequency");
2740 sprintf(mpu.accel_orient, "%s%s", sysfs_path, "/accl_matrix");
2744 sprintf(mpu.accel_fsr, "%s%s", sysfs_path, "/in_accel_scale");
2746 sprintf(mpu.accel_bias, "%s%s", sysfs_path, "/accl_bias");
2749 sprintf(mpu.accel_x_fifo_enable, "%s%s", sysfs_path, "/scan_elements/in_accel_x_en");
2750 sprintf(mpu.accel_y_fifo_enable, "%s%s", sysfs_path, "/scan_elements/in_accel_y_en");
2751 sprintf(mpu.accel_z_fifo_enable, "%s%s", sysfs_path, "/scan_elements/in_accel_z_en");
2753 sprintf(mpu.quaternion_on, "%s%s", sysfs_path, "/quaternion_on");
2754 sprintf(mpu.in_quat_r_en, "%s%s", sysfs_path, "/scan_elements/in_quaternion_r_en");
2755 sprintf(mpu.in_quat_x_en, "%s%s", sysfs_path, "/scan_elements/in_quaternion_x_en");
2756 sprintf(mpu.in_quat_y_en, "%s%s", sysfs_path, "/scan_elements/in_quaternion_y_en");
2757 sprintf(mpu.in_quat_z_en, "%s%s", sysfs_path, "/scan_elements/in_quaternion_z_en");
2759 sprintf(mpu.display_orientation_on, "%s%s", sysfs_path, "/display_orientation_on");
2760 sprintf(mpu.event_display_orientation, "%s%s", sysfs_path, "/event_display_orientation");
2764 dptr = (char**)&mpu;