Skip to content

Commit

Permalink
Merge pull request #91 from tweedegolf/add-scd4x
Browse files Browse the repository at this point in the history
Add scd4x crate and needed categories and manufacturer
  • Loading branch information
tdittr authored Nov 8, 2024
2 parents 20b5d45 + e06adda commit db0a068
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 0 deletions.
15 changes: 15 additions & 0 deletions backend/src/driver_db/categories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@ pub enum Category {
#[serde(rename = "Sensor::Gyroscope")]
Gyroscope,

/// Sensors measuring air CO2 concentration
#[serde(rename = "Sensor::CO2")]
CO2,

/// Sensors measuring air temperature
#[serde(rename = "Sensor::Temperature")]
Temperature,

/// Sensors measuring air humidity
#[serde(rename = "Sensor::Humidity")]
Humidity,

/// Sensors measuring magnetic fields
///
/// These are commonly used as compasses, measuring the
Expand Down Expand Up @@ -108,6 +120,9 @@ impl Category {
Self::Accelerometer => Self::Sensor,
Self::Gyroscope => Self::Sensor,
Self::Magnetometer => Self::Sensor,
Category::CO2 => Self::Sensor,
Category::Temperature => Self::Sensor,
Category::Humidity => Self::Sensor,
Self::IoExpander => {
return None;
}
Expand Down
2 changes: 2 additions & 0 deletions backend/src/driver_db/manufacturers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ pub enum ChipManufacturer {
TI,
NXP,
Toshiba,
Sensirion,
SolomonSystech,

#[default]
Unknown,
}
16 changes: 16 additions & 0 deletions driver-db-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,21 @@
"type": "string",
"const": "Sensor::Gyroscope"
},
{
"description": "Sensors measuring air CO2 concentration",
"type": "string",
"const": "Sensor::CO2"
},
{
"description": "Sensors measuring air temperature",
"type": "string",
"const": "Sensor::Temperature"
},
{
"description": "Sensors measuring air humidity",
"type": "string",
"const": "Sensor::Humidity"
},
{
"description": "Sensors measuring magnetic fields\n\n These are commonly used as compasses, measuring the\n magnetic field of the earth.",
"type": "string",
Expand Down Expand Up @@ -139,6 +154,7 @@
"TI",
"NXP",
"Toshiba",
"Sensirion",
"SolomonSystech",
"Unknown"
]
Expand Down
40 changes: 40 additions & 0 deletions driver-db/scd4x.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
manifest_version = "0.0.1"

[meta]
categories = ["Sensor::CO2", "Sensor::Humidity", "Sensor::Temperature"]
datasheets = [
"https://sensirion.com/media/documents/48C4B7FB/66E05452/CD_DS_SCD4x_Datasheet_D1.pdf",
]
manufacturer = "Sensirion"
names = ["SCD40", "SCD41"]
part_numbers = ["SCD40-D-R2", "SCD41-D-R2"]

kicad_symbol = ["Sensor_Gas::SCD40-D-R2", "Sensor_Gas::SCD41-D-R2"]

[[dev_boards]]
connections = ["StemmaQt"]
link = "https://www.adafruit.com/product/5187"
manufacturer = "Adafruit"
name = "Adafruit SCD-40 - True CO2, Temperature and Humidity Sensor - STEMMA QT / Qwiic"

[[dev_boards]]
connections = ["StemmaQt"]
link = "https://www.adafruit.com/product/5190"
manufacturer = "Adafruit"
name = "Adafruit SCD-41 - True CO2 Temperature and Humidity Sensor - STEMMA QT / Qwiic"

[[dev_boards]]
connections = ["StemmaQt"]
link = "https://www.sparkfun.com/products/22395"
manufacturer = "Sparkfun"
name = "SparkFun CO₂ Humidity and Temperature Sensor - SCD40 (Qwiic)"

[[dev_boards]]
connections = ["MikroBus"]
link = "https://www.mikroe.com/hvac-click"
manufacturer = "Mikroe"
name = "HVAC Click"

[interfaces.i2c]
addrs = [0x62]
interrupt = false

0 comments on commit db0a068

Please sign in to comment.