ESPHome 2025.5.0
Loading...
Searching...
No Matches
bmi160.cpp File Reference

Go to the source code of this file.

Namespaces

namespace  esphome
 Providing packet encoding functions for exchanging data with a remote host.
 
namespace  esphome::bmi160
 

Enumerations

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