Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: CSSE4011_BLE_IMU_Project_rev2 Seeed_Tiny_BLE_Get_Started nrf51822_fix_i2c_spi_conflict balanceboard ... more
inv_mpu_dmp_motion_driver.h
00001 /* 00002 $License: 00003 Copyright (C) 2011-2012 InvenSense Corporation, All Rights Reserved. 00004 See included License.txt for License information. 00005 $ 00006 */ 00007 /** 00008 * @addtogroup DRIVERS Sensor Driver Layer 00009 * @brief Hardware drivers to communicate with sensors via I2C. 00010 * 00011 * @{ 00012 * @file inv_mpu_dmp_motion_driver.h 00013 * @brief DMP image and interface functions. 00014 * @details All functions are preceded by the dmp_ prefix to 00015 * differentiate among MPL and general driver function calls. 00016 */ 00017 #ifndef _INV_MPU_DMP_MOTION_DRIVER_H_ 00018 #define _INV_MPU_DMP_MOTION_DRIVER_H_ 00019 00020 #ifdef __cplusplus 00021 extern "C" { 00022 #endif 00023 00024 #define TAP_X (0x01) 00025 #define TAP_Y (0x02) 00026 #define TAP_Z (0x04) 00027 #define TAP_XYZ (0x07) 00028 00029 #define TAP_X_UP (0x01) 00030 #define TAP_X_DOWN (0x02) 00031 #define TAP_Y_UP (0x03) 00032 #define TAP_Y_DOWN (0x04) 00033 #define TAP_Z_UP (0x05) 00034 #define TAP_Z_DOWN (0x06) 00035 00036 #define ANDROID_ORIENT_PORTRAIT (0x00) 00037 #define ANDROID_ORIENT_LANDSCAPE (0x01) 00038 #define ANDROID_ORIENT_REVERSE_PORTRAIT (0x02) 00039 #define ANDROID_ORIENT_REVERSE_LANDSCAPE (0x03) 00040 00041 #define DMP_INT_GESTURE (0x01) 00042 #define DMP_INT_CONTINUOUS (0x02) 00043 00044 #define DMP_FEATURE_TAP (0x001) 00045 #define DMP_FEATURE_ANDROID_ORIENT (0x002) 00046 #define DMP_FEATURE_LP_QUAT (0x004) 00047 #define DMP_FEATURE_PEDOMETER (0x008) 00048 #define DMP_FEATURE_6X_LP_QUAT (0x010) 00049 #define DMP_FEATURE_GYRO_CAL (0x020) 00050 #define DMP_FEATURE_SEND_RAW_ACCEL (0x040) 00051 #define DMP_FEATURE_SEND_RAW_GYRO (0x080) 00052 #define DMP_FEATURE_SEND_CAL_GYRO (0x100) 00053 00054 #define INV_WXYZ_QUAT (0x100) 00055 00056 /* Set up functions. */ 00057 int dmp_load_motion_driver_firmware(void); 00058 int dmp_set_fifo_rate(unsigned short rate); 00059 int dmp_get_fifo_rate(unsigned short *rate); 00060 int dmp_enable_feature(unsigned short mask); 00061 int dmp_get_enabled_features(unsigned short *mask); 00062 int dmp_set_interrupt_mode(unsigned char mode); 00063 int dmp_set_orientation(unsigned short orient); 00064 int dmp_set_gyro_bias(long *bias); 00065 int dmp_set_accel_bias(long *bias); 00066 00067 /* Tap functions. */ 00068 int dmp_register_tap_cb(void (*func)(unsigned char, unsigned char)); 00069 int dmp_set_tap_thresh(unsigned char axis, unsigned short thresh); 00070 int dmp_set_tap_axes(unsigned char axis); 00071 int dmp_set_tap_count(unsigned char min_taps); 00072 int dmp_set_tap_time(unsigned short time); 00073 int dmp_set_tap_time_multi(unsigned short time); 00074 int dmp_set_shake_reject_thresh(long sf, unsigned short thresh); 00075 int dmp_set_shake_reject_time(unsigned short time); 00076 int dmp_set_shake_reject_timeout(unsigned short time); 00077 00078 /* Android orientation functions. */ 00079 int dmp_register_android_orient_cb(void (*func)(unsigned char)); 00080 00081 /* LP quaternion functions. */ 00082 int dmp_enable_lp_quat(unsigned char enable); 00083 int dmp_enable_6x_lp_quat(unsigned char enable); 00084 00085 /* Pedometer functions. */ 00086 int dmp_get_pedometer_step_count(unsigned long *count); 00087 int dmp_set_pedometer_step_count(unsigned long count); 00088 int dmp_get_pedometer_walk_time(unsigned long *time); 00089 int dmp_set_pedometer_walk_time(unsigned long time); 00090 00091 /* DMP gyro calibration functions. */ 00092 int dmp_enable_gyro_cal(unsigned char enable); 00093 00094 /* Read function. This function should be called whenever the MPU interrupt is 00095 * detected. 00096 */ 00097 int dmp_read_fifo(short *gyro, short *accel, long *quat, 00098 unsigned long *timestamp, short *sensors, unsigned char *more); 00099 00100 #ifdef __cplusplus 00101 } 00102 #endif 00103 00104 #endif /* #ifndef _INV_MPU_DMP_MOTION_DRIVER_H_ */ 00105
Generated on Tue Jul 12 2022 18:47:12 by
1.7.2