Skip to content

Commit d3cae7e

Browse files
miggazElquezdanieldegrasse
authored andcommitted
drivers: sensors: add driver for the magnetometer in lsm9ds1
This driver supports the magnetometer in the ST lsm9ds1 sensor, on the I2C bus. This driver does not support the triggers. This driver use the stmemsc HAL. link: https://www.st.com/resource/en/datasheet/lsm9ds1.pdf Signed-off-by: Miguel Gazquez <miguel.gazquez@bootlin.com>
1 parent 8362e60 commit d3cae7e

File tree

7 files changed

+481
-0
lines changed

7 files changed

+481
-0
lines changed

drivers/sensor/st/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ add_subdirectory_ifdef(CONFIG_LSM6DSV16X lsm6dsv16x)
3333
add_subdirectory_ifdef(CONFIG_LSM9DS0_GYRO lsm9ds0_gyro)
3434
add_subdirectory_ifdef(CONFIG_LSM9DS0_MFD lsm9ds0_mfd)
3535
add_subdirectory_ifdef(CONFIG_LSM9DS1 lsm9ds1)
36+
add_subdirectory_ifdef(CONFIG_LSM9DS1_MAG lsm9ds1_mag)
3637
add_subdirectory_ifdef(CONFIG_QDEC_STM32 qdec_stm32)
3738
add_subdirectory_ifdef(CONFIG_STM32_DIGI_TEMP stm32_digi_temp)
3839
add_subdirectory_ifdef(CONFIG_STM32_TEMP stm32_temp)

drivers/sensor/st/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ source "drivers/sensor/st/lsm6dsv16x/Kconfig"
3232
source "drivers/sensor/st/lsm9ds0_gyro/Kconfig"
3333
source "drivers/sensor/st/lsm9ds0_mfd/Kconfig"
3434
source "drivers/sensor/st/lsm9ds1/Kconfig"
35+
source "drivers/sensor/st/lsm9ds1_mag/Kconfig"
3536
source "drivers/sensor/st/qdec_stm32/Kconfig"
3637
source "drivers/sensor/st/stm32_digi_temp/Kconfig"
3738
source "drivers/sensor/st/stm32_temp/Kconfig"
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(lsm9ds1_mag.c)
6+
7+
zephyr_library_include_directories(../stmemsc)

drivers/sensor/st/lsm9ds1_mag/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) 2024 Bootlin
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config LSM9DS1_MAG
5+
bool "LSM9DS1 I2C magnetometer chip"
6+
default y
7+
depends on DT_HAS_ST_LSM9DS1_MAG_ENABLED
8+
select I2C
9+
select HAS_STMEMSC
10+
select USE_STDC_LSM9DS1

0 commit comments

Comments
 (0)