summaryrefslogtreecommitdiffstats
path: root/libsensors_iio/software/core/mpl
diff options
context:
space:
mode:
Diffstat (limited to 'libsensors_iio/software/core/mpl')
-rw-r--r--libsensors_iio/software/core/mpl/accel_auto_cal.h76
-rw-r--r--libsensors_iio/software/core/mpl/adv_func.h30
-rw-r--r--libsensors_iio/software/core/mpl/auto_calibration.h33
-rw-r--r--libsensors_iio/software/core/mpl/build/android/libmplmpu.sobin170544 -> 130934 bytes
-rw-r--r--libsensors_iio/software/core/mpl/build/android/shared.mk6
-rw-r--r--libsensors_iio/software/core/mpl/build/android/static.mk110
-rw-r--r--libsensors_iio/software/core/mpl/fast_no_motion.h14
-rw-r--r--libsensors_iio/software/core/mpl/fusion_9axis.h2
-rw-r--r--libsensors_iio/software/core/mpl/interpolator.h103
-rw-r--r--libsensors_iio/software/core/mpl/inv_log.h7
-rw-r--r--libsensors_iio/software/core/mpl/inv_math.h16
-rw-r--r--libsensors_iio/software/core/mpl/invensense_adv.h1
-rw-r--r--libsensors_iio/software/core/mpl/mlsetinterrupts.h23
-rw-r--r--libsensors_iio/software/core/mpl/mlsupervisor_9axis.h57
-rw-r--r--libsensors_iio/software/core/mpl/motion_no_motion.h54
-rw-r--r--libsensors_iio/software/core/mpl/orientation.h42
-rw-r--r--libsensors_iio/software/core/mpl/progressive_no_motion.h39
-rw-r--r--libsensors_iio/software/core/mpl/quat_accuracy_monitor.h141
-rw-r--r--libsensors_iio/software/core/mpl/quaternion_supervisor.h53
-rw-r--r--libsensors_iio/software/core/mpl/sensor_moments.h42
-rw-r--r--libsensors_iio/software/core/mpl/shake.h94
-rw-r--r--libsensors_iio/software/core/mpl/state_storage.h25
22 files changed, 691 insertions, 277 deletions
diff --git a/libsensors_iio/software/core/mpl/accel_auto_cal.h b/libsensors_iio/software/core/mpl/accel_auto_cal.h
index 6641a7f..5a53213 100644
--- a/libsensors_iio/software/core/mpl/accel_auto_cal.h
+++ b/libsensors_iio/software/core/mpl/accel_auto_cal.h
@@ -1,38 +1,38 @@
-/*
- $License:
- Copyright (C) 2011-2012 InvenSense Corporation, All Rights Reserved.
- See included License.txt for License information.
- $
- */
-
-/*******************************************************************************
- *
- * $Id$
- *
- ******************************************************************************/
-
-#ifndef MLDMP_ACCEL_AUTO_CALIBRATION_H__
-#define MLDMP_ACCEL_AUTO_CALIBRATION_H__
-
-#include "mltypes.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-inv_error_t inv_enable_in_use_auto_calibration(void);
-inv_error_t inv_disable_in_use_auto_calibration(void);
-inv_error_t inv_stop_in_use_auto_calibration(void);
-inv_error_t inv_start_in_use_auto_calibration(void);
-inv_error_t inv_in_use_auto_calibration_is_enabled(unsigned char *is_enabled);
-inv_error_t inv_init_in_use_auto_calibration(void);
-void inv_init_accel_maxmin(void);
-void inv_record_good_accel_maxmin(void);
-int inv_get_accel_bias_stage();
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // MLDMP_ACCEL_AUTO_CALIBRATION_H__
-
+/*
+ $License:
+ Copyright (C) 2011-2012 InvenSense Corporation, All Rights Reserved.
+ See included License.txt for License information.
+ $
+ */
+
+/*******************************************************************************
+ *
+ * $Id$
+ *
+ ******************************************************************************/
+
+#ifndef MLDMP_ACCEL_AUTO_CALIBRATION_H__
+#define MLDMP_ACCEL_AUTO_CALIBRATION_H__
+
+#include "mltypes.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+inv_error_t inv_enable_in_use_auto_calibration(void);
+inv_error_t inv_disable_in_use_auto_calibration(void);
+inv_error_t inv_stop_in_use_auto_calibration(void);
+inv_error_t inv_start_in_use_auto_calibration(void);
+inv_error_t inv_in_use_auto_calibration_is_enabled(unsigned char *is_enabled);
+inv_error_t inv_init_in_use_auto_calibration(void);
+void inv_init_accel_maxmin(void);
+void inv_record_good_accel_maxmin(void);
+int inv_get_accel_bias_stage();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // MLDMP_ACCEL_AUTO_CALIBRATION_H__
+
diff --git a/libsensors_iio/software/core/mpl/adv_func.h b/libsensors_iio/software/core/mpl/adv_func.h
new file mode 100644
index 0000000..3f8595f
--- /dev/null
+++ b/libsensors_iio/software/core/mpl/adv_func.h
@@ -0,0 +1,30 @@
+/*
+ $License:
+ Copyright (C) 2011-2012 InvenSense Corporation, All Rights Reserved.
+ See included License.txt for License information.
+ $
+ */
+
+/******************************************************************************
+ *
+ * $Id$
+ *
+ *****************************************************************************/
+
+#ifndef MLDMP_ADVFUNC_H__
+#define MLDMP_ADVFUNC_H__
+#include "mltypes.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ float inv_compass_angle(const long *compass, const long *grav, const float *quat);
+ inv_error_t inv_set_dmp_quaternion(long *q);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif // MLDMP_ADVFUNC_H__
diff --git a/libsensors_iio/software/core/mpl/auto_calibration.h b/libsensors_iio/software/core/mpl/auto_calibration.h
new file mode 100644
index 0000000..3dd9827
--- /dev/null
+++ b/libsensors_iio/software/core/mpl/auto_calibration.h
@@ -0,0 +1,33 @@
+/*
+ $License:
+ Copyright (C) 2011 InvenSense Corporation, All Rights Reserved.
+ $
+ */
+
+/******************************************************************************
+ *
+ * $Id$
+ *
+ *****************************************************************************/
+
+#ifndef MLDMP_IN_USE_AUTO_CALIBRATION_H__
+#define MLDMP_IN_USE_AUTO_CALIBRATION_H__
+
+#include "mltypes.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+inv_error_t inv_enable_in_use_auto_calibration(void);
+inv_error_t inv_disable_in_use_auto_calibration(void);
+inv_error_t inv_in_use_auto_calibration_is_enabled(unsigned char *is_enabled);
+inv_error_t inv_init_in_use_auto_calibration(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif // MLDMP_IN_USE_AUTO_CALIBRATION_H__
+
diff --git a/libsensors_iio/software/core/mpl/build/android/libmplmpu.so b/libsensors_iio/software/core/mpl/build/android/libmplmpu.so
index 5e74a60..116b618 100644
--- a/libsensors_iio/software/core/mpl/build/android/libmplmpu.so
+++ b/libsensors_iio/software/core/mpl/build/android/libmplmpu.so
Binary files differ
diff --git a/libsensors_iio/software/core/mpl/build/android/shared.mk b/libsensors_iio/software/core/mpl/build/android/shared.mk
index 2e15205..79cf9c1 100644
--- a/libsensors_iio/software/core/mpl/build/android/shared.mk
+++ b/libsensors_iio/software/core/mpl/build/android/shared.mk
@@ -16,7 +16,6 @@ MPL_DIR = $(INV_ROOT)/software/core/mpl
include $(INV_ROOT)/software/build/android/common.mk
CFLAGS += $(CMDLINE_CFLAGS)
-CFLAGS += $(ANDROID_COMPILE)
CFLAGS += -Wall
CFLAGS += -fpic
CFLAGS += -nostdlib
@@ -44,6 +43,11 @@ LLINK += -ldl
LFLAGS += $(CMDLINE_LFLAGS)
LFLAGS += -shared
LFLAGS += -Wl,-soname,$(LIBRARY)
+LFLAGS += -nostdlib
+LFLAGS += -fpic
+LFLAGS += -Wl,-T,$(ANDROID_ROOT)/build/core/armelf.xsc
+LFLAGS += -Wl,--gc-sections
+LFLAGS += -Wl,--no-whole-archive
LFLAGS += -Wl,-shared,-Bsymbolic
LFLAGS += $(ANDROID_LINK)
LFLAGS += -Wl,-rpath,$(ANDROID_ROOT)/out/target/product/$(PRODUCT)/obj/lib:$(ANDROID_ROOT)/out/target/product/$(PRODUCT)/system/lib
diff --git a/libsensors_iio/software/core/mpl/build/android/static.mk b/libsensors_iio/software/core/mpl/build/android/static.mk
new file mode 100644
index 0000000..6ad45de
--- /dev/null
+++ b/libsensors_iio/software/core/mpl/build/android/static.mk
@@ -0,0 +1,110 @@
+MLLITE_LIB_NAME = mllite
+LIBRARY = $(LIB_PREFIX)$(MLLITE_LIB_NAME).$(STATIC_LIB_EXT)
+
+MK_NAME = $(notdir $(CURDIR)/$(firstword $(MAKEFILE_LIST)))
+
+OBJFOLDER = $(CURDIR)/obj
+
+CROSS = arm-none-linux-gnueabi-
+COMP= $(CROSS)gcc
+LINK= $(CROSS)ar cr
+
+MLLITE_DIR = $(MLSDK_ROOT)/mllite
+MPL_DIR = $(MLSDK_ROOT)/mldmp
+MLPLATFORM_DIR = $(MLSDK_ROOT)/platform
+
+include $(MLSDK_ROOT)/Android-common.mk
+
+CFLAGS += $(CMDLINE_CFLAGS)
+CFLAGS += -Wall -fpic
+CFLAGS += -mthumb-interwork -fno-exceptions -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -fmessage-length=0
+CFLAGS += -DNDEBUG
+CFLAGS += -D_REENTRANT -DLINUX -DANDROID
+CFLAGS += -I$(MLLITE_DIR)
+CFLAGS += -I$(MLPLATFORM_DIR)/include
+CFLAGS += -I$(MLSDK_ROOT)/mlutils
+CFLAGS += -I$(MLSDK_ROOT)/mlapps/common
+CFLAGS += $(MLSDK_INCLUDES)
+CFLAGS += $(MLSDK_DEFINES)
+
+VPATH += $(MLLITE_DIR)
+VPATH += $(MLSDK_ROOT)/mlutils
+VPATH += $(MLLITE_DIR)/accel
+VPATH += $(MLLITE_DIR)/compass
+VPATH += $(MLLITE_DIR)/pressure
+VPATH += $(MLLITE_DIR)/mlapps/common
+
+####################################################################################################
+## sources
+
+ML_LIBS = $(MLPLATFORM_DIR)/linux/$(LIB_PREFIX)$(MLPLATFORM_LIB_NAME).$(STATIC_LIB_EXT)
+
+ML_SOURCES += $(MLLITE_DIR)/mldl_cfg_mpu.c
+ML_SOURCES += $(MLLITE_DIR)/mldl_cfg_init_linux.c
+ML_SOURCES += $(MLLITE_DIR)/accel.c
+ML_SOURCES += $(MLLITE_DIR)/compass.c
+ML_SOURCES += $(MLLITE_DIR)/compass_supervisor.c
+ML_SOURCES += $(MLLITE_DIR)/compass_supervisor_adv_callbacks.c
+ML_SOURCES += $(MLLITE_DIR)/key0_96.c
+ML_SOURCES += $(MLLITE_DIR)/pressure.c
+ML_SOURCES += $(MLLITE_DIR)/ml.c
+ML_SOURCES += $(MLLITE_DIR)/ml_invobj.c
+ML_SOURCES += $(MLLITE_DIR)/ml_init.c
+ML_SOURCES += $(MLLITE_DIR)/mlarray_lite.c
+ML_SOURCES += $(MLLITE_DIR)/mlarray_adv.c
+ML_SOURCES += $(MLLITE_DIR)/mlarray_legacy.c
+ML_SOURCES += $(MLLITE_DIR)/mlBiasNoMotion.c
+ML_SOURCES += $(MLLITE_DIR)/mlFIFO.c
+ML_SOURCES += $(MLLITE_DIR)/mlFIFOHW.c
+ML_SOURCES += $(MLLITE_DIR)/mlMathFunc.c
+ML_SOURCES += $(MLLITE_DIR)/mlcontrol.c
+ML_SOURCES += $(MLLITE_DIR)/mldl.c
+ML_SOURCES += $(MLLITE_DIR)/mldmp.c
+ML_SOURCES += $(MLLITE_DIR)/dmpDefault.c
+ML_SOURCES += $(MLLITE_DIR)/mlstates.c
+ML_SOURCES += $(MLLITE_DIR)/mlsupervisor.c
+ML_SOURCES += $(MLLITE_DIR)/ml_stored_data.c
+ML_SOURCES += $(MLLITE_DIR)/ustore_manager.c
+ML_SOURCES += $(MLLITE_DIR)/ustore_mlsl_io.c
+ML_SOURCES += $(MLLITE_DIR)/ustore_adv_fusion_delegate.c
+ML_SOURCES += $(MLLITE_DIR)/ustore_lite_fusion_delegate.c
+ML_SOURCES += $(MLLITE_DIR)/temp_comp_legacy.c
+ML_SOURCES += $(MLLITE_DIR)/mlSetGyroBias.c
+ML_SOURCES += $(MLSDK_ROOT)/mlutils/checksum.c
+ML_SOURCES += $(MLSDK_ROOT)/mlutils/mputest.c
+ML_SOURCES += $(MLLITE_DIR)/mldl_print_cfg.c
+ifeq ($(MPU_NAME),MPU3050)
+ML_SOURCES += $(MLSDK_ROOT)/mlutils/mpu3050test.c
+else
+ML_SOURCES += $(MLSDK_ROOT)/mlutils/mpu6050test.c
+endif
+
+ML_OBJS := $(addsuffix .o,$(ML_SOURCES))
+ML_OBJS_DST = $(addprefix $(OBJFOLDER)/,$(addsuffix .o, $(notdir $(ML_SOURCES))))
+
+####################################################################################################
+## rules
+
+.PHONY: all clean cleanall
+
+all: $(LIBRARY) $(MK_NAME)
+
+$(LIBRARY) : $(OBJFOLDER) $(ML_OBJS_DST) $(ML_LIBS) $(MK_NAME)
+ @$(call echo_in_colors, "\n<linking $(LIBRARY) with objects $(ML_OBJS_DST)\n")
+ $(LINK) $(LIBRARY) $(ML_OBJS_DST)
+ $(CROSS)ranlib $(LIBRARY)
+
+$(OBJFOLDER) :
+ @$(call echo_in_colors, "\n<creating object's folder 'obj/'>\n")
+ mkdir obj
+
+$(ML_OBJS_DST) : $(OBJFOLDER)/%.c.o : %.c $(MK_NAME)
+ @$(call echo_in_colors, "\n<compile $< to $(OBJFOLDER)/$(notdir $@)>\n")
+ $(COMP) $(CFLAGS) $(ANDROID_INCLUDES) $(KERNEL_INCLUDES) $(MLSDK_INCLUDES) -o $@ -c $<
+
+clean :
+ rm -fR $(OBJFOLDER)
+
+cleanall :
+ rm -fR $(LIBRARY) $(OBJFOLDER)
+
diff --git a/libsensors_iio/software/core/mpl/fast_no_motion.h b/libsensors_iio/software/core/mpl/fast_no_motion.h
index 24bc0d5..2a33093 100644
--- a/libsensors_iio/software/core/mpl/fast_no_motion.h
+++ b/libsensors_iio/software/core/mpl/fast_no_motion.h
@@ -28,14 +28,12 @@ extern "C" {
void inv_set_default_number_of_samples(int N);
inv_error_t inv_fast_nomot_is_enabled(unsigned char *is_enabled);
inv_error_t inv_update_fast_nomot(long *gyro);
-
- void inv_get_fast_nomot_accel_param(long *cntr, long long *param);
- void inv_get_fast_nomot_compass_param(long *cntr, long long *param);
- void inv_set_fast_nomot_accel_threshold(long long thresh);
- void inv_set_fast_nomot_compass_threshold(long long thresh);
- void int_set_fast_nomot_gyro_threshold(long long thresh);
-
- void inv_fnm_debug_print(void);
+
+ void inv_get_fast_nomot_accel_param(long *cntr, float *param);
+ void inv_get_fast_nomot_compass_param(long *cntr, float *param);
+ void inv_set_fast_nomot_accel_threshold(float thresh);
+ void inv_set_fast_nomot_compass_threshold(float thresh);
+ void int_set_fast_nomot_gyro_threshold(float thresh);
#ifdef __cplusplus
}
diff --git a/libsensors_iio/software/core/mpl/fusion_9axis.h b/libsensors_iio/software/core/mpl/fusion_9axis.h
index 1ba1ebb..616694a 100644
--- a/libsensors_iio/software/core/mpl/fusion_9axis.h
+++ b/libsensors_iio/software/core/mpl/fusion_9axis.h
@@ -26,8 +26,6 @@ extern "C" {
inv_error_t inv_disable_9x_sensor_fusion(void);
inv_error_t inv_start_9x_sensor_fusion(void);
inv_error_t inv_stop_9x_sensor_fusion(void);
- inv_error_t inv_9x_fusion_set_mag_fb(double fb);
- inv_error_t inv_9x_fusion_enable_jitter_reduction(int en);
#ifdef __cplusplus
}
diff --git a/libsensors_iio/software/core/mpl/interpolator.h b/libsensors_iio/software/core/mpl/interpolator.h
new file mode 100644
index 0000000..5eb571d
--- /dev/null
+++ b/libsensors_iio/software/core/mpl/interpolator.h
@@ -0,0 +1,103 @@
+/*
+ $License:
+ Copyright (C) 2011 InvenSense Corporation, All Rights Reserved.
+ $
+ */
+#ifndef INTERPOLATOR_H
+#define INTERPOLATOR_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//#include "mltypes.h"
+
+ /* ------------ */
+ /* - Defines. - */
+ /* ------------ */
+
+#define MAX_INTERPOLATION (20)
+
+typedef struct {
+ long x[2];
+ long y[4];
+} tInterpolate2;
+typedef struct {
+ long x[2];
+ long y[6];
+} tInterpolate3;
+typedef struct {
+ long x[5];
+ long y[10];
+ int idx1;
+} tInterpolate5;
+typedef struct {
+ tInterpolate2 state1;
+ tInterpolate2 state2;
+} tInterpolate4;
+typedef struct {
+ tInterpolate3 state1;
+ tInterpolate2 state2;
+} tInterpolate6;
+typedef struct {
+ tInterpolate2 state1;
+ tInterpolate4 state2;
+} tInterpolate8;
+typedef struct {
+ tInterpolate3 state1;
+ tInterpolate3 state2;
+} tInterpolate9;
+typedef struct {
+ tInterpolate5 state1;
+ tInterpolate2 state2;
+} tInterpolate10;
+typedef struct {
+ tInterpolate4 state1;
+ tInterpolate3 state2;
+} tInterpolate12;
+typedef struct {
+ tInterpolate5 state1;
+ tInterpolate3 state2;
+} tInterpolate15;
+typedef struct {
+ tInterpolate2 state1;
+ tInterpolate8 state2;
+} tInterpolate16;
+typedef struct {
+ tInterpolate9 state1;
+ tInterpolate2 state2;
+} tInterpolate18;
+typedef struct {
+ tInterpolate10 state1;
+ tInterpolate2 state2;
+} tInterpolate20;
+
+typedef union {
+ tInterpolate2 u2;
+ tInterpolate3 u3;
+ tInterpolate4 u4;
+ tInterpolate5 u5;
+ tInterpolate6 u6;
+ tInterpolate8 u8;
+ tInterpolate9 u9;
+ tInterpolate10 u10;
+ tInterpolate12 u12;
+ tInterpolate15 u15;
+ tInterpolate16 u16;
+ tInterpolate18 u18;
+ tInterpolate20 u20;
+} tInterpolateState;
+
+ /* --------------------- */
+ /* - Function p-types. - */
+ /* --------------------- */
+int inv_get_interp_amount( int x );
+int inv_interpolate( int amount, long input, long *output, tInterpolateState *state );
+long inv_fxmult( long x, long y );
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* INTERPOLATOR_H */
diff --git a/libsensors_iio/software/core/mpl/inv_log.h b/libsensors_iio/software/core/mpl/inv_log.h
new file mode 100644
index 0000000..972844b
--- /dev/null
+++ b/libsensors_iio/software/core/mpl/inv_log.h
@@ -0,0 +1,7 @@
+#include "mltypes.h"
+#ifndef INV_INV_LOG_H__
+#define INV_INV_LOG_H__
+
+#define INV_LOGE(s)
+
+#endif // INV_INV_LOG_H__
diff --git a/libsensors_iio/software/core/mpl/inv_math.h b/libsensors_iio/software/core/mpl/inv_math.h
index 175511a..6620bbf 100644
--- a/libsensors_iio/software/core/mpl/inv_math.h
+++ b/libsensors_iio/software/core/mpl/inv_math.h
@@ -1,8 +1,8 @@
-/* math.h has many functions and defines that are not consistent across
-* platforms. This address that */
-
-#ifdef _WINDOWS
-#define _USE_MATH_DEFINES
-#endif
-
-#include <math.h>
+/* math.h has many functions and defines that are not consistent across
+* platforms. This address that */
+
+#ifdef _WINDOWS
+#define _USE_MATH_DEFINES
+#endif
+
+#include <math.h>
diff --git a/libsensors_iio/software/core/mpl/invensense_adv.h b/libsensors_iio/software/core/mpl/invensense_adv.h
index 12932c9..9e59c18 100644
--- a/libsensors_iio/software/core/mpl/invensense_adv.h
+++ b/libsensors_iio/software/core/mpl/invensense_adv.h
@@ -28,4 +28,3 @@
#include "quaternion_supervisor.h"
#include "mag_disturb.h"
#include "quat_accuracy_monitor.h"
-#include "shake.h"
diff --git a/libsensors_iio/software/core/mpl/mlsetinterrupts.h b/libsensors_iio/software/core/mpl/mlsetinterrupts.h
new file mode 100644
index 0000000..a81dabb
--- /dev/null
+++ b/libsensors_iio/software/core/mpl/mlsetinterrupts.h
@@ -0,0 +1,23 @@
+/*
+ $License:
+ Copyright (c) 2008 InvenSense Corporation, All Rights Reserved.
+ $
+ */
+
+#ifndef MLSETINTERRUPT_H
+#define MLSETINTERRUPT_H
+
+#include "mltypes.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* DEPRECATED - Scheduled for removal. Do not use */
+ inv_error_t MLSetInterrupts(unsigned short interrupts);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* MLSETINTERRUPT_H */
diff --git a/libsensors_iio/software/core/mpl/mlsupervisor_9axis.h b/libsensors_iio/software/core/mpl/mlsupervisor_9axis.h
new file mode 100644
index 0000000..3779381
--- /dev/null
+++ b/libsensors_iio/software/core/mpl/mlsupervisor_9axis.h
@@ -0,0 +1,57 @@
+/*
+ $License:
+ Copyright (C) 2011 InvenSense Corporation, All Rights Reserved.
+ $
+ */
+
+/******************************************************************************
+ *
+ * $Id: mlsupervisor_9axis.h 6123 2011-09-30 18:21:11Z mcaramello $
+ *
+ *****************************************************************************/
+
+#ifndef MLDMP_MLSUPERVISOR_H__
+#define MLDMP_MLSUPERVISOR_H__
+
+#include "mltypes.h"
+
+//#include "temp_comp.h"
+
+struct inv_fusion_t {
+ int compassCount;
+ long quat[4];
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+inv_error_t inv_enable_9x_fusion(void);
+inv_error_t inv_disable_9x_fusion(void);
+
+inv_error_t inv_enable_9x_fusion_legacy(void);
+inv_error_t inv_disable_9x_fusion_legacy(void);
+
+inv_error_t inv_enable_9x_fusion_new(void);
+inv_error_t inv_disable_9x_fusion_new(void);
+
+inv_error_t inv_enable_9x_fusion_basic(void);
+inv_error_t inv_disable_9x_fusion_basic(void);
+
+inv_error_t inv_enable_9x_fusion_external(void);
+inv_error_t inv_disable_9x_fusion_external(void);
+
+inv_error_t inv_enable_maintain_heading(void);
+inv_error_t inv_disable_maintain_heading(void);
+
+void inv_set_compass_state(long compassState, long accState,
+ unsigned long deltaTime,
+ int magDisturb, int gotBias,
+ int *new_state,
+ int *new_accuracy);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // MLDMP_MLSUPERVISOR_H__
diff --git a/libsensors_iio/software/core/mpl/motion_no_motion.h b/libsensors_iio/software/core/mpl/motion_no_motion.h
index 188c78b..01cf1c0 100644
--- a/libsensors_iio/software/core/mpl/motion_no_motion.h
+++ b/libsensors_iio/software/core/mpl/motion_no_motion.h
@@ -1,28 +1,28 @@
-/*
- $License:
- Copyright (C) 2011-2012 InvenSense Corporation, All Rights Reserved.
- See included License.txt for License information.
- $
+/*
+ $License:
+ Copyright (C) 2011-2012 InvenSense Corporation, All Rights Reserved.
+ See included License.txt for License information.
+ $
*/
-#ifndef INV_MOTION_NO_MOTION_H__
-#define INV_MOTION_NO_MOTION_H__
-
-#include "mltypes.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-inv_error_t inv_enable_motion_no_motion(void);
-inv_error_t inv_disable_motion_no_motion(void);
-inv_error_t inv_init_motion_no_motion(void);
-inv_error_t inv_start_motion_no_motion(void);
-inv_error_t inv_stop_motion_no_motion(void);
-
-inv_error_t inv_set_no_motion_time(long time_ms);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // INV_MOTION_NO_MOTION_H__
+#ifndef INV_MOTION_NO_MOTION_H__
+#define INV_MOTION_NO_MOTION_H__
+
+#include "mltypes.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+inv_error_t inv_enable_motion_no_motion(void);
+inv_error_t inv_disable_motion_no_motion(void);
+inv_error_t inv_init_motion_no_motion(void);
+inv_error_t inv_start_motion_no_motion(void);
+inv_error_t inv_stop_motion_no_motion(void);
+
+inv_error_t inv_set_no_motion_time(long time_ms);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // INV_MOTION_NO_MOTION_H__
diff --git a/libsensors_iio/software/core/mpl/orientation.h b/libsensors_iio/software/core/mpl/orientation.h
new file mode 100644
index 0000000..ab4e45e
--- /dev/null
+++ b/libsensors_iio/software/core/mpl/orientation.h
@@ -0,0 +1,42 @@
+/*
+ $License:
+ Copyright (C) 2011 InvenSense Corporation, All Rights Reserved.
+ $
+ */
+#ifndef MLDMP_ORIENTATION_H__
+#define MLDMP_ORIENTATION_H__
+
+#include "mltypes.h"
+/*******************************************************************************/
+/* Orientations */
+/*******************************************************************************/
+
+#define INV_X_UP 0x01
+#define INV_X_DOWN 0x02
+#define INV_Y_UP 0x04
+#define INV_Y_DOWN 0x08
+#define INV_Z_UP 0x10
+#define INV_Z_DOWN 0x20
+#define INV_ORIENTATION_ALL 0x3F
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ inv_error_t inv_enable_orientation(void);
+ inv_error_t inv_disable_orientation(void);
+ inv_error_t inv_set_orientation(int orientation);
+ inv_error_t inv_set_orientation_cb(void (*callback)(unsigned short));
+ inv_error_t inv_get_orientation(int *orientation);
+ inv_error_t inv_get_orientation_state(int * state);
+ inv_error_t inv_set_orientation_interrupt(unsigned char on);
+ inv_error_t inv_set_orientation_thresh(float angle,
+ float hysteresis,
+ unsigned long time,
+ unsigned int axis);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // MLDMP_ORIENTATION_H__
diff --git a/libsensors_iio/software/core/mpl/progressive_no_motion.h b/libsensors_iio/software/core/mpl/progressive_no_motion.h
new file mode 100644
index 0000000..99333e3
--- /dev/null
+++ b/libsensors_iio/software/core/mpl/progressive_no_motion.h
@@ -0,0 +1,39 @@
+/*
+ $License:
+ Copyright (C) 2011 InvenSense Corporation, All Rights Reserved.
+ $
+ */
+
+/******************************************************************************
+ *
+ * $Id:$
+ *
+ *****************************************************************************/
+
+#ifndef MLDMP_PROG_NO_MOTION_H__
+#define MLDMP_PROG_NO_MOTION_H__
+
+#include "mltypes.h"
+
+#define PROG_NO_MOTION 1
+#define PROG_MOTION 2
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* APIs */
+inv_error_t inv_enable_prog_no_motion(void);
+inv_error_t inv_disable_prog_no_motion(void);
+
+/* internal use */
+int inv_get_prog_no_motion_enabled(void);
+void inv_get_prog_no_motion_bias_changed(void);
+int inv_get_prog_no_motion_state(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif // MLDMP_PROG_NO_MOTION_H__
diff --git a/libsensors_iio/software/core/mpl/quat_accuracy_monitor.h b/libsensors_iio/software/core/mpl/quat_accuracy_monitor.h
index 5ee0573..2cf7a50 100644
--- a/libsensors_iio/software/core/mpl/quat_accuracy_monitor.h
+++ b/libsensors_iio/software/core/mpl/quat_accuracy_monitor.h
@@ -1,71 +1,70 @@
-/*
- quat_accuracy_monitor.h
- $License:
- Copyright (C) 2011-2012 InvenSense Corporation, All Rights Reserved.
- See included License.txt for License information.
- $
- */
-
-/*******************************************************************************
- *
- * $Id:$
- *
- ******************************************************************************/
-
-#ifndef QUAT_ACCURARCY_MONITOR_H__
-#define QUAT_ACCURARCY_MONITOR_H__
-
-#include "mltypes.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-enum accuracy_signal_type_e {
- TYPE_NAV_QUAT,
- TYPE_GAM_QUAT,
- TYPE_NAV_QUAT_ADVANCED,
- TYPE_GAM_QUAT_ADVANCED,
- TYPE_NAV_QUAT_BASIC,
- TYPE_GAM_QUAT_BASIC,
- TYPE_MAG,
- TYPE_GYRO,
- TYPE_ACCEL,
-};
-
-inv_error_t inv_init_quat_accuracy_monitor(void);
-
-void set_accuracy_threshold(enum accuracy_signal_type_e type, double threshold);
-double get_accuracy_threshold(enum accuracy_signal_type_e type);
-void set_accuracy_weight(enum accuracy_signal_type_e type, int weight);
-int get_accuracy_weight(enum accuracy_signal_type_e type);
-
-int8_t get_accuracy_accuracy(enum accuracy_signal_type_e type);
-
-void inv_reset_quat_accuracy(void);
-double get_6axis_correction_term(void);
-double get_9axis_correction_term(void);
-int get_9axis_accuracy_state();
-
-void set_6axis_error_average(double value);
-double get_6axis_error_bound(void);
-double get_compass_correction(void);
-double get_9axis_error_bound(void);
-
-float get_confidence_interval(void);
-void set_compass_uncertainty(float value);
-
-inv_error_t inv_enable_quat_accuracy_monitor(void);
-inv_error_t inv_disable_quat_accuracy_monitor(void);
-inv_error_t inv_start_quat_accuracy_monitor(void);
-inv_error_t inv_stop_quat_accuracy_monitor(void);
-
-double get_compassNgravity(void);
-double get_init_compassNgravity(void);
-
-float inv_heading_accuracy_check(float orient[3], float *heading, int8_t *accuracy);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // QUAT_ACCURARCY_MONITOR_H__
+/*
+ quat_accuracy_monitor.h
+ $License:
+ Copyright (C) 2011-2012 InvenSense Corporation, All Rights Reserved.
+ See included License.txt for License information.
+ $
+ */
+
+/*******************************************************************************
+ *
+ * $Id:$
+ *
+ ******************************************************************************/
+
+#ifndef QUAT_ACCURARCY_MONITOR_H__
+#define QUAT_ACCURARCY_MONITOR_H__
+
+#include "mltypes.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+enum accuracy_signal_type_e {
+ TYPE_NAV_QUAT,
+ TYPE_GAM_QUAT,
+ TYPE_NAV_QUAT_ADVANCED,
+ TYPE_GAM_QUAT_ADVANCED,
+ TYPE_NAV_QUAT_BASIC,
+ TYPE_GAM_QUAT_BASIC,
+ TYPE_MAG,
+ TYPE_GYRO,
+ TYPE_ACCEL,
+};
+
+inv_error_t inv_init_quat_accuracy_monitor(void);
+
+void set_accuracy_threshold(enum accuracy_signal_type_e type, double threshold);
+double get_accuracy_threshold(enum accuracy_signal_type_e type);
+void set_accuracy_weight(enum accuracy_signal_type_e type, int weight);
+int get_accuracy_weight(enum accuracy_signal_type_e type);
+
+int8_t get_accuracy_accuracy(enum accuracy_signal_type_e type);
+
+void inv_reset_quat_accuracy(void);
+double get_6axis_correction_term(void);
+double get_9axis_correction_term(void);
+int get_9axis_accuracy_state();
+
+void set_6axis_error_average(double value);
+double get_6axis_error_bound(void);
+double get_compass_correction(void);
+double get_9axis_error_bound(void);
+
+float get_confidence_interval(void);
+void set_compass_uncertainty(float value);
+
+inv_error_t inv_enable_quat_accuracy_monitor(void);
+inv_error_t inv_disable_quat_accuracy_monitor(void);
+inv_error_t inv_start_quat_accuracy_monitor(void);
+inv_error_t inv_stop_quat_accuracy_monitor(void);
+
+double get_compassNgravity(void);
+double get_init_compassNgravity(void);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // QUAT_ACCURARCY_MONITOR_H__
diff --git a/libsensors_iio/software/core/mpl/quaternion_supervisor.h b/libsensors_iio/software/core/mpl/quaternion_supervisor.h
index 722c0d9..532e8af 100644
--- a/libsensors_iio/software/core/mpl/quaternion_supervisor.h
+++ b/libsensors_iio/software/core/mpl/quaternion_supervisor.h
@@ -1,27 +1,26 @@
-/*
- $License:
- Copyright (C) 2011-2012 InvenSense Corporation, All Rights Reserved.
- See included License.txt for License information.
- $
- */
-#ifndef INV_QUATERNION_SUPERVISOR_H__
-#define INV_QUATERNION_SUPERVISOR_H__
-
-#include "mltypes.h"
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-inv_error_t inv_enable_quaternion(void);
-inv_error_t inv_disable_quaternion(void);
-inv_error_t inv_init_quaternion(void);
-inv_error_t inv_start_quaternion(void);
-void inv_set_quaternion(long *quat);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // INV_QUATERNION_SUPERVISOR_H__
+/*
+ $License:
+ Copyright (C) 2011-2012 InvenSense Corporation, All Rights Reserved.
+ See included License.txt for License information.
+ $
+ */
+#ifndef INV_QUATERNION_SUPERVISOR_H__
+#define INV_QUATERNION_SUPERVISOR_H__
+
+#include "mltypes.h"
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+inv_error_t inv_enable_quaternion(void);
+inv_error_t inv_disable_quaternion(void);
+inv_error_t inv_init_quaternion(void);
+inv_error_t inv_start_quaternion(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // INV_QUATERNION_SUPERVISOR_H__
diff --git a/libsensors_iio/software/core/mpl/sensor_moments.h b/libsensors_iio/software/core/mpl/sensor_moments.h
new file mode 100644
index 0000000..73eb363
--- /dev/null
+++ b/libsensors_iio/software/core/mpl/sensor_moments.h
@@ -0,0 +1,42 @@
+/*
+ $License:
+ Copyright (C) 2011-2012 InvenSense Corporation, All Rights Reserved.
+ See included License.txt for License information.
+ $
+ */
+
+/******************************************************************************
+ *
+ * $Id$
+ *
+ *****************************************************************************/
+
+#ifndef MLDMP_SENSOR_MOMENTS_H__
+#define MLDMP_SENSOR_MOMENTS_H__
+
+#include "mltypes.h"
+
+enum moment_ord {
+ SECOND_ORD=0,
+ THIRD_ORD,
+ FOURTH_ORD,
+ MAX_ORD
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ inv_error_t inv_enable_sm(void);
+ inv_error_t inv_disable_sm(void);
+ inv_error_t inv_sm_record_data(float sample, void *sensor);
+ inv_error_t inv_sm_update_evt_act_state(int motion);
+ void *inv_init_sm(enum moment_ord);
+ float inv_sm_get_filtered_data(void *sensor);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // MLDMP_SENSOR_MOMENTS_H__
+
diff --git a/libsensors_iio/software/core/mpl/shake.h b/libsensors_iio/software/core/mpl/shake.h
deleted file mode 100644
index 8775a4c..0000000
--- a/libsensors_iio/software/core/mpl/shake.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- $License:
- Copyright (C) 2011-2012 InvenSense Corporation, All Rights Reserved.
- See included License.txt for License information.
- $
- */
-#ifndef INV_SHAKE_H__
-#define INV_SHAKE_H__
-
-#include "mltypes.h"
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
- /* ------------ */
- /* - Defines. - */
- /* ------------ */
-
- #define STATE_ZERO 0
- #define STATE_INIT_1 1
- #define STATE_INIT_2 2
- #define STATE_DETECT 3
-
- struct t_shake_config_params {
- long shake_time_min_ms;
- long shake_time_max_ms;
- long shake_time_min;
- long shake_time_max;
- unsigned char shake_time_set;
- long shake_time_saved;
- float shake_deriv_thr;
- int zero_cross_thr;
- float accel_delta_min;
- float accel_delta_max;
- unsigned char interp_enable;
- };
-
- struct t_shake_state_params {
- unsigned char state;
- float accel_peak_high;
- float accel_peak_low;
- float accel_range;
- int num_zero_cross;
- short curr_shake_time;
- int deriv_major_change;
- int deriv_major_sign;
- float accel_buffer[200];
- float delta_buffer[200];
- };
-
- struct t_shake_data_params {
- float accel_prev;
- float accel_curr;
- float delta_prev;
- float delta_curr;
- float delta_prev_buffer;
- };
-
- struct t_shake_results {
- //unsigned char shake_int;
- int shake_number;
- };
-
- struct t_shake_cb {
- void (*shake_callback)(struct t_shake_results *shake_results);
- };
-
-
- /* --------------------- */
- /* - Function p-types. - */
- /* --------------------- */
- inv_error_t inv_enable_shake(void);
- inv_error_t inv_disable_shake(void);
- inv_error_t inv_init_shake(void);
- inv_error_t inv_start_shake(void);
- int inv_set_shake_cb(void (*callback)(struct t_shake_results *shake_results));
- void inv_config_shake_time_params(long sample_time_ms);
- void inv_set_shake_accel_delta_min(float accel_g);
- void inv_set_shake_accel_delta_max(float accel_g);
- void inv_set_shake_zero_cross_thresh(int num_zero_cross);
- void inv_set_shake_deriv_thresh(float shake_deriv_thresh);
- void inv_set_shake_time_min_ms(long time_ms);
- void inv_set_shake_time_max_ms(long time_ms);
- void inv_enable_shake_data_interpolation(unsigned char en);
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // INV_SHAKE__ \ No newline at end of file
diff --git a/libsensors_iio/software/core/mpl/state_storage.h b/libsensors_iio/software/core/mpl/state_storage.h
new file mode 100644
index 0000000..c1eb47b
--- /dev/null
+++ b/libsensors_iio/software/core/mpl/state_storage.h
@@ -0,0 +1,25 @@
+/*
+ $License:
+ Copyright (C) 2011-2012 InvenSense Corporation, All Rights Reserved.
+ See included License.txt for License information.
+ $
+ */
+#ifndef INV_STATE_STORAGE_H__
+#define INV_STATE_STORAGE_H__
+
+#include "mltypes.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+inv_error_t inv_store_data(const void *data, size_t size, unsigned long module,
+ unsigned long version);
+inv_error_t inv_load_data(void *data, size_t size, unsigned long module,
+ unsigned long version);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // INV_STATE_STORAGE_H__