107 lines
22 KiB
TeX
107 lines
22 KiB
TeX
\hypertarget{mpu6050_8h_source}{}\doxysection{mpu6050.\+h}
|
|
\label{mpu6050_8h_source}\index{D:/gitt/MicrochipFor32/bscpp\_Device/bscpp\_MPU6050/mpu6050.h@{D:/gitt/MicrochipFor32/bscpp\_Device/bscpp\_MPU6050/mpu6050.h}}
|
|
\mbox{\hyperlink{mpu6050_8h}{浏览该文件的文档.}}
|
|
\begin{DoxyCode}{0}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00001}00001 }
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00011}00011 \textcolor{preprocessor}{\#pragma once}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00012}00012 \textcolor{preprocessor}{\#ifdef \_\_cplusplus}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00013}00013 \textcolor{keyword}{extern} \textcolor{stringliteral}{"{}C"{}}\{}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00014}00014 \textcolor{preprocessor}{\#endif}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00015}00015 \textcolor{preprocessor}{\#include "{}main.h"{}}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00016}00016 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{varint_8h}{varint.h}}"{}}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00017}00017 }
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00018}00018 \textcolor{comment}{//\#define MPU\_ACCEL\_OFFS\_REG 0X06 //accel\_offs寄存器,可读取版本号,寄存器手册未提到}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00019}00019 \textcolor{comment}{//\#define MPU\_PROD\_ID\_REG 0X0C //prod id寄存器,在寄存器手册未提到}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00020}\mbox{\hyperlink{mpu6050_8h_af02b592f85ebbfcc6f5e13d8287832de}{00020}} \textcolor{preprocessor}{\#define MPU\_SELF\_TESTX\_REG 0X0D }\textcolor{comment}{//自检寄存器X}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00021}\mbox{\hyperlink{mpu6050_8h_a029c571acc0e3a941d14d4af3e3ecd5f}{00021}} \textcolor{preprocessor}{\#define MPU\_SELF\_TESTY\_REG 0X0E }\textcolor{comment}{//自检寄存器Y}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00022}\mbox{\hyperlink{mpu6050_8h_aa7f091c311c419133b4799a37919ce24}{00022}} \textcolor{preprocessor}{\#define MPU\_SELF\_TESTZ\_REG 0X0F }\textcolor{comment}{//自检寄存器Z}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00023}\mbox{\hyperlink{mpu6050_8h_a9f2d6b09b992598daadf6a0afa9a8b9c}{00023}} \textcolor{preprocessor}{\#define MPU\_SELF\_TESTA\_REG 0X10 }\textcolor{comment}{//自检寄存器A}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00024}\mbox{\hyperlink{mpu6050_8h_a4b95cfafadb4b30146a17fac36819ca3}{00024}} \textcolor{preprocessor}{\#define MPU\_SAMPLE\_RATE\_REG 0X19 }\textcolor{comment}{//采样频率分频器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00025}\mbox{\hyperlink{mpu6050_8h_a5034e2fc680fc68faa369a48f6955837}{00025}} \textcolor{preprocessor}{\#define MPU\_CFG\_REG 0X1A }\textcolor{comment}{//配置寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00026}\mbox{\hyperlink{mpu6050_8h_ac8ce2e66126327cf30cfba19c4c38db5}{00026}} \textcolor{preprocessor}{\#define MPU\_GYRO\_CFG\_REG 0X1B }\textcolor{comment}{//陀螺仪配置寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00027}\mbox{\hyperlink{mpu6050_8h_a7bc1a37b846a3869f13a29e00072bbc7}{00027}} \textcolor{preprocessor}{\#define MPU\_ACCEL\_CFG\_REG 0X1C }\textcolor{comment}{//加速度计配置寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00028}\mbox{\hyperlink{mpu6050_8h_ad214879acffccefd843d291949a2abb6}{00028}} \textcolor{preprocessor}{\#define MPU\_MOTION\_DET\_REG 0X1F }\textcolor{comment}{//运动检测阀值设置寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00029}\mbox{\hyperlink{mpu6050_8h_a6ac27367cd834a85810e99df72b97621}{00029}} \textcolor{preprocessor}{\#define MPU\_FIFO\_EN\_REG 0X23 }\textcolor{comment}{//FIFO使能寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00030}\mbox{\hyperlink{mpu6050_8h_a077d9362ddf1c52a0fca0740164533ca}{00030}} \textcolor{preprocessor}{\#define MPU\_I2CMST\_CTRL\_REG 0X24 }\textcolor{comment}{//IIC主机控制寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00031}\mbox{\hyperlink{mpu6050_8h_a0482943c31faa0c896d63ef5d66755e1}{00031}} \textcolor{preprocessor}{\#define MPU\_I2CSLV0\_ADDR\_REG 0X25 }\textcolor{comment}{//IIC从机0器件地址寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00032}\mbox{\hyperlink{mpu6050_8h_a53122cbda4565a4a060e5df3bb9a37a7}{00032}} \textcolor{preprocessor}{\#define MPU\_I2CSLV0\_REG 0X26 }\textcolor{comment}{//IIC从机0数据地址寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00033}\mbox{\hyperlink{mpu6050_8h_a22b266f1daab1a09f9257cfeb96fbb68}{00033}} \textcolor{preprocessor}{\#define MPU\_I2CSLV0\_CTRL\_REG 0X27 }\textcolor{comment}{//IIC从机0控制寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00034}\mbox{\hyperlink{mpu6050_8h_a9123fc86edcdc301cbb75f7ebe4b5875}{00034}} \textcolor{preprocessor}{\#define MPU\_I2CSLV1\_ADDR\_REG 0X28 }\textcolor{comment}{//IIC从机1器件地址寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00035}\mbox{\hyperlink{mpu6050_8h_a7a0758891de15a4b4bf0ef2c4e75efeb}{00035}} \textcolor{preprocessor}{\#define MPU\_I2CSLV1\_REG 0X29 }\textcolor{comment}{//IIC从机1数据地址寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00036}\mbox{\hyperlink{mpu6050_8h_a237cf43cb562d63ea2f2d98eeac464bc}{00036}} \textcolor{preprocessor}{\#define MPU\_I2CSLV1\_CTRL\_REG 0X2A }\textcolor{comment}{//IIC从机1控制寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00037}\mbox{\hyperlink{mpu6050_8h_a5a7b90007c003c428c098d0073fa4f9c}{00037}} \textcolor{preprocessor}{\#define MPU\_I2CSLV2\_ADDR\_REG 0X2B }\textcolor{comment}{//IIC从机2器件地址寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00038}\mbox{\hyperlink{mpu6050_8h_a1d01e992631966ee1af8795ec14710bc}{00038}} \textcolor{preprocessor}{\#define MPU\_I2CSLV2\_REG 0X2C }\textcolor{comment}{//IIC从机2数据地址寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00039}\mbox{\hyperlink{mpu6050_8h_a1c2971fc921e219f0060640349d4a58a}{00039}} \textcolor{preprocessor}{\#define MPU\_I2CSLV2\_CTRL\_REG 0X2D }\textcolor{comment}{//IIC从机2控制寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00040}\mbox{\hyperlink{mpu6050_8h_a0627354a9a7143a3967bbf1552952e11}{00040}} \textcolor{preprocessor}{\#define MPU\_I2CSLV3\_ADDR\_REG 0X2E }\textcolor{comment}{//IIC从机3器件地址寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00041}\mbox{\hyperlink{mpu6050_8h_a82236d7861a3a175cff0058d5d5b4716}{00041}} \textcolor{preprocessor}{\#define MPU\_I2CSLV3\_REG 0X2F }\textcolor{comment}{//IIC从机3数据地址寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00042}\mbox{\hyperlink{mpu6050_8h_ac907afde99231069287fa0d78c305549}{00042}} \textcolor{preprocessor}{\#define MPU\_I2CSLV3\_CTRL\_REG 0X30 }\textcolor{comment}{//IIC从机3控制寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00043}\mbox{\hyperlink{mpu6050_8h_a6fbb07805d44b04e97f4f7d30d7c65bf}{00043}} \textcolor{preprocessor}{\#define MPU\_I2CSLV4\_ADDR\_REG 0X31 }\textcolor{comment}{//IIC从机4器件地址寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00044}\mbox{\hyperlink{mpu6050_8h_a838f7301336bd077e84a3a4fbe6e16e7}{00044}} \textcolor{preprocessor}{\#define MPU\_I2CSLV4\_REG 0X32 }\textcolor{comment}{//IIC从机4数据地址寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00045}\mbox{\hyperlink{mpu6050_8h_a5bf6ae395ef8815c28c23d5343116871}{00045}} \textcolor{preprocessor}{\#define MPU\_I2CSLV4\_DO\_REG 0X33 }\textcolor{comment}{//IIC从机4写数据寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00046}\mbox{\hyperlink{mpu6050_8h_a144d40f6321e971c85d9987ceaedf539}{00046}} \textcolor{preprocessor}{\#define MPU\_I2CSLV4\_CTRL\_REG 0X34 }\textcolor{comment}{//IIC从机4控制寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00047}\mbox{\hyperlink{mpu6050_8h_ab62d9fd87688d16052273b6598d5572f}{00047}} \textcolor{preprocessor}{\#define MPU\_I2CSLV4\_DI\_REG 0X35 }\textcolor{comment}{//IIC从机4读数据寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00048}00048 }
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00049}\mbox{\hyperlink{mpu6050_8h_a818abd42a819632acfee736d8db636f5}{00049}} \textcolor{preprocessor}{\#define MPU\_I2CMST\_STA\_REG 0X36 }\textcolor{comment}{//IIC主机状态寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00050}\mbox{\hyperlink{mpu6050_8h_a41676476ba5dbb1b213f8f8e252d17f9}{00050}} \textcolor{preprocessor}{\#define MPU\_INTBP\_CFG\_REG 0X37 }\textcolor{comment}{//中断/旁路设置寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00051}\mbox{\hyperlink{mpu6050_8h_afa56d3602a6044562c45cecf6403fb8b}{00051}} \textcolor{preprocessor}{\#define MPU\_INT\_EN\_REG 0X38 }\textcolor{comment}{//中断使能寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00052}\mbox{\hyperlink{mpu6050_8h_a186faa987a57c9d2a3ea6bfaba0bdd46}{00052}} \textcolor{preprocessor}{\#define MPU\_INT\_STA\_REG 0X3A }\textcolor{comment}{//中断状态寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00053}00053 }
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00054}\mbox{\hyperlink{mpu6050_8h_a571a31cdf2a467b2b1df39fea686ea0d}{00054}} \textcolor{preprocessor}{\#define MPU\_ACCEL\_XOUTH\_REG 0X3B }\textcolor{comment}{//加速度值,X轴高8位寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00055}\mbox{\hyperlink{mpu6050_8h_ad7193ffe844d2c844b0c419a50d40173}{00055}} \textcolor{preprocessor}{\#define MPU\_ACCEL\_XOUTL\_REG 0X3C }\textcolor{comment}{//加速度值,X轴低8位寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00056}\mbox{\hyperlink{mpu6050_8h_a42eb93ccf84e25005cd1eca7c43b7516}{00056}} \textcolor{preprocessor}{\#define MPU\_ACCEL\_YOUTH\_REG 0X3D }\textcolor{comment}{//加速度值,Y轴高8位寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00057}\mbox{\hyperlink{mpu6050_8h_aa1b06e69bcbb83ced2e28a8891ee8558}{00057}} \textcolor{preprocessor}{\#define MPU\_ACCEL\_YOUTL\_REG 0X3E }\textcolor{comment}{//加速度值,Y轴低8位寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00058}\mbox{\hyperlink{mpu6050_8h_af3a12a4f04a41df24c977c491a4aad5f}{00058}} \textcolor{preprocessor}{\#define MPU\_ACCEL\_ZOUTH\_REG 0X3F }\textcolor{comment}{//加速度值,Z轴高8位寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00059}\mbox{\hyperlink{mpu6050_8h_a82eb10a4b48c58f8bf7bc96a892533b6}{00059}} \textcolor{preprocessor}{\#define MPU\_ACCEL\_ZOUTL\_REG 0X40 }\textcolor{comment}{//加速度值,Z轴低8位寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00060}00060 }
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00061}\mbox{\hyperlink{mpu6050_8h_af2665b26b7f1ce9b3982a9f6418748e9}{00061}} \textcolor{preprocessor}{\#define MPU\_TEMP\_OUTH\_REG 0X41 }\textcolor{comment}{//温度值高八位寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00062}\mbox{\hyperlink{mpu6050_8h_a5f4a1c425564e1e56bfe51576ba3ea82}{00062}} \textcolor{preprocessor}{\#define MPU\_TEMP\_OUTL\_REG 0X42 }\textcolor{comment}{//温度值低8位寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00063}00063 }
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00064}\mbox{\hyperlink{mpu6050_8h_a7e16f1a459d902b070ca67df67be862b}{00064}} \textcolor{preprocessor}{\#define MPU\_GYRO\_XOUTH\_REG 0X43 }\textcolor{comment}{//陀螺仪值,X轴高8位寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00065}\mbox{\hyperlink{mpu6050_8h_a0b2e09225774ed67f49666ec1bbea501}{00065}} \textcolor{preprocessor}{\#define MPU\_GYRO\_XOUTL\_REG 0X44 }\textcolor{comment}{//陀螺仪值,X轴低8位寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00066}\mbox{\hyperlink{mpu6050_8h_af71ca06f446573faed7a73979237e51e}{00066}} \textcolor{preprocessor}{\#define MPU\_GYRO\_YOUTH\_REG 0X45 }\textcolor{comment}{//陀螺仪值,Y轴高8位寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00067}\mbox{\hyperlink{mpu6050_8h_a0007fe50b455737a3076e38f300bce14}{00067}} \textcolor{preprocessor}{\#define MPU\_GYRO\_YOUTL\_REG 0X46 }\textcolor{comment}{//陀螺仪值,Y轴低8位寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00068}\mbox{\hyperlink{mpu6050_8h_ad5811a104c711b123b648b46bcc6f929}{00068}} \textcolor{preprocessor}{\#define MPU\_GYRO\_ZOUTH\_REG 0X47 }\textcolor{comment}{//陀螺仪值,Z轴高8位寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00069}\mbox{\hyperlink{mpu6050_8h_a289046a426f3c6ef18cb504c5e991652}{00069}} \textcolor{preprocessor}{\#define MPU\_GYRO\_ZOUTL\_REG 0X48 }\textcolor{comment}{//陀螺仪值,Z轴低8位寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00070}00070 }
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00071}\mbox{\hyperlink{mpu6050_8h_a93d37f52e6ac87e1ef103339b22770af}{00071}} \textcolor{preprocessor}{\#define MPU\_I2CSLV0\_DO\_REG 0X63 }\textcolor{comment}{//IIC从机0数据寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00072}\mbox{\hyperlink{mpu6050_8h_af03578391ec1c0c6b357207c83ce28bb}{00072}} \textcolor{preprocessor}{\#define MPU\_I2CSLV1\_DO\_REG 0X64 }\textcolor{comment}{//IIC从机1数据寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00073}\mbox{\hyperlink{mpu6050_8h_a14db443ae863599bc0f16fa3733d4056}{00073}} \textcolor{preprocessor}{\#define MPU\_I2CSLV2\_DO\_REG 0X65 }\textcolor{comment}{//IIC从机2数据寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00074}\mbox{\hyperlink{mpu6050_8h_a4343d92e344dd56343094d46798a5e0e}{00074}} \textcolor{preprocessor}{\#define MPU\_I2CSLV3\_DO\_REG 0X66 }\textcolor{comment}{//IIC从机3数据寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00075}00075 }
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00076}\mbox{\hyperlink{mpu6050_8h_ad7209fcea0ea70f90f6cb43e862f8f5b}{00076}} \textcolor{preprocessor}{\#define MPU\_I2CMST\_DELAY\_REG 0X67 }\textcolor{comment}{//IIC主机延时管理寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00077}\mbox{\hyperlink{mpu6050_8h_a82c9cecb9ee30b37f8b054feca2bc1da}{00077}} \textcolor{preprocessor}{\#define MPU\_SIGPATH\_RST\_REG 0X68 }\textcolor{comment}{//信号通道复位寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00078}\mbox{\hyperlink{mpu6050_8h_a1e60421d39a0a24b0c513f309e1d6910}{00078}} \textcolor{preprocessor}{\#define MPU\_MDETECT\_CTRL\_REG 0X69 }\textcolor{comment}{//运动检测控制寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00079}\mbox{\hyperlink{mpu6050_8h_a0146ef35d7ff0b037eafb0a5dac53b0f}{00079}} \textcolor{preprocessor}{\#define MPU\_USER\_CTRL\_REG 0X6A }\textcolor{comment}{//用户控制寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00080}\mbox{\hyperlink{mpu6050_8h_abbe7ea135ee03eb0f1296ecb22be7554}{00080}} \textcolor{preprocessor}{\#define MPU\_PWR\_MGMT1\_REG 0X6B }\textcolor{comment}{//电源管理寄存器1}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00081}\mbox{\hyperlink{mpu6050_8h_a3fa9eb0485744e73d0274b198f0ad705}{00081}} \textcolor{preprocessor}{\#define MPU\_PWR\_MGMT2\_REG 0X6C }\textcolor{comment}{//电源管理寄存器2 }}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00082}\mbox{\hyperlink{mpu6050_8h_a9c04be29f6f59066df910560a1eb9ddf}{00082}} \textcolor{preprocessor}{\#define MPU\_FIFO\_CNTH\_REG 0X72 }\textcolor{comment}{//FIFO计数寄存器高八位}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00083}\mbox{\hyperlink{mpu6050_8h_a66dc73eec1f79cfefe8ad3d4c2a81c0d}{00083}} \textcolor{preprocessor}{\#define MPU\_FIFO\_CNTL\_REG 0X73 }\textcolor{comment}{//FIFO计数寄存器低八位}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00084}\mbox{\hyperlink{mpu6050_8h_af3acc9068f9c3b6a54c3d65ca91dc52e}{00084}} \textcolor{preprocessor}{\#define MPU\_FIFO\_RW\_REG 0X74 }\textcolor{comment}{//FIFO读写寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00085}\mbox{\hyperlink{mpu6050_8h_a9668e5ccfcfb0aa64da044a381a56f9c}{00085}} \textcolor{preprocessor}{\#define MPU\_DEVICE\_ID\_REG 0X75 }\textcolor{comment}{//器件ID寄存器}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00086}00086 }
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00087}00087 \textcolor{comment}{//如果AD0脚(9脚)接地,IIC地址为0X68(不包含最低位).}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00088}00088 \textcolor{comment}{//如果接V3.3,则IIC地址为0X69(不包含最低位).}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00089}\mbox{\hyperlink{mpu6050_8h_ac3281ee64415e63422da7d65db161891}{00089}} \textcolor{preprocessor}{\#define MPU\_ADDR 0X68}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00090}00090 }
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00091}00091 \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \mbox{\hyperlink{mpu6050_8h_ab1f8c6111d59b60a2edb4ee3e8aa3113}{MPU\_Init}}(\textcolor{keywordtype}{void}); \textcolor{comment}{//初始化MPU6050}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00092}00092 \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \mbox{\hyperlink{mpu6050_8h_a59b1c26b234be88e97435a1b3c061330}{MPU\_Write\_Len}}(\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} addr,\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5448c351fc95ff052b110eee80e5f75c}{reg}},\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} len,\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} *buf);\textcolor{comment}{//IIC连续写}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00093}00093 \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \mbox{\hyperlink{mpu6050_8h_a63161fa966899e4e7c5791e40ebf2b0a}{MPU\_Read\_Len}}(\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} addr,\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5448c351fc95ff052b110eee80e5f75c}{reg}},\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} len,\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} *buf); \textcolor{comment}{//IIC连续读 }}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00094}00094 \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \mbox{\hyperlink{mpu6050_8h_a0be9b422bb8613f8444db4af5234e1a1}{MPU\_Write\_Byte}}(\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5448c351fc95ff052b110eee80e5f75c}{reg}},\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} data); \textcolor{comment}{//IIC写一个字节}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00095}00095 \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \mbox{\hyperlink{mpu6050_8h_a17c11d19a2bb21d61610f08cb2cbe2f7}{MPU\_Read\_Byte}}(\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \mbox{\hyperlink{group___d_r_i_v_e_r_s_ga5448c351fc95ff052b110eee80e5f75c}{reg}}); \textcolor{comment}{//IIC读一个字节}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00096}00096 }
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00097}00097 \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \mbox{\hyperlink{mpu6050_8h_aa27cc30326ce4980b289a0e1c3f76b5e}{MPU\_Set\_Gyro\_Fsr}}(\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} fsr);}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00098}00098 \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \mbox{\hyperlink{mpu6050_8h_a6c391137bc5880c3b5e15e84c5a3380f}{MPU\_Set\_Accel\_Fsr}}(\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} fsr);}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00099}00099 \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \mbox{\hyperlink{mpu6050_8h_a2fb9973c9f5ea5327649d0eef5e96217}{MPU\_Set\_LPF}}(\mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} lpf);}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00100}00100 \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \mbox{\hyperlink{mpu6050_8h_a04e58232ce838e94d54aa2b53287cb41}{MPU\_Set\_Rate}}(\mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} rate);}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00101}\mbox{\hyperlink{mpu6050_8h_a91e0ee4610726fcf9f45570245269a0e}{00101}} \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \mbox{\hyperlink{mpu6050_8h_a91e0ee4610726fcf9f45570245269a0e}{MPU\_Set\_Fifo}}(\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} sens);}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00102}00102 }
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00103}00103 \textcolor{keywordtype}{short} \mbox{\hyperlink{mpu6050_8h_a41eaf87c26b1281d9d5fc6a06abcf2a8}{MPU\_Get\_Temperature}}(\textcolor{keywordtype}{void});}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00104}00104 \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \mbox{\hyperlink{mpu6050_8h_a8f28105f9dcccc709b78d7d0ce497633}{MPU\_Get\_Gyroscope}}(\textcolor{keywordtype}{short} *gx,\textcolor{keywordtype}{short} *gy,\textcolor{keywordtype}{short} *gz);}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00105}00105 \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \mbox{\hyperlink{mpu6050_8h_a2a0a02f6d7c597828a0cc282c76e99e3}{MPU\_Get\_Accelerometer}}(\textcolor{keywordtype}{short} *ax,\textcolor{keywordtype}{short} *ay,\textcolor{keywordtype}{short} *az);}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00106}00106 }
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00107}00107 \textcolor{preprocessor}{\#ifdef \_\_cplusplus}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00108}00108 \}}
|
|
\DoxyCodeLine{\Hypertarget{mpu6050_8h_source_l00109}00109 \textcolor{preprocessor}{\#endif}}
|
|
|
|
\end{DoxyCode}
|