Skip to content

Commit

Permalink
drivers: sensors: bmi270: Add CRT feature module
Browse files Browse the repository at this point in the history
Fixes: #62514
Adds support for the bmi270 feature:
Creates a specific kconfig for the feature.
Adds a method to run the crt process.
Adds a method to program the bmi270 nvm.
Adds a method to enable/disable gain compensation.

Signed-off-by: Pedro Machado <[email protected]>
  • Loading branch information
peter-axe committed Sep 24, 2023
1 parent f8f97a3 commit bd1d683
Show file tree
Hide file tree
Showing 4 changed files with 755 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/sensor/bmi270/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ zephyr_library_sources(bmi270.c)
zephyr_library_sources_ifdef(CONFIG_BMI270_BUS_I2C bmi270_i2c.c)
zephyr_library_sources_ifdef(CONFIG_BMI270_BUS_SPI bmi270_spi.c)
zephyr_library_sources_ifdef(CONFIG_BMI270_TRIGGER bmi270_trigger.c)
zephyr_library_sources_ifdef(CONFIG_BMI270_CRT bmi270_crt.c)
6 changes: 6 additions & 0 deletions drivers/sensor/bmi270/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,10 @@ config BMI270_THREAD_STACK_SIZE
help
Stack size of thread used by the driver to handle interrupts.

config BMI270_CRT
bool "CRT feature support for bmi270"
default n
help
Gyro CRT calibration feature support for bmi270

endif # BMI270
5 changes: 5 additions & 0 deletions drivers/sensor/bmi270/bmi270.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,11 @@ static const struct bmi270_feature_config bmi270_feature_base = {
.config_file_len = sizeof(bmi270_config_file_base),
.anymo_1 = &(struct bmi270_feature_reg){ .page = 1, .addr = 0x3C },
.anymo_2 = &(struct bmi270_feature_reg){ .page = 1, .addr = 0x3E },
#if defined(CONFIG_BMI270_CRT)
.g_trig_1 = &(struct bmi270_feature_reg){.page = 1, .addr = 0x32},
.gyr_gain_status = &(struct bmi270_feature_reg){.page = 0, .addr = 0x38},
.gen_set_1 = &(struct bmi270_feature_reg){.page = 1, .addr = 0x34},
#endif
};

#define BMI270_FEATURE(inst) ( \
Expand Down
Loading

0 comments on commit bd1d683

Please sign in to comment.