123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- #ifndef _U_EFFECT_NORMAL_H_
- #define _U_EFFECT_NORMAL_H_
- #include "u_global.h"
- #define BREATH_BRIGHT_STEP_VAL (2)
- typedef struct //light_info
- {
- //uint8_t mode_en;
- uint8_t clr_num_max;
- uint8_t clr_ind;
- uint8_t set_speed; //1 - 10 递减
- uint8_t set_bright; //1 - 100 递增
-
- uint8_t change_cnt;
- uint8_t curr_ind;
- uint16_t clr_temp[3];
- uint8_t clr_buff[8][3]; //light_mode_gradual
-
- uint8_t bright_dir;
- int16_t curr_bright;
- const uint32_t *color_buff; //brkght
-
- uint8_t play_dir;
- int16_t play_ind;
- uint32_t *play_buff; //幻彩播放缓存指针
- uint8_t seg_len; //色块长度
- uint8_t seg_num; //色块数量
- int16_t change_diff[8][3];
- int16_t color_temp[8][3];
- }LightInfo_t;
- typedef struct //_rhythm_param
- {
- uint8_t bright;
- uint8_t clr_ind;
- uint8_t clr_max_num;
- //uint8_t type;
- uint8_t speed;
- //uint8_t *sensit;
- uint8_t vol_value;
- const uint32_t *clr_buff;
- //uint8_t music_mode_ind;
- //uint8_t color_ind; //渐变律动专用
- //uint8_t color_end; //渐变律动专用
-
- uint8_t grad_dir;
- uint8_t grad_first;
- uint8_t grad_r_period; //
- uint8_t grad_g_period; //
- uint8_t grad_b_period; //
- uint8_t grad_refer; //
- uint8_t music_start;
-
- uint16_t clr_temp[3];
- uint8_t color_buff[8][3];
- //uint8_t music_end;
- }RhythmPara_t;
- enum //_light_effect
- {
- LIGHT_EFFECT_NULL = 0,
-
- LIGHT_EFFECT_STATIC,
- LIGHT_EFFECT_JUMP,
- LIGHT_EFFECT_GRADUAL,
- LIGHT_EFFECT_BREATH,
- LIGHT_EFFECT_BLINK,
-
- LIGHT_EFFECT_RHYTHM_MIN,
- LIGHT_EFFECT_RHYTHM_JUMP = LIGHT_EFFECT_RHYTHM_MIN,
- LIGHT_EFFECT_RHYTHM_BREATH,
- LIGHT_EFFECT_RHYTHM_GRADUAL,
-
- LIGHT_EFFECT_RHYTHM_ONE_CLR,
- };
- enum _bright_dir
- {
- BRIGHT_DIR_SUBT = 0,
- BRIGHT_DIR_PLUS = 1,
- };
- extern LightInfo_t g_light_info;
- uint8_t u_fabs(uint8_t x, uint8_t y);
- uint32_t light_color_bright_create(uint32_t light_color, uint8_t bright);
- uint32_t light_color_bright_alter(uint32_t light_color, uint8_t old_bright, uint8_t new_bright);
- void light_mode_jump_timer_cb(LightInfo_t *jump);
- void light_mode_jump_cfg(LightInfo_t *jump, const uint32_t *color_buff, uint8_t color_num, uint8_t speed, uint8_t bright);
- void light_mode_gradual_timer_cb(LightInfo_t *gradual);
- void light_mode_gradual_cfg(LightInfo_t *gradual_cfg, const uint32_t *color_buff, uint8_t color_num, uint8_t speed, uint8_t bright);
- void light_mode_breath_timer_cb(LightInfo_t *breath);
- void light_mode_breath_cfg(LightInfo_t *breath_cfg, const uint32_t *color_buff, uint8_t color_num, uint8_t speed, uint8_t bright);
- void light_mode_blink_timer_cb(LightInfo_t *light_breath);
- void light_mode_blink_cfg(LightInfo_t *blink_cfg, const uint32_t *color_buff, uint8_t color_num, uint8_t switch_ration, uint8_t speed, uint8_t bright);
- void light_mode_static_cfg(LightInfo_t *static_cfg, const uint32_t *color_buff, uint8_t bright);
- void light_rhythm_mode_fade_timer_cb(RhythmPara_t *Grad_Cfg);
- void light_rhythm_mode_fade_cfg(RhythmPara_t *rhythm_gradual_cfg, const uint32_t *color_buff, uint8_t color_num, uint8_t speed);
- void light_rhythm_mode_jump_timer_cb(RhythmPara_t *rhythm_jump);
- void light_rhythm_mode_jump_cfg(RhythmPara_t *rhythm_jump_cfg, const uint32_t *color_buff, uint8_t color_num, uint8_t speed);
- void light_rhythm_mode_one_clr_cfg(RhythmPara_t *one_clr_cfg, const uint32_t *color_buff, uint8_t speed);
- void light_rhythm_mode_one_clr_timer_cb(RhythmPara_t *rhythm_one_clr);
- void light_rhythm_mode_gradual_cfg(RhythmPara_t *gradual_rhythm_cfg, const uint32_t *color_buff, uint8_t color_num, uint8_t speed);
- void light_rhythm_mode_gradual_timer_cb(RhythmPara_t *gradual_rhythm);
- #endif // _U_EFFECT_NORMAL_H_
|