soft_flow.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #ifndef _SOFT_FLOW_H
  2. #define _SOFT_FLOW_H
  3. #include "stdint.h"
  4. #include "stdbool.h"
  5. #include "gpio.h"
  6. #include "common.h"
  7. #define MAXPUMPCLIB_NUM 38
  8. #define CLIB_SPRAY_SPEED 500
  9. #define FlOW_KP 22
  10. #define EXTI_FALL 1
  11. #define EXTI_UP 2
  12. float flow_dete2(void);
  13. float flow_dete3(void);
  14. float flow_dete4(void);
  15. void flow_count_add(uint8_t flow_num,uint8_t exti_status);
  16. void flow_function(void);
  17. void L1L2_GPIO_check(void);
  18. void can_recv_mimor_flow_function(uint32_t CanID, uint8_t data[], uint8_t len);
  19. //extern bool L1_status;
  20. //extern bool L2_status;
  21. #pragma pack(1)
  22. typedef struct
  23. {
  24. uint8_t ch;
  25. uint16_t flow_speed;
  26. uint16_t total_ml;
  27. uint8_t status;
  28. uint8_t circu_time;
  29. uint8_t signal_str;
  30. uint8_t get_k_count;
  31. uint8_t send_k_count;
  32. uint16_t flow_k; //当前K
  33. uint16_t flow_calk;//校准K
  34. char soft_version[2];
  35. char sn[14];
  36. uint16_t last_total_ml;
  37. uint8_t overturn_count;
  38. }mimo_flow;
  39. extern mimo_flow flow_mimo1;
  40. extern mimo_flow flow_mimo2;
  41. #pragma pack()
  42. //霍尔流量计
  43. #pragma pack(1)
  44. typedef struct
  45. {
  46. bool count_flag;
  47. uint32_t time;
  48. uint32_t last_time;
  49. uint32_t irq_count; //单位时间内经过的液体体积
  50. uint32_t irq_last_count;
  51. bool exti_error;
  52. int speed;
  53. bool rising_delay_flag;
  54. bool falling_delay_falg;
  55. uint32_t cal_delay_time;
  56. uint8_t irq_flag;
  57. bool sem_flag;
  58. uint32_t rising_delay_time;
  59. uint32_t falling_delay_time;
  60. }flow_hl;
  61. extern flow_hl flow_dev1;
  62. extern flow_hl flow_dev2;
  63. #pragma pack()
  64. typedef struct
  65. {
  66. uint16_t speed;
  67. uint32_t flow_ml;
  68. uint16_t warn;
  69. }vk_flow;
  70. extern vk_flow flow_vkdev1;
  71. extern vk_flow flow_vkdev2;
  72. extern GPIO_PinState L3_status;
  73. extern GPIO_PinState L4_status;
  74. #endif