forked from zephyrproject-rtos/zephyr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drivers: sensor: Add VCNL4040 driver
Add support for Vishay VCNL4040 proximity and light sensor Signed-off-by: Richard Osterloh <[email protected]>
- Loading branch information
1 parent
2be0086
commit 0a0026a
Showing
10 changed files
with
981 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
zephyr_library() | ||
|
||
zephyr_library_sources_ifdef(CONFIG_VCNL4040 vcnl4040.c) | ||
zephyr_library_sources_ifdef(CONFIG_VCNL4040_TRIGGER vcnl4040_trigger.c) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# VCNL4040 Proximity and Ambient Light Sensor configuration options | ||
|
||
# Copyright (c) 2020 Richard Osterloh | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
menuconfig VCNL4040 | ||
bool "VCNL4040 Proximity and Ambient Light Sensor" | ||
depends on I2C && HAS_DTS_I2C && HAS_DTS_GPIO | ||
help | ||
Enable driver for VCNL4040 sensors. | ||
|
||
if VCNL4040 | ||
|
||
config VCNL4040_ENABLE_ALS | ||
bool "Enable ambient light sensor" | ||
help | ||
Enable Ambient Light Sense (ALS). | ||
|
||
config VCNL4040_TRIGGER | ||
bool | ||
|
||
choice | ||
prompt "Trigger mode" | ||
default VCNL4040_TRIGGER_NONE | ||
help | ||
Specify the type of triggering to be used by the driver. | ||
|
||
config VCNL4040_TRIGGER_NONE | ||
bool "No trigger" | ||
|
||
config VCNL4040_TRIGGER_GLOBAL_THREAD | ||
bool "Use global thread" | ||
depends on GPIO | ||
select VCNL4040_TRIGGER | ||
|
||
config VCNL4040_TRIGGER_OWN_THREAD | ||
bool "Use own thread" | ||
depends on GPIO | ||
select VCNL4040_TRIGGER | ||
|
||
endchoice | ||
|
||
config VCNL4040_THREAD_PRIORITY | ||
int "Thread priority" | ||
depends on VCNL4040_TRIGGER_OWN_THREAD | ||
default 10 | ||
help | ||
Priority of thread used by the driver to handle interrupts. | ||
|
||
config VCNL4040_THREAD_STACK_SIZE | ||
int "Thread stack size" | ||
depends on VCNL4040_TRIGGER_OWN_THREAD | ||
default 1024 | ||
help | ||
Stack size of thread used by the driver to handle interrupts. | ||
|
||
endif # VCNL4040 |
Oops, something went wrong.