usr_lysis.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*
  2. * usr_gpio.h
  3. *
  4. * Created on: 2022��4��11��
  5. * Author: amos
  6. */
  7. #ifndef USR_LYSIS_H_
  8. #define USR_LYSIS_H_
  9. #include "van_com_algorithm.h"
  10. /*************************************/
  11. #define TUPE_OPTIC_PORT PF//光开
  12. #define TUPE_OPTIC_PIN BIT5//光开
  13. #define TUPE_OPTIC_INT_CH 5//光开
  14. #define TUPE_OPTIC() (PF5) //按键
  15. #define HEAT_UP_CH_MASK PWM_CH_4_MASK
  16. #define HEAT_UP_CH 4
  17. #define COOL_DOWN_CH_MASK PWM_CH_5_MASK
  18. #define COOL_DOWN_CH 5
  19. #define MOTOR_CHECK_SPEED 60
  20. #define MOTOR_MOVEFORM_OPTIC_TIM 10
  21. #define MOTOR_LOOP_TIM 100
  22. #define MOTOR_SWING_TIM 100
  23. typedef enum {
  24. HEAT_UP = 0,
  25. COOL_DOWN = 1,
  26. }HEAT_DIR;
  27. typedef enum Heat_state {
  28. PID_IDLE,
  29. PID_OVERHEAT,
  30. PID_OVERHEATLAST,
  31. PID_OVERCOOL,
  32. PID_OVERCOOLLAST,
  33. PID_ADJ,
  34. PID_STAB,
  35. PID_ERROR,
  36. } pid_state_def;
  37. typedef enum {
  38. THERMOSTAT_NOR, // 正常
  39. THERMOSTAT_COOL_EER, //制冷坏
  40. THERMOSTAT_HEAT_EER, // 加热坏
  41. THERMOSTAT_SENSER_EER, // 传感器坏
  42. THERMOSTAT_TUBEEXIST_EER, //存在试管
  43. THERMOSTAT_TUBENOEXIST_EER, //不存在试管
  44. } THERMOSTAT_ERR_State;
  45. typedef enum THERMO_state {
  46. THERMOSTAT_PWRON,
  47. THERMOSTAT_CHECK,
  48. THERMOSTAT_WARM,
  49. THERMOSTAT_IDLE,
  50. THERMOSTAT_INSERT,
  51. THERMOSTAT_NOTICE,
  52. THERMOSTAT_WORK,
  53. THERMOSTAT_END,
  54. THERMOSTAT_ERROR,
  55. } thermostat_state_def;
  56. typedef struct
  57. {
  58. float offset;
  59. float overHeat;
  60. float overHeatTime;
  61. float overCool;
  62. float overCoolTime;
  63. float idletemp;
  64. float worktime;
  65. float lastgaol;
  66. pid_def pid;
  67. unsigned int pwdId;
  68. float cabinTem;
  69. pid_state_def pid_st;
  70. unsigned int pid_stable;
  71. unsigned int pid_stable_time;
  72. thermostat_state_def thermostat_st;
  73. THERMOSTAT_ERR_State eerst;
  74. unsigned int recGoalFlag;
  75. unsigned int firstin;
  76. }lysis_ctr_def;
  77. void updatParm_lysis(void);
  78. void set_lysis(float goal) ;
  79. uint32_t lysis_work(void);
  80. uint32_t Close_lysis_work(void);
  81. uint32_t get_lysis_st(float *temp,unsigned int *st);
  82. /***********************************/
  83. #endif /* USR_HEATER_H_ */