From c6d4e48efd7ff65aa7122930a4c07c81107cc08b Mon Sep 17 00:00:00 2001 From: Hpsaturn Date: Wed, 23 Aug 2023 17:46:19 +0200 Subject: [PATCH 01/13] provisional DFRobot target with some fixes --- doxygen.conf | 2 +- unified-lib-deps.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doxygen.conf b/doxygen.conf index 8797b565..04801c2f 100644 --- a/doxygen.conf +++ b/doxygen.conf @@ -38,7 +38,7 @@ PROJECT_NAME = "CanAirIO Sensors Library" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 0.6.5 +PROJECT_NUMBER = 0.7.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/unified-lib-deps.ini b/unified-lib-deps.ini index e7028ccd..8fa0eab2 100644 --- a/unified-lib-deps.ini +++ b/unified-lib-deps.ini @@ -13,7 +13,7 @@ lib_deps = jcomas/S8_UART@1.0.1 sensirion/Sensirion Core@0.6.0 sensirion/Sensirion I2C SCD4x@0.4.0 - phzi/DFRobot_MultiGasSensor@2.0.0 + https://github.com/DFRobot/DFRobot_MultiGasSensor.git https://github.com/enjoyneering/AHTxx.git#eb21571 https://github.com/hpsaturn/DHT_nonblocking.git#ec6e5b9 https://github.com/paulvha/SN-GCJA5.git#f261968 From eb33b573850566cfa4ee22a239f713416f909239 Mon Sep 17 00:00:00 2001 From: Hpsaturn Date: Tue, 19 Sep 2023 22:14:56 +0200 Subject: [PATCH 02/13] added support for get the temperature in Kelvin and Fahrenheit --- src/Sensors.cpp | 77 ++++++++++++++++++++++++++++++++++++++++++------- src/Sensors.hpp | 25 ++++++++++++++-- 2 files changed, 90 insertions(+), 12 deletions(-) diff --git a/src/Sensors.cpp b/src/Sensors.cpp index 61176583..5503c734 100644 --- a/src/Sensors.cpp +++ b/src/Sensors.cpp @@ -299,6 +299,53 @@ float Sensors::getTemperature() { return temp; } +/// get temperature °K value of environment sensor +float Sensors::getTempKelvin() { + return temp + 273.15; +} + +/// get temperature °K value of environment sensor +float Sensors::getTempFahrenheit() { + return temp * (9/5) + 32; +} + +/** + * @brief Temperature unit register (auto) + * @param isCO2temp temperature unit register for CO2 sensors + * + * This method should register the right unit regarding setTemperatureUnit() method. +*/ +void Sensors::tempRegister(bool isCO2temp) { + switch(temp_unit){ + case(TEMPUNIT::KELVIN): + if (isCO2temp) + unitRegister(UNIT::CO2TEMPK); + else + unitRegister(UNIT::TEMPK); + break; + case(TEMPUNIT::FAHRENHEIT): + if (isCO2temp) + unitRegister(UNIT::CO2TEMPF); + else + unitRegister(UNIT::TEMPF); + break; + case(TEMPUNIT::CELSIUS): + if (isCO2temp) + unitRegister(UNIT::CO2TEMP); + else + unitRegister(UNIT::TEMP); + break; + } +} + +/** + * @brief set the temperature type unit + * @param tunit celciuse, kelvin or fahrenheit +*/ +void Sensors::setTemperatureUnit(TEMPUNIT tunit){ + temp_unit = tunit; +} + /** * @brief Set temperature offset for all temperature sensors * @param offset temperature offset in °C (default 0). @@ -326,10 +373,12 @@ float Sensors::getPressure() { return pres; } +/// get NH3 value in ppm float Sensors::getNH3() { return nh3; } +/// get CO value in ppm float Sensors::getCO() { return co; } @@ -537,12 +586,20 @@ float Sensors::getUnitValue(UNIT unit) { return pm10; case TEMP: return temp; + case TEMPK: + return temp+273.15; + case TEMPF: + return temp*(9/5)+32; case HUM: return humi; case CO2: return CO2Val; case CO2TEMP: return CO2temp; + case CO2TEMPK: + return CO2temp+273.15; + case CO2TEMPF: + return CO2temp*(9/5)+32; case CO2HUM: return CO2humi; case PRESS: @@ -781,8 +838,8 @@ bool Sensors::CO2Mhz19Read() { if(altoffset != 0) CO2correctionAlt(); dataReady = true; DEBUG("-->[SLIB] MHZ14-9 read \t: done!"); + tempRegister(true); unitRegister(UNIT::CO2); - unitRegister(UNIT::CO2TEMP); return true; } return false; @@ -867,7 +924,7 @@ void Sensors::am2320Read() { temp = temp1-toffset; dataReady = true; DEBUG("-->[SLIB] AM2320 read\t\t: done!"); - unitRegister(UNIT::TEMP); + tempRegister(false); unitRegister(UNIT::HUM); } } @@ -882,7 +939,7 @@ void Sensors::bme280Read() { alt = bme280.readAltitude(sealevel); dataReady = true; DEBUG("-->[SLIB] BME280 read\t\t: done!"); - unitRegister(UNIT::TEMP); + tempRegister(false); unitRegister(UNIT::HUM); unitRegister(UNIT::ALT); } @@ -897,7 +954,7 @@ void Sensors::bmp280Read() { alt = alt1; dataReady = true; DEBUG("-->[SLIB] BMP280 read\t\t: done!"); - unitRegister(UNIT::TEMP); + tempRegister(false); unitRegister(UNIT::PRESS); unitRegister(UNIT::ALT); } @@ -912,7 +969,7 @@ void Sensors::bme680Read() { alt = bme680.readAltitude(sealevel); dataReady = true; DEBUG("-->[SLIB] BME680 read\t\t: done!"); - unitRegister(UNIT::TEMP); + tempRegister(false); unitRegister(UNIT::HUM); unitRegister(UNIT::PRESS); unitRegister(UNIT::GAS); @@ -927,7 +984,7 @@ void Sensors::aht10Read() { temp = temp1-toffset; dataReady = true; DEBUG("-->[SLIB] AHT10 read\t\t: done!"); - unitRegister(UNIT::TEMP); + tempRegister(false); unitRegister(UNIT::HUM); } } @@ -940,7 +997,7 @@ void Sensors::sht31Read() { temp = temp1-toffset; dataReady = true; DEBUG("-->[SLIB] SHT31 read\t\t: done!"); - unitRegister(UNIT::TEMP); + tempRegister(false); unitRegister(UNIT::HUM); } } @@ -954,8 +1011,8 @@ void Sensors::CO2scd30Read() { CO2temp = scd30.temperature; dataReady = true; DEBUG("-->[SLIB] SCD30 read\t\t: done!"); + tempRegister(true); unitRegister(UNIT::CO2); - unitRegister(UNIT::CO2TEMP); unitRegister(UNIT::CO2HUM); } } @@ -970,8 +1027,8 @@ void Sensors::CO2scd4xRead() { CO2temp = tCO2temp; dataReady = true; DEBUG("-->[SLIB] SCD4x read\t\t: done!"); + tempRegister(true); unitRegister(UNIT::CO2); - unitRegister(UNIT::CO2TEMP); unitRegister(UNIT::CO2HUM); } @@ -1040,7 +1097,7 @@ void Sensors::dhtRead() { dataReady = true; sensorRegister(SENSORS::SDHTX); DEBUG("-->[SLIB] DHTXX read\t\t: done!"); - unitRegister(UNIT::TEMP); + tempRegister(false); unitRegister(UNIT::HUM); } #endif diff --git a/src/Sensors.hpp b/src/Sensors.hpp index c77ddb02..80ea97c5 100644 --- a/src/Sensors.hpp +++ b/src/Sensors.hpp @@ -91,9 +91,13 @@ X(PM4, "ug/m3", "PM4") \ X(PM10, "ug/m3", "PM10") \ X(TEMP, "C", "T") \ + X(TEMPK, "K", "T") \ + X(TEMPF, "F", "T") \ X(HUM, "%", "H") \ X(CO2, "ppm", "CO2") \ X(CO2TEMP, "C", "CO2T") \ + X(CO2TEMPK, "K", "CO2TK") \ + X(CO2TEMPF, "F", "CO2TF") \ X(CO2HUM, "%", "CO2H") \ X(PRESS, "hPa", "P") \ X(ALT, "m", "Alt") \ @@ -143,6 +147,12 @@ enum class SensorGroup { SENSOR_NONE, SENSOR_ENV, SENSOR_RAD // CAJOE_GEIGER }; +// TEMPERATURE UNIT +enum class TEMPUNIT { + CELSIUS, + FAHRENHEIT, + KELVIN +}; typedef void (*errorCbFn)(const char *msg); typedef void (*voidCbFn)(); @@ -238,6 +248,8 @@ class Sensors { void setOnErrorCallBack(errorCbFn cb); + void setTemperatureUnit(TEMPUNIT tunit); + void setDebugMode(bool enable); bool isUARTSensorConfigured(); @@ -260,6 +272,10 @@ class Sensors { float getTemperature(); + float getTempKelvin(); + + float getTempFahrenheit(); + float getHumidity(); float getPressure(); @@ -360,7 +376,10 @@ class Sensors { float temp = 0.0; // Temperature (°C) float pres = 0.0; // Pressure float alt = 0.0; - float gas = 0.0; // + float gas = 0.0; // + + // temperature unit (C,K,F) + TEMPUNIT temp_unit = TEMPUNIT::CELSIUS; uint16_t CO2Val; // CO2 in ppm float CO2humi = 0.0; // humidity of CO2 sensor @@ -424,7 +443,7 @@ class Sensors { bool pm1006Read(); bool CO2Mhz19Read(); bool CO2CM1106Read(); - int CO2CM1106val(); + int CO2CM116val(); bool CO2Mhz19Init(); bool CO2CM1106Init(); bool senseAirS8Init(); @@ -461,6 +480,8 @@ class Sensors { void printHumTemp(); + void tempRegister(bool isCO2temp); + void sensorRegister(SENSORS sensor); void sensorAnnounce(SENSORS sensor); From d1ccf93ba3bfc085710356fcf96f38d6551914e2 Mon Sep 17 00:00:00 2001 From: Hpsaturn Date: Tue, 19 Sep 2023 23:30:05 +0200 Subject: [PATCH 03/13] fixed issue for fahrenheit calc --- src/Sensors.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Sensors.cpp b/src/Sensors.cpp index 5503c734..aa150dc4 100644 --- a/src/Sensors.cpp +++ b/src/Sensors.cpp @@ -306,7 +306,7 @@ float Sensors::getTempKelvin() { /// get temperature °K value of environment sensor float Sensors::getTempFahrenheit() { - return temp * (9/5) + 32; + return temp * 1.8 + 32; } /** @@ -589,7 +589,7 @@ float Sensors::getUnitValue(UNIT unit) { case TEMPK: return temp+273.15; case TEMPF: - return temp*(9/5)+32; + return temp*1.8+32; case HUM: return humi; case CO2: From 1ba89864dcd299980388ccefecfe6a075be63533 Mon Sep 17 00:00:00 2001 From: Hpsaturn Date: Tue, 19 Sep 2023 23:45:13 +0200 Subject: [PATCH 04/13] updated examples with new methods. Fixed some pio issues --- .../advanced_multivariable/platformio.ini | 36 +++++++++++++------ examples/advanced_multivariable/src/main.cpp | 3 +- examples/m5atom/platformio.ini | 7 +++- 3 files changed, 33 insertions(+), 13 deletions(-) diff --git a/examples/advanced_multivariable/platformio.ini b/examples/advanced_multivariable/platformio.ini index df34b985..18e393ee 100644 --- a/examples/advanced_multivariable/platformio.ini +++ b/examples/advanced_multivariable/platformio.ini @@ -10,25 +10,39 @@ [platformio] src_dir = . +lib_dir = ../.. +extra_configs = ../../unified-lib-deps.ini -[common_env_data] +[env] framework = arduino upload_speed = 1500000 monitor_speed = 115200 -lib_deps = - hpsaturn/CanAirIO Air Quality Sensors Library +build_flags = + -D CORE_DEBUG_LEVEL=0 + -D ARDUINO_ESP32_DEV=1 + ; -D DHT11_ENABLED=1 // Deprecated, please change this old sensor + ; -D DHT_SENSOR_TYPE=2 + ; -D DHT_SENSOR_PIN=19 +lib_deps = ${commonlibs.lib_deps} -[env:esp32dev] +[common] +framework = ${env.framework} +upload_speed = ${env.upload_speed} +monitor_speed = ${env.monitor_speed} +build_flags = ${env.build_flags} +lib_deps = ${env.lib_deps} + +[env:esp32] +extends = common platform = espressif32 board = esp32dev -framework = ${common_env_data.framework} -upload_speed = ${common_env_data.upload_speed} -monitor_speed = ${common_env_data.monitor_speed} -lib_deps = ${common_env_data.lib_deps} [env:esp8266] +extends = common platform = espressif8266 board = esp12e -framework = ${common_env_data.framework} -monitor_speed = ${common_env_data.monitor_speed} -lib_deps = ${common_env_data.lib_deps} + +[env:atmelsam] +extends = common +platform = atmelsam +board = seeed_wio_terminal diff --git a/examples/advanced_multivariable/src/main.cpp b/examples/advanced_multivariable/src/main.cpp index 232507f9..27ad8bd8 100644 --- a/examples/advanced_multivariable/src/main.cpp +++ b/examples/advanced_multivariable/src/main.cpp @@ -65,7 +65,8 @@ void setup() { sensors.setSampleTime(10); // config sensors sample time interval sensors.setOnDataCallBack(&onSensorDataOk); // all data read callback sensors.setDebugMode(true); // [optional] debug mode - sensors.detectI2COnly(false); // disable force to only i2c sensors + sensors.detectI2COnly(true); // force to only i2c sensors + sensors.setTemperatureUnit(TEMPUNIT::KELVIN); // comment for Celsius or set Fahrenheit sensors.init(); // Auto detection to UART and i2c sensors delay(1000); } diff --git a/examples/m5atom/platformio.ini b/examples/m5atom/platformio.ini index 12ff98f2..db73d8e0 100644 --- a/examples/m5atom/platformio.ini +++ b/examples/m5atom/platformio.ini @@ -8,6 +8,11 @@ ; Please visit documentation for the other options and examples ; https://docs.platformio.org/page/projectconf.html +[platformio] +src_dir = . +lib_dir = ../.. +extra_configs = ../../unified-lib-deps.ini + [env:esp32dev] platform = espressif32 board = esp32dev @@ -20,4 +25,4 @@ build_flags = lib_deps = fastled/FastLED@^3.5.0 m5stack/M5Atom@^0.0.7 - hpsaturn/CanAirIO Air Quality Sensors Library @ ^0.5.5 + ${commonlibs.lib_deps} \ No newline at end of file From 1598a9f406e796c32cfb1a9aea5379a214bc0c60 Mon Sep 17 00:00:00 2001 From: Hpsaturn Date: Tue, 19 Sep 2023 23:46:11 +0200 Subject: [PATCH 05/13] fixed identation on example config --- examples/m5atom/platformio.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/m5atom/platformio.ini b/examples/m5atom/platformio.ini index db73d8e0..cdd8b02a 100644 --- a/examples/m5atom/platformio.ini +++ b/examples/m5atom/platformio.ini @@ -23,6 +23,6 @@ build_flags = -D CORE_DEBUG_LEVEL=0 -D M5ATOM lib_deps = - fastled/FastLED@^3.5.0 - m5stack/M5Atom@^0.0.7 + fastled/FastLED@^3.5.0 + m5stack/M5Atom@^0.0.7 ${commonlibs.lib_deps} \ No newline at end of file From a4b710c3640a0261a86aec7ba32ea05ae40c574d Mon Sep 17 00:00:00 2001 From: Hpsaturn Date: Wed, 20 Sep 2023 10:07:05 +0200 Subject: [PATCH 06/13] improved temperature API call to only one getter --- src/Sensors.cpp | 94 ++++++++++++++++++++++++++----------------------- src/Sensors.hpp | 4 --- 2 files changed, 50 insertions(+), 48 deletions(-) diff --git a/src/Sensors.cpp b/src/Sensors.cpp index aa150dc4..848d54e1 100644 --- a/src/Sensors.cpp +++ b/src/Sensors.cpp @@ -284,29 +284,43 @@ float Sensors::getCO2humi() { return CO2humi; } -/// get temperature °C value of CO2 sensor device -float Sensors::getCO2temp() { - return CO2temp; -} - /// get humidity % value of environment sensor float Sensors::getHumidity() { return humi; } -/// get temperature °C value of environment sensor -float Sensors::getTemperature() { - return temp; +/** + * @brief set the temperature type unit + * @param tunit celciuse, kelvin or fahrenheit +*/ +void Sensors::setTemperatureUnit(TEMPUNIT tunit){ + temp_unit = tunit; } -/// get temperature °K value of environment sensor -float Sensors::getTempKelvin() { - return temp + 273.15; +/// get temperature value from the CO2 sensor device +float Sensors::getCO2temp() { + switch (temp_unit) { + case TEMPUNIT::CELSIUS: + return CO2temp; + case TEMPUNIT::KELVIN: + return CO2temp + 273.15; + case TEMPUNIT::FAHRENHEIT: + return CO2temp * 1.8 + 32; + } + return CO2temp; } -/// get temperature °K value of environment sensor -float Sensors::getTempFahrenheit() { - return temp * 1.8 + 32; +/// get temperature value from environment sensor +float Sensors::getTemperature() { + switch (temp_unit) { + case TEMPUNIT::CELSIUS: + return temp; + case TEMPUNIT::KELVIN: + return temp + 273.15; + case TEMPUNIT::FAHRENHEIT: + return temp * 1.8 + 32; + } + return temp; } /** @@ -316,34 +330,26 @@ float Sensors::getTempFahrenheit() { * This method should register the right unit regarding setTemperatureUnit() method. */ void Sensors::tempRegister(bool isCO2temp) { - switch(temp_unit){ - case(TEMPUNIT::KELVIN): - if (isCO2temp) - unitRegister(UNIT::CO2TEMPK); - else - unitRegister(UNIT::TEMPK); - break; - case(TEMPUNIT::FAHRENHEIT): - if (isCO2temp) - unitRegister(UNIT::CO2TEMPF); - else - unitRegister(UNIT::TEMPF); - break; - case(TEMPUNIT::CELSIUS): - if (isCO2temp) - unitRegister(UNIT::CO2TEMP); - else - unitRegister(UNIT::TEMP); - break; - } -} - -/** - * @brief set the temperature type unit - * @param tunit celciuse, kelvin or fahrenheit -*/ -void Sensors::setTemperatureUnit(TEMPUNIT tunit){ - temp_unit = tunit; + switch (temp_unit) { + case (TEMPUNIT::CELSIUS): + if (isCO2temp) + unitRegister(UNIT::CO2TEMP); + else + unitRegister(UNIT::TEMP); + break; + case (TEMPUNIT::KELVIN): + if (isCO2temp) + unitRegister(UNIT::CO2TEMPK); + else + unitRegister(UNIT::TEMPK); + break; + case (TEMPUNIT::FAHRENHEIT): + if (isCO2temp) + unitRegister(UNIT::CO2TEMPF); + else + unitRegister(UNIT::TEMPF); + break; + } } /** @@ -589,7 +595,7 @@ float Sensors::getUnitValue(UNIT unit) { case TEMPK: return temp+273.15; case TEMPF: - return temp*1.8+32; + return temp * 1.8 + 32; case HUM: return humi; case CO2: @@ -599,7 +605,7 @@ float Sensors::getUnitValue(UNIT unit) { case CO2TEMPK: return CO2temp+273.15; case CO2TEMPF: - return CO2temp*(9/5)+32; + return CO2temp * 1.8 + 32; case CO2HUM: return CO2humi; case PRESS: diff --git a/src/Sensors.hpp b/src/Sensors.hpp index 80ea97c5..c9e7c793 100644 --- a/src/Sensors.hpp +++ b/src/Sensors.hpp @@ -272,10 +272,6 @@ class Sensors { float getTemperature(); - float getTempKelvin(); - - float getTempFahrenheit(); - float getHumidity(); float getPressure(); From cd0527ffda48904a36ca25b7a9ce9d3b9fd42508 Mon Sep 17 00:00:00 2001 From: Hpsaturn Date: Wed, 20 Sep 2023 17:18:03 +0200 Subject: [PATCH 07/13] refactor some code comments --- src/Sensors.cpp | 45 ++++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/src/Sensors.cpp b/src/Sensors.cpp index 848d54e1..e77ad252 100644 --- a/src/Sensors.cpp +++ b/src/Sensors.cpp @@ -188,7 +188,7 @@ void Sensors::setCO2RecalibrationFactor(int ppmValue) { /** * @brief set CO2 altitude offset (m) - * @param altitude (m) + * @param altitude (m). * * This method is used to compensate the CO2 value with the altitude. Recommended on high altitude. */ @@ -210,7 +210,7 @@ void Sensors::setCO2AltitudeOffset(float altitude){ /** * @brief set the sea level pressure (hPa) - * @param hpa (hPa) + * @param hpa (hPa). * * This method is used to set the sea level pressure for some sensors that need it. */ @@ -291,7 +291,7 @@ float Sensors::getHumidity() { /** * @brief set the temperature type unit - * @param tunit celciuse, kelvin or fahrenheit + * @param tunit celciuse, kelvin or fahrenheit. */ void Sensors::setTemperatureUnit(TEMPUNIT tunit){ temp_unit = tunit; @@ -325,7 +325,7 @@ float Sensors::getTemperature() { /** * @brief Temperature unit register (auto) - * @param isCO2temp temperature unit register for CO2 sensors + * @param isCO2temp temperature unit register for CO2 sensors. * * This method should register the right unit regarding setTemperatureUnit() method. */ @@ -406,7 +406,7 @@ int Sensors::getUARTDeviceTypeSelected() { } /** - * @brief Forced to enable I2C sensors only + * @brief Forced to enable I2C sensors only. * Recommended to use only if you are using a I2C sensor and improve the performance. */ void Sensors::detectI2COnly(bool enable) { @@ -537,7 +537,7 @@ UNIT Sensors::getNextUnit() { } /** - * @brief reset the sensor units registry + * @brief reset the sensor units registry. * * This function is useful to reset the units registry after a sensor unit is removed. * but it is **Not necessary** to call this function. @@ -549,7 +549,7 @@ void Sensors::resetUnitsRegister() { } } /** - * @brief reset the sensor registry + * @brief reset the sensor registry. * * This function is useful to reset the sensors registry after a sensor is removed. * It should be called before the initialization of the sensors but @@ -563,7 +563,7 @@ void Sensors::resetSensorsRegister() { } /** - * @brief reset the next sensor unit counter + * @brief reset the next sensor unit counter. * * This function is useful to reset the counter to review the sensor units again. * but it is not necessary to call this function. @@ -575,7 +575,7 @@ void Sensors::resetNextUnit() { /** * @brief get the sensor unit value (float) * @param unit (mandatory) UNIT enum value. - * @return float value of the each unit (RAW) + * @return float value of the each unit (RAW). * * Also you can use the specific primitive like getTemperature(), * getHumidity(), getGas(), getAltitude(), getPressure() @@ -593,7 +593,7 @@ float Sensors::getUnitValue(UNIT unit) { case TEMP: return temp; case TEMPK: - return temp+273.15; + return temp + 273.15; case TEMPF: return temp * 1.8 + 32; case HUM: @@ -603,7 +603,7 @@ float Sensors::getUnitValue(UNIT unit) { case CO2TEMP: return CO2temp; case CO2TEMPK: - return CO2temp+273.15; + return CO2temp + 273.15; case CO2TEMPF: return CO2temp * 1.8 + 32; case CO2HUM: @@ -629,7 +629,7 @@ float Sensors::getUnitValue(UNIT unit) { /** * @brief print the sensor units names available - * @param debug optional boolean to set the debug mode flag + * @param debug optional boolean to set the debug mode flag. */ void Sensors::printUnitsRegistered(bool debug) { if (!debug) return; @@ -644,7 +644,7 @@ void Sensors::printUnitsRegistered(bool debug) { /** * @brief print the sensor names detected - * @param debug optional boolean to set the debug mode flag + * @param debug optional boolean to set the debug mode flag. */ void Sensors::printSensorsRegistered(bool debug) { if (!debug) return; @@ -677,7 +677,7 @@ void Sensors::printValues() { /** * @brief PMS sensor generic read. Supported: Honeywell & Plantower sensors - * @return true if header and sensor data is right + * @return true if header and sensor data is right. */ bool Sensors::pmGenericRead() { int lenght_buffer = 32; @@ -704,7 +704,7 @@ bool Sensors::pmGenericRead() { /** * @brief Panasonic GCJA5 particulate meter sensor read. - * @return true if header and sensor data is right + * @return true if header and sensor data is right. */ bool Sensors::pmGCJA5Read() { int lenght_buffer = 32; @@ -731,7 +731,7 @@ bool Sensors::pmGCJA5Read() { /** * @brief Nova SDS011 particulate meter sensor read. - * @return true if header and sensor data is right + * @return true if header and sensor data is right. */ bool Sensors::pmSDS011Read() { int lenght_buffer = 10; @@ -758,7 +758,7 @@ bool Sensors::pmSDS011Read() { /** * @brief IKEA Vindriktning particulate meter sensor read. - * @return true if header and sensor data is right + * @return true if header and sensor data is right. */ bool Sensors::pm1006Read() { @@ -773,9 +773,8 @@ bool Sensors::pm1006Read() { /** * @brief PMSensor Serial read to basic string - * * @param SENSOR_RETRY attempts before failure - * @return String buffer + * @return String buffer. **/ String Sensors::hwSerialRead(unsigned int lenght_buffer) { unsigned int try_sensor_read = 0; @@ -794,7 +793,7 @@ String Sensors::hwSerialRead(unsigned int lenght_buffer) { /** * @brief Sensirion SPS30 particulate meter sensor read. - * @return true if reads succes + * @return true if reads succes. */ bool Sensors::sps30Read() { if (!isSensorRegistered(SENSORS::SSPS30)) return false; @@ -877,7 +876,7 @@ bool Sensors::senseAirS8Read() { /** * @brief read sensor data. Sensor selected. - * @return true if data is loaded from sensor + * @return true if data is loaded from sensor. */ bool Sensors::pmSensorRead() { switch (dev_uart_type) { @@ -1413,7 +1412,7 @@ bool Sensors::sps30tests() { } /** - * @brief : read and display Sensirion device info + * @brief : read and display Sensirion device info. */ void Sensors::sps30DeviceInfo() { char buf[32]; @@ -1725,7 +1724,7 @@ void Sensors::geigerRead(){ } /** * @brief Enable Geiger sensor on specific pin - * @param GPIO pin + * @param GPIO pin. */ void Sensors::enableGeigerSensor(int gpio){ sensorAnnounce(SENSORS::SCAJOE); From b6ff1d43a3702b328f62bb0ed4d0c67f82ac415f Mon Sep 17 00:00:00 2001 From: Hpsaturn Date: Wed, 20 Sep 2023 17:40:52 +0200 Subject: [PATCH 08/13] added verbose on temperature unit selection --- src/Sensors.cpp | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/src/Sensors.cpp b/src/Sensors.cpp index e77ad252..d60d7dcd 100644 --- a/src/Sensors.cpp +++ b/src/Sensors.cpp @@ -37,12 +37,12 @@ void Sensors::loop() { pmLoopTimeStamp = millis(); readAllSensors(); - if (!dataReady) DEBUG("-->[SLIB] Any data from sensors\t: ? check your wirings!"); + if (!dataReady) DEBUG("-->[SLIB] any data from sensors\t: ? check your wirings!"); if (dataReady && (_onDataCb != nullptr)) { _onDataCb(); // if any sensor reached any data, dataReady is true. } else if (!dataReady && (_onErrorCb != nullptr)) - _onErrorCb("[W][SLIB] Sensorslib error msg\t: No data from any sensor!"); + _onErrorCb("[W][SLIB] sensorslib error msg\t: No data from any sensor!"); } #ifdef DHT11_ENABLED @@ -293,8 +293,21 @@ float Sensors::getHumidity() { * @brief set the temperature type unit * @param tunit celciuse, kelvin or fahrenheit. */ -void Sensors::setTemperatureUnit(TEMPUNIT tunit){ - temp_unit = tunit; +void Sensors::setTemperatureUnit(TEMPUNIT tunit) { + temp_unit = tunit; + String tunit_symbol; + switch (temp_unit) { + case TEMPUNIT::CELSIUS: + tunit_symbol = getUnitSymbol(TEMP); + break; + case TEMPUNIT::KELVIN: + tunit_symbol = getUnitSymbol(TEMPK); + break; + case TEMPUNIT::FAHRENHEIT: + tunit_symbol = getUnitSymbol(TEMPF); + break; + } + Serial.printf("-->[SLIB] temperature unit\t: %s\r\n", tunit_symbol.c_str()); } /// get temperature value from the CO2 sensor device @@ -633,7 +646,7 @@ float Sensors::getUnitValue(UNIT unit) { */ void Sensors::printUnitsRegistered(bool debug) { if (!debug) return; - Serial.printf("-->[SLIB] Sensors units count\t: %i (", units_registered_count); + Serial.printf("-->[SLIB] sensors units count\t: %i (", units_registered_count); int i = 0; while (units_registered[i++] != 0) { Serial.print(unit_name[units_registered[i-1]]); @@ -648,7 +661,7 @@ void Sensors::printUnitsRegistered(bool debug) { */ void Sensors::printSensorsRegistered(bool debug) { if (!debug) return; - Serial.printf("-->[SLIB] Sensors count \t: %i (", sensors_registered_count); + Serial.printf("-->[SLIB] sensors count \t: %i (", sensors_registered_count); int i = 0; while (sensors_registered[i++] != 0) { Serial.print(sensors_device_names[sensors_registered[i-1]]); @@ -660,7 +673,7 @@ void Sensors::printSensorsRegistered(bool debug) { /// Print preview of the current variables detected by the sensors void Sensors::printValues() { if (!devmode) return; - Serial.print("-->[SLIB] Sensors values \t: "); + Serial.print("-->[SLIB] sensors values \t: "); for (u_int i = 0; i < UCOUNT; i++) { if (units_registered[i] != 0) { Serial.print(getUnitName((UNIT)units_registered[i])); From 2a10cfbe2f4ad4d2822030bf99403570b0f85ffb Mon Sep 17 00:00:00 2001 From: Hpsaturn Date: Wed, 20 Sep 2023 19:10:06 +0200 Subject: [PATCH 09/13] fix possible issue with wrong tunit enum set --- src/Sensors.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Sensors.cpp b/src/Sensors.cpp index d60d7dcd..881de94f 100644 --- a/src/Sensors.cpp +++ b/src/Sensors.cpp @@ -306,6 +306,8 @@ void Sensors::setTemperatureUnit(TEMPUNIT tunit) { case TEMPUNIT::FAHRENHEIT: tunit_symbol = getUnitSymbol(TEMPF); break; + default: + tunit_symbol = getUnitSymbol(TEMP); } Serial.printf("-->[SLIB] temperature unit\t: %s\r\n", tunit_symbol.c_str()); } From 0c8e0130d86e5b01c9374b62b83f7dd941935b2a Mon Sep 17 00:00:00 2001 From: Hpsaturn Date: Wed, 20 Sep 2023 19:15:36 +0200 Subject: [PATCH 10/13] removed unimplemented method in header for CM1106 --- src/Sensors.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Sensors.hpp b/src/Sensors.hpp index c9e7c793..8df20a2b 100644 --- a/src/Sensors.hpp +++ b/src/Sensors.hpp @@ -439,7 +439,6 @@ class Sensors { bool pm1006Read(); bool CO2Mhz19Read(); bool CO2CM1106Read(); - int CO2CM116val(); bool CO2Mhz19Init(); bool CO2CM1106Init(); bool senseAirS8Init(); From 83e5f768141a9d3bb6caec17a50e24209458ae2d Mon Sep 17 00:00:00 2001 From: Hpsaturn Date: Wed, 20 Sep 2023 19:21:43 +0200 Subject: [PATCH 11/13] r378v0.7.1 Fahrenheit and Kelvin support. issue #116 --- README.md | 1 + library.json | 2 +- library.properties | 2 +- src/Sensors.hpp | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0871fdbc..b5894fc7 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,7 @@ DHT22 is supported but is not recommended. Please see the documentation. - Unified calibration trigger for all CO2 sensors - Unified CO2 Altitude compensation - Unified temperature offset for CO2 and environment sensors +- Add support for Kelvin and Fahrenheit on environment and CO2 sensors - Public access to main objects of each library (full methods access) - Get unit symbol and name and each sub-sensor - Get the main group type: NONE, PM, CO2 and ENV. diff --git a/library.json b/library.json index 01c24699..99641c7f 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "CanAirIO Air Quality Sensors Library", - "version": "0.7.0", + "version": "0.7.1", "homepage":"https://canair.io", "keywords": [ diff --git a/library.properties b/library.properties index f24351b7..85df923f 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=CanAirIO Air Quality Sensors Library -version=0.7.0 +version=0.7.1 author=@hpsaturn, CanAirIO project maintainer=Antonio Vanegas url=https://github.com/kike-canaries/canairio_sensorlib diff --git a/src/Sensors.hpp b/src/Sensors.hpp index 8df20a2b..6b773a16 100644 --- a/src/Sensors.hpp +++ b/src/Sensors.hpp @@ -23,8 +23,8 @@ #include #endif -#define CSL_VERSION "0.7.0" -#define CSL_REVISION 377 +#define CSL_VERSION "0.7.1" +#define CSL_REVISION 378 /*************************************************************** * S E T U P E S P 3 2 B O A R D S A N D F I E L D S From 5840bbcc2da1998426b43803b759812a212dd34a Mon Sep 17 00:00:00 2001 From: Hpsaturn Date: Thu, 21 Sep 2023 00:14:15 +0200 Subject: [PATCH 12/13] improved documentation --- README.md | 3 +- doxygen.conf | 411 ++++++++++++++++++++++++++++++++++-------------- src/Sensors.cpp | 50 ++++-- src/Sensors.hpp | 66 ++++---- 4 files changed, 369 insertions(+), 161 deletions(-) diff --git a/README.md b/README.md index b5894fc7..34717aa7 100644 --- a/README.md +++ b/README.md @@ -130,6 +130,7 @@ void setup() { sensors.setSeaLevelPressure(1036.25); // [optional] Set sea level pressure in hpa sensors.setDebugMode(false); // [optional] debug mode to get detailed msgs sensors.detectI2COnly(true); // [optional] force to only i2c sensors + sensors.setTemperatureUnit(TEMPUNIT::KELVIN); // comment it for Celsius or set Fahrenheit sensors.init(); // Auto detection to UART and i2c sensors // Alternatives only for UART sensors (TX/RX): @@ -144,8 +145,6 @@ void setup() { // sensors.init(SENSORS::SAIRS8); // Force UART detection to SenseAirS8 CO2 sensor // sensors.init(SENSORS::Auto,PMS_RX,PMS_TX); // Auto detection on custom RX,TX - - // Also you can access to sub-library objects, and perform for example calls like next: // sensors.sps30.sleep() diff --git a/doxygen.conf b/doxygen.conf index 04801c2f..1116469b 100644 --- a/doxygen.conf +++ b/doxygen.conf @@ -1,4 +1,4 @@ -# Doxyfile 1.8.13 +# Doxyfile 1.9.1 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -17,11 +17,11 @@ # Project related configuration options #--------------------------------------------------------------------------- -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all text -# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv -# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv -# for the list of possible encodings. +# This tag specifies the encoding used for all characters in the configuration +# file that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. # The default value is: UTF-8. DOXYFILE_ENCODING = UTF-8 @@ -38,7 +38,7 @@ PROJECT_NAME = "CanAirIO Sensors Library" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 0.7.0 +PROJECT_NUMBER = 0.7.1 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -93,6 +93,14 @@ ALLOW_UNICODE_NAMES = NO OUTPUT_LANGUAGE = English +# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all generated output in the proper direction. +# Possible values are: None, LTR, RTL and Context. +# The default value is: None. + +OUTPUT_TEXT_DIRECTION = None + # If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. @@ -189,6 +197,16 @@ SHORT_NAMES = NO JAVADOC_AUTOBRIEF = NO +# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line +# such as +# /*************** +# as being the beginning of a Javadoc-style comment "banner". If set to NO, the +# Javadoc-style will behave just like regular comments and it will not be +# interpreted by doxygen. +# The default value is: NO. + +JAVADOC_BANNER = NO + # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first # line (until the first dot) of a Qt-style comment as the brief description. If # set to NO, the Qt-style will behave just like regular Qt-style comments (thus @@ -209,6 +227,14 @@ QT_AUTOBRIEF = NO MULTILINE_CPP_IS_BRIEF = NO +# By default Python docstrings are displayed as preformatted text and doxygen's +# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the +# doxygen's special commands can be used and the contents of the docstring +# documentation blocks is shown as doxygen documentation. +# The default value is: YES. + +PYTHON_DOCSTRING = YES + # If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the # documentation from any documented member that it re-implements. # The default value is: YES. @@ -236,16 +262,15 @@ TAB_SIZE = 4 # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading # "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines. +# newlines (in the resulting output). You can put ^^ in the value part of an +# alias to insert a newline as if a physical newline was in the original file. +# When you need a literal { or } or , in the value part of an alias you have to +# escape them by means of a backslash (\), this can lead to conflicts with the +# commands \{ and \} for these it is advised to use the version @{ and @} or use +# a double escape (\\{ and \\}) ALIASES = -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding "class=itcl::class" -# will allow you to use the command class in the itcl::class meaning. - -TCL_SUBST = - # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For # instance, some of the names that are used will be different. The list of all @@ -274,28 +299,40 @@ OPTIMIZE_FOR_FORTRAN = NO OPTIMIZE_OUTPUT_VHDL = NO +# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice +# sources only. Doxygen will then generate output that is more tailored for that +# language. For instance, namespaces will be presented as modules, types will be +# separated into more groups, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_SLICE = NO + # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, and -# language is one of the parsers supported by doxygen: IDL, Java, Javascript, -# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: -# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: -# Fortran. In the later case the parser tries to guess whether the code is fixed -# or free formatted code, this is the default for Fortran type files), VHDL. For -# instance to make doxygen treat .inc files as Fortran files (default is PHP), -# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, +# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice, VHDL, +# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: +# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser +# tries to guess whether the code is fixed or free formatted code, this is the +# default for Fortran type files). For instance to make doxygen treat .inc files +# as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. # # Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise -# the files are not read by doxygen. +# the files are not read by doxygen. When specifying no_extension you should add +# * to the FILE_PATTERNS. +# +# Note see also the list of default file extension mappings. EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. +# documentation. See https://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you can # mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in # case of backward compatibilities issues. @@ -307,7 +344,7 @@ MARKDOWN_SUPPORT = YES # to that level are automatically included in the table of contents, even if # they do not have an id attribute. # Note: This feature currently applies only to Markdown headings. -# Minimum value: 0, maximum value: 99, default value: 0. +# Minimum value: 0, maximum value: 99, default value: 5. # This tag requires that the tag MARKDOWN_SUPPORT is set to YES. TOC_INCLUDE_HEADINGS = 0 @@ -337,7 +374,7 @@ BUILTIN_STL_SUPPORT = NO CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen # will parse them like normal C++ but will assume all classes use public instead # of private inheritance when no explicit protection keyword is present. # The default value is: NO. @@ -423,6 +460,19 @@ TYPEDEF_HIDES_STRUCT = NO LOOKUP_CACHE_SIZE = 0 +# The NUM_PROC_THREADS specifies the number threads doxygen is allowed to use +# during processing. When set to 0 doxygen will based this on the number of +# cores available in the system. You can set it explicitly to a value larger +# than 0 to get more control over the balance between CPU load and processing +# speed. At this moment only the input processing can be done using multiple +# threads. Since this is still an experimental feature the default is set to 1, +# which efficively disables parallel processing. Please report any issues you +# encounter. Generating dot graphs in parallel is controlled by the +# DOT_NUM_THREADS setting. +# Minimum value: 0, maximum value: 32, default value: 1. + +NUM_PROC_THREADS = 1 + #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- @@ -443,6 +493,12 @@ EXTRACT_ALL = NO EXTRACT_PRIVATE = NO +# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual +# methods of a class will be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIV_VIRTUAL = NO + # If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. # The default value is: NO. @@ -480,6 +536,13 @@ EXTRACT_LOCAL_METHODS = NO EXTRACT_ANON_NSPACES = NO +# If this flag is set to YES, the name of an unnamed parameter in a declaration +# will be determined by the corresponding definition. By default unnamed +# parameters remain unnamed in the output. +# The default value is: YES. + +RESOLVE_UNNAMED_PARAMS = YES + # If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all # undocumented members inside documented classes or files. If set to NO these # members will be included in the various overviews, but no documentation @@ -497,8 +560,8 @@ HIDE_UNDOC_MEMBERS = NO HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO, these declarations will be -# included in the documentation. +# declarations. If set to NO, these declarations will be included in the +# documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO @@ -517,11 +580,18 @@ HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = NO -# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES, upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. +# With the correct setting of option CASE_SENSE_NAMES doxygen will better be +# able to match the capabilities of the underlying filesystem. In case the +# filesystem is case sensitive (i.e. it supports files in the same directory +# whose names only differ in casing), the option must be set to YES to properly +# deal with such files in case they appear in the input. For filesystems that +# are not case sensitive the option should be be set to NO to properly deal with +# output files written for symbols that only differ in casing, such as for two +# classes, one named CLASS and the other named Class, and to also support +# references to files without having to specify the exact matching casing. On +# Windows (including Cygwin) and MacOS, users should typically set this option +# to NO, whereas on Linux or other Unix flavors it should typically be set to +# YES. # The default value is: system dependent. CASE_SENSE_NAMES = YES @@ -708,7 +778,7 @@ LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. @@ -753,13 +823,17 @@ WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return # value. If set to NO, doxygen will only warn about wrong or incomplete -# parameter documentation, but not about the absence of documentation. +# parameter documentation, but not about the absence of documentation. If +# EXTRACT_ALL is set to YES then this flag will automatically be disabled. # The default value is: NO. WARN_NO_PARAMDOC = NO # If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when -# a warning is encountered. +# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS +# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but +# at the end of the doxygen process doxygen will return with a non-zero status. +# Possible values are: NO, YES and FAIL_ON_WARNINGS. # The default value is: NO. WARN_AS_ERROR = NO @@ -790,13 +864,14 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = src README.md +INPUT = src \ + README.md # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: http://www.gnu.org/software/libiconv) for the list of -# possible encodings. +# documentation (see: +# https://www.gnu.org/software/libiconv/) for the list of possible encodings. # The default value is: UTF-8. INPUT_ENCODING = UTF-8 @@ -809,11 +884,15 @@ INPUT_ENCODING = UTF-8 # need to set EXTENSION_MAPPING for the extension otherwise the files are not # read by doxygen. # +# Note the list of default checked file patterns might differ from the list of +# default file extension mappings. +# # If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, # *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, # *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, -# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, -# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. +# *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C comment), +# *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, *.vhdl, +# *.ucf, *.qsf and *.ice. FILE_PATTERNS = *.c \ *.cc \ @@ -1011,7 +1090,7 @@ INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES then for each documented -# function all documented functions referencing it will be listed. +# entity all documented functions referencing it will be listed. # The default value is: NO. REFERENCED_BY_RELATION = NO @@ -1043,12 +1122,12 @@ SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system -# (see http://www.gnu.org/software/global/global.html). You will need version +# (see https://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: # - Install the latest version of global -# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file # - Make sure the INPUT points to the root of the source tree # - Run doxygen as normal # @@ -1071,16 +1150,22 @@ USE_HTAGS = NO VERBATIM_HEADERS = YES # If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the -# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the -# cost of reduced performance. This can be particularly helpful with template -# rich C++ code for which doxygen's built-in parser lacks the necessary type -# information. +# clang parser (see: +# http://clang.llvm.org/) for more accurate parsing at the cost of reduced +# performance. This can be particularly helpful with template rich C++ code for +# which doxygen's built-in parser lacks the necessary type information. # Note: The availability of this option depends on whether or not doxygen was -# generated with the -Duse-libclang=ON option for CMake. +# generated with the -Duse_libclang=ON option for CMake. # The default value is: NO. CLANG_ASSISTED_PARSING = NO +# If clang assisted parsing is enabled and the CLANG_ADD_INC_PATHS tag is set to +# YES then doxygen will add the directory of each input to the include path. +# The default value is: YES. + +CLANG_ADD_INC_PATHS = YES + # If clang assisted parsing is enabled you can provide the compiler with command # line options that you would normally use when invoking the compiler. Note that # the include paths will already be set by doxygen for the files and directories @@ -1089,6 +1174,19 @@ CLANG_ASSISTED_PARSING = NO CLANG_OPTIONS = +# If clang assisted parsing is enabled you can provide the clang parser with the +# path to the directory containing a file called compile_commands.json. This +# file is the compilation database (see: +# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) containing the +# options used when the source files were built. This is equivalent to +# specifying the -p option to a clang tool, such as clang-check. These options +# will then be passed to the parser. Any options specified with CLANG_OPTIONS +# will be added as well. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse_libclang=ON option for CMake. + +CLANG_DATABASE_PATH = + #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- @@ -1100,13 +1198,6 @@ CLANG_OPTIONS = ALPHABETICAL_INDEX = YES -# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in -# which the alphabetical index list will be split. -# Minimum value: 1, maximum value: 20, default value: 5. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -COLS_IN_ALPHA_INDEX = 5 - # In case all classes in a project start with a common prefix, all classes will # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag # can be used to specify a prefix (or a list of prefixes) that should be ignored @@ -1207,7 +1298,7 @@ HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see -# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. @@ -1243,6 +1334,17 @@ HTML_COLORSTYLE_GAMMA = 80 HTML_TIMESTAMP = NO +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via JavaScript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have JavaScript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = YES + # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. @@ -1266,13 +1368,14 @@ HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: http://developer.apple.com/tools/xcode/), introduced with -# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a -# Makefile in the HTML output directory. Running make will produce the docset in -# that directory and running make install will install the docset in +# environment (see: +# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To +# create a documentation set, doxygen will generate a Makefile in the HTML +# output directory. Running make will produce the docset in that directory and +# running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. +# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy +# genXcode/_index.html for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1311,8 +1414,8 @@ DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on -# Windows. +# (see: +# https://www.microsoft.com/en-us/download/details.aspx?id=21138) on Windows. # # The HTML Help Workshop contains a compiler that can convert all HTML output # generated by doxygen into a single compiled HTML file (.chm). Compiled HTML @@ -1342,7 +1445,7 @@ CHM_FILE = HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated -# (YES) or that it should be included in the master .chm file (NO). +# (YES) or that it should be included in the main .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. @@ -1387,7 +1490,8 @@ QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace -# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1395,8 +1499,8 @@ QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- -# folders). +# Folders (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1404,30 +1508,30 @@ QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = -# The QHG_LOCATION tag can be used to specify the location of Qt's -# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the -# generated .qhp file. +# The QHG_LOCATION tag can be used to specify the location (absolute path +# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to +# run qhelpgenerator on the generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. QHG_LOCATION = @@ -1504,6 +1608,17 @@ TREEVIEW_WIDTH = 250 EXT_LINKS_IN_WINDOW = NO +# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg +# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see +# https://inkscape.org) to generate formulas as SVG images instead of PNGs for +# the HTML output. These images will generally look nicer at scaled resolutions. +# Possible values are: png (the default) and svg (looks nicer but requires the +# pdf2svg or inkscape tool). +# The default value is: png. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FORMULA_FORMAT = png + # Use this tag to change the font size of LaTeX formulas included as images in # the HTML documentation. When you change the font size after a successful # doxygen run you need to manually remove any form_*.png images from the HTML @@ -1513,7 +1628,7 @@ EXT_LINKS_IN_WINDOW = NO FORMULA_FONTSIZE = 10 -# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# Use the FORMULA_TRANSPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are not # supported properly for IE 6.0, but are supported on all modern browsers. # @@ -1524,8 +1639,14 @@ FORMULA_FONTSIZE = 10 FORMULA_TRANSPARENT = YES +# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands +# to create new LaTeX commands to be used in formulas as building blocks. See +# the section "Including formulas" for details. + +FORMULA_MACROFILE = + # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# http://www.mathjax.org) which uses client side Javascript for the rendering +# https://www.mathjax.org) which uses client side JavaScript for the rendering # instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path @@ -1537,7 +1658,7 @@ USE_MATHJAX = NO # When MathJax is enabled you can set the default output format to be used for # the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. +# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. # Possible values are: HTML-CSS (which is slower, but has the best # compatibility), NativeMML (i.e. MathML) and SVG. # The default value is: HTML-CSS. @@ -1552,8 +1673,8 @@ MATHJAX_FORMAT = HTML-CSS # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of -# MathJax from http://www.mathjax.org before deployment. -# The default value is: http://cdn.mathjax.org/mathjax/latest. +# MathJax from https://www.mathjax.org before deployment. +# The default value is: https://cdn.jsdelivr.net/npm/mathjax@2. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest @@ -1567,7 +1688,8 @@ MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. @@ -1595,7 +1717,7 @@ MATHJAX_CODEFILE = SEARCHENGINE = YES # When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a web server instead of a web client using Javascript. There +# implemented using a web server instead of a web client using JavaScript. There # are two flavors of web server based searching depending on the EXTERNAL_SEARCH # setting. When disabled, doxygen will generate a PHP script for searching and # an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing @@ -1614,7 +1736,8 @@ SERVER_BASED_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). +# Xapian (see: +# https://xapian.org/). # # See the section "External Indexing and Searching" for details. # The default value is: NO. @@ -1627,8 +1750,9 @@ EXTERNAL_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). See the section "External Indexing and -# Searching" for details. +# Xapian (see: +# https://xapian.org/). See the section "External Indexing and Searching" for +# details. # This tag requires that the tag SEARCHENGINE is set to YES. SEARCHENGINE_URL = @@ -1679,21 +1803,35 @@ LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. # -# Note that when enabling USE_PDFLATEX this option is only used for generating -# bitmaps for formulas in the HTML output, but not in the Makefile that is -# written to the output directory. -# The default file is: latex. +# Note that when not enabling USE_PDFLATEX the default is latex when enabling +# USE_PDFLATEX the default is pdflatex and when in the later case latex is +# chosen this is overwritten by pdflatex. For specific output languages the +# default can have been set differently, this depends on the implementation of +# the output language. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate # index for LaTeX. +# Note: This tag is used in the Makefile / make.bat. +# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file +# (.tex). # The default file is: makeindex. # This tag requires that the tag GENERATE_LATEX is set to YES. MAKEINDEX_CMD_NAME = makeindex +# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to +# generate index for LaTeX. In case there is no backslash (\) as first character +# it will be automatically added in the LaTeX code. +# Note: This tag is used in the generated output file (.tex). +# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat. +# The default value is: makeindex. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_MAKEINDEX_CMD = makeindex + # If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX # documents. This may be useful for small projects and may help to save some # trees in general. @@ -1778,9 +1916,11 @@ LATEX_EXTRA_FILES = PDF_HYPERLINKS = YES -# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate -# the PDF file directly from the LaTeX files. Set this option to YES, to get a -# higher quality PDF documentation. +# If the USE_PDFLATEX tag is set to YES, doxygen will use the engine as +# specified with LATEX_CMD_NAME to generate the PDF file directly from the LaTeX +# files. Set this option to YES, to get a higher quality PDF documentation. +# +# See also section LATEX_CMD_NAME for selecting the engine. # The default value is: YES. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1814,7 +1954,7 @@ LATEX_SOURCE_CODE = NO # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. See -# http://en.wikipedia.org/wiki/BibTeX and \cite for more info. +# https://en.wikipedia.org/wiki/BibTeX and \cite for more info. # The default value is: plain. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1828,6 +1968,14 @@ LATEX_BIB_STYLE = plain LATEX_TIMESTAMP = NO +# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute) +# path from which the emoji images will be read. If a relative path is entered, +# it will be relative to the LATEX_OUTPUT directory. If left blank the +# LATEX_OUTPUT directory will be used. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_EMOJI_DIRECTORY = + #--------------------------------------------------------------------------- # Configuration options related to the RTF output #--------------------------------------------------------------------------- @@ -1867,9 +2015,9 @@ COMPACT_RTF = NO RTF_HYPERLINKS = NO -# Load stylesheet definitions from file. Syntax is similar to doxygen's config -# file, i.e. a series of assignments. You only have to provide replacements, -# missing definitions are set to their default value. +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# configuration file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. # # See also section "Doxygen usage" for information on how to generate the # default style sheet that doxygen normally uses. @@ -1878,8 +2026,8 @@ RTF_HYPERLINKS = NO RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an RTF document. Syntax is -# similar to doxygen's config file. A template extensions file can be generated -# using doxygen -e rtf extensionFile. +# similar to doxygen's configuration file. A template extensions file can be +# generated using doxygen -e rtf extensionFile. # This tag requires that the tag GENERATE_RTF is set to YES. RTF_EXTENSIONS_FILE = @@ -1965,6 +2113,13 @@ XML_OUTPUT = xml XML_PROGRAMLISTING = YES +# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include +# namespace members in file scope as well, matching the HTML output. +# The default value is: NO. +# This tag requires that the tag GENERATE_XML is set to YES. + +XML_NS_MEMB_FILE_SCOPE = NO + #--------------------------------------------------------------------------- # Configuration options related to the DOCBOOK output #--------------------------------------------------------------------------- @@ -1997,9 +2152,9 @@ DOCBOOK_PROGRAMLISTING = NO #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an -# AutoGen Definitions (see http://autogen.sf.net) file that captures the -# structure of the code including all documentation. Note that this feature is -# still experimental and incomplete at the moment. +# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures +# the structure of the code including all documentation. Note that this feature +# is still experimental and incomplete at the moment. # The default value is: NO. GENERATE_AUTOGEN_DEF = NO @@ -2166,12 +2321,6 @@ EXTERNAL_GROUPS = YES EXTERNAL_PAGES = YES -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of 'which perl'). -# The default file (with absolute path) is: /usr/bin/perl. - -PERL_PATH = /usr/bin/perl - #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- @@ -2185,15 +2334,6 @@ PERL_PATH = /usr/bin/perl CLASS_DIAGRAMS = YES -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see: -# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - # You can include diagrams made with dia in doxygen documentation. Doxygen will # then run dia to produce the diagram and insert it in the documentation. The # DIA_PATH tag allows you to specify the directory where the dia binary resides. @@ -2291,10 +2431,32 @@ UML_LOOK = NO # but if the number exceeds 15, the total amount of fields shown is limited to # 10. # Minimum value: 0, maximum value: 100, default value: 10. -# This tag requires that the tag HAVE_DOT is set to YES. +# This tag requires that the tag UML_LOOK is set to YES. UML_LIMIT_NUM_FIELDS = 10 +# If the DOT_UML_DETAILS tag is set to NO, doxygen will show attributes and +# methods without types and arguments in the UML graphs. If the DOT_UML_DETAILS +# tag is set to YES, doxygen will add type and arguments for attributes and +# methods in the UML graphs. If the DOT_UML_DETAILS tag is set to NONE, doxygen +# will not generate fields with class member information in the UML graphs. The +# class diagrams will look similar to the default class diagrams but using UML +# notation for the relationships. +# Possible values are: NO, YES and NONE. +# The default value is: NO. +# This tag requires that the tag UML_LOOK is set to YES. + +DOT_UML_DETAILS = NO + +# The DOT_WRAP_THRESHOLD tag can be used to set the maximum number of characters +# to display on a single line. If the actual line length exceeds this threshold +# significantly it will wrapped across multiple lines. Some heuristics are apply +# to avoid ugly line breaks. +# Minimum value: 0, maximum value: 1000, default value: 17. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_WRAP_THRESHOLD = 17 + # If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and # collaboration graphs will show the relations between templates and their # instances. @@ -2486,9 +2648,18 @@ DOT_MULTI_TARGETS = NO GENERATE_LEGEND = YES -# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot +# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate # files that are used to generate the various graphs. +# +# Note: This setting is not only used for dot files but also for msc and +# plantuml temporary files. # The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. DOT_CLEANUP = YES + +# MODS: + + +DISABLE_INDEX = YES +GENERATE_TREEVIEW = YES + diff --git a/src/Sensors.cpp b/src/Sensors.cpp index 881de94f..897c4c6b 100644 --- a/src/Sensors.cpp +++ b/src/Sensors.cpp @@ -194,7 +194,7 @@ void Sensors::setCO2RecalibrationFactor(int ppmValue) { */ void Sensors::setCO2AltitudeOffset(float altitude){ this->altoffset = altitude; - this->hpa = hpaCalculation(altitude); //hPa hectopascal calculation based on altitude + this->hpa = hpaCalculation(altitude); // hPa hectopascal calculation based on altitude if (isSensorRegistered(SENSORS::SSCD30)) { setSCD30AltitudeOffset(altoffset); @@ -428,10 +428,12 @@ void Sensors::detectI2COnly(bool enable) { i2conly = enable; } +/// returns the CanAirIO Sensorslib version String Sensors::getLibraryVersion() { return String(CSL_VERSION); } +/// return the current revision code number int16_t Sensors::getLibraryRevision() { return CSL_REVISION; } @@ -477,10 +479,9 @@ SensorGroup Sensors::getSensorGroup(SENSORS sensor) { /** * @brief get the sensor registry for retrieve the sensor names - * @return pointer to the sensor registry - * @link https://bit.ly/3qVQYYy + * @return pointer to the sensor registry. * - * See the multivariable example: https://bit.ly/2XzZ9yw + * See the Advanced Multivariable example */ uint8_t * Sensors::getSensorsRegistered() { return sensors_registered; @@ -489,9 +490,8 @@ uint8_t * Sensors::getSensorsRegistered() { /** * @brief get the sensor unit status on the registry * @return True if the sensor unit is available, false otherwise. - * @link https://bit.ly/3qVQYYy * - * See the multivariable example: https://bit.ly/2XzZ9yw + * See the Advanced Multivariable example */ bool Sensors::isUnitRegistered(UNIT unit) { if (unit == UNIT::NUNIT) return false; @@ -504,9 +504,8 @@ bool Sensors::isUnitRegistered(UNIT unit) { /** * @brief get the sensor units registry for retrieve the unit name, unit type and symbol. See getNextUnit() * @return pointer to the sensor units registry - * @link https://bit.ly/3qVQYYy * - * See the multivariable example: https://bit.ly/2XzZ9yw + * See the Advanced Multivariable example */ uint8_t * Sensors::getUnitsRegistered() { return units_registered; @@ -1512,6 +1511,7 @@ void Sensors::bme280Init() { sensorRegister(SENSORS::SBME280); } +/// Environment BMP280 sensor init void Sensors::bmp280Init() { sensorAnnounce(SENSORS::SBMP280); #ifndef Wire1 @@ -1536,6 +1536,7 @@ void Sensors::bmp280Init() { sensorRegister(SENSORS::SBMP280); } +/// Bosch BME680 sensor init void Sensors::bme680Init() { sensorAnnounce(SENSORS::SBME680); if (!bme680.begin()) return; @@ -1547,6 +1548,7 @@ void Sensors::bme680Init() { sensorRegister(SENSORS::SBME680); } +/// AHTXX sensors init void Sensors::aht10Init() { sensorAnnounce(SENSORS::SAHTXX); aht10 = AHTxx(AHTXX_ADDRESS_X38, AHT1x_SENSOR); @@ -1558,6 +1560,7 @@ void Sensors::aht10Init() { sensorRegister(SENSORS::SAHTXX); } +/// Sensirion SCD30 CO2/T/H sensor init void Sensors::CO2scd30Init() { sensorAnnounce(SENSORS::SSCD30); #ifndef Wire1 @@ -1599,6 +1602,7 @@ void Sensors::setSCD30AltitudeOffset(float offset) { } } +/// Sensirion SCD4X CO2 sensor init void Sensors::CO2scd4xInit() { sensorAnnounce(SENSORS::SSCD4X); float tTemperatureOffset, offsetDifference; @@ -1649,6 +1653,7 @@ void Sensors::setSCD4xAltitudeOffset(float offset) { } } +/// Panasonic GCJA5 sensor init void Sensors::GCJA5Init() { sensorAnnounce(SENSORS::SGCJA5); #ifndef Wire1 @@ -1659,6 +1664,7 @@ void Sensors::GCJA5Init() { sensorRegister(SENSORS::SGCJA5); } +/// DFRobot GAS (CO) sensors init void Sensors::DFRobotCOInit() { sensorAnnounce(SENSORS::SDFRCO); dfrCO = DFRobot_GAS_I2C(&Wire, 0x78); // Be sure that your group of i2c address is 7 @@ -1670,6 +1676,7 @@ void Sensors::DFRobotCOInit() { sensorRegister(SENSORS::SDFRCO); } +/// DFRobot GAS (NH3) sensors init void Sensors::DFRobotNH3Init() { sensorAnnounce(SENSORS::SDFRNH3); dfrNH3 = DFRobot_GAS_I2C(&Wire, 0x7A); // 0x77 y 0x75 used by bme680. Be sure that your group of i2c address is 7 @@ -1689,6 +1696,7 @@ void Sensors::CO2correctionAlt() { DEBUG("-->[SLIB] CO2 compensated\t:", String(CO2Val).c_str()); } +/// hPa hectopascal calculation based on the altitude. See CO2AltitudeOffset setter float Sensors::hpaCalculation(float altitude) { DEBUG("-->[SLIB] CO2 altitude offset\t:", String(altitude).c_str()); float hpa = 1012 - 0.118 * altitude + 0.00000473 * altitude * altitude; // Cuadratic regresion formula obtained PA (hpa) from high above the sea @@ -1696,22 +1704,38 @@ float Sensors::hpaCalculation(float altitude) { return hpa; } +/// utility to notify on the debug output a possible sensor. void Sensors::sensorAnnounce(SENSORS sensor) { DEBUG("-->[SLIB] attempt enable sensor\t:",getSensorName(sensor).c_str()); } +/** + * @brief register the sensor type. + * @param receive SENSORS enum param. + * + * Each sensor should be registered and also its units. With that we will able to have + * dynamic calls of the sensors and its units on the GUI or implementation. +*/ void Sensors::sensorRegister(SENSORS sensor) { if (isSensorRegistered(sensor)) return; Serial.printf("-->[SLIB] sensor registered\t: %s \t:D\r\n", getSensorName(sensor).c_str()); sensors_registered[sensors_registered_count++] = sensor; } +/** + * @brief register the unit type. + * @param receive UNIT enum param. + * + * Each sensor unit should be registered. For temperature sensors + * please use tempRegister() method. +*/ void Sensors::unitRegister(UNIT unit) { if (isUnitRegistered(unit)) return; if (unit == UNIT::NUNIT) return; units_registered[units_registered_count++] = unit; } +/// reset all library variables (generic sensors units) void Sensors::resetAllVariables() { pm1 = 0; pm25 = 0; @@ -1739,7 +1763,7 @@ void Sensors::geigerRead(){ } /** * @brief Enable Geiger sensor on specific pin - * @param GPIO pin. + * @param gpio number or pin. */ void Sensors::enableGeigerSensor(int gpio){ sensorAnnounce(SENSORS::SCAJOE); @@ -1751,11 +1775,19 @@ void Sensors::enableGeigerSensor(int gpio){ sensorRegister(SENSORS::SCAJOE); } +/** + * @brief get Geiger count. Tics in the last 60secs + * @return CPM +*/ uint32_t Sensors::getGeigerCPM(void) { if (rad == nullptr) return 0; else return rad->getTics(); } +/** + * @brief get Geiger count in uSv/h units + * @return CPM * J305 conversion factor +*/ float Sensors::getGeigerMicroSievertHour(void) { if (rad == nullptr) return 0; else return rad->getUSvh(); diff --git a/src/Sensors.hpp b/src/Sensors.hpp index 6b773a16..9cf8e345 100644 --- a/src/Sensors.hpp +++ b/src/Sensors.hpp @@ -84,6 +84,7 @@ // UART defualt port #define SENSOR_COMMS SERIALPORT2 +/// Sensors units definitions (symbol/name) #define SENSOR_UNITS \ X(NUNIT, "NUNIT", "NUNIT") \ X(PM1, "ug/m3", "PM1") \ @@ -113,6 +114,7 @@ typedef enum UNIT : size_t { SENSOR_UNITS } UNIT; #undef X +/// sensors types: 1:PM, 2:CO2, 3:ENV #define SENSORS_TYPES \ X(Auto, "GENERIC", 1) \ X(SGCJA5, "GCJA5", 1) \ @@ -140,14 +142,14 @@ typedef enum UNIT : size_t { SENSOR_UNITS } UNIT; typedef enum SENSORS : size_t { SENSORS_TYPES } SENSORS; // backward compatibility #undef X -// MAIN SENSOR TYPE +/// MAIN SENSOR GROUPS TYPE enum class SensorGroup { SENSOR_NONE, SENSOR_PM, SENSOR_CO2, SENSOR_ENV, SENSOR_RAD // CAJOE_GEIGER }; -// TEMPERATURE UNIT +/// TEMPERATURE UNITS enum class TEMPUNIT { CELSIUS, FAHRENHEIT, @@ -157,81 +159,85 @@ enum class TEMPUNIT { typedef void (*errorCbFn)(const char *msg); typedef void (*voidCbFn)(); +/** + * @brief CanAirIO Sensors Manager main class. + * @authors \@hpsaturn and CanAir.IO contributers +*/ class Sensors { public: - // SPS30 values. Only for Sensirion SPS30 sensor. + /// SPS30 values. Only for Sensirion SPS30 sensor. struct sps_values val; - // Debug mode for increase verbose. + /// Debug mode for increase verbose. bool devmode; - // Initial sample time for all sensors + /// Initial sample time for all sensors int sample_time = 10; - // temperature offset (for final temp output) + /// Temperature offset (for final temp output) float toffset = 0.0; - // Altitud compensation variable + /// Altitud compensation variable float altoffset = 0.0; - // Sea level pressure (hPa) + /// Sea level pressure (hPa) float sealevel = 1013.25; - // Altitud hpa calculation + /// Altitud hpa calculation float hpa = 0.0; /// Sensirion library SPS30 sps30; - // only detect i2c sensors + /// only detect i2c sensors flag bool i2conly; /***************************************** * I2C sensors: ****************************************/ - // AM2320 (Humidity and temperature) + /// AM2320 object (Humidity and temperature) AM232X am2320; - // BME280 (Humidity, Pressure, Altitude and Temperature) + /// BME280 object (Humidity, Pressure, Altitude and Temperature) Adafruit_BME280 bme280; - // BMP280 (Humidity, Pressure, Altitude and Temperature) + /// BMP280 object (Humidity, Pressure, Altitude and Temperature) Adafruit_BMP280 bmp280; - // BME680 (Humidity, Gas, IAQ, Pressure, Altitude and Temperature) + /// BME680 object (Humidity, Gas, IAQ, Pressure, Altitude and Temperature) Adafruit_BME680 bme680; - // AHT10 + /// AHTXX sensors object AHTxx aht10; - // SHT31 + /// SHT31 object (Humidity and temperature) Adafruit_SHT31 sht31; #ifdef DHT11_ENABLED - // DHT sensor + /// @deprecated DHT sensor variable float dhthumi, dhttemp; #endif - // Mhz19 sensor + /// Mhz19 object sensor MHZ19 mhz19; - // SCD30 sensor + /// SCD30 object sensor Adafruit_SCD30 scd30; - // CM1106 UART + /// CM1106 UART main object sensor CM1106_UART *cm1106; - // CM1106 UART + /// CM1106 UART main variable CM1106_sensor cm1106sensor; - // CM1106 UART + /// CM1106 UART calibration object CM1106_ABC abc; - // Panasonic SN-GCJA5 + /// Panasonic SN-GCJA5 object sensor SFE_PARTICLE_SENSOR pmGCJA5; - // SenseAir S8 CO2 sensor + /// SenseAir S8 CO2 object sensor S8_UART *s8; - // SenseAir S8 CO2 sensor + /// SenseAir S8 CO2 object sensor S8_sensor s8sensor; - // SCD4x sensor + /// SCD4x object sensor SensirionI2CScd4x scd4x; - // IKEA Vindriktn sensor + /// IKEA Vindriktn object sensor PM1006 *pm1006; - // DFRobot gravity NH3 sensor addr 0x74 + /// DFRobot gravity NH3 object sensor addr 0x74 DFRobot_GAS_I2C dfrCO; - // DFRobot gravity NH3 sensor addr 0x77 + /// DFRobot gravity NH3 object sensor addr 0x77 DFRobot_GAS_I2C dfrNH3; - // Geiger CAJOE sensor + /// Geiger CAJOE object sensor GEIGER *rad; void init(u_int pms_type = 0, int pms_rx = PMS_RX, int pms_tx = PMS_TX); From 264b40d1566c7c412b22457c47c8324669723434 Mon Sep 17 00:00:00 2001 From: Hpsaturn Date: Thu, 21 Sep 2023 00:28:00 +0200 Subject: [PATCH 13/13] fixed some doxygen issues --- doxygen.conf | 11 ++--------- src/Sensors.hpp | 8 ++++---- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/doxygen.conf b/doxygen.conf index 1116469b..402b4f21 100644 --- a/doxygen.conf +++ b/doxygen.conf @@ -1565,7 +1565,7 @@ ECLIPSE_DOC_ID = org.doxygen.Project # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. -DISABLE_INDEX = NO +DISABLE_INDEX = YES # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. If the tag @@ -1582,7 +1582,7 @@ DISABLE_INDEX = NO # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. -GENERATE_TREEVIEW = NO +GENERATE_TREEVIEW = YES # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that # doxygen will group on one line in the generated HTML documentation. @@ -2656,10 +2656,3 @@ GENERATE_LEGEND = YES # The default value is: YES. DOT_CLEANUP = YES - -# MODS: - - -DISABLE_INDEX = YES -GENERATE_TREEVIEW = YES - diff --git a/src/Sensors.hpp b/src/Sensors.hpp index 9cf8e345..e27dfd48 100644 --- a/src/Sensors.hpp +++ b/src/Sensors.hpp @@ -84,7 +84,7 @@ // UART defualt port #define SENSOR_COMMS SERIALPORT2 -/// Sensors units definitions (symbol/name) +// Sensors units definitions (symbol/name) #define SENSOR_UNITS \ X(NUNIT, "NUNIT", "NUNIT") \ X(PM1, "ug/m3", "PM1") \ @@ -114,7 +114,7 @@ typedef enum UNIT : size_t { SENSOR_UNITS } UNIT; #undef X -/// sensors types: 1:PM, 2:CO2, 3:ENV +// sensors types: 1:PM, 2:CO2, 3:ENV #define SENSORS_TYPES \ X(Auto, "GENERIC", 1) \ X(SGCJA5, "GCJA5", 1) \ @@ -142,14 +142,14 @@ typedef enum UNIT : size_t { SENSOR_UNITS } UNIT; typedef enum SENSORS : size_t { SENSORS_TYPES } SENSORS; // backward compatibility #undef X -/// MAIN SENSOR GROUPS TYPE +// MAIN SENSOR GROUPS TYPE enum class SensorGroup { SENSOR_NONE, SENSOR_PM, SENSOR_CO2, SENSOR_ENV, SENSOR_RAD // CAJOE_GEIGER }; -/// TEMPERATURE UNITS +// TEMPERATURE UNITS enum class TEMPUNIT { CELSIUS, FAHRENHEIT,