DHT20.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. Unitemp - Universal temperature reader
  3. Copyright (C) 2022-2023 Victor Nikitchuk (https://github.com/quen0n)
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <https://www.gnu.org/licenses/>.
  14. */
  15. #ifndef UNITEMP_DHT20
  16. #define UNITEMP_DHT20
  17. #include "../unitemp.h"
  18. #include "../Sensors.h"
  19. extern const SensorType DHT20;
  20. extern const SensorType AHT10;
  21. /**
  22. * @brief Выделение памяти и установка начальных значений датчика DHT20
  23. *
  24. * @param sensor Указатель на создаваемый датчик
  25. * @return Истина при успехе
  26. */
  27. bool unitemp_DHT20_I2C_alloc(Sensor* sensor, char* args);
  28. /**
  29. * @brief Инициализации датчика DHT20
  30. *
  31. * @param sensor Указатель на датчик
  32. * @return Истина если инициализация упспешная
  33. */
  34. bool unitemp_DHT20_init(Sensor* sensor);
  35. /**
  36. * @brief Деинициализация датчика
  37. *
  38. * @param sensor Указатель на датчик
  39. */
  40. bool unitemp_DHT20_I2C_deinit(Sensor* sensor);
  41. /**
  42. * @brief Обновление значений из датчика
  43. *
  44. * @param sensor Указатель на датчик
  45. * @return Статус обновления
  46. */
  47. UnitempStatus unitemp_DHT20_I2C_update(Sensor* sensor);
  48. /**
  49. * @brief Высвободить память датчика
  50. *
  51. * @param sensor Указатель на датчик
  52. */
  53. bool unitemp_DHT20_I2C_free(Sensor* sensor);
  54. #endif