[lsm6ds] Add support for LSM6DSO32TR (WHO_AM_I 0x69)
This commit is contained in:
1 parent
d0d3ed8b0c
commit
f404061060
2 files changed
+4
-1
No files matched your search
@@ -13,6 +13,7 @@ LSM6DS_OUTX_L_A = 0x28
|
|||||||
# WHO_AM_I Values for different variants
|
# WHO_AM_I Values for different variants
|
||||||
LSM6DSOX_WHO_AM_I_VALUE = 0x6C
|
LSM6DSOX_WHO_AM_I_VALUE = 0x6C
|
||||||
LSM6DS3TR_WHO_AM_I_VALUE = 0x6A
|
LSM6DS3TR_WHO_AM_I_VALUE = 0x6A
|
||||||
|
LSM6DSO32TR_WHO_AM_I_VALUE = 0x69
|
||||||
|
|
||||||
lsm6ds_ns = cg.esphome_ns.namespace("lsm6ds")
|
lsm6ds_ns = cg.esphome_ns.namespace("lsm6ds")
|
||||||
LSM6DSComponent = lsm6ds_ns.class_("LSM6DSComponent", cg.PollingComponent)
|
LSM6DSComponent = lsm6ds_ns.class_("LSM6DSComponent", cg.PollingComponent)
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ void LSM6DSComponent::setup() {
|
|||||||
ESP_LOGI(TAG, "Detected LSM6DSOX");
|
ESP_LOGI(TAG, "Detected LSM6DSOX");
|
||||||
} else if (who_am_i == 0x6A) {
|
} else if (who_am_i == 0x6A) {
|
||||||
ESP_LOGI(TAG, "Detected LSM6DS3TR-C");
|
ESP_LOGI(TAG, "Detected LSM6DS3TR-C");
|
||||||
|
} else if (who_am_i == 0x69) {
|
||||||
|
ESP_LOGI(TAG, "Detected LSM6DSO32TR");
|
||||||
} else {
|
} else {
|
||||||
this->mark_failed();
|
this->mark_failed();
|
||||||
ESP_LOGE(TAG, "Unknown chip ID: 0x%02X", who_am_i);
|
ESP_LOGE(TAG, "Unknown chip ID: 0x%02X", who_am_i);
|
||||||
@@ -110,7 +112,7 @@ void LSM6DSComponent::update() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void LSM6DSComponent::dump_config() {
|
void LSM6DSComponent::dump_config() {
|
||||||
ESP_LOGCONFIG(TAG, "LSM6DS (LSM6DSOX/LSM6DS3TR-C):");
|
ESP_LOGCONFIG(TAG, "LSM6DS (LSM6DSOX/LSM6DS3TR-C/LSM6DSO32TR):");
|
||||||
LOG_UPDATE_INTERVAL(this);
|
LOG_UPDATE_INTERVAL(this);
|
||||||
if (this->is_failed()) {
|
if (this->is_failed()) {
|
||||||
ESP_LOGCONFIG(TAG, " Connection failed!");
|
ESP_LOGCONFIG(TAG, " Connection failed!");
|
||||||
|
|||||||
Reference in new issue
Block a user