APM:Libraries
Classes | Macros | Variables
AP_InertialSensor_BMI160.cpp File Reference
#include <utility>
#include <AP_HAL/AP_HAL.h>
#include <AP_HAL/utility/sparse-endian.h>
#include <AP_HAL_Linux/GPIO.h>
#include <AP_Math/AP_Math.h>
#include "AP_InertialSensor_BMI160.h"
Include dependency graph for AP_InertialSensor_BMI160.cpp:

Go to the source code of this file.

Classes

struct  RawData
 

Macros

#define BMI160_REG_CHIPID   0x00
 
#define BMI160_CHIPID   0xD1
 
#define BMI160_REG_ERR_REG   0x02
 
#define BMI160_REG_FIFO_LENGTH   0x22
 
#define BMI160_REG_FIFO_DATA   0x24
 
#define BMI160_REG_ACC_CONF   0x40
 
#define BMI160_REG_ACC_RANGE   0x41
 
#define BMI160_ACC_RANGE_16G   3
 
#define BMI160_REG_GYR_CONF   0x42
 
#define BMI160_REG_GYR_RANGE   0x43
 
#define BMI160_GYR_RANGE_2000DPS   0x00
 
#define BMI160_REG_FIFO_CONFIG_0   0x46
 
#define BMI160_REG_FIFO_CONFIG_1   0x47
 
#define BMI160_FIFO_ACC_EN   0x40
 
#define BMI160_FIFO_GYR_EN   0x80
 
#define BMI160_REG_INT_EN_1   0x51
 
#define BMI160_INT_FWM_EN   0x40
 
#define BMI160_REG_INT_OUT_CTRL   0x53
 
#define BMI160_INT1_LVL   0x02
 
#define BMI160_INT1_OUTPUT_EN   0x08
 
#define BMI160_REG_INT_MAP_1   0x56
 
#define BMI160_INT_MAP_INT1_FWM   0x40
 
#define BMI160_REG_CMD   0x7E
 
#define BMI160_CMD_ACCEL_NORMAL_POWER_MODE   0x11
 
#define BMI160_CMD_GYRO_NORMAL_POWER_MODE   0x15
 
#define BMI160_CMD_FIFO_FLUSH   0xB0
 
#define BMI160_CMD_SOFTRESET   0xB6
 
#define BMI160_OSR_NORMAL   0x20
 
#define BMI160_ODR_1600HZ   0x0C
 
#define BMI160_POWERUP_DELAY_MSEC   10
 
#define BMI160_SOFTRESET_DELAY_MSEC   100
 
#define BMI160_ACCEL_NORMAL_POWER_MODE_DELAY_MSEC   4
 
#define BMI160_GYRO_NORMAL_POWER_MODE_DELAY_MSEC   81
 
#define BMI160_OSR   BMI160_OSR_NORMAL
 
#define BMI160_ODR   BMI160_ODR_1600HZ
 
#define BMI160_ACC_RANGE   BMI160_ACC_RANGE_16G
 
#define BMI160_GYR_RANGE   BMI160_GYR_RANGE_2000DPS
 
#define BMI160_ACC_RANGE_BITS   (BMI160_ACC_RANGE * (BMI160_ACC_RANGE + 3) / 2 + 3)
 
#define BMI160_ODR_TO_HZ(odr_)   (uint16_t)(odr_ > 8 ? 100 << (odr_ - 8) : 100 >> (8 - odr_))
 
#define BMI160_MAX_FIFO_SAMPLES   8
 
#define BMI160_READ_FLAG   0x80
 
#define BMI160_HARDWARE_INIT_MAX_TRIES   5
 
#define BMI160_INT1_GPIO   AERO_GPIO_BMI160_INT1
 

Variables

const AP_HAL::HALhal
 -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- More...
 

Macro Definition Documentation

◆ BMI160_ACC_RANGE

#define BMI160_ACC_RANGE   BMI160_ACC_RANGE_16G

◆ BMI160_ACC_RANGE_16G

#define BMI160_ACC_RANGE_16G   3

Definition at line 40 of file AP_InertialSensor_BMI160.cpp.

◆ BMI160_ACC_RANGE_BITS

#define BMI160_ACC_RANGE_BITS   (BMI160_ACC_RANGE * (BMI160_ACC_RANGE + 3) / 2 + 3)

◆ BMI160_ACCEL_NORMAL_POWER_MODE_DELAY_MSEC

#define BMI160_ACCEL_NORMAL_POWER_MODE_DELAY_MSEC   4

◆ BMI160_CHIPID

#define BMI160_CHIPID   0xD1

◆ BMI160_CMD_ACCEL_NORMAL_POWER_MODE

#define BMI160_CMD_ACCEL_NORMAL_POWER_MODE   0x11

◆ BMI160_CMD_FIFO_FLUSH

#define BMI160_CMD_FIFO_FLUSH   0xB0

◆ BMI160_CMD_GYRO_NORMAL_POWER_MODE

#define BMI160_CMD_GYRO_NORMAL_POWER_MODE   0x15

◆ BMI160_CMD_SOFTRESET

#define BMI160_CMD_SOFTRESET   0xB6

◆ BMI160_FIFO_ACC_EN

#define BMI160_FIFO_ACC_EN   0x40

◆ BMI160_FIFO_GYR_EN

#define BMI160_FIFO_GYR_EN   0x80

◆ BMI160_GYR_RANGE

#define BMI160_GYR_RANGE   BMI160_GYR_RANGE_2000DPS

◆ BMI160_GYR_RANGE_2000DPS

#define BMI160_GYR_RANGE_2000DPS   0x00

Definition at line 43 of file AP_InertialSensor_BMI160.cpp.

◆ BMI160_GYRO_NORMAL_POWER_MODE_DELAY_MSEC

#define BMI160_GYRO_NORMAL_POWER_MODE_DELAY_MSEC   81

◆ BMI160_HARDWARE_INIT_MAX_TRIES

#define BMI160_HARDWARE_INIT_MAX_TRIES   5

◆ BMI160_INT1_GPIO

#define BMI160_INT1_GPIO   AERO_GPIO_BMI160_INT1

◆ BMI160_INT1_LVL

#define BMI160_INT1_LVL   0x02

◆ BMI160_INT1_OUTPUT_EN

#define BMI160_INT1_OUTPUT_EN   0x08

◆ BMI160_INT_FWM_EN

#define BMI160_INT_FWM_EN   0x40

◆ BMI160_INT_MAP_INT1_FWM

#define BMI160_INT_MAP_INT1_FWM   0x40

◆ BMI160_MAX_FIFO_SAMPLES

#define BMI160_MAX_FIFO_SAMPLES   8

Definition at line 97 of file AP_InertialSensor_BMI160.cpp.

◆ BMI160_ODR

#define BMI160_ODR   BMI160_ODR_1600HZ

◆ BMI160_ODR_1600HZ

#define BMI160_ODR_1600HZ   0x0C

Definition at line 62 of file AP_InertialSensor_BMI160.cpp.

◆ BMI160_ODR_TO_HZ

#define BMI160_ODR_TO_HZ (   odr_)    (uint16_t)(odr_ > 8 ? 100 << (odr_ - 8) : 100 >> (8 - odr_))

Definition at line 92 of file AP_InertialSensor_BMI160.cpp.

Referenced by AP_InertialSensor_BMI160::start().

◆ BMI160_OSR

#define BMI160_OSR   BMI160_OSR_NORMAL

◆ BMI160_OSR_NORMAL

#define BMI160_OSR_NORMAL   0x20

Definition at line 61 of file AP_InertialSensor_BMI160.cpp.

◆ BMI160_POWERUP_DELAY_MSEC

#define BMI160_POWERUP_DELAY_MSEC   10

◆ BMI160_READ_FLAG

#define BMI160_READ_FLAG   0x80

Definition at line 99 of file AP_InertialSensor_BMI160.cpp.

Referenced by AP_InertialSensor_BMI160::_init().

◆ BMI160_REG_ACC_CONF

#define BMI160_REG_ACC_CONF   0x40

◆ BMI160_REG_ACC_RANGE

#define BMI160_REG_ACC_RANGE   0x41

◆ BMI160_REG_CHIPID

#define BMI160_REG_CHIPID   0x00

◆ BMI160_REG_CMD

#define BMI160_REG_CMD   0x7E

◆ BMI160_REG_ERR_REG

#define BMI160_REG_ERR_REG   0x02

◆ BMI160_REG_FIFO_CONFIG_0

#define BMI160_REG_FIFO_CONFIG_0   0x46

◆ BMI160_REG_FIFO_CONFIG_1

#define BMI160_REG_FIFO_CONFIG_1   0x47

◆ BMI160_REG_FIFO_DATA

#define BMI160_REG_FIFO_DATA   0x24

Definition at line 35 of file AP_InertialSensor_BMI160.cpp.

Referenced by AP_InertialSensor_BMI160::_read_fifo().

◆ BMI160_REG_FIFO_LENGTH

#define BMI160_REG_FIFO_LENGTH   0x22

Definition at line 34 of file AP_InertialSensor_BMI160.cpp.

Referenced by AP_InertialSensor_BMI160::_read_fifo().

◆ BMI160_REG_GYR_CONF

#define BMI160_REG_GYR_CONF   0x42

◆ BMI160_REG_GYR_RANGE

#define BMI160_REG_GYR_RANGE   0x43

◆ BMI160_REG_INT_EN_1

#define BMI160_REG_INT_EN_1   0x51

◆ BMI160_REG_INT_MAP_1

#define BMI160_REG_INT_MAP_1   0x56

◆ BMI160_REG_INT_OUT_CTRL

#define BMI160_REG_INT_OUT_CTRL   0x53

◆ BMI160_SOFTRESET_DELAY_MSEC

#define BMI160_SOFTRESET_DELAY_MSEC   100

Variable Documentation

◆ hal

const AP_HAL::HAL& hal

-*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-

Definition at line 14 of file AC_PID_test.cpp.