# MAX30101 heart rate sensor
#
# Copyright (c) 2017, NXP
# Copyright (c) 2025, CATIE
#
# SPDX-License-Identifier: Apache-2.0

menuconfig MAX30101
	bool "MAX30101 Pulse Oximeter and Heart Rate Sensor"
	default y
	depends on DT_HAS_MAXIM_MAX30101_ENABLED
	select I2C if $(dt_compat_on_bus,$(DT_COMPAT_MAXIM_MAX30101),i2c)

if MAX30101

config MAX30101_DIE_TEMPERATURE
	bool "Die temperature acquisition"

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

config MAX30101_TRIGGER_NONE
	bool "No trigger"

config MAX30101_TRIGGER_GLOBAL_THREAD
	bool "Use global thread"
	depends on GPIO
	depends on $(dt_compat_any_has_prop,$(DT_COMPAT_MAXIM_MAX30101),irq-gpios)
	select MAX30101_TRIGGER

config MAX30101_TRIGGER_OWN_THREAD
	bool "Use own thread"
	depends on GPIO
	depends on $(dt_compat_any_has_prop,$(DT_COMPAT_MAXIM_MAX30101),irq-gpios)
	select MAX30101_TRIGGER

endchoice

config MAX30101_TRIGGER
	bool

if MAX30101_TRIGGER

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

config MAX30101_THREAD_SIZE
	int "Thread stack size"
	depends on MAX30101_TRIGGER_OWN_THREAD
	default 2048
	help
	  Stack size of thread used by the driver to handle interrupts.

endif # MAX30101_TRIGGER

endif # MAX30101
