soft_flow.h 1.8 KB

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