Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: sensor: tsl2540 #59330

Merged
merged 1 commit into from Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions drivers/sensor/CMakeLists.txt
Expand Up @@ -137,6 +137,7 @@ add_subdirectory_ifdef(CONFIG_TMP007 tmp007)
add_subdirectory_ifdef(CONFIG_TMP108 tmp108)
add_subdirectory_ifdef(CONFIG_TMP112 tmp112)
add_subdirectory_ifdef(CONFIG_TMP116 tmp116)
add_subdirectory_ifdef(CONFIG_TSL2540 tsl2540)
add_subdirectory_ifdef(CONFIG_VCMP_IT8XXX2 ite_vcmp_it8xxx2)
add_subdirectory_ifdef(CONFIG_VCNL4040 vcnl4040)
add_subdirectory_ifdef(CONFIG_VEML7700 veml7700)
Expand Down
1 change: 1 addition & 0 deletions drivers/sensor/Kconfig
Expand Up @@ -193,6 +193,7 @@ source "drivers/sensor/tmp007/Kconfig"
source "drivers/sensor/tmp108/Kconfig"
source "drivers/sensor/tmp112/Kconfig"
source "drivers/sensor/tmp116/Kconfig"
source "drivers/sensor/tsl2540/Kconfig"
source "drivers/sensor/vcnl4040/Kconfig"
source "drivers/sensor/veml7700/Kconfig"
source "drivers/sensor/vl53l0x/Kconfig"
Expand Down
6 changes: 6 additions & 0 deletions drivers/sensor/tsl2540/CMakeLists.txt
@@ -0,0 +1,6 @@
# SPDX-License-Identifier: Apache-2.0

zephyr_library()

zephyr_library_sources(tsl2540.c)
zephyr_library_sources_ifdef(CONFIG_TSL2540_TRIGGER tsl2540_trigger.c)
54 changes: 54 additions & 0 deletions drivers/sensor/tsl2540/Kconfig
@@ -0,0 +1,54 @@
# TSL2540 Ambient Light Sensor configuration options

# Copyright (c) 2022 T-Mobile USA, Inc.
# SPDX-License-Identifier: Apache-2.0

menuconfig TSL2540
bool "TSL2540 Ambient Light Sensor"
default y
depends on DT_HAS_AMS_TSL2540_ENABLED
select I2C
help
Enable driver for TSL2540 sensors.

if TSL2540

config TSL2540_TRIGGER
bool

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

config TSL2540_TRIGGER_NONE
bool "No trigger"

config TSL2540_TRIGGER_GLOBAL_THREAD
bool "Use global thread"
depends on GPIO
select TSL2540_TRIGGER

config TSL2540_TRIGGER_OWN_THREAD
bool "Use own thread"
depends on GPIO
select TSL2540_TRIGGER

endchoice

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

config TSL2540_THREAD_STACK_SIZE
int "Thread stack size"
depends on TSL2540_TRIGGER_OWN_THREAD
default 1024
help
Stack size of thread used by the driver to handle interrupts.

endif # TSL2540