From b05cba931bfc46a5392b121deaa6eecae4b5f8c4 Mon Sep 17 00:00:00 2001
From: MX <10697207+xMasterX@users.noreply.github.com>
Date: Thu, 2 Feb 2023 14:01:23 +0300
Subject: [PATCH] Update UniTemp
https://github.com/quen0n/unitemp-flipperzero/tree/master
---
applications/plugins/unitemp/README.md | 13 +-
applications/plugins/unitemp/Sensors.c | 23 +-
applications/plugins/unitemp/Sensors.h | 4 +-
applications/plugins/unitemp/sensors/BME680.c | 431 ++++++++++++++++++
applications/plugins/unitemp/sensors/BME680.h | 112 +++++
.../plugins/unitemp/sensors/MAX6675.c | 81 ++++
.../plugins/unitemp/sensors/MAX6675.h | 65 +++
.../plugins/unitemp/sensors/Sensors.xlsx | Bin 12455 -> 12642 bytes
applications/plugins/unitemp/unitemp.h | 2 +-
9 files changed, 707 insertions(+), 24 deletions(-)
create mode 100644 applications/plugins/unitemp/sensors/BME680.c
create mode 100644 applications/plugins/unitemp/sensors/BME680.h
create mode 100644 applications/plugins/unitemp/sensors/MAX6675.c
create mode 100644 applications/plugins/unitemp/sensors/MAX6675.h
diff --git a/applications/plugins/unitemp/README.md b/applications/plugins/unitemp/README.md
index 668aae40a..436f3600e 100644
--- a/applications/plugins/unitemp/README.md
+++ b/applications/plugins/unitemp/README.md
@@ -4,14 +4,21 @@
[![GitHub](https://img.shields.io/github/license/quen0n/unitemp-flipperzero)](https://github.com/quen0n/unitemp-flipperzero/blob/dev/LICENSE.md)
[![Build dev](https://github.com/quen0n/unitemp-flipperzero/actions/workflows/build_dev.yml/badge.svg?branch=dev)](https://github.com/quen0n/unitemp-flipperzero/actions/workflows/build_dev.yml)
[Flipper Zero](https://flipperzero.one/) application for reading temperature, humidity and pressure sensors like a DHT11/22, DS18B20, BMP280, HTU21 and more.
-## List of supported sensors (supplemented)
-![image](https://user-images.githubusercontent.com/10090793/211131502-c1560eb5-f59c-4cfa-86f7-27f037490a35.png)
+## List of supported sensors
+![image](https://user-images.githubusercontent.com/10090793/215605424-54b1c08c-e41b-4fb4-b966-dd959507200b.png)
+
## Installation
1) Download [latest version](https://cloud.quenon.ru/index.php/s/h98rT9UnaOL4wxR/download?path=%2F&files=unitemp-latest.fap)
2) Copy `unitemp-latest.fap` to `SD card/apps/GPIO` with qFlipper or mobile application
3) Open application on your Flipper: `Applications->GPIO->Temp sensors reader`
-Note: If you get the message "API version mismatch" after updating the firmware, download and install Unitemp again
+Note: If you get the message "API version mismatch" after updating the firmware, download and install Unitemp again
+## Need help? Discussions?
+Join the discussion, ask a question or just send a photo of the flipper with sensors to [Discord](https://discord.com/channels/740930220399525928/1056727938747351060)
+## Gratitudes
+Thanks to [@Svaarich](https://github.com/Svaarich) for the UI design and to the Unleashed firmware community for sensors testing and feedbacks.
+
## Some community photos
![image](https://user-images.githubusercontent.com/10090793/210120132-7ddbc937-0a6b-4472-bd1c-7fbc3ecdf2ad.png)
![image](https://user-images.githubusercontent.com/10090793/210120135-12fc5810-77ff-49db-b799-e9479e1f57a7.png)
![image](https://user-images.githubusercontent.com/10090793/210120143-a2bae3ce-4190-421f-8c4f-c7c744903bd6.png)
+![image](https://user-images.githubusercontent.com/10090793/215224085-8099408e-b3de-4a0c-854e-fe4e4faa8ea3.png)
\ No newline at end of file
diff --git a/applications/plugins/unitemp/Sensors.c b/applications/plugins/unitemp/Sensors.c
index 2b1eaf6bf..d9304ab32 100644
--- a/applications/plugins/unitemp/Sensors.c
+++ b/applications/plugins/unitemp/Sensors.c
@@ -75,25 +75,10 @@ const Interface SPI = {
//Перечень интерфейсов подключения
//static const Interface* interfaces[] = {&SINGLE_WIRE, &I2C, &ONE_WIRE, &SPI};
//Перечень датчиков
-static const SensorType* sensorTypes[] = {
- &DHT11,
- &DHT12_SW,
- &DHT20,
- &DHT21,
- &DHT22,
- &Dallas,
- &AM2320_SW,
- &AM2320_I2C,
- &HTU21x,
- &AHT10,
- &SHT30,
- &GXHT30,
- &LM75,
- &HDC1080,
- &BMP180,
- &BMP280,
- &BME280,
- &MAX31855};
+static const SensorType* sensorTypes[] = {&DHT11, &DHT12_SW, &DHT20, &DHT21, &DHT22,
+ &Dallas, &AM2320_SW, &AM2320_I2C, &HTU21x, &AHT10,
+ &SHT30, &GXHT30, &LM75, &HDC1080, &BMP180,
+ &BMP280, &BME280, &BME680, &MAX31855, &MAX6675};
const SensorType* unitemp_sensors_getTypeFromInt(uint8_t index) {
if(index > SENSOR_TYPES_COUNT) return NULL;
diff --git a/applications/plugins/unitemp/Sensors.h b/applications/plugins/unitemp/Sensors.h
index 3e4152e33..d2b7c07af 100644
--- a/applications/plugins/unitemp/Sensors.h
+++ b/applications/plugins/unitemp/Sensors.h
@@ -318,8 +318,9 @@ const GPIO*
//DS18x2x
#include "./interfaces/OneWireSensor.h"
#include "./sensors/LM75.h"
-//BMP280, BME280
+//BMP280, BME280, BME680
#include "./sensors/BMx280.h"
+#include "./sensors/BME680.h"
#include "./sensors/AM2320.h"
#include "./sensors/DHT20.h"
#include "./sensors/SHT30.h"
@@ -327,4 +328,5 @@ const GPIO*
#include "./sensors/HTU21x.h"
#include "./sensors/HDC1080.h"
#include "./sensors/MAX31855.h"
+#include "./sensors/MAX6675.h"
#endif
diff --git a/applications/plugins/unitemp/sensors/BME680.c b/applications/plugins/unitemp/sensors/BME680.c
new file mode 100644
index 000000000..397e702cb
--- /dev/null
+++ b/applications/plugins/unitemp/sensors/BME680.c
@@ -0,0 +1,431 @@
+/*
+ Unitemp - Universal temperature reader
+ Copyright (C) 2022-2023 Victor Nikitchuk (https://github.com/quen0n)
+ Contributed by g0gg0 (https://github.com/g3gg0)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+#include "BME680.h"
+
+const SensorType BME680 = {
+ .typename = "BME680",
+ .interface = &I2C,
+ .datatype = UT_TEMPERATURE | UT_HUMIDITY | UT_PRESSURE,
+ .pollingInterval = 500,
+ .allocator = unitemp_BME680_alloc,
+ .mem_releaser = unitemp_BME680_free,
+ .initializer = unitemp_BME680_init,
+ .deinitializer = unitemp_BME680_deinit,
+ .updater = unitemp_BME680_update};
+
+//Интервал обновления калибровочных значений
+#define BOSCH_CAL_UPDATE_INTERVAL 60000
+
+#define BME680_ID 0x61
+
+#define BME680_I2C_ADDR_MIN (0x76 << 1)
+#define BME680_I2C_ADDR_MAX (0x77 << 1)
+
+#define BME680_REG_STATUS 0x1D
+#define BME680_REG_CTRL_MEAS 0x74
+#define BME680_REG_CONFIG 0x75
+#define BME680_REG_CTRL_HUM 0x72
+//Преддескретизация температуры
+#define BME680_TEMP_OVERSAMPLING_SKIP 0b00000000
+#define BME680_TEMP_OVERSAMPLING_1 0b00100000
+#define BME680_TEMP_OVERSAMPLING_2 0b01000000
+#define BME680_TEMP_OVERSAMPLING_4 0b01100000
+#define BME680_TEMP_OVERSAMPLING_8 0b10000000
+#define BME680_TEMP_OVERSAMPLING_16 0b10100000
+//Преддескретизация давления
+#define BME680_PRESS_OVERSAMPLING_SKIP 0b00000000
+#define BME680_PRESS_OVERSAMPLING_1 0b00000100
+#define BME680_PRESS_OVERSAMPLING_2 0b00001000
+#define BME680_PRESS_OVERSAMPLING_4 0b00001100
+#define BME680_PRESS_OVERSAMPLING_8 0b00010000
+#define BME680_PRESS_OVERSAMPLING_16 0b00010100
+//Преддескретизация влажности
+#define BME680_HUM_OVERSAMPLING_SKIP 0b00000000
+#define BME680_HUM_OVERSAMPLING_1 0b00000001
+#define BME680_HUM_OVERSAMPLING_2 0b00000010
+#define BME680_HUM_OVERSAMPLING_4 0b00000011
+#define BME680_HUM_OVERSAMPLING_8 0b00000100
+#define BME680_HUM_OVERSAMPLING_16 0b00000101
+//Режимы работы датчика
+#define BME680_MODE_SLEEP 0b00000000 //Наелся и спит
+#define BME680_MODE_FORCED 0b00000001 //Обновляет значения 1 раз, после чего уходит в сон
+//Коэффициент фильтрации значений
+#define BME680_FILTER_COEFF_1 0b00000000
+#define BME680_FILTER_COEFF_2 0b00000100
+#define BME680_FILTER_COEFF_4 0b00001000
+#define BME680_FILTER_COEFF_8 0b00001100
+#define BME680_FILTER_COEFF_16 0b00010000
+//Разрешить работу по SPI
+#define BME680_SPI_3W_ENABLE 0b00000001
+#define BME680_SPI_3W_DISABLE 0b00000000
+
+/* https://github.com/boschsensortec/BME680_driver/blob/master/bme680.c or
+ https://github.com/boschsensortec/BME68x-Sensor-API */
+static float BME680_compensate_temperature(I2CSensor* i2c_sensor, int32_t temp_adc) {
+ BME680_instance* bme680_instance = (BME680_instance*)i2c_sensor->sensorInstance;
+ float var1 = 0;
+ float var2 = 0;
+ float calc_temp = 0;
+
+ /* calculate var1 data */
+ var1 =
+ ((((float)temp_adc / 16384.0f) - ((float)bme680_instance->temp_cal.dig_T1 / 1024.0f)) *
+ ((float)bme680_instance->temp_cal.dig_T2));
+
+ /* calculate var2 data */
+ var2 =
+ (((((float)temp_adc / 131072.0f) - ((float)bme680_instance->temp_cal.dig_T1 / 8192.0f)) *
+ (((float)temp_adc / 131072.0f) - ((float)bme680_instance->temp_cal.dig_T1 / 8192.0f))) *
+ ((float)bme680_instance->temp_cal.dig_T3 * 16.0f));
+
+ /* t_fine value*/
+ bme680_instance->t_fine = (var1 + var2);
+
+ /* compensated temperature data*/
+ calc_temp = ((bme680_instance->t_fine) / 5120.0f);
+
+ return calc_temp;
+}
+
+static float BME680_compensate_pressure(I2CSensor* i2c_sensor, int32_t pres_adc) {
+ BME680_instance* bme680_instance = (BME680_instance*)i2c_sensor->sensorInstance;
+
+ float var1;
+ float var2;
+ float var3;
+ float calc_pres;
+
+ var1 = (((float)bme680_instance->t_fine / 2.0f) - 64000.0f);
+ var2 = var1 * var1 * (((float)bme680_instance->press_cal.dig_P6) / (131072.0f));
+ var2 = var2 + (var1 * ((float)bme680_instance->press_cal.dig_P5) * 2.0f);
+ var2 = (var2 / 4.0f) + (((float)bme680_instance->press_cal.dig_P4) * 65536.0f);
+ var1 =
+ (((((float)bme680_instance->press_cal.dig_P3 * var1 * var1) / 16384.0f) +
+ ((float)bme680_instance->press_cal.dig_P2 * var1)) /
+ 524288.0f);
+ var1 = ((1.0f + (var1 / 32768.0f)) * ((float)bme680_instance->press_cal.dig_P1));
+ calc_pres = (1048576.0f - ((float)pres_adc));
+
+ /* Avoid exception caused by division by zero */
+ if((int)var1 != 0) {
+ calc_pres = (((calc_pres - (var2 / 4096.0f)) * 6250.0f) / var1);
+ var1 =
+ (((float)bme680_instance->press_cal.dig_P9) * calc_pres * calc_pres) / 2147483648.0f;
+ var2 = calc_pres * (((float)bme680_instance->press_cal.dig_P8) / 32768.0f);
+ var3 =
+ ((calc_pres / 256.0f) * (calc_pres / 256.0f) * (calc_pres / 256.0f) *
+ (bme680_instance->press_cal.dig_P10 / 131072.0f));
+ calc_pres =
+ (calc_pres +
+ (var1 + var2 + var3 + ((float)bme680_instance->press_cal.dig_P7 * 128.0f)) / 16.0f);
+ } else {
+ calc_pres = 0;
+ }
+
+ return calc_pres;
+}
+
+static float BME680_compensate_humidity(I2CSensor* i2c_sensor, int32_t hum_adc) {
+ BME680_instance* bme680_instance = (BME680_instance*)i2c_sensor->sensorInstance;
+ float calc_hum;
+ float var1;
+ float var2;
+ float var3;
+ float var4;
+ float temp_comp;
+
+ /* compensated temperature data*/
+ temp_comp = ((bme680_instance->t_fine) / 5120.0f);
+ var1 =
+ (float)((float)hum_adc) - (((float)bme680_instance->hum_cal.dig_H1 * 16.0f) +
+ (((float)bme680_instance->hum_cal.dig_H3 / 2.0f) * temp_comp));
+ var2 = var1 *
+ ((float)(((float)bme680_instance->hum_cal.dig_H2 / 262144.0f) *
+ (1.0f + (((float)bme680_instance->hum_cal.dig_H4 / 16384.0f) * temp_comp) +
+ (((float)bme680_instance->hum_cal.dig_H5 / 1048576.0f) * temp_comp * temp_comp))));
+ var3 = (float)bme680_instance->hum_cal.dig_H6 / 16384.0f;
+ var4 = (float)bme680_instance->hum_cal.dig_H7 / 2097152.0f;
+ calc_hum = var2 + ((var3 + (var4 * temp_comp)) * var2 * var2);
+ if(calc_hum > 100.0f) {
+ calc_hum = 100.0f;
+ } else if(calc_hum < 0.0f) {
+ calc_hum = 0.0f;
+ }
+
+ return calc_hum;
+}
+
+/* https://github.com/boschsensortec/BME680_driver/blob/master/bme680_defs.h */
+#define BME680_COEFF_SIZE UINT8_C(41)
+#define BME680_COEFF_ADDR1_LEN UINT8_C(25)
+#define BME680_COEFF_ADDR2_LEN UINT8_C(16)
+#define BME680_COEFF_ADDR1 UINT8_C(0x89)
+#define BME680_COEFF_ADDR2 UINT8_C(0xe1)
+#define BME680_CONCAT_BYTES(msb, lsb) (((uint16_t)msb << 8) | (uint16_t)lsb)
+#define BME680_T2_LSB_REG (1)
+#define BME680_T2_MSB_REG (2)
+#define BME680_T3_REG (3)
+#define BME680_P1_LSB_REG (5)
+#define BME680_P1_MSB_REG (6)
+#define BME680_P2_LSB_REG (7)
+#define BME680_P2_MSB_REG (8)
+#define BME680_P3_REG (9)
+#define BME680_P4_LSB_REG (11)
+#define BME680_P4_MSB_REG (12)
+#define BME680_P5_LSB_REG (13)
+#define BME680_P5_MSB_REG (14)
+#define BME680_P7_REG (15)
+#define BME680_P6_REG (16)
+#define BME680_P8_LSB_REG (19)
+#define BME680_P8_MSB_REG (20)
+#define BME680_P9_LSB_REG (21)
+#define BME680_P9_MSB_REG (22)
+#define BME680_P10_REG (23)
+#define BME680_H2_MSB_REG (25)
+#define BME680_H2_LSB_REG (26)
+#define BME680_H1_LSB_REG (26)
+#define BME680_H1_MSB_REG (27)
+#define BME680_H3_REG (28)
+#define BME680_H4_REG (29)
+#define BME680_H5_REG (30)
+#define BME680_H6_REG (31)
+#define BME680_H7_REG (32)
+#define BME680_T1_LSB_REG (33)
+#define BME680_T1_MSB_REG (34)
+#define BME680_GH2_LSB_REG (35)
+#define BME680_GH2_MSB_REG (36)
+#define BME680_GH1_REG (37)
+#define BME680_GH3_REG (38)
+#define BME680_HUM_REG_SHIFT_VAL UINT8_C(4)
+#define BME680_BIT_H1_DATA_MSK UINT8_C(0x0F)
+
+static bool BME680_readCalValues(I2CSensor* i2c_sensor) {
+ BME680_instance* bme680_instance = (BME680_instance*)i2c_sensor->sensorInstance;
+ uint8_t coeff_array[BME680_COEFF_SIZE] = {0};
+
+ if(!unitemp_i2c_readRegArray(
+ i2c_sensor, BME680_COEFF_ADDR1, BME680_COEFF_ADDR1_LEN, &coeff_array[0]))
+ return false;
+ if(!unitemp_i2c_readRegArray(
+ i2c_sensor,
+ BME680_COEFF_ADDR2,
+ BME680_COEFF_ADDR2_LEN,
+ &coeff_array[BME680_COEFF_ADDR1_LEN]))
+ return false;
+
+ /* Temperature related coefficients */
+ bme680_instance->temp_cal.dig_T1 = (uint16_t)(BME680_CONCAT_BYTES(
+ coeff_array[BME680_T1_MSB_REG], coeff_array[BME680_T1_LSB_REG]));
+ bme680_instance->temp_cal.dig_T2 = (int16_t)(BME680_CONCAT_BYTES(
+ coeff_array[BME680_T2_MSB_REG], coeff_array[BME680_T2_LSB_REG]));
+ bme680_instance->temp_cal.dig_T3 = (int8_t)(coeff_array[BME680_T3_REG]);
+
+ /* Pressure related coefficients */
+ bme680_instance->press_cal.dig_P1 = (uint16_t)(BME680_CONCAT_BYTES(
+ coeff_array[BME680_P1_MSB_REG], coeff_array[BME680_P1_LSB_REG]));
+ bme680_instance->press_cal.dig_P2 = (int16_t)(BME680_CONCAT_BYTES(
+ coeff_array[BME680_P2_MSB_REG], coeff_array[BME680_P2_LSB_REG]));
+ bme680_instance->press_cal.dig_P3 = (int8_t)coeff_array[BME680_P3_REG];
+ bme680_instance->press_cal.dig_P4 = (int16_t)(BME680_CONCAT_BYTES(
+ coeff_array[BME680_P4_MSB_REG], coeff_array[BME680_P4_LSB_REG]));
+ bme680_instance->press_cal.dig_P5 = (int16_t)(BME680_CONCAT_BYTES(
+ coeff_array[BME680_P5_MSB_REG], coeff_array[BME680_P5_LSB_REG]));
+ bme680_instance->press_cal.dig_P6 = (int8_t)(coeff_array[BME680_P6_REG]);
+ bme680_instance->press_cal.dig_P7 = (int8_t)(coeff_array[BME680_P7_REG]);
+ bme680_instance->press_cal.dig_P8 = (int16_t)(BME680_CONCAT_BYTES(
+ coeff_array[BME680_P8_MSB_REG], coeff_array[BME680_P8_LSB_REG]));
+ bme680_instance->press_cal.dig_P9 = (int16_t)(BME680_CONCAT_BYTES(
+ coeff_array[BME680_P9_MSB_REG], coeff_array[BME680_P9_LSB_REG]));
+ bme680_instance->press_cal.dig_P10 = (uint8_t)(coeff_array[BME680_P10_REG]);
+
+ /* Humidity related coefficients */
+ bme680_instance->hum_cal.dig_H1 =
+ (uint16_t)(((uint16_t)coeff_array[BME680_H1_MSB_REG] << BME680_HUM_REG_SHIFT_VAL) | (coeff_array[BME680_H1_LSB_REG] & BME680_BIT_H1_DATA_MSK));
+ bme680_instance->hum_cal.dig_H2 =
+ (uint16_t)(((uint16_t)coeff_array[BME680_H2_MSB_REG] << BME680_HUM_REG_SHIFT_VAL) | ((coeff_array[BME680_H2_LSB_REG]) >> BME680_HUM_REG_SHIFT_VAL));
+ bme680_instance->hum_cal.dig_H3 = (int8_t)coeff_array[BME680_H3_REG];
+ bme680_instance->hum_cal.dig_H4 = (int8_t)coeff_array[BME680_H4_REG];
+ bme680_instance->hum_cal.dig_H5 = (int8_t)coeff_array[BME680_H5_REG];
+ bme680_instance->hum_cal.dig_H6 = (uint8_t)coeff_array[BME680_H6_REG];
+ bme680_instance->hum_cal.dig_H7 = (int8_t)coeff_array[BME680_H7_REG];
+
+ /* Gas heater related coefficients */
+ bme680_instance->gas_cal.dig_GH1 = (int8_t)coeff_array[BME680_GH1_REG];
+ bme680_instance->gas_cal.dig_GH2 = (int16_t)(BME680_CONCAT_BYTES(
+ coeff_array[BME680_GH2_MSB_REG], coeff_array[BME680_GH2_LSB_REG]));
+ bme680_instance->gas_cal.dig_GH3 = (int8_t)coeff_array[BME680_GH3_REG];
+
+#ifdef UNITEMP_DEBUG
+ FURI_LOG_D(
+ APP_NAME,
+ "Sensor BME680 T1-T3: %d, %d, %d",
+ bme680_instance->temp_cal.dig_T1,
+ bme680_instance->temp_cal.dig_T2,
+ bme680_instance->temp_cal.dig_T3);
+
+ FURI_LOG_D(
+ APP_NAME,
+ "Sensor BME680: P1-P10: %d, %d, %d, %d, %d, %d, %d, %d, %d, %d",
+ bme680_instance->press_cal.dig_P1,
+ bme680_instance->press_cal.dig_P2,
+ bme680_instance->press_cal.dig_P3,
+ bme680_instance->press_cal.dig_P4,
+ bme680_instance->press_cal.dig_P5,
+ bme680_instance->press_cal.dig_P6,
+ bme680_instance->press_cal.dig_P7,
+ bme680_instance->press_cal.dig_P8,
+ bme680_instance->press_cal.dig_P9,
+ bme680_instance->press_cal.dig_P10);
+
+ FURI_LOG_D(
+ APP_NAME,
+ "Sensor BME680: H1-H7: %d, %d, %d, %d, %d, %d, %d",
+ bme680_instance->hum_cal.dig_H1,
+ bme680_instance->hum_cal.dig_H2,
+ bme680_instance->hum_cal.dig_H3,
+ bme680_instance->hum_cal.dig_H4,
+ bme680_instance->hum_cal.dig_H5,
+ bme680_instance->hum_cal.dig_H6,
+ bme680_instance->hum_cal.dig_H7);
+
+ FURI_LOG_D(
+ APP_NAME,
+ "Sensor BME680 GH1-GH3: %d, %d, %d",
+ bme680_instance->gas_cal.dig_GH1,
+ bme680_instance->gas_cal.dig_GH2,
+ bme680_instance->gas_cal.dig_GH3);
+
+#endif
+
+ bme680_instance->last_cal_update_time = furi_get_tick();
+ return true;
+}
+static bool BME680_isMeasuring(Sensor* sensor) {
+ I2CSensor* i2c_sensor = (I2CSensor*)sensor->instance;
+ return (bool)(unitemp_i2c_readReg(i2c_sensor, BME680_REG_STATUS) & 0x20);
+}
+
+bool unitemp_BME680_alloc(Sensor* sensor, char* args) {
+ UNUSED(args);
+ I2CSensor* i2c_sensor = (I2CSensor*)sensor->instance;
+ BME680_instance* bme680_instance = malloc(sizeof(BME680_instance));
+ if(bme680_instance == NULL) {
+ FURI_LOG_E(APP_NAME, "Failed to allocation sensor %s instance", sensor->name);
+ return false;
+ }
+
+ if(sensor->type == &BME680) bme680_instance->chip_id = BME680_ID;
+
+ i2c_sensor->sensorInstance = bme680_instance;
+
+ i2c_sensor->minI2CAdr = BME680_I2C_ADDR_MIN;
+ i2c_sensor->maxI2CAdr = BME680_I2C_ADDR_MAX;
+ return true;
+}
+
+bool unitemp_BME680_init(Sensor* sensor) {
+ I2CSensor* i2c_sensor = (I2CSensor*)sensor->instance;
+ //Перезагрузка
+ unitemp_i2c_writeReg(i2c_sensor, 0xE0, 0xB6);
+ //Чтение ID датчика
+ uint8_t id = unitemp_i2c_readReg(i2c_sensor, 0xD0);
+ if(id != BME680_ID) {
+ FURI_LOG_E(
+ APP_NAME,
+ "Sensor %s returned wrong ID 0x%02X, expected 0x%02X",
+ sensor->name,
+ id,
+ BME680_ID);
+ return false;
+ }
+
+ unitemp_i2c_writeReg(
+ i2c_sensor,
+ BME680_REG_CTRL_HUM,
+ (unitemp_i2c_readReg(i2c_sensor, BME680_REG_CTRL_HUM) & ~7) | BME680_HUM_OVERSAMPLING_1);
+ unitemp_i2c_writeReg(
+ i2c_sensor,
+ BME680_REG_CTRL_MEAS,
+ BME680_TEMP_OVERSAMPLING_2 | BME680_PRESS_OVERSAMPLING_4 | BME680_MODE_FORCED);
+ //Настройка периода опроса и фильтрации значений
+ unitemp_i2c_writeReg(
+ i2c_sensor, BME680_REG_CONFIG, BME680_FILTER_COEFF_16 | BME680_SPI_3W_DISABLE);
+ //Чтение калибровочных значений
+ if(!BME680_readCalValues(i2c_sensor)) {
+ FURI_LOG_E(APP_NAME, "Failed to read calibration values sensor %s", sensor->name);
+ return false;
+ }
+ return true;
+}
+
+bool unitemp_BME680_deinit(Sensor* sensor) {
+ I2CSensor* i2c_sensor = (I2CSensor*)sensor->instance;
+ //Перевод в сон
+ unitemp_i2c_writeReg(i2c_sensor, BME680_REG_CTRL_MEAS, BME680_MODE_SLEEP);
+ return true;
+}
+
+UnitempStatus unitemp_BME680_update(Sensor* sensor) {
+ I2CSensor* i2c_sensor = (I2CSensor*)sensor->instance;
+ BME680_instance* instance = i2c_sensor->sensorInstance;
+
+ uint32_t t = furi_get_tick();
+
+ uint8_t buff[3];
+ //Проверка инициализированности датчика
+ unitemp_i2c_readRegArray(i2c_sensor, 0xF4, 2, buff);
+ if(buff[0] == 0) {
+ FURI_LOG_W(APP_NAME, "Sensor %s is not initialized!", sensor->name);
+ return UT_SENSORSTATUS_ERROR;
+ }
+
+ unitemp_i2c_writeReg(
+ i2c_sensor,
+ BME680_REG_CTRL_MEAS,
+ unitemp_i2c_readReg(i2c_sensor, BME680_REG_CTRL_MEAS) | 1);
+
+ while(BME680_isMeasuring(sensor)) {
+ if(furi_get_tick() - t > 100) {
+ return UT_SENSORSTATUS_TIMEOUT;
+ }
+ }
+
+ if(furi_get_tick() - instance->last_cal_update_time > BOSCH_CAL_UPDATE_INTERVAL) {
+ BME680_readCalValues(i2c_sensor);
+ }
+
+ if(!unitemp_i2c_readRegArray(i2c_sensor, 0x1F, 3, buff)) return UT_SENSORSTATUS_TIMEOUT;
+ int32_t adc_P = ((int32_t)buff[0] << 12) | ((int32_t)buff[1] << 4) | ((int32_t)buff[2] >> 4);
+ if(!unitemp_i2c_readRegArray(i2c_sensor, 0x22, 3, buff)) return UT_SENSORSTATUS_TIMEOUT;
+ int32_t adc_T = ((int32_t)buff[0] << 12) | ((int32_t)buff[1] << 4) | ((int32_t)buff[2] >> 4);
+ if(!unitemp_i2c_readRegArray(i2c_sensor, 0x25, 2, buff)) return UT_SENSORSTATUS_TIMEOUT;
+ int32_t adc_H = ((uint16_t)buff[0] << 8) | buff[1];
+
+ sensor->temp = BME680_compensate_temperature(i2c_sensor, adc_T);
+ sensor->pressure = BME680_compensate_pressure(i2c_sensor, adc_P);
+ sensor->hum = BME680_compensate_humidity(i2c_sensor, adc_H);
+
+ return UT_SENSORSTATUS_OK;
+}
+
+bool unitemp_BME680_free(Sensor* sensor) {
+ I2CSensor* i2c_sensor = (I2CSensor*)sensor->instance;
+ free(i2c_sensor->sensorInstance);
+ return true;
+}
\ No newline at end of file
diff --git a/applications/plugins/unitemp/sensors/BME680.h b/applications/plugins/unitemp/sensors/BME680.h
new file mode 100644
index 000000000..b126c7c84
--- /dev/null
+++ b/applications/plugins/unitemp/sensors/BME680.h
@@ -0,0 +1,112 @@
+/*
+ Unitemp - Universal temperature reader
+ Copyright (C) 2022-2023 Victor Nikitchuk (https://github.com/quen0n)
+ Contributed by g0gg0 (https://github.com/g3gg0)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+#ifndef UNITEMP_BME680
+#define UNITEMP_BME680
+
+#include "../unitemp.h"
+#include "../Sensors.h"
+#include "../interfaces/I2CSensor.h"
+
+typedef struct {
+ uint16_t dig_T1;
+ int16_t dig_T2;
+ int16_t dig_T3;
+} BME680_temp_cal;
+
+typedef struct {
+ uint16_t dig_GH1;
+ int16_t dig_GH2;
+ int16_t dig_GH3;
+} BME680_gas_cal;
+
+typedef struct {
+ uint16_t dig_P1;
+ int16_t dig_P2;
+ int16_t dig_P3;
+ int16_t dig_P4;
+ int16_t dig_P5;
+ int16_t dig_P6;
+ int16_t dig_P7;
+ int16_t dig_P8;
+ int16_t dig_P9;
+ int16_t dig_P10;
+} BME680_press_cal;
+
+typedef struct {
+ uint16_t dig_H1;
+ uint16_t dig_H2;
+ int8_t dig_H3;
+ int8_t dig_H4;
+ int8_t dig_H5;
+ uint8_t dig_H6;
+ int8_t dig_H7;
+} BME680_hum_cal;
+
+typedef struct {
+ //Калибровочные значения температуры
+ BME680_temp_cal temp_cal;
+ //Калибровочные значения давления
+ BME680_press_cal press_cal;
+ //Калибровочные значения влажности воздуха
+ BME680_hum_cal hum_cal;
+ BME680_gas_cal gas_cal;
+ //Время последнего обновления калибровочных значений
+ uint32_t last_cal_update_time;
+ //Индификатор датчика
+ uint8_t chip_id;
+ //Корректировочное значение температуры
+ int32_t t_fine;
+} BME680_instance;
+
+extern const SensorType BMP280;
+extern const SensorType BME680;
+/**
+ * @brief Выделение памяти и установка начальных значений датчика BMP280
+ * @param sensor Указатель на создаваемый датчик
+ * @return Истина при успехе
+ */
+bool unitemp_BME680_alloc(Sensor* sensor, char* args);
+
+/**
+ * @brief Инициализации датчика BMP280
+ * @param sensor Указатель на датчик
+ * @return Истина если инициализация упспешная
+ */
+bool unitemp_BME680_init(Sensor* sensor);
+
+/**
+ * @brief Деинициализация датчика
+ * @param sensor Указатель на датчик
+ */
+bool unitemp_BME680_deinit(Sensor* sensor);
+
+/**
+ * @brief Обновление значений из датчика
+ * @param sensor Указатель на датчик
+ * @return Статус опроса датчика
+ */
+UnitempStatus unitemp_BME680_update(Sensor* sensor);
+
+/**
+ * @brief Высвободить память датчика
+ * @param sensor Указатель на датчик
+ */
+bool unitemp_BME680_free(Sensor* sensor);
+
+#endif
\ No newline at end of file
diff --git a/applications/plugins/unitemp/sensors/MAX6675.c b/applications/plugins/unitemp/sensors/MAX6675.c
new file mode 100644
index 000000000..e97a96eb5
--- /dev/null
+++ b/applications/plugins/unitemp/sensors/MAX6675.c
@@ -0,0 +1,81 @@
+/*
+ Unitemp - Universal temperature reader
+ Copyright (C) 2022-2023 Victor Nikitchuk (https://github.com/quen0n)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+#include "MAX6675.h"
+
+const SensorType MAX6675 = {
+ .typename = "MAX6675",
+ .altname = "MAX6675 (Thermocouple)",
+ .interface = &SPI,
+ .datatype = UT_TEMPERATURE,
+ .pollingInterval = 500,
+ .allocator = unitemp_MAX6675_alloc,
+ .mem_releaser = unitemp_MAX6675_free,
+ .initializer = unitemp_MAX6675_init,
+ .deinitializer = unitemp_MAX6675_deinit,
+ .updater = unitemp_MAX6675_update};
+
+bool unitemp_MAX6675_alloc(Sensor* sensor, char* args) {
+ UNUSED(sensor);
+ UNUSED(args);
+ return true;
+}
+
+bool unitemp_MAX6675_free(Sensor* sensor) {
+ UNUSED(sensor);
+ return true;
+}
+
+bool unitemp_MAX6675_init(Sensor* sensor) {
+ SPISensor* instance = sensor->instance;
+ furi_hal_spi_bus_handle_init(instance->spi);
+ UNUSED(instance);
+ return true;
+}
+
+bool unitemp_MAX6675_deinit(Sensor* sensor) {
+ UNUSED(sensor);
+ return true;
+}
+
+UnitempStatus unitemp_MAX6675_update(Sensor* sensor) {
+ SPISensor* instance = sensor->instance;
+
+ furi_hal_spi_acquire(instance->spi);
+ furi_hal_gpio_write(instance->CS_pin->pin, false);
+
+ uint8_t buff[2] = {0};
+
+ furi_hal_spi_bus_rx(instance->spi, buff, 2, 0xFF);
+ furi_hal_spi_release(instance->spi);
+
+ uint32_t raw = (buff[0] << 8) | buff[1];
+
+ if(raw == 0xFFFFFFFF || raw == 0) return UT_SENSORSTATUS_TIMEOUT;
+
+ //Определение состояния термопары
+ uint8_t state = raw & 0b100;
+ //Обрыв
+ if(state == 0b100) {
+ UNITEMP_DEBUG("%s has thermocouple open circuit", sensor->name);
+ return UT_SENSORSTATUS_ERROR;
+ }
+
+ sensor->temp = (int16_t)(raw) / 32.0f;
+
+ return UT_SENSORSTATUS_OK;
+}
diff --git a/applications/plugins/unitemp/sensors/MAX6675.h b/applications/plugins/unitemp/sensors/MAX6675.h
new file mode 100644
index 000000000..cce346590
--- /dev/null
+++ b/applications/plugins/unitemp/sensors/MAX6675.h
@@ -0,0 +1,65 @@
+/*
+ Unitemp - Universal temperature reader
+ Copyright (C) 2022-2023 Victor Nikitchuk (https://github.com/quen0n)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+#ifndef UNITEMP_MAX6675
+#define UNITEMP_MAX6675
+
+#include "../unitemp.h"
+#include "../Sensors.h"
+#include "../interfaces/SPISensor.h"
+
+extern const SensorType MAX6675;
+
+/**
+ * @brief Выделение памяти и установка начальных значений датчика MAX6675
+ *
+ * @param sensor Указатель на создаваемый датчик
+ * @return Истина при успехе
+ */
+bool unitemp_MAX6675_alloc(Sensor* sensor, char* args);
+
+/**
+ * @brief Инициализации датчика MAX6675
+ *
+ * @param sensor Указатель на датчик
+ * @return Истина если инициализация упспешная
+ */
+bool unitemp_MAX6675_init(Sensor* sensor);
+
+/**
+ * @brief Деинициализация датчика
+ *
+ * @param sensor Указатель на датчик
+ */
+bool unitemp_MAX6675_deinit(Sensor* sensor);
+
+/**
+ * @brief Обновление значений из датчика
+ *
+ * @param sensor Указатель на датчик
+ * @return Статус обновления
+ */
+UnitempStatus unitemp_MAX6675_update(Sensor* sensor);
+
+/**
+ * @brief Высвободить память датчика
+ *
+ * @param sensor Указатель на датчик
+ */
+bool unitemp_MAX6675_free(Sensor* sensor);
+
+#endif
\ No newline at end of file
diff --git a/applications/plugins/unitemp/sensors/Sensors.xlsx b/appl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af4tB7?;e_??FKu$SuvQfNUzHQUwH7-
zLAw=(@5e4G{rD|Lr~EW)DlD&!yVBr*Qzp29a+H?&6Cj0jabT-wum6>J8~XA`R4W^J
z5QT?9+bu`!7kmt(U!KZCKUm#fzwE5st_&?t8N*%|i$er!p5OSD9A|n-HuwkC_NcBP
z_5nZvpU)`%U3fcIIV6n#{II38b0{NcU;qFqDj4J`eq4AI|C_b{oBIB{jHak@vQqws
z7ytkW{=4lTrIsiqgOh>c|K4-{)5kDnfs>l@|EAXew3pJP5OBRk#A8S~U|{&`3=1Og
vP0G<5=9Hy5CDK!L;&D#QvRPM<$+5Av4AB-gq!x2{ol_90O0=tk1CLu
diff --git a/applications/plugins/unitemp/unitemp.h b/applications/plugins/unitemp/unitemp.h
index bcb2e4ac9..bde8b0c17 100644
--- a/applications/plugins/unitemp/unitemp.h
+++ b/applications/plugins/unitemp/unitemp.h
@@ -40,7 +40,7 @@
//Имя приложения
#define APP_NAME "Unitemp"
//Версия приложения
-#define UNITEMP_APP_VER "1.1.2-dev"
+#define UNITEMP_APP_VER "1.2"
//Путь хранения файлов плагина
#define APP_PATH_FOLDER "/ext/unitemp"
//Имя файла с настройками