123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- #ifndef __U_MAIN_H_
- #define __U_MAIN_H_
- #include "u_global.h"
- typedef struct //_light_para
- {
- uint8_t save_flag;
-
- uint8_t power_st;
- uint8_t app_mode[2];
- uint8_t app_seting;
- uint8_t rc_mode;
- uint8_t rhythm_mode;
- uint8_t effect;
- uint8_t app_effect;
- uint8_t bright; //1 - 100 亮度递增
- int8_t speed; //1 - 10 递减
- int8_t app_speed; //1 - 100 递增
- //uint8_t saturation;
- uint8_t clr_temp[4];
- uint8_t rgb_order[3];
- //uint32_t one_rhythm_clr;
- uint8_t rhythm_sensit; //0 - 50递减
- //uint8_t rhythm_speed[2]; //1 - 10 递减
-
- uint8_t mic;
- uint8_t mic_AppOrDriver; //APP=0;Driver=1;
- }LightPara_t;
- enum //timeing
- {
- TIMER_TIME_GLO_TASK = (20),
- TIMER_TIME_LIGHT_EFFECT = (20),
- TIMER_TIME_RHYTHM = (10),
- TIMER_TIME_LIGHT_TIME = (1000),
- TIMER_TIME_FLASH_SAVE = (2000),
- TIMER_TIME_POWER_CHECK = (1000),
- TIMER_TIME_LIGHT_TEST = (500),
- };
- enum //_light_mode
- {
- LIGHT_APP_MODE_WHITE_LIGHT = 0,
- LIGHT_APP_MODE_COLORUR,
-
- LIGHT_APP_MODE_S_RED,
- LIGHT_APP_MODE_S_BLUE,
- LIGHT_APP_MODE_S_GREEN,
- LIGHT_APP_MODE_S_CYAN,
- LIGHT_APP_MODE_S_YELLOW,
- LIGHT_APP_MODE_S_PURPLE,
- LIGHT_APP_MODE_S_WHITE,
-
- LIGHT_APP_MODE_JUMP_3,
- LIGHT_APP_MODE_JUMP_7,
- LIGHT_APP_MODE_FADE_3,
- LIGHT_APP_MODE_FADE_7,
-
- LIGHT_APP_MODE_BREATH_RED,
- LIGHT_APP_MODE_BREATH_BLUE,
- LIGHT_APP_MODE_BREATH_GREEN,
- LIGHT_APP_MODE_BREATH_YELLOW,
- LIGHT_APP_MODE_BREATH_CYAN,
- LIGHT_APP_MODE_BREATH_PURPLE,
- LIGHT_APP_MODE_BREATH_WHITE,
-
- LIGHT_APP_MODE_FADE_RG,
- LIGHT_APP_MODE_FADE_RB,
- LIGHT_APP_MODE_FADE_GB,
-
- LIGHT_APP_MODE_BLINK_7,
-
- LIGHT_APP_MODE_BLINK_RED,
- LIGHT_APP_MODE_BLINK_GREEN,
- LIGHT_APP_MODE_BLINK_BLUE,
- LIGHT_APP_MODE_BLINK_YELLOW,
- LIGHT_APP_MODE_BLINK_CYAN,
- LIGHT_APP_MODE_BLINK_PURPLE,
- LIGHT_APP_MODE_BLINK_WHITE,
-
- LIGHT_APP_MODE_RHYTHM_DRIVER = 0xA0,
- LIGHT_APP_MODE_RHYTHM_APP = 0xA1,
- LIGHT_APP_MODE_RHYTHM_MUSIC = 0xB0,
-
- LIGHT_APP_MODE_SCENE_MIN = 0xC0,
- LIGHT_APP_MODE_GOODNIGHT = LIGHT_APP_MODE_SCENE_MIN,
- LIGHT_APP_MODE_READ,
- LIGHT_APP_MODE_WORD,
- LIGHT_APP_MODE_COLORFUL, //缤纷
- LIGHT_APP_MODE_DAZZLING, //炫彩
- LIGHT_APP_MODE_MULT, //斑斓
- LIGHT_APP_MODE_FLAME, //火焰
- LIGHT_APP_MODE_BLINK, //闪动
- LIGHT_APP_MODE_SHOW, //灯光秀
- LIGHT_APP_MODE_SCENE_MAX = LIGHT_APP_MODE_SHOW,
-
- LIGHT_APP_MODE_RC_MIN = 0xD0,
- LIGHT_APP_MODE_RC_STATIC = LIGHT_APP_MODE_RC_MIN,
- LIGHT_APP_MODE_RC_DYNAMIC = 0xD1,
- };
- enum //_sundry
- {
- // APP_MODE_SCENE_MAX_NUM = 4,
- // APP_MODE_CLR_MAX_NUM = 8,
-
- LIGHT_IC_NUM_MAX = 100,
- LIGHT_DEF_SPEED = 3,
-
- LIGHT_DEF_SENSIT = 8,
- APP_SENSIT_K = 2,
- LIGHT_SENSIT_MIN = 0,
- LIGHT_SENSIT_MAX = 50,
-
-
- APP_SPEED_K = 10,
- LIGHT_SPEED_MIN = 1,
- LIGHT_SPEED_MAX = 10,
- LIGHT_APP_SPEED_MIN = 1,
- LIGHT_APP_SPEED_MAX = 100,
-
- LIGHT_BRIGHT_MIN_MIN = 2,
- LIGHT_BRIGHT_MIN = 10,
- LIGHT_BRIGHT_MAX = 100,
-
- DIY_SCENE_ID_MIN = 50,
- APP_DIY_SCENE_NUM_MAX = 8,
- DIY_SCENE_ID_MAX = DIY_SCENE_ID_MIN + APP_DIY_SCENE_NUM_MAX,
-
- DIY_DEF_CLR = 0xFFFFFF,
- };
- extern LightPara_t g_light_para;
- void u_gapc_connection_cd(void);
- void u_gapc_disconnect_cd(uint8_t reason);
- void u_init(void);
- void u_while(void);
- void u_rhythm_timer_ctrl(uint8_t timer_en);
- void light_time_timer_start(void);
- void light_effect_timer_start(uint16_t timing);
- void light_effect_timer_stop(void);
- void count_down_reach_cb(uint8_t execute_st);
- void alarm_time_reach_cb(uint8_t execute_st);
- #endif
|