Setup structure for scd30 driver

This commit is contained in:
Artemis Tosini 2023-11-22 21:31:59 +00:00
parent 2caa6d6baa
commit 6ea2ead13e
Signed by: artemist
GPG key ID: ADFFE553DCBB831E
12 changed files with 36 additions and 0 deletions

View file

@ -6,5 +6,6 @@ set(BOARD minico2)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
add_subdirectory(drivers)
project(minico2)
target_sources(app PRIVATE src/main.c)

2
Kconfig Normal file
View file

@ -0,0 +1,2 @@
source "Kconfig.zephyr"
rsource "drivers/Kconfig"

View file

@ -45,6 +45,15 @@
scl-gpios = <&gpio0 33 GPIO_OPEN_DRAIN>;
pinctrl-0 = <&i2c0_default>;
pinctrl-names = "default";
#address-cells = <1>;
#size-cells = <0>;
scd30: scd30@61 {
status = "okay";
compatible = "sensirion,scd30";
reg = <0x61>;
};
};
&spi2 {
@ -56,6 +65,7 @@
#size-cells = <0>;
epd: sd16xxfb@0 {
status = "okay";
compatible = "gooddisplay,gdey0213b74", "solomon,ssd1680";
spi-max-frequency = <4000000>;
reg = <0>;

1
drivers/CMakeLists.txt Normal file
View file

@ -0,0 +1 @@
add_subdirectory_ifdef(CONFIG_SENSOR sensor)

3
drivers/Kconfig Normal file
View file

@ -0,0 +1,3 @@
menu "Drivers"
rsource "sensor/Kconfig"
endmenu

View file

@ -0,0 +1 @@
add_subdirectory_ifdef(CONFIG_SCD30 scd30)

3
drivers/sensor/Kconfig Normal file
View file

@ -0,0 +1,3 @@
if SENSOR
rsource "scd30/Kconfig"
endif

View file

@ -0,0 +1,3 @@
zephyr_library()
zephyr_library_sources(scd30.c)

View file

@ -0,0 +1,8 @@
config SCD30
bool "SCD30 CO2, Temperature, and Humidity Sensor"
default y
depends on DT_HAS_SENSIRION_SCD30_ENABLED
select I2C
select CRC
help
Enable driver for the SCD30 CO2, temperature, and humidity sensors.

View file

View file

@ -0,0 +1,3 @@
description: Sensirion SCD30 CO2, humidity, and temperature sensor
compatible: "sensirion,scd30"
include: [sensor-device.yaml, i2c-device.yaml]

View file

@ -1 +1,2 @@
CONFIG_SENSOR=y
CONFIG_GPIO=y