Khangai Robot Play - Naive  01
THe naive play of the Khangai Robot
mpu6050.h
Go to the documentation of this file.
1 /*
2  * mpu6050.h
3  *
4  * Created : 9/27/2018
5  * Author : n-is
6  * email : 073bex422.nischal@pcampus.edu.np
7  */
8 
9 #ifndef _MPU6050_H_
10 #define _MPU6050_H_
11 
12 #include "vec3.h"
13 #include "i2c.h"
14 #include "mpu6050_reg.h"
15 
16 #define I2C_TIMEOUT (5)
17 
19 {
20  SCALE_2G = 0,
24 };
25 
27 {
28  SCALE_250 = 0,
32 };
33 
34 struct MPU6050
35 {
36  I2C_HandleTypeDef *hi2c;
39  uint8_t address;
40  float tmpr;
43 };
44 
45 
46 int8_t MPU6050_Init(struct MPU6050 *mpu);
47 int8_t MPU6050_Read_Temp(struct MPU6050 *mpu);
48 
49 int8_t MPU6050_Read_RawAccel(struct MPU6050 *mpu);
50 int8_t MPU6050_Read_RawGyro(struct MPU6050 *mpu);
51 int8_t MPU6050_Read_RawAxes(struct MPU6050 *mpu);
52 
53 int8_t MPU6050_Read_NormAccel(struct MPU6050 *mpu);
54 int8_t MPU6050_Read_NormGyro(struct MPU6050 *mpu);
55 int8_t MPU6050_Read_NormAxes(struct MPU6050 *mpu);
56 
57 Vec3<float> MPU6050_Calc_OmegaBias(struct MPU6050 *mpu, uint32_t n);
58 
59 
60 #endif // _MPU6050_H_
I2C_HandleTypeDef * hi2c
Definition: mpu6050.h:36
Definition: mpu6050.h:29
Vec3< int16_t > raw_a_axis
Definition: mpu6050.h:37
int8_t MPU6050_Init(struct MPU6050 *mpu)
Definition: mpu6050.cpp:20
int8_t MPU6050_Read_NormGyro(struct MPU6050 *mpu)
Definition: mpu6050.cpp:115
enum Gyro_Scale g_scale
Definition: mpu6050.h:42
Definition: mpu6050.h:31
int8_t MPU6050_Read_RawGyro(struct MPU6050 *mpu)
Definition: mpu6050.cpp:59
Gyro_Scale
Definition: mpu6050.h:26
Vec3< float > norm_g_axis
Definition: mpu6050.h:38
int8_t MPU6050_Read_NormAxes(struct MPU6050 *mpu)
Definition: mpu6050.cpp:132
Definition: mpu6050.h:21
Definition: mpu6050.h:20
int8_t MPU6050_Read_NormAccel(struct MPU6050 *mpu)
Definition: mpu6050.cpp:94
int8_t MPU6050_Read_RawAccel(struct MPU6050 *mpu)
Definition: mpu6050.cpp:45
float tmpr
Definition: mpu6050.h:40
int8_t MPU6050_Read_Temp(struct MPU6050 *mpu)
Definition: mpu6050.cpp:73
Definition: mpu6050.h:22
Vec3< int16_t > raw_g_axis
Definition: mpu6050.h:37
int8_t MPU6050_Read_RawAxes(struct MPU6050 *mpu)
Definition: mpu6050.cpp:86
uint8_t address
Definition: mpu6050.h:39
Definition: mpu6050.h:23
Definition: mpu6050.h:30
Definition: mpu6050.h:34
Accel_Scale
Definition: mpu6050.h:18
Vec3< float > norm_a_axis
Definition: mpu6050.h:38
enum Accel_Scale a_scale
Definition: mpu6050.h:41
Vec3< float > MPU6050_Calc_OmegaBias(struct MPU6050 *mpu, uint32_t n)
Definition: mpu6050.cpp:140
Definition: mpu6050.h:28