S&B Volcano vaporizer remote control with Pi Pico W
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

volcano.h 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * volcano.h
  3. *
  4. * Copyright (c) 2023 Thomas Buck (thomas@xythobuz.de)
  5. *
  6. * This program is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * See <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef __VOLCANO_H__
  19. #define __VOLCANO_H__
  20. #include <stdint.h>
  21. #include <stdbool.h>
  22. #include "models.h"
  23. #define VOLCANO_FW_LEN 12
  24. enum volcano_state {
  25. VOLCANO_STATE_NONE = 0,
  26. VOLCANO_STATE_HEATER = (1 << 0),
  27. VOLCANO_STATE_PUMP = (1 << 1),
  28. VOLCANO_STATE_INVALID = 0xFF,
  29. };
  30. // returns < 0 on error
  31. int8_t volcano_discover_characteristics(bool wf, bool conf);
  32. // in 1/10th degrees C, or < 0 on error
  33. int16_t volcano_get_current_temp(void);
  34. int16_t volcano_get_target_temp(void);
  35. // v in 1/10th degrees C, returns < 0 on error
  36. int8_t volcano_set_target_temp(uint16_t v);
  37. // returns < 0 on error
  38. int8_t volcano_set_heater_state(bool value);
  39. int8_t volcano_set_pump_state(bool value);
  40. int8_t volcano_set_unit(enum unit unit);
  41. int8_t volcano_set_vibration(bool value);
  42. int8_t volcano_set_display_cooling(bool value);
  43. enum unit volcano_get_unit(void);
  44. enum volcano_state volcano_get_state(void);
  45. // returns bool, or < 0 on error
  46. int8_t volcano_get_vibration(void);
  47. int8_t volcano_get_display_cooling(void);
  48. // returns seconds, or < 0 on error
  49. int16_t volcano_get_auto_shutoff(void);
  50. // v in seconds, returns < 0 on error
  51. int8_t volcano_set_auto_shutoff(uint16_t v);
  52. // returns 0 - 100, or < 0 on error
  53. int8_t volcano_get_brightness(void);
  54. // v in 0 - 100, returns < 0 on error
  55. int8_t volcano_set_brightness(uint8_t v);
  56. // val is filled with VOLCANO_FW_LEN bytes, returns < 0 on error
  57. int8_t volcano_get_firmware(char *val);
  58. // returns minutes, or < 0 on error
  59. int32_t volcano_get_runtime(void);
  60. #endif // __VOLCANO_H__