Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions drivers/sensor/st/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ add_subdirectory_ifdef(CONFIG_LSM6DS0 lsm6ds0)
add_subdirectory_ifdef(CONFIG_LSM6DSL lsm6dsl)
add_subdirectory_ifdef(CONFIG_LSM6DSO lsm6dso)
add_subdirectory_ifdef(CONFIG_LSM6DSO16IS lsm6dso16is)
add_subdirectory_ifdef(CONFIG_LSM6DSR lsm6dsr)
add_subdirectory_ifdef(CONFIG_LSM6DSV16X lsm6dsv16x)
add_subdirectory_ifdef(CONFIG_LSM9DS0_GYRO lsm9ds0_gyro)
add_subdirectory_ifdef(CONFIG_LSM9DS0_MFD lsm9ds0_mfd)
Expand Down
1 change: 1 addition & 0 deletions drivers/sensor/st/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ source "drivers/sensor/st/lsm6ds0/Kconfig"
source "drivers/sensor/st/lsm6dsl/Kconfig"
source "drivers/sensor/st/lsm6dso/Kconfig"
source "drivers/sensor/st/lsm6dso16is/Kconfig"
source "drivers/sensor/st/lsm6dsr/Kconfig"
source "drivers/sensor/st/lsm6dsv16x/Kconfig"
source "drivers/sensor/st/lsm9ds0_gyro/Kconfig"
source "drivers/sensor/st/lsm9ds0_mfd/Kconfig"
Expand Down
8 changes: 8 additions & 0 deletions drivers/sensor/st/lsm6dsr/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# SPDX-License-Identifier: Apache-2.0

zephyr_library()

zephyr_library_sources(lsm6dsr.c)
zephyr_library_sources(lsm6dsr_spi.c)
zephyr_library_sources(lsm6dsr_i2c.c)
zephyr_library_sources_ifdef(CONFIG_LSM6DSR_TRIGGER lsm6dsr_trigger.c)
129 changes: 129 additions & 0 deletions drivers/sensor/st/lsm6dsr/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# LSM6DSR accelerometer and gyroscope sensor configuration
# options

# Copyright (c) 2025 Helbling Technik AG
# SPDX-License-Identifier: Apache-2.0

menuconfig LSM6DSR
bool "LSM6DSR I2C/SPI accelerometer and gyroscope Chip"
default y
depends on DT_HAS_ST_LSM6DSR_ENABLED
select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ST_LSM6DSR),i2c)
select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ST_LSM6DSR),spi)
help
Enable driver for LSM6DSR accelerometer and gyroscope
sensor.

if LSM6DSR

choice LSM6DSR_TRIGGER_MODE
prompt "Trigger mode"
help
Specify the type of triggering to be used by the driver.

config LSM6DSR_TRIGGER_NONE
bool "No trigger"

config LSM6DSR_TRIGGER_GLOBAL_THREAD
bool "Use global thread"
depends on GPIO
depends on $(dt_compat_any_has_prop,$(DT_COMPAT_ST_LSM6DSR),irq-gpios)
select LSM6DSR_TRIGGER

config LSM6DSR_TRIGGER_OWN_THREAD
bool "Use own thread"
depends on GPIO
depends on $(dt_compat_any_has_prop,$(DT_COMPAT_ST_LSM6DSR),irq-gpios)
select LSM6DSR_TRIGGER

endchoice

config LSM6DSR_TRIGGER
bool

config LSM6DSR_THREAD_PRIORITY
int "Thread priority"
depends on LSM6DSR_TRIGGER_OWN_THREAD
default 10
help
Priority of thread used by the driver to handle interrupts.

config LSM6DSR_THREAD_STACK_SIZE
int "Thread stack size"
depends on LSM6DSR_TRIGGER_OWN_THREAD
default 1024
help
Stack size of thread used by the driver to handle interrupts.


menu "Attributes"

config LSM6DSR_GYRO_FS
int "Gyroscope full-scale range"
default 0
help
Specify the default gyroscope full-scale range.
An X value for the config represents a range of +/- X degree per
second. Valid values are:
0: Full Scale selected at runtime
125: +/- 125dps
250: +/- 250dps
500: +/- 500dps
1000: +/- 1000dps
2000: +/- 2000dps
4000: +/- 4000dps

config LSM6DSR_GYRO_ODR
int "Gyroscope Output data rate frequency"
range 0 10
default 0
help
Specify the default accelerometer output data rate expressed in
samples per second (Hz).
0: ODR selected at runtime
1: 12.5Hz
2: 26Hz
3: 52Hz
4: 104Hz
5: 208Hz
6: 416Hz
7: 833Hz
8: 1660Hz
9: 3330Hz
10: 6660Hz

config LSM6DSR_ACCEL_FS
int "Accelerometer full-scale range"
default 0
help
Specify the default accelerometer full-scale range.
An X value for the config represents a range of +/- X G. Valid values
are:
0: Full Scale selected at runtime
2: +/- 2g
4: +/- 4g
8: +/- 8g
16: +/- 16g

config LSM6DSR_ACCEL_ODR
int "Accelerometer Output data rate frequency"
range 0 11
default 0
help
Specify the default accelerometer output data rate expressed in
samples per second (Hz).
0: ODR selected at runtime
1: 12.5Hz
2: 26Hz
3: 52Hz
4: 104Hz
5: 208Hz
6: 416Hz
7: 833Hz
8: 1666Hz
9: 3332Hz
10: 6664Hz
11: 1.6Hz
endmenu

endif # LSM6DSR
Loading