| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- /*
- * Copyright (c) 2006-2021, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date Author Notes
- * 2024-08-16 RuoFeng the first version
- */
- #ifndef APPLICATIONS_WORK_XCT_H_
- #define APPLICATIONS_WORK_XCT_H_
- /*********************↓ define ↓************************/
- #define Luxlimit_def 300 // 光控阈值
- #define tempup_def 50 // 温度上限
- #define tempdw_def 10 // 温度下限
- #define humiup_def 100 // 温度上限
- #define humidw_def 0 // 温度上限
- #define gktime_def 3 // 默认光控时长
- #define TakeINR 30 // mins 默认的拍照间隔
- /* 拍照定时参数默认值与取值范围 */
- #define PHO_INR_DAY_MIN 1 // 拍照间隔天数 最小值
- #define PHO_INR_DAY_MAX 7 // 拍照间隔天数 最大值
- #define PHO_INR_DAY_DEF 1 // 默认间隔天数(1天)
- #define PHO_T_HOUR_DEF 21 // 默认拍照时刻-时(21点)
- #define PHO_T_MIN_DEF 0 // 默认拍照时刻-分(整点)
- /*********************↑ define ↑************************/
- /**
- *
- *
- *
- *
- * */
- /*********************↓ include ↓************************/
- #include "stm32f1xx_hal.h"
- /*********************↑ include ↑************************/
- /**
- *
- *
- *
- *
- * */
- /*********************↓ extern ↓************************/
- /*********************↑ extern ↑************************/
- /**
- *
- *
- *
- *
- * */
- /********************↓ declaration ↓***********************/
- typedef struct
- {
- uint8_t temhumEN;
- uint8_t LuxEN;
- uint8_t RainEN;
- int16_t temp_up;
- int16_t temp_dw;
- int16_t humi_up;
- int16_t humi_dw;
- uint8_t LuxTime;
- }Limit;
- typedef struct
- {
- uint8_t start_work; // 是否开始工作
- RTC_TimeTypeDef start_time; // 开始工作时间
- uint16_t lux_set; // 出发光控的阈值
- uint8_t Read; // 是否读取了参数
- } Luxwork;
- typedef struct
- {
- uint8_t en_tigmode; // 工作模式
- uint8_t fan_speed; // 风机速度(10-100)
- uint8_t Demo_mode; // 演示模式
- uint32_t Demo_cnt; // 演示模式计数
- uint8_t photo_finsh; // 拍照完成
- uint8_t not_poweroff; // 拍照呢 别断电
- uint8_t rtu_sta; // 是否正常的开机就绪了
- uint16_t dattim;
- uint16_t photim;
- uint8_t pho_inr_day; // 拍照间隔天数 1-7(0=未配置, 开机校验后置默认)
- uint8_t pho_t_hour; // 拍照时刻-时 0-23
- uint8_t pho_t_min; // 拍照时刻-分 0-59
- }SYSCFG;
- void WorkTask_TN(void);
- struct tmm
- {
- int tm_sec;
- int tm_min;
- int tm_hour;
- int tm_mday;
- int tm_mon;
- int tm_year;
- int tm_wday;
- int tm_yday;
- int tm_isdst;
- #ifdef __TM_GMTOFF
- long __TM_GMTOFF;
- #endif
- #ifdef __TM_ZONE
- const char *__TM_ZONE;
- #endif
- };
- uint32_t math_timestampe_NEW(uint32_t *tim);
- void recode_timestampe_NEW(uint32_t *tim);
- void ctr_RTU_DTU(uint8_t status_rtu);
- uint8_t Check_Photo_Trigger(void); // 是否到达拍照触发时刻(间隔N天+指定时分)
- uint8_t Check_Photo_Near(void); // 是否接近拍照触发时刻(保持RTU上电用)
- void Check_Photo_Param_Valid(void); // 拍照参数合法性校验(非法/全0恢复默认)
- /********************↑ declaration ↑***********************/
- /**
- *
- *
- *
- *
- * */
- /*********************↓ global variables ↓************************/
- /*********************↑ global variables ↑************************/
- /**
- *
- *
- *
- *
- * */
- #endif /* APPLICATIONS_WORK_XCT_H_ */
|