usr_lysis.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. pid_def pid;
  66. unsigned int pwdId;
  67. float cabinTem;
  68. pid_state_def pid_st;
  69. unsigned int pid_stable;
  70. unsigned int pid_stable_time;
  71. thermostat_state_def thermostat_st;
  72. THERMOSTAT_ERR_State eerst;
  73. unsigned int recGoalFlag;
  74. unsigned int firstin;
  75. }lysis_ctr_def;
  76. void updatParm_lysis(void);
  77. void set_lysis(float goal) ;
  78. uint32_t lysis_work(void);
  79. uint32_t Close_lysis_work(void);
  80. uint32_t get_lysis_st(float *temp,unsigned int *st);
  81. /***********************************/
  82. #endif /* USR_HEATER_H_ */