user_light_adj.h 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. #ifndef __USER_LIGHT_ADJ_H__
  2. #define __USER_LIGHT_ADJ_H__
  3. /*pwm.h: function and macro definition of PWM API , driver level */
  4. /*user_light.h: user interface for light setting, user level*/
  5. /*user_light_adj: API for color changing and lighting effects, user level*/
  6. /*save RGB params to flash when calling light_set_aim*/
  7. #define SAVE_LIGHT_PARAM 0 //set to 0: do not save color params
  8. /*check current consumption and limit the total current for LED driver IC*/
  9. /*NOTE: YOU SHOULD REPLACE WIHT THE LIMIT CURRENT OF YOUR OWN APPLICATION*/
  10. #define LIGHT_CURRENT_LIMIT 0 //set to 0: do not limit total current
  11. #if LIGHT_CURRENT_LIMIT
  12. #define LIGHT_TOTAL_CURRENT_MAX (450*1000) //450000/1000 MA AT MOST
  13. #define LIGHT_CURRENT_MARGIN (80*1000) //80000/1000 MA CURRENT RAISES WHILE TEMPERATURE INCREASING
  14. #define LIGHT_CURRENT_MARGIN_L2 (110*1000) //110000/1000 MA
  15. #define LIGHT_CURRENT_MARGIN_L3 (140*1000) //140000/1000 MA
  16. #endif
  17. /*set target duty for PWM channels, change each channel duty gradually */
  18. void light_set_aim(uint32 r,uint32 g,uint32 b,uint32 cw,uint32 ww,uint32 period);//'white' channel is not used in default demo
  19. void light_set_aim_r(uint32 r);
  20. void light_set_aim_g(uint32 g);
  21. void light_set_aim_b(uint32 b);
  22. void light_set_aim_cw(uint32 cw);
  23. void light_set_aim_ww(uint32 ww);
  24. #endif