# ADXL345, 3-Axis, +/-16g Digital Accelerometer

# Copyright (c) 2020 Antmicro <www.antmicro.com>
# SPDX-License-Identifier: Apache-2.0

config ADXL345
	bool "ADXL345 Three Axis accelerometer"
	default y
	depends on DT_HAS_ADI_ADXL345_ENABLED
	select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ADI_ADXL345),i2c)
	select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ADI_ADXL345),spi)
	select RTIO_WORKQ if SENSOR_ASYNC_API
	help
	  Enable driver for ADXL345 Three-Axis Digital Accelerometer.

if ADXL345

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

config ADXL345_TRIGGER_NONE
	bool "No trigger"

config ADXL345_TRIGGER_GLOBAL_THREAD
	bool "Use global thread"
	depends on GPIO
	select ADXL345_TRIGGER

config ADXL345_TRIGGER_OWN_THREAD
	bool "Use own thread"
	depends on GPIO
	select ADXL345_TRIGGER

endchoice

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

config ADXL345_TRIGGER
	bool

config ADXL345_THREAD_PRIORITY
	int "Thread priority"
	depends on ADXL345_TRIGGER_OWN_THREAD && ADXL345_TRIGGER
	default 10
	help
	  Priority of thread used by the driver to handle interrupts.

config ADXL345_THREAD_STACK_SIZE
	int "Thread stack size"
	depends on ADXL345_TRIGGER_OWN_THREAD && ADXL345_TRIGGER
	default 1024
	help
	  Stack size of thread used by the driver to handle interrupts.

endif # ADXL345
