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
bmi088.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2019 Gautier Hattenberger <gautier.hattenberger@enac.fr>
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 BMI088_H
28#define BMI088_H
29
30#include "std.h"
33
34/* Include address and register definition */
36
38#define BMI088_DEFAULT_GYRO_RANGE BMI088_GYRO_RANGE_1000
40#define BMI088_DEFAULT_GYRO_ODR BMI088_GYRO_ODR_1000_BW_116
42#define BMI088_DEFAULT_ACCEL_RANGE BMI088_ACCEL_RANGE_12G
44#define BMI088_DEFAULT_ACCEL_ODR BMI088_ACCEL_ODR_1600
46#define BMI088_DEFAULT_ACCEL_BW BMI088_ACCEL_BW_OSR4
47
53#define BMI088_GYRO_SENS_125 0.272442 // FIXME
54#define BMI088_GYRO_SENS_125_NUM 19327
55#define BMI088_GYRO_SENS_125_DEN 17735
56#define BMI088_GYRO_SENS_250 0.544883
57#define BMI088_GYRO_SENS_250_NUM 19327
58#define BMI088_GYRO_SENS_250_DEN 35470
59#define BMI088_GYRO_SENS_500 1.08977
60#define BMI088_GYRO_SENS_500_NUM 57663
61#define BMI088_GYRO_SENS_500_DEN 52913
62#define BMI088_GYRO_SENS_1000 2.17953
63#define BMI088_GYRO_SENS_1000_NUM 18271
64#define BMI088_GYRO_SENS_1000_DEN 8383
65#define BMI088_GYRO_SENS_2000 4.35906
66#define BMI088_GYRO_SENS_2000_NUM 36542
67#define BMI088_GYRO_SENS_2000_DEN 8383
68
69// Get default sensitivity from a table
70extern const float BMI088_GYRO_SENS[5];
71// Get default sensitivity numerator and denominator from a table
72extern const struct FloatRates BMI088_GYRO_SENS_F[5];
73
79// FIXME
80#define BMI088_ACCEL_SENS_3G 0.919912
81#define BMI088_ACCEL_SENS_3G_NUM 9199
82#define BMI088_ACCEL_SENS_3G_DEN 10000
83#define BMI088_ACCEL_SENS_6G 1.83982
84#define BMI088_ACCEL_SENS_6G_NUM 18398
85#define BMI088_ACCEL_SENS_6G_DEN 10000
86#define BMI088_ACCEL_SENS_12G 3.67965
87#define BMI088_ACCEL_SENS_12G_NUM 36797
88#define BMI088_ACCEL_SENS_12G_DEN 10000
89#define BMI088_ACCEL_SENS_24G 7.3593
90#define BMI088_ACCEL_SENS_24G_NUM 7359
91#define BMI088_ACCEL_SENS_24G_DEN 1000
92
93// Get default sensitivity from a table
94extern const float BMI088_ACCEL_SENS[4];
95// Get default sensitivity numerator and denominator from a table
96extern const struct FloatVect3 BMI088_ACCEL_SENS_F[4];
97
109
110#define BMI088_CONFIG_ACCEL 0
111#define BMI088_CONFIG_GYRO 1
114
127
128extern void bmi088_set_default_config(struct Bmi088Config *c);
129
131extern void bmi088_send_config(Bmi088ConfigSet bmi_set, void *bmi, struct Bmi088Config *config);
132
133#endif // BMI088_H
void bmi088_set_default_config(struct Bmi088Config *c)
Definition bmi088.c:61
const float BMI088_ACCEL_SENS[4]
Definition bmi088.c:47
enum Bmi088AccelODR accel_odr
output data rate
Definition bmi088.h:119
void(* Bmi088ConfigSet)(void *bmi, uint8_t _reg, uint8_t _val, uint8_t _type)
Configuration function prototype.
Definition bmi088.h:113
const struct FloatRates BMI088_GYRO_SENS_F[5]
Definition bmi088.c:39
enum Bmi088AccelRanges accel_range
g Range
Definition bmi088.h:118
enum Bmi088GyroODR gyro_odr
output data rate
Definition bmi088.h:117
enum Bmi088AccelBW accel_bw
bandwidth
Definition bmi088.h:120
void bmi088_send_config(Bmi088ConfigSet bmi_set, void *bmi, struct Bmi088Config *config)
Configuration sequence called once before normal use.
Definition bmi088.c:70
bool initialized
config done flag
Definition bmi088.h:122
const struct FloatVect3 BMI088_ACCEL_SENS_F[4]
Definition bmi088.c:54
enum Bmi088ConfStatus init_status
init status
Definition bmi088.h:121
Bmi088ConfStatus
Definition bmi088.h:98
@ BMI088_CONF_ACCEL_RANGE
Definition bmi088.h:100
@ BMI088_CONF_GYRO_PWR
Definition bmi088.h:106
@ BMI088_CONF_ACCEL_ODR
Definition bmi088.h:101
@ BMI088_CONF_GYRO_ODR
Definition bmi088.h:105
@ BMI088_CONF_ACCEL_PWR_CTRL
Definition bmi088.h:103
@ BMI088_CONF_DONE
Definition bmi088.h:107
@ BMI088_CONF_GYRO_RANGE
Definition bmi088.h:104
@ BMI088_CONF_ACCEL_PWR_CONF
Definition bmi088.h:102
@ BMI088_CONF_UNINIT
Definition bmi088.h:99
float accel_samplerate
samplerate in Hz from accel_odr
Definition bmi088.h:125
float gyro_samplerate
samplerate in Hz from gyro_odr
Definition bmi088.h:124
enum Bmi088GyroRanges gyro_range
deg/s Range
Definition bmi088.h:116
const float BMI088_GYRO_SENS[5]
Definition bmi088.c:31
Register and address definitions for BMI088.
Bmi088GyroODR
Gyro output data rate and bandwidth.
Bmi088GyroRanges
Gyro output range.
Bmi088AccelODR
Accel outpur data rate.
Bmi088AccelRanges
Accel output range.
Definition bmi088_regs.h:98
Bmi088AccelBW
Accel bandwith.
angular rates
uint16_t foo
Definition main_demo5.c:58
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.