initial

Dependencies:   mbed

Committer:
yihui
Date:
Mon Jan 11 02:49:25 2016 +0000
Revision:
1:9d3b497333c0
Parent:
0:638edba3adf6
use mbed lib

Who changed what in which revision?

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