InvenSense Inc.
1197 Borregas Ave., Sunnyvale, CA 94089 U.S.A.
Tel: +1 (408) 988-7339 Fax: +1 (408) 988-8104
Website: www.invensense.com
: SW-EMD-REL-5.1.1
Doc
Doc Rev : 1.0
Date
: 12/14/2012
Embedded Motion Driver v5.1.1
APIs Specification
CONFIDENTIAL & PROPRIETARY
www.invensense.com
A printed copy of this document is NOT UNDER REVISION CONTROLunless it is dated and stamped in red ink as,“REVISION CONTROLLED COPY.”This information furnished by InvenSense is believed to be accurate and reliable. However, no responsibility is assumed by InvenSense for its use, or for any infringements or patents or other rights of third parties that may result from its use. Specifications are subject to change without notice. Certain intellectual property owned by InvenSense and described in this document is patent protected. No license is granted by Implication or otherwise under any patent or patent rights of InvenSense. This isan unpublished work protected under the United States copyright laws. This work contains proprietary and confidential information of InvenSense Inc. Use, disclosure or reproduction without the express written authorization of InvenSense Inc. is prohibited.Trademarks that are registered trademarks are the property of their respective companies.This publication supersedes and replaces all information previously supplied. InvenSense sensors should not be used or sold for the development, storing, production and utilization of any conventional or mass-destructive weapons or any other weapons or life threatening applications, as well as to be used in any other life critical applications such as medical, transportation, aerospace, nuclear, undersea, power, disaster and crime prevention equipment.Copyright ©2010InvenSense Corporation.
eMD v5.1.1
APIs Specification
: SW-EMD-REL-5.1.1
Doc
Doc Rev : 1.0
Date
: 12/14/2012
CONFIDENTIAL & PROPRIETARY
www.invensense.com
: SW-EMD-REL-5.1.1
Doc
Doc Rev : 1.0
Date
: 12/14/2012
eMD v5.1.1
APIs Specification
Chapter 1
Purpose and Scope
This document is a guide to all of the functions available in the InvenSense Embedded Motion Driver (eMD), and
corresponds with Embedded Motion Driver Release v5.1.1.
The eMD contains the code for configuring the InvenSense devices and using the DMP hardware features. All of the
source code is in ANSI C and can be compiled in C or C++ environments.
All functions available in the eMD are described in this document, including all parameters involved in the function
calls.
For more information on how to use these functions in a specific application, refer to InvenSense Application Notes.
CONFIDENTIAL & PROPRIETARY
www.invensense.com
: SW-EMD-REL-5.1.1
Doc
Doc Rev : 1.0
Date
: 12/14/2012
eMD v5.1.1
APIs Specification
Chapter 2
About this document
This document is automatically generated from the source files using Doxygen’s output format in the LATEX. Heading,
footer, and general document format are customized from the standard header template provided by Doxygen. The
document is subdivided in the various sections, each describing the main source Modules composing the eMD and
implementing specific features.
Every section starts with a brief description and an overview of the functions composing the module. Each of those
functions is also fully documented in the analogous "Function Documentation" section. Clicking on the function
prototype will lead to the portion of text full documentating it.
This Embedded Motion Driver Functional Specification is best viewed in a PDF viewer, as it provides text hyper-
links and bookmarks on the left-hand side for ease of browsing. There is an Alphabetical Index of the modules and
their functions available at the bottom of this document.
CONFIDENTIAL & PROPRIETARY
www.invensense.com
eMD v5.1.1
APIs Specification
: SW-EMD-REL-5.1.1
Doc
Doc Rev : 1.0
Date
: 12/14/2012
Chapter 3
Module Index
3.1 Modules
Here is a list of all modules:
.
Sensor Driver Layer .
.
.
.
.
.
. . . . . . . . . . . . . . . . . . . . . . . .
3
CONFIDENTIAL & PROPRIETARY
www.invensense.com
eMD v5.1.1
APIs Specification
: SW-EMD-REL-5.1.1
Doc
Doc Rev : 1.0
Date
: 12/14/2012
2
Module Index
Generated on Fri Dec 14 11:17:09 2012 for MotionDriver by Doxygen
CONFIDENTIAL & PROPRIETARY
www.invensense.com
: SW-EMD-REL-5.1.1
Doc
Doc Rev : 1.0
Date
: 12/14/2012
eMD v5.1.1
APIs Specification
Chapter 4
Module Documentation
4.1 Sensor Driver Layer
Hardware drivers to communicate with sensors via I2C.
Files
• file inv_mpu.c
An I2C-based driver for Invensense gyroscopes.
• file inv_mpu_dmp_android.c
DMP image and interface functions.
Functions
• int dmp_enable_6x_lp_quat (unsigned char enable)
Generate 6-axis quaternions from the DMP.
• int dmp_enable_feature (unsigned short mask)
Enable DMP features.
• int dmp_enable_gyro_cal (unsigned char enable)
Calibrate the gyro data in the DMP.
• int dmp_enable_lp_quat (unsigned char enable)
Generate 3-axis quaternions from the DMP.
CONFIDENTIAL & PROPRIETARY
www.invensense.com
eMD v5.1.1
APIs Specification
: SW-EMD-REL-5.1.1
Doc
Doc Rev : 1.0
Date
: 12/14/2012
4
Module Documentation
• int dmp_enable_no_motion_detection (unsigned char enable)
Detect accel-based no motion events.
• int dmp_get_fifo_rate (unsigned short ∗rate)
Get DMP output rate.
• int dmp_get_pedometer_step_count (unsigned long ∗count)
Get current step count.
• int dmp_get_pedometer_walk_time (unsigned long ∗time)
Get duration of walking time.
• int dmp_load_android_firmware (void)
Load the DMP with this image.
• int dmp_read_fifo (short ∗gyro, short ∗accel,
∗timestamp, short ∗sensors, unsigned char ∗more)
long ∗quat, unsigned long
Get one packet from the FIFO.
• int dmp_register_android_orient_cb (void(∗func)(unsigned char))
Register a function to be executed on a android orientation event.
• int dmp_register_no_motion_cb (void(∗func)(void))
Register a function to be executed on a no motion event.
• int dmp_register_tap_cb (void(∗func)(unsigned char, unsigned char))
Register a function to be executed on a tap event.
• int dmp_set_accel_bias (long ∗bias)
Push accel biases to the DMP.
• int dmp_set_fifo_rate (unsigned short rate)
Set DMP output rate.
• int dmp_set_gyro_bias (long ∗bias)
Push gyro biases to the DMP.
• int dmp_set_interrupt_mode (unsigned char mode)
Specify when a DMP interrupt should occur.
• int dmp_set_no_motion_thresh (unsigned long thresh_mg)
Generated on Fri Dec 14 11:17:09 2012 for MotionDriver by Doxygen
CONFIDENTIAL & PROPRIETARY
www.invensense.com