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