You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.0 KiB

12 months ago
4 weeks ago
12 months ago
4 weeks ago
12 months ago
4 weeks ago
12 months ago
4 weeks ago
12 months ago
4 weeks ago
12 months ago
4 weeks ago
12 months ago
4 weeks ago
12 months ago
  1. #pragma once
  2. #include "base/appdep.hpp"
  3. namespace iflytop {
  4. using namespace transmit_disfection_protocol;
  5. class HeaterController {
  6. ZGPIO m_ctrlGpio;
  7. ZADC m_iAdc;
  8. ZADC m_tempAdc;
  9. bool m_isInitialized = false;
  10. public:
  11. void initialize(Pin_t ctrlGpio, ADC_HandleTypeDef* iadc, uint32_t ich, ADC_HandleTypeDef* tadc, uint32_t tch);
  12. bool isInitialized();
  13. void heater_ctrl(int32_t val);
  14. void heater_ctrl_safe_valve(int32_t val);
  15. int32_t heater_read_temperature_data();
  16. int32_t heater_read_ei();
  17. int32_t heater_read_iadc();
  18. int32_t heater_read_tadc();
  19. // PP
  20. void fn_heater_ctrl(ProcessContext* cxt);
  21. void fn_heater_ctrl_safe_valve(ProcessContext* cxt);
  22. void fn_heater_read_ei(ProcessContext* cxt);
  23. void fn_heater_read_temperature_data(ProcessContext* cxt);
  24. void fn_heater_read_ei_adc_raw(ProcessContext* cxt);
  25. void fn_heater_read_temperature_data_adc_raw(ProcessContext* cxt);
  26. void fn_heater_is_open(ProcessContext* cxt);
  27. private:
  28. void periodTask();
  29. };
  30. } // namespace iflytop