inv_mpu_dmp_motion_driver.h
Go to the documentation of this file.
00001 /*
00002  $License:
00003     Copyright (C) 2011-2012 InvenSense Corporation, All Rights Reserved.
00004     See included License.txt for License information.
00005  $
00006  */
00017 #ifndef _INV_MPU_DMP_MOTION_DRIVER_H_
00018 #define _INV_MPU_DMP_MOTION_DRIVER_H_
00019 
00020 #define TAP_X               (0x01)
00021 #define TAP_Y               (0x02)
00022 #define TAP_Z               (0x04)
00023 #define TAP_XYZ             (0x07)
00024 
00025 #define TAP_X_UP            (0x01)
00026 #define TAP_X_DOWN          (0x02)
00027 #define TAP_Y_UP            (0x03)
00028 #define TAP_Y_DOWN          (0x04)
00029 #define TAP_Z_UP            (0x05)
00030 #define TAP_Z_DOWN          (0x06)
00031 
00032 #define ANDROID_ORIENT_PORTRAIT             (0x00)
00033 #define ANDROID_ORIENT_LANDSCAPE            (0x01)
00034 #define ANDROID_ORIENT_REVERSE_PORTRAIT     (0x02)
00035 #define ANDROID_ORIENT_REVERSE_LANDSCAPE    (0x03)
00036 
00037 #define DMP_INT_GESTURE     (0x01)
00038 #define DMP_INT_CONTINUOUS  (0x02)
00039 
00040 #define DMP_FEATURE_TAP             (0x001)
00041 #define DMP_FEATURE_ANDROID_ORIENT  (0x002)
00042 #define DMP_FEATURE_LP_QUAT         (0x004)
00043 #define DMP_FEATURE_PEDOMETER       (0x008)
00044 #define DMP_FEATURE_6X_LP_QUAT      (0x010)
00045 #define DMP_FEATURE_GYRO_CAL        (0x020)
00046 #define DMP_FEATURE_SEND_RAW_ACCEL  (0x040)
00047 #define DMP_FEATURE_SEND_RAW_GYRO   (0x080)
00048 #define DMP_FEATURE_SEND_CAL_GYRO   (0x100)
00049 
00050 #define INV_WXYZ_QUAT       (0x100)
00051 
00052 /* Set up functions. */
00053 void dmp_init_structures();
00054 int dmp_select_device(int device);
00055 int dmp_load_motion_driver_firmware(void);
00056 int dmp_set_fifo_rate(unsigned short rate);
00057 int dmp_get_fifo_rate(unsigned short *rate);
00058 int dmp_enable_feature(unsigned short mask);
00059 int dmp_get_enabled_features(unsigned short *mask);
00060 int dmp_set_interrupt_mode(unsigned char mode);
00061 int dmp_set_orientation(unsigned short orient);
00062 int dmp_set_gyro_bias(long *bias);
00063 int dmp_set_accel_bias(long *bias);
00064 
00065 #ifdef MPU_MAXIMAL
00066 /* Tap functions. */
00067 int dmp_register_tap_cb(void (*func)(unsigned char, unsigned char));
00068 int dmp_set_tap_thresh(unsigned char axis, unsigned short thresh);
00069 int dmp_set_tap_axes(unsigned char axis);
00070 int dmp_set_tap_count(unsigned char min_taps);
00071 int dmp_set_tap_time(unsigned short time);
00072 int dmp_set_tap_time_multi(unsigned short time);
00073 int dmp_set_shake_reject_thresh(long sf, unsigned short thresh);
00074 int dmp_set_shake_reject_time(unsigned short time);
00075 int dmp_set_shake_reject_timeout(unsigned short time);
00076 
00077 /* Android orientation functions. */
00078 int dmp_register_android_orient_cb(void (*func)(unsigned char));
00079 #endif // MPU_MAXIMAL
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 #ifdef MPU_MAXIMAL
00086 /* Pedometer functions. */
00087 int dmp_get_pedometer_step_count(unsigned long *count);
00088 int dmp_set_pedometer_step_count(unsigned long count);
00089 int dmp_get_pedometer_walk_time(unsigned long *time);
00090 int dmp_set_pedometer_walk_time(unsigned long time);
00091 #endif // MPU_MAXIMAL
00092 
00093 /* DMP gyro calibration functions. */
00094 int dmp_enable_gyro_cal(unsigned char enable);
00095 
00096 /* Read function. This function should be called whenever the MPU interrupt is
00097  * detected.
00098  */
00099 int dmp_read_fifo(short *gyro, short *accel, long *quat,
00100     unsigned long *timestamp, short *sensors, unsigned char *more);
00101 
00102 #endif  /* #ifndef _INV_MPU_DMP_MOTION_DRIVER_H_ */
00103 


lizi_arduino
Author(s): RoboTiCan
autogenerated on Wed Aug 26 2015 12:24:22