Paparazzi UAS  v5.15_devel-164-g81d4ceb
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
bmi088.h File Reference

BMI088 driver common interface (I2C and SPI). More...

#include "std.h"
#include "peripherals/bmi088_regs.h"
+ Include dependency graph for bmi088.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Bmi088Config
 

Macros

#define BMI088_DEFAULT_GYRO_RANGE   BMI088_GYRO_RANGE_1000
 Default gyro full scale range +- 1000°/s. More...
 
#define BMI088_DEFAULT_GYRO_ODR   BMI088_GYRO_ODR_400_BW_47
 Default gyro output rate. More...
 
#define BMI088_DEFAULT_ACCEL_RANGE   BMI088_ACCEL_RANGE_6G
 Default accel full scale range +- 6g. More...
 
#define BMI088_DEFAULT_ACCEL_ODR   BMI088_ACCEL_ODR_400
 Default accel output rate. More...
 
#define BMI088_DEFAULT_ACCEL_BW   BMI088_ACCEL_BW_NORMAL
 Default accel bandwidth. More...
 
#define BMI088_GYRO_SENS_125   0.272442
 default gyro sensitivy from the datasheet sens = 1/ [LSB/(deg/s)] * pi/180 * 2^INT32_RATE_FRAC ex: BMI with 1000 deg/s has 32.8 LSB/(deg/s) sens = 1/32.8 * pi/180 * 4096 = 2.17953 More...
 
#define BMI088_GYRO_SENS_125_NUM   19327
 
#define BMI088_GYRO_SENS_125_DEN   17735
 
#define BMI088_GYRO_SENS_250   0.544883
 
#define BMI088_GYRO_SENS_250_NUM   19327
 
#define BMI088_GYRO_SENS_250_DEN   35470
 
#define BMI088_GYRO_SENS_500   1.08977
 
#define BMI088_GYRO_SENS_500_NUM   57663
 
#define BMI088_GYRO_SENS_500_DEN   52913
 
#define BMI088_GYRO_SENS_1000   2.17953
 
#define BMI088_GYRO_SENS_1000_NUM   18271
 
#define BMI088_GYRO_SENS_1000_DEN   8383
 
#define BMI088_GYRO_SENS_2000   4.35906
 
#define BMI088_GYRO_SENS_2000_NUM   36542
 
#define BMI088_GYRO_SENS_2000_DEN   8383
 
#define BMI088_ACCEL_SENS_3G   0.919687
 default accel sensitivy from the datasheet sens = 9.81 [m/s^2] / [LSB/g] * 2^INT32_ACCEL_FRAC ex: BMI with 8g has 4096 LSB/g sens = 9.81 [m/s^2] / 4096 [LSB/g] * 2^INT32_ACCEL_FRAC = 2.4525 More...
 
#define BMI088_ACCEL_SENS_3G_NUM   9197
 
#define BMI088_ACCEL_SENS_3G_DEN   10000
 
#define BMI088_ACCEL_SENS_6G   1.83937
 
#define BMI088_ACCEL_SENS_6G_NUM   18394
 
#define BMI088_ACCEL_SENS_6G_DEN   10000
 
#define BMI088_ACCEL_SENS_12G   3.67875
 
#define BMI088_ACCEL_SENS_12G_NUM   36787
 
#define BMI088_ACCEL_SENS_12G_DEN   10000
 
#define BMI088_ACCEL_SENS_24G   7.3575
 
#define BMI088_ACCEL_SENS_24G_NUM   7357
 
#define BMI088_ACCEL_SENS_24G_DEN   1000
 
#define BMI088_CONFIG_ACCEL   0
 
#define BMI088_CONFIG_GYRO   1
 

Typedefs

typedef void(* Bmi088ConfigSet )(void *bmi, uint8_t _reg, uint8_t _val, uint8_t _type)
 Configuration function prototype. More...
 

Enumerations

enum  Bmi088ConfStatus {
  BMI088_CONF_UNINIT, BMI088_CONF_ACCEL_RANGE, BMI088_CONF_ACCEL_ODR, BMI088_CONF_ACCEL_PWR_CONF,
  BMI088_CONF_ACCEL_PWR_CTRL, BMI088_CONF_GYRO_RANGE, BMI088_CONF_GYRO_ODR, BMI088_CONF_GYRO_PWR,
  BMI088_CONF_DONE
}
 

Functions

void bmi088_set_default_config (struct Bmi088Config *c)
 
void bmi088_send_config (Bmi088ConfigSet bmi_set, void *bmi, struct Bmi088Config *config)
 Configuration sequence called once before normal use. More...
 

Variables

const float BMI088_GYRO_SENS [5]
 
const int32_t BMI088_GYRO_SENS_FRAC [5][2]
 
const float BMI088_ACCEL_SENS [4]
 
const int32_t BMI088_ACCEL_SENS_FRAC [4][2]
 

Detailed Description

BMI088 driver common interface (I2C and SPI).

Definition in file bmi088.h.


Data Structure Documentation

struct Bmi088Config

Definition at line 113 of file bmi088.h.

Data Fields
enum Bmi088AccelBW accel_bw bandwidth
enum Bmi088AccelODR accel_odr output data rate
enum Bmi088AccelRanges accel_range g Range
enum Bmi088GyroODR gyro_odr output data rate
enum Bmi088GyroRanges gyro_range deg/s Range
enum Bmi088ConfStatus init_status init status
bool initialized config done flag

Macro Definition Documentation

#define BMI088_ACCEL_SENS_12G   3.67875

Definition at line 84 of file bmi088.h.

#define BMI088_ACCEL_SENS_12G_DEN   10000

Definition at line 86 of file bmi088.h.

#define BMI088_ACCEL_SENS_12G_NUM   36787

Definition at line 85 of file bmi088.h.

#define BMI088_ACCEL_SENS_24G   7.3575

Definition at line 87 of file bmi088.h.

#define BMI088_ACCEL_SENS_24G_DEN   1000

Definition at line 89 of file bmi088.h.

#define BMI088_ACCEL_SENS_24G_NUM   7357

Definition at line 88 of file bmi088.h.

#define BMI088_ACCEL_SENS_3G   0.919687

default accel sensitivy from the datasheet sens = 9.81 [m/s^2] / [LSB/g] * 2^INT32_ACCEL_FRAC ex: BMI with 8g has 4096 LSB/g sens = 9.81 [m/s^2] / 4096 [LSB/g] * 2^INT32_ACCEL_FRAC = 2.4525

Definition at line 78 of file bmi088.h.

#define BMI088_ACCEL_SENS_3G_DEN   10000

Definition at line 80 of file bmi088.h.

#define BMI088_ACCEL_SENS_3G_NUM   9197

Definition at line 79 of file bmi088.h.

#define BMI088_ACCEL_SENS_6G   1.83937

Definition at line 81 of file bmi088.h.

#define BMI088_ACCEL_SENS_6G_DEN   10000

Definition at line 83 of file bmi088.h.

#define BMI088_ACCEL_SENS_6G_NUM   18394

Definition at line 82 of file bmi088.h.

#define BMI088_CONFIG_ACCEL   0

Definition at line 108 of file bmi088.h.

Referenced by bmi088_i2c_write_to_reg(), and bmi088_send_config().

#define BMI088_CONFIG_GYRO   1

Definition at line 109 of file bmi088.h.

Referenced by bmi088_i2c_write_to_reg(), and bmi088_send_config().

#define BMI088_DEFAULT_ACCEL_BW   BMI088_ACCEL_BW_NORMAL

Default accel bandwidth.

Definition at line 44 of file bmi088.h.

Referenced by bmi088_set_default_config().

#define BMI088_DEFAULT_ACCEL_ODR   BMI088_ACCEL_ODR_400

Default accel output rate.

Definition at line 42 of file bmi088.h.

Referenced by bmi088_set_default_config().

#define BMI088_DEFAULT_ACCEL_RANGE   BMI088_ACCEL_RANGE_6G

Default accel full scale range +- 6g.

Definition at line 40 of file bmi088.h.

Referenced by bmi088_set_default_config().

#define BMI088_DEFAULT_GYRO_ODR   BMI088_GYRO_ODR_400_BW_47

Default gyro output rate.

Definition at line 38 of file bmi088.h.

Referenced by bmi088_set_default_config().

#define BMI088_DEFAULT_GYRO_RANGE   BMI088_GYRO_RANGE_1000

Default gyro full scale range +- 1000°/s.

Definition at line 36 of file bmi088.h.

Referenced by bmi088_set_default_config().

#define BMI088_GYRO_SENS_1000   2.17953

Definition at line 60 of file bmi088.h.

#define BMI088_GYRO_SENS_1000_DEN   8383

Definition at line 62 of file bmi088.h.

#define BMI088_GYRO_SENS_1000_NUM   18271

Definition at line 61 of file bmi088.h.

#define BMI088_GYRO_SENS_125   0.272442

default gyro sensitivy from the datasheet sens = 1/ [LSB/(deg/s)] * pi/180 * 2^INT32_RATE_FRAC ex: BMI with 1000 deg/s has 32.8 LSB/(deg/s) sens = 1/32.8 * pi/180 * 4096 = 2.17953

Definition at line 51 of file bmi088.h.

#define BMI088_GYRO_SENS_125_DEN   17735

Definition at line 53 of file bmi088.h.

#define BMI088_GYRO_SENS_125_NUM   19327

Definition at line 52 of file bmi088.h.

#define BMI088_GYRO_SENS_2000   4.35906

Definition at line 63 of file bmi088.h.

#define BMI088_GYRO_SENS_2000_DEN   8383

Definition at line 65 of file bmi088.h.

#define BMI088_GYRO_SENS_2000_NUM   36542

Definition at line 64 of file bmi088.h.

#define BMI088_GYRO_SENS_250   0.544883

Definition at line 54 of file bmi088.h.

#define BMI088_GYRO_SENS_250_DEN   35470

Definition at line 56 of file bmi088.h.

#define BMI088_GYRO_SENS_250_NUM   19327

Definition at line 55 of file bmi088.h.

#define BMI088_GYRO_SENS_500   1.08977

Definition at line 57 of file bmi088.h.

#define BMI088_GYRO_SENS_500_DEN   52913

Definition at line 59 of file bmi088.h.

#define BMI088_GYRO_SENS_500_NUM   57663

Definition at line 58 of file bmi088.h.

Typedef Documentation

typedef void(* Bmi088ConfigSet)(void *bmi, uint8_t _reg, uint8_t _val, uint8_t _type)

Configuration function prototype.

Definition at line 111 of file bmi088.h.

Enumeration Type Documentation

Enumerator
BMI088_CONF_UNINIT 
BMI088_CONF_ACCEL_RANGE 
BMI088_CONF_ACCEL_ODR 
BMI088_CONF_ACCEL_PWR_CONF 
BMI088_CONF_ACCEL_PWR_CTRL 
BMI088_CONF_GYRO_RANGE 
BMI088_CONF_GYRO_ODR 
BMI088_CONF_GYRO_PWR 
BMI088_CONF_DONE 

Definition at line 96 of file bmi088.h.

Function Documentation

Variable Documentation

const float BMI088_ACCEL_SENS[4]

Definition at line 47 of file bmi088.c.

const int32_t BMI088_ACCEL_SENS_FRAC[4][2]

Definition at line 54 of file bmi088.c.

const float BMI088_GYRO_SENS[5]

Definition at line 31 of file bmi088.c.

const int32_t BMI088_GYRO_SENS_FRAC[5][2]

Definition at line 39 of file bmi088.c.