u_light_ctrl.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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//原来不带麦蓝面贴用的 24 个按键
  6. //{
  7. // RC_CODE_UP = 0x90,
  8. // RC_CODE_DOWN = 0xB8,
  9. // RC_CODE_OFF = 0xF8,
  10. // RC_CODE_ON = 0xB0,
  11. //
  12. // RC_CODE_W = 0xA8,
  13. // RC_CODE_FLASH = 0xB2,
  14. // RC_CODE_STROBE = 0x00,
  15. // RC_CODE_FADE = 0x58,
  16. // RC_CODE_SMOOTH = 0x30,
  17. //
  18. // RC_CODE_COLOR_R = 0x98,
  19. // RC_CODE_COLOR_G = 0xD8,
  20. // RC_CODE_COLOR_B = 0x88,
  21. //
  22. // RC_CODE_COLOR_1 = 0xE8,
  23. // RC_CODE_COLOR_2 = 0x48,
  24. // RC_CODE_COLOR_3 = 0x68,
  25. //
  26. // RC_CODE_COLOR_4 = 0x02,
  27. // RC_CODE_COLOR_5 = 0x32,
  28. // RC_CODE_COLOR_6 = 0x20,
  29. //
  30. // RC_CODE_COLOR_7 = 0x50,
  31. // RC_CODE_COLOR_8 = 0x78,
  32. // RC_CODE_COLOR_9 = 0x70,
  33. //
  34. // RC_CODE_COLOR_10 = 0x38,
  35. // RC_CODE_COLOR_11 = 0x28,
  36. // RC_CODE_COLOR_12 = 0xF0,
  37. //};
  38. enum _rc_code//
  39. {
  40. RC_CODE_UP = 0x00,
  41. RC_CODE_DOWN = 0x80,
  42. RC_CODE_OFF = 0x40,
  43. RC_CODE_ON = 0xC0,
  44. RC_CODE_W = 0xE0,
  45. RC_CODE_FLASH = 0xD0,
  46. RC_CODE_STROBE = 0xF0,
  47. RC_CODE_FADE = 0xC8,
  48. RC_CODE_SMOOTH = 0xE8,
  49. RC_CODE_COLOR_R = 0x20,
  50. RC_CODE_COLOR_G = 0xA0,
  51. RC_CODE_COLOR_B = 0x60,
  52. RC_CODE_COLOR_1 = 0x10, //对应的是遥控器12个其他颜色值
  53. RC_CODE_COLOR_2 = 0x90,
  54. RC_CODE_COLOR_3 = 0x50,
  55. RC_CODE_COLOR_4 = 0x30,
  56. RC_CODE_COLOR_5 = 0xB0,
  57. RC_CODE_COLOR_6 = 0x70,
  58. RC_CODE_COLOR_7 = 0x08,
  59. RC_CODE_COLOR_8 = 0x88,
  60. RC_CODE_COLOR_9 = 0x48,
  61. RC_CODE_COLOR_10 = 0x28,
  62. RC_CODE_COLOR_11 = 0xA8,
  63. RC_CODE_COLOR_12 = 0x68,
  64. };
  65. enum _rc_code_20
  66. {
  67. RC_CODE_UP_20 = 0x00,
  68. RC_CODE_DOWN_20 = 0x80,
  69. RC_CODE_OFF_20 = 0xC0,
  70. RC_CODE_ON_20 = 0x40,
  71. RC_CODE_COLOR_R_20 = 0x20,
  72. RC_CODE_COLOR_G_20 = 0xA0,
  73. RC_CODE_COLOR_B_20 = 0x60,
  74. RC_CODE_W_20 = 0xE0,
  75. RC_CODE_COLOR_ORANGE_20 = 0x10,
  76. RC_CODE_COLOR_YELLOW_20 = 0x90,
  77. RC_CODE_COLOR_CYAN_20 = 0x50,
  78. RC_CODE_COLOR_PURPLE_20 = 0xD0,
  79. RC_CODE_JUMP3_20 = 0x30,
  80. RC_CODE_JUMP7_20 = 0xB0,
  81. RC_CODE_FADE3_20 = 0x70,
  82. RC_CODE_FADE7_20 = 0xF0,
  83. RC_CODE_MUSIC1_20 = 0x08,
  84. RC_CODE_MUSIC2_20 = 0x88,
  85. RC_CODE_MUSIC3_20 = 0x48,
  86. RC_CODE_MUSIC4_20 = 0xC8,
  87. };
  88. enum //_rc_mode
  89. {
  90. RC_MODE_COLOR_MIN = 0,
  91. RC_MODE_COLOR_R = RC_MODE_COLOR_MIN,
  92. RC_MODE_COLOR_G,
  93. RC_MODE_COLOR_B,
  94. RC_MODE_COLOR_W,
  95. RC_MODE_COLOR_1,
  96. RC_MODE_COLOR_2,
  97. RC_MODE_COLOR_3,
  98. RC_MODE_COLOR_4,
  99. RC_MODE_COLOR_5,
  100. RC_MODE_COLOR_6,
  101. RC_MODE_COLOR_7,
  102. RC_MODE_COLOR_8,
  103. RC_MODE_COLOR_9,
  104. RC_MODE_COLOR_10,
  105. RC_MODE_COLOR_11,
  106. RC_MODE_COLOR_12,
  107. RC_MODE_FLASH,
  108. RC_MODE_STROBE,
  109. RC_MODE_FADE,
  110. RC_MODE_SMOOTH,
  111. RC_CODE_FADE7,
  112. RC_CODE_FADE3,
  113. RC_CODE_JUMP3,
  114. RC_CODE_JUMP7,
  115. RC_MODE_RHYTM_MUSIC1,
  116. RC_MODE_RHYTM_MUSIC2,
  117. RC_MODE_RHYTM_MUSIC3,
  118. RC_MODE_RHYTM_MUSIC4,
  119. };
  120. typedef enum //_rc_mode_switch_dir
  121. {
  122. RC_MODE_SHITCH_KEEP,
  123. RC_MODE_SHITCH_PLUS,
  124. RC_MODE_SHITCH_SUBT,
  125. }RcModeDir_t;
  126. void light_param_init(void);
  127. void light_power_set(uint8_t set_state);
  128. void ctrl_light_speed_ctrl(uint8_t light_speed);
  129. void light_speed_ctrl(uint8_t light_speed);
  130. void light_bright_ctrl(uint8_t light_bright);
  131. void light_rhythm_enter(uint8_t rhythm_mode);
  132. void rc_mode_enter(uint8_t rc_mode);
  133. void ir_decode(const uint8_t *ir_code);
  134. uint8_t rgb_line_order_check(void);
  135. void light_info_save_set(void);
  136. void light_info_save(void);
  137. void light_flash_save_cb(void);
  138. void light_info_init(void);
  139. #endif //_U_LIGHT_CTRL_H_