u_light_ctrl.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. #ifndef _U_LIGHT_CTRL_H_
  2. #define _U_LIGHT_CTRL_H_
  3. #include "u_global.h"
  4. #include "u_main.h"
  5. enum _rc_code
  6. {
  7. RC_CODE_UP = 0x90,
  8. RC_CODE_DOWN = 0xB8,
  9. RC_CODE_OFF = 0xF8,
  10. RC_CODE_ON = 0xB0,
  11. RC_CODE_W = 0xA8,
  12. RC_CODE_FLASH = 0xB2,
  13. RC_CODE_STROBE = 0x00,
  14. RC_CODE_FADE = 0x58,
  15. RC_CODE_SMOOTH = 0x30,
  16. RC_CODE_COLOR_R = 0x98,
  17. RC_CODE_COLOR_G = 0xD8,
  18. RC_CODE_COLOR_B = 0x88,
  19. RC_CODE_COLOR_1 = 0xE8,
  20. RC_CODE_COLOR_2 = 0x48,
  21. RC_CODE_COLOR_3 = 0x68,
  22. RC_CODE_COLOR_4 = 0x02,
  23. RC_CODE_COLOR_5 = 0x32,
  24. RC_CODE_COLOR_6 = 0x20,
  25. RC_CODE_COLOR_7 = 0x50,
  26. RC_CODE_COLOR_8 = 0x78,
  27. RC_CODE_COLOR_9 = 0x70,
  28. RC_CODE_COLOR_10 = 0x38,
  29. RC_CODE_COLOR_11 = 0x28,
  30. RC_CODE_COLOR_12 = 0xF0,
  31. };
  32. enum _rc_code_20
  33. {
  34. RC_CODE_UP_20 = 0x00,
  35. RC_CODE_DOWN_20 = 0x80,
  36. RC_CODE_OFF_20 = 0xC0,
  37. RC_CODE_ON_20 = 0x40,
  38. RC_CODE_COLOR_R_20 = 0x20,
  39. RC_CODE_COLOR_G_20 = 0xA0,
  40. RC_CODE_COLOR_B_20 = 0x60,
  41. RC_CODE_W_20 = 0xE0,
  42. RC_CODE_COLOR_ORANGE_20 = 0x10,
  43. RC_CODE_COLOR_YELLOW_20 = 0x90,
  44. RC_CODE_COLOR_CYAN_20 = 0x50,
  45. RC_CODE_COLOR_PURPLE_20 = 0xD0,
  46. RC_CODE_JUMP3_20 = 0x30,
  47. RC_CODE_JUMP7_20 = 0xB0,
  48. RC_CODE_FADE3_20 = 0x70,
  49. RC_CODE_FADE7_20 = 0xF0,
  50. RC_CODE_MUSIC1_20 = 0x08,
  51. RC_CODE_MUSIC2_20 = 0x88,
  52. RC_CODE_MUSIC3_20 = 0x48,
  53. RC_CODE_MUSIC4_20 = 0xC8,
  54. };
  55. enum //_rc_mode
  56. {
  57. RC_MODE_COLOR_MIN = 0,
  58. RC_MODE_COLOR_R = RC_MODE_COLOR_MIN,
  59. RC_MODE_COLOR_G,
  60. RC_MODE_COLOR_B,
  61. RC_MODE_COLOR_W,
  62. RC_MODE_COLOR_1,
  63. RC_MODE_COLOR_2,
  64. RC_MODE_COLOR_3,
  65. RC_MODE_COLOR_4,
  66. RC_MODE_COLOR_5,
  67. RC_MODE_COLOR_6,
  68. RC_MODE_COLOR_7,
  69. RC_MODE_COLOR_8,
  70. RC_MODE_COLOR_9,
  71. RC_MODE_COLOR_10,
  72. RC_MODE_COLOR_11,
  73. RC_MODE_COLOR_12,
  74. RC_MODE_FLASH,
  75. RC_MODE_STROBE,
  76. RC_MODE_FADE,
  77. RC_MODE_SMOOTH,
  78. RC_CODE_FADE7,
  79. RC_CODE_FADE3,
  80. RC_CODE_JUMP3,
  81. RC_CODE_JUMP7,
  82. RC_MODE_RHYTM_MUSIC1,
  83. RC_MODE_RHYTM_MUSIC2,
  84. RC_MODE_RHYTM_MUSIC3,
  85. RC_MODE_RHYTM_MUSIC4,
  86. };
  87. typedef enum //_rc_mode_switch_dir
  88. {
  89. RC_MODE_SHITCH_KEEP,
  90. RC_MODE_SHITCH_PLUS,
  91. RC_MODE_SHITCH_SUBT,
  92. }RcModeDir_t;
  93. void light_param_init(void);
  94. void light_power_set(uint8_t set_state);
  95. void ctrl_light_speed_ctrl(uint8_t light_speed);
  96. void light_speed_ctrl(uint8_t light_speed);
  97. void light_bright_ctrl(uint8_t light_bright);
  98. void light_rhythm_enter(uint8_t rhythm_mode);
  99. void rc_mode_enter(uint8_t rc_mode);
  100. void ir_decode(const uint8_t *ir_code);
  101. uint8_t rgb_line_order_check(void);
  102. void light_info_save_set(void);
  103. void light_info_save(void);
  104. void light_flash_save_cb(void);
  105. void light_info_init(void);
  106. #endif //_U_LIGHT_CTRL_H_