Skip to content

Commit 0f95b6f

Browse files
tristan-googleMaureenHelm
authored andcommitted
sensors: Add Bosch BMA4xx-series driver
This is a driver targetting the Bosch BMA 4-series accelerometers. It has been specifically developed for the BMA422 but should be compatible with others in that line, excepting the BMA400. Supports key attributes and async RTIO one-shot operation. I2C operation is supported, with stubs for a SPI implementation provided for future improvement. Signed-off-by: Tristan Honscheid <[email protected]>
1 parent aeb1e41 commit 0f95b6f

File tree

12 files changed

+1175
-0
lines changed

12 files changed

+1175
-0
lines changed

drivers/sensor/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ add_subdirectory_ifdef(CONFIG_AMS_IAQ_CORE ams_iAQcore)
1818
add_subdirectory_ifdef(CONFIG_APDS9960 apds9960)
1919
add_subdirectory_ifdef(CONFIG_BH1750 bh1750)
2020
add_subdirectory_ifdef(CONFIG_BMA280 bma280)
21+
add_subdirectory_ifdef(CONFIG_BMA4XX bma4xx)
2122
add_subdirectory_ifdef(CONFIG_BMC150_MAGN bmc150_magn)
2223
add_subdirectory_ifdef(CONFIG_BME280 bme280)
2324
add_subdirectory_ifdef(CONFIG_BME680 bme680)

drivers/sensor/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ source "drivers/sensor/ams_iAQcore/Kconfig"
9090
source "drivers/sensor/apds9960/Kconfig"
9191
source "drivers/sensor/bh1750/Kconfig"
9292
source "drivers/sensor/bma280/Kconfig"
93+
source "drivers/sensor/bma4xx/Kconfig"
9394
source "drivers/sensor/bmc150_magn/Kconfig"
9495
source "drivers/sensor/bme280/Kconfig"
9596
source "drivers/sensor/bme680/Kconfig"

drivers/sensor/bma4xx/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
zephyr_library()
4+
5+
zephyr_library_sources(bma4xx.c)
6+
zephyr_library_sources(bma4xx_i2c.c)
7+
zephyr_library_sources(bma4xx_spi.c)

drivers/sensor/bma4xx/Kconfig

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# BMA4XX 3-axis accelerometer config options
2+
#
3+
# Copyright (c) 2023 Google LLC
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
config BMA4XX
8+
bool "BMA4XX 3-axis acceleration sensor"
9+
default y
10+
depends on DT_HAS_BOSCH_BMA4XX_ENABLED
11+
depends on SENSOR_ASYNC_API
12+
select I2C
13+
help
14+
Enable driver for Bosch BMA4XX (I2C-based)
15+
16+
config BMA4XX_TEMPERATURE
17+
bool "Allow reading the BMA4XX die temperature"
18+
default n
19+
depends on BMA4XX
20+
help
21+
Allow reading the BMA4xx's on-chip temperature sensor. This creates
22+
extra bus activity and increases code size.
23+
24+
config EMUL_BMA4XX
25+
bool "Emulator for the BMA4XX"
26+
default y
27+
depends on BMA4XX
28+
depends on EMUL
29+
help
30+
Enable the hardware emulator for the BMA4XX. Doing so allows exercising
31+
sensor APIs for this sensor in native_posix and qemu.

0 commit comments

Comments
 (0)