Skip to content

Commit

Permalink
sensors: Add Bosch BMA4xx-series driver
Browse files Browse the repository at this point in the history
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 <honscheid@google.com>
  • Loading branch information
tristan-google committed Dec 20, 2023
1 parent 3c2a896 commit 674da2c
Show file tree
Hide file tree
Showing 12 changed files with 1,171 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/sensor/CMakeLists.txt
Expand Up @@ -18,6 +18,7 @@ add_subdirectory_ifdef(CONFIG_AMS_IAQ_CORE ams_iAQcore)
add_subdirectory_ifdef(CONFIG_APDS9960 apds9960)
add_subdirectory_ifdef(CONFIG_BH1750 bh1750)
add_subdirectory_ifdef(CONFIG_BMA280 bma280)
add_subdirectory_ifdef(CONFIG_BMA4XX bma4xx)
add_subdirectory_ifdef(CONFIG_BMC150_MAGN bmc150_magn)
add_subdirectory_ifdef(CONFIG_BME280 bme280)
add_subdirectory_ifdef(CONFIG_BME680 bme680)
Expand Down
1 change: 1 addition & 0 deletions drivers/sensor/Kconfig
Expand Up @@ -90,6 +90,7 @@ source "drivers/sensor/ams_iAQcore/Kconfig"
source "drivers/sensor/apds9960/Kconfig"
source "drivers/sensor/bh1750/Kconfig"
source "drivers/sensor/bma280/Kconfig"
source "drivers/sensor/bma4xx/Kconfig"
source "drivers/sensor/bmc150_magn/Kconfig"
source "drivers/sensor/bme280/Kconfig"
source "drivers/sensor/bme680/Kconfig"
Expand Down
7 changes: 7 additions & 0 deletions drivers/sensor/bma4xx/CMakeLists.txt
@@ -0,0 +1,7 @@
# SPDX-License-Identifier: Apache-2.0

zephyr_library()

zephyr_library_sources(bma4xx.c)
zephyr_library_sources(bma4xx_i2c.c)
zephyr_library_sources(bma4xx_spi.c)
31 changes: 31 additions & 0 deletions drivers/sensor/bma4xx/Kconfig
@@ -0,0 +1,31 @@
# BMA422 3-axis accelerometer config options
#
# Copyright (c) 2023 Google LLC
#
# SPDX-License-Identifier: Apache-2.0

config BMA4XX
bool "BMA4XX 3-axis acceleration sensor"
default y
depends on DT_HAS_BOSCH_BMA4XX_ENABLED
depends on SENSOR_ASYNC_API
select I2C
help
Enable driver for Bosch BMA4XX (I2C-based)

config BMA4XX_TEMPERATURE
bool "Allow reading the BMA4XX die temperature"
default n
depends on BMA4XX
help
Allow reading the BMA4xx's on-chip temperature sensor. This creates
extra bus activity and increases code size.

config EMUL_BMA4XX
bool "Emulator for the BMA4XX"
default y
depends on BMA4XX
depends on EMUL
help
Enable the hardware emulator for the BMA4XX. Doing so allows exercising
sensor APIs for this sensor in native_posix and qemu.

0 comments on commit 674da2c

Please sign in to comment.