Skip to content

Commit fcbf0ee

Browse files
drivers: sensor: icm42670: supports icm42670-P/-S
Prepare to use official TDK Invensense Inc. driver for icm42670-P/-S sensor in tdk_hal module. Simplify I2C and SPI transport files. Driver code moves in hal_tdk module. Adds APEX features, such as Pedometer, Tilt detection, Wake on Motion and Significant Motion Detector. Signed-off-by: Aurelie Fontaine <[email protected]>
1 parent 2ea5582 commit fcbf0ee

File tree

11 files changed

+1198
-965
lines changed

11 files changed

+1198
-965
lines changed

drivers/sensor/tdk/icm42670/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
zephyr_library()
44

5-
zephyr_library_sources(
6-
icm42670.c
7-
icm42670_spi.c
8-
icm42670_i2c.c
9-
)
5+
zephyr_library_sources(icm42670.c)
6+
7+
zephyr_library_sources_ifdef(CONFIG_SPI icm42670_spi.c)
8+
zephyr_library_sources_ifdef(CONFIG_I2C icm42670_i2c.c)
109

1110
zephyr_library_sources_ifdef(CONFIG_ICM42670_TRIGGER icm42670_trigger.c)
11+
zephyr_library_sources_ifdef(CONFIG_TDK_APEX icm42670_apex.c)

drivers/sensor/tdk/icm42670/Kconfig

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,33 @@
1-
# ICM42670 Six-Axis Motion Tracking device configuration options
1+
# ICM42670-P ICM42670-S Six-Axis Motion Tracking device configuration options
22
#
3+
# Copyright (c) 2024 TDK Invensense
34
# Copyright (c) 2022 Esco Medical ApS
45
# Copyright (c) 2020 TDK Invensense
56
#
67
# SPDX-License-Identifier: Apache-2.0
8+
config TDK_APEX
9+
bool "TDK APEX features"
710

811
menuconfig ICM42670
9-
bool "ICM42670 Six-Axis Motion Tracking Device"
12+
bool "ICM42670-P/-S Six-Axis Motion Tracking Device"
1013
default y
11-
depends on DT_HAS_INVENSENSE_ICM42670_ENABLED
12-
select SPI if $(dt_compat_on_bus,$(DT_COMPAT_INVENSENSE_ICM42670),spi)
13-
select I2C if $(dt_compat_on_bus,$(DT_COMPAT_INVENSENSE_ICM42670),i2c)
14+
depends on DT_HAS_INVENSENSE_ICM42670P_ENABLED \
15+
|| DT_HAS_INVENSENSE_ICM42670S_ENABLED
16+
depends on ZEPHYR_HAL_TDK_MODULE
17+
select SPI if $(dt_compat_on_bus,$(DT_COMPAT_INVENSENSE_ICM42670P),spi) \
18+
|| $(dt_compat_on_bus,$(DT_COMPAT_INVENSENSE_ICM42670S),spi)
19+
select I2C if $(dt_compat_on_bus,$(DT_COMPAT_INVENSENSE_ICM42670P),i2c) \
20+
|| $(dt_compat_on_bus,$(DT_COMPAT_INVENSENSE_ICM42670S),i2c)
21+
select TDK_APEX if $(dt_node_str_prop_equals,$(dt_nodelabel_path,icm42670p),apex,pedometer) \
22+
|| $(dt_node_str_prop_equals,$(dt_nodelabel_path,icm42670p),apex,tilt) \
23+
|| $(dt_node_str_prop_equals,$(dt_nodelabel_path,icm42670p),apex,smd) \
24+
|| $(dt_node_str_prop_equals,$(dt_nodelabel_path,icm42670p),apex,wom) \
25+
|| $(dt_node_str_prop_equals,$(dt_nodelabel_path,icm42670s),apex,pedometer) \
26+
|| $(dt_node_str_prop_equals,$(dt_nodelabel_path,icm42670s),apex,tilt) \
27+
|| $(dt_node_str_prop_equals,$(dt_nodelabel_path,icm42670s),apex,smd) \
28+
|| $(dt_node_str_prop_equals,$(dt_nodelabel_path,icm42670s),apex,wom)
1429
help
15-
Enable driver for ICM42670 SPI-based six-axis motion tracking device.
30+
Enable driver for ICM42670 SPI-based or I2C-based Six-Axis Motion Tracking device.
1631

1732
if ICM42670
1833

0 commit comments

Comments
 (0)