Skip to content

Commit 6cbb84c

Browse files
dchat-nordiccarlescufi
authored andcommitted
sensor: dts: Add SPI capability to bmi270 driver
Added SPI bus support for BMI270 gyroscope driver. Signed-off-by: Dominik Chat <[email protected]>
1 parent f0a85f6 commit 6cbb84c

File tree

9 files changed

+335
-71
lines changed

9 files changed

+335
-71
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#
22
# Copyright (c) 2021 Bosch Sensortec GmbH
3+
# Copyright (c) 2022 Nordic Semiconductor ASA
34
#
45
# SPDX-License-Identifier: Apache-2.0
56
#
67

78
zephyr_library()
89

910
zephyr_library_sources(bmi270.c)
11+
zephyr_library_sources_ifdef(CONFIG_BMI270_BUS_I2C bmi270_i2c.c)
12+
zephyr_library_sources_ifdef(CONFIG_BMI270_BUS_SPI bmi270_spi.c)

drivers/sensor/bmi270/Kconfig

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
11
# BMI270 6 Axis IMU configuration
22

33
# Copyright (c) 2021 Bosch Sensortec GmbH
4+
# Copyright (c) 2022 Nordic Semiconductor ASA
45
# SPDX-License-Identifier: Apache-2.0
56

6-
config BMI270
7+
menuconfig BMI270
78
bool "BMI270 Inertial measurement unit"
89
default y
910
depends on DT_HAS_BOSCH_BMI270_ENABLED
10-
select I2C
11+
select I2C if $(dt_compat_on_bus,$(DT_COMPAT_BOSCH_BMI270),i2c)
12+
select SPI if $(dt_compat_on_bus,$(DT_COMPAT_BOSCH_BMI270),spi)
1113
help
1214
Enable driver for BMI270 I2C-based imu sensor
15+
16+
if BMI270
17+
18+
config BMI270_BUS_I2C
19+
bool
20+
default y
21+
depends on $(dt_compat_on_bus,$(DT_COMPAT_BOSCH_BMI270),i2c)
22+
23+
config BMI270_BUS_SPI
24+
bool
25+
default y
26+
depends on $(dt_compat_on_bus,$(DT_COMPAT_BOSCH_BMI270),spi)
27+
28+
endif # BMI270

0 commit comments

Comments
 (0)