#ADXL355 Three-Axis Digital Accelerometer

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

config ADXL355
	bool "ADXL355 Three-Axis Digital Accelerometer"
	default y
	depends on DT_HAS_ADI_ADXL355_ENABLED
	select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ADI_ADXL355),i2c)
	select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ADI_ADXL355),spi)
	select RTIO_WORKQ if SENSOR_ASYNC_API
	help
	  Enable driver for ADXL355 Three-Axis Digital Accelerometers.

if ADXL355

choice ADXL355_OP_MODE
	prompt "Operating mode"
	default ADXL355_MEASUREMENT_MODE

config ADXL355_MEASUREMENT_MODE
	bool "Measurement Mode"
	help
	  In this mode, acceleration data is provided continuously at the
	  output data rate (ODR).

endchoice

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

config ADXL355_TRIGGER_NONE
	bool "No trigger"

config ADXL355_TRIGGER_GLOBAL_THREAD
	bool "Use global thread"
	depends on GPIO
	select ADXL355_TRIGGER

config ADXL355_TRIGGER_OWN_THREAD
	bool "Use own thread"
	depends on GPIO
	select ADXL355_TRIGGER

endchoice

config ADXL355_TRIGGER
	bool

config ADXL355_THREAD_PRIORITY
	int "Thread priority"
	depends on ADXL355_TRIGGER_OWN_THREAD && ADXL355_TRIGGER
	default 10
	help
	  Priority of thread used by the driver to handle interrupts.
config ADXL355_THREAD_STACK_SIZE
	int "Thread stack size"
	depends on ADXL355_TRIGGER_OWN_THREAD && ADXL355_TRIGGER
	default 1024
	help
	  Stack size of thread used by the driver to handle interrupts.

config ADXL355_INIT_PRIORITY
	int "Init priority"
	default SENSOR_INIT_PRIORITY
	help
	  Device initialization priority for ADXL355.

	  Lower values initialize earlier during boot. Higher values defer
	  initialization until later in the boot sequence.

	  Defaults to CONFIG_SENSOR_INIT_PRIORITY. Increase this value
	  (e.g., to 90) to defer initialization when self-test is enabled,
	  avoiding delays to critical boot tasks.

config ADXL355_STREAM
	bool "Use FIFO to stream data"
	select ADXL355_TRIGGER
	depends on (SPI_RTIO || I2C_RTIO)
	depends on SENSOR_ASYNC_API
	help
	  Use this configuration option to enable streaming sensor data via RTIO.

endif # ADXL355
