Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
mpu60x0.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2013 Gautier Hattenberger
3 *
4 * This file is part of paparazzi.
5 *
6 * paparazzi is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * paparazzi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with paparazzi; see the file COPYING. If not, see
18 * <http://www.gnu.org/licenses/>.
19 */
20
27#ifndef MPU60X0_H
28#define MPU60X0_H
29
30#include "std.h"
33
34/* Include address and register definition */
36
38#define MPU60X0_DEFAULT_SMPLRT_DIV 0
40#define MPU60X0_DEFAULT_FS_SEL MPU60X0_GYRO_RANGE_2000
42#define MPU60X0_DEFAULT_AFS_SEL MPU60X0_ACCEL_RANGE_16G
44#define MPU60X0_DEFAULT_DLPF_CFG MPU60X0_DLPF_98HZ
46#define MPU60X0_DEFAULT_DLPF_CFG_ACC MPU60X0_DLPF_ACC_99HZ
48#define MPU60X0_DEFAULT_INT_CFG 1
50#define MPU60X0_DEFAULT_CLK_SEL 1
51
52// Default number of I2C slaves
53#ifndef MPU60X0_I2C_NB_SLAVES
54#define MPU60X0_I2C_NB_SLAVES 5
55#endif
56
62#define MPU60X0_GYRO_SENS_250 0.544883
63#define MPU60X0_GYRO_SENS_500 1.08977
64#define MPU60X0_GYRO_SENS_1000 2.17953
65#define MPU60X0_GYRO_SENS_2000 4.35906
66
67// Get default sensitivity from a table
68extern const float MPU60X0_GYRO_SENS[4];
69extern const struct FloatRates MPU60X0_GYRO_SENS_F[4];
70
76#define MPU60X0_ACCEL_SENS_2G 0.613125
77#define MPU60X0_ACCEL_SENS_4G 1.22625
78#define MPU60X0_ACCEL_SENS_8G 2.4525
79#define MPU60X0_ACCEL_SENS_16G 4.905
80
81// Get default sensitivity from a table
82extern const float MPU60X0_ACCEL_SENS[4];
83extern const struct FloatVect3 MPU60X0_ACCEL_SENS_F[4];
84
94
110
113
116
120
145
146extern void mpu60x0_set_default_config(struct Mpu60x0Config *c);
147
149extern void mpu60x0_send_config(Mpu60x0ConfigSet mpu_set, void *mpu, struct Mpu60x0Config *config);
150
159
160#endif // MPU60X0_H
angular rates
uint16_t foo
Definition main_demo5.c:58
Mpu60x0I2cSlaveConfigure configure
Definition mpu60x0.h:118
uint8_t i2c_mst_delay
MPU I2C slaves delayed sample rate.
Definition mpu60x0.h:143
void mpu60x0_set_default_config(struct Mpu60x0Config *c)
Definition mpu60x0.c:61
#define MPU60X0_I2C_NB_SLAVES
Definition mpu60x0.h:54
enum Mpu60x0MstClk i2c_mst_clk
MPU I2C master clock speed.
Definition mpu60x0.h:142
bool initialized
config done flag
Definition mpu60x0.h:132
const struct FloatVect3 MPU60X0_ACCEL_SENS_F[4]
Definition mpu60x0.c:54
uint8_t nb_bytes
number of bytes to read starting with MPU60X0_REG_INT_STATUS
Definition mpu60x0.h:130
bool(* Mpu60x0I2cSlaveConfigure)(Mpu60x0ConfigSet mpu_set, void *mpu)
function prototype for configuration of a single I2C slave
Definition mpu60x0.h:115
Mpu60x0Type
MPU60x0 sensor type.
Definition mpu60x0.h:87
@ ICM20602
Definition mpu60x0.h:91
@ ICM20689
Definition mpu60x0.h:92
@ ICM20600
Definition mpu60x0.h:89
@ MPU60X0
Definition mpu60x0.h:88
@ ICM20608
Definition mpu60x0.h:90
void mpu60x0_send_config(Mpu60x0ConfigSet mpu_set, void *mpu, struct Mpu60x0Config *config)
Configuration sequence called once before normal use.
Definition mpu60x0.c:83
uint8_t smplrt_div
Sample rate divider.
Definition mpu60x0.h:123
const float MPU60X0_ACCEL_SENS[4]
Definition mpu60x0.c:46
uint8_t nb_slaves
number of used I2C slaves
Definition mpu60x0.h:139
uint8_t nb_slave_init
number of already configured/initialized slaves
Definition mpu60x0.h:140
struct Mpu60x0I2cSlave slaves[MPU60X0_I2C_NB_SLAVES]
I2C slaves.
Definition mpu60x0.h:141
const float MPU60X0_GYRO_SENS[4]
Definition mpu60x0.c:31
enum Mpu60x0DLPF dlpf_cfg
Digital Low Pass Filter.
Definition mpu60x0.h:124
enum Mpu60x0Type type
The type of sensor (MPU60x0, ICM20608, ...)
Definition mpu60x0.h:122
const struct FloatRates MPU60X0_GYRO_SENS_F[4]
Definition mpu60x0.c:38
bool i2c_bypass
Bypass MPU I2C.
Definition mpu60x0.h:137
bool drdy_int_enable
Enable Data Ready Interrupt.
Definition mpu60x0.h:128
enum Mpu60x0ConfStatus init_status
init status
Definition mpu60x0.h:131
Mpu60x0ConfStatus
Definition mpu60x0.h:95
@ MPU60X0_CONF_UNINIT
Definition mpu60x0.h:96
@ MPU60X0_CONF_I2C_SLAVES
Definition mpu60x0.h:105
@ MPU60X0_CONF_DONE
Definition mpu60x0.h:108
@ MPU60X0_CONF_ACCEL
Definition mpu60x0.h:103
@ MPU60X0_CONF_PWR
Definition mpu60x0.h:99
@ MPU60X0_CONF_GYRO
Definition mpu60x0.h:102
@ MPU60X0_CONF_INT_ENABLE
Definition mpu60x0.h:106
@ MPU60X0_CONF_USER_RESET
Definition mpu60x0.h:98
@ MPU60X0_CONF_RESET
Definition mpu60x0.h:97
@ MPU60X0_CONF_ACCEL2
Definition mpu60x0.h:104
@ MPU60X0_CONF_UNDOC1
Definition mpu60x0.h:107
@ MPU60X0_CONF_SD
Definition mpu60x0.h:100
@ MPU60X0_CONF_DLPF
Definition mpu60x0.h:101
enum Mpu60x0AccelRanges accel_range
g Range
Definition mpu60x0.h:127
uint8_t clk_sel
Clock select.
Definition mpu60x0.h:129
enum Mpu60x0ACCDLPF dlpf_cfg_acc
Digital Low Pass Filter for acceleremoter (ICM devices only)
Definition mpu60x0.h:125
void(* Mpu60x0ConfigSet)(void *mpu, uint8_t _reg, uint8_t _val)
Configuration function prototype.
Definition mpu60x0.h:112
bool mpu60x0_configure_i2c_slaves(Mpu60x0ConfigSet mpu_set, void *mpu)
Configure I2C slaves of the MPU.
enum Mpu60x0GyroRanges gyro_range
deg/s Range
Definition mpu60x0.h:126
Register and address definitions for MPU-6000 and MPU-6050.
Mpu60x0DLPF
Digital Low Pass Filter Options DLFP is affecting both gyro and accels (on MPU not ICM),...
Mpu60x0GyroRanges
Selectable gyro range.
Mpu60x0AccelRanges
Selectable accel range.
Mpu60x0ACCDLPF
Digital Low Pass Filter Options DLFP specifically for the ICM device accelerometer.
Mpu60x0MstClk
I2C Master clock.
Paparazzi floating point algebra.
Paparazzi fixed point algebra.
static const struct usb_config_descriptor config
Definition usb_ser_hw.c:200
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.