Skip to content

Commit

Permalink
drivers: sensor: Add icm40627 6-axis accelerometer driver
Browse files Browse the repository at this point in the history
Initial driver for the icm40627 from Invensense/TDK, a 6-axis
accelerometer with gyroscope and temperature sensing capabilities.

Signed-off-by: Florijan Plohl <florijan.plohl@norik.com>
  • Loading branch information
FPlohl committed Feb 13, 2025
1 parent c387fca commit fcf3dbe
Show file tree
Hide file tree
Showing 12 changed files with 1,487 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/sensor/tdk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# SPDX-License-Identifier: Apache-2.0

# zephyr-keep-sorted-start
add_subdirectory_ifdef(CONFIG_ICM40627 icm40627)
add_subdirectory_ifdef(CONFIG_ICM42605 icm42605)
add_subdirectory_ifdef(CONFIG_ICM42688 icm42688)
add_subdirectory_ifdef(CONFIG_ICM42X70 icm42x70)
Expand Down
1 change: 1 addition & 0 deletions drivers/sensor/tdk/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# SPDX-License-Identifier: Apache-2.0

# zephyr-keep-sorted-start
source "drivers/sensor/tdk/icm40627/Kconfig"
source "drivers/sensor/tdk/icm42605/Kconfig"
source "drivers/sensor/tdk/icm42688/Kconfig"
source "drivers/sensor/tdk/icm42x70/Kconfig"
Expand Down
10 changes: 10 additions & 0 deletions drivers/sensor/tdk/icm40627/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# SPDX-License-Identifier: Apache-2.0

zephyr_library()

zephyr_library_sources(
icm40627.c
icm40627_i2c.c
)

zephyr_library_sources_ifdef(CONFIG_ICM40627_TRIGGER icm40627_trigger.c)
58 changes: 58 additions & 0 deletions drivers/sensor/tdk/icm40627/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# ICM40627 Six-Axis Motion Tracking device configuration options
#
# Copyright 2024 PHYTEC America, LLC
#
# SPDX-License-Identifier: Apache-2.0

menuconfig ICM40627
bool "ICM40627 Six-Axis Motion Tracking Device"
default y
depends on DT_HAS_INVENSENSE_ICM40627_ENABLED
select SPI if $(dt_compat_on_bus,$(DT_COMPAT_INVENSENSE_ICM40627),spi)
select I2C if $(dt_compat_on_bus,$(DT_COMPAT_INVENSENSE_ICM40627),i2c)
help
Enable driver for ICM40627 SPI-based six-axis motion tracking device.

if ICM40627

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

config ICM40627_TRIGGER_NONE
bool "No trigger"

config ICM40627_TRIGGER_GLOBAL_THREAD
bool "Use global thread"
depends on GPIO
depends on $(dt_compat_any_has_prop,$(DT_COMPAT_INVENSENSE_ICM40627),int-gpios)
select ICM40627_TRIGGER

config ICM40627_TRIGGER_OWN_THREAD
bool "Use own thread"
depends on GPIO
depends on $(dt_compat_any_has_prop,$(DT_COMPAT_INVENSENSE_ICM40627),int-gpios)
select ICM40627_TRIGGER

endchoice

config ICM40627_TRIGGER
bool

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

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

endif # ICM40627
Loading

0 comments on commit fcf3dbe

Please sign in to comment.