Work_TN.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2024-08-16 RuoFeng the first version
  9. */
  10. #ifndef APPLICATIONS_WORK_XCT_H_
  11. #define APPLICATIONS_WORK_XCT_H_
  12. /*********************↓ define ↓************************/
  13. #define Luxlimit_def 300 // 光控阈值
  14. #define tempup_def 50 // 温度上限
  15. #define tempdw_def 10 // 温度下限
  16. #define humiup_def 100 // 温度上限
  17. #define humidw_def 0 // 温度上限
  18. #define gktime_def 3 // 默认光控时长
  19. #define TakeINR 30 // mins 默认的拍照间隔
  20. /*********************↑ define ↑************************/
  21. /**
  22. *
  23. *
  24. *
  25. *
  26. * */
  27. /*********************↓ include ↓************************/
  28. #include "stm32f1xx_hal.h"
  29. /*********************↑ include ↑************************/
  30. /**
  31. *
  32. *
  33. *
  34. *
  35. * */
  36. /*********************↓ extern ↓************************/
  37. /*********************↑ extern ↑************************/
  38. /**
  39. *
  40. *
  41. *
  42. *
  43. * */
  44. /********************↓ declaration ↓***********************/
  45. typedef struct
  46. {
  47. uint8_t temhumEN;
  48. uint8_t LuxEN;
  49. uint8_t RainEN;
  50. int16_t temp_up;
  51. int16_t temp_dw;
  52. int16_t humi_up;
  53. int16_t humi_dw;
  54. uint8_t LuxTime;
  55. }Limit;
  56. typedef struct
  57. {
  58. uint8_t start_work; // 是否开始工作
  59. RTC_TimeTypeDef start_time; // 开始工作时间
  60. uint16_t lux_set; // 出发光控的阈值
  61. uint8_t Read; // 是否读取了参数
  62. } Luxwork;
  63. typedef struct
  64. {
  65. uint8_t en_tigmode; // 工作模式
  66. uint8_t fan_speed; // 风机速度(10-100)
  67. uint8_t Demo_mode; // 演示模式
  68. uint32_t Demo_cnt; // 演示模式计数
  69. uint8_t photo_finsh; // 拍照完成
  70. uint8_t not_poweroff; // 拍照呢 别断电
  71. uint8_t rtu_sta; // 是否正常的开机就绪了
  72. uint16_t dattim;
  73. uint16_t photim;
  74. }SYSCFG;
  75. void WorkTask_TN(void);
  76. struct tmm
  77. {
  78. int tm_sec;
  79. int tm_min;
  80. int tm_hour;
  81. int tm_mday;
  82. int tm_mon;
  83. int tm_year;
  84. int tm_wday;
  85. int tm_yday;
  86. int tm_isdst;
  87. #ifdef __TM_GMTOFF
  88. long __TM_GMTOFF;
  89. #endif
  90. #ifdef __TM_ZONE
  91. const char *__TM_ZONE;
  92. #endif
  93. };
  94. uint32_t math_timestampe_NEW(uint32_t *tim);
  95. void recode_timestampe_NEW(uint32_t *tim);
  96. void ctr_RTU_DTU(uint8_t status_rtu);
  97. /********************↑ declaration ↑***********************/
  98. /**
  99. *
  100. *
  101. *
  102. *
  103. * */
  104. /*********************↓ global variables ↓************************/
  105. /*********************↑ global variables ↑************************/
  106. /**
  107. *
  108. *
  109. *
  110. *
  111. * */
  112. #endif /* APPLICATIONS_WORK_XCT_H_ */