led_layers.c 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. /* My (demuredemeanor) sofle RGB conf */
  2. /// Pin out /// {{{
  3. /*
  4. * Bottom View
  5. * RIGHT LEFT
  6. * ,-----------------------------------------. ,-----------------------------------------.
  7. * | | | |
  8. * | [39] [38] [37] | | [ 0] [ 1] [ 2] |
  9. * | | | |
  10. * | | | |
  11. * | | | |
  12. * | [40] [41] [42] |-------. ,-------| [ 5] [ 4] [ 3] |
  13. * | | | |
  14. * `------------ [43] [44] \ / [ 7] [ 6] ------------'
  15. * \ / \ /
  16. * `-----------------------------------' `-----------------------------------'
  17. */
  18. /*
  19. * Top View
  20. * LEFT RIGHT
  21. * ,-----------------------------------------. ,-----------------------------------------.
  22. * | 33 | 32 | 24 | 23 | 14 | 13 | | 50 | 51 | 60 | 61 | 69 | 70 |
  23. * |------+------+------+------+------+------| |------+------+------+------+------+------|
  24. * | 34 | 31 | 25 | 22 | 15 | 12 | | 49 | 52 | 59 | 62 | 68 | 71 |
  25. * |------+------+------+------+------+------| |------+------+------+------+------+------|
  26. * | 35 | 30 | 26 | 21 | 16 | 11 | | 48 | 53 | 58 | 63 | 67 | 72 |
  27. * |------+------+------+------+------+------|-------. ,-------|------+------+------+------+------+------|
  28. * | 36 | 29 | 27 | 20 | 17 | 10 | | | | 47 | 54 | 57 | 64 | 66 | 73 |
  29. * `-------------+------+------+------\------\--------\ /--------/------/------+------+------+-------------'
  30. * \| 28 | 19 | 18 | 9 \ 8 / \ 45 / 46 | 55 | 56 | 65 |/
  31. * `-----------------------------------' `-----------------------------------'
  32. * | - ^ | - ^ |- ^ ^ -| ^ -| ^ -|
  33. * v | - v | - v |- -| v -| v -| v
  34. */
  35. /// End Pin Out /// }}}
  36. /// Layer Colors /// {{{
  37. // Caps Lock
  38. const rgblight_segment_t PROGMEM my_capslock_layer[] = RGBLIGHT_LAYER_SEGMENTS(
  39. // Right Edge
  40. {2, 2, HSV_RED},
  41. {33, 4, HSV_RED},
  42. // Left Edge
  43. {39, 2, HSV_RED},
  44. {70, 4, HSV_RED}
  45. );
  46. // Colemak -- Unused
  47. const rgblight_segment_t PROGMEM my_layer1_layer[] = RGBLIGHT_LAYER_SEGMENTS(
  48. {9, 2, HSV_CYAN}
  49. );
  50. // Game
  51. const rgblight_segment_t PROGMEM my_layer2_layer[] = RGBLIGHT_LAYER_SEGMENTS(
  52. {8, 1, HSV_PURPLE}, // Game Space
  53. {28, 1, HSV_PURPLE}, // Game Enter
  54. // WASD
  55. {21, 1, HSV_PURPLE},
  56. {25, 2, HSV_PURPLE},
  57. {30, 1, HSV_PURPLE},
  58. // Arrows
  59. {64, 1, HSV_PURPLE},
  60. {66, 2, HSV_PURPLE},
  61. {73, 1, HSV_PURPLE},
  62. // Under Glow
  63. {6, 2, HSV_PURPLE},
  64. {44, 2, HSV_PURPLE}
  65. );
  66. // Mouse
  67. const rgblight_segment_t PROGMEM my_layer3_layer[] = RGBLIGHT_LAYER_SEGMENTS(
  68. // Move Mouse
  69. {48, 1, HSV_YELLOW},
  70. {53, 1, HSV_YELLOW},
  71. {58, 1, HSV_YELLOW},
  72. {63, 1, HSV_YELLOW},
  73. // Mouse Buttons
  74. {55, 2, HSV_YELLOW},
  75. {70, 1, HSV_RED}
  76. );
  77. // Lower
  78. const rgblight_segment_t PROGMEM my_layer4_layer[] = RGBLIGHT_LAYER_SEGMENTS(
  79. // Left Underglow
  80. {0, 1, HSV_GREEN},
  81. {5, 1, HSV_MAGENTA},
  82. {7, 1, HSV_GREEN},
  83. // Left Per key
  84. {8, 1, HSV_GREEN},
  85. {9, 1, HSV_MAGENTA},
  86. {10, 1, HSV_GREEN},
  87. {11, 1, HSV_MAGENTA},
  88. {12, 1, HSV_GREEN},
  89. {13, 1, HSV_MAGENTA},
  90. // Right Underglow
  91. {37, 1, HSV_GREEN},
  92. {42, 1, HSV_MAGENTA},
  93. {44, 1, HSV_GREEN},
  94. // Right Per key
  95. {45, 1, HSV_GREEN},
  96. {46, 1, HSV_MAGENTA},
  97. {47, 1, HSV_GREEN},
  98. {48, 1, HSV_MAGENTA},
  99. {49, 1, HSV_GREEN},
  100. {50, 1, HSV_MAGENTA}
  101. );
  102. // Raise
  103. const rgblight_segment_t PROGMEM my_layer5_layer[] = RGBLIGHT_LAYER_SEGMENTS(
  104. // Left Underglow
  105. {0, 1, HSV_YELLOW},
  106. {5, 1, HSV_BLUE},
  107. {7, 1, HSV_YELLOW},
  108. // Left Per key
  109. {8, 1, HSV_YELLOW},
  110. {9, 1, HSV_BLUE},
  111. {10, 1, HSV_YELLOW},
  112. {11, 1, HSV_BLUE},
  113. {12, 1, HSV_YELLOW},
  114. {13, 1, HSV_BLUE},
  115. // Right Underglow
  116. {37, 1, HSV_YELLOW},
  117. {42, 1, HSV_BLUE},
  118. {44, 1, HSV_YELLOW},
  119. // Right Per key
  120. {45, 1, HSV_YELLOW},
  121. {46, 1, HSV_BLUE},
  122. {47, 1, HSV_YELLOW},
  123. {48, 1, HSV_BLUE},
  124. {49, 1, HSV_YELLOW},
  125. {50, 1, HSV_BLUE}
  126. );
  127. // Adjust
  128. const rgblight_segment_t PROGMEM my_layer6_layer[] = RGBLIGHT_LAYER_SEGMENTS(
  129. // Left Underglow
  130. {0, 1, HSV_RED},
  131. {5, 1, HSV_PINK},
  132. {7, 1, HSV_RED},
  133. // Left Per key
  134. {8, 1, HSV_RED},
  135. {9, 1, HSV_PINK},
  136. {10, 1, HSV_RED},
  137. {11, 1, HSV_PINK},
  138. {12, 1, HSV_RED},
  139. {13, 1, HSV_PINK},
  140. // Right Underglow
  141. {37, 1, HSV_RED},
  142. {42, 1, HSV_PINK},
  143. {44, 1, HSV_RED},
  144. // Right Per key
  145. {45, 1, HSV_RED},
  146. {46, 1, HSV_PINK},
  147. {47, 1, HSV_RED},
  148. {48, 1, HSV_PINK},
  149. {49, 1, HSV_RED},
  150. {50, 1, HSV_PINK}
  151. );
  152. /// End Layer Colors /// }}}
  153. /// Prep /// {{{
  154. // Now define the array of layers. Later layers take precedence
  155. const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST(
  156. my_capslock_layer,
  157. my_layer1_layer, // Overrides caps lock layer
  158. my_layer2_layer, // Overrides other layers
  159. my_layer3_layer, // Overrides other layers
  160. my_layer4_layer, // Overrides other layers
  161. my_layer5_layer, // Overrides other layers
  162. my_layer6_layer // Overrides other layers
  163. );
  164. void keyboard_post_init_user(void) {
  165. // Enable the LED layers
  166. rgblight_layers = my_rgb_layers;
  167. }
  168. /// End Prep /// }}}
  169. /// Enact Colors~ /// {{{
  170. bool led_update_user(led_t led_state) {
  171. rgblight_set_layer_state(0, led_state.caps_lock);
  172. return true;
  173. }
  174. layer_state_t default_layer_state_set_user(layer_state_t state) {
  175. // Not setting colemak
  176. /*rgblight_set_layer_state(1, layer_state_cmp(state, _COLEMAK));*/
  177. rgblight_set_layer_state(2, layer_state_cmp(state, _GAME));
  178. return state;
  179. }
  180. layer_state_t layer_state_set_user(layer_state_t state) {
  181. rgblight_set_layer_state(3, layer_state_cmp(state, _MOUSE));
  182. rgblight_set_layer_state(4, layer_state_cmp(state, _LOWER));
  183. rgblight_set_layer_state(5, layer_state_cmp(state, _RAISE));
  184. rgblight_set_layer_state(6, layer_state_cmp(state, _ADJUST));
  185. return state;
  186. }
  187. /// End Enact Colors~ /// }}}