It is modified accordingly to work with sparkfun dmp library under mbed platform
Dependents: MPU9250-dmp-bluepill MPU9250-dmp
Fork of MotionDriver_6_1 by
inv_mpu_dmp_motion_driver.h@0:5fa30cf392c3, 2014-08-24 (annotated)
- Committer:
- oprospero
- Date:
- Sun Aug 24 00:52:07 2014 +0000
- Revision:
- 0:5fa30cf392c3
Initial commit, copied from Motion Driver 6.1 no edits
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
oprospero | 0:5fa30cf392c3 | 1 | /* |
oprospero | 0:5fa30cf392c3 | 2 | $License: |
oprospero | 0:5fa30cf392c3 | 3 | Copyright (C) 2011-2012 InvenSense Corporation, All Rights Reserved. |
oprospero | 0:5fa30cf392c3 | 4 | See included License.txt for License information. |
oprospero | 0:5fa30cf392c3 | 5 | $ |
oprospero | 0:5fa30cf392c3 | 6 | */ |
oprospero | 0:5fa30cf392c3 | 7 | /** |
oprospero | 0:5fa30cf392c3 | 8 | * @addtogroup DRIVERS Sensor Driver Layer |
oprospero | 0:5fa30cf392c3 | 9 | * @brief Hardware drivers to communicate with sensors via I2C. |
oprospero | 0:5fa30cf392c3 | 10 | * |
oprospero | 0:5fa30cf392c3 | 11 | * @{ |
oprospero | 0:5fa30cf392c3 | 12 | * @file inv_mpu_dmp_motion_driver.h |
oprospero | 0:5fa30cf392c3 | 13 | * @brief DMP image and interface functions. |
oprospero | 0:5fa30cf392c3 | 14 | * @details All functions are preceded by the dmp_ prefix to |
oprospero | 0:5fa30cf392c3 | 15 | * differentiate among MPL and general driver function calls. |
oprospero | 0:5fa30cf392c3 | 16 | */ |
oprospero | 0:5fa30cf392c3 | 17 | #ifndef _INV_MPU_DMP_MOTION_DRIVER_H_ |
oprospero | 0:5fa30cf392c3 | 18 | #define _INV_MPU_DMP_MOTION_DRIVER_H_ |
oprospero | 0:5fa30cf392c3 | 19 | |
oprospero | 0:5fa30cf392c3 | 20 | #define TAP_X (0x01) |
oprospero | 0:5fa30cf392c3 | 21 | #define TAP_Y (0x02) |
oprospero | 0:5fa30cf392c3 | 22 | #define TAP_Z (0x04) |
oprospero | 0:5fa30cf392c3 | 23 | #define TAP_XYZ (0x07) |
oprospero | 0:5fa30cf392c3 | 24 | |
oprospero | 0:5fa30cf392c3 | 25 | #define TAP_X_UP (0x01) |
oprospero | 0:5fa30cf392c3 | 26 | #define TAP_X_DOWN (0x02) |
oprospero | 0:5fa30cf392c3 | 27 | #define TAP_Y_UP (0x03) |
oprospero | 0:5fa30cf392c3 | 28 | #define TAP_Y_DOWN (0x04) |
oprospero | 0:5fa30cf392c3 | 29 | #define TAP_Z_UP (0x05) |
oprospero | 0:5fa30cf392c3 | 30 | #define TAP_Z_DOWN (0x06) |
oprospero | 0:5fa30cf392c3 | 31 | |
oprospero | 0:5fa30cf392c3 | 32 | #define ANDROID_ORIENT_PORTRAIT (0x00) |
oprospero | 0:5fa30cf392c3 | 33 | #define ANDROID_ORIENT_LANDSCAPE (0x01) |
oprospero | 0:5fa30cf392c3 | 34 | #define ANDROID_ORIENT_REVERSE_PORTRAIT (0x02) |
oprospero | 0:5fa30cf392c3 | 35 | #define ANDROID_ORIENT_REVERSE_LANDSCAPE (0x03) |
oprospero | 0:5fa30cf392c3 | 36 | |
oprospero | 0:5fa30cf392c3 | 37 | #define DMP_INT_GESTURE (0x01) |
oprospero | 0:5fa30cf392c3 | 38 | #define DMP_INT_CONTINUOUS (0x02) |
oprospero | 0:5fa30cf392c3 | 39 | |
oprospero | 0:5fa30cf392c3 | 40 | #define DMP_FEATURE_TAP (0x001) |
oprospero | 0:5fa30cf392c3 | 41 | #define DMP_FEATURE_ANDROID_ORIENT (0x002) |
oprospero | 0:5fa30cf392c3 | 42 | #define DMP_FEATURE_LP_QUAT (0x004) |
oprospero | 0:5fa30cf392c3 | 43 | #define DMP_FEATURE_PEDOMETER (0x008) |
oprospero | 0:5fa30cf392c3 | 44 | #define DMP_FEATURE_6X_LP_QUAT (0x010) |
oprospero | 0:5fa30cf392c3 | 45 | #define DMP_FEATURE_GYRO_CAL (0x020) |
oprospero | 0:5fa30cf392c3 | 46 | #define DMP_FEATURE_SEND_RAW_ACCEL (0x040) |
oprospero | 0:5fa30cf392c3 | 47 | #define DMP_FEATURE_SEND_RAW_GYRO (0x080) |
oprospero | 0:5fa30cf392c3 | 48 | #define DMP_FEATURE_SEND_CAL_GYRO (0x100) |
oprospero | 0:5fa30cf392c3 | 49 | |
oprospero | 0:5fa30cf392c3 | 50 | #define INV_WXYZ_QUAT (0x100) |
oprospero | 0:5fa30cf392c3 | 51 | |
oprospero | 0:5fa30cf392c3 | 52 | /* Set up functions. */ |
oprospero | 0:5fa30cf392c3 | 53 | int dmp_load_motion_driver_firmware(void); |
oprospero | 0:5fa30cf392c3 | 54 | int dmp_set_fifo_rate(unsigned short rate); |
oprospero | 0:5fa30cf392c3 | 55 | int dmp_get_fifo_rate(unsigned short *rate); |
oprospero | 0:5fa30cf392c3 | 56 | int dmp_enable_feature(unsigned short mask); |
oprospero | 0:5fa30cf392c3 | 57 | int dmp_get_enabled_features(unsigned short *mask); |
oprospero | 0:5fa30cf392c3 | 58 | int dmp_set_interrupt_mode(unsigned char mode); |
oprospero | 0:5fa30cf392c3 | 59 | int dmp_set_orientation(unsigned short orient); |
oprospero | 0:5fa30cf392c3 | 60 | int dmp_set_gyro_bias(long *bias); |
oprospero | 0:5fa30cf392c3 | 61 | int dmp_set_accel_bias(long *bias); |
oprospero | 0:5fa30cf392c3 | 62 | |
oprospero | 0:5fa30cf392c3 | 63 | /* Tap functions. */ |
oprospero | 0:5fa30cf392c3 | 64 | int dmp_register_tap_cb(void (*func)(unsigned char, unsigned char)); |
oprospero | 0:5fa30cf392c3 | 65 | int dmp_set_tap_thresh(unsigned char axis, unsigned short thresh); |
oprospero | 0:5fa30cf392c3 | 66 | int dmp_set_tap_axes(unsigned char axis); |
oprospero | 0:5fa30cf392c3 | 67 | int dmp_set_tap_count(unsigned char min_taps); |
oprospero | 0:5fa30cf392c3 | 68 | int dmp_set_tap_time(unsigned short time); |
oprospero | 0:5fa30cf392c3 | 69 | int dmp_set_tap_time_multi(unsigned short time); |
oprospero | 0:5fa30cf392c3 | 70 | int dmp_set_shake_reject_thresh(long sf, unsigned short thresh); |
oprospero | 0:5fa30cf392c3 | 71 | int dmp_set_shake_reject_time(unsigned short time); |
oprospero | 0:5fa30cf392c3 | 72 | int dmp_set_shake_reject_timeout(unsigned short time); |
oprospero | 0:5fa30cf392c3 | 73 | |
oprospero | 0:5fa30cf392c3 | 74 | /* Android orientation functions. */ |
oprospero | 0:5fa30cf392c3 | 75 | int dmp_register_android_orient_cb(void (*func)(unsigned char)); |
oprospero | 0:5fa30cf392c3 | 76 | |
oprospero | 0:5fa30cf392c3 | 77 | /* LP quaternion functions. */ |
oprospero | 0:5fa30cf392c3 | 78 | int dmp_enable_lp_quat(unsigned char enable); |
oprospero | 0:5fa30cf392c3 | 79 | int dmp_enable_6x_lp_quat(unsigned char enable); |
oprospero | 0:5fa30cf392c3 | 80 | |
oprospero | 0:5fa30cf392c3 | 81 | /* Pedometer functions. */ |
oprospero | 0:5fa30cf392c3 | 82 | int dmp_get_pedometer_step_count(unsigned long *count); |
oprospero | 0:5fa30cf392c3 | 83 | int dmp_set_pedometer_step_count(unsigned long count); |
oprospero | 0:5fa30cf392c3 | 84 | int dmp_get_pedometer_walk_time(unsigned long *time); |
oprospero | 0:5fa30cf392c3 | 85 | int dmp_set_pedometer_walk_time(unsigned long time); |
oprospero | 0:5fa30cf392c3 | 86 | |
oprospero | 0:5fa30cf392c3 | 87 | /* DMP gyro calibration functions. */ |
oprospero | 0:5fa30cf392c3 | 88 | int dmp_enable_gyro_cal(unsigned char enable); |
oprospero | 0:5fa30cf392c3 | 89 | |
oprospero | 0:5fa30cf392c3 | 90 | /* Read function. This function should be called whenever the MPU interrupt is |
oprospero | 0:5fa30cf392c3 | 91 | * detected. |
oprospero | 0:5fa30cf392c3 | 92 | */ |
oprospero | 0:5fa30cf392c3 | 93 | int dmp_read_fifo(short *gyro, short *accel, long *quat, |
oprospero | 0:5fa30cf392c3 | 94 | unsigned long *timestamp, short *sensors, unsigned char *more); |
oprospero | 0:5fa30cf392c3 | 95 | |
oprospero | 0:5fa30cf392c3 | 96 | #endif /* #ifndef _INV_MPU_DMP_MOTION_DRIVER_H_ */ |
oprospero | 0:5fa30cf392c3 | 97 | |
oprospero | 0:5fa30cf392c3 | 98 |