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: openwear-lifelogger-example
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 #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 int dmp_load_motion_driver_firmware(void); 00054 int dmp_set_fifo_rate(unsigned short rate); 00055 int dmp_get_fifo_rate(unsigned short *rate); 00056 int dmp_enable_feature(unsigned short mask); 00057 int dmp_get_enabled_features(unsigned short *mask); 00058 int dmp_set_interrupt_mode(unsigned char mode); 00059 int dmp_set_orientation(unsigned short orient); 00060 int dmp_set_gyro_bias(long *bias); 00061 int dmp_set_accel_bias(long *bias); 00062 00063 /* Tap functions. */ 00064 int dmp_register_tap_cb(void (*func)(unsigned char, unsigned char)); 00065 int dmp_set_tap_thresh(unsigned char axis, unsigned short thresh); 00066 int dmp_set_tap_axes(unsigned char axis); 00067 int dmp_set_tap_count(unsigned char min_taps); 00068 int dmp_set_tap_time(unsigned short time); 00069 int dmp_set_tap_time_multi(unsigned short time); 00070 int dmp_set_shake_reject_thresh(long sf, unsigned short thresh); 00071 int dmp_set_shake_reject_time(unsigned short time); 00072 int dmp_set_shake_reject_timeout(unsigned short time); 00073 00074 /* Android orientation functions. */ 00075 int dmp_register_android_orient_cb(void (*func)(unsigned char)); 00076 00077 /* LP quaternion functions. */ 00078 int dmp_enable_lp_quat(unsigned char enable); 00079 int dmp_enable_6x_lp_quat(unsigned char enable); 00080 00081 /* Pedometer functions. */ 00082 int dmp_get_pedometer_step_count(unsigned long *count); 00083 int dmp_set_pedometer_step_count(unsigned long count); 00084 int dmp_get_pedometer_walk_time(unsigned long *time); 00085 int dmp_set_pedometer_walk_time(unsigned long time); 00086 00087 /* DMP gyro calibration functions. */ 00088 int dmp_enable_gyro_cal(unsigned char enable); 00089 00090 /* Read function. This function should be called whenever the MPU interrupt is 00091 * detected. 00092 */ 00093 int dmp_read_fifo(short *gyro, short *accel, long *quat, 00094 unsigned long *timestamp, short *sensors, unsigned char *more); 00095 00096 #endif /* #ifndef _INV_MPU_DMP_MOTION_DRIVER_H_ */ 00097
Generated on Thu Jul 14 2022 19:09:08 by
