u_main.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. #ifndef __U_MAIN_H_
  2. #define __U_MAIN_H_
  3. #include "u_global.h"
  4. typedef struct //_light_para
  5. {
  6. uint8_t save_flag;
  7. uint8_t power_st;
  8. uint8_t app_mode[2];
  9. uint8_t app_seting;
  10. uint8_t rc_mode;
  11. uint8_t rhythm_mode;
  12. uint8_t effect;
  13. uint8_t app_effect;
  14. uint8_t bright; //1 - 100 亮度递增
  15. int8_t speed; //1 - 10 递减
  16. int8_t app_speed; //1 - 100 递增
  17. //uint8_t saturation;
  18. uint8_t clr_temp[4];
  19. uint8_t rgb_order[3];
  20. //uint32_t one_rhythm_clr;
  21. uint8_t rhythm_sensit; //0 - 50递减
  22. //uint8_t rhythm_speed[2]; //1 - 10 递减
  23. uint8_t mic;
  24. uint8_t mic_AppOrDriver; //APP=0;Driver=1;
  25. }LightPara_t;
  26. enum //timeing
  27. {
  28. TIMER_TIME_GLO_TASK = (20),
  29. TIMER_TIME_LIGHT_EFFECT = (20),
  30. TIMER_TIME_RHYTHM = (10),
  31. TIMER_TIME_LIGHT_TIME = (1000),
  32. TIMER_TIME_FLASH_SAVE = (2000),
  33. TIMER_TIME_POWER_CHECK = (1000),
  34. TIMER_TIME_LIGHT_TEST = (500),
  35. };
  36. enum //_light_mode
  37. {
  38. LIGHT_APP_MODE_WHITE_LIGHT = 0,
  39. LIGHT_APP_MODE_COLORUR,
  40. LIGHT_APP_MODE_S_RED,
  41. LIGHT_APP_MODE_S_BLUE,
  42. LIGHT_APP_MODE_S_GREEN,
  43. LIGHT_APP_MODE_S_CYAN,
  44. LIGHT_APP_MODE_S_YELLOW,
  45. LIGHT_APP_MODE_S_PURPLE,
  46. LIGHT_APP_MODE_S_WHITE,
  47. LIGHT_APP_MODE_JUMP_3,
  48. LIGHT_APP_MODE_JUMP_7,
  49. LIGHT_APP_MODE_FADE_3,
  50. LIGHT_APP_MODE_FADE_7,
  51. LIGHT_APP_MODE_BREATH_RED,
  52. LIGHT_APP_MODE_BREATH_BLUE,
  53. LIGHT_APP_MODE_BREATH_GREEN,
  54. LIGHT_APP_MODE_BREATH_YELLOW,
  55. LIGHT_APP_MODE_BREATH_CYAN,
  56. LIGHT_APP_MODE_BREATH_PURPLE,
  57. LIGHT_APP_MODE_BREATH_WHITE,
  58. LIGHT_APP_MODE_FADE_RG,
  59. LIGHT_APP_MODE_FADE_RB,
  60. LIGHT_APP_MODE_FADE_GB,
  61. LIGHT_APP_MODE_BLINK_7,
  62. LIGHT_APP_MODE_BLINK_RED,
  63. LIGHT_APP_MODE_BLINK_GREEN,
  64. LIGHT_APP_MODE_BLINK_BLUE,
  65. LIGHT_APP_MODE_BLINK_YELLOW,
  66. LIGHT_APP_MODE_BLINK_CYAN,
  67. LIGHT_APP_MODE_BLINK_PURPLE,
  68. LIGHT_APP_MODE_BLINK_WHITE,
  69. LIGHT_APP_MODE_RHYTHM_DRIVER = 0xA0,
  70. LIGHT_APP_MODE_RHYTHM_APP = 0xA1,
  71. LIGHT_APP_MODE_RHYTHM_MUSIC = 0xB0,
  72. LIGHT_APP_MODE_SCENE_MIN = 0xC0,
  73. LIGHT_APP_MODE_GOODNIGHT = LIGHT_APP_MODE_SCENE_MIN,
  74. LIGHT_APP_MODE_READ,
  75. LIGHT_APP_MODE_WORD,
  76. LIGHT_APP_MODE_COLORFUL, //缤纷
  77. LIGHT_APP_MODE_DAZZLING, //炫彩
  78. LIGHT_APP_MODE_MULT, //斑斓
  79. LIGHT_APP_MODE_FLAME, //火焰
  80. LIGHT_APP_MODE_BLINK, //闪动
  81. LIGHT_APP_MODE_SHOW, //灯光秀
  82. LIGHT_APP_MODE_SCENE_MAX = LIGHT_APP_MODE_SHOW,
  83. LIGHT_APP_MODE_RC_MIN = 0xD0,
  84. LIGHT_APP_MODE_RC_STATIC = LIGHT_APP_MODE_RC_MIN,
  85. LIGHT_APP_MODE_RC_DYNAMIC = 0xD1,
  86. };
  87. enum //_sundry
  88. {
  89. // APP_MODE_SCENE_MAX_NUM = 4,
  90. // APP_MODE_CLR_MAX_NUM = 8,
  91. LIGHT_IC_NUM_MAX = 100,
  92. LIGHT_DEF_SPEED = 3,
  93. LIGHT_DEF_SENSIT = 8,
  94. APP_SENSIT_K = 2,
  95. LIGHT_SENSIT_MIN = 0,
  96. LIGHT_SENSIT_MAX = 50,
  97. APP_SPEED_K = 10,
  98. LIGHT_SPEED_MIN = 1,
  99. LIGHT_SPEED_MAX = 10,
  100. LIGHT_APP_SPEED_MIN = 1,
  101. LIGHT_APP_SPEED_MAX = 100,
  102. LIGHT_BRIGHT_MIN_MIN = 2,
  103. LIGHT_BRIGHT_MIN = 10,
  104. LIGHT_BRIGHT_MAX = 100,
  105. DIY_SCENE_ID_MIN = 50,
  106. APP_DIY_SCENE_NUM_MAX = 8,
  107. DIY_SCENE_ID_MAX = DIY_SCENE_ID_MIN + APP_DIY_SCENE_NUM_MAX,
  108. DIY_DEF_CLR = 0xFFFFFF,
  109. };
  110. extern LightPara_t g_light_para;
  111. void u_gapc_connection_cd(void);
  112. void u_gapc_disconnect_cd(uint8_t reason);
  113. void u_init(void);
  114. void u_while(void);
  115. void u_rhythm_timer_ctrl(uint8_t timer_en);
  116. void light_time_timer_start(void);
  117. void light_effect_timer_start(uint16_t timing);
  118. void light_effect_timer_stop(void);
  119. void count_down_reach_cb(uint8_t execute_st);
  120. void alarm_time_reach_cb(uint8_t execute_st);
  121. #endif