\hypertarget{inv__mpu_8c_source}{}\doxysection{inv\+\_\+mpu.\+c}
\label{inv__mpu_8c_source}\index{D:/gitt/MicrochipFor32/bsp\_MPU6050/inv\_mpu.c@{D:/gitt/MicrochipFor32/bsp\_MPU6050/inv\_mpu.c}}
\mbox{\hyperlink{inv__mpu_8c}{浏览该文件的文档.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00001}00001 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00002}00002 \textcolor{comment}{ \$License:}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00003}00003 \textcolor{comment}{    Copyright (C) 2011-\/2012 InvenSense Corporation, All Rights Reserved.}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00004}00004 \textcolor{comment}{    See included License.txt for License information.}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00005}00005 \textcolor{comment}{ \$}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00006}00006 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00020}00020 \textcolor{preprocessor}{\#include <stdio.h>}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00021}00021 \textcolor{preprocessor}{\#include <stdlib.h>}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00022}00022 \textcolor{preprocessor}{\#include <string.h>}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00023}00023 \textcolor{preprocessor}{\#include <math.h>}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00024}00024 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{inv__mpu_8h}{inv\_mpu.h}}"{}}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00025}00025 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{inv__mpu__dmp__motion__driver_8h}{inv\_mpu\_dmp\_motion\_driver.h}}"{}}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00026}00026 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{mpu6050_8h}{mpu6050.h}}"{}}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00027}00027 \textcolor{preprocessor}{\#include "{}usart.h"{}}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00028}00028 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{varint_8h}{varint.h}}"{}}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00029}00029 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00030}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6d132f914f18cb144a0eaf36312045c8}{00030}} \textcolor{preprocessor}{\#define MPU6050                         }\textcolor{comment}{//定义我们使用的传感器为MPU6050}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00031}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf5aa4c072d42b67d74043f642b68ddd7}{00031}} \textcolor{preprocessor}{\#define MOTION\_DRIVER\_TARGET\_MSP430     }\textcolor{comment}{//定义驱动部分,采用MSP430的驱动(移植到STM32F1)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00032}00032 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00033}00033 \textcolor{comment}{/* The following functions must be defined for this platform:}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00034}00034 \textcolor{comment}{ * i2c\_write(unsigned char slave\_addr, unsigned char reg\_addr,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00035}00035 \textcolor{comment}{ *      unsigned char length, unsigned char const *data)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00036}00036 \textcolor{comment}{ * i2c\_read(unsigned char slave\_addr, unsigned char reg\_addr,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00037}00037 \textcolor{comment}{ *      unsigned char length, unsigned char *data)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00038}00038 \textcolor{comment}{ * delay\_ms(unsigned long num\_ms)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00039}00039 \textcolor{comment}{ * get\_ms(unsigned long *count)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00040}00040 \textcolor{comment}{ * reg\_int\_cb(void (*cb)(void), unsigned char port, unsigned char pin)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00041}00041 \textcolor{comment}{ * labs(long x)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00042}00042 \textcolor{comment}{ * fabsf(float x)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00043}00043 \textcolor{comment}{ * min(int a, int b)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00044}00044 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00045}00045 \textcolor{preprocessor}{\#if defined MOTION\_DRIVER\_TARGET\_MSP430}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00046}00046 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00047}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{00047}} \textcolor{preprocessor}{\#define i2c\_write   MPU\_Write\_Len}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00048}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga838d8f1c7b0d8cc83923b93bbafe1b33}{00048}} \textcolor{preprocessor}{\#define i2c\_read    MPU\_Read\_Len}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00049}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gae36aca5baf9b6b7d74992aef00686d67}{00049}} \textcolor{preprocessor}{\#define delay\_ms    HAL\_Delay}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00050}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3e6b6bc6d1cd2956353a31bfadd3c332}{00050}} \textcolor{preprocessor}{\#define get\_ms      mget\_ms}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00051}00051 \textcolor{comment}{//static inline int reg\_int\_cb(struct int\_param\_s *int\_param)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00052}00052 \textcolor{comment}{//\{}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00053}00053 \textcolor{comment}{//    return msp430\_reg\_int\_cb(int\_param-\/>cb, int\_param-\/>pin, int\_param-\/>lp\_exit,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00054}00054 \textcolor{comment}{//        int\_param-\/>active\_low);}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00055}00055 \textcolor{comment}{//\}}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00056}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga69f90a1116c37ff659a096f2932c3988}{00056}} \textcolor{keywordtype}{void} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga69f90a1116c37ff659a096f2932c3988}{log\_none}}(\textcolor{keywordtype}{char} *fmt,...)\{;\}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00057}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2905fba7885cd95057e1655cb4d16bda}{00057}} \textcolor{preprocessor}{\#define log\_i   log\_none    }\textcolor{comment}{//打印信息}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00058}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab354affc295f7d61fe8a355c9361cc5a}{00058}} \textcolor{preprocessor}{\#define log\_e   log\_none    }\textcolor{comment}{//打印信息}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00059}00059 \textcolor{comment}{/* labs is already defined by TI's toolchain. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00060}00060 \textcolor{comment}{/* fabs is for doubles. fabsf is for floats. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00061}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga95bcc5f260df5ce993730008a1dcb45a}{00061}} \textcolor{preprocessor}{\#define fabs        fabsf}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00062}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac6afabdc09a49a433ee19d8a9486056d}{00062}} \textcolor{preprocessor}{\#define min(a,b) ((a<b)?a:b)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00063}00063 \textcolor{preprocessor}{\#elif defined EMPL\_TARGET\_MSP430}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00064}00064 \textcolor{preprocessor}{\#include "{}msp430.h"{}}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00065}00065 \textcolor{preprocessor}{\#include "{}msp430\_i2c.h"{}}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00066}00066 \textcolor{preprocessor}{\#include "{}msp430\_clock.h"{}}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00067}00067 \textcolor{preprocessor}{\#include "{}msp430\_interrupt.h"{}}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00068}00068 \textcolor{preprocessor}{\#include "{}log.h"{}}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00069}00069 \textcolor{preprocessor}{\#define i2c\_write   msp430\_i2c\_write}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00070}00070 \textcolor{preprocessor}{\#define i2c\_read    msp430\_i2c\_read}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00071}00071 \textcolor{preprocessor}{\#define delay\_ms    msp430\_delay\_ms}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00072}00072 \textcolor{preprocessor}{\#define get\_ms      msp430\_get\_clock\_ms}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00073}00073 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{int} reg\_int\_cb(\textcolor{keyword}{struct} \mbox{\hyperlink{structint__param__s}{int\_param\_s}} *int\_param)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00074}00074 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00075}00075     \textcolor{keywordflow}{return} msp430\_reg\_int\_cb(int\_param-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga97093754f1f13b06492990e3da77965d}{cb}}, int\_param-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5c682e1b664acf566f985b48dd7acbb7}{pin}}, int\_param-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga46dfad5a278a8b40a68d71beca0d2be4}{lp\_exit}},}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00076}00076         int\_param-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga9b859a3332d9bd9287d5766494f261fb}{active\_low}});}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00077}00077 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00078}00078 \textcolor{preprocessor}{\#define log\_i       MPL\_LOGI}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00079}00079 \textcolor{preprocessor}{\#define log\_e       MPL\_LOGE}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00080}00080 \textcolor{comment}{/* labs is already defined by TI's toolchain. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00081}00081 \textcolor{comment}{/* fabs is for doubles. fabsf is for floats. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00082}00082 \textcolor{preprocessor}{\#define fabs        fabsf}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00083}00083 \textcolor{preprocessor}{\#define min(a,b) ((a<b)?a:b)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00084}00084 \textcolor{preprocessor}{\#elif defined EMPL\_TARGET\_UC3L0}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00085}00085 \textcolor{comment}{/* Instead of using the standard TWI driver from the ASF library, we're using}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00086}00086 \textcolor{comment}{ * a TWI driver that follows the slave address + register address convention.}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00087}00087 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00088}00088 \textcolor{preprocessor}{\#include "{}twi.h"{}}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00089}00089 \textcolor{preprocessor}{\#include "{}delay.h"{}}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00090}00090 \textcolor{preprocessor}{\#include "{}sysclk.h"{}}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00091}00091 \textcolor{preprocessor}{\#include "{}log.h"{}}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00092}00092 \textcolor{preprocessor}{\#include "{}sensors\_xplained.h"{}}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00093}00093 \textcolor{preprocessor}{\#include "{}uc3l0\_clock.h"{}}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00094}00094 \textcolor{preprocessor}{\#define i2c\_write(a, b, c, d)   twi\_write(a, b, d, c)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00095}00095 \textcolor{preprocessor}{\#define i2c\_read(a, b, c, d)    twi\_read(a, b, d, c)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00096}00096 \textcolor{comment}{/* delay\_ms is a function already defined in ASF. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00097}00097 \textcolor{preprocessor}{\#define get\_ms  uc3l0\_get\_clock\_ms}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00098}00098 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{int} reg\_int\_cb(\textcolor{keyword}{struct} \mbox{\hyperlink{structint__param__s}{int\_param\_s}} *int\_param)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00099}00099 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00100}00100     sensor\_board\_irq\_connect(int\_param-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5c682e1b664acf566f985b48dd7acbb7}{pin}}, int\_param-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga97093754f1f13b06492990e3da77965d}{cb}}, int\_param-\/>arg);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00101}00101     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00102}00102 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00103}00103 \textcolor{preprocessor}{\#define log\_i       MPL\_LOGI}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00104}00104 \textcolor{preprocessor}{\#define log\_e       MPL\_LOGE}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00105}00105 \textcolor{comment}{/* UC3 is a 32-\/bit processor, so abs and labs are equivalent. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00106}00106 \textcolor{preprocessor}{\#define labs        abs}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00107}00107 \textcolor{preprocessor}{\#define fabs(x)     (((x)>0)?(x):-\/(x))}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00108}00108 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00109}00109 \textcolor{preprocessor}{\#error  Gyro driver is missing the system layer implementations.}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00110}00110 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00111}00111 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00112}00112 \textcolor{preprocessor}{\#if !defined MPU6050 \&\& !defined MPU9150 \&\& !defined MPU6500 \&\& !defined MPU9250}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00113}00113 \textcolor{preprocessor}{\#error  Which gyro are you using? Define MPUxxxx in your compiler options.}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00114}00114 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00115}00115 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00116}00116 \textcolor{comment}{/* Time for some messy macro work. =]}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00117}00117 \textcolor{comment}{ * \#define MPU9150}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00118}00118 \textcolor{comment}{ * is equivalent to..}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00119}00119 \textcolor{comment}{ * \#define MPU6050}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00120}00120 \textcolor{comment}{ * \#define AK8975\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00121}00121 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00122}00122 \textcolor{comment}{ * \#define MPU9250}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00123}00123 \textcolor{comment}{ * is equivalent to..}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00124}00124 \textcolor{comment}{ * \#define MPU6500}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00125}00125 \textcolor{comment}{ * \#define AK8963\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00126}00126 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00127}00127 \textcolor{preprocessor}{\#if defined MPU9150}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00128}00128 \textcolor{preprocessor}{\#ifndef MPU6050}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00129}00129 \textcolor{preprocessor}{\#define MPU6050}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00130}00130 \textcolor{preprocessor}{\#endif                          }\textcolor{comment}{/* \#ifndef MPU6050 */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00131}00131 \textcolor{preprocessor}{\#if defined AK8963\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00132}00132 \textcolor{preprocessor}{\#error "{}MPU9150 and AK8963\_SECONDARY cannot both be defined."{}}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00133}00133 \textcolor{preprocessor}{\#elif !defined AK8975\_SECONDARY }\textcolor{comment}{/* \#if defined AK8963\_SECONDARY */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00134}00134 \textcolor{preprocessor}{\#define AK8975\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00135}00135 \textcolor{preprocessor}{\#endif                          }\textcolor{comment}{/* \#if defined AK8963\_SECONDARY */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00136}00136 \textcolor{preprocessor}{\#elif defined MPU9250           }\textcolor{comment}{/* \#if defined MPU9150 */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00137}00137 \textcolor{preprocessor}{\#ifndef MPU6500}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00138}00138 \textcolor{preprocessor}{\#define MPU6500}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00139}00139 \textcolor{preprocessor}{\#endif                          }\textcolor{comment}{/* \#ifndef MPU6500 */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00140}00140 \textcolor{preprocessor}{\#if defined AK8975\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00141}00141 \textcolor{preprocessor}{\#error "{}MPU9250 and AK8975\_SECONDARY cannot both be defined."{}}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00142}00142 \textcolor{preprocessor}{\#elif !defined AK8963\_SECONDARY }\textcolor{comment}{/* \#if defined AK8975\_SECONDARY */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00143}00143 \textcolor{preprocessor}{\#define AK8963\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00144}00144 \textcolor{preprocessor}{\#endif                          }\textcolor{comment}{/* \#if defined AK8975\_SECONDARY */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00145}00145 \textcolor{preprocessor}{\#endif                          }\textcolor{comment}{/* \#if defined MPU9150 */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00146}00146 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00147}00147 \textcolor{preprocessor}{\#if defined AK8975\_SECONDARY || defined AK8963\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00148}00148 \textcolor{preprocessor}{\#define AK89xx\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00149}00149 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00150}00150 \textcolor{comment}{/* \#warning "{}No compass = less profit for Invensense. Lame."{} */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00151}00151 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00152}00152 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00153}00153 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gafd5ebff6b0179e1dce0b68c2272cae07}{set\_int\_enable}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} enable);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00154}00154 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00155}00155 \textcolor{comment}{/* Hardware registers needed by driver. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00156}\mbox{\hyperlink{structgyro__reg__s}{00156}} \textcolor{keyword}{struct }\mbox{\hyperlink{structgyro__reg__s}{gyro\_reg\_s}} \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00157}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga51068a36efe9d2aedc9cb8fffacbf15b}{00157}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga51068a36efe9d2aedc9cb8fffacbf15b}{who\_am\_i}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00158}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga27dd9db31f16ca170520b3009255e6d0}{00158}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga27dd9db31f16ca170520b3009255e6d0}{rate\_div}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00159}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga22eeac0bd77e7d99b3e15dda52f1bd08}{00159}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga22eeac0bd77e7d99b3e15dda52f1bd08}{lpf}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00160}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf418d8a6b0e262df54ab8a6a5228011c}{00160}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf418d8a6b0e262df54ab8a6a5228011c}{prod\_id}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00161}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga12505a7d8cd7c976e5571f27a6160d23}{00161}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga12505a7d8cd7c976e5571f27a6160d23}{user\_ctrl}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00162}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6a392b7ecae843c734db3d832f11af49}{00162}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6a392b7ecae843c734db3d832f11af49}{fifo\_en}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00163}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gada0b973f74cc874552f079fd58c435a6}{00163}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gada0b973f74cc874552f079fd58c435a6}{gyro\_cfg}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00164}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gae93a446c54cc00bc7f11209d7af0025e}{00164}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gae93a446c54cc00bc7f11209d7af0025e}{accel\_cfg}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00165}00165 \textcolor{comment}{//    unsigned char accel\_cfg2;}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00166}00166 \textcolor{comment}{//    unsigned char lp\_accel\_odr;}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00167}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab2065a062ea7d6179cd8407b2ab4d146}{00167}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gab2065a062ea7d6179cd8407b2ab4d146}{motion\_thr}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00168}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga57d7f3d79c8227e1795764222e2a4a6e}{00168}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga57d7f3d79c8227e1795764222e2a4a6e}{motion\_dur}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00169}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab7503974d62cf9c2d688579fcd1abd48}{00169}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gab7503974d62cf9c2d688579fcd1abd48}{fifo\_count\_h}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00170}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb6763dc5f368ea01ef7c733cea9dab4}{00170}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb6763dc5f368ea01ef7c733cea9dab4}{fifo\_r\_w}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00171}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab5c2246c44bb36b21596fe5acf7ec0d4}{00171}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gab5c2246c44bb36b21596fe5acf7ec0d4}{raw\_gyro}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00172}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga9b7c162cea6a3deeaac41444c613b7bc}{00172}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga9b7c162cea6a3deeaac41444c613b7bc}{raw\_accel}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00173}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga47674fab0681811c1b733462944e0233}{00173}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga47674fab0681811c1b733462944e0233}{temp}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00174}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga48b47844d4b0570e60aa6806faa59eae}{00174}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga48b47844d4b0570e60aa6806faa59eae}{int\_enable}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00175}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaea6ad456241786750b3f211bc92032eb}{00175}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaea6ad456241786750b3f211bc92032eb}{dmp\_int\_status}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00176}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga837724080c34ff5a190751427febaf91}{00176}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga837724080c34ff5a190751427febaf91}{int\_status}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00177}00177 \textcolor{comment}{//    unsigned char accel\_intel;}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00178}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa01fb0872030e8e2932f8d1d257ea86a}{00178}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa01fb0872030e8e2932f8d1d257ea86a}{pwr\_mgmt\_1}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00179}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3e378b0c77e9529ee93ac6eba11e1031}{00179}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3e378b0c77e9529ee93ac6eba11e1031}{pwr\_mgmt\_2}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00180}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaae7bdbff2a1029245890b555b2d8d519}{00180}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaae7bdbff2a1029245890b555b2d8d519}{int\_pin\_cfg}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00181}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gae17166b43fa12a960c0eced9a3c04bf0}{00181}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gae17166b43fa12a960c0eced9a3c04bf0}{mem\_r\_w}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00182}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab745dd73e0c3ef01f30f96444358cb89}{00182}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gab745dd73e0c3ef01f30f96444358cb89}{accel\_offs}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00183}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2bf6dc826bcb17168013f303c904544b}{00183}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2bf6dc826bcb17168013f303c904544b}{i2c\_mst}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00184}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf1b74c33fa828ea4dc172bfbaaf47216}{00184}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf1b74c33fa828ea4dc172bfbaaf47216}{bank\_sel}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00185}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga7cf5696d5640d63b078f9c5ed9aceda8}{00185}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga7cf5696d5640d63b078f9c5ed9aceda8}{mem\_start\_addr}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00186}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaac4aac12b0e82272affd408b24dc9c95}{00186}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaac4aac12b0e82272affd408b24dc9c95}{prgm\_start\_h}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00187}00187 \textcolor{preprocessor}{\#if defined AK89xx\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00188}00188     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} s0\_addr;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00189}00189     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} s0\_reg;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00190}00190     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} s0\_ctrl;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00191}00191     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} s1\_addr;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00192}00192     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} s1\_reg;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00193}00193     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} s1\_ctrl;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00194}00194     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} s4\_ctrl;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00195}00195     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} s0\_do;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00196}00196     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} s1\_do;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00197}00197     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} i2c\_delay\_ctrl;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00198}00198     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} raw\_compass;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00199}00199     \textcolor{comment}{/* The I2C\_MST\_VDDIO bit is in this register. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00200}00200     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} yg\_offs\_tc;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00201}00201 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00202}00202 \};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00203}00203 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00204}00204 \textcolor{comment}{/* Information specific to a particular device. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00205}\mbox{\hyperlink{structhw__s}{00205}} \textcolor{keyword}{struct }\mbox{\hyperlink{structhw__s}{hw\_s}} \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00206}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{00206}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00207}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5f77e9f55285abb4d214b80281f69c1f}{00207}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5f77e9f55285abb4d214b80281f69c1f}{max\_fifo}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00208}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1039fa66b110194727938cd86be8c3c5}{00208}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1039fa66b110194727938cd86be8c3c5}{num\_reg}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00209}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab2397f792a86b32b0957c24e3912bc63}{00209}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gab2397f792a86b32b0957c24e3912bc63}{temp\_sens}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00210}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga56f98c91a7c4d60ccea1ade1f3e88d04}{00210}}     \textcolor{keywordtype}{short} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga56f98c91a7c4d60ccea1ade1f3e88d04}{temp\_offset}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00211}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaef4a2014cd6e3d5faeb8f713ee3606ed}{00211}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaef4a2014cd6e3d5faeb8f713ee3606ed}{bank\_size}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00212}00212 \textcolor{preprocessor}{\#if defined AK89xx\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00213}00213     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} compass\_fsr;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00214}00214 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00215}00215 \};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00216}00216 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00217}00217 \textcolor{comment}{/* When entering motion interrupt mode, the driver keeps track of the}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00218}00218 \textcolor{comment}{ * previous state so that it can be restored at a later time.}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00219}00219 \textcolor{comment}{ * TODO: This is tacky. Fix it.}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00220}00220 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00221}\mbox{\hyperlink{structmotion__int__cache__s}{00221}} \textcolor{keyword}{struct }\mbox{\hyperlink{structmotion__int__cache__s}{motion\_int\_cache\_s}} \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00222}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gae9614e4c92be9fc08f2aec7f34853fbc}{00222}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gae9614e4c92be9fc08f2aec7f34853fbc}{gyro\_fsr}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00223}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacfb901facda5ef8a02d47726db98e58e}{00223}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gacfb901facda5ef8a02d47726db98e58e}{accel\_fsr}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00224}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac1a1eb41631eb71481d6d247d9c67d4a}{00224}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gac1a1eb41631eb71481d6d247d9c67d4a}{lpf}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00225}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1cf6b7edfe37a51209897ccc448ec0e6}{00225}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1cf6b7edfe37a51209897ccc448ec0e6}{sample\_rate}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00226}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gae5416a4097b0cf39460df70094bc474d}{00226}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gae5416a4097b0cf39460df70094bc474d}{sensors\_on}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00227}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga41501694a84bdf70e9c660852b653273}{00227}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga41501694a84bdf70e9c660852b653273}{fifo\_sensors}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00228}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6461e400e336d2ccbc8c7d95ace9461d}{00228}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6461e400e336d2ccbc8c7d95ace9461d}{dmp\_on}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00229}00229 \};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00230}00230 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00231}00231 \textcolor{comment}{/* Cached chip configuration data.}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00232}00232 \textcolor{comment}{ * TODO: A lot of these can be handled with a bitmask.}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00233}00233 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00234}\mbox{\hyperlink{structchip__cfg__s}{00234}} \textcolor{keyword}{struct }\mbox{\hyperlink{structchip__cfg__s}{chip\_cfg\_s}} \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00235}00235     \textcolor{comment}{/* Matches gyro\_cfg >> 3 \& 0x03 */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00236}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab45a727aeee17380828a3e20ccb375c2}{00236}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gab45a727aeee17380828a3e20ccb375c2}{gyro\_fsr}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00237}00237     \textcolor{comment}{/* Matches accel\_cfg >> 3 \& 0x03 */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00238}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf66873be1446ed552812e32d40eced61}{00238}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf66873be1446ed552812e32d40eced61}{accel\_fsr}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00239}00239     \textcolor{comment}{/* Enabled sensors. Uses same masks as fifo\_en, NOT pwr\_mgmt\_2. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00240}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa996fc14aa630e53823462baf460c13f}{00240}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa996fc14aa630e53823462baf460c13f}{sensors}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00241}00241     \textcolor{comment}{/* Matches config register. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00242}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga16ec8ca8298f62ac01419775377270fb}{00242}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga16ec8ca8298f62ac01419775377270fb}{lpf}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00243}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab7bd5165d6e62cb0d814cf3401958445}{00243}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gab7bd5165d6e62cb0d814cf3401958445}{clk\_src}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00244}00244     \textcolor{comment}{/* Sample rate, NOT rate divider. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00245}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2660470fcf7b53e2e832a397cbe6c354}{00245}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2660470fcf7b53e2e832a397cbe6c354}{sample\_rate}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00246}00246     \textcolor{comment}{/* Matches fifo\_en register. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00247}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga88143c31b894bcd819c0e49b0ff267aa}{00247}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga88143c31b894bcd819c0e49b0ff267aa}{fifo\_enable}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00248}00248     \textcolor{comment}{/* Matches int enable register. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00249}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa366c36057f31e6e0d4cf2ca4a1ef52f}{00249}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa366c36057f31e6e0d4cf2ca4a1ef52f}{int\_enable}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00250}00250     \textcolor{comment}{/* 1 if devices on auxiliary I2C bus appear on the primary. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00251}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6d3a962d6435644c7ea68e7d65934636}{00251}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6d3a962d6435644c7ea68e7d65934636}{bypass\_mode}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00252}00252     \textcolor{comment}{/* 1 if half-\/sensitivity.}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00253}00253 \textcolor{comment}{     * NOTE: This doesn't belong here, but everything else in hw\_s is const,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00254}00254 \textcolor{comment}{     * and this allows us to save some precious RAM.}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00255}00255 \textcolor{comment}{     */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00256}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab72e3cead391dee41f28e041282d743f}{00256}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gab72e3cead391dee41f28e041282d743f}{accel\_half}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00257}00257     \textcolor{comment}{/* 1 if device in low-\/power accel-\/only mode. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00258}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga33e138d8a49744eb9b4ea0e9086cef1c}{00258}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga33e138d8a49744eb9b4ea0e9086cef1c}{lp\_accel\_mode}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00259}00259     \textcolor{comment}{/* 1 if interrupts are only triggered on motion events. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00260}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga279cd5d5d78890357f2d42905d7471df}{00260}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga279cd5d5d78890357f2d42905d7471df}{int\_motion\_only}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00261}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gadf3b491a068e0225a080821516353bac}{00261}}     \textcolor{keyword}{struct }\mbox{\hyperlink{structmotion__int__cache__s}{motion\_int\_cache\_s}} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gadf3b491a068e0225a080821516353bac}{cache}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00262}00262     \textcolor{comment}{/* 1 for active low interrupts. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00263}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6f12e54ae8c7f2dd77954f3ab619bbb9}{00263}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6f12e54ae8c7f2dd77954f3ab619bbb9}{active\_low\_int}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00264}00264     \textcolor{comment}{/* 1 for latched interrupts. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00265}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga55ce40fc460a62829ec149edaccffe7c}{00265}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga55ce40fc460a62829ec149edaccffe7c}{latched\_int}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00266}00266     \textcolor{comment}{/* 1 if DMP is enabled. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00267}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4783ed8aa79a3b5de798963819997c38}{00267}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4783ed8aa79a3b5de798963819997c38}{dmp\_on}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00268}00268     \textcolor{comment}{/* Ensures that DMP will only be loaded once. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00269}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1d2ff55e17aae1459dfad61d76054b1b}{00269}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1d2ff55e17aae1459dfad61d76054b1b}{dmp\_loaded}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00270}00270     \textcolor{comment}{/* Sampling rate used when DMP is enabled. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00271}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5f42b7e1e740f2fb64427417e9e2dab7}{00271}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5f42b7e1e740f2fb64427417e9e2dab7}{dmp\_sample\_rate}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00272}00272 \textcolor{preprocessor}{\#ifdef AK89xx\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00273}00273     \textcolor{comment}{/* Compass sample rate. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00274}00274     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} compass\_sample\_rate;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00275}00275     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} compass\_addr;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00276}00276     \textcolor{keywordtype}{short} mag\_sens\_adj[3];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00277}00277 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00278}00278 \};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00279}00279 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00280}00280 \textcolor{comment}{/* Information for self-\/test. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00281}\mbox{\hyperlink{structtest__s}{00281}} \textcolor{keyword}{struct }\mbox{\hyperlink{structtest__s}{test\_s}} \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00282}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga330290a347407b0d92b1d77aa274993c}{00282}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga330290a347407b0d92b1d77aa274993c}{gyro\_sens}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00283}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5f602885d6a544a9039b13a0cc7ac085}{00283}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5f602885d6a544a9039b13a0cc7ac085}{accel\_sens}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00284}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3bef0c9f009cea4cbe01d0ee91126d83}{00284}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3bef0c9f009cea4cbe01d0ee91126d83}{reg\_rate\_div}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00285}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga09f5a9ab86d36f3b83e7f4abdea73e39}{00285}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga09f5a9ab86d36f3b83e7f4abdea73e39}{reg\_lpf}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00286}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa0dfe8b2c29358e9e045aaa8beff244d}{00286}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa0dfe8b2c29358e9e045aaa8beff244d}{reg\_gyro\_fsr}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00287}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3b54f67ea7f1dd47fd8aa48dda051032}{00287}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3b54f67ea7f1dd47fd8aa48dda051032}{reg\_accel\_fsr}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00288}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf5d495939c8ca761ac2bbe7791dcd727}{00288}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf5d495939c8ca761ac2bbe7791dcd727}{wait\_ms}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00289}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8af20793fdb7764bfa90f80bd74b87e7}{00289}}     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8af20793fdb7764bfa90f80bd74b87e7}{packet\_thresh}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00290}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gafacfcf92f07cd846fb0aaf889a30c582}{00290}}     \textcolor{keywordtype}{float} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gafacfcf92f07cd846fb0aaf889a30c582}{min\_dps}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00291}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gae588d6c0105bcd8f9144f42eee6c4835}{00291}}     \textcolor{keywordtype}{float} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gae588d6c0105bcd8f9144f42eee6c4835}{max\_dps}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00292}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3b47b72fbf8c152cb4389e3cd866ded9}{00292}}     \textcolor{keywordtype}{float} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3b47b72fbf8c152cb4389e3cd866ded9}{max\_gyro\_var}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00293}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gae86aec181d0f1e4a29e9f9ae0735e8e1}{00293}}     \textcolor{keywordtype}{float} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gae86aec181d0f1e4a29e9f9ae0735e8e1}{min\_g}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00294}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga9ebd3195ac2f460f82873b9e6c36eb2c}{00294}}     \textcolor{keywordtype}{float} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga9ebd3195ac2f460f82873b9e6c36eb2c}{max\_g}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00295}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga7f6071fb91426f467d9223c712560ee6}{00295}}     \textcolor{keywordtype}{float} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga7f6071fb91426f467d9223c712560ee6}{max\_accel\_var}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00296}00296 \};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00297}00297 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00298}00298 \textcolor{comment}{/* Gyro driver state variables. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00299}\mbox{\hyperlink{structgyro__state__s}{00299}} \textcolor{keyword}{struct }\mbox{\hyperlink{structgyro__state__s}{gyro\_state\_s}} \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00300}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{00300}}     \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structgyro__reg__s}{gyro\_reg\_s}} *\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00301}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{00301}}     \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structhw__s}{hw\_s}} *\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00302}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{00302}}     \textcolor{keyword}{struct }\mbox{\hyperlink{structchip__cfg__s}{chip\_cfg\_s}} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00303}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5a1563d12b0aab5e65317621742f6f62}{00303}}     \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structtest__s}{test\_s}} *\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5a1563d12b0aab5e65317621742f6f62}{test}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00304}00304 \};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00305}00305 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00306}00306 \textcolor{comment}{/* Filter configurations. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00307}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga91c762a5bd71461f7911dc49ee7696e9}{00307}} \textcolor{keyword}{enum} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga91c762a5bd71461f7911dc49ee7696e9}{lpf\_e}} \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00308}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9a9f0263fbbdccd3c5a18fcb65be278d24}{00308}}     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9a9f0263fbbdccd3c5a18fcb65be278d24}{INV\_FILTER\_256HZ\_NOLPF2}} = 0,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00309}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9ab58e52e0b6be4cbaf0c7f32705a9fcec}{00309}}     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9ab58e52e0b6be4cbaf0c7f32705a9fcec}{INV\_FILTER\_188HZ}},}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00310}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9a0f288da0c97b325a6cb57f1223f0cf98}{00310}}     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9a0f288da0c97b325a6cb57f1223f0cf98}{INV\_FILTER\_98HZ}},}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00311}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9a995b18a52a5bd919aa9c1411a2292110}{00311}}     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9a995b18a52a5bd919aa9c1411a2292110}{INV\_FILTER\_42HZ}},}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00312}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9aebecb86604e475ed8e2cb68340010ff1}{00312}}     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9aebecb86604e475ed8e2cb68340010ff1}{INV\_FILTER\_20HZ}},}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00313}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9a327619f406c6b2f6a221793881013508}{00313}}     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9a327619f406c6b2f6a221793881013508}{INV\_FILTER\_10HZ}},}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00314}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9abdaaf85666fd6a490ee01dcd8a315678}{00314}}     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9abdaaf85666fd6a490ee01dcd8a315678}{INV\_FILTER\_5HZ}},}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00315}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9a76de97a6c2f8eb3c5d1a73d717513f5d}{00315}}     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9a76de97a6c2f8eb3c5d1a73d717513f5d}{INV\_FILTER\_2100HZ\_NOLPF}},}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00316}00316     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9a053f39f04904f6103090bcba3002c4a3}{NUM\_FILTER}}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00317}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9a053f39f04904f6103090bcba3002c4a3}{00317}} \};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00318}00318 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00319}00319 \textcolor{comment}{/* Full scale ranges. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00320}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga83acdc0eb37e8bfe0c2ae2348ded0a90}{00320}} \textcolor{keyword}{enum} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga83acdc0eb37e8bfe0c2ae2348ded0a90}{gyro\_fsr\_e}} \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00321}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gga83acdc0eb37e8bfe0c2ae2348ded0a90a5b8251a49db5cb8a676076b0b308ae35}{00321}}     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga83acdc0eb37e8bfe0c2ae2348ded0a90a5b8251a49db5cb8a676076b0b308ae35}{INV\_FSR\_250DPS}} = 0,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00322}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gga83acdc0eb37e8bfe0c2ae2348ded0a90a50901470ff389927fd010081e2b8fd09}{00322}}     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga83acdc0eb37e8bfe0c2ae2348ded0a90a50901470ff389927fd010081e2b8fd09}{INV\_FSR\_500DPS}},}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00323}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gga83acdc0eb37e8bfe0c2ae2348ded0a90aee922e0daa4fbb404c3db6c49d897a13}{00323}}     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga83acdc0eb37e8bfe0c2ae2348ded0a90aee922e0daa4fbb404c3db6c49d897a13}{INV\_FSR\_1000DPS}},}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00324}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gga83acdc0eb37e8bfe0c2ae2348ded0a90ac0c37efc1c8acd6f70c0c5a768e5b8be}{00324}}     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga83acdc0eb37e8bfe0c2ae2348ded0a90ac0c37efc1c8acd6f70c0c5a768e5b8be}{INV\_FSR\_2000DPS}},}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00325}00325     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga83acdc0eb37e8bfe0c2ae2348ded0a90ab50b300433c5bc3cbc7ae8adb980c815}{NUM\_GYRO\_FSR}}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00326}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gga83acdc0eb37e8bfe0c2ae2348ded0a90ab50b300433c5bc3cbc7ae8adb980c815}{00326}} \};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00327}00327 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00328}00328 \textcolor{comment}{/* Full scale ranges. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00329}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaec8501b935143099e5f729dee221a81e}{00329}} \textcolor{keyword}{enum} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaec8501b935143099e5f729dee221a81e}{accel\_fsr\_e}} \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00330}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ggaec8501b935143099e5f729dee221a81eae27c6f69463dab7de81fac0c51ff8aa7}{00330}}     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ggaec8501b935143099e5f729dee221a81eae27c6f69463dab7de81fac0c51ff8aa7}{INV\_FSR\_2G}} = 0,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00331}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ggaec8501b935143099e5f729dee221a81eaa91e3a89d0bbd01149fe71148595be6d}{00331}}     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ggaec8501b935143099e5f729dee221a81eaa91e3a89d0bbd01149fe71148595be6d}{INV\_FSR\_4G}},}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00332}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ggaec8501b935143099e5f729dee221a81ea0a40371bdda397d234c53d0ee2f3be8b}{00332}}     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ggaec8501b935143099e5f729dee221a81ea0a40371bdda397d234c53d0ee2f3be8b}{INV\_FSR\_8G}},}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00333}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ggaec8501b935143099e5f729dee221a81ea6712e8563c97c11b458ef721d4f5f9d5}{00333}}     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ggaec8501b935143099e5f729dee221a81ea6712e8563c97c11b458ef721d4f5f9d5}{INV\_FSR\_16G}},}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00334}00334     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ggaec8501b935143099e5f729dee221a81ea6d466b2f73b176f1dfc8a3f94ae8a4df}{NUM\_ACCEL\_FSR}}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00335}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ggaec8501b935143099e5f729dee221a81ea6d466b2f73b176f1dfc8a3f94ae8a4df}{00335}} \};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00336}00336 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00337}00337 \textcolor{comment}{/* Clock sources. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00338}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga75570f009627c6f4ddfb2d936d81e207}{00338}} \textcolor{keyword}{enum} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga75570f009627c6f4ddfb2d936d81e207}{clock\_sel\_e}} \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00339}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gga75570f009627c6f4ddfb2d936d81e207a92059acf8d0ff5b7e12580c15f88466f}{00339}}     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga75570f009627c6f4ddfb2d936d81e207a92059acf8d0ff5b7e12580c15f88466f}{INV\_CLK\_INTERNAL}} = 0,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00340}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gga75570f009627c6f4ddfb2d936d81e207a01b240917a78674d3e387110a6a8f94c}{00340}}     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga75570f009627c6f4ddfb2d936d81e207a01b240917a78674d3e387110a6a8f94c}{INV\_CLK\_PLL}},}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00341}00341     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga75570f009627c6f4ddfb2d936d81e207a7f075b0360037232fdf24f90de7be1d7}{NUM\_CLK}}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00342}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gga75570f009627c6f4ddfb2d936d81e207a7f075b0360037232fdf24f90de7be1d7}{00342}} \};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00343}00343 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00344}00344 \textcolor{comment}{/* Low-\/power accel wakeup rates. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00345}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga23c3fcde795e5aa2b141232d490c9ca7}{00345}} \textcolor{keyword}{enum} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga23c3fcde795e5aa2b141232d490c9ca7}{lp\_accel\_rate\_e}} \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00346}00346 \textcolor{preprocessor}{\#if defined MPU6050}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00347}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gga23c3fcde795e5aa2b141232d490c9ca7ab44c7d0127a9466747853533a537b567}{00347}}     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga23c3fcde795e5aa2b141232d490c9ca7ab44c7d0127a9466747853533a537b567}{INV\_LPA\_1\_25HZ}},}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00348}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gga23c3fcde795e5aa2b141232d490c9ca7a474cac76bff369dd656cc973207a1ca5}{00348}}     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga23c3fcde795e5aa2b141232d490c9ca7a474cac76bff369dd656cc973207a1ca5}{INV\_LPA\_5HZ}},}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00349}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gga23c3fcde795e5aa2b141232d490c9ca7accaaf47c58dfe32cbf2ffa11fdb83108}{00349}}     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga23c3fcde795e5aa2b141232d490c9ca7accaaf47c58dfe32cbf2ffa11fdb83108}{INV\_LPA\_20HZ}},}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00350}00350     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga23c3fcde795e5aa2b141232d490c9ca7a798d2b86eafcf3fc7c7fe775f46cb4cb}{INV\_LPA\_40HZ}}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00351}00351 \textcolor{preprocessor}{\#elif defined MPU6500}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00352}00352     INV\_LPA\_0\_3125HZ,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00353}00353     INV\_LPA\_0\_625HZ,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00354}00354     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga23c3fcde795e5aa2b141232d490c9ca7ab44c7d0127a9466747853533a537b567}{INV\_LPA\_1\_25HZ}},}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00355}00355     INV\_LPA\_2\_5HZ,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00356}00356     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga23c3fcde795e5aa2b141232d490c9ca7a474cac76bff369dd656cc973207a1ca5}{INV\_LPA\_5HZ}},}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00357}00357     INV\_LPA\_10HZ,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00358}00358     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga23c3fcde795e5aa2b141232d490c9ca7accaaf47c58dfe32cbf2ffa11fdb83108}{INV\_LPA\_20HZ}},}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00359}00359     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga23c3fcde795e5aa2b141232d490c9ca7a798d2b86eafcf3fc7c7fe775f46cb4cb}{INV\_LPA\_40HZ}},}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00360}00360     INV\_LPA\_80HZ,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00361}00361     INV\_LPA\_160HZ,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00362}00362     INV\_LPA\_320HZ,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00363}00363     INV\_LPA\_640HZ}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00364}00364 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00365}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gga23c3fcde795e5aa2b141232d490c9ca7a798d2b86eafcf3fc7c7fe775f46cb4cb}{00365}} \};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00366}00366 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00367}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac52d7caf4efc485ef6faa1211bfe60dc}{00367}} \textcolor{preprocessor}{\#define BIT\_I2C\_MST\_VDDIO   (0x80)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00368}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gae3c4a18accb84992faaf2534a84a147c}{00368}} \textcolor{preprocessor}{\#define BIT\_FIFO\_EN         (0x40)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00369}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga02c3e9ddd63128f1c3cf50bf1e9b5fe6}{00369}} \textcolor{preprocessor}{\#define BIT\_DMP\_EN          (0x80)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00370}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaeae2cc64314ad05f3a93d2358a2369db}{00370}} \textcolor{preprocessor}{\#define BIT\_FIFO\_RST        (0x04)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00371}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga37d5ceb74c3568e4bab6dcdd0afaa95b}{00371}} \textcolor{preprocessor}{\#define BIT\_DMP\_RST         (0x08)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00372}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gafb9b49ce5dd973b3c29ae72680924fa7}{00372}} \textcolor{preprocessor}{\#define BIT\_FIFO\_OVERFLOW   (0x10)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00373}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga45eec9dbc46778c356703dcf90b9e0c3}{00373}} \textcolor{preprocessor}{\#define BIT\_DATA\_RDY\_EN     (0x01)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00374}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4dc5309ed09fc683d8e5a247feaad69d}{00374}} \textcolor{preprocessor}{\#define BIT\_DMP\_INT\_EN      (0x02)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00375}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6a8f2f7f3dd17bc05d9c6286d15c7ada}{00375}} \textcolor{preprocessor}{\#define BIT\_MOT\_INT\_EN      (0x40)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00376}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2d9aff1be96b1fc021ca96f251c3e72b}{00376}} \textcolor{preprocessor}{\#define BITS\_FSR            (0x18)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00377}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4d83411e736da86163a61828816a200a}{00377}} \textcolor{preprocessor}{\#define BITS\_LPF            (0x07)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00378}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3c9c0234d4a71c9d35bb0da64ea867eb}{00378}} \textcolor{preprocessor}{\#define BITS\_HPF            (0x07)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00379}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1823f90ac353cf4cde25d297a8627dd4}{00379}} \textcolor{preprocessor}{\#define BITS\_CLK            (0x07)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00380}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3769fd3fa71deaef1e77ce14c26f679d}{00380}} \textcolor{preprocessor}{\#define BIT\_FIFO\_SIZE\_1024  (0x40)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00381}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga0fa95b278851b0c05a9995f65ba2b895}{00381}} \textcolor{preprocessor}{\#define BIT\_FIFO\_SIZE\_2048  (0x80)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00382}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac067df9d789eaae04585abfc5ffdb2b6}{00382}} \textcolor{preprocessor}{\#define BIT\_FIFO\_SIZE\_4096  (0xC0)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00383}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf4ce49fd1fc9b1461b5241f9ef4812f4}{00383}} \textcolor{preprocessor}{\#define BIT\_RESET           (0x80)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00384}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1fed8bd436e9b7dfccb1cae99ca89103}{00384}} \textcolor{preprocessor}{\#define BIT\_SLEEP           (0x40)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00385}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac4b33689dd697c1cf2411638a017c009}{00385}} \textcolor{preprocessor}{\#define BIT\_S0\_DELAY\_EN     (0x01)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00386}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga22e4452fe8abca7fe12a2dc45194e6df}{00386}} \textcolor{preprocessor}{\#define BIT\_S2\_DELAY\_EN     (0x04)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00387}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gabc5c2ee59baeb02a0f761740466f3c28}{00387}} \textcolor{preprocessor}{\#define BITS\_SLAVE\_LENGTH   (0x0F)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00388}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5e8f3ccff1b3eeb95a938b207ca873ff}{00388}} \textcolor{preprocessor}{\#define BIT\_SLAVE\_BYTE\_SW   (0x40)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00389}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf616c3ecf97ffd7bde444f0b74e7453e}{00389}} \textcolor{preprocessor}{\#define BIT\_SLAVE\_GROUP     (0x10)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00390}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gae9440f48b6d70d900366dc040a8714d7}{00390}} \textcolor{preprocessor}{\#define BIT\_SLAVE\_EN        (0x80)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00391}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8ef1963ec6fb3df5586e50959cf00a70}{00391}} \textcolor{preprocessor}{\#define BIT\_I2C\_READ        (0x80)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00392}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab470b625fa05ff228b3fdb94802b1c0d}{00392}} \textcolor{preprocessor}{\#define BITS\_I2C\_MASTER\_DLY (0x1F)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00393}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gabcdedbd3098140aa14ad17bcaca8e176}{00393}} \textcolor{preprocessor}{\#define BIT\_AUX\_IF\_EN       (0x20)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00394}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8467782bedc44051c95643e303543655}{00394}} \textcolor{preprocessor}{\#define BIT\_ACTL            (0x80)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00395}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga588b5a95724c4a68c6868faa78fd3a7f}{00395}} \textcolor{preprocessor}{\#define BIT\_LATCH\_EN        (0x20)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00396}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1f50796ca0363292d9ac9cc1d29d9225}{00396}} \textcolor{preprocessor}{\#define BIT\_ANY\_RD\_CLR      (0x10)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00397}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gadd12a8d89e1a4c4e008b12a96dd4c75d}{00397}} \textcolor{preprocessor}{\#define BIT\_BYPASS\_EN       (0x02)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00398}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga75b1479e451b747afb3b24cbc4df99f7}{00398}} \textcolor{preprocessor}{\#define BITS\_WOM\_EN         (0xC0)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00399}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga63e6f23af37626aa1498d8c248f259e7}{00399}} \textcolor{preprocessor}{\#define BIT\_LPA\_CYCLE       (0x20)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00400}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacfc46ee2ea036d16b3df45c8fb241b5b}{00400}} \textcolor{preprocessor}{\#define BIT\_STBY\_XA         (0x20)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00401}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga49e6d38569bfc4b58ccc45dbb19001fa}{00401}} \textcolor{preprocessor}{\#define BIT\_STBY\_YA         (0x10)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00402}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gafac8114288bae2db7ea7dbf0f6fb755c}{00402}} \textcolor{preprocessor}{\#define BIT\_STBY\_ZA         (0x08)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00403}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga82256fedeffe5b2443ab3ae34cf032d9}{00403}} \textcolor{preprocessor}{\#define BIT\_STBY\_XG         (0x04)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00404}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gabf1c0a844906a5e887a659971a4af417}{00404}} \textcolor{preprocessor}{\#define BIT\_STBY\_YG         (0x02)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00405}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga30967a4efdf3c3f1e39814e72a4168b0}{00405}} \textcolor{preprocessor}{\#define BIT\_STBY\_ZG         (0x01)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00406}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga04a57159e34387dafe9b86b171c4654c}{00406}} \textcolor{preprocessor}{\#define BIT\_STBY\_XYZA       (BIT\_STBY\_XA | BIT\_STBY\_YA | BIT\_STBY\_ZA)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00407}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4e2ef22b94b90f9b83394dfe1f688ce4}{00407}} \textcolor{preprocessor}{\#define BIT\_STBY\_XYZG       (BIT\_STBY\_XG | BIT\_STBY\_YG | BIT\_STBY\_ZG)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00408}00408 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00409}00409 \textcolor{preprocessor}{\#if defined AK8975\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00410}00410 \textcolor{preprocessor}{\#define SUPPORTS\_AK89xx\_HIGH\_SENS   (0x00)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00411}00411 \textcolor{preprocessor}{\#define AK89xx\_FSR                  (9830)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00412}00412 \textcolor{preprocessor}{\#elif defined AK8963\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00413}00413 \textcolor{preprocessor}{\#define SUPPORTS\_AK89xx\_HIGH\_SENS   (0x10)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00414}00414 \textcolor{preprocessor}{\#define AK89xx\_FSR                  (4915)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00415}00415 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00416}00416 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00417}00417 \textcolor{preprocessor}{\#ifdef AK89xx\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00418}00418 \textcolor{preprocessor}{\#define AKM\_REG\_WHOAMI      (0x00)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00419}00419 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00420}00420 \textcolor{preprocessor}{\#define AKM\_REG\_ST1         (0x02)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00421}00421 \textcolor{preprocessor}{\#define AKM\_REG\_HXL         (0x03)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00422}00422 \textcolor{preprocessor}{\#define AKM\_REG\_ST2         (0x09)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00423}00423 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00424}00424 \textcolor{preprocessor}{\#define AKM\_REG\_CNTL        (0x0A)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00425}00425 \textcolor{preprocessor}{\#define AKM\_REG\_ASTC        (0x0C)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00426}00426 \textcolor{preprocessor}{\#define AKM\_REG\_ASAX        (0x10)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00427}00427 \textcolor{preprocessor}{\#define AKM\_REG\_ASAY        (0x11)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00428}00428 \textcolor{preprocessor}{\#define AKM\_REG\_ASAZ        (0x12)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00429}00429 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00430}00430 \textcolor{preprocessor}{\#define AKM\_DATA\_READY      (0x01)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00431}00431 \textcolor{preprocessor}{\#define AKM\_DATA\_OVERRUN    (0x02)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00432}00432 \textcolor{preprocessor}{\#define AKM\_OVERFLOW        (0x80)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00433}00433 \textcolor{preprocessor}{\#define AKM\_DATA\_ERROR      (0x40)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00434}00434 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00435}00435 \textcolor{preprocessor}{\#define AKM\_BIT\_SELF\_TEST   (0x40)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00436}00436 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00437}00437 \textcolor{preprocessor}{\#define AKM\_POWER\_DOWN          (0x00 | SUPPORTS\_AK89xx\_HIGH\_SENS)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00438}00438 \textcolor{preprocessor}{\#define AKM\_SINGLE\_MEASUREMENT  (0x01 | SUPPORTS\_AK89xx\_HIGH\_SENS)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00439}00439 \textcolor{preprocessor}{\#define AKM\_FUSE\_ROM\_ACCESS     (0x0F | SUPPORTS\_AK89xx\_HIGH\_SENS)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00440}00440 \textcolor{preprocessor}{\#define AKM\_MODE\_SELF\_TEST      (0x08 | SUPPORTS\_AK89xx\_HIGH\_SENS)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00441}00441 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00442}00442 \textcolor{preprocessor}{\#define AKM\_WHOAMI      (0x48)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00443}00443 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00444}00444 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00445}00445 \textcolor{preprocessor}{\#if defined MPU6050}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00446}00446 \textcolor{comment}{//const struct gyro\_reg\_s reg = \{}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00447}00447 \textcolor{comment}{//    .who\_am\_i       = 0x75,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00448}00448 \textcolor{comment}{//    .rate\_div       = 0x19,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00449}00449 \textcolor{comment}{//    .lpf            = 0x1A,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00450}00450 \textcolor{comment}{//    .prod\_id        = 0x0C,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00451}00451 \textcolor{comment}{//    .user\_ctrl      = 0x6A,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00452}00452 \textcolor{comment}{//    .fifo\_en        = 0x23,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00453}00453 \textcolor{comment}{//    .gyro\_cfg       = 0x1B,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00454}00454 \textcolor{comment}{//    .accel\_cfg      = 0x1C,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00455}00455 \textcolor{comment}{//    .motion\_thr     = 0x1F,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00456}00456 \textcolor{comment}{//    .motion\_dur     = 0x20,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00457}00457 \textcolor{comment}{//    .fifo\_count\_h   = 0x72,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00458}00458 \textcolor{comment}{//    .fifo\_r\_w       = 0x74,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00459}00459 \textcolor{comment}{//    .raw\_gyro       = 0x43,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00460}00460 \textcolor{comment}{//    .raw\_accel      = 0x3B,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00461}00461 \textcolor{comment}{//    .temp           = 0x41,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00462}00462 \textcolor{comment}{//    .int\_enable     = 0x38,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00463}00463 \textcolor{comment}{//    .dmp\_int\_status = 0x39,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00464}00464 \textcolor{comment}{//    .int\_status     = 0x3A,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00465}00465 \textcolor{comment}{//    .pwr\_mgmt\_1     = 0x6B,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00466}00466 \textcolor{comment}{//    .pwr\_mgmt\_2     = 0x6C,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00467}00467 \textcolor{comment}{//    .int\_pin\_cfg    = 0x37,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00468}00468 \textcolor{comment}{//    .mem\_r\_w        = 0x6F,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00469}00469 \textcolor{comment}{//    .accel\_offs     = 0x06,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00470}00470 \textcolor{comment}{//    .i2c\_mst        = 0x24,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00471}00471 \textcolor{comment}{//    .bank\_sel       = 0x6D,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00472}00472 \textcolor{comment}{//    .mem\_start\_addr = 0x6E,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00473}00473 \textcolor{comment}{//    .prgm\_start\_h   = 0x70}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00474}00474 \textcolor{comment}{//\#ifdef AK89xx\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00475}00475 \textcolor{comment}{//    ,.raw\_compass   = 0x49,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00476}00476 \textcolor{comment}{//    .yg\_offs\_tc     = 0x01,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00477}00477 \textcolor{comment}{//    .s0\_addr        = 0x25,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00478}00478 \textcolor{comment}{//    .s0\_reg         = 0x26,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00479}00479 \textcolor{comment}{//    .s0\_ctrl        = 0x27,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00480}00480 \textcolor{comment}{//    .s1\_addr        = 0x28,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00481}00481 \textcolor{comment}{//    .s1\_reg         = 0x29,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00482}00482 \textcolor{comment}{//    .s1\_ctrl        = 0x2A,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00483}00483 \textcolor{comment}{//    .s4\_ctrl        = 0x34,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00484}00484 \textcolor{comment}{//    .s0\_do          = 0x63,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00485}00485 \textcolor{comment}{//    .s1\_do          = 0x64,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00486}00486 \textcolor{comment}{//    .i2c\_delay\_ctrl = 0x67}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00487}00487 \textcolor{comment}{//\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00488}00488 \textcolor{comment}{//\};}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00489}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5448c351fc95ff052b110eee80e5f75c}{00489}} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structgyro__reg__s}{gyro\_reg\_s}} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5448c351fc95ff052b110eee80e5f75c}{reg}} = \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00490}00490 0x75,  \textcolor{comment}{//who\_am\_i}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00491}00491 0x19,  \textcolor{comment}{//rate\_div}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00492}00492 0x1A,  \textcolor{comment}{//lpf}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00493}00493 0x0C,  \textcolor{comment}{//prod\_id}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00494}00494 0x6A,  \textcolor{comment}{//user\_ctrl}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00495}00495 0x23,  \textcolor{comment}{//fifo\_en}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00496}00496 0x1B,  \textcolor{comment}{//gyro\_cfg}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00497}00497 0x1C,  \textcolor{comment}{//accel\_cfg}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00498}00498 0x1F,  \textcolor{comment}{// motion\_thr}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00499}00499 0x20,  \textcolor{comment}{// motion\_dur}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00500}00500 0x72,  \textcolor{comment}{// fifo\_count\_h}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00501}00501 0x74,  \textcolor{comment}{// fifo\_r\_w}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00502}00502 0x43,  \textcolor{comment}{// raw\_gyro}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00503}00503 0x3B,  \textcolor{comment}{// raw\_accel}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00504}00504 0x41,  \textcolor{comment}{// temp}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00505}00505 0x38,  \textcolor{comment}{// int\_enable}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00506}00506 0x39,  \textcolor{comment}{//  dmp\_int\_status}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00507}00507 0x3A,  \textcolor{comment}{//  int\_status}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00508}00508 0x6B,  \textcolor{comment}{// pwr\_mgmt\_1}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00509}00509 0x6C,  \textcolor{comment}{// pwr\_mgmt\_2}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00510}00510 0x37,  \textcolor{comment}{// int\_pin\_cfg}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00511}00511 0x6F,  \textcolor{comment}{// mem\_r\_w}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00512}00512 0x06,  \textcolor{comment}{// accel\_offs}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00513}00513 0x24,  \textcolor{comment}{// i2c\_mst}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00514}00514 0x6D,  \textcolor{comment}{// bank\_sel}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00515}00515 0x6E,  \textcolor{comment}{// mem\_start\_addr}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00516}00516 0x70   \textcolor{comment}{// prgm\_start\_h}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00517}00517 \};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00518}00518 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00519}00519 \textcolor{comment}{//const struct hw\_s hw = \{}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00520}00520 \textcolor{comment}{//    .addr           = 0x68,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00521}00521 \textcolor{comment}{//    .max\_fifo       = 1024,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00522}00522 \textcolor{comment}{//    .num\_reg        = 118,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00523}00523 \textcolor{comment}{//    .temp\_sens      = 340,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00524}00524 \textcolor{comment}{//    .temp\_offset    = -\/521,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00525}00525 \textcolor{comment}{//    .bank\_size      = 256}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00526}00526 \textcolor{comment}{//\#if defined AK89xx\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00527}00527 \textcolor{comment}{//    ,.compass\_fsr    = AK89xx\_FSR}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00528}00528 \textcolor{comment}{//\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00529}00529 \textcolor{comment}{//\};}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00530}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga7fefd0bb47e09b7e39e25e9795cd7edc}{00530}} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structhw__s}{hw\_s}} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga7fefd0bb47e09b7e39e25e9795cd7edc}{hw}}=\{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00531}00531   0x68,  \textcolor{comment}{//addr}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00532}00532   1024,  \textcolor{comment}{//max\_fifo}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00533}00533   118,   \textcolor{comment}{//num\_reg}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00534}00534   340,   \textcolor{comment}{//temp\_sens}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00535}00535   -\/521,  \textcolor{comment}{//temp\_offset}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00536}00536   256    \textcolor{comment}{//bank\_size}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00537}00537 \};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00538}00538 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00539}00539 \textcolor{comment}{//const struct test\_s test = \{}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00540}00540 \textcolor{comment}{//    .gyro\_sens      = 32768/250,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00541}00541 \textcolor{comment}{//    .accel\_sens     = 32768/16,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00542}00542 \textcolor{comment}{//    .reg\_rate\_div   = 0,    /* 1kHz. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00543}00543 \textcolor{comment}{//    .reg\_lpf        = 1,    /* 188Hz. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00544}00544 \textcolor{comment}{//    .reg\_gyro\_fsr   = 0,    /* 250dps. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00545}00545 \textcolor{comment}{//    .reg\_accel\_fsr  = 0x18, /* 16g. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00546}00546 \textcolor{comment}{//    .wait\_ms        = 50,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00547}00547 \textcolor{comment}{//    .packet\_thresh  = 5,    /* 5\% */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00548}00548 \textcolor{comment}{//    .min\_dps        = 10.f,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00549}00549 \textcolor{comment}{//    .max\_dps        = 105.f,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00550}00550 \textcolor{comment}{//    .max\_gyro\_var   = 0.14f,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00551}00551 \textcolor{comment}{//    .min\_g          = 0.3f,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00552}00552 \textcolor{comment}{//    .max\_g          = 0.95f,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00553}00553 \textcolor{comment}{//    .max\_accel\_var  = 0.14f}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00554}00554 \textcolor{comment}{//\};}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00555}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1e8f8b1ef7fb2c429e1ce7c2f9985530}{00555}} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structtest__s}{test\_s}} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1e8f8b1ef7fb2c429e1ce7c2f9985530}{test}}=\{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00556}00556 32768/250,       \textcolor{comment}{//gyro\_sens}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00557}00557 32768/16,        \textcolor{comment}{// accel\_sens}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00558}00558 0,               \textcolor{comment}{// reg\_rate\_div}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00559}00559 1,              \textcolor{comment}{//  reg\_lpf}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00560}00560 0,               \textcolor{comment}{// reg\_gyro\_fsr}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00561}00561 0x18,           \textcolor{comment}{//  reg\_accel\_fsr}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00562}00562 50,             \textcolor{comment}{//  wait\_ms}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00563}00563 5,              \textcolor{comment}{//  packet\_thresh}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00564}00564 10.0f,           \textcolor{comment}{// min\_dps}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00565}00565 105.0f,          \textcolor{comment}{// max\_dps}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00566}00566 0.14f,          \textcolor{comment}{//  max\_gyro\_var}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00567}00567 0.3f,          \textcolor{comment}{//   min\_g}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00568}00568 0.95f,         \textcolor{comment}{//   max\_g}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00569}00569 0.14f          \textcolor{comment}{//   max\_accel\_var}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00570}00570 \};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00571}00571 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00572}00572 \textcolor{comment}{//static struct gyro\_state\_s st = \{}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00573}00573 \textcolor{comment}{//    .reg = \&reg,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00574}00574 \textcolor{comment}{//    .hw = \&hw,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00575}00575 \textcolor{comment}{//    .test = \&test}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00576}00576 \textcolor{comment}{//\};}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00577}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{00577}} \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structgyro__state__s}{gyro\_state\_s}} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}=\{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00578}00578   \&\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5448c351fc95ff052b110eee80e5f75c}{reg}},}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00579}00579   \&\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga7fefd0bb47e09b7e39e25e9795cd7edc}{hw}},}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00580}00580   \{0\},}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00581}00581   \&\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1e8f8b1ef7fb2c429e1ce7c2f9985530}{test}}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00582}00582 \};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00583}00583 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00584}00584 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00585}00585 \textcolor{preprocessor}{\#elif defined MPU6500}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00586}00586 \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structgyro__reg__s}{gyro\_reg\_s}} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5448c351fc95ff052b110eee80e5f75c}{reg}} = \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00587}00587     .\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga51068a36efe9d2aedc9cb8fffacbf15b}{who\_am\_i}}       = 0x75,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00588}00588     .rate\_div       = 0x19,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00589}00589     .lpf            = 0x1A,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00590}00590     .prod\_id        = 0x0C,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00591}00591     .user\_ctrl      = 0x6A,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00592}00592     .fifo\_en        = 0x23,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00593}00593     .gyro\_cfg       = 0x1B,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00594}00594     .accel\_cfg      = 0x1C,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00595}00595     .accel\_cfg2     = 0x1D,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00596}00596     .lp\_accel\_odr   = 0x1E,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00597}00597     .motion\_thr     = 0x1F,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00598}00598     .motion\_dur     = 0x20,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00599}00599     .fifo\_count\_h   = 0x72,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00600}00600     .fifo\_r\_w       = 0x74,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00601}00601     .raw\_gyro       = 0x43,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00602}00602     .raw\_accel      = 0x3B,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00603}00603     .temp           = 0x41,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00604}00604     .int\_enable     = 0x38,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00605}00605     .dmp\_int\_status = 0x39,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00606}00606     .int\_status     = 0x3A,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00607}00607     .accel\_intel    = 0x69,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00608}00608     .pwr\_mgmt\_1     = 0x6B,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00609}00609     .pwr\_mgmt\_2     = 0x6C,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00610}00610     .int\_pin\_cfg    = 0x37,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00611}00611     .mem\_r\_w        = 0x6F,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00612}00612     .accel\_offs     = 0x77,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00613}00613     .i2c\_mst        = 0x24,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00614}00614     .bank\_sel       = 0x6D,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00615}00615     .mem\_start\_addr = 0x6E,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00616}00616     .prgm\_start\_h   = 0x70}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00617}00617 \textcolor{preprocessor}{\#ifdef AK89xx\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00618}00618     ,.raw\_compass   = 0x49,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00619}00619     .s0\_addr        = 0x25,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00620}00620     .s0\_reg         = 0x26,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00621}00621     .s0\_ctrl        = 0x27,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00622}00622     .s1\_addr        = 0x28,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00623}00623     .s1\_reg         = 0x29,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00624}00624     .s1\_ctrl        = 0x2A,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00625}00625     .s4\_ctrl        = 0x34,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00626}00626     .s0\_do          = 0x63,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00627}00627     .s1\_do          = 0x64,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00628}00628     .i2c\_delay\_ctrl = 0x67}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00629}00629 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00630}00630 \};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00631}00631 \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structhw__s}{hw\_s}} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga7fefd0bb47e09b7e39e25e9795cd7edc}{hw}} = \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00632}00632     .\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}           = 0x68,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00633}00633     .max\_fifo       = 1024,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00634}00634     .num\_reg        = 128,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00635}00635     .temp\_sens      = 321,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00636}00636     .temp\_offset    = 0,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00637}00637     .bank\_size      = 256}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00638}00638 \textcolor{preprocessor}{\#if defined AK89xx\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00639}00639     ,.compass\_fsr    = AK89xx\_FSR}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00640}00640 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00641}00641 \};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00642}00642 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00643}00643 \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structtest__s}{test\_s}} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1e8f8b1ef7fb2c429e1ce7c2f9985530}{test}} = \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00644}00644     .\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga330290a347407b0d92b1d77aa274993c}{gyro\_sens}}      = 32768/250,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00645}00645     .accel\_sens     = 32768/16,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00646}00646     .reg\_rate\_div   = 0,    \textcolor{comment}{/* 1kHz. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00647}00647     .reg\_lpf        = 1,    \textcolor{comment}{/* 188Hz. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00648}00648     .reg\_gyro\_fsr   = 0,    \textcolor{comment}{/* 250dps. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00649}00649     .reg\_accel\_fsr  = 0x18, \textcolor{comment}{/* 16g. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00650}00650     .wait\_ms        = 50,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00651}00651     .packet\_thresh  = 5,    \textcolor{comment}{/* 5\% */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00652}00652     .min\_dps        = 10.f,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00653}00653     .max\_dps        = 105.f,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00654}00654     .max\_gyro\_var   = 0.14f,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00655}00655     .min\_g          = 0.3f,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00656}00656     .max\_g          = 0.95f,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00657}00657     .max\_accel\_var  = 0.14f}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00658}00658 \};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00659}00659 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00660}00660 \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structgyro__state__s}{gyro\_state\_s}} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}} = \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00661}00661     .\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}} = \&\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5448c351fc95ff052b110eee80e5f75c}{reg}},}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00662}00662     .hw = \&\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga7fefd0bb47e09b7e39e25e9795cd7edc}{hw}},}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00663}00663     .test = \&\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1e8f8b1ef7fb2c429e1ce7c2f9985530}{test}}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00664}00664 \};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00665}00665 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00666}00666 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00667}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga973c680573b37fc359fc68d0707da355}{00667}} \textcolor{preprocessor}{\#define MAX\_PACKET\_LENGTH (12)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00668}00668 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00669}00669 \textcolor{preprocessor}{\#ifdef AK89xx\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00670}00670 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4764ce0ba4e07a4c774f69ab3b83d1f9}{setup\_compass}}(\textcolor{keywordtype}{void});}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00671}00671 \textcolor{preprocessor}{\#define MAX\_COMPASS\_SAMPLE\_RATE (100)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00672}00672 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00673}00673 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00681}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gafd5ebff6b0179e1dce0b68c2272cae07}{00681}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gafd5ebff6b0179e1dce0b68c2272cae07}{set\_int\_enable}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} enable)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00682}00682 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00683}00683     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} tmp;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00684}00684 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00685}00685     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4783ed8aa79a3b5de798963819997c38}{dmp\_on}}) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00686}00686         \textcolor{keywordflow}{if} (enable)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00687}00687             tmp = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4dc5309ed09fc683d8e5a247feaad69d}{BIT\_DMP\_INT\_EN}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00688}00688         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00689}00689             tmp = 0x00;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00690}00690         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga48b47844d4b0570e60aa6806faa59eae}{int\_enable}}, 1, \&tmp))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00691}00691             \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00692}00692         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa366c36057f31e6e0d4cf2ca4a1ef52f}{int\_enable}} = tmp;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00693}00693     \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00694}00694         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa996fc14aa630e53823462baf460c13f}{sensors}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00695}00695             \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00696}00696         \textcolor{keywordflow}{if} (enable \&\& \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa366c36057f31e6e0d4cf2ca4a1ef52f}{int\_enable}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00697}00697             \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00698}00698         \textcolor{keywordflow}{if} (enable)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00699}00699             tmp = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga45eec9dbc46778c356703dcf90b9e0c3}{BIT\_DATA\_RDY\_EN}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00700}00700         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00701}00701             tmp = 0x00;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00702}00702         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga48b47844d4b0570e60aa6806faa59eae}{int\_enable}}, 1, \&tmp))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00703}00703             \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00704}00704         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa366c36057f31e6e0d4cf2ca4a1ef52f}{int\_enable}} = tmp;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00705}00705     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00706}00706     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00707}00707 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00708}00708 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00713}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga0e1201ecfd8453f1d89e4299528baaf6}{00713}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga0e1201ecfd8453f1d89e4299528baaf6}{mpu\_reg\_dump}}(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00714}00714 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00715}00715     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} ii;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00716}00716     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} data;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00717}00717 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00718}00718     \textcolor{keywordflow}{for} (ii = 0; ii < \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1039fa66b110194727938cd86be8c3c5}{num\_reg}}; ii++) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00719}00719         \textcolor{keywordflow}{if} (ii == \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb6763dc5f368ea01ef7c733cea9dab4}{fifo\_r\_w}} || ii == \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gae17166b43fa12a960c0eced9a3c04bf0}{mem\_r\_w}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00720}00720             \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00721}00721         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga838d8f1c7b0d8cc83923b93bbafe1b33}{i2c\_read}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, ii, 1, \&data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00722}00722             \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00723}00723         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2905fba7885cd95057e1655cb4d16bda}{log\_i}}(\textcolor{stringliteral}{"{}\%\#5x: \%\#5x\(\backslash\)r\(\backslash\)n"{}}, ii, data);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00724}00724     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00725}00725     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00726}00726 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00727}00727 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00735}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5c35a3363337014e11769a0ea7c0dfa9}{00735}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5c35a3363337014e11769a0ea7c0dfa9}{mpu\_read\_reg}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5448c351fc95ff052b110eee80e5f75c}{reg}}, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} *data)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00736}00736 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00737}00737     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5448c351fc95ff052b110eee80e5f75c}{reg}} == \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb6763dc5f368ea01ef7c733cea9dab4}{fifo\_r\_w}} || \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5448c351fc95ff052b110eee80e5f75c}{reg}} == \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gae17166b43fa12a960c0eced9a3c04bf0}{mem\_r\_w}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00738}00738         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00739}00739     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5448c351fc95ff052b110eee80e5f75c}{reg}} >= \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1039fa66b110194727938cd86be8c3c5}{num\_reg}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00740}00740         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00741}00741     \textcolor{keywordflow}{return} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga838d8f1c7b0d8cc83923b93bbafe1b33}{i2c\_read}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5448c351fc95ff052b110eee80e5f75c}{reg}}, 1, data);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00742}00742 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00743}00743 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00757}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac48a36b51e23bc4191ec13916bbb9d0b}{00757}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gac48a36b51e23bc4191ec13916bbb9d0b}{mpu\_init}}(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00758}00758 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00759}00759     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} data[6], rev;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00760}00760 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00761}00761     \textcolor{comment}{/* Reset device. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00762}00762     data[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf4ce49fd1fc9b1461b5241f9ef4812f4}{BIT\_RESET}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00763}00763     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa01fb0872030e8e2932f8d1d257ea86a}{pwr\_mgmt\_1}}, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00764}00764         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00765}00765     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gae36aca5baf9b6b7d74992aef00686d67}{delay\_ms}}(100);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00766}00766 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00767}00767     \textcolor{comment}{/* Wake up chip. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00768}00768     data[0] = 0x00;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00769}00769     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa01fb0872030e8e2932f8d1d257ea86a}{pwr\_mgmt\_1}}, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00770}00770         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00771}00771 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00772}00772 \textcolor{preprocessor}{\#if defined MPU6050}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00773}00773     \textcolor{comment}{/* Check product revision. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00774}00774     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga838d8f1c7b0d8cc83923b93bbafe1b33}{i2c\_read}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab745dd73e0c3ef01f30f96444358cb89}{accel\_offs}}, 6, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00775}00775         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00776}00776     rev = ((data[5] \& 0x01) << 2) | ((data[3] \& 0x01) << 1) |}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00777}00777         (data[1] \& 0x01);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00778}00778 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00779}00779     \textcolor{keywordflow}{if} (rev) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00780}00780         \textcolor{comment}{/* Congrats, these parts are better. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00781}00781         \textcolor{keywordflow}{if} (rev == 1)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00782}00782             \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab72e3cead391dee41f28e041282d743f}{accel\_half}} = 1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00783}00783         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (rev == 2)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00784}00784             \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab72e3cead391dee41f28e041282d743f}{accel\_half}} = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00785}00785         \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00786}00786             \mbox{\hyperlink{group___d_r_i_v_e_r_s_gab354affc295f7d61fe8a355c9361cc5a}{log\_e}}(\textcolor{stringliteral}{"{}Unsupported software product rev \%d.\(\backslash\)n"{}}, rev);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00787}00787             \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00788}00788         \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00789}00789     \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00790}00790         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga838d8f1c7b0d8cc83923b93bbafe1b33}{i2c\_read}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf418d8a6b0e262df54ab8a6a5228011c}{prod\_id}}, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00791}00791             \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00792}00792         rev = data[0] \& 0x0F;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00793}00793         \textcolor{keywordflow}{if} (!rev) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00794}00794             \mbox{\hyperlink{group___d_r_i_v_e_r_s_gab354affc295f7d61fe8a355c9361cc5a}{log\_e}}(\textcolor{stringliteral}{"{}Product ID read as 0 indicates device is either "{}}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00795}00795                 \textcolor{stringliteral}{"{}incompatible or an MPU3050.\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00796}00796             \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00797}00797         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (rev == 4) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00798}00798             \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2905fba7885cd95057e1655cb4d16bda}{log\_i}}(\textcolor{stringliteral}{"{}Half sensitivity part found.\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00799}00799             \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab72e3cead391dee41f28e041282d743f}{accel\_half}} = 1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00800}00800         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00801}00801             \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab72e3cead391dee41f28e041282d743f}{accel\_half}} = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00802}00802     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00803}00803 \textcolor{preprocessor}{\#elif defined MPU6500}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00804}00804 \textcolor{preprocessor}{\#define MPU6500\_MEM\_REV\_ADDR    (0x17)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00805}00805     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3374bececb6743893c9eab27645c1182}{mpu\_read\_mem}}(MPU6500\_MEM\_REV\_ADDR, 1, \&rev))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00806}00806         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00807}00807     \textcolor{keywordflow}{if} (rev == 0x1)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00808}00808         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab72e3cead391dee41f28e041282d743f}{accel\_half}} = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00809}00809     \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00810}00810         \mbox{\hyperlink{group___d_r_i_v_e_r_s_gab354affc295f7d61fe8a355c9361cc5a}{log\_e}}(\textcolor{stringliteral}{"{}Unsupported software product rev \%d.\(\backslash\)n"{}}, rev);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00811}00811         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00812}00812     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00813}00813 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00814}00814     \textcolor{comment}{/* MPU6500 shares 4kB of memory between the DMP and the FIFO. Since the}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00815}00815 \textcolor{comment}{     * first 3kB are needed by the DMP, we'll use the last 1kB for the FIFO.}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00816}00816 \textcolor{comment}{     */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00817}00817     data[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3769fd3fa71deaef1e77ce14c26f679d}{BIT\_FIFO\_SIZE\_1024}} | 0x8;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00818}00818     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>accel\_cfg2, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00819}00819         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00820}00820 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00821}00821 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00822}00822     \textcolor{comment}{/* Set to invalid values to ensure no I2C writes are skipped. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00823}00823     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa996fc14aa630e53823462baf460c13f}{sensors}} = 0xFF;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00824}00824     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab45a727aeee17380828a3e20ccb375c2}{gyro\_fsr}} = 0xFF;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00825}00825     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf66873be1446ed552812e32d40eced61}{accel\_fsr}} = 0xFF;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00826}00826     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga16ec8ca8298f62ac01419775377270fb}{lpf}} = 0xFF;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00827}00827     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2660470fcf7b53e2e832a397cbe6c354}{sample\_rate}} = 0xFFFF;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00828}00828     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga88143c31b894bcd819c0e49b0ff267aa}{fifo\_enable}} = 0xFF;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00829}00829     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6d3a962d6435644c7ea68e7d65934636}{bypass\_mode}} = 0xFF;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00830}00830 \textcolor{preprocessor}{\#ifdef AK89xx\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00831}00831     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.compass\_sample\_rate = 0xFFFF;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00832}00832 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00833}00833     \textcolor{comment}{/* mpu\_set\_sensors always preserves this setting. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00834}00834     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab7bd5165d6e62cb0d814cf3401958445}{clk\_src}} = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga75570f009627c6f4ddfb2d936d81e207a01b240917a78674d3e387110a6a8f94c}{INV\_CLK\_PLL}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00835}00835     \textcolor{comment}{/* Handled in next call to mpu\_set\_bypass. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00836}00836     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6f12e54ae8c7f2dd77954f3ab619bbb9}{active\_low\_int}} = 1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00837}00837     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga55ce40fc460a62829ec149edaccffe7c}{latched\_int}} = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00838}00838     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga279cd5d5d78890357f2d42905d7471df}{int\_motion\_only}} = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00839}00839     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga33e138d8a49744eb9b4ea0e9086cef1c}{lp\_accel\_mode}} = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00840}00840     memset(\&\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gadf3b491a068e0225a080821516353bac}{cache}}, 0, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gadf3b491a068e0225a080821516353bac}{cache}}));}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00841}00841     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4783ed8aa79a3b5de798963819997c38}{dmp\_on}} = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00842}00842     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1d2ff55e17aae1459dfad61d76054b1b}{dmp\_loaded}} = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00843}00843     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5f42b7e1e740f2fb64427417e9e2dab7}{dmp\_sample\_rate}} = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00844}00844 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00845}00845     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gad09e6031c8677adc0b8a39b6deea8e27}{mpu\_set\_gyro\_fsr}}(2000))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00846}00846         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00847}00847     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2713a96af104cfb2ae8e0ed4c3718119}{mpu\_set\_accel\_fsr}}(2))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00848}00848         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00849}00849     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5661a9dee25152166769910767a2a93d}{mpu\_set\_lpf}}(42))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00850}00850         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00851}00851     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga0144d666a67a82888b8580002afe8b55}{mpu\_set\_sample\_rate}}(50))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00852}00852         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00853}00853     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gababbdda287e1f19323489f90a0889dd7}{mpu\_configure\_fifo}}(0))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00854}00854         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00855}00855 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00856}00856 \textcolor{comment}{//    if (int\_param)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00857}00857 \textcolor{comment}{//        reg\_int\_cb(int\_param);}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00858}00858 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00859}00859 \textcolor{preprocessor}{\#ifdef AK89xx\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00860}00860     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4764ce0ba4e07a4c774f69ab3b83d1f9}{setup\_compass}}();}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00861}00861     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga78da3828de0ef9d080c4d03e7bc45e7b}{mpu\_set\_compass\_sample\_rate}}(10))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00862}00862         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00863}00863 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00864}00864     \textcolor{comment}{/* Already disabled by setup\_compass. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00865}00865     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga36f70f38371b48d81094d3b061233e15}{mpu\_set\_bypass}}(0))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00866}00866         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00867}00867 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00868}00868 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00869}00869     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6e77e7cc1cf6be5e8fdf617c5b4586d1}{mpu\_set\_sensors}}(0);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00870}00870     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00871}00871 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00872}00872 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00888}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3a4fea75686ab7d2e68634e81ccac04c}{00888}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3a4fea75686ab7d2e68634e81ccac04c}{mpu\_lp\_accel\_mode}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} rate)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00889}00889 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00890}00890     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} tmp[2];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00891}00891 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00892}00892     \textcolor{keywordflow}{if} (rate > 40)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00893}00893         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00894}00894 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00895}00895     \textcolor{keywordflow}{if} (!rate) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00896}00896         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga653cb855300bff9285ce4b8dca6a503b}{mpu\_set\_int\_latched}}(0);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00897}00897         tmp[0] = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00898}00898         tmp[1] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4e2ef22b94b90f9b83394dfe1f688ce4}{BIT\_STBY\_XYZG}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00899}00899         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa01fb0872030e8e2932f8d1d257ea86a}{pwr\_mgmt\_1}}, 2, tmp))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00900}00900             \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00901}00901         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga33e138d8a49744eb9b4ea0e9086cef1c}{lp\_accel\_mode}} = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00902}00902         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00903}00903     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00904}00904     \textcolor{comment}{/* For LP accel, we automatically configure the hardware to produce latched}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00905}00905 \textcolor{comment}{     * interrupts. In LP accel mode, the hardware cycles into sleep mode before}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00906}00906 \textcolor{comment}{     * it gets a chance to deassert the interrupt pin; therefore, we shift this}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00907}00907 \textcolor{comment}{     * responsibility over to the MCU.}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00908}00908 \textcolor{comment}{     *}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00909}00909 \textcolor{comment}{     * Any register read will clear the interrupt.}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00910}00910 \textcolor{comment}{     */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00911}00911     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga653cb855300bff9285ce4b8dca6a503b}{mpu\_set\_int\_latched}}(1);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00912}00912 \textcolor{preprocessor}{\#if defined MPU6050}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00913}00913     tmp[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga63e6f23af37626aa1498d8c248f259e7}{BIT\_LPA\_CYCLE}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00914}00914     \textcolor{keywordflow}{if} (rate == 1) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00915}00915         tmp[1] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga23c3fcde795e5aa2b141232d490c9ca7ab44c7d0127a9466747853533a537b567}{INV\_LPA\_1\_25HZ}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00916}00916         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5661a9dee25152166769910767a2a93d}{mpu\_set\_lpf}}(5);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00917}00917     \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (rate <= 5) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00918}00918         tmp[1] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga23c3fcde795e5aa2b141232d490c9ca7a474cac76bff369dd656cc973207a1ca5}{INV\_LPA\_5HZ}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00919}00919         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5661a9dee25152166769910767a2a93d}{mpu\_set\_lpf}}(5);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00920}00920     \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (rate <= 20) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00921}00921         tmp[1] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga23c3fcde795e5aa2b141232d490c9ca7accaaf47c58dfe32cbf2ffa11fdb83108}{INV\_LPA\_20HZ}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00922}00922         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5661a9dee25152166769910767a2a93d}{mpu\_set\_lpf}}(10);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00923}00923     \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00924}00924         tmp[1] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga23c3fcde795e5aa2b141232d490c9ca7a798d2b86eafcf3fc7c7fe775f46cb4cb}{INV\_LPA\_40HZ}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00925}00925         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5661a9dee25152166769910767a2a93d}{mpu\_set\_lpf}}(20);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00926}00926     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00927}00927     tmp[1] = (tmp[1] << 6) | \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4e2ef22b94b90f9b83394dfe1f688ce4}{BIT\_STBY\_XYZG}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00928}00928     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa01fb0872030e8e2932f8d1d257ea86a}{pwr\_mgmt\_1}}, 2, tmp))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00929}00929         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00930}00930 \textcolor{preprocessor}{\#elif defined MPU6500}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00931}00931     \textcolor{comment}{/* Set wake frequency. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00932}00932     \textcolor{keywordflow}{if} (rate == 1)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00933}00933         tmp[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga23c3fcde795e5aa2b141232d490c9ca7ab44c7d0127a9466747853533a537b567}{INV\_LPA\_1\_25HZ}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00934}00934     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (rate == 2)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00935}00935         tmp[0] = INV\_LPA\_2\_5HZ;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00936}00936     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (rate <= 5)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00937}00937         tmp[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga23c3fcde795e5aa2b141232d490c9ca7a474cac76bff369dd656cc973207a1ca5}{INV\_LPA\_5HZ}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00938}00938     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (rate <= 10)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00939}00939         tmp[0] = INV\_LPA\_10HZ;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00940}00940     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (rate <= 20)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00941}00941         tmp[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga23c3fcde795e5aa2b141232d490c9ca7accaaf47c58dfe32cbf2ffa11fdb83108}{INV\_LPA\_20HZ}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00942}00942     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (rate <= 40)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00943}00943         tmp[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga23c3fcde795e5aa2b141232d490c9ca7a798d2b86eafcf3fc7c7fe775f46cb4cb}{INV\_LPA\_40HZ}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00944}00944     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (rate <= 80)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00945}00945         tmp[0] = INV\_LPA\_80HZ;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00946}00946     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (rate <= 160)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00947}00947         tmp[0] = INV\_LPA\_160HZ;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00948}00948     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (rate <= 320)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00949}00949         tmp[0] = INV\_LPA\_320HZ;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00950}00950     \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00951}00951         tmp[0] = INV\_LPA\_640HZ;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00952}00952     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>lp\_accel\_odr, 1, tmp))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00953}00953         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00954}00954     tmp[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga63e6f23af37626aa1498d8c248f259e7}{BIT\_LPA\_CYCLE}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00955}00955     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa01fb0872030e8e2932f8d1d257ea86a}{pwr\_mgmt\_1}}, 1, tmp))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00956}00956         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00957}00957 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00958}00958     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa996fc14aa630e53823462baf460c13f}{sensors}} = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa03f025a17ed491e70b88274e89c75c5}{INV\_XYZ\_ACCEL}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00959}00959     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab7bd5165d6e62cb0d814cf3401958445}{clk\_src}} = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00960}00960     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga33e138d8a49744eb9b4ea0e9086cef1c}{lp\_accel\_mode}} = 1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00961}00961     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gababbdda287e1f19323489f90a0889dd7}{mpu\_configure\_fifo}}(0);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00962}00962 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00963}00963     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00964}00964 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00965}00965 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00972}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5555854590ad11495c0e30401294bae2}{00972}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5555854590ad11495c0e30401294bae2}{mpu\_get\_gyro\_reg}}(\textcolor{keywordtype}{short} *data, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} *timestamp)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00973}00973 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00974}00974     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} tmp[6];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00975}00975 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00976}00976     \textcolor{keywordflow}{if} (!(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa996fc14aa630e53823462baf460c13f}{sensors}} \& \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3fdc30f9c0a26c2c4e2bb88921f91629}{INV\_XYZ\_GYRO}}))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00977}00977         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00978}00978 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00979}00979     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga838d8f1c7b0d8cc83923b93bbafe1b33}{i2c\_read}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab5c2246c44bb36b21596fe5acf7ec0d4}{raw\_gyro}}, 6, tmp))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00980}00980         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00981}00981     data[0] = (tmp[0] << 8) | tmp[1];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00982}00982     data[1] = (tmp[2] << 8) | tmp[3];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00983}00983     data[2] = (tmp[4] << 8) | tmp[5];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00984}00984     \textcolor{keywordflow}{if} (timestamp)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00985}00985         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3e6b6bc6d1cd2956353a31bfadd3c332}{get\_ms}}(timestamp);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00986}00986     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00987}00987 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00988}00988 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00995}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gae4ae960e5df78049ece2647772a3d809}{00995}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gae4ae960e5df78049ece2647772a3d809}{mpu\_get\_accel\_reg}}(\textcolor{keywordtype}{short} *data, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} *timestamp)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00996}00996 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00997}00997     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} tmp[6];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00998}00998 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l00999}00999     \textcolor{keywordflow}{if} (!(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa996fc14aa630e53823462baf460c13f}{sensors}} \& \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa03f025a17ed491e70b88274e89c75c5}{INV\_XYZ\_ACCEL}}))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01000}01000         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01001}01001 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01002}01002     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga838d8f1c7b0d8cc83923b93bbafe1b33}{i2c\_read}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga9b7c162cea6a3deeaac41444c613b7bc}{raw\_accel}}, 6, tmp))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01003}01003         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01004}01004     data[0] = (tmp[0] << 8) | tmp[1];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01005}01005     data[1] = (tmp[2] << 8) | tmp[3];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01006}01006     data[2] = (tmp[4] << 8) | tmp[5];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01007}01007     \textcolor{keywordflow}{if} (timestamp)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01008}01008         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3e6b6bc6d1cd2956353a31bfadd3c332}{get\_ms}}(timestamp);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01009}01009     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01010}01010 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01011}01011 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01018}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa449b565a157b4b8ca0f491b7ed46018}{01018}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa449b565a157b4b8ca0f491b7ed46018}{mpu\_get\_temperature}}(\textcolor{keywordtype}{long} *data, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} *timestamp)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01019}01019 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01020}01020     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} tmp[2];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01021}01021     \textcolor{keywordtype}{short} raw;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01022}01022 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01023}01023     \textcolor{keywordflow}{if} (!(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa996fc14aa630e53823462baf460c13f}{sensors}}))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01024}01024         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01025}01025 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01026}01026     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga838d8f1c7b0d8cc83923b93bbafe1b33}{i2c\_read}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga47674fab0681811c1b733462944e0233}{temp}}, 2, tmp))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01027}01027         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01028}01028     raw = (tmp[0] << 8) | tmp[1];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01029}01029     \textcolor{keywordflow}{if} (timestamp)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01030}01030         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3e6b6bc6d1cd2956353a31bfadd3c332}{get\_ms}}(timestamp);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01031}01031 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01032}01032     data[0] = (long)((35 + ((raw -\/ (\textcolor{keywordtype}{float})\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga56f98c91a7c4d60ccea1ade1f3e88d04}{temp\_offset}}) / \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab2397f792a86b32b0957c24e3912bc63}{temp\_sens}})) * 65536L);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01033}01033     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01034}01034 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01035}01035 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01043}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4968cc2ec80f0da0d72436551c81f134}{01043}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4968cc2ec80f0da0d72436551c81f134}{mpu\_set\_accel\_bias}}(\textcolor{keyword}{const} \textcolor{keywordtype}{long} *accel\_bias)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01044}01044 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01045}01045     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} data[6];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01046}01046     \textcolor{keywordtype}{short} accel\_hw[3];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01047}01047     \textcolor{keywordtype}{short} got\_accel[3];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01048}01048     \textcolor{keywordtype}{short} fg[3];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01049}01049 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01050}01050     \textcolor{keywordflow}{if} (!accel\_bias)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01051}01051         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01052}01052     \textcolor{keywordflow}{if} (!accel\_bias[0] \&\& !accel\_bias[1] \&\& !accel\_bias[2])}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01053}01053         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01054}01054 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01055}01055     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga838d8f1c7b0d8cc83923b93bbafe1b33}{i2c\_read}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, 3, 3, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01056}01056         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01057}01057     fg[0] = ((data[0] >> 4) + 8) \& 0xf;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01058}01058     fg[1] = ((data[1] >> 4) + 8) \& 0xf;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01059}01059     fg[2] = ((data[2] >> 4) + 8) \& 0xf;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01060}01060 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01061}01061     accel\_hw[0] = (short)(accel\_bias[0] * 2 / (64 + fg[0]));}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01062}01062     accel\_hw[1] = (short)(accel\_bias[1] * 2 / (64 + fg[1]));}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01063}01063     accel\_hw[2] = (short)(accel\_bias[2] * 2 / (64 + fg[2]));}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01064}01064 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01065}01065     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga838d8f1c7b0d8cc83923b93bbafe1b33}{i2c\_read}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, 0x06, 6, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01066}01066         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01067}01067 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01068}01068     got\_accel[0] = ((short)data[0] << 8) | data[1];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01069}01069     got\_accel[1] = ((short)data[2] << 8) | data[3];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01070}01070     got\_accel[2] = ((short)data[4] << 8) | data[5];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01071}01071 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01072}01072     accel\_hw[0] += got\_accel[0];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01073}01073     accel\_hw[1] += got\_accel[1];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01074}01074     accel\_hw[2] += got\_accel[2];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01075}01075 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01076}01076     data[0] = (accel\_hw[0] >> 8) \& 0xff;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01077}01077     data[1] = (accel\_hw[0]) \& 0xff;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01078}01078     data[2] = (accel\_hw[1] >> 8) \& 0xff;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01079}01079     data[3] = (accel\_hw[1]) \& 0xff;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01080}01080     data[4] = (accel\_hw[2] >> 8) \& 0xff;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01081}01081     data[5] = (accel\_hw[2]) \& 0xff;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01082}01082 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01083}01083     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, 0x06, 6, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01084}01084         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01085}01085     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01086}01086 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01087}01087 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01092}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf23e9f57c0059be6ec57862f0584de10}{01092}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf23e9f57c0059be6ec57862f0584de10}{mpu\_reset\_fifo}}(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01093}01093 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01094}01094     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} data;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01095}01095 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01096}01096     \textcolor{keywordflow}{if} (!(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa996fc14aa630e53823462baf460c13f}{sensors}}))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01097}01097         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01098}01098 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01099}01099     data = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01100}01100     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga48b47844d4b0570e60aa6806faa59eae}{int\_enable}}, 1, \&data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01101}01101         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01102}01102     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6a392b7ecae843c734db3d832f11af49}{fifo\_en}}, 1, \&data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01103}01103         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01104}01104     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga12505a7d8cd7c976e5571f27a6160d23}{user\_ctrl}}, 1, \&data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01105}01105         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01106}01106 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01107}01107     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4783ed8aa79a3b5de798963819997c38}{dmp\_on}}) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01108}01108         data = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaeae2cc64314ad05f3a93d2358a2369db}{BIT\_FIFO\_RST}} | \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga37d5ceb74c3568e4bab6dcdd0afaa95b}{BIT\_DMP\_RST}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01109}01109         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga12505a7d8cd7c976e5571f27a6160d23}{user\_ctrl}}, 1, \&data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01110}01110             \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01111}01111         \mbox{\hyperlink{group___d_r_i_v_e_r_s_gae36aca5baf9b6b7d74992aef00686d67}{delay\_ms}}(50);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01112}01112         data = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga02c3e9ddd63128f1c3cf50bf1e9b5fe6}{BIT\_DMP\_EN}} | \mbox{\hyperlink{group___d_r_i_v_e_r_s_gae3c4a18accb84992faaf2534a84a147c}{BIT\_FIFO\_EN}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01113}01113         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa996fc14aa630e53823462baf460c13f}{sensors}} \& \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga7fc9c1dbdcb2ac8cc2a4128a5799482a}{INV\_XYZ\_COMPASS}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01114}01114             data |= \mbox{\hyperlink{group___d_r_i_v_e_r_s_gabcdedbd3098140aa14ad17bcaca8e176}{BIT\_AUX\_IF\_EN}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01115}01115         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga12505a7d8cd7c976e5571f27a6160d23}{user\_ctrl}}, 1, \&data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01116}01116             \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01117}01117         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa366c36057f31e6e0d4cf2ca4a1ef52f}{int\_enable}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01118}01118             data = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4dc5309ed09fc683d8e5a247feaad69d}{BIT\_DMP\_INT\_EN}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01119}01119         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01120}01120             data = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01121}01121         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga48b47844d4b0570e60aa6806faa59eae}{int\_enable}}, 1, \&data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01122}01122             \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01123}01123         data = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01124}01124         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6a392b7ecae843c734db3d832f11af49}{fifo\_en}}, 1, \&data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01125}01125             \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01126}01126     \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01127}01127         data = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaeae2cc64314ad05f3a93d2358a2369db}{BIT\_FIFO\_RST}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01128}01128         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga12505a7d8cd7c976e5571f27a6160d23}{user\_ctrl}}, 1, \&data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01129}01129             \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01130}01130         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6d3a962d6435644c7ea68e7d65934636}{bypass\_mode}} || !(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa996fc14aa630e53823462baf460c13f}{sensors}} \& \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga7fc9c1dbdcb2ac8cc2a4128a5799482a}{INV\_XYZ\_COMPASS}}))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01131}01131             data = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gae3c4a18accb84992faaf2534a84a147c}{BIT\_FIFO\_EN}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01132}01132         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01133}01133             data = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gae3c4a18accb84992faaf2534a84a147c}{BIT\_FIFO\_EN}} | \mbox{\hyperlink{group___d_r_i_v_e_r_s_gabcdedbd3098140aa14ad17bcaca8e176}{BIT\_AUX\_IF\_EN}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01134}01134         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga12505a7d8cd7c976e5571f27a6160d23}{user\_ctrl}}, 1, \&data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01135}01135             \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01136}01136         \mbox{\hyperlink{group___d_r_i_v_e_r_s_gae36aca5baf9b6b7d74992aef00686d67}{delay\_ms}}(50);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01137}01137         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa366c36057f31e6e0d4cf2ca4a1ef52f}{int\_enable}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01138}01138             data = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga45eec9dbc46778c356703dcf90b9e0c3}{BIT\_DATA\_RDY\_EN}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01139}01139         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01140}01140             data = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01141}01141         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga48b47844d4b0570e60aa6806faa59eae}{int\_enable}}, 1, \&data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01142}01142             \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01143}01143         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6a392b7ecae843c734db3d832f11af49}{fifo\_en}}, 1, \&\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga88143c31b894bcd819c0e49b0ff267aa}{fifo\_enable}}))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01144}01144             \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01145}01145     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01146}01146     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01147}01147 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01148}01148 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01154}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf973c32c73ba912ff512aab948fc31ca}{01154}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf973c32c73ba912ff512aab948fc31ca}{mpu\_get\_gyro\_fsr}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} *fsr)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01155}01155 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01156}01156     \textcolor{keywordflow}{switch} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab45a727aeee17380828a3e20ccb375c2}{gyro\_fsr}}) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01157}01157     \textcolor{keywordflow}{case} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga83acdc0eb37e8bfe0c2ae2348ded0a90a5b8251a49db5cb8a676076b0b308ae35}{INV\_FSR\_250DPS}}:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01158}01158         fsr[0] = 250;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01159}01159         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01160}01160     \textcolor{keywordflow}{case} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga83acdc0eb37e8bfe0c2ae2348ded0a90a50901470ff389927fd010081e2b8fd09}{INV\_FSR\_500DPS}}:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01161}01161         fsr[0] = 500;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01162}01162         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01163}01163     \textcolor{keywordflow}{case} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga83acdc0eb37e8bfe0c2ae2348ded0a90aee922e0daa4fbb404c3db6c49d897a13}{INV\_FSR\_1000DPS}}:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01164}01164         fsr[0] = 1000;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01165}01165         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01166}01166     \textcolor{keywordflow}{case} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga83acdc0eb37e8bfe0c2ae2348ded0a90ac0c37efc1c8acd6f70c0c5a768e5b8be}{INV\_FSR\_2000DPS}}:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01167}01167         fsr[0] = 2000;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01168}01168         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01169}01169     \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01170}01170         fsr[0] = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01171}01171         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01172}01172     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01173}01173     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01174}01174 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01175}01175 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01181}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gad09e6031c8677adc0b8a39b6deea8e27}{01181}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gad09e6031c8677adc0b8a39b6deea8e27}{mpu\_set\_gyro\_fsr}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} fsr)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01182}01182 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01183}01183     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} data;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01184}01184 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01185}01185     \textcolor{keywordflow}{if} (!(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa996fc14aa630e53823462baf460c13f}{sensors}}))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01186}01186         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01187}01187 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01188}01188     \textcolor{keywordflow}{switch} (fsr) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01189}01189     \textcolor{keywordflow}{case} 250:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01190}01190         data = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga83acdc0eb37e8bfe0c2ae2348ded0a90a5b8251a49db5cb8a676076b0b308ae35}{INV\_FSR\_250DPS}} << 3;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01191}01191         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01192}01192     \textcolor{keywordflow}{case} 500:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01193}01193         data = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga83acdc0eb37e8bfe0c2ae2348ded0a90a50901470ff389927fd010081e2b8fd09}{INV\_FSR\_500DPS}} << 3;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01194}01194         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01195}01195     \textcolor{keywordflow}{case} 1000:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01196}01196         data = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga83acdc0eb37e8bfe0c2ae2348ded0a90aee922e0daa4fbb404c3db6c49d897a13}{INV\_FSR\_1000DPS}} << 3;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01197}01197         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01198}01198     \textcolor{keywordflow}{case} 2000:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01199}01199         data = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga83acdc0eb37e8bfe0c2ae2348ded0a90ac0c37efc1c8acd6f70c0c5a768e5b8be}{INV\_FSR\_2000DPS}} << 3;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01200}01200         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01201}01201     \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01202}01202         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01203}01203     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01204}01204 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01205}01205     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab45a727aeee17380828a3e20ccb375c2}{gyro\_fsr}} == (data >> 3))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01206}01206         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01207}01207     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gada0b973f74cc874552f079fd58c435a6}{gyro\_cfg}}, 1, \&data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01208}01208         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01209}01209     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab45a727aeee17380828a3e20ccb375c2}{gyro\_fsr}} = data >> 3;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01210}01210     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01211}01211 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01212}01212 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01218}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab6087a15ee23db23b6aec41590329a60}{01218}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gab6087a15ee23db23b6aec41590329a60}{mpu\_get\_accel\_fsr}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} *fsr)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01219}01219 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01220}01220     \textcolor{keywordflow}{switch} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf66873be1446ed552812e32d40eced61}{accel\_fsr}}) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01221}01221     \textcolor{keywordflow}{case} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ggaec8501b935143099e5f729dee221a81eae27c6f69463dab7de81fac0c51ff8aa7}{INV\_FSR\_2G}}:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01222}01222         fsr[0] = 2;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01223}01223         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01224}01224     \textcolor{keywordflow}{case} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ggaec8501b935143099e5f729dee221a81eaa91e3a89d0bbd01149fe71148595be6d}{INV\_FSR\_4G}}:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01225}01225         fsr[0] = 4;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01226}01226         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01227}01227     \textcolor{keywordflow}{case} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ggaec8501b935143099e5f729dee221a81ea0a40371bdda397d234c53d0ee2f3be8b}{INV\_FSR\_8G}}:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01228}01228         fsr[0] = 8;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01229}01229         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01230}01230     \textcolor{keywordflow}{case} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ggaec8501b935143099e5f729dee221a81ea6712e8563c97c11b458ef721d4f5f9d5}{INV\_FSR\_16G}}:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01231}01231         fsr[0] = 16;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01232}01232         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01233}01233     \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01234}01234         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01235}01235     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01236}01236     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab72e3cead391dee41f28e041282d743f}{accel\_half}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01237}01237         fsr[0] <<= 1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01238}01238     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01239}01239 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01240}01240 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01246}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2713a96af104cfb2ae8e0ed4c3718119}{01246}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2713a96af104cfb2ae8e0ed4c3718119}{mpu\_set\_accel\_fsr}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} fsr)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01247}01247 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01248}01248     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} data;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01249}01249 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01250}01250     \textcolor{keywordflow}{if} (!(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa996fc14aa630e53823462baf460c13f}{sensors}}))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01251}01251         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01252}01252 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01253}01253     \textcolor{keywordflow}{switch} (fsr) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01254}01254     \textcolor{keywordflow}{case} 2:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01255}01255         data = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ggaec8501b935143099e5f729dee221a81eae27c6f69463dab7de81fac0c51ff8aa7}{INV\_FSR\_2G}} << 3;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01256}01256         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01257}01257     \textcolor{keywordflow}{case} 4:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01258}01258         data = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ggaec8501b935143099e5f729dee221a81eaa91e3a89d0bbd01149fe71148595be6d}{INV\_FSR\_4G}} << 3;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01259}01259         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01260}01260     \textcolor{keywordflow}{case} 8:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01261}01261         data = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ggaec8501b935143099e5f729dee221a81ea0a40371bdda397d234c53d0ee2f3be8b}{INV\_FSR\_8G}} << 3;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01262}01262         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01263}01263     \textcolor{keywordflow}{case} 16:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01264}01264         data = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ggaec8501b935143099e5f729dee221a81ea6712e8563c97c11b458ef721d4f5f9d5}{INV\_FSR\_16G}} << 3;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01265}01265         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01266}01266     \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01267}01267         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01268}01268     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01269}01269 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01270}01270     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf66873be1446ed552812e32d40eced61}{accel\_fsr}} == (data >> 3))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01271}01271         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01272}01272     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gae93a446c54cc00bc7f11209d7af0025e}{accel\_cfg}}, 1, \&data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01273}01273         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01274}01274     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf66873be1446ed552812e32d40eced61}{accel\_fsr}} = data >> 3;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01275}01275     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01276}01276 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01277}01277 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01283}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa95c7e216dcb2d888e9796001ca555f8}{01283}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa95c7e216dcb2d888e9796001ca555f8}{mpu\_get\_lpf}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} *lpf)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01284}01284 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01285}01285     \textcolor{keywordflow}{switch} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga16ec8ca8298f62ac01419775377270fb}{lpf}}) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01286}01286     \textcolor{keywordflow}{case} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9ab58e52e0b6be4cbaf0c7f32705a9fcec}{INV\_FILTER\_188HZ}}:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01287}01287         lpf[0] = 188;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01288}01288         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01289}01289     \textcolor{keywordflow}{case} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9a0f288da0c97b325a6cb57f1223f0cf98}{INV\_FILTER\_98HZ}}:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01290}01290         lpf[0] = 98;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01291}01291         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01292}01292     \textcolor{keywordflow}{case} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9a995b18a52a5bd919aa9c1411a2292110}{INV\_FILTER\_42HZ}}:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01293}01293         lpf[0] = 42;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01294}01294         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01295}01295     \textcolor{keywordflow}{case} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9aebecb86604e475ed8e2cb68340010ff1}{INV\_FILTER\_20HZ}}:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01296}01296         lpf[0] = 20;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01297}01297         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01298}01298     \textcolor{keywordflow}{case} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9a327619f406c6b2f6a221793881013508}{INV\_FILTER\_10HZ}}:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01299}01299         lpf[0] = 10;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01300}01300         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01301}01301     \textcolor{keywordflow}{case} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9abdaaf85666fd6a490ee01dcd8a315678}{INV\_FILTER\_5HZ}}:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01302}01302         lpf[0] = 5;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01303}01303         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01304}01304     \textcolor{keywordflow}{case} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9a9f0263fbbdccd3c5a18fcb65be278d24}{INV\_FILTER\_256HZ\_NOLPF2}}:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01305}01305     \textcolor{keywordflow}{case} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9a76de97a6c2f8eb3c5d1a73d717513f5d}{INV\_FILTER\_2100HZ\_NOLPF}}:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01306}01306     \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01307}01307         lpf[0] = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01308}01308         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01309}01309     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01310}01310     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01311}01311 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01312}01312 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01319}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5661a9dee25152166769910767a2a93d}{01319}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5661a9dee25152166769910767a2a93d}{mpu\_set\_lpf}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} lpf)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01320}01320 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01321}01321     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} data;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01322}01322 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01323}01323     \textcolor{keywordflow}{if} (!(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa996fc14aa630e53823462baf460c13f}{sensors}}))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01324}01324         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01325}01325 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01326}01326     \textcolor{keywordflow}{if} (lpf >= 188)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01327}01327         data = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9ab58e52e0b6be4cbaf0c7f32705a9fcec}{INV\_FILTER\_188HZ}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01328}01328     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (lpf >= 98)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01329}01329         data = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9a0f288da0c97b325a6cb57f1223f0cf98}{INV\_FILTER\_98HZ}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01330}01330     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (lpf >= 42)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01331}01331         data = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9a995b18a52a5bd919aa9c1411a2292110}{INV\_FILTER\_42HZ}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01332}01332     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (lpf >= 20)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01333}01333         data = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9aebecb86604e475ed8e2cb68340010ff1}{INV\_FILTER\_20HZ}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01334}01334     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (lpf >= 10)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01335}01335         data = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9a327619f406c6b2f6a221793881013508}{INV\_FILTER\_10HZ}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01336}01336     \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01337}01337         data = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9abdaaf85666fd6a490ee01dcd8a315678}{INV\_FILTER\_5HZ}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01338}01338 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01339}01339     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga16ec8ca8298f62ac01419775377270fb}{lpf}} == data)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01340}01340         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01341}01341     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga22eeac0bd77e7d99b3e15dda52f1bd08}{lpf}}, 1, \&data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01342}01342         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01343}01343     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga16ec8ca8298f62ac01419775377270fb}{lpf}} = data;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01344}01344     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01345}01345 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01346}01346 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01352}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2487dd551b701c1c7ed4d6335f02b2f1}{01352}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2487dd551b701c1c7ed4d6335f02b2f1}{mpu\_get\_sample\_rate}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} *rate)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01353}01353 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01354}01354     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4783ed8aa79a3b5de798963819997c38}{dmp\_on}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01355}01355         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01356}01356     \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01357}01357         rate[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2660470fcf7b53e2e832a397cbe6c354}{sample\_rate}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01358}01358     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01359}01359 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01360}01360 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01367}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga0144d666a67a82888b8580002afe8b55}{01367}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga0144d666a67a82888b8580002afe8b55}{mpu\_set\_sample\_rate}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} rate)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01368}01368 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01369}01369     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} data;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01370}01370 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01371}01371     \textcolor{keywordflow}{if} (!(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa996fc14aa630e53823462baf460c13f}{sensors}}))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01372}01372         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01373}01373 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01374}01374     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4783ed8aa79a3b5de798963819997c38}{dmp\_on}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01375}01375         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01376}01376     \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01377}01377         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga33e138d8a49744eb9b4ea0e9086cef1c}{lp\_accel\_mode}}) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01378}01378             \textcolor{keywordflow}{if} (rate \&\& (rate <= 40)) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01379}01379                 \textcolor{comment}{/* Just stay in low-\/power accel mode. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01380}01380                 \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3a4fea75686ab7d2e68634e81ccac04c}{mpu\_lp\_accel\_mode}}(rate);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01381}01381                 \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01382}01382             \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01383}01383             \textcolor{comment}{/* Requested rate exceeds the allowed frequencies in LP accel mode,}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01384}01384 \textcolor{comment}{             * switch back to full-\/power mode.}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01385}01385 \textcolor{comment}{             */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01386}01386             \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3a4fea75686ab7d2e68634e81ccac04c}{mpu\_lp\_accel\_mode}}(0);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01387}01387         \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01388}01388         \textcolor{keywordflow}{if} (rate < 4)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01389}01389             rate = 4;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01390}01390         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (rate > 1000)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01391}01391             rate = 1000;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01392}01392 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01393}01393         data = 1000 / rate -\/ 1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01394}01394         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga27dd9db31f16ca170520b3009255e6d0}{rate\_div}}, 1, \&data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01395}01395             \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01396}01396 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01397}01397         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2660470fcf7b53e2e832a397cbe6c354}{sample\_rate}} = 1000 / (1 + data);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01398}01398 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01399}01399 \textcolor{preprocessor}{\#ifdef AK89xx\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01400}01400         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga78da3828de0ef9d080c4d03e7bc45e7b}{mpu\_set\_compass\_sample\_rate}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac6afabdc09a49a433ee19d8a9486056d}{min}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.compass\_sample\_rate, MAX\_COMPASS\_SAMPLE\_RATE));}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01401}01401 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01402}01402 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01403}01403         \textcolor{comment}{/* Automatically set LPF to 1/2 sampling rate. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01404}01404         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5661a9dee25152166769910767a2a93d}{mpu\_set\_lpf}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2660470fcf7b53e2e832a397cbe6c354}{sample\_rate}} >> 1);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01405}01405         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01406}01406     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01407}01407 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01408}01408 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01414}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab5a45cd7783f6937788c0decb0b18b16}{01414}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gab5a45cd7783f6937788c0decb0b18b16}{mpu\_get\_compass\_sample\_rate}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} *rate)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01415}01415 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01416}01416 \textcolor{preprocessor}{\#ifdef AK89xx\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01417}01417     rate[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.compass\_sample\_rate;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01418}01418     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01419}01419 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01420}01420     rate[0] = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01421}01421     \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01422}01422 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01423}01423 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01424}01424 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01436}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga78da3828de0ef9d080c4d03e7bc45e7b}{01436}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga78da3828de0ef9d080c4d03e7bc45e7b}{mpu\_set\_compass\_sample\_rate}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} rate)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01437}01437 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01438}01438 \textcolor{preprocessor}{\#ifdef AK89xx\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01439}01439     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} div;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01440}01440     \textcolor{keywordflow}{if} (!rate || rate > \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2660470fcf7b53e2e832a397cbe6c354}{sample\_rate}} || rate > MAX\_COMPASS\_SAMPLE\_RATE)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01441}01441         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01442}01442 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01443}01443     div = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2660470fcf7b53e2e832a397cbe6c354}{sample\_rate}} / rate -\/ 1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01444}01444     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>s4\_ctrl, 1, \&div))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01445}01445         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01446}01446     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.compass\_sample\_rate = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2660470fcf7b53e2e832a397cbe6c354}{sample\_rate}} / (div + 1);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01447}01447     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01448}01448 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01449}01449     \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01450}01450 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01451}01451 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01452}01452 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01458}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga023c0cc94aa8f162dc33b15048a49421}{01458}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga023c0cc94aa8f162dc33b15048a49421}{mpu\_get\_gyro\_sens}}(\textcolor{keywordtype}{float} *sens)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01459}01459 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01460}01460     \textcolor{keywordflow}{switch} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab45a727aeee17380828a3e20ccb375c2}{gyro\_fsr}}) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01461}01461     \textcolor{keywordflow}{case} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga83acdc0eb37e8bfe0c2ae2348ded0a90a5b8251a49db5cb8a676076b0b308ae35}{INV\_FSR\_250DPS}}:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01462}01462         sens[0] = 131.f;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01463}01463         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01464}01464     \textcolor{keywordflow}{case} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga83acdc0eb37e8bfe0c2ae2348ded0a90a50901470ff389927fd010081e2b8fd09}{INV\_FSR\_500DPS}}:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01465}01465         sens[0] = 65.5f;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01466}01466         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01467}01467     \textcolor{keywordflow}{case} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga83acdc0eb37e8bfe0c2ae2348ded0a90aee922e0daa4fbb404c3db6c49d897a13}{INV\_FSR\_1000DPS}}:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01468}01468         sens[0] = 32.8f;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01469}01469         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01470}01470     \textcolor{keywordflow}{case} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga83acdc0eb37e8bfe0c2ae2348ded0a90ac0c37efc1c8acd6f70c0c5a768e5b8be}{INV\_FSR\_2000DPS}}:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01471}01471         sens[0] = 16.4f;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01472}01472         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01473}01473     \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01474}01474         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01475}01475     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01476}01476     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01477}01477 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01478}01478 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01484}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga620408949052b96e856cad920f856583}{01484}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga620408949052b96e856cad920f856583}{mpu\_get\_accel\_sens}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} *sens)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01485}01485 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01486}01486     \textcolor{keywordflow}{switch} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf66873be1446ed552812e32d40eced61}{accel\_fsr}}) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01487}01487     \textcolor{keywordflow}{case} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ggaec8501b935143099e5f729dee221a81eae27c6f69463dab7de81fac0c51ff8aa7}{INV\_FSR\_2G}}:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01488}01488         sens[0] = 16384;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01489}01489         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01490}01490     \textcolor{keywordflow}{case} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ggaec8501b935143099e5f729dee221a81eaa91e3a89d0bbd01149fe71148595be6d}{INV\_FSR\_4G}}:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01491}01491         sens[0] = 8092;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01492}01492         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01493}01493     \textcolor{keywordflow}{case} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ggaec8501b935143099e5f729dee221a81ea0a40371bdda397d234c53d0ee2f3be8b}{INV\_FSR\_8G}}:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01494}01494         sens[0] = 4096;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01495}01495         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01496}01496     \textcolor{keywordflow}{case} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ggaec8501b935143099e5f729dee221a81ea6712e8563c97c11b458ef721d4f5f9d5}{INV\_FSR\_16G}}:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01497}01497         sens[0] = 2048;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01498}01498         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01499}01499     \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01500}01500         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01501}01501     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01502}01502     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab72e3cead391dee41f28e041282d743f}{accel\_half}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01503}01503         sens[0] >>= 1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01504}01504     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01505}01505 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01506}01506 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01516}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga093f11eb10b2639a4b9fe344ea348c54}{01516}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga093f11eb10b2639a4b9fe344ea348c54}{mpu\_get\_fifo\_config}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} *sensors)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01517}01517 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01518}01518     sensors[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga88143c31b894bcd819c0e49b0ff267aa}{fifo\_enable}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01519}01519     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01520}01520 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01521}01521 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01531}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gababbdda287e1f19323489f90a0889dd7}{01531}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gababbdda287e1f19323489f90a0889dd7}{mpu\_configure\_fifo}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} sensors)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01532}01532 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01533}01533     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} prev;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01534}01534     \textcolor{keywordtype}{int} result = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01535}01535 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01536}01536     \textcolor{comment}{/* Compass data isn't going into the FIFO. Stop trying. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01537}01537     sensors \&= \string~INV\_XYZ\_COMPASS;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01538}01538 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01539}01539     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4783ed8aa79a3b5de798963819997c38}{dmp\_on}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01540}01540         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01541}01541     \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01542}01542         \textcolor{keywordflow}{if} (!(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa996fc14aa630e53823462baf460c13f}{sensors}}))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01543}01543             \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01544}01544         prev = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga88143c31b894bcd819c0e49b0ff267aa}{fifo\_enable}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01545}01545         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga88143c31b894bcd819c0e49b0ff267aa}{fifo\_enable}} = sensors \& \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa996fc14aa630e53823462baf460c13f}{sensors}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01546}01546         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga88143c31b894bcd819c0e49b0ff267aa}{fifo\_enable}} != sensors)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01547}01547             \textcolor{comment}{/* You're not getting what you asked for. Some sensors are}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01548}01548 \textcolor{comment}{             * asleep.}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01549}01549 \textcolor{comment}{             */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01550}01550             result = -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01551}01551         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01552}01552             result = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01553}01553         \textcolor{keywordflow}{if} (sensors || \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga33e138d8a49744eb9b4ea0e9086cef1c}{lp\_accel\_mode}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01554}01554             \mbox{\hyperlink{group___d_r_i_v_e_r_s_gafd5ebff6b0179e1dce0b68c2272cae07}{set\_int\_enable}}(1);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01555}01555         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01556}01556             \mbox{\hyperlink{group___d_r_i_v_e_r_s_gafd5ebff6b0179e1dce0b68c2272cae07}{set\_int\_enable}}(0);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01557}01557         \textcolor{keywordflow}{if} (sensors) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01558}01558             \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf23e9f57c0059be6ec57862f0584de10}{mpu\_reset\_fifo}}()) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01559}01559                 \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga88143c31b894bcd819c0e49b0ff267aa}{fifo\_enable}} = prev;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01560}01560                 \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01561}01561             \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01562}01562         \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01563}01563     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01564}01564 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01565}01565     \textcolor{keywordflow}{return} result;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01566}01566 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01567}01567 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01573}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaec8fa7a067988d174516bb735a4a0bc9}{01573}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaec8fa7a067988d174516bb735a4a0bc9}{mpu\_get\_power\_state}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} *power\_on)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01574}01574 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01575}01575     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa996fc14aa630e53823462baf460c13f}{sensors}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01576}01576         power\_on[0] = 1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01577}01577     \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01578}01578         power\_on[0] = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01579}01579     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01580}01580 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01581}01581 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01592}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6e77e7cc1cf6be5e8fdf617c5b4586d1}{01592}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6e77e7cc1cf6be5e8fdf617c5b4586d1}{mpu\_set\_sensors}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} sensors)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01593}01593 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01594}01594     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} data;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01595}01595 \textcolor{preprocessor}{\#ifdef AK89xx\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01596}01596     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} user\_ctrl;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01597}01597 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01598}01598 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01599}01599     \textcolor{keywordflow}{if} (sensors \& \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3fdc30f9c0a26c2c4e2bb88921f91629}{INV\_XYZ\_GYRO}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01600}01600         data = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga75570f009627c6f4ddfb2d936d81e207a01b240917a78674d3e387110a6a8f94c}{INV\_CLK\_PLL}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01601}01601     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (sensors)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01602}01602         data = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01603}01603     \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01604}01604         data = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1fed8bd436e9b7dfccb1cae99ca89103}{BIT\_SLEEP}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01605}01605     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa01fb0872030e8e2932f8d1d257ea86a}{pwr\_mgmt\_1}}, 1, \&data)) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01606}01606         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa996fc14aa630e53823462baf460c13f}{sensors}} = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01607}01607         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01608}01608     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01609}01609     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab7bd5165d6e62cb0d814cf3401958445}{clk\_src}} = data \& \string~BIT\_SLEEP;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01610}01610 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01611}01611     data = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01612}01612     \textcolor{keywordflow}{if} (!(sensors \& \mbox{\hyperlink{group___d_r_i_v_e_r_s_gabf02bf28541421d59f8be764f2b95407}{INV\_X\_GYRO}}))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01613}01613         data |= \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga82256fedeffe5b2443ab3ae34cf032d9}{BIT\_STBY\_XG}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01614}01614     \textcolor{keywordflow}{if} (!(sensors \& \mbox{\hyperlink{group___d_r_i_v_e_r_s_gacdd8ff833a34dba08ca2aa145eb92b44}{INV\_Y\_GYRO}}))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01615}01615         data |= \mbox{\hyperlink{group___d_r_i_v_e_r_s_gabf1c0a844906a5e887a659971a4af417}{BIT\_STBY\_YG}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01616}01616     \textcolor{keywordflow}{if} (!(sensors \& \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga50205b5cc6089b33b2561c854eb8b0fd}{INV\_Z\_GYRO}}))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01617}01617         data |= \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga30967a4efdf3c3f1e39814e72a4168b0}{BIT\_STBY\_ZG}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01618}01618     \textcolor{keywordflow}{if} (!(sensors \& \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa03f025a17ed491e70b88274e89c75c5}{INV\_XYZ\_ACCEL}}))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01619}01619         data |= \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga04a57159e34387dafe9b86b171c4654c}{BIT\_STBY\_XYZA}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01620}01620     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3e378b0c77e9529ee93ac6eba11e1031}{pwr\_mgmt\_2}}, 1, \&data)) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01621}01621         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa996fc14aa630e53823462baf460c13f}{sensors}} = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01622}01622         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01623}01623     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01624}01624 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01625}01625     \textcolor{keywordflow}{if} (sensors \&\& (sensors != \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa03f025a17ed491e70b88274e89c75c5}{INV\_XYZ\_ACCEL}}))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01626}01626         \textcolor{comment}{/* Latched interrupts only used in LP accel mode. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01627}01627         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga653cb855300bff9285ce4b8dca6a503b}{mpu\_set\_int\_latched}}(0);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01628}01628 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01629}01629 \textcolor{preprocessor}{\#ifdef AK89xx\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01630}01630 \textcolor{preprocessor}{\#ifdef AK89xx\_BYPASS}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01631}01631     \textcolor{keywordflow}{if} (sensors \& \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga7fc9c1dbdcb2ac8cc2a4128a5799482a}{INV\_XYZ\_COMPASS}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01632}01632         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga36f70f38371b48d81094d3b061233e15}{mpu\_set\_bypass}}(1);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01633}01633     \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01634}01634         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga36f70f38371b48d81094d3b061233e15}{mpu\_set\_bypass}}(0);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01635}01635 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01636}01636     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga838d8f1c7b0d8cc83923b93bbafe1b33}{i2c\_read}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga12505a7d8cd7c976e5571f27a6160d23}{user\_ctrl}}, 1, \&user\_ctrl))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01637}01637         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01638}01638     \textcolor{comment}{/* Handle AKM power management. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01639}01639     \textcolor{keywordflow}{if} (sensors \& \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga7fc9c1dbdcb2ac8cc2a4128a5799482a}{INV\_XYZ\_COMPASS}}) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01640}01640         data = AKM\_SINGLE\_MEASUREMENT;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01641}01641         user\_ctrl |= \mbox{\hyperlink{group___d_r_i_v_e_r_s_gabcdedbd3098140aa14ad17bcaca8e176}{BIT\_AUX\_IF\_EN}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01642}01642     \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01643}01643         data = AKM\_POWER\_DOWN;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01644}01644         user\_ctrl \&= \string~BIT\_AUX\_IF\_EN;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01645}01645     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01646}01646     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4783ed8aa79a3b5de798963819997c38}{dmp\_on}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01647}01647         user\_ctrl |= \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga02c3e9ddd63128f1c3cf50bf1e9b5fe6}{BIT\_DMP\_EN}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01648}01648     \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01649}01649         user\_ctrl \&= \string~BIT\_DMP\_EN;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01650}01650     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>s1\_do, 1, \&data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01651}01651         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01652}01652     \textcolor{comment}{/* Enable/disable I2C master mode. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01653}01653     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga12505a7d8cd7c976e5571f27a6160d23}{user\_ctrl}}, 1, \&user\_ctrl))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01654}01654         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01655}01655 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01656}01656 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01657}01657 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01658}01658     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa996fc14aa630e53823462baf460c13f}{sensors}} = sensors;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01659}01659     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga33e138d8a49744eb9b4ea0e9086cef1c}{lp\_accel\_mode}} = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01660}01660     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gae36aca5baf9b6b7d74992aef00686d67}{delay\_ms}}(50);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01661}01661     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01662}01662 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01663}01663 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01669}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga0afd02d8c76d3278b488ef7038c26e3e}{01669}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga0afd02d8c76d3278b488ef7038c26e3e}{mpu\_get\_int\_status}}(\textcolor{keywordtype}{short} *status)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01670}01670 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01671}01671     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} tmp[2];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01672}01672     \textcolor{keywordflow}{if} (!\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa996fc14aa630e53823462baf460c13f}{sensors}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01673}01673         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01674}01674     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga838d8f1c7b0d8cc83923b93bbafe1b33}{i2c\_read}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaea6ad456241786750b3f211bc92032eb}{dmp\_int\_status}}, 2, tmp))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01675}01675         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01676}01676     status[0] = (tmp[0] << 8) | tmp[1];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01677}01677     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01678}01678 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01679}01679 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01698}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2da20453aafbbba4a0f6fb9fbdd25572}{01698}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2da20453aafbbba4a0f6fb9fbdd25572}{mpu\_read\_fifo}}(\textcolor{keywordtype}{short} *gyro, \textcolor{keywordtype}{short} *accel, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} *timestamp,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01699}01699         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} *sensors, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} *more)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01700}01700 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01701}01701     \textcolor{comment}{/* Assumes maximum packet size is gyro (6) + accel (6). */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01702}01702     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} data[\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga973c680573b37fc359fc68d0707da355}{MAX\_PACKET\_LENGTH}}];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01703}01703     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} packet\_size = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01704}01704     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} fifo\_count, index = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01705}01705 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01706}01706     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4783ed8aa79a3b5de798963819997c38}{dmp\_on}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01707}01707         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01708}01708 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01709}01709     sensors[0] = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01710}01710     \textcolor{keywordflow}{if} (!\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa996fc14aa630e53823462baf460c13f}{sensors}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01711}01711         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01712}01712     \textcolor{keywordflow}{if} (!\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga88143c31b894bcd819c0e49b0ff267aa}{fifo\_enable}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01713}01713         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01714}01714 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01715}01715     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga88143c31b894bcd819c0e49b0ff267aa}{fifo\_enable}} \& \mbox{\hyperlink{group___d_r_i_v_e_r_s_gabf02bf28541421d59f8be764f2b95407}{INV\_X\_GYRO}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01716}01716         packet\_size += 2;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01717}01717     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga88143c31b894bcd819c0e49b0ff267aa}{fifo\_enable}} \& \mbox{\hyperlink{group___d_r_i_v_e_r_s_gacdd8ff833a34dba08ca2aa145eb92b44}{INV\_Y\_GYRO}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01718}01718         packet\_size += 2;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01719}01719     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga88143c31b894bcd819c0e49b0ff267aa}{fifo\_enable}} \& \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga50205b5cc6089b33b2561c854eb8b0fd}{INV\_Z\_GYRO}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01720}01720         packet\_size += 2;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01721}01721     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga88143c31b894bcd819c0e49b0ff267aa}{fifo\_enable}} \& \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa03f025a17ed491e70b88274e89c75c5}{INV\_XYZ\_ACCEL}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01722}01722         packet\_size += 6;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01723}01723 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01724}01724     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga838d8f1c7b0d8cc83923b93bbafe1b33}{i2c\_read}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab7503974d62cf9c2d688579fcd1abd48}{fifo\_count\_h}}, 2, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01725}01725         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01726}01726     fifo\_count = (data[0] << 8) | data[1];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01727}01727     \textcolor{keywordflow}{if} (fifo\_count < packet\_size)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01728}01728         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01729}01729 \textcolor{comment}{//    log\_i("{}FIFO count: \%hd\(\backslash\)n"{}, fifo\_count);}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01730}01730     \textcolor{keywordflow}{if} (fifo\_count > (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5f77e9f55285abb4d214b80281f69c1f}{max\_fifo}} >> 1)) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01731}01731         \textcolor{comment}{/* FIFO is 50\% full, better check overflow bit. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01732}01732         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga838d8f1c7b0d8cc83923b93bbafe1b33}{i2c\_read}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga837724080c34ff5a190751427febaf91}{int\_status}}, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01733}01733             \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01734}01734         \textcolor{keywordflow}{if} (data[0] \& \mbox{\hyperlink{group___d_r_i_v_e_r_s_gafb9b49ce5dd973b3c29ae72680924fa7}{BIT\_FIFO\_OVERFLOW}}) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01735}01735             \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf23e9f57c0059be6ec57862f0584de10}{mpu\_reset\_fifo}}();}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01736}01736             \textcolor{keywordflow}{return} -\/2;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01737}01737         \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01738}01738     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01739}01739     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3e6b6bc6d1cd2956353a31bfadd3c332}{get\_ms}}((\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long}*)timestamp);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01740}01740 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01741}01741     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga838d8f1c7b0d8cc83923b93bbafe1b33}{i2c\_read}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb6763dc5f368ea01ef7c733cea9dab4}{fifo\_r\_w}}, packet\_size, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01742}01742         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01743}01743     more[0] = fifo\_count / packet\_size -\/ 1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01744}01744     sensors[0] = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01745}01745 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01746}01746     \textcolor{keywordflow}{if} ((index != packet\_size) \&\& \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga88143c31b894bcd819c0e49b0ff267aa}{fifo\_enable}} \& \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa03f025a17ed491e70b88274e89c75c5}{INV\_XYZ\_ACCEL}}) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01747}01747         accel[0] = (data[index+0] << 8) | data[index+1];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01748}01748         accel[1] = (data[index+2] << 8) | data[index+3];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01749}01749         accel[2] = (data[index+4] << 8) | data[index+5];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01750}01750         sensors[0] |= \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa03f025a17ed491e70b88274e89c75c5}{INV\_XYZ\_ACCEL}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01751}01751         index += 6;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01752}01752     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01753}01753     \textcolor{keywordflow}{if} ((index != packet\_size) \&\& \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga88143c31b894bcd819c0e49b0ff267aa}{fifo\_enable}} \& \mbox{\hyperlink{group___d_r_i_v_e_r_s_gabf02bf28541421d59f8be764f2b95407}{INV\_X\_GYRO}}) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01754}01754         gyro[0] = (data[index+0] << 8) | data[index+1];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01755}01755         sensors[0] |= \mbox{\hyperlink{group___d_r_i_v_e_r_s_gabf02bf28541421d59f8be764f2b95407}{INV\_X\_GYRO}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01756}01756         index += 2;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01757}01757     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01758}01758     \textcolor{keywordflow}{if} ((index != packet\_size) \&\& \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga88143c31b894bcd819c0e49b0ff267aa}{fifo\_enable}} \& \mbox{\hyperlink{group___d_r_i_v_e_r_s_gacdd8ff833a34dba08ca2aa145eb92b44}{INV\_Y\_GYRO}}) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01759}01759         gyro[1] = (data[index+0] << 8) | data[index+1];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01760}01760         sensors[0] |= \mbox{\hyperlink{group___d_r_i_v_e_r_s_gacdd8ff833a34dba08ca2aa145eb92b44}{INV\_Y\_GYRO}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01761}01761         index += 2;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01762}01762     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01763}01763     \textcolor{keywordflow}{if} ((index != packet\_size) \&\& \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga88143c31b894bcd819c0e49b0ff267aa}{fifo\_enable}} \& \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga50205b5cc6089b33b2561c854eb8b0fd}{INV\_Z\_GYRO}}) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01764}01764         gyro[2] = (data[index+0] << 8) | data[index+1];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01765}01765         sensors[0] |= \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga50205b5cc6089b33b2561c854eb8b0fd}{INV\_Z\_GYRO}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01766}01766         index += 2;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01767}01767     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01768}01768 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01769}01769     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01770}01770 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01771}01771 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01779}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga13593044949b460e9f571eb57e9a0788}{01779}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga13593044949b460e9f571eb57e9a0788}{mpu\_read\_fifo\_stream}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} length, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} *data,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01780}01780     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} *more)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01781}01781 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01782}01782     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} tmp[2];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01783}01783     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} fifo\_count;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01784}01784     \textcolor{keywordflow}{if} (!\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4783ed8aa79a3b5de798963819997c38}{dmp\_on}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01785}01785         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01786}01786     \textcolor{keywordflow}{if} (!\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa996fc14aa630e53823462baf460c13f}{sensors}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01787}01787         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01788}01788 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01789}01789     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga838d8f1c7b0d8cc83923b93bbafe1b33}{i2c\_read}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab7503974d62cf9c2d688579fcd1abd48}{fifo\_count\_h}}, 2, tmp))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01790}01790         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01791}01791     fifo\_count = (tmp[0] << 8) | tmp[1];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01792}01792     \textcolor{keywordflow}{if} (fifo\_count < length) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01793}01793         more[0] = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01794}01794         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01795}01795     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01796}01796     \textcolor{keywordflow}{if} (fifo\_count > (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5f77e9f55285abb4d214b80281f69c1f}{max\_fifo}} >> 1)) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01797}01797         \textcolor{comment}{/* FIFO is 50\% full, better check overflow bit. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01798}01798         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga838d8f1c7b0d8cc83923b93bbafe1b33}{i2c\_read}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga837724080c34ff5a190751427febaf91}{int\_status}}, 1, tmp))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01799}01799             \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01800}01800         \textcolor{keywordflow}{if} (tmp[0] \& \mbox{\hyperlink{group___d_r_i_v_e_r_s_gafb9b49ce5dd973b3c29ae72680924fa7}{BIT\_FIFO\_OVERFLOW}}) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01801}01801             \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf23e9f57c0059be6ec57862f0584de10}{mpu\_reset\_fifo}}();}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01802}01802             \textcolor{keywordflow}{return} -\/2;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01803}01803         \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01804}01804     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01805}01805 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01806}01806     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga838d8f1c7b0d8cc83923b93bbafe1b33}{i2c\_read}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb6763dc5f368ea01ef7c733cea9dab4}{fifo\_r\_w}}, length, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01807}01807         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01808}01808     more[0] = fifo\_count / length -\/ 1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01809}01809     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01810}01810 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01811}01811 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01817}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga36f70f38371b48d81094d3b061233e15}{01817}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga36f70f38371b48d81094d3b061233e15}{mpu\_set\_bypass}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} bypass\_on)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01818}01818 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01819}01819     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} tmp;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01820}01820 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01821}01821     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6d3a962d6435644c7ea68e7d65934636}{bypass\_mode}} == bypass\_on)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01822}01822         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01823}01823 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01824}01824     \textcolor{keywordflow}{if} (bypass\_on) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01825}01825         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga838d8f1c7b0d8cc83923b93bbafe1b33}{i2c\_read}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga12505a7d8cd7c976e5571f27a6160d23}{user\_ctrl}}, 1, \&tmp))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01826}01826             \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01827}01827         tmp \&= \string~BIT\_AUX\_IF\_EN;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01828}01828         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga12505a7d8cd7c976e5571f27a6160d23}{user\_ctrl}}, 1, \&tmp))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01829}01829             \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01830}01830         \mbox{\hyperlink{group___d_r_i_v_e_r_s_gae36aca5baf9b6b7d74992aef00686d67}{delay\_ms}}(3);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01831}01831         tmp = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gadd12a8d89e1a4c4e008b12a96dd4c75d}{BIT\_BYPASS\_EN}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01832}01832         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6f12e54ae8c7f2dd77954f3ab619bbb9}{active\_low\_int}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01833}01833             tmp |= \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8467782bedc44051c95643e303543655}{BIT\_ACTL}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01834}01834         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga55ce40fc460a62829ec149edaccffe7c}{latched\_int}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01835}01835             tmp |= \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga588b5a95724c4a68c6868faa78fd3a7f}{BIT\_LATCH\_EN}} | \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1f50796ca0363292d9ac9cc1d29d9225}{BIT\_ANY\_RD\_CLR}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01836}01836         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaae7bdbff2a1029245890b555b2d8d519}{int\_pin\_cfg}}, 1, \&tmp))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01837}01837             \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01838}01838     \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01839}01839         \textcolor{comment}{/* Enable I2C master mode if compass is being used. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01840}01840         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga838d8f1c7b0d8cc83923b93bbafe1b33}{i2c\_read}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga12505a7d8cd7c976e5571f27a6160d23}{user\_ctrl}}, 1, \&tmp))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01841}01841             \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01842}01842         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa996fc14aa630e53823462baf460c13f}{sensors}} \& \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga7fc9c1dbdcb2ac8cc2a4128a5799482a}{INV\_XYZ\_COMPASS}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01843}01843             tmp |= \mbox{\hyperlink{group___d_r_i_v_e_r_s_gabcdedbd3098140aa14ad17bcaca8e176}{BIT\_AUX\_IF\_EN}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01844}01844         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01845}01845             tmp \&= \string~BIT\_AUX\_IF\_EN;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01846}01846         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga12505a7d8cd7c976e5571f27a6160d23}{user\_ctrl}}, 1, \&tmp))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01847}01847             \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01848}01848         \mbox{\hyperlink{group___d_r_i_v_e_r_s_gae36aca5baf9b6b7d74992aef00686d67}{delay\_ms}}(3);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01849}01849         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6f12e54ae8c7f2dd77954f3ab619bbb9}{active\_low\_int}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01850}01850             tmp = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8467782bedc44051c95643e303543655}{BIT\_ACTL}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01851}01851         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01852}01852             tmp = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01853}01853         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga55ce40fc460a62829ec149edaccffe7c}{latched\_int}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01854}01854             tmp |= \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga588b5a95724c4a68c6868faa78fd3a7f}{BIT\_LATCH\_EN}} | \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1f50796ca0363292d9ac9cc1d29d9225}{BIT\_ANY\_RD\_CLR}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01855}01855         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaae7bdbff2a1029245890b555b2d8d519}{int\_pin\_cfg}}, 1, \&tmp))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01856}01856             \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01857}01857     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01858}01858     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6d3a962d6435644c7ea68e7d65934636}{bypass\_mode}} = bypass\_on;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01859}01859     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01860}01860 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01861}01861 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01867}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacc92fb1489ef32a04bcb6b0ebde4d657}{01867}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gacc92fb1489ef32a04bcb6b0ebde4d657}{mpu\_set\_int\_level}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} active\_low)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01868}01868 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01869}01869     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6f12e54ae8c7f2dd77954f3ab619bbb9}{active\_low\_int}} = active\_low;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01870}01870     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01871}01871 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01872}01872 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01879}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga653cb855300bff9285ce4b8dca6a503b}{01879}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga653cb855300bff9285ce4b8dca6a503b}{mpu\_set\_int\_latched}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} enable)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01880}01880 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01881}01881     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} tmp;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01882}01882     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga55ce40fc460a62829ec149edaccffe7c}{latched\_int}} == enable)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01883}01883         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01884}01884 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01885}01885     \textcolor{keywordflow}{if} (enable)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01886}01886         tmp = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga588b5a95724c4a68c6868faa78fd3a7f}{BIT\_LATCH\_EN}} | \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1f50796ca0363292d9ac9cc1d29d9225}{BIT\_ANY\_RD\_CLR}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01887}01887     \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01888}01888         tmp = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01889}01889     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6d3a962d6435644c7ea68e7d65934636}{bypass\_mode}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01890}01890         tmp |= \mbox{\hyperlink{group___d_r_i_v_e_r_s_gadd12a8d89e1a4c4e008b12a96dd4c75d}{BIT\_BYPASS\_EN}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01891}01891     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6f12e54ae8c7f2dd77954f3ab619bbb9}{active\_low\_int}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01892}01892         tmp |= \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8467782bedc44051c95643e303543655}{BIT\_ACTL}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01893}01893     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaae7bdbff2a1029245890b555b2d8d519}{int\_pin\_cfg}}, 1, \&tmp))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01894}01894         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01895}01895     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga55ce40fc460a62829ec149edaccffe7c}{latched\_int}} = enable;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01896}01896     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01897}01897 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01898}01898 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01899}01899 \textcolor{preprocessor}{\#ifdef MPU6050}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01900}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab7ebbe13328466605a20f6ce1a106de8}{01900}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gab7ebbe13328466605a20f6ce1a106de8}{get\_accel\_prod\_shift}}(\textcolor{keywordtype}{float} *st\_shift)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01901}01901 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01902}01902     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} tmp[4], shift\_code[3], ii;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01903}01903 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01904}01904     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga838d8f1c7b0d8cc83923b93bbafe1b33}{i2c\_read}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, 0x0D, 4, tmp))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01905}01905         \textcolor{keywordflow}{return} 0x07;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01906}01906 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01907}01907     shift\_code[0] = ((tmp[0] \& 0xE0) >> 3) | ((tmp[3] \& 0x30) >> 4);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01908}01908     shift\_code[1] = ((tmp[1] \& 0xE0) >> 3) | ((tmp[3] \& 0x0C) >> 2);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01909}01909     shift\_code[2] = ((tmp[2] \& 0xE0) >> 3) | (tmp[3] \& 0x03);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01910}01910     \textcolor{keywordflow}{for} (ii = 0; ii < 3; ii++) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01911}01911         \textcolor{keywordflow}{if} (!shift\_code[ii]) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01912}01912             st\_shift[ii] = 0.f;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01913}01913             \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01914}01914         \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01915}01915         \textcolor{comment}{/* Equivalent to..}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01916}01916 \textcolor{comment}{         * st\_shift[ii] = 0.34f * powf(0.92f/0.34f, (shift\_code[ii]-\/1) / 30.f)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01917}01917 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01918}01918         st\_shift[ii] = 0.34f;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01919}01919         \textcolor{keywordflow}{while} (-\/-\/shift\_code[ii])}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01920}01920             st\_shift[ii] *= 1.034f;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01921}01921     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01922}01922     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01923}01923 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01924}01924 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01925}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaab48ddb3bd05cea3f0fc85a68db9934d}{01925}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaab48ddb3bd05cea3f0fc85a68db9934d}{accel\_self\_test}}(\textcolor{keywordtype}{long} *bias\_regular, \textcolor{keywordtype}{long} *bias\_st)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01926}01926 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01927}01927     \textcolor{keywordtype}{int} jj, result = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01928}01928     \textcolor{keywordtype}{float} st\_shift[3], st\_shift\_cust, st\_shift\_var;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01929}01929 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01930}01930     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gab7ebbe13328466605a20f6ce1a106de8}{get\_accel\_prod\_shift}}(st\_shift);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01931}01931     \textcolor{keywordflow}{for}(jj = 0; jj < 3; jj++) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01932}01932         st\_shift\_cust = labs(bias\_regular[jj] -\/ bias\_st[jj]) / 65536.f;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01933}01933         \textcolor{keywordflow}{if} (st\_shift[jj]) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01934}01934             st\_shift\_var = st\_shift\_cust / st\_shift[jj] -\/ 1.f;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01935}01935             \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga95bcc5f260df5ce993730008a1dcb45a}{fabs}}(st\_shift\_var) > \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1e8f8b1ef7fb2c429e1ce7c2f9985530}{test}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga7f6071fb91426f467d9223c712560ee6}{max\_accel\_var}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01936}01936                 result |= 1 << jj;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01937}01937         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} ((st\_shift\_cust < \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1e8f8b1ef7fb2c429e1ce7c2f9985530}{test}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gae86aec181d0f1e4a29e9f9ae0735e8e1}{min\_g}}) ||}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01938}01938             (st\_shift\_cust > \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1e8f8b1ef7fb2c429e1ce7c2f9985530}{test}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga9ebd3195ac2f460f82873b9e6c36eb2c}{max\_g}}))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01939}01939             result |= 1 << jj;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01940}01940     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01941}01941 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01942}01942     \textcolor{keywordflow}{return} result;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01943}01943 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01944}01944 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01945}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga267d6f443d5be8b2a7a06aa007116f7a}{01945}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga267d6f443d5be8b2a7a06aa007116f7a}{gyro\_self\_test}}(\textcolor{keywordtype}{long} *bias\_regular, \textcolor{keywordtype}{long} *bias\_st)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01946}01946 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01947}01947     \textcolor{keywordtype}{int} jj, result = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01948}01948     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} tmp[3];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01949}01949     \textcolor{keywordtype}{float} st\_shift, st\_shift\_cust, st\_shift\_var;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01950}01950 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01951}01951     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga838d8f1c7b0d8cc83923b93bbafe1b33}{i2c\_read}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, 0x0D, 3, tmp))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01952}01952         \textcolor{keywordflow}{return} 0x07;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01953}01953 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01954}01954     tmp[0] \&= 0x1F;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01955}01955     tmp[1] \&= 0x1F;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01956}01956     tmp[2] \&= 0x1F;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01957}01957 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01958}01958     \textcolor{keywordflow}{for} (jj = 0; jj < 3; jj++) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01959}01959         st\_shift\_cust = labs(bias\_regular[jj] -\/ bias\_st[jj]) / 65536.f;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01960}01960         \textcolor{keywordflow}{if} (tmp[jj]) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01961}01961             st\_shift = 3275.f / \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1e8f8b1ef7fb2c429e1ce7c2f9985530}{test}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga330290a347407b0d92b1d77aa274993c}{gyro\_sens}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01962}01962             \textcolor{keywordflow}{while} (-\/-\/tmp[jj])}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01963}01963                 st\_shift *= 1.046f;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01964}01964             st\_shift\_var = st\_shift\_cust / st\_shift -\/ 1.f;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01965}01965             \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga95bcc5f260df5ce993730008a1dcb45a}{fabs}}(st\_shift\_var) > \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1e8f8b1ef7fb2c429e1ce7c2f9985530}{test}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3b47b72fbf8c152cb4389e3cd866ded9}{max\_gyro\_var}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01966}01966                 result |= 1 << jj;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01967}01967         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} ((st\_shift\_cust < \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1e8f8b1ef7fb2c429e1ce7c2f9985530}{test}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gafacfcf92f07cd846fb0aaf889a30c582}{min\_dps}}) ||}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01968}01968             (st\_shift\_cust > \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1e8f8b1ef7fb2c429e1ce7c2f9985530}{test}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gae588d6c0105bcd8f9144f42eee6c4835}{max\_dps}}))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01969}01969             result |= 1 << jj;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01970}01970     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01971}01971     \textcolor{keywordflow}{return} result;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01972}01972 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01973}01973 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01974}01974 \textcolor{preprocessor}{\#ifdef AK89xx\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01975}01975 \textcolor{keyword}{static} \textcolor{keywordtype}{int} compass\_self\_test(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01976}01976 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01977}01977     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} tmp[6];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01978}01978     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} tries = 10;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01979}01979     \textcolor{keywordtype}{int} result = 0x07;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01980}01980     \textcolor{keywordtype}{short} data;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01981}01981 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01982}01982     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga36f70f38371b48d81094d3b061233e15}{mpu\_set\_bypass}}(1);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01983}01983 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01984}01984     tmp[0] = AKM\_POWER\_DOWN;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01985}01985     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.compass\_addr, AKM\_REG\_CNTL, 1, tmp))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01986}01986         \textcolor{keywordflow}{return} 0x07;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01987}01987     tmp[0] = AKM\_BIT\_SELF\_TEST;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01988}01988     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.compass\_addr, AKM\_REG\_ASTC, 1, tmp))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01989}01989         \textcolor{keywordflow}{goto} AKM\_restore;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01990}01990     tmp[0] = AKM\_MODE\_SELF\_TEST;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01991}01991     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.compass\_addr, AKM\_REG\_CNTL, 1, tmp))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01992}01992         \textcolor{keywordflow}{goto} AKM\_restore;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01993}01993 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01994}01994     \textcolor{keywordflow}{do} \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01995}01995         \mbox{\hyperlink{group___d_r_i_v_e_r_s_gae36aca5baf9b6b7d74992aef00686d67}{delay\_ms}}(10);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01996}01996         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga838d8f1c7b0d8cc83923b93bbafe1b33}{i2c\_read}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.compass\_addr, AKM\_REG\_ST1, 1, tmp))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01997}01997             \textcolor{keywordflow}{goto} AKM\_restore;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01998}01998         \textcolor{keywordflow}{if} (tmp[0] \& AKM\_DATA\_READY)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l01999}01999             \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02000}02000     \} \textcolor{keywordflow}{while} (tries-\/-\/);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02001}02001     \textcolor{keywordflow}{if} (!(tmp[0] \& AKM\_DATA\_READY))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02002}02002         \textcolor{keywordflow}{goto} AKM\_restore;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02003}02003 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02004}02004     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga838d8f1c7b0d8cc83923b93bbafe1b33}{i2c\_read}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.compass\_addr, AKM\_REG\_HXL, 6, tmp))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02005}02005         \textcolor{keywordflow}{goto} AKM\_restore;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02006}02006 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02007}02007     result = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02008}02008     data = (short)(tmp[1] << 8) | tmp[0];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02009}02009     \textcolor{keywordflow}{if} ((data > 100) || (data < -\/100))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02010}02010         result |= 0x01;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02011}02011     data = (short)(tmp[3] << 8) | tmp[2];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02012}02012     \textcolor{keywordflow}{if} ((data > 100) || (data < -\/100))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02013}02013         result |= 0x02;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02014}02014     data = (short)(tmp[5] << 8) | tmp[4];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02015}02015     \textcolor{keywordflow}{if} ((data > -\/300) || (data < -\/1000))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02016}02016         result |= 0x04;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02017}02017 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02018}02018 AKM\_restore:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02019}02019     tmp[0] = 0 | SUPPORTS\_AK89xx\_HIGH\_SENS;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02020}02020     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.compass\_addr, AKM\_REG\_ASTC, 1, tmp);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02021}02021     tmp[0] = SUPPORTS\_AK89xx\_HIGH\_SENS;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02022}02022     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.compass\_addr, AKM\_REG\_CNTL, 1, tmp);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02023}02023     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga36f70f38371b48d81094d3b061233e15}{mpu\_set\_bypass}}(0);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02024}02024     \textcolor{keywordflow}{return} result;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02025}02025 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02026}02026 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02027}02027 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02028}02028 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02029}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8d087842b07e9710be2267adea4b497a}{02029}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8d087842b07e9710be2267adea4b497a}{get\_st\_biases}}(\textcolor{keywordtype}{long} *gyro, \textcolor{keywordtype}{long} *accel, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} hw\_test)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02030}02030 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02031}02031     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} data[\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga973c680573b37fc359fc68d0707da355}{MAX\_PACKET\_LENGTH}}];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02032}02032     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} packet\_count, ii;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02033}02033     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} fifo\_count;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02034}02034 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02035}02035     data[0] = 0x01;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02036}02036     data[1] = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02037}02037     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa01fb0872030e8e2932f8d1d257ea86a}{pwr\_mgmt\_1}}, 2, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02038}02038         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02039}02039     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gae36aca5baf9b6b7d74992aef00686d67}{delay\_ms}}(200);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02040}02040     data[0] = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02041}02041     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga48b47844d4b0570e60aa6806faa59eae}{int\_enable}}, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02042}02042         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02043}02043     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6a392b7ecae843c734db3d832f11af49}{fifo\_en}}, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02044}02044         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02045}02045     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa01fb0872030e8e2932f8d1d257ea86a}{pwr\_mgmt\_1}}, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02046}02046         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02047}02047     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2bf6dc826bcb17168013f303c904544b}{i2c\_mst}}, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02048}02048         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02049}02049     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga12505a7d8cd7c976e5571f27a6160d23}{user\_ctrl}}, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02050}02050         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02051}02051     data[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaeae2cc64314ad05f3a93d2358a2369db}{BIT\_FIFO\_RST}} | \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga37d5ceb74c3568e4bab6dcdd0afaa95b}{BIT\_DMP\_RST}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02052}02052     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga12505a7d8cd7c976e5571f27a6160d23}{user\_ctrl}}, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02053}02053         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02054}02054     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gae36aca5baf9b6b7d74992aef00686d67}{delay\_ms}}(15);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02055}02055     data[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5a1563d12b0aab5e65317621742f6f62}{test}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga09f5a9ab86d36f3b83e7f4abdea73e39}{reg\_lpf}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02056}02056     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga22eeac0bd77e7d99b3e15dda52f1bd08}{lpf}}, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02057}02057         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02058}02058     data[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5a1563d12b0aab5e65317621742f6f62}{test}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3bef0c9f009cea4cbe01d0ee91126d83}{reg\_rate\_div}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02059}02059     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga27dd9db31f16ca170520b3009255e6d0}{rate\_div}}, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02060}02060         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02061}02061     \textcolor{keywordflow}{if} (hw\_test)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02062}02062         data[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5a1563d12b0aab5e65317621742f6f62}{test}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa0dfe8b2c29358e9e045aaa8beff244d}{reg\_gyro\_fsr}} | 0xE0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02063}02063     \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02064}02064         data[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5a1563d12b0aab5e65317621742f6f62}{test}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa0dfe8b2c29358e9e045aaa8beff244d}{reg\_gyro\_fsr}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02065}02065     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gada0b973f74cc874552f079fd58c435a6}{gyro\_cfg}}, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02066}02066         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02067}02067 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02068}02068     \textcolor{keywordflow}{if} (hw\_test)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02069}02069         data[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5a1563d12b0aab5e65317621742f6f62}{test}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3b54f67ea7f1dd47fd8aa48dda051032}{reg\_accel\_fsr}} | 0xE0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02070}02070     \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02071}02071         data[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1e8f8b1ef7fb2c429e1ce7c2f9985530}{test}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3b54f67ea7f1dd47fd8aa48dda051032}{reg\_accel\_fsr}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02072}02072     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gae93a446c54cc00bc7f11209d7af0025e}{accel\_cfg}}, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02073}02073         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02074}02074     \textcolor{keywordflow}{if} (hw\_test)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02075}02075         \mbox{\hyperlink{group___d_r_i_v_e_r_s_gae36aca5baf9b6b7d74992aef00686d67}{delay\_ms}}(200);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02076}02076 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02077}02077     \textcolor{comment}{/* Fill FIFO for test.wait\_ms milliseconds. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02078}02078     data[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gae3c4a18accb84992faaf2534a84a147c}{BIT\_FIFO\_EN}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02079}02079     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga12505a7d8cd7c976e5571f27a6160d23}{user\_ctrl}}, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02080}02080         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02081}02081 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02082}02082     data[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3fdc30f9c0a26c2c4e2bb88921f91629}{INV\_XYZ\_GYRO}} | \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa03f025a17ed491e70b88274e89c75c5}{INV\_XYZ\_ACCEL}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02083}02083     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6a392b7ecae843c734db3d832f11af49}{fifo\_en}}, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02084}02084         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02085}02085     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gae36aca5baf9b6b7d74992aef00686d67}{delay\_ms}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1e8f8b1ef7fb2c429e1ce7c2f9985530}{test}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf5d495939c8ca761ac2bbe7791dcd727}{wait\_ms}});}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02086}02086     data[0] = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02087}02087     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6a392b7ecae843c734db3d832f11af49}{fifo\_en}}, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02088}02088         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02089}02089 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02090}02090     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga838d8f1c7b0d8cc83923b93bbafe1b33}{i2c\_read}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab7503974d62cf9c2d688579fcd1abd48}{fifo\_count\_h}}, 2, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02091}02091         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02092}02092 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02093}02093     fifo\_count = (data[0] << 8) | data[1];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02094}02094     packet\_count = fifo\_count / \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga973c680573b37fc359fc68d0707da355}{MAX\_PACKET\_LENGTH}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02095}02095     gyro[0] = gyro[1] = gyro[2] = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02096}02096     accel[0] = accel[1] = accel[2] = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02097}02097 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02098}02098     \textcolor{keywordflow}{for} (ii = 0; ii < packet\_count; ii++) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02099}02099         \textcolor{keywordtype}{short} accel\_cur[3], gyro\_cur[3];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02100}02100         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga838d8f1c7b0d8cc83923b93bbafe1b33}{i2c\_read}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb6763dc5f368ea01ef7c733cea9dab4}{fifo\_r\_w}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga973c680573b37fc359fc68d0707da355}{MAX\_PACKET\_LENGTH}}, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02101}02101             \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02102}02102         accel\_cur[0] = ((short)data[0] << 8) | data[1];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02103}02103         accel\_cur[1] = ((short)data[2] << 8) | data[3];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02104}02104         accel\_cur[2] = ((short)data[4] << 8) | data[5];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02105}02105         accel[0] += (long)accel\_cur[0];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02106}02106         accel[1] += (long)accel\_cur[1];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02107}02107         accel[2] += (long)accel\_cur[2];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02108}02108         gyro\_cur[0] = (((short)data[6] << 8) | data[7]);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02109}02109         gyro\_cur[1] = (((short)data[8] << 8) | data[9]);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02110}02110         gyro\_cur[2] = (((short)data[10] << 8) | data[11]);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02111}02111         gyro[0] += (long)gyro\_cur[0];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02112}02112         gyro[1] += (long)gyro\_cur[1];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02113}02113         gyro[2] += (long)gyro\_cur[2];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02114}02114     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02115}02115 \textcolor{preprocessor}{\#ifdef EMPL\_NO\_64BIT}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02116}02116     gyro[0] = (long)(((\textcolor{keywordtype}{float})gyro[0]*65536.f) / \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1e8f8b1ef7fb2c429e1ce7c2f9985530}{test}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga330290a347407b0d92b1d77aa274993c}{gyro\_sens}} / packet\_count);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02117}02117     gyro[1] = (long)(((\textcolor{keywordtype}{float})gyro[1]*65536.f) / \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1e8f8b1ef7fb2c429e1ce7c2f9985530}{test}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga330290a347407b0d92b1d77aa274993c}{gyro\_sens}} / packet\_count);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02118}02118     gyro[2] = (long)(((\textcolor{keywordtype}{float})gyro[2]*65536.f) / \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1e8f8b1ef7fb2c429e1ce7c2f9985530}{test}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga330290a347407b0d92b1d77aa274993c}{gyro\_sens}} / packet\_count);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02119}02119     \textcolor{keywordflow}{if} (has\_accel) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02120}02120         accel[0] = (long)(((\textcolor{keywordtype}{float})accel[0]*65536.f) / \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1e8f8b1ef7fb2c429e1ce7c2f9985530}{test}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5f602885d6a544a9039b13a0cc7ac085}{accel\_sens}} /}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02121}02121             packet\_count);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02122}02122         accel[1] = (long)(((\textcolor{keywordtype}{float})accel[1]*65536.f) / \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1e8f8b1ef7fb2c429e1ce7c2f9985530}{test}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5f602885d6a544a9039b13a0cc7ac085}{accel\_sens}} /}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02123}02123             packet\_count);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02124}02124         accel[2] = (long)(((\textcolor{keywordtype}{float})accel[2]*65536.f) / \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1e8f8b1ef7fb2c429e1ce7c2f9985530}{test}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5f602885d6a544a9039b13a0cc7ac085}{accel\_sens}} /}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02125}02125             packet\_count);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02126}02126         \textcolor{comment}{/* Don't remove gravity! */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02127}02127         accel[2] -\/= 65536L;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02128}02128     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02129}02129 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02130}02130     gyro[0] = (long)(((\textcolor{keywordtype}{long} \textcolor{keywordtype}{long})gyro[0]<<16) / \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1e8f8b1ef7fb2c429e1ce7c2f9985530}{test}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga330290a347407b0d92b1d77aa274993c}{gyro\_sens}} / packet\_count);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02131}02131     gyro[1] = (long)(((\textcolor{keywordtype}{long} \textcolor{keywordtype}{long})gyro[1]<<16) / \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1e8f8b1ef7fb2c429e1ce7c2f9985530}{test}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga330290a347407b0d92b1d77aa274993c}{gyro\_sens}} / packet\_count);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02132}02132     gyro[2] = (long)(((\textcolor{keywordtype}{long} \textcolor{keywordtype}{long})gyro[2]<<16) / \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1e8f8b1ef7fb2c429e1ce7c2f9985530}{test}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga330290a347407b0d92b1d77aa274993c}{gyro\_sens}} / packet\_count);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02133}02133     accel[0] = (long)(((\textcolor{keywordtype}{long} \textcolor{keywordtype}{long})accel[0]<<16) / \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1e8f8b1ef7fb2c429e1ce7c2f9985530}{test}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5f602885d6a544a9039b13a0cc7ac085}{accel\_sens}} /}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02134}02134         packet\_count);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02135}02135     accel[1] = (long)(((\textcolor{keywordtype}{long} \textcolor{keywordtype}{long})accel[1]<<16) / \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1e8f8b1ef7fb2c429e1ce7c2f9985530}{test}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5f602885d6a544a9039b13a0cc7ac085}{accel\_sens}} /}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02136}02136         packet\_count);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02137}02137     accel[2] = (long)(((\textcolor{keywordtype}{long} \textcolor{keywordtype}{long})accel[2]<<16) / \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1e8f8b1ef7fb2c429e1ce7c2f9985530}{test}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5f602885d6a544a9039b13a0cc7ac085}{accel\_sens}} /}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02138}02138         packet\_count);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02139}02139     \textcolor{comment}{/* Don't remove gravity! */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02140}02140     \textcolor{keywordflow}{if} (accel[2] > 0L)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02141}02141         accel[2] -\/= 65536L;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02142}02142     \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02143}02143         accel[2] += 65536L;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02144}02144 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02145}02145 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02146}02146     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02147}02147 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02148}02148 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02169}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3773dc98eb1ba15da0091ae75abcf62f}{02169}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3773dc98eb1ba15da0091ae75abcf62f}{mpu\_run\_self\_test}}(\textcolor{keywordtype}{long} *gyro, \textcolor{keywordtype}{long} *accel)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02170}02170 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02171}02171 \textcolor{preprocessor}{\#ifdef MPU6050}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02172}02172     \textcolor{keyword}{const} \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} tries = 2;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02173}02173     \textcolor{keywordtype}{long} gyro\_st[3], accel\_st[3];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02174}02174     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} accel\_result, gyro\_result;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02175}02175 \textcolor{preprocessor}{\#ifdef AK89xx\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02176}02176     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} compass\_result;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02177}02177 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02178}02178     \textcolor{keywordtype}{int} ii;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02179}02179 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02180}02180     \textcolor{keywordtype}{int} result;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02181}02181     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} accel\_fsr, fifo\_sensors, sensors\_on;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02182}02182     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} gyro\_fsr, sample\_rate, lpf;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02183}02183     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} dmp\_was\_on;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02184}02184 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02185}02185     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4783ed8aa79a3b5de798963819997c38}{dmp\_on}}) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02186}02186         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga68ed20e6c9663cd7c50469329af8715f}{mpu\_set\_dmp\_state}}(0);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02187}02187         dmp\_was\_on = 1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02188}02188     \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02189}02189         dmp\_was\_on = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02190}02190 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02191}02191     \textcolor{comment}{/* Get initial settings. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02192}02192     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf973c32c73ba912ff512aab948fc31ca}{mpu\_get\_gyro\_fsr}}(\&gyro\_fsr);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02193}02193     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gab6087a15ee23db23b6aec41590329a60}{mpu\_get\_accel\_fsr}}(\&accel\_fsr);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02194}02194     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa95c7e216dcb2d888e9796001ca555f8}{mpu\_get\_lpf}}(\&lpf);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02195}02195     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2487dd551b701c1c7ed4d6335f02b2f1}{mpu\_get\_sample\_rate}}(\&sample\_rate);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02196}02196     sensors\_on = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa996fc14aa630e53823462baf460c13f}{sensors}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02197}02197     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga093f11eb10b2639a4b9fe344ea348c54}{mpu\_get\_fifo\_config}}(\&fifo\_sensors);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02198}02198 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02199}02199     \textcolor{comment}{/* For older chips, the self-\/test will be different. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02200}02200 \textcolor{preprocessor}{\#if defined MPU6050}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02201}02201     \textcolor{keywordflow}{for} (ii = 0; ii < tries; ii++)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02202}02202         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8d087842b07e9710be2267adea4b497a}{get\_st\_biases}}(gyro, accel, 0))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02203}02203             \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02204}02204     \textcolor{keywordflow}{if} (ii == tries) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02205}02205         \textcolor{comment}{/* If we reach this point, we most likely encountered an I2C error.}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02206}02206 \textcolor{comment}{         * We'll just report an error for all three sensors.}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02207}02207 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02208}02208         result = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02209}02209         \textcolor{keywordflow}{goto} restore;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02210}02210     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02211}02211     \textcolor{keywordflow}{for} (ii = 0; ii < tries; ii++)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02212}02212         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8d087842b07e9710be2267adea4b497a}{get\_st\_biases}}(gyro\_st, accel\_st, 1))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02213}02213             \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02214}02214     \textcolor{keywordflow}{if} (ii == tries) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02215}02215         \textcolor{comment}{/* Again, probably an I2C error. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02216}02216         result = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02217}02217         \textcolor{keywordflow}{goto} restore;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02218}02218     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02219}02219     accel\_result = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaab48ddb3bd05cea3f0fc85a68db9934d}{accel\_self\_test}}(accel, accel\_st);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02220}02220     gyro\_result = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga267d6f443d5be8b2a7a06aa007116f7a}{gyro\_self\_test}}(gyro, gyro\_st);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02221}02221 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02222}02222     result = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02223}02223     \textcolor{keywordflow}{if} (!gyro\_result)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02224}02224         result |= 0x01;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02225}02225     \textcolor{keywordflow}{if} (!accel\_result)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02226}02226         result |= 0x02;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02227}02227 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02228}02228 \textcolor{preprocessor}{\#ifdef AK89xx\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02229}02229     compass\_result = compass\_self\_test();}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02230}02230     \textcolor{keywordflow}{if} (!compass\_result)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02231}02231         result |= 0x04;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02232}02232 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02233}02233 restore:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02234}02234 \textcolor{preprocessor}{\#elif defined MPU6500}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02235}02235     \textcolor{comment}{/* For now, this function will return a "{}pass"{} result for all three sensors}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02236}02236 \textcolor{comment}{     * for compatibility with current test applications.}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02237}02237 \textcolor{comment}{     */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02238}02238     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8d087842b07e9710be2267adea4b497a}{get\_st\_biases}}(gyro, accel, 0);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02239}02239     result = 0x7;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02240}02240 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02241}02241     \textcolor{comment}{/* Set to invalid values to ensure no I2C writes are skipped. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02242}02242     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab45a727aeee17380828a3e20ccb375c2}{gyro\_fsr}} = 0xFF;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02243}02243     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf66873be1446ed552812e32d40eced61}{accel\_fsr}} = 0xFF;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02244}02244     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga16ec8ca8298f62ac01419775377270fb}{lpf}} = 0xFF;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02245}02245     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2660470fcf7b53e2e832a397cbe6c354}{sample\_rate}} = 0xFFFF;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02246}02246     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa996fc14aa630e53823462baf460c13f}{sensors}} = 0xFF;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02247}02247     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga88143c31b894bcd819c0e49b0ff267aa}{fifo\_enable}} = 0xFF;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02248}02248     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab7bd5165d6e62cb0d814cf3401958445}{clk\_src}} = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga75570f009627c6f4ddfb2d936d81e207a01b240917a78674d3e387110a6a8f94c}{INV\_CLK\_PLL}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02249}02249     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gad09e6031c8677adc0b8a39b6deea8e27}{mpu\_set\_gyro\_fsr}}(gyro\_fsr);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02250}02250     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2713a96af104cfb2ae8e0ed4c3718119}{mpu\_set\_accel\_fsr}}(accel\_fsr);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02251}02251     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5661a9dee25152166769910767a2a93d}{mpu\_set\_lpf}}(lpf);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02252}02252     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga0144d666a67a82888b8580002afe8b55}{mpu\_set\_sample\_rate}}(sample\_rate);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02253}02253     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6e77e7cc1cf6be5e8fdf617c5b4586d1}{mpu\_set\_sensors}}(sensors\_on);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02254}02254     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gababbdda287e1f19323489f90a0889dd7}{mpu\_configure\_fifo}}(fifo\_sensors);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02255}02255 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02256}02256     \textcolor{keywordflow}{if} (dmp\_was\_on)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02257}02257         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga68ed20e6c9663cd7c50469329af8715f}{mpu\_set\_dmp\_state}}(1);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02258}02258 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02259}02259     \textcolor{keywordflow}{return} result;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02260}02260 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02261}02261 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02271}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gafea59910bc3dd30ba3356b1c75213a5f}{02271}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gafea59910bc3dd30ba3356b1c75213a5f}{mpu\_write\_mem}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} mem\_addr, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} length,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02272}02272         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} *data)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02273}02273 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02274}02274     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} tmp[2];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02275}02275 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02276}02276     \textcolor{keywordflow}{if} (!data)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02277}02277         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02278}02278     \textcolor{keywordflow}{if} (!\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa996fc14aa630e53823462baf460c13f}{sensors}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02279}02279         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02280}02280 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02281}02281     tmp[0] = (\textcolor{keywordtype}{unsigned} char)(mem\_addr >> 8);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02282}02282     tmp[1] = (\textcolor{keywordtype}{unsigned} char)(mem\_addr \& 0xFF);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02283}02283 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02284}02284     \textcolor{comment}{/* Check bank boundaries. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02285}02285     \textcolor{keywordflow}{if} (tmp[1] + length > \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaef4a2014cd6e3d5faeb8f713ee3606ed}{bank\_size}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02286}02286         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02287}02287 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02288}02288     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf1b74c33fa828ea4dc172bfbaaf47216}{bank\_sel}}, 2, tmp))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02289}02289         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02290}02290     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gae17166b43fa12a960c0eced9a3c04bf0}{mem\_r\_w}}, length, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02291}02291         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02292}02292     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02293}02293 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02294}02294 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02304}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3374bececb6743893c9eab27645c1182}{02304}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3374bececb6743893c9eab27645c1182}{mpu\_read\_mem}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} mem\_addr, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} length,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02305}02305         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} *data)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02306}02306 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02307}02307     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} tmp[2];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02308}02308 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02309}02309     \textcolor{keywordflow}{if} (!data)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02310}02310         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02311}02311     \textcolor{keywordflow}{if} (!\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa996fc14aa630e53823462baf460c13f}{sensors}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02312}02312         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02313}02313 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02314}02314     tmp[0] = (\textcolor{keywordtype}{unsigned} char)(mem\_addr >> 8);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02315}02315     tmp[1] = (\textcolor{keywordtype}{unsigned} char)(mem\_addr \& 0xFF);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02316}02316 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02317}02317     \textcolor{comment}{/* Check bank boundaries. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02318}02318     \textcolor{keywordflow}{if} (tmp[1] + length > \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaef4a2014cd6e3d5faeb8f713ee3606ed}{bank\_size}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02319}02319         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02320}02320 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02321}02321     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf1b74c33fa828ea4dc172bfbaaf47216}{bank\_sel}}, 2, tmp))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02322}02322         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02323}02323     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga838d8f1c7b0d8cc83923b93bbafe1b33}{i2c\_read}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gae17166b43fa12a960c0eced9a3c04bf0}{mem\_r\_w}}, length, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02324}02324         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02325}02325     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02326}02326 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02327}02327 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02336}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8fbdfe1a50285d4ab438e29c2efc70f5}{02336}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8fbdfe1a50285d4ab438e29c2efc70f5}{mpu\_load\_firmware}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} length, \textcolor{keyword}{const} \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} *firmware,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02337}02337     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} start\_addr, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} sample\_rate)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02338}02338 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02339}02339     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} ii;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02340}02340     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} this\_write;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02341}02341     \textcolor{comment}{/* Must divide evenly into st.hw-\/>bank\_size to avoid bank crossings. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02342}02342 \textcolor{preprocessor}{\#define LOAD\_CHUNK  (16)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02343}02343     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} cur[\mbox{\hyperlink{inv__mpu_8c_a7750730ae7e5c713b619e347d44185fe}{LOAD\_CHUNK}}], tmp[2];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02344}02344 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02345}02345     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1d2ff55e17aae1459dfad61d76054b1b}{dmp\_loaded}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02346}02346         \textcolor{comment}{/* DMP should only be loaded once. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02347}02347         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02348}02348 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02349}02349     \textcolor{keywordflow}{if} (!firmware)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02350}02350         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02351}02351     \textcolor{keywordflow}{for} (ii = 0; ii < length; ii += this\_write) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02352}02352         this\_write = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gac6afabdc09a49a433ee19d8a9486056d}{min}}(\mbox{\hyperlink{inv__mpu_8c_a7750730ae7e5c713b619e347d44185fe}{LOAD\_CHUNK}}, length -\/ ii);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02353}02353         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gafea59910bc3dd30ba3356b1c75213a5f}{mpu\_write\_mem}}(ii, this\_write, (\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char}*)\&firmware[ii]))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02354}02354             \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02355}02355         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3374bececb6743893c9eab27645c1182}{mpu\_read\_mem}}(ii, this\_write, cur))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02356}02356             \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02357}02357         \textcolor{keywordflow}{if} (memcmp(firmware+ii, cur, this\_write))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02358}02358             \textcolor{keywordflow}{return} -\/2;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02359}02359     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02360}02360 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02361}02361     \textcolor{comment}{/* Set program start address. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02362}02362     tmp[0] = start\_addr >> 8;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02363}02363     tmp[1] = start\_addr \& 0xFF;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02364}02364     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaac4aac12b0e82272affd408b24dc9c95}{prgm\_start\_h}}, 2, tmp))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02365}02365         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02366}02366 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02367}02367     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1d2ff55e17aae1459dfad61d76054b1b}{dmp\_loaded}} = 1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02368}02368     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5f42b7e1e740f2fb64427417e9e2dab7}{dmp\_sample\_rate}} = sample\_rate;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02369}02369     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02370}02370 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02371}02371 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02377}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga68ed20e6c9663cd7c50469329af8715f}{02377}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga68ed20e6c9663cd7c50469329af8715f}{mpu\_set\_dmp\_state}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} enable)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02378}02378 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02379}02379     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} tmp;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02380}02380     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4783ed8aa79a3b5de798963819997c38}{dmp\_on}} == enable)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02381}02381         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02382}02382 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02383}02383     \textcolor{keywordflow}{if} (enable) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02384}02384         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1d2ff55e17aae1459dfad61d76054b1b}{dmp\_loaded}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02385}02385             \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02386}02386         \textcolor{comment}{/* Disable data ready interrupt. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02387}02387         \mbox{\hyperlink{group___d_r_i_v_e_r_s_gafd5ebff6b0179e1dce0b68c2272cae07}{set\_int\_enable}}(0);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02388}02388         \textcolor{comment}{/* Disable bypass mode. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02389}02389         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga36f70f38371b48d81094d3b061233e15}{mpu\_set\_bypass}}(0);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02390}02390         \textcolor{comment}{/* Keep constant sample rate, FIFO rate controlled by DMP. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02391}02391         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga0144d666a67a82888b8580002afe8b55}{mpu\_set\_sample\_rate}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5f42b7e1e740f2fb64427417e9e2dab7}{dmp\_sample\_rate}});}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02392}02392         \textcolor{comment}{/* Remove FIFO elements. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02393}02393         tmp = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02394}02394         \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, 0x23, 1, \&tmp);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02395}02395         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4783ed8aa79a3b5de798963819997c38}{dmp\_on}} = 1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02396}02396         \textcolor{comment}{/* Enable DMP interrupt. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02397}02397         \mbox{\hyperlink{group___d_r_i_v_e_r_s_gafd5ebff6b0179e1dce0b68c2272cae07}{set\_int\_enable}}(1);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02398}02398         \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf23e9f57c0059be6ec57862f0584de10}{mpu\_reset\_fifo}}();}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02399}02399     \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02400}02400         \textcolor{comment}{/* Disable DMP interrupt. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02401}02401         \mbox{\hyperlink{group___d_r_i_v_e_r_s_gafd5ebff6b0179e1dce0b68c2272cae07}{set\_int\_enable}}(0);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02402}02402         \textcolor{comment}{/* Restore FIFO settings. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02403}02403         tmp = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga88143c31b894bcd819c0e49b0ff267aa}{fifo\_enable}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02404}02404         \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, 0x23, 1, \&tmp);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02405}02405         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4783ed8aa79a3b5de798963819997c38}{dmp\_on}} = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02406}02406         \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf23e9f57c0059be6ec57862f0584de10}{mpu\_reset\_fifo}}();}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02407}02407     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02408}02408     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02409}02409 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02410}02410 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02416}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gafe0f60ed0d7f8fd2dcd55d45b95a2363}{02416}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gafe0f60ed0d7f8fd2dcd55d45b95a2363}{mpu\_get\_dmp\_state}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} *enabled)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02417}02417 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02418}02418     enabled[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4783ed8aa79a3b5de798963819997c38}{dmp\_on}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02419}02419     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02420}02420 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02421}02421 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02422}02422 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02423}02423 \textcolor{comment}{/* This initialization is similar to the one in ak8975.c. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02424}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4764ce0ba4e07a4c774f69ab3b83d1f9}{02424}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4764ce0ba4e07a4c774f69ab3b83d1f9}{setup\_compass}}(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02425}02425 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02426}02426 \textcolor{preprocessor}{\#ifdef AK89xx\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02427}02427     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} data[4], akm\_addr;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02428}02428 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02429}02429     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga36f70f38371b48d81094d3b061233e15}{mpu\_set\_bypass}}(1);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02430}02430 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02431}02431     \textcolor{comment}{/* Find compass. Possible addresses range from 0x0C to 0x0F. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02432}02432     \textcolor{keywordflow}{for} (akm\_addr = 0x0C; akm\_addr <= 0x0F; akm\_addr++) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02433}02433         \textcolor{keywordtype}{int} result;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02434}02434         result = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga838d8f1c7b0d8cc83923b93bbafe1b33}{i2c\_read}}(akm\_addr, AKM\_REG\_WHOAMI, 1, data);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02435}02435         \textcolor{keywordflow}{if} (!result \&\& (data[0] == AKM\_WHOAMI))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02436}02436             \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02437}02437     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02438}02438 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02439}02439     \textcolor{keywordflow}{if} (akm\_addr > 0x0F) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02440}02440         \textcolor{comment}{/* TODO: Handle this case in all compass-\/related functions. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02441}02441         \mbox{\hyperlink{group___d_r_i_v_e_r_s_gab354affc295f7d61fe8a355c9361cc5a}{log\_e}}(\textcolor{stringliteral}{"{}Compass not found.\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02442}02442         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02443}02443     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02444}02444 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02445}02445     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.compass\_addr = akm\_addr;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02446}02446 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02447}02447     data[0] = AKM\_POWER\_DOWN;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02448}02448     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.compass\_addr, AKM\_REG\_CNTL, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02449}02449         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02450}02450     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gae36aca5baf9b6b7d74992aef00686d67}{delay\_ms}}(1);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02451}02451 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02452}02452     data[0] = AKM\_FUSE\_ROM\_ACCESS;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02453}02453     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.compass\_addr, AKM\_REG\_CNTL, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02454}02454         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02455}02455     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gae36aca5baf9b6b7d74992aef00686d67}{delay\_ms}}(1);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02456}02456 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02457}02457     \textcolor{comment}{/* Get sensitivity adjustment data from fuse ROM. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02458}02458     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga838d8f1c7b0d8cc83923b93bbafe1b33}{i2c\_read}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.compass\_addr, AKM\_REG\_ASAX, 3, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02459}02459         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02460}02460     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.mag\_sens\_adj[0] = (long)data[0] + 128;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02461}02461     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.mag\_sens\_adj[1] = (long)data[1] + 128;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02462}02462     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.mag\_sens\_adj[2] = (long)data[2] + 128;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02463}02463 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02464}02464     data[0] = AKM\_POWER\_DOWN;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02465}02465     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.compass\_addr, AKM\_REG\_CNTL, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02466}02466         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02467}02467     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gae36aca5baf9b6b7d74992aef00686d67}{delay\_ms}}(1);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02468}02468 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02469}02469     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga36f70f38371b48d81094d3b061233e15}{mpu\_set\_bypass}}(0);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02470}02470 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02471}02471     \textcolor{comment}{/* Set up master mode, master clock, and ES bit. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02472}02472     data[0] = 0x40;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02473}02473     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2bf6dc826bcb17168013f303c904544b}{i2c\_mst}}, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02474}02474         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02475}02475 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02476}02476     \textcolor{comment}{/* Slave 0 reads from AKM data registers. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02477}02477     data[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8ef1963ec6fb3df5586e50959cf00a70}{BIT\_I2C\_READ}} | \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.compass\_addr;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02478}02478     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>s0\_addr, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02479}02479         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02480}02480 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02481}02481     \textcolor{comment}{/* Compass reads start at this register. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02482}02482     data[0] = AKM\_REG\_ST1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02483}02483     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>s0\_reg, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02484}02484         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02485}02485 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02486}02486     \textcolor{comment}{/* Enable slave 0, 8-\/byte reads. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02487}02487     data[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gae9440f48b6d70d900366dc040a8714d7}{BIT\_SLAVE\_EN}} | 8;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02488}02488     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>s0\_ctrl, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02489}02489         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02490}02490 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02491}02491     \textcolor{comment}{/* Slave 1 changes AKM measurement mode. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02492}02492     data[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.compass\_addr;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02493}02493     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>s1\_addr, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02494}02494         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02495}02495 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02496}02496     \textcolor{comment}{/* AKM measurement mode register. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02497}02497     data[0] = AKM\_REG\_CNTL;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02498}02498     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>s1\_reg, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02499}02499         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02500}02500 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02501}02501     \textcolor{comment}{/* Enable slave 1, 1-\/byte writes. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02502}02502     data[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gae9440f48b6d70d900366dc040a8714d7}{BIT\_SLAVE\_EN}} | 1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02503}02503     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>s1\_ctrl, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02504}02504         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02505}02505 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02506}02506     \textcolor{comment}{/* Set slave 1 data. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02507}02507     data[0] = AKM\_SINGLE\_MEASUREMENT;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02508}02508     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>s1\_do, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02509}02509         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02510}02510 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02511}02511     \textcolor{comment}{/* Trigger slave 0 and slave 1 actions at each sample. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02512}02512     data[0] = 0x03;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02513}02513     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>i2c\_delay\_ctrl, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02514}02514         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02515}02515 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02516}02516 \textcolor{preprocessor}{\#ifdef MPU9150}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02517}02517     \textcolor{comment}{/* For the MPU9150, the auxiliary I2C bus needs to be set to VDD. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02518}02518     data[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gac52d7caf4efc485ef6faa1211bfe60dc}{BIT\_I2C\_MST\_VDDIO}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02519}02519     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>yg\_offs\_tc, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02520}02520         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02521}02521 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02522}02522 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02523}02523     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02524}02524 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02525}02525     \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02526}02526 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02527}02527 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02528}02528 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02535}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga65e6b0ce980b8c0255d7be9b55c88c08}{02535}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga65e6b0ce980b8c0255d7be9b55c88c08}{mpu\_get\_compass\_reg}}(\textcolor{keywordtype}{short} *data, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} *timestamp)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02536}02536 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02537}02537 \textcolor{preprocessor}{\#ifdef AK89xx\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02538}02538     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} tmp[9];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02539}02539 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02540}02540     \textcolor{keywordflow}{if} (!(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa996fc14aa630e53823462baf460c13f}{sensors}} \& \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga7fc9c1dbdcb2ac8cc2a4128a5799482a}{INV\_XYZ\_COMPASS}}))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02541}02541         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02542}02542 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02543}02543 \textcolor{preprocessor}{\#ifdef AK89xx\_BYPASS}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02544}02544     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga838d8f1c7b0d8cc83923b93bbafe1b33}{i2c\_read}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.compass\_addr, AKM\_REG\_ST1, 8, tmp))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02545}02545         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02546}02546     tmp[8] = AKM\_SINGLE\_MEASUREMENT;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02547}02547     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.compass\_addr, AKM\_REG\_CNTL, 1, tmp+8))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02548}02548         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02549}02549 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02550}02550     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga838d8f1c7b0d8cc83923b93bbafe1b33}{i2c\_read}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>raw\_compass, 8, tmp))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02551}02551         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02552}02552 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02553}02553 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02554}02554 \textcolor{preprocessor}{\#if defined AK8975\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02555}02555     \textcolor{comment}{/* AK8975 doesn't have the overrun error bit. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02556}02556     \textcolor{keywordflow}{if} (!(tmp[0] \& AKM\_DATA\_READY))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02557}02557         \textcolor{keywordflow}{return} -\/2;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02558}02558     \textcolor{keywordflow}{if} ((tmp[7] \& AKM\_OVERFLOW) || (tmp[7] \& AKM\_DATA\_ERROR))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02559}02559         \textcolor{keywordflow}{return} -\/3;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02560}02560 \textcolor{preprocessor}{\#elif defined AK8963\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02561}02561     \textcolor{comment}{/* AK8963 doesn't have the data read error bit. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02562}02562     \textcolor{keywordflow}{if} (!(tmp[0] \& AKM\_DATA\_READY) || (tmp[0] \& AKM\_DATA\_OVERRUN))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02563}02563         \textcolor{keywordflow}{return} -\/2;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02564}02564     \textcolor{keywordflow}{if} (tmp[7] \& AKM\_OVERFLOW)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02565}02565         \textcolor{keywordflow}{return} -\/3;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02566}02566 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02567}02567     data[0] = (tmp[2] << 8) | tmp[1];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02568}02568     data[1] = (tmp[4] << 8) | tmp[3];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02569}02569     data[2] = (tmp[6] << 8) | tmp[5];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02570}02570 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02571}02571     data[0] = ((long)data[0] * \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.mag\_sens\_adj[0]) >> 8;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02572}02572     data[1] = ((long)data[1] * \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.mag\_sens\_adj[1]) >> 8;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02573}02573     data[2] = ((long)data[2] * \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.mag\_sens\_adj[2]) >> 8;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02574}02574 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02575}02575     \textcolor{keywordflow}{if} (timestamp)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02576}02576         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3e6b6bc6d1cd2956353a31bfadd3c332}{get\_ms}}(timestamp);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02577}02577     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02578}02578 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02579}02579     \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02580}02580 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02581}02581 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02582}02582 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02588}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gade8589573d09e0f14b84130428f286df}{02588}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gade8589573d09e0f14b84130428f286df}{mpu\_get\_compass\_fsr}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} *fsr)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02589}02589 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02590}02590 \textcolor{preprocessor}{\#ifdef AK89xx\_SECONDARY}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02591}02591     fsr[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>compass\_fsr;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02592}02592     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02593}02593 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02594}02594     \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02595}02595 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02596}02596 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02597}02597 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02642}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga7d0b3259346898ccd1ba6ef78bf7df97}{02642}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga7d0b3259346898ccd1ba6ef78bf7df97}{mpu\_lp\_motion\_interrupt}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} thresh, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} time,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02643}02643     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} lpa\_freq)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02644}02644 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02645}02645     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} data[3];}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02646}02646 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02647}02647     \textcolor{keywordflow}{if} (lpa\_freq) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02648}02648         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} thresh\_hw;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02649}02649 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02650}02650 \textcolor{preprocessor}{\#if defined MPU6050}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02651}02651         \textcolor{comment}{/* TODO: Make these const/\#defines. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02652}02652         \textcolor{comment}{/* 1LSb = 32mg. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02653}02653         \textcolor{keywordflow}{if} (thresh > 8160)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02654}02654             thresh\_hw = 255;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02655}02655         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (thresh < 32)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02656}02656             thresh\_hw = 1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02657}02657         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02658}02658             thresh\_hw = thresh >> 5;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02659}02659 \textcolor{preprocessor}{\#elif defined MPU6500}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02660}02660         \textcolor{comment}{/* 1LSb = 4mg. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02661}02661         \textcolor{keywordflow}{if} (thresh > 1020)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02662}02662             thresh\_hw = 255;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02663}02663         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (thresh < 4)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02664}02664             thresh\_hw = 1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02665}02665         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02666}02666             thresh\_hw = thresh >> 2;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02667}02667 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02668}02668 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02669}02669         \textcolor{keywordflow}{if} (!time)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02670}02670             \textcolor{comment}{/* Minimum duration must be 1ms. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02671}02671             time = 1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02672}02672 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02673}02673 \textcolor{preprocessor}{\#if defined MPU6050}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02674}02674         \textcolor{keywordflow}{if} (lpa\_freq > 40)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02675}02675 \textcolor{preprocessor}{\#elif defined MPU6500}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02676}02676         \textcolor{keywordflow}{if} (lpa\_freq > 640)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02677}02677 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02678}02678             \textcolor{comment}{/* At this point, the chip has not been re-\/configured, so the}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02679}02679 \textcolor{comment}{             * function can safely exit.}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02680}02680 \textcolor{comment}{             */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02681}02681             \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02682}02682 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02683}02683         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga279cd5d5d78890357f2d42905d7471df}{int\_motion\_only}}) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02684}02684             \textcolor{comment}{/* Store current settings for later. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02685}02685             \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4783ed8aa79a3b5de798963819997c38}{dmp\_on}}) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02686}02686                 \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga68ed20e6c9663cd7c50469329af8715f}{mpu\_set\_dmp\_state}}(0);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02687}02687                 \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gadf3b491a068e0225a080821516353bac}{cache}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6461e400e336d2ccbc8c7d95ace9461d}{dmp\_on}} = 1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02688}02688             \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02689}02689                 \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gadf3b491a068e0225a080821516353bac}{cache}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6461e400e336d2ccbc8c7d95ace9461d}{dmp\_on}} = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02690}02690             \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf973c32c73ba912ff512aab948fc31ca}{mpu\_get\_gyro\_fsr}}(\&\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gadf3b491a068e0225a080821516353bac}{cache}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gae9614e4c92be9fc08f2aec7f34853fbc}{gyro\_fsr}});}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02691}02691             \mbox{\hyperlink{group___d_r_i_v_e_r_s_gab6087a15ee23db23b6aec41590329a60}{mpu\_get\_accel\_fsr}}(\&\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gadf3b491a068e0225a080821516353bac}{cache}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacfb901facda5ef8a02d47726db98e58e}{accel\_fsr}});}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02692}02692             \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa95c7e216dcb2d888e9796001ca555f8}{mpu\_get\_lpf}}(\&\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gadf3b491a068e0225a080821516353bac}{cache}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac1a1eb41631eb71481d6d247d9c67d4a}{lpf}});}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02693}02693             \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2487dd551b701c1c7ed4d6335f02b2f1}{mpu\_get\_sample\_rate}}(\&\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gadf3b491a068e0225a080821516353bac}{cache}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1cf6b7edfe37a51209897ccc448ec0e6}{sample\_rate}});}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02694}02694             \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gadf3b491a068e0225a080821516353bac}{cache}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gae5416a4097b0cf39460df70094bc474d}{sensors\_on}} = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa996fc14aa630e53823462baf460c13f}{sensors}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02695}02695             \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga093f11eb10b2639a4b9fe344ea348c54}{mpu\_get\_fifo\_config}}(\&\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gadf3b491a068e0225a080821516353bac}{cache}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga41501694a84bdf70e9c660852b653273}{fifo\_sensors}});}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02696}02696         \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02697}02697 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02698}02698 \textcolor{preprocessor}{\#ifdef MPU6050}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02699}02699         \textcolor{comment}{/* Disable hardware interrupts for now. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02700}02700         \mbox{\hyperlink{group___d_r_i_v_e_r_s_gafd5ebff6b0179e1dce0b68c2272cae07}{set\_int\_enable}}(0);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02701}02701 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02702}02702         \textcolor{comment}{/* Enter full-\/power accel-\/only mode. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02703}02703         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3a4fea75686ab7d2e68634e81ccac04c}{mpu\_lp\_accel\_mode}}(0);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02704}02704 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02705}02705         \textcolor{comment}{/* Override current LPF (and HPF) settings to obtain a valid accel}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02706}02706 \textcolor{comment}{         * reading.}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02707}02707 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02708}02708         data[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga91c762a5bd71461f7911dc49ee7696e9a9f0263fbbdccd3c5a18fcb65be278d24}{INV\_FILTER\_256HZ\_NOLPF2}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02709}02709         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga22eeac0bd77e7d99b3e15dda52f1bd08}{lpf}}, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02710}02710             \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02711}02711 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02712}02712         \textcolor{comment}{/* NOTE: Digital high pass filter should be configured here. Since this}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02713}02713 \textcolor{comment}{         * driver doesn't modify those bits anywhere, they should already be}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02714}02714 \textcolor{comment}{         * cleared by default.}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02715}02715 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02716}02716 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02717}02717         \textcolor{comment}{/* Configure the device to send motion interrupts. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02718}02718         \textcolor{comment}{/* Enable motion interrupt. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02719}02719         data[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6a8f2f7f3dd17bc05d9c6286d15c7ada}{BIT\_MOT\_INT\_EN}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02720}02720         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga48b47844d4b0570e60aa6806faa59eae}{int\_enable}}, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02721}02721             \textcolor{keywordflow}{goto} lp\_int\_restore;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02722}02722 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02723}02723         \textcolor{comment}{/* Set motion interrupt parameters. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02724}02724         data[0] = thresh\_hw;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02725}02725         data[1] = time;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02726}02726         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab2065a062ea7d6179cd8407b2ab4d146}{motion\_thr}}, 2, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02727}02727             \textcolor{keywordflow}{goto} lp\_int\_restore;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02728}02728 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02729}02729         \textcolor{comment}{/* Force hardware to "{}lock"{} current accel sample. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02730}02730         \mbox{\hyperlink{group___d_r_i_v_e_r_s_gae36aca5baf9b6b7d74992aef00686d67}{delay\_ms}}(5);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02731}02731         data[0] = (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf66873be1446ed552812e32d40eced61}{accel\_fsr}} << 3) | \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3c9c0234d4a71c9d35bb0da64ea867eb}{BITS\_HPF}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02732}02732         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gae93a446c54cc00bc7f11209d7af0025e}{accel\_cfg}}, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02733}02733             \textcolor{keywordflow}{goto} lp\_int\_restore;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02734}02734 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02735}02735         \textcolor{comment}{/* Set up LP accel mode. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02736}02736         data[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga63e6f23af37626aa1498d8c248f259e7}{BIT\_LPA\_CYCLE}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02737}02737         \textcolor{keywordflow}{if} (lpa\_freq == 1)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02738}02738             data[1] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga23c3fcde795e5aa2b141232d490c9ca7ab44c7d0127a9466747853533a537b567}{INV\_LPA\_1\_25HZ}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02739}02739         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (lpa\_freq <= 5)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02740}02740             data[1] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga23c3fcde795e5aa2b141232d490c9ca7a474cac76bff369dd656cc973207a1ca5}{INV\_LPA\_5HZ}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02741}02741         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (lpa\_freq <= 20)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02742}02742             data[1] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga23c3fcde795e5aa2b141232d490c9ca7accaaf47c58dfe32cbf2ffa11fdb83108}{INV\_LPA\_20HZ}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02743}02743         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02744}02744             data[1] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga23c3fcde795e5aa2b141232d490c9ca7a798d2b86eafcf3fc7c7fe775f46cb4cb}{INV\_LPA\_40HZ}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02745}02745         data[1] = (data[1] << 6) | \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4e2ef22b94b90f9b83394dfe1f688ce4}{BIT\_STBY\_XYZG}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02746}02746         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa01fb0872030e8e2932f8d1d257ea86a}{pwr\_mgmt\_1}}, 2, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02747}02747             \textcolor{keywordflow}{goto} lp\_int\_restore;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02748}02748 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02749}02749         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga279cd5d5d78890357f2d42905d7471df}{int\_motion\_only}} = 1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02750}02750         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02751}02751 \textcolor{preprocessor}{\#elif defined MPU6500}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02752}02752         \textcolor{comment}{/* Disable hardware interrupts. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02753}02753         \mbox{\hyperlink{group___d_r_i_v_e_r_s_gafd5ebff6b0179e1dce0b68c2272cae07}{set\_int\_enable}}(0);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02754}02754 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02755}02755         \textcolor{comment}{/* Enter full-\/power accel-\/only mode, no FIFO/DMP. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02756}02756         data[0] = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02757}02757         data[1] = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02758}02758         data[2] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4e2ef22b94b90f9b83394dfe1f688ce4}{BIT\_STBY\_XYZG}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02759}02759         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga12505a7d8cd7c976e5571f27a6160d23}{user\_ctrl}}, 3, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02760}02760             \textcolor{keywordflow}{goto} lp\_int\_restore;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02761}02761 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02762}02762         \textcolor{comment}{/* Set motion threshold. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02763}02763         data[0] = thresh\_hw;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02764}02764         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab2065a062ea7d6179cd8407b2ab4d146}{motion\_thr}}, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02765}02765             \textcolor{keywordflow}{goto} lp\_int\_restore;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02766}02766 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02767}02767         \textcolor{comment}{/* Set wake frequency. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02768}02768         \textcolor{keywordflow}{if} (lpa\_freq == 1)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02769}02769             data[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga23c3fcde795e5aa2b141232d490c9ca7ab44c7d0127a9466747853533a537b567}{INV\_LPA\_1\_25HZ}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02770}02770         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (lpa\_freq == 2)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02771}02771             data[0] = INV\_LPA\_2\_5HZ;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02772}02772         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (lpa\_freq <= 5)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02773}02773             data[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga23c3fcde795e5aa2b141232d490c9ca7a474cac76bff369dd656cc973207a1ca5}{INV\_LPA\_5HZ}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02774}02774         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (lpa\_freq <= 10)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02775}02775             data[0] = INV\_LPA\_10HZ;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02776}02776         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (lpa\_freq <= 20)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02777}02777             data[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga23c3fcde795e5aa2b141232d490c9ca7accaaf47c58dfe32cbf2ffa11fdb83108}{INV\_LPA\_20HZ}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02778}02778         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (lpa\_freq <= 40)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02779}02779             data[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga23c3fcde795e5aa2b141232d490c9ca7a798d2b86eafcf3fc7c7fe775f46cb4cb}{INV\_LPA\_40HZ}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02780}02780         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (lpa\_freq <= 80)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02781}02781             data[0] = INV\_LPA\_80HZ;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02782}02782         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (lpa\_freq <= 160)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02783}02783             data[0] = INV\_LPA\_160HZ;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02784}02784         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (lpa\_freq <= 320)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02785}02785             data[0] = INV\_LPA\_320HZ;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02786}02786         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02787}02787             data[0] = INV\_LPA\_640HZ;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02788}02788         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>lp\_accel\_odr, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02789}02789             \textcolor{keywordflow}{goto} lp\_int\_restore;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02790}02790 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02791}02791         \textcolor{comment}{/* Enable motion interrupt (MPU6500 version). */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02792}02792         data[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga75b1479e451b747afb3b24cbc4df99f7}{BITS\_WOM\_EN}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02793}02793         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>accel\_intel, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02794}02794             \textcolor{keywordflow}{goto} lp\_int\_restore;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02795}02795 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02796}02796         \textcolor{comment}{/* Enable cycle mode. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02797}02797         data[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga63e6f23af37626aa1498d8c248f259e7}{BIT\_LPA\_CYCLE}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02798}02798         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa01fb0872030e8e2932f8d1d257ea86a}{pwr\_mgmt\_1}}, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02799}02799             \textcolor{keywordflow}{goto} lp\_int\_restore;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02800}02800 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02801}02801         \textcolor{comment}{/* Enable interrupt. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02802}02802         data[0] = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6a8f2f7f3dd17bc05d9c6286d15c7ada}{BIT\_MOT\_INT\_EN}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02803}02803         \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga48b47844d4b0570e60aa6806faa59eae}{int\_enable}}, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02804}02804             \textcolor{keywordflow}{goto} lp\_int\_restore;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02805}02805 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02806}02806         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga279cd5d5d78890357f2d42905d7471df}{int\_motion\_only}} = 1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02807}02807         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02808}02808 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02809}02809     \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02810}02810         \textcolor{comment}{/* Don't "{}restore"{} the previous state if no state has been saved. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02811}02811         \textcolor{keywordtype}{int} ii;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02812}02812         \textcolor{keywordtype}{char} *cache\_ptr = (\textcolor{keywordtype}{char}*)\&\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gadf3b491a068e0225a080821516353bac}{cache}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02813}02813         for (ii = 0; ii < \textcolor{keyword}{sizeof}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gadf3b491a068e0225a080821516353bac}{cache}}); ii++) \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02814}02814             \textcolor{keywordflow}{if} (cache\_ptr[ii] != 0)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02815}02815                 \textcolor{keywordflow}{goto} lp\_int\_restore;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02816}02816         \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02817}02817         \textcolor{comment}{/* If we reach this point, motion interrupt mode hasn't been used yet. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02818}02818         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02819}02819     \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02820}02820 lp\_int\_restore:}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02821}02821     \textcolor{comment}{/* Set to invalid values to ensure no I2C writes are skipped. */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02822}02822     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab45a727aeee17380828a3e20ccb375c2}{gyro\_fsr}} = 0xFF;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02823}02823     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf66873be1446ed552812e32d40eced61}{accel\_fsr}} = 0xFF;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02824}02824     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga16ec8ca8298f62ac01419775377270fb}{lpf}} = 0xFF;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02825}02825     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2660470fcf7b53e2e832a397cbe6c354}{sample\_rate}} = 0xFFFF;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02826}02826     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa996fc14aa630e53823462baf460c13f}{sensors}} = 0xFF;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02827}02827     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga88143c31b894bcd819c0e49b0ff267aa}{fifo\_enable}} = 0xFF;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02828}02828     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gab7bd5165d6e62cb0d814cf3401958445}{clk\_src}} = \mbox{\hyperlink{group___d_r_i_v_e_r_s_gga75570f009627c6f4ddfb2d936d81e207a01b240917a78674d3e387110a6a8f94c}{INV\_CLK\_PLL}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02829}02829     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6e77e7cc1cf6be5e8fdf617c5b4586d1}{mpu\_set\_sensors}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gadf3b491a068e0225a080821516353bac}{cache}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gae5416a4097b0cf39460df70094bc474d}{sensors\_on}});}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02830}02830     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gad09e6031c8677adc0b8a39b6deea8e27}{mpu\_set\_gyro\_fsr}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gadf3b491a068e0225a080821516353bac}{cache}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gae9614e4c92be9fc08f2aec7f34853fbc}{gyro\_fsr}});}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02831}02831     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2713a96af104cfb2ae8e0ed4c3718119}{mpu\_set\_accel\_fsr}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gadf3b491a068e0225a080821516353bac}{cache}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacfb901facda5ef8a02d47726db98e58e}{accel\_fsr}});}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02832}02832     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5661a9dee25152166769910767a2a93d}{mpu\_set\_lpf}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gadf3b491a068e0225a080821516353bac}{cache}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac1a1eb41631eb71481d6d247d9c67d4a}{lpf}});}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02833}02833     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga0144d666a67a82888b8580002afe8b55}{mpu\_set\_sample\_rate}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gadf3b491a068e0225a080821516353bac}{cache}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga1cf6b7edfe37a51209897ccc448ec0e6}{sample\_rate}});}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02834}02834     \mbox{\hyperlink{group___d_r_i_v_e_r_s_gababbdda287e1f19323489f90a0889dd7}{mpu\_configure\_fifo}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gadf3b491a068e0225a080821516353bac}{cache}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga41501694a84bdf70e9c660852b653273}{fifo\_sensors}});}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02835}02835 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02836}02836     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gadf3b491a068e0225a080821516353bac}{cache}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6461e400e336d2ccbc8c7d95ace9461d}{dmp\_on}})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02837}02837         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga68ed20e6c9663cd7c50469329af8715f}{mpu\_set\_dmp\_state}}(1);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02838}02838 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02839}02839 \textcolor{preprocessor}{\#ifdef MPU6500}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02840}02840     \textcolor{comment}{/* Disable motion interrupt (MPU6500 version). */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02841}02841     data[0] = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02842}02842     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa248719e0ea03e6601004693d74890e0}{i2c\_write}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac280ecd767872a9664737fce8dd8e07b}{hw}}-\/>\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb482b60b4bc425c2990da9cf7cbdfee}{addr}}, \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga458ad7d19aa1dc020276ec0d36951d0d}{reg}}-\/>accel\_intel, 1, data))}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02843}02843         \textcolor{keywordflow}{goto} lp\_int\_restore;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02844}02844 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02845}02845 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02846}02846     \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3854b4875f6db26c2a1a707885f1fc78}{st}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga8881b9ec8b8009515310301f33abdeaf}{chip\_cfg}}.\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga279cd5d5d78890357f2d42905d7471df}{int\_motion\_only}} = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02847}02847     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02848}02848 \}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02850}02850 \textcolor{comment}{//添加的代码部分 }}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02852}02852 \textcolor{comment}{}\textcolor{comment}{//本程序只供学习使用，未经作者许可，不得用于其它任何用途}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02853}02853 \textcolor{comment}{//ALIENTEK精英STM32开发板V3}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02854}02854 \textcolor{comment}{//MPU6050 DMP 驱动代码     }}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02855}02855 \textcolor{comment}{//正点原子@ALIENTEK}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02856}02856 \textcolor{comment}{//技术论坛:www.openedv.com}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02857}02857 \textcolor{comment}{//创建日期:2015/1/17}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02858}02858 \textcolor{comment}{//版本：V1.0}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02859}02859 \textcolor{comment}{//版权所有，盗版必究。}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02860}02860 \textcolor{comment}{//Copyright(C) 广州市星翼电子科技有限公司 2009-\/2019}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02861}02861 \textcolor{comment}{//All rights reserved                                     }}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02863}02863 \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02864}02864 \textcolor{comment}{//q30格式,long转float时的除数.}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02865}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga0c2ff73765f99e113d4f99826f9601e5}{02865}} \textcolor{preprocessor}{\#define q30  1073741824.0f}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02866}02866 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02867}02867 \textcolor{comment}{//陀螺仪方向设置}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02868}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gadcca9e3dfdbc53cc5509fabdaede02b8}{02868}} \textcolor{keyword}{static} \textcolor{keywordtype}{signed} \textcolor{keywordtype}{char} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gadcca9e3dfdbc53cc5509fabdaede02b8}{gyro\_orientation}}[9] = \{ 1, 0, 0,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02869}02869                                            0, 1, 0,}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02870}02870                                            0, 0, 1\};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02871}02871 \textcolor{comment}{//MPU6050自测试}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02872}02872 \textcolor{comment}{//返回值:0,正常}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02873}02873 \textcolor{comment}{//    其他,失败}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02874}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaff893f93277595387023c71d46b03c42}{02874}} \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaff893f93277595387023c71d46b03c42}{run\_self\_test}}(\textcolor{keywordtype}{void})\{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02875}02875     \textcolor{keywordtype}{int} result;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02876}02876     \textcolor{comment}{//char test\_packet[4] = \{0\};}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02877}02877     \textcolor{keywordtype}{long} gyro[3], accel[3]; }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02878}02878     result = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3773dc98eb1ba15da0091ae75abcf62f}{mpu\_run\_self\_test}}(gyro, accel);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02879}02879     \textcolor{keywordflow}{if} (result == 0x3)\{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02880}02880         \textcolor{comment}{/* Test passed. We can trust the gyro data here, so let's push it down}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02881}02881 \textcolor{comment}{        * to the DMP.}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02882}02882 \textcolor{comment}{        */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02883}02883         \textcolor{keywordtype}{float} sens;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02884}02884         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} accel\_sens;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02885}02885         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga023c0cc94aa8f162dc33b15048a49421}{mpu\_get\_gyro\_sens}}(\&sens);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02886}02886         gyro[0] = (long)(gyro[0] * sens);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02887}02887         gyro[1] = (long)(gyro[1] * sens);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02888}02888         gyro[2] = (long)(gyro[2] * sens);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02889}02889         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga4766e37ef95cbf0044c8f9594ed811d1}{dmp\_set\_gyro\_bias}}(gyro);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02890}02890         \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga620408949052b96e856cad920f856583}{mpu\_get\_accel\_sens}}(\&accel\_sens);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02891}02891         accel[0] *= accel\_sens;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02892}02892         accel[1] *= accel\_sens;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02893}02893         accel[2] *= accel\_sens;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02894}02894         \mbox{\hyperlink{group___d_r_i_v_e_r_s_gafbd714aee6086836f70aaea847771669}{dmp\_set\_accel\_bias}}(accel);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02895}02895         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02896}02896     \}\textcolor{keywordflow}{else} \textcolor{keywordflow}{return} 1;\}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02897}02897 \textcolor{comment}{//陀螺仪方向控制}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02898}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3ff6037a69f37bb6174355936ad67ef3}{02898}} \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3ff6037a69f37bb6174355936ad67ef3}{inv\_orientation\_matrix\_to\_scalar}}(}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02899}02899     \textcolor{keyword}{const} \textcolor{keywordtype}{signed} \textcolor{keywordtype}{char} *mtx)\{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02900}02900     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} scalar; }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02901}02901     \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02902}02902 \textcolor{comment}{       XYZ  010\_001\_000 Identity Matrix}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02903}02903 \textcolor{comment}{       XZY  001\_010\_000}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02904}02904 \textcolor{comment}{       YXZ  010\_000\_001}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02905}02905 \textcolor{comment}{       YZX  000\_010\_001}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02906}02906 \textcolor{comment}{       ZXY  001\_000\_010}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02907}02907 \textcolor{comment}{       ZYX  000\_001\_010}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02908}02908 \textcolor{comment}{     */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02909}02909     scalar = \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2b58dae1c0567f3f9f6dcbfb07476de7}{inv\_row\_2\_scale}}(mtx);}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02910}02910     scalar |= \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2b58dae1c0567f3f9f6dcbfb07476de7}{inv\_row\_2\_scale}}(mtx + 3) << 3;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02911}02911     scalar |= \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2b58dae1c0567f3f9f6dcbfb07476de7}{inv\_row\_2\_scale}}(mtx + 6) << 6;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02912}02912     \textcolor{keywordflow}{return} scalar;\}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02913}02913 \textcolor{comment}{//方向转换}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02914}\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2b58dae1c0567f3f9f6dcbfb07476de7}{02914}} \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga2b58dae1c0567f3f9f6dcbfb07476de7}{inv\_row\_2\_scale}}(\textcolor{keyword}{const} \textcolor{keywordtype}{signed} \textcolor{keywordtype}{char} *row)\{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02915}02915     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} b;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02916}02916 }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02917}02917     \textcolor{keywordflow}{if} (row[0] > 0)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02918}02918         b = 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02919}02919     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (row[0] < 0)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02920}02920         b = 4;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02921}02921     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (row[1] > 0)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02922}02922         b = 1;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02923}02923     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (row[1] < 0)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02924}02924         b = 5;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02925}02925     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (row[2] > 0)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02926}02926         b = 2;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02927}02927     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (row[2] < 0)}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02928}02928         b = 6;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02929}02929     \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02930}02930         b = 7;      \textcolor{comment}{// error}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02931}02931     \textcolor{keywordflow}{return} b;\}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02932}02932 \textcolor{comment}{//空函数,未用到.}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02933}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gafa3071c8321f6e8dd2036be8a1e57ad0}{02933}} \textcolor{keywordtype}{void} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gafa3071c8321f6e8dd2036be8a1e57ad0}{mget\_ms}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} *time)\{\}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02934}02934 \textcolor{comment}{//mpu6050,dmp初始化}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02935}02935 \textcolor{comment}{//返回值:0,正常}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02936}02936 \textcolor{comment}{//    其他,失败}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02937}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gafac8fcbf24cfa1b69737e02238580f3a}{02937}} \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gafac8fcbf24cfa1b69737e02238580f3a}{mpu\_dmp\_init}}(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02938}02938 \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02939}02939     \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} res=0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02940}02940     \textcolor{keywordflow}{if}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_gac48a36b51e23bc4191ec13916bbb9d0b}{mpu\_init}}()==0)   \textcolor{comment}{//初始化MPU6050}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02941}02941     \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02942}02942         res=\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6e77e7cc1cf6be5e8fdf617c5b4586d1}{mpu\_set\_sensors}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3fdc30f9c0a26c2c4e2bb88921f91629}{INV\_XYZ\_GYRO}}|\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa03f025a17ed491e70b88274e89c75c5}{INV\_XYZ\_ACCEL}});                \textcolor{comment}{//设置所需要的传感器}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02943}02943         \textcolor{keywordflow}{if}(res)\textcolor{keywordflow}{return} 1; }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02944}02944         res=\mbox{\hyperlink{group___d_r_i_v_e_r_s_gababbdda287e1f19323489f90a0889dd7}{mpu\_configure\_fifo}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3fdc30f9c0a26c2c4e2bb88921f91629}{INV\_XYZ\_GYRO}}|\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaa03f025a17ed491e70b88274e89c75c5}{INV\_XYZ\_ACCEL}});              \textcolor{comment}{//设置FIFO}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02945}02945         \textcolor{keywordflow}{if}(res)\textcolor{keywordflow}{return} 2; }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02946}02946         res=\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga0144d666a67a82888b8580002afe8b55}{mpu\_set\_sample\_rate}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga292d717406e906831952ce46612fe4cd}{DEFAULT\_MPU\_HZ}});                       \textcolor{comment}{//设置采样率}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02947}02947         \textcolor{keywordflow}{if}(res)\textcolor{keywordflow}{return} 3; }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02948}02948         res=\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga66626a842452f444e9af29cb0d2c6150}{dmp\_load\_motion\_driver\_firmware}}();                           \textcolor{comment}{//加载dmp固件}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02949}02949         \textcolor{keywordflow}{if}(res)\textcolor{keywordflow}{return} 4; }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02950}02950         res=\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga6cb5ff144ce6e1546f00809de8bb24a4}{dmp\_set\_orientation}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3ff6037a69f37bb6174355936ad67ef3}{inv\_orientation\_matrix\_to\_scalar}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_gadcca9e3dfdbc53cc5509fabdaede02b8}{gyro\_orientation}}));\textcolor{comment}{//设置陀螺仪方向}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02951}02951         \textcolor{keywordflow}{if}(res)\textcolor{keywordflow}{return} 5; }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02952}02952         res=\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga70c485bdfa30515e5b869b081192caa1}{dmp\_enable\_feature}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_gae879a3c9729f9e1be5e6d7c9211c69c0}{DMP\_FEATURE\_6X\_LP\_QUAT}}|\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga87fac39cf95e2c56afdf507a986fa00b}{DMP\_FEATURE\_TAP}}|   \textcolor{comment}{//设置dmp功能}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02953}02953             \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaf2b250fc928390d562f7bd80300ce419}{DMP\_FEATURE\_ANDROID\_ORIENT}}|\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga9eeb257febe4a305df7ad4cf31dc2755}{DMP\_FEATURE\_SEND\_RAW\_ACCEL}}|\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga40462c6fd55b04b2f79723dd737ee795}{DMP\_FEATURE\_SEND\_CAL\_GYRO}}|}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02954}02954             \mbox{\hyperlink{group___d_r_i_v_e_r_s_gaaf0ac890c1f83106c08b722f1e865fdb}{DMP\_FEATURE\_GYRO\_CAL}});}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02955}02955         \textcolor{keywordflow}{if}(res)\textcolor{keywordflow}{return} 6; }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02956}02956         res=\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5399728fd572a7694af20286cc9d4121}{dmp\_set\_fifo\_rate}}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga292d717406e906831952ce46612fe4cd}{DEFAULT\_MPU\_HZ}});                           \textcolor{comment}{//设置DMP输出速率(最大不超过200Hz)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02957}02957         \textcolor{keywordflow}{if}(res)\textcolor{keywordflow}{return} 7;   }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02958}02958         res=\mbox{\hyperlink{group___d_r_i_v_e_r_s_gaff893f93277595387023c71d46b03c42}{run\_self\_test}}();                                           \textcolor{comment}{//自检}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02959}02959         \textcolor{keywordflow}{if}(res)\textcolor{keywordflow}{return} 8;    }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02960}02960         res=\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga68ed20e6c9663cd7c50469329af8715f}{mpu\_set\_dmp\_state}}(1);                                      \textcolor{comment}{//使能DMP}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02961}02961         \textcolor{keywordflow}{if}(res)\textcolor{keywordflow}{return} 9;     }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02962}02962     \}\textcolor{keywordflow}{else} \textcolor{keywordflow}{return} 10;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02963}02963     \textcolor{keywordflow}{return} 0;\}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02964}02964 \textcolor{comment}{//得到dmp处理后的数据(注意,本函数需要比较多堆栈,局部变量有点多)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02965}02965 \textcolor{comment}{//pitch:俯仰角 精度:0.1°   范围:-\/90.0° <-\/-\/-\/> +90.0°}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02966}02966 \textcolor{comment}{//roll:横滚角  精度:0.1°   范围:-\/180.0°<-\/-\/-\/> +180.0°}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02967}02967 \textcolor{comment}{//yaw:航向角   精度:0.1°   范围:-\/180.0°<-\/-\/-\/> +180.0°}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02968}02968 \textcolor{comment}{//返回值:0,正常}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02969}02969 \textcolor{comment}{//    其他,失败}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02970}\mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb825f2fd99c3044d012a9b25608cc18}{02970}} \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \mbox{\hyperlink{group___d_r_i_v_e_r_s_gacb825f2fd99c3044d012a9b25608cc18}{mpu\_dmp\_get\_data}}(\textcolor{keywordtype}{float} *pitch,\textcolor{keywordtype}{float} *roll,\textcolor{keywordtype}{float} *yaw)\{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02971}02971     \textcolor{keywordtype}{float} q0=1.0f,q1=0.0f,q2=0.0f,q3=0.0f;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02972}02972     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} sensor\_timestamp;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02973}02973     \textcolor{keywordtype}{short} gyro[3], accel[3], sensors;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02974}02974     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} more;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02975}02975     \textcolor{keywordtype}{long} quat[4]; }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02976}02976     \textcolor{keywordflow}{if}(\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga02db5f25359abe84be002c543cdc3803}{dmp\_read\_fifo}}(gyro, accel, quat, \&sensor\_timestamp, \&sensors,\&more))\textcolor{keywordflow}{return} 1;    }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02977}02977     \textcolor{comment}{/* Gyro and accel data are written to the FIFO by the DMP in chip frame and hardware units.}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02978}02978 \textcolor{comment}{     * This behavior is convenient because it keeps the gyro and accel outputs of dmp\_read\_fifo and mpu\_read\_fifo consistent.}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02979}02979 \textcolor{comment}{    **/}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02980}02980     \textcolor{comment}{/*if (sensors \& INV\_XYZ\_GYRO )}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02981}02981 \textcolor{comment}{    send\_packet(PACKET\_TYPE\_GYRO, gyro);}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02982}02982 \textcolor{comment}{    if (sensors \& INV\_XYZ\_ACCEL)}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02983}02983 \textcolor{comment}{    send\_packet(PACKET\_TYPE\_ACCEL, accel); */}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02984}02984     \textcolor{comment}{/* Unlike gyro and accel, quaternions are written to the FIFO in the body frame, q30.}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02985}02985 \textcolor{comment}{     * The orientation is set by the scalar passed to dmp\_set\_orientation during initialization. }}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02986}02986 \textcolor{comment}{    **/}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02987}02987     \textcolor{keywordflow}{if}(sensors\&\mbox{\hyperlink{group___d_r_i_v_e_r_s_ga3d79cffe845a796a27d03432a1f2ade0}{INV\_WXYZ\_QUAT}}) }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02988}02988     \{}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02989}02989         q0 = quat[0] / \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga0c2ff73765f99e113d4f99826f9601e5}{q30}};  \textcolor{comment}{//q30格式转换为浮点数}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02990}02990         q1 = quat[1] / \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga0c2ff73765f99e113d4f99826f9601e5}{q30}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02991}02991         q2 = quat[2] / \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga0c2ff73765f99e113d4f99826f9601e5}{q30}};}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02992}02992         q3 = quat[3] / \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga0c2ff73765f99e113d4f99826f9601e5}{q30}}; }
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02993}02993         \textcolor{comment}{//计算得到俯仰角/横滚角/航向角}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02994}02994         *pitch = asin(-\/2 * q1 * q3 + 2 * q0* q2)* 57.3; \textcolor{comment}{// pitch}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02995}02995         *roll  = atan2(2 * q2 * q3 + 2 * q0 * q1, -\/2 * q1 * q1 -\/ 2 * q2* q2 + 1)* 57.3; \textcolor{comment}{// roll}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02996}02996         *yaw   = atan2(2*(q1*q2 + q0*q3),q0*q0+q1*q1-\/q2*q2-\/q3*q3) * 57.3;   \textcolor{comment}{//yaw}}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02997}02997     \}\textcolor{keywordflow}{else} \textcolor{keywordflow}{return} 2;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02998}02998     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{inv__mpu_8c_source_l02999}02999 \}}

\end{DoxyCode}
