summaryrefslogtreecommitdiffstats
path: root/invensense/mlsdk/mllite
diff options
context:
space:
mode:
Diffstat (limited to 'invensense/mlsdk/mllite')
-rw-r--r--invensense/mlsdk/mllite/compass.c41
-rw-r--r--invensense/mlsdk/mllite/dmpKey.h34
-rw-r--r--invensense/mlsdk/mllite/ml.c105
-rw-r--r--invensense/mlsdk/mllite/ml.h7
-rw-r--r--invensense/mlsdk/mllite/mlBiasNoMotion.c86
-rw-r--r--invensense/mlsdk/mllite/mlFIFO.c141
-rw-r--r--invensense/mlsdk/mllite/mlFIFOHW.c10
-rw-r--r--invensense/mlsdk/mllite/ml_mputest.c4
-rw-r--r--invensense/mlsdk/mllite/mldl.c43
-rw-r--r--invensense/mlsdk/mllite/mldl_cfg.h14
-rw-r--r--invensense/mlsdk/mllite/mldl_cfg_mpu.c3
-rw-r--r--invensense/mlsdk/mllite/mlsupervisor.c10
12 files changed, 9 insertions, 489 deletions
diff --git a/invensense/mlsdk/mllite/compass.c b/invensense/mlsdk/mllite/compass.c
index dcae0cd..c008fbf 100644
--- a/invensense/mlsdk/mllite/compass.c
+++ b/invensense/mlsdk/mllite/compass.c
@@ -304,48 +304,7 @@ inv_error_t inv_get_compass_data(long *data)
inv_obj.compass_overunder = (int)tmp[6];
} else {
-#if defined CONFIG_MPU_SENSORS_MPU6050A2 || \
- defined CONFIG_MPU_SENSORS_MPU6050B1
- result = inv_get_external_sensor_data(data, 3);
- if (result) {
- LOG_RESULT_LOCATION(result);
- return result;
- }
-#if defined CONFIG_MPU_SENSORS_MPU6050A2
- {
- static unsigned char first = TRUE;
- // one-off write to AKM
- if (first) {
- unsigned char regs[] = {
- // beginning Mantis register for one-off slave R/W
- MPUREG_I2C_SLV4_ADDR,
- // the slave to write to
- mldl_cfg->pdata->compass.address,
- // the register to write to
- /*mldl_cfg->compass->trigger->reg */ 0x0A,
- // the value to write
- /*mldl_cfg->compass->trigger->value */ 0x01,
- // enable the write
- 0xC0
- };
- result =
- inv_serial_write(inv_get_serial_handle(), mldl_cfg->addr,
- ARRAY_SIZE(regs), regs);
- first = FALSE;
- } else {
- unsigned char regs[] = {
- MPUREG_I2C_SLV4_CTRL,
- 0xC0
- };
- result =
- inv_serial_write(inv_get_serial_handle(), mldl_cfg->addr,
- ARRAY_SIZE(regs), regs);
- }
- }
-#endif
-#else
return INV_ERROR_INVALID_CONFIGURATION;
-#endif // CONFIG_MPU_SENSORS_xxxx
}
data[0] = inv_q30_mult(data[0], inv_obj.compass_asa[0]);
data[1] = inv_q30_mult(data[1], inv_obj.compass_asa[1]);
diff --git a/invensense/mlsdk/mllite/dmpKey.h b/invensense/mlsdk/mllite/dmpKey.h
index 0c5ab0a..3e2e667 100644
--- a/invensense/mlsdk/mllite/dmpKey.h
+++ b/invensense/mlsdk/mllite/dmpKey.h
@@ -372,7 +372,6 @@
#define DINC7A 0x7a
#define DINC7B 0x7b
-#if defined CONFIG_MPU_SENSORS_MPU3050
#define DINA80 0x80
#define DINA90 0x90
#define DINAA0 0xa0
@@ -394,39 +393,6 @@
#define DINAC3 0xc3
#define DINAC4 0xc4
#define DINAC5 0xc5
-#elif defined CONFIG_MPU_SENSORS_MPU6050A2 || \
- defined CONFIG_MPU_SENSORS_MPU6050B1
-
-#define DINA80 0x80
-#define DINA90 0x90
-#define DINAA0 0xa0
-#define DINAC9 0xc9
-#define DINACB 0xcb
-#define DINACD 0xcd
-#define DINACF 0xcf
-#define DINAC8 0xc8
-#define DINACA 0xca
-#define DINACC 0xcc
-#define DINACE 0xce
-#define DINAD8 0xd8
-#define DINADD 0xdd
-#define DINAF8 0xf0
-#define DINAFE 0xfe
-
-#define DINBF8 0xf8
-#define DINAC0 0xb0
-#define DINAC1 0xb1
-#define DINAC2 0xb4
-#define DINAC3 0xb5
-#define DINAC4 0xb8
-#define DINAC5 0xb9
-#define DINBC0 0xc0
-#define DINBC2 0xc2
-#define DINBC4 0xc4
-#define DINBC6 0xc6
-#else
-#error No CONFIG_MPU_SENSORS_xxxx has been defined.
-#endif
#endif // DMPKEY_H__
diff --git a/invensense/mlsdk/mllite/ml.c b/invensense/mlsdk/mllite/ml.c
index 5ee91d0..d830be7 100644
--- a/invensense/mlsdk/mllite/ml.c
+++ b/invensense/mlsdk/mllite/ml.c
@@ -233,13 +233,8 @@ inv_error_t inv_apply_calibration(void)
if (NULL != mldl_cfg->accel){
RANGE_FIXEDPOINT_TO_FLOAT(mldl_cfg->accel->range, accelScale);
inv_obj.accel_sens = (long)(accelScale * 65536L);
- /* sensitivity adjustment, typically = 2 (for +/- 2 gee) */
-#if defined CONFIG_MPU_SENSORS_MPU6050A2 || \
- defined CONFIG_MPU_SENSORS_MPU6050B1
- inv_obj.accel_sens /= 32768 / mldl_cfg->accel_sens_trim;
-#else
- inv_obj.accel_sens /= 2;
-#endif
+ /* sensitivity adjustment, typically = 2 (for +/- 2 gee) */
+ inv_obj.accel_sens /= 2;
}
if (NULL != mldl_cfg->compass){
RANGE_FIXEDPOINT_TO_FLOAT(mldl_cfg->compass->range, magScale);
@@ -460,7 +455,7 @@ inv_error_t inv_reset_motion(void)
inv_obj.motion_state = INV_MOTION;
inv_obj.flags[INV_MOTION_STATE_CHANGE] = INV_MOTION;
inv_obj.no_motion_accel_time = inv_get_tick_count();
-#if defined CONFIG_MPU_SENSORS_MPU3050
+
regs[0] = DINAD8 + 2;
regs[1] = DINA0C;
regs[2] = DINAD8 + 1;
@@ -469,8 +464,7 @@ inv_error_t inv_reset_motion(void)
LOG_RESULT_LOCATION(result);
return result;
}
-#else
-#endif
+
regs[0] = (unsigned char)((inv_obj.motion_duration >> 8) & 0xff);
regs[1] = (unsigned char)(inv_obj.motion_duration & 0xff);
result = inv_set_mpu_memory(KEY_D_1_106, 2, regs);
@@ -804,12 +798,7 @@ inv_error_t inv_set_accel_calibration(float range, signed char *orientation)
}
if (mldl_cfg->accel->id) {
-#if defined CONFIG_MPU_SENSORS_MPU6050A2 || \
- defined CONFIG_MPU_SENSORS_MPU6050B1
- unsigned char tmp[3] = { DINA0C, DINAC9, DINA2C };
-#else
unsigned char tmp[3] = { DINA4C, DINACD, DINA6C };
-#endif
struct mldl_cfg *mldl_cfg = inv_get_dl_config();
unsigned char regs[3];
unsigned short orient;
@@ -831,15 +820,8 @@ inv_error_t inv_set_accel_calibration(float range, signed char *orientation)
regs[0] = DINA26;
regs[1] = DINA46;
-#if defined CONFIG_MPU_SENSORS_MPU3050 || defined CONFIG_MPU_SENSORS_MPU6050A2
regs[2] = DINA66;
-#else
- if (MPL_PROD_KEY(mldl_cfg->product_id, mldl_cfg->product_revision)
- == MPU_PRODUCT_KEY_B1_E1_5)
- regs[2] = DINA76;
- else
- regs[2] = DINA66;
-#endif
+
if (orient & 4)
regs[0] |= 1;
if (orient & 0x20)
@@ -949,16 +931,9 @@ inv_error_t inv_set_gyro_calibration(float range, signed char *orientation)
}
{
-#if defined CONFIG_MPU_SENSORS_MPU6050A2 || \
- defined CONFIG_MPU_SENSORS_MPU6050B1
- unsigned char tmpD = DINA4C;
- unsigned char tmpE = DINACD;
- unsigned char tmpF = DINA6C;
-#else
unsigned char tmpD = DINAC9;
unsigned char tmpE = DINA2C;
unsigned char tmpF = DINACB;
-#endif
regs[3] = DINA36;
regs[4] = DINA56;
regs[5] = DINA76;
@@ -1125,16 +1100,11 @@ inv_error_t inv_set_dead_zone(void)
if (cntrl_params.functions & INV_DEAD_ZONE) {
reg = 0x08;
} else {
-#if defined CONFIG_MPU_SENSORS_MPU6050A2 || \
- defined CONFIG_MPU_SENSORS_MPU6050B1
- reg = 0;
-#else
if (inv_params_obj.bias_mode & INV_BIAS_FROM_LPF) {
reg = 0x2;
} else {
reg = 0;
}
-#endif
}
result = inv_set_mpu_memory(KEY_D_0_163, 1, &reg);
@@ -1817,70 +1787,5 @@ void inv_set_mode_change(inv_error_t(*mode_change_func)
}
/**
-* Mantis setup
-*/
-#ifdef CONFIG_MPU_SENSORS_MPU6050B1
-inv_error_t inv_set_mpu_6050_config()
-{
- long temp;
- inv_error_t result;
- unsigned char big8[4];
- unsigned char atc[4];
- long s[3], s2[3];
- int kk;
- struct mldl_cfg *mldlCfg = inv_get_dl_config();
-
- result = inv_serial_read(inv_get_serial_handle(), inv_get_mpu_slave_addr(),
- 0x0d, 4, atc);
- if (result) {
- LOG_RESULT_LOCATION(result);
- return result;
- }
-
- temp = atc[3] & 0x3f;
- if (temp >= 32)
- temp = temp - 64;
- temp = (temp << 21) | 0x100000;
- temp += (1L << 29);
- temp = -temp;
- result = inv_set_mpu_memory(KEY_D_ACT0, 4, inv_int32_to_big8(temp, big8));
- if (result) {
- LOG_RESULT_LOCATION(result);
- return result;
- }
-
- for (kk = 0; kk < 3; ++kk) {
- s[kk] = atc[kk] & 0x3f;
- if (s[kk] > 32)
- s[kk] = s[kk] - 64;
- s[kk] *= 2516582L;
- }
-
- for (kk = 0; kk < 3; ++kk) {
- s2[kk] = mldlCfg->pdata->orientation[kk * 3] * s[0] +
- mldlCfg->pdata->orientation[kk * 3 + 1] * s[1] +
- mldlCfg->pdata->orientation[kk * 3 + 2] * s[2];
- }
- result = inv_set_mpu_memory(KEY_D_ACSX, 4, inv_int32_to_big8(s2[0], big8));
- if (result) {
- LOG_RESULT_LOCATION(result);
- return result;
- }
- result = inv_set_mpu_memory(KEY_D_ACSY, 4, inv_int32_to_big8(s2[1], big8));
- if (result) {
- LOG_RESULT_LOCATION(result);
- return result;
- }
- result = inv_set_mpu_memory(KEY_D_ACSZ, 4, inv_int32_to_big8(s2[2], big8));
- if (result) {
- LOG_RESULT_LOCATION(result);
- return result;
- }
-
- return result;
-}
-#endif
-
-/**
* @}
*/
diff --git a/invensense/mlsdk/mllite/ml.h b/invensense/mlsdk/mllite/ml.h
index 838cd49..67e47e2 100644
--- a/invensense/mlsdk/mllite/ml.h
+++ b/invensense/mlsdk/mllite/ml.h
@@ -456,13 +456,6 @@ struct inv_obj_t {
/*API for setting bias update function */
inv_error_t inv_set_bias_update(unsigned short biasFunction);
-#if defined CONFIG_MPU_SENSORS_MPU6050A2 || \
- defined CONFIG_MPU_SENSORS_MPU6050B1
- inv_error_t inv_turn_on_bias_from_no_motion(void);
- inv_error_t inv_turn_off_bias_from_no_motion(void);
- inv_error_t inv_set_mpu_6050_config(void);
-#endif
-
/* Legacy functions for handling augmented data*/
inv_error_t inv_get_array(int dataSet, long *data);
inv_error_t inv_get_float_array(int dataSet, float *data);
diff --git a/invensense/mlsdk/mllite/mlBiasNoMotion.c b/invensense/mlsdk/mllite/mlBiasNoMotion.c
index 0afe627..aaf98d2 100644
--- a/invensense/mlsdk/mllite/mlBiasNoMotion.c
+++ b/invensense/mlsdk/mllite/mlBiasNoMotion.c
@@ -71,30 +71,6 @@ inv_error_t inv_set_motion_callback(void (*func) (unsigned short motion_state))
return INV_SUCCESS;
}
-#if defined CONFIG_MPU_SENSORS_MPU6050A2 || \
- defined CONFIG_MPU_SENSORS_MPU6050B1
-/** Turns on the feature to compute gyro bias from No Motion */
-inv_error_t inv_turn_on_bias_from_no_motion()
-{
- inv_error_t result;
- unsigned char regs[3] = { 0x0d, DINA35, 0x5d };
- inv_params_obj.bias_mode |= INV_BIAS_FROM_NO_MOTION;
- result = inv_set_mpu_memory(KEY_CFG_MOTION_BIAS, 3, regs);
- return result;
-}
-
-/** Turns off the feature to compute gyro bias from No Motion
-*/
-inv_error_t inv_turn_off_bias_from_no_motion()
-{
- inv_error_t result;
- unsigned char regs[3] = { DINA90 + 8, DINA90 + 8, DINA90 + 8 };
- inv_params_obj.bias_mode &= ~INV_BIAS_FROM_NO_MOTION;
- result = inv_set_mpu_memory(KEY_CFG_MOTION_BIAS, 3, regs);
- return result;
-}
-#endif
-
inv_error_t inv_update_bias(void)
{
INVENSENSE_FUNC_START;
@@ -237,7 +213,6 @@ inv_error_t MLPollMotionStatus(struct inv_obj_t * inv_obj)
inv_obj->poll_no_motion = currentTime;
-#if defined CONFIG_MPU_SENSORS_MPU3050
if (inv_get_gyro_present()
&& ((inv_params_obj.bias_mode & INV_BIAS_FROM_FAST_NO_MOTION) == 0)) {
static long repeatBiasUpdateTime = 0;
@@ -309,52 +284,7 @@ inv_error_t MLPollMotionStatus(struct inv_obj_t * inv_obj)
}
}
}
-#else // CONFIG_MPU_SENSORS_MPU3050
- if (inv_get_gyro_present()
- && ((inv_params_obj.bias_mode & INV_BIAS_FROM_FAST_NO_MOTION) == 0)) {
- result = inv_get_mpu_memory(KEY_D_1_98, 2, regs);
- if (result) {
- LOG_RESULT_LOCATION(result);
- return result;
- }
-
- motionFlag = (unsigned short)regs[0] * 256 + (unsigned short)regs[1];
-
- _mlDebug(MPL_LOGV("motionFlag from RAM : 0x%04X\n", motionFlag);
- )
- if (motionFlag > 0) {
- unsigned char biasReg[12];
- long biasTmp2[3], biasTmp[3];
- int i;
-
- if (inv_obj->last_motion != motionFlag) {
- result = inv_get_mpu_memory(KEY_D_2_96, 12, biasReg);
- for (i = 0; i < 3; i++) {
- biasTmp2[i] = inv_big8_to_int32(&biasReg[i * 4]);
- }
- // Rotate bias vector by the transpose of the orientation matrix
- for (i = 0; i < 3; ++i) {
- biasTmp[i] =
- inv_q30_mult(biasTmp2[0],
- inv_obj->gyro_orient[i]) +
- inv_q30_mult(biasTmp2[1],
- inv_obj->gyro_orient[i + 3]) +
- inv_q30_mult(biasTmp2[2], inv_obj->gyro_orient[i + 6]);
- }
- inv_obj->gyro_bias[0] = inv_q30_mult(biasTmp[0], 1501974482L);
- inv_obj->gyro_bias[1] = inv_q30_mult(biasTmp[1], 1501974482L);
- inv_obj->gyro_bias[2] = inv_q30_mult(biasTmp[2], 1501974482L);
- }
- inv_set_motion_state(INV_NO_MOTION);
- } else {
- // We are in a motion state
- inv_set_motion_state(INV_MOTION);
- }
- inv_obj->last_motion = motionFlag;
-
- }
-#endif // CONFIG_MPU_SENSORS_MPU3050
return INV_SUCCESS;
}
@@ -365,14 +295,6 @@ inv_error_t inv_enable_bias_no_motion(void)
result =
inv_register_fifo_rate_process(MLPollMotionStatus,
INV_PRIORITY_BIAS_NO_MOTION);
-#if defined CONFIG_MPU_SENSORS_MPU6050A2 || \
- defined CONFIG_MPU_SENSORS_MPU6050B1
- if (result) {
- LOG_RESULT_LOCATION(result);
- return result;
- }
- result = inv_turn_on_bias_from_no_motion();
-#endif
return result;
}
@@ -381,13 +303,5 @@ inv_error_t inv_disable_bias_no_motion(void)
inv_error_t result;
inv_params_obj.bias_mode &= ~INV_BIAS_FROM_NO_MOTION;
result = inv_unregister_fifo_rate_process(MLPollMotionStatus);
-#if defined CONFIG_MPU_SENSORS_MPU6050A2 || \
- defined CONFIG_MPU_SENSORS_MPU6050B1
- if (result) {
- LOG_RESULT_LOCATION(result);
- return result;
- }
- result = inv_turn_off_bias_from_no_motion();
-#endif
return result;
}
diff --git a/invensense/mlsdk/mllite/mlFIFO.c b/invensense/mlsdk/mllite/mlFIFO.c
index 221e72d..a5d0c9f 100644
--- a/invensense/mlsdk/mllite/mlFIFO.c
+++ b/invensense/mlsdk/mllite/mlFIFO.c
@@ -33,15 +33,7 @@
#include <string.h>
#include "mpu.h"
-#if defined CONFIG_MPU_SENSORS_MPU6050A2
-# include "mpu6050a2.h"
-#elif defined CONFIG_MPU_SENSORS_MPU6050B1
-# include "mpu6050b1.h"
-#elif defined CONFIG_MPU_SENSORS_MPU3050
-# include "mpu3050.h"
-#else
-#error Invalid or undefined CONFIG_MPU_SENSORS_MPUxxxx
-#endif
+#include "mpu3050.h"
#include "mlFIFO.h"
#include "mlFIFOHW.h"
#include "dmpKey.h"
@@ -765,18 +757,8 @@ inv_error_t inv_process_fifo_packet(const unsigned char *dmpData)
*/
long inv_decode_temperature(short tempReg)
{
-#if defined CONFIG_MPU_SENSORS_MPU6050A2
- // Celcius = 35 + (T + 3048.7)/325.9
- return 2906830L + inv_q30_mult((long)tempReg << 16, 3294697L);
-#endif
-#if defined CONFIG_MPU_SENSORS_MPU6050B1
- // Celcius = 35 + (T + 927.4)/360.6
- return 2462307L + inv_q30_mult((long)tempReg << 16, 2977653L);
-#endif
-#if defined CONFIG_MPU_SENSORS_MPU3050
// Celcius = 35 + (T + 13200)/280
return 5383314L + inv_q30_mult((long)tempReg << 16, 3834792L);
-#endif
}
/** @internal
@@ -957,24 +939,8 @@ inv_error_t inv_get_gyro_and_accel_sensor(long *data)
*/
inv_error_t inv_get_external_sensor_data(long *data, int size)
{
-#if defined CONFIG_MPU_SENSORS_MPU6050A2 || \
- defined CONFIG_MPU_SENSORS_MPU6050B1
- int ii;
- if (data == NULL)
- return INV_ERROR_INVALID_PARAMETER;
-
- if (!fifo_obj.data_config[CONFIG_RAW_EXTERNAL])
- return INV_ERROR_FEATURE_NOT_ENABLED;
-
- for (ii = 0; ii < size && ii < 6; ii++) {
- data[ii] = fifo_obj.decoded[REF_RAW_EXTERNAL + ii];
- }
-
- return INV_SUCCESS;
-#else
memset(data, 0, COMPASS_NUM_AXES * sizeof(long));
return INV_ERROR_FEATURE_NOT_IMPLEMENTED;
-#endif
}
/**
@@ -1298,61 +1264,6 @@ inv_error_t inv_send_quaternion(uint_fast16_t accuracy)
inv_error_t inv_send_sensor_data(uint_fast16_t elements, uint_fast16_t accuracy)
{
int result;
-#if defined CONFIG_MPU_SENSORS_MPU6050A2 || \
- defined CONFIG_MPU_SENSORS_MPU6050B1
- unsigned char regs[7] = { DINAA0 + 3, DINAA0 + 3, DINAA0 + 3,
- DINAA0 + 3, DINAA0 + 3, DINAA0 + 3,
- DINAA0 + 3
- };
-
- if (inv_get_state() < INV_STATE_DMP_OPENED)
- return INV_ERROR_SM_IMPROPER_STATE;
-
- if (accuracy)
- accuracy = INV_16_BIT;
-
- elements = inv_set_fifo_reference(elements, accuracy, REF_RAW, 7);
-
- if (elements & 1)
- fifo_obj.data_config[CONFIG_TEMPERATURE] = 1 | INV_16_BIT;
- else
- fifo_obj.data_config[CONFIG_TEMPERATURE] = 0;
- if (elements & 0x7e)
- fifo_obj.data_config[CONFIG_RAW_DATA] =
- (0x3f & (elements >> 1)) | INV_16_BIT;
- else
- fifo_obj.data_config[CONFIG_RAW_DATA] = 0;
-
- if (elements & INV_ELEMENT_1) {
- regs[0] = DINACA;
- }
- if (elements & INV_ELEMENT_2) {
- regs[1] = DINBC4;
- }
- if (elements & INV_ELEMENT_3) {
- regs[2] = DINACC;
- }
- if (elements & INV_ELEMENT_4) {
- regs[3] = DINBC6;
- }
- if (elements & INV_ELEMENT_5) {
- regs[4] = DINBC0;
- }
- if (elements & INV_ELEMENT_6) {
- regs[5] = DINAC8;
- }
- if (elements & INV_ELEMENT_7) {
- regs[6] = DINBC2;
- }
- result = inv_set_mpu_memory(KEY_CFG_15, 7, regs);
- if (result) {
- LOG_RESULT_LOCATION(result);
- return result;
- }
-
- return inv_set_footer();
-
-#else
INVENSENSE_FUNC_START;
unsigned char regs[4] = { DINAA0 + 3,
DINAA0 + 3,
@@ -1402,7 +1313,6 @@ inv_error_t inv_send_sensor_data(uint_fast16_t elements, uint_fast16_t accuracy)
fifo_obj.data_config[CONFIG_RAW_DATA] = 0;
return inv_set_footer();
-#endif
}
/** Sends raw external data to the FIFO.
@@ -1417,56 +1327,7 @@ inv_error_t inv_send_sensor_data(uint_fast16_t elements, uint_fast16_t accuracy)
inv_error_t inv_send_external_sensor_data(uint_fast16_t elements,
uint_fast16_t accuracy)
{
-#if defined CONFIG_MPU_SENSORS_MPU6050A2 || \
- defined CONFIG_MPU_SENSORS_MPU6050B1
- int result;
- unsigned char regs[6] = { DINAA0 + 3, DINAA0 + 3,
- DINAA0 + 3, DINAA0 + 3,
- DINAA0 + 3, DINAA0 + 3 };
-
- if (inv_get_state() < INV_STATE_DMP_OPENED)
- return INV_ERROR_SM_IMPROPER_STATE;
-
- if (accuracy)
- accuracy = INV_16_BIT;
-
- elements = inv_set_fifo_reference(elements, accuracy, REF_RAW_EXTERNAL, 6);
-
- if (elements)
- fifo_obj.data_config[CONFIG_RAW_EXTERNAL] = elements | INV_16_BIT;
- else
- fifo_obj.data_config[CONFIG_RAW_EXTERNAL] = 0;
-
- if (elements & INV_ELEMENT_1) {
- regs[0] = DINBC2;
- }
- if (elements & INV_ELEMENT_2) {
- regs[1] = DINACA;
- }
- if (elements & INV_ELEMENT_3) {
- regs[2] = DINBC4;
- }
- if (elements & INV_ELEMENT_4) {
- regs[3] = DINBC0;
- }
- if (elements & INV_ELEMENT_5) {
- regs[4] = DINAC8;
- }
- if (elements & INV_ELEMENT_6) {
- regs[5] = DINACC;
- }
-
- result = inv_set_mpu_memory(KEY_CFG_EXTERNAL, sizeof(regs), regs);
- if (result) {
- LOG_RESULT_LOCATION(result);
- return result;
- }
-
- return inv_set_footer();
-
-#else
return INV_ERROR_FEATURE_NOT_IMPLEMENTED; // Feature not supported
-#endif
}
/**
diff --git a/invensense/mlsdk/mllite/mlFIFOHW.c b/invensense/mlsdk/mllite/mlFIFOHW.c
index 1dd5294..e806b95 100644
--- a/invensense/mlsdk/mllite/mlFIFOHW.c
+++ b/invensense/mlsdk/mllite/mlFIFOHW.c
@@ -35,15 +35,7 @@
#include <string.h>
#include "mpu.h"
-#if defined CONFIG_MPU_SENSORS_MPU6050A2
-# include "mpu6050a2.h"
-#elif defined CONFIG_MPU_SENSORS_MPU6050B1
-# include "mpu6050b1.h"
-#elif defined CONFIG_MPU_SENSORS_MPU3050
-# include "mpu3050.h"
-#else
-#error Invalid or undefined CONFIG_MPU_SENSORS_MPUxxxx
-#endif
+#include "mpu3050.h"
#include "mlFIFOHW.h"
#include "ml.h"
#include "mldl.h"
diff --git a/invensense/mlsdk/mllite/ml_mputest.c b/invensense/mlsdk/mllite/ml_mputest.c
index d7fc608..ffb17cd 100644
--- a/invensense/mlsdk/mllite/ml_mputest.c
+++ b/invensense/mlsdk/mllite/ml_mputest.c
@@ -134,11 +134,7 @@ inv_error_t inv_self_test_factory_calibrate(void *mlsl_handle,
*/
inv_error_t inv_self_test_run(void)
{
-#ifdef CONFIG_MPU_SENSORS_MPU3050
return inv_self_test_factory_calibrate(inv_get_serial_handle(), TRUE);
-#else
- return inv_self_test_factory_calibrate(inv_get_serial_handle(), FALSE);
-#endif
}
/**
diff --git a/invensense/mlsdk/mllite/mldl.c b/invensense/mlsdk/mllite/mldl.c
index 10470e6..ee7258f 100644
--- a/invensense/mlsdk/mllite/mldl.c
+++ b/invensense/mlsdk/mllite/mldl.c
@@ -39,15 +39,7 @@
#include <string.h>
#include "mpu.h"
-#if defined CONFIG_MPU_SENSORS_MPU6050A2
-# include "mpu6050a2.h"
-#elif defined CONFIG_MPU_SENSORS_MPU6050B1
-# include "mpu6050b1.h"
-#elif defined CONFIG_MPU_SENSORS_MPU3050
-# include "mpu3050.h"
-#else
-#error Invalid or undefined CONFIG_MPU_SENSORS_MPUxxxx
-#endif
+#include "mpu3050.h"
#include "mldl.h"
#include "mldl_cfg.h"
#include "compass.h"
@@ -422,12 +414,10 @@ inv_error_t inv_get_dl_cfg_int(unsigned char triggers)
{
inv_error_t result = INV_SUCCESS;
-#if defined CONFIG_MPU_SENSORS_MPU3050
/* Mantis has 8 bits of interrupt config bits */
if (triggers & !(BIT_MPU_RDY_EN | BIT_DMP_INT_EN | BIT_RAW_RDY_EN)) {
return INV_ERROR_INVALID_PARAMETER;
}
-#endif
mldlCfg.int_config = triggers;
if (!mldlCfg.gyro_is_suspended) {
@@ -617,7 +607,6 @@ inv_error_t inv_set_offsetTC(const unsigned char *tc)
}
if (!mldlCfg.gyro_is_suspended) {
-#ifdef CONFIG_MPU_SENSORS_MPU3050
result = inv_serial_single_write(sMLSLHandle, mldlCfg.addr,
MPUREG_XG_OFFS_TC, tc[0]);
if (result) {
@@ -636,36 +625,6 @@ inv_error_t inv_set_offsetTC(const unsigned char *tc)
LOG_RESULT_LOCATION(result);
return result;
}
-#else
- unsigned char reg;
- result = inv_serial_single_write(sMLSLHandle, mldlCfg.addr,
- MPUREG_XG_OFFS_TC,
- ((mldlCfg.offset_tc[0] << 1)
- & BITS_XG_OFFS_TC));
- if (result) {
- LOG_RESULT_LOCATION(result);
- return result;
- }
- reg = ((mldlCfg.offset_tc[1] << 1) & BITS_YG_OFFS_TC);
-#ifdef CONFIG_MPU_SENSORS_MPU6050B1
- if (mldlCfg.pdata->level_shifter)
- reg |= BIT_I2C_MST_VDDIO;
-#endif
- result = inv_serial_single_write(sMLSLHandle, mldlCfg.addr,
- MPUREG_YG_OFFS_TC, reg);
- if (result) {
- LOG_RESULT_LOCATION(result);
- return result;
- }
- result = inv_serial_single_write(sMLSLHandle, mldlCfg.addr,
- MPUREG_ZG_OFFS_TC,
- ((mldlCfg.offset_tc[2] << 1)
- & BITS_ZG_OFFS_TC));
- if (result) {
- LOG_RESULT_LOCATION(result);
- return result;
- }
-#endif
} else {
mldlCfg.gyro_needs_reset = TRUE;
}
diff --git a/invensense/mlsdk/mllite/mldl_cfg.h b/invensense/mlsdk/mllite/mldl_cfg.h
index b4914e2..fb2e402 100644
--- a/invensense/mlsdk/mllite/mldl_cfg.h
+++ b/invensense/mlsdk/mllite/mldl_cfg.h
@@ -30,15 +30,7 @@
#include "mltypes.h"
#include "mlsl.h"
#include <linux/mpu.h>
-#if defined CONFIG_MPU_SENSORS_MPU6050A2
-# include "mpu6050a2.h"
-#elif defined CONFIG_MPU_SENSORS_MPU6050B1
-# include "mpu6050b1.h"
-#elif defined CONFIG_MPU_SENSORS_MPU3050
-# include "mpu3050.h"
-#else
-#error Invalid or undefined CONFIG_MPU_SENSORS_MPUxxxx
-#endif
+#include "mpu3050.h"
#include "log.h"
@@ -106,10 +98,6 @@ struct mldl_cfg {
unsigned char silicon_revision;
unsigned char product_id;
unsigned short gyro_sens_trim;
-#if defined CONFIG_MPU_SENSORS_MPU6050A2 || \
- defined CONFIG_MPU_SENSORS_MPU6050B1
- unsigned short accel_sens_trim;
-#endif
/* Driver/Kernel related state information */
int gyro_is_bypassed;
diff --git a/invensense/mlsdk/mllite/mldl_cfg_mpu.c b/invensense/mlsdk/mllite/mldl_cfg_mpu.c
index 74c0f14..5a6f06a 100644
--- a/invensense/mlsdk/mllite/mldl_cfg_mpu.c
+++ b/invensense/mlsdk/mllite/mldl_cfg_mpu.c
@@ -79,9 +79,6 @@ void mpu_print_cfg(struct mldl_cfg * mldl_cfg)
MPL_LOGD("mldl_cfg.silicon_revision = %02x\n", mldl_cfg->silicon_revision);
MPL_LOGD("mldl_cfg.product_id = %02x\n", mldl_cfg->product_id);
MPL_LOGD("mldl_cfg.gyro_sens_trim = %02x\n", mldl_cfg->gyro_sens_trim);
-#if defined CONFIG_MPU_SENSORS_MPU6050A2 || defined CONFIG_MPU_SENSORS_MPU6050B1
- MPL_LOGD("mldl_cfg.accel_sens_trim = %02x\n", mldl_cfg->accel_sens_trim);
-#endif
if (mldl_cfg->accel) {
MPL_LOGD("slave_accel->suspend = %p\n", mldl_cfg->accel->suspend);
diff --git a/invensense/mlsdk/mllite/mlsupervisor.c b/invensense/mlsdk/mllite/mlsupervisor.c
index ea6b7ec..a7b35df 100644
--- a/invensense/mlsdk/mllite/mlsupervisor.c
+++ b/invensense/mlsdk/mllite/mlsupervisor.c
@@ -86,16 +86,6 @@ void inv_init_sensor_fusion_supervisor(void)
yas_filter_init(&f);
f.init(&handle);
-#if defined CONFIG_MPU_SENSORS_MPU6050A2 || \
- defined CONFIG_MPU_SENSORS_MPU6050B1
- if (inv_compass_present()) {
- struct mldl_cfg *mldl_cfg = inv_get_dl_config();
- if (mldl_cfg->pdata->compass.bus == EXT_SLAVE_BUS_SECONDARY) {
- (void)inv_send_external_sensor_data(INV_ELEMENT_1 | INV_ELEMENT_2 | INV_ELEMENT_3, INV_16_BIT);
- }
- }
-#endif
-
if (ml_supervisor_cb.supervisor_reset_func != NULL) {
ml_supervisor_cb.supervisor_reset_func();
}