Skip to content

Commit

Permalink
drivers: sensor: tsl2540
Browse files Browse the repository at this point in the history
Add the tsl2540 sensor to drivers.

Signed-off-by: Rick Talbott <richard.talbott1@t-mobile.com>

updated

Signed-off-by: RIck Talbott <richard.talbott1@t-mobile.com>
  • Loading branch information
rtalbott-tmo committed Jun 27, 2023
1 parent 14573fc commit 4bdbd6f
Show file tree
Hide file tree
Showing 14 changed files with 837 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/sensor/CMakeLists.txt
Expand Up @@ -132,6 +132,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 @@ -188,6 +188,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

0 comments on commit 4bdbd6f

Please sign in to comment.