1# ICM42670-P ICM42670-S Six-Axis Motion Tracking device configuration options
2#
3# Copyright (c) 2024 TDK Invensense
4# Copyright (c) 2022 Esco Medical ApS
5# Copyright (c) 2020 TDK Invensense
6#
7# SPDX-License-Identifier: Apache-2.0
8config TDK_APEX
9	bool "TDK APEX features"
10
11menuconfig ICM42670
12	bool "ICM42670-P/-S Six-Axis Motion Tracking Device"
13	default y
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)
29	help
30	  Enable driver for ICM42670 SPI-based or I2C-based Six-Axis Motion Tracking device.
31
32if ICM42670
33
34choice ICM42670_TRIGGER_MODE
35	prompt "Trigger mode"
36	default ICM42670_TRIGGER_NONE
37	help
38	  Specify the type of triggering to be used by the driver.
39
40config ICM42670_TRIGGER_NONE
41	bool "No trigger"
42
43config ICM42670_TRIGGER_GLOBAL_THREAD
44	bool "Use global thread"
45	depends on GPIO
46	depends on $(dt_compat_any_has_prop,$(DT_COMPAT_INVENSENSE_ICM42670P),int-gpios) \
47		|| $(dt_compat_any_has_prop,$(DT_COMPAT_INVENSENSE_ICM42670S),int-gpios)
48	select ICM42670_TRIGGER
49
50config ICM42670_TRIGGER_OWN_THREAD
51	bool "Use own thread"
52	depends on GPIO
53	depends on $(dt_compat_any_has_prop,$(DT_COMPAT_INVENSENSE_ICM42670P),int-gpios) \
54		|| $(dt_compat_any_has_prop,$(DT_COMPAT_INVENSENSE_ICM42670S),int-gpios)
55	select ICM42670_TRIGGER
56
57endchoice
58
59config ICM42670_TRIGGER
60	bool
61
62config ICM42670_THREAD_PRIORITY
63	int "Thread priority"
64	depends on ICM42670_TRIGGER_OWN_THREAD
65	default 10
66	help
67	  Priority of thread used by the driver to handle interrupts.
68
69config ICM42670_THREAD_STACK_SIZE
70	int "Thread stack size"
71	depends on ICM42670_TRIGGER_OWN_THREAD
72	default 1024
73	help
74	  Stack size of thread used by the driver to handle interrupts.
75
76endif # ICM42670
77