# MAX30009 Bio-Impedance AFE

# Copyright (c) 2026 Analog Devices, Inc.
# SPDX-License-Identifier: Apache-2.0

config MAX30009
	bool "MAX30009 Bio-Impedance AFE"
	default y
	depends on DT_HAS_ADI_MAX30009_ENABLED
	select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ADI_MAX30009),i2c)
	select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ADI_MAX30009),spi)
	select RTIO_WORKQ if SENSOR_ASYNC_API
	help
	  Enable driver for MAX30009 Bio-Impedance AFE.

if MAX30009

choice MAX30009_TRIGGER_MODE
	prompt "Trigger mode"
	default MAX30009_TRIGGER_NONE
	help
	  Specify the type of triggering used by the driver.

config MAX30009_TRIGGER_NONE
	bool "No trigger"

config MAX30009_TRIGGER_GLOBAL_THREAD
	bool "Use global thread"
	select GPIO
	select MAX30009_TRIGGER

config MAX30009_TRIGGER_OWN_THREAD
	bool "Use own thread"
	select GPIO
	select MAX30009_TRIGGER
endchoice

config MAX30009_TRIGGER
	bool

config MAX30009_THREAD_PRIORITY
	int "Thread priority"
	depends on MAX30009_TRIGGER_OWN_THREAD && MAX30009_TRIGGER
	default 10
	help
	  Priority of thread used by the driver to handle interrupts.

config MAX30009_THREAD_STACK_SIZE
	int "Thread stack size"
	depends on MAX30009_TRIGGER_OWN_THREAD && MAX30009_TRIGGER
	default 4096
	help
	  Stack size of thread used by the driver to handle interrupts.

config MAX30009_INIT_PRIORITY
	int "Initialization priority"
	default SENSOR_INIT_PRIORITY
	help
	  Initialization priority of the MAX30009 driver. Should be lower than the priority of any
	  thread that needs to use the driver.

config MAX30009_STREAM
	bool "Use streaming mode"
	select MAX30009_TRIGGER
	select SPI_RTIO if $(dt_compat_on_bus,$(DT_COMPAT_ADI_MAX30009),spi)
	select I2C_RTIO if $(dt_compat_on_bus,$(DT_COMPAT_ADI_MAX30009),i2c)
	select SENSOR_ASYNC_API
	help
	  Use this configuration option to enable streaming sensor data via RTIO.

endif # MAX30009
