-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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 ScioSense ENS160 driver
Add driver for ScioSense ENS160 multi-gas sensor. The driver includes support for I2C and SPI, attributes for setting temperature and humidity compensation and data ready trigger. Also add ScioSense to the list of vendor prefixes. Signed-off-by: Gustavo Silva <gustavograzs@gmail.com>
- Loading branch information
Showing
19 changed files
with
997 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,8 @@ | ||
# Copyright (c) 2024 Gustavo Silva | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
zephyr_library() | ||
zephyr_library_sources(ens160.c) | ||
zephyr_library_sources(ens160_i2c.c) | ||
zephyr_library_sources(ens160_spi.c) | ||
zephyr_library_sources_ifdef(CONFIG_ENS160_TRIGGER ens160_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,53 @@ | ||
# Copyright (c) 2024 Gustavo Silva | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
menuconfig ENS160 | ||
bool "ENS160 multi-gas sensor" | ||
default y | ||
depends on DT_HAS_SCIOSENSE_ENS160_ENABLED | ||
select I2C if $(dt_compat_on_bus,$(DT_COMPAT_SCIOSENSE_ENS160),i2c) | ||
select SPI if $(dt_compat_on_bus,$(DT_COMPAT_SCIOSENSE_ENS160),spi) | ||
help | ||
Enable driver for ENS160 Digital Metal Oxide Multi-Gas Sensor. | ||
|
||
if ENS160 | ||
|
||
choice | ||
prompt "Trigger Mode" | ||
default ENS160_TRIGGER_NONE | ||
help | ||
Specify the type of triggering to be used by the driver. | ||
|
||
config ENS160_TRIGGER_NONE | ||
bool "No trigger" | ||
|
||
config ENS160_TRIGGER_GLOBAL_THREAD | ||
bool "Use global thread" | ||
depends on GPIO | ||
select ENS160_TRIGGER | ||
|
||
config ENS160_TRIGGER_OWN_THREAD | ||
bool "Use own thread" | ||
depends on GPIO | ||
select ENS160_TRIGGER | ||
|
||
endchoice # Trigger Mode | ||
|
||
config ENS160_TRIGGER | ||
bool | ||
|
||
config ENS160_THREAD_PRIORITY | ||
int "Thread priority" | ||
depends on ENS160_TRIGGER_OWN_THREAD && ENS160_TRIGGER | ||
default 10 | ||
help | ||
Priority of thread used by the driver to handle interrupts. | ||
|
||
config ENS160_THREAD_STACK_SIZE | ||
int "Thread stack size" | ||
depends on ENS160_TRIGGER_OWN_THREAD && ENS160_TRIGGER | ||
default 1024 | ||
help | ||
Stack size of thread used by the driver to handle interrupts. | ||
|
||
endif # ENS160 |
Oops, something went wrong.