extern_param.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. * 2025-12-31 Administrator the first version
  9. */
  10. #ifndef APPLICATIONS_EXTERN_PARAM_H_
  11. #define APPLICATIONS_EXTERN_PARAM_H_
  12. //传感器
  13. typedef struct {
  14. char temperature[8]; //温度
  15. char humidity[8]; //湿度
  16. char ap[8]; //大气压
  17. char lux[8]; //照度
  18. } SensorData;
  19. typedef struct {
  20. uint8_t iSave; //存储标志位
  21. uint8_t dtype; //设备类型?7-孢子仪,3-测报灯
  22. /*测报灯*/
  23. uint8_t heat_sw; //加热开关
  24. uint8_t photo_ws; //拍照
  25. uint8_t power_status; //电源
  26. uint8_t sun_test; //光控测测试标志位
  27. uint8_t heat_status; //加热状态 0-关 1-开
  28. uint8_t lamp_status; //灯管1状态 0-关 1-开
  29. uint8_t lamp1_status; //灯管2状态 0-关 1-开
  30. uint8_t lamp2_status; //灯管3状态 0-关 1-开
  31. uint8_t up_status; //上仓门状态 0-停止 1-打开 2-关闭
  32. uint8_t down_status; //下仓门状态 0-停止 1-打开 2-关闭
  33. uint8_t clear_status; //清扫状态 0-停止 1-开始
  34. uint8_t shake_ws; //震动 0-关 1-开
  35. uint8_t heatvalue; //加热设定温度
  36. } FlashData;
  37. typedef struct ConfigModule {
  38. SensorData sensordata;
  39. } ConfigModule;
  40. // 单例对象声明
  41. extern ConfigModule config;
  42. // 函数声明
  43. void Config_Init(void);
  44. bool Config_Set(ConfigItem item, void* value);
  45. bool Config_Get(ConfigItem item, void* value);
  46. #endif /* APPLICATIONS_EXTERN_PARAM_H_ */