Skip to content

Commit 0b0c2e7

Browse files
Mikkel Jakobsenmbolivar-nordic
authored andcommitted
drivers: sensor: add icm42670 6-axis accelerometer driver
the icm42670 from Invensense/TDK is a 6-axis accelerometer with gyroscope and temperature sensing capabilities. this initial driver does not support the devices 2K FIFO or many of the other advanced features. Instead, only basic features are implemented. Signed-off-by: Mikkel Jakobsen <[email protected]>
1 parent 7a431dc commit 0b0c2e7

File tree

12 files changed

+1621
-0
lines changed

12 files changed

+1621
-0
lines changed

drivers/sensor/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ add_subdirectory_ifdef(CONFIG_HP206C hp206c)
3333
add_subdirectory_ifdef(CONFIG_HTS221 hts221)
3434
add_subdirectory_ifdef(CONFIG_I3G4250D i3g4250d)
3535
add_subdirectory_ifdef(CONFIG_ICM42605 icm42605)
36+
add_subdirectory_ifdef(CONFIG_ICM42670 icm42670)
3637
add_subdirectory_ifdef(CONFIG_IIS2DH iis2dh)
3738
add_subdirectory_ifdef(CONFIG_IIS2DLPC iis2dlpc)
3839
add_subdirectory_ifdef(CONFIG_IIS2ICLX iis2iclx)

drivers/sensor/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ source "drivers/sensor/i3g4250d/Kconfig"
104104

105105
source "drivers/sensor/icm42605/Kconfig"
106106

107+
source "drivers/sensor/icm42670/Kconfig"
108+
107109
source "drivers/sensor/iis2dh/Kconfig"
108110

109111
source "drivers/sensor/iis2dlpc/Kconfig"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
zephyr_library()
4+
5+
zephyr_library_sources(
6+
icm42670.c
7+
icm42670_spi.c
8+
)
9+
10+
zephyr_library_sources_ifdef(CONFIG_ICM42670_TRIGGER icm42670_trigger.c)

drivers/sensor/icm42670/Kconfig

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# ICM42670 Six-Axis Motion Tracking device configuration options
2+
#
3+
# Copyright (c) 2022 Esco Medical ApS
4+
# Copyright (c) 2020 TDK Invensense
5+
#
6+
# SPDX-License-Identifier: Apache-2.0
7+
8+
DT_COMPAT_ICM42670 := invensense,icm42670
9+
10+
menuconfig ICM42670
11+
bool "ICM42670 Six-Axis Motion Tracking Device"
12+
default $(dt_compat_enabled,$(DT_COMPAT_ICM42670))
13+
depends on SPI
14+
help
15+
Enable driver for ICM42670 SPI-based six-axis motion tracking device.
16+
17+
if ICM42670
18+
19+
choice ICM42670_TRIGGER_MODE
20+
prompt "Trigger mode"
21+
default ICM42670_TRIGGER_NONE
22+
help
23+
Specify the type of triggering to be used by the driver.
24+
25+
config ICM42670_TRIGGER_NONE
26+
bool "No trigger"
27+
28+
config ICM42670_TRIGGER_GLOBAL_THREAD
29+
bool "Use global thread"
30+
depends on GPIO
31+
select ICM42670_TRIGGER
32+
33+
config ICM42670_TRIGGER_OWN_THREAD
34+
bool "Use own thread"
35+
depends on GPIO
36+
select ICM42670_TRIGGER
37+
38+
endchoice
39+
40+
config ICM42670_TRIGGER
41+
bool
42+
43+
config ICM42670_THREAD_PRIORITY
44+
int "Thread priority"
45+
depends on ICM42670_TRIGGER_OWN_THREAD
46+
default 10
47+
help
48+
Priority of thread used by the driver to handle interrupts.
49+
50+
config ICM42670_THREAD_STACK_SIZE
51+
int "Thread stack size"
52+
depends on ICM42670_TRIGGER_OWN_THREAD
53+
default 1024
54+
help
55+
Stack size of thread used by the driver to handle interrupts.
56+
57+
endif # ICM42670

0 commit comments

Comments
 (0)