Skip to content

Commit

Permalink
drivers: sensor: lis2dux12: Add lis2dux12 driver
Browse files Browse the repository at this point in the history
Adds support for the STMicroelectronics LIS2DUX12 3-axis accelerometer.

Signed-off-by: Kyle Dunn <[email protected]>
  • Loading branch information
kdunn926 committed Nov 16, 2023
1 parent ad3b3a9 commit e243de1
Show file tree
Hide file tree
Showing 16 changed files with 847 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/sensor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ add_subdirectory_ifdef(CONFIG_ITDS wsen_itds)
add_subdirectory_ifdef(CONFIG_LIS2DH lis2dh)
add_subdirectory_ifdef(CONFIG_LIS2DS12 lis2ds12)
add_subdirectory_ifdef(CONFIG_LIS2DW12 lis2dw12)
add_subdirectory_ifdef(CONFIG_LIS2DUX12 lis2dux12)
add_subdirectory_ifdef(CONFIG_LIS2MDL lis2mdl)
add_subdirectory_ifdef(CONFIG_LIS3MDL lis3mdl)
add_subdirectory_ifdef(CONFIG_LM75 lm75)
Expand Down
1 change: 1 addition & 0 deletions drivers/sensor/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ source "drivers/sensor/ite_vcmp_it8xxx2/Kconfig"
source "drivers/sensor/lis2dh/Kconfig"
source "drivers/sensor/lis2ds12/Kconfig"
source "drivers/sensor/lis2dw12/Kconfig"
source "drivers/sensor/lis2dux12/Kconfig"
source "drivers/sensor/lis2mdl/Kconfig"
source "drivers/sensor/lis3mdl/Kconfig"
source "drivers/sensor/lm75/Kconfig"
Expand Down
9 changes: 9 additions & 0 deletions drivers/sensor/lis2dux12/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# SPDX-License-Identifier: Apache-2.0

zephyr_library()

zephyr_library_sources(lis2dux12.c)
zephyr_library_sources_ifdef(CONFIG_LIS2DUX12_TRIGGER lis2dux12_trigger.c)

zephyr_library_include_directories(../stmemsc)
zephyr_library_include_directories(../../../../modules/hal/st/sensor/stmemsc/lis2dux12_STdC/driver)
61 changes: 61 additions & 0 deletions drivers/sensor/lis2dux12/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# ST Microelectronics LIS2DUX12 3-axis accelerometer driver

# Copyright (c) 2019 STMicroelectronics
# SPDX-License-Identifier: Apache-2.0

menuconfig LIS2DUX12
bool "LIS2DUX12 I2C/SPI accelerometer sensor driver"
default y
depends on DT_HAS_ST_LIS2DUX12_ENABLED
select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ST_LIS2DUX12),i2c)
select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ST_LIS2DUX12),spi)
select HAS_STMEMSC
select USE_STDC_LIS2DUX12
help
Enable driver for LIS2DUX12 accelerometer sensor driver

if LIS2DUX12

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

config LIS2DUX12_TRIGGER_NONE
bool "No trigger"

config LIS2DUX12_TRIGGER_GLOBAL_THREAD
bool "Use global thread"
depends on GPIO
select LIS2DUX12_TRIGGER

config LIS2DUX12_TRIGGER_OWN_THREAD
bool "Use own thread"
depends on GPIO
select LIS2DUX12_TRIGGER

endchoice

config LIS2DUX12_TRIGGER
bool

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

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

config LIS2DUX12_ENABLE_TEMP
bool "Temperature"
help
Enable/disable temperature

endif # LIS2DUX12
Loading

0 comments on commit e243de1

Please sign in to comment.