ESPHome  2024.10.2
Namespaces | Enumerations | Variables
bmi160.cpp File Reference

Go to the source code of this file.

Namespaces

 esphome
 Implementation of SPI Controller mode.
 
 esphome::bmi160
 

Enumerations

enum  esphome::bmi160::Cmd : uint8_t {
  esphome::bmi160::Cmd::START_FOC = 0x03, esphome::bmi160::Cmd::ACCL_SET_PMU_MODE = 0b00010000, esphome::bmi160::Cmd::GYRO_SET_PMU_MODE = 0b00010100, esphome::bmi160::Cmd::MAG_SET_PMU_MODE = 0b00011000,
  esphome::bmi160::Cmd::PROG_NVM = 0xA0, esphome::bmi160::Cmd::FIFO_FLUSH = 0xB0, esphome::bmi160::Cmd::INT_RESET = 0xB1, esphome::bmi160::Cmd::SOFT_RESET = 0xB6,
  esphome::bmi160::Cmd::STEP_CNT_CLR = 0xB2
}
 
enum  esphome::bmi160::GyroPmuMode : uint8_t { esphome::bmi160::GyroPmuMode::SUSPEND = 0b00, esphome::bmi160::GyroPmuMode::NORMAL = 0b01, esphome::bmi160::GyroPmuMode::LOW_POWER = 0b10 }
 
enum  esphome::bmi160::AcclPmuMode : uint8_t { esphome::bmi160::AcclPmuMode::SUSPEND = 0b00, esphome::bmi160::AcclPmuMode::NORMAL = 0b01, esphome::bmi160::AcclPmuMode::FAST_STARTUP = 0b11 }
 
enum  esphome::bmi160::MagPmuMode : uint8_t { esphome::bmi160::MagPmuMode::SUSPEND = 0b00, esphome::bmi160::MagPmuMode::NORMAL = 0b01, esphome::bmi160::MagPmuMode::LOW_POWER = 0b10 }
 
enum  esphome::bmi160::AcclFilterMode : uint8_t { esphome::bmi160::AcclFilterMode::POWER_SAVING = 0b00000000, esphome::bmi160::AcclFilterMode::PERF = 0b10000000 }
 
enum  esphome::bmi160::AcclBandwidth : uint8_t {
  esphome::bmi160::AcclBandwidth::OSR4_AVG1 = 0b00000000, esphome::bmi160::AcclBandwidth::OSR2_AVG2 = 0b00010000, esphome::bmi160::AcclBandwidth::NORMAL_AVG4 = 0b00100000, esphome::bmi160::AcclBandwidth::RES_AVG8 = 0b00110000,
  esphome::bmi160::AcclBandwidth::RES_AVG16 = 0b01000000, esphome::bmi160::AcclBandwidth::RES_AVG32 = 0b01010000, esphome::bmi160::AcclBandwidth::RES_AVG64 = 0b01100000, esphome::bmi160::AcclBandwidth::RES_AVG128 = 0b01110000
}
 
enum  esphome::bmi160::AccelOutputDataRate : uint8_t {
  esphome::bmi160::AccelOutputDataRate::HZ_25_32 = 0b0001, esphome::bmi160::AccelOutputDataRate::HZ_25_16 = 0b0010, esphome::bmi160::AccelOutputDataRate::HZ_25_8 = 0b0011, esphome::bmi160::AccelOutputDataRate::HZ_25_4 = 0b0100,
  esphome::bmi160::AccelOutputDataRate::HZ_25_2 = 0b0101, esphome::bmi160::AccelOutputDataRate::HZ_25 = 0b0110, esphome::bmi160::AccelOutputDataRate::HZ_50 = 0b0111, esphome::bmi160::AccelOutputDataRate::HZ_100 = 0b1000,
  esphome::bmi160::AccelOutputDataRate::HZ_200 = 0b1001, esphome::bmi160::AccelOutputDataRate::HZ_400 = 0b1010, esphome::bmi160::AccelOutputDataRate::HZ_800 = 0b1011, esphome::bmi160::AccelOutputDataRate::HZ_1600 = 0b1100
}
 
enum  esphome::bmi160::AccelRange : uint8_t { esphome::bmi160::AccelRange::RANGE_2G = 0b0011, esphome::bmi160::AccelRange::RANGE_4G = 0b0101, esphome::bmi160::AccelRange::RANGE_8G = 0b1000, esphome::bmi160::AccelRange::RANGE_16G = 0b1100 }
 
enum  esphome::bmi160::GyroBandwidth : uint8_t { esphome::bmi160::GyroBandwidth::OSR4 = 0x00, esphome::bmi160::GyroBandwidth::OSR2 = 0x10, esphome::bmi160::GyroBandwidth::NORMAL = 0x20 }
 
enum  esphome::bmi160::GyroOuputDataRate : uint8_t {
  esphome::bmi160::GyroOuputDataRate::HZ_25 = 0x06, esphome::bmi160::GyroOuputDataRate::HZ_50 = 0x07, esphome::bmi160::GyroOuputDataRate::HZ_100 = 0x08, esphome::bmi160::GyroOuputDataRate::HZ_200 = 0x09,
  esphome::bmi160::GyroOuputDataRate::HZ_400 = 0x0A, esphome::bmi160::GyroOuputDataRate::HZ_800 = 0x0B, esphome::bmi160::GyroOuputDataRate::HZ_1600 = 0x0C, esphome::bmi160::GyroOuputDataRate::HZ_3200 = 0x0D
}
 
enum  esphome::bmi160::GyroRange : uint8_t {
  esphome::bmi160::GyroRange::RANGE_2000_DPS = 0x0, esphome::bmi160::GyroRange::RANGE_1000_DPS = 0x1, esphome::bmi160::GyroRange::RANGE_500_DPS = 0x2, esphome::bmi160::GyroRange::RANGE_250_DPS = 0x3,
  esphome::bmi160::GyroRange::RANGE_125_DPS = 0x4
}
 

Variables

const uint8_t esphome::bmi160::BMI160_REGISTER_CHIPID = 0x00
 
const uint8_t esphome::bmi160::BMI160_REGISTER_CMD = 0x7E
 
const uint8_t esphome::bmi160::BMI160_REGISTER_ACCEL_CONFIG = 0x40
 
const uint8_t esphome::bmi160::BMI160_REGISTER_ACCEL_RANGE = 0x41
 
const uint8_t esphome::bmi160::BMI160_REGISTER_GYRO_CONFIG = 0x42
 
const uint8_t esphome::bmi160::BMI160_REGISTER_GYRO_RANGE = 0x43
 
const uint8_t esphome::bmi160::BMI160_REGISTER_DATA_GYRO_X_LSB = 0x0C
 
const uint8_t esphome::bmi160::BMI160_REGISTER_DATA_GYRO_X_MSB = 0x0D
 
const uint8_t esphome::bmi160::BMI160_REGISTER_DATA_GYRO_Y_LSB = 0x0E
 
const uint8_t esphome::bmi160::BMI160_REGISTER_DATA_GYRO_Y_MSB = 0x0F
 
const uint8_t esphome::bmi160::BMI160_REGISTER_DATA_GYRO_Z_LSB = 0x10
 
const uint8_t esphome::bmi160::BMI160_REGISTER_DATA_GYRO_Z_MSB = 0x11
 
const uint8_t esphome::bmi160::BMI160_REGISTER_DATA_ACCEL_X_LSB = 0x12
 
const uint8_t esphome::bmi160::BMI160_REGISTER_DATA_ACCEL_X_MSB = 0x13
 
const uint8_t esphome::bmi160::BMI160_REGISTER_DATA_ACCEL_Y_LSB = 0x14
 
const uint8_t esphome::bmi160::BMI160_REGISTER_DATA_ACCEL_Y_MSB = 0x15
 
const uint8_t esphome::bmi160::BMI160_REGISTER_DATA_ACCEL_Z_LSB = 0x16
 
const uint8_t esphome::bmi160::BMI160_REGISTER_DATA_ACCEL_Z_MSB = 0x17
 
const uint8_t esphome::bmi160::BMI160_REGISTER_DATA_TEMP_LSB = 0x20
 
const uint8_t esphome::bmi160::BMI160_REGISTER_DATA_TEMP_MSB = 0x21
 
const float esphome::bmi160::GRAVITY_EARTH = 9.80665f