You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
5.5 KiB

  1. #pragma once
  2. #include "quantum.h"
  3. #include "matrix.h"
  4. #include <avr/sfr_defs.h>
  5. typedef struct RGB_Color {
  6. uint16_t red;
  7. uint16_t green;
  8. uint16_t blue;
  9. } RGB_Color;
  10. typedef struct Layer_Info {
  11. uint32_t layer;
  12. uint32_t mask;
  13. RGB_Color color;
  14. } Layer_Info;
  15. extern const uint32_t layer_count;
  16. extern const Layer_Info layer_info[];
  17. enum action_functions {
  18. LFK_CLEAR = 0, // Resets all layers
  19. LFK_ESC_TILDE, // esc+lshift = ~
  20. LFK_SET_DEFAULT_LAYER, // changes and saves current base layer to eeprom
  21. LFK_CLICK_TOGGLE, // Adjusts click duration
  22. LFK_CLICK_FREQ_HIGHER, // Adjusts click frequency
  23. LFK_CLICK_FREQ_LOWER, // Adjusts click frequency
  24. LFK_CLICK_TIME_LONGER, // Adjusts click duration
  25. LFK_CLICK_TIME_SHORTER, // Adjusts click duration
  26. LFK_DEBUG_SETTINGS, // prints LED and click settings to HID
  27. LFK_LED_TEST // cycles through switch and RGB LEDs
  28. };
  29. #define CLICK_HZ 500
  30. #define CLICK_MS 2
  31. #define CLICK_ENABLED 0
  32. void reset_keyboard_kb(void);
  33. void click(uint16_t freq, uint16_t duration);
  34. #define XXX KC_NO
  35. /* Vanilla Keymap */
  36. // This a shortcut to help you visually see your layout.
  37. /*
  38. * ,-------------------------------------------------------------------------------.
  39. * | 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 0A | 0B | 0C | 0D | 0E | 0F |
  40. * |-------------------------------------------------------------------------------|
  41. * | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 1A | 1B | 1C | 1D | 1F |
  42. * |-------------------------------------------------------------------------------|
  43. * | 20 | 21 |22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 2A | 2B | 2C | 2D | 2E |
  44. * |-------------------------------------------------------------------------------|
  45. * | 30 | 31 |32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 3A | 3B | 3C | 3E |
  46. * |-------------------------------------------------------------------------------|
  47. * | 40 | 42 |43 | 44 | 45 | 46 | 47 | 48 | 49 | 4A | 4B | 4C | 4D | 4E |
  48. * |-------------------------------------------------------------------------------|
  49. * | 50 | 51 | 52 | 53 | 56 | 58 | 59 | 5A | 5B | 5C | 5D | 5E |
  50. * `-------------------------------------------------------------------------------'
  51. */
  52. // The first section contains all of the arguements
  53. // The second converts the arguments into a two-dimensional array
  54. #define LAYOUT( \
  55. k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F, \
  56. k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1F, \
  57. k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, \
  58. k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3E, \
  59. k40, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, \
  60. k50, k51, k52, k53, k56, k58, k59, k5A, k5B, k5C, k5D, k5E \
  61. ) { \
  62. { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F }, \
  63. { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, XXX, k1F }, \
  64. { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, XXX }, \
  65. { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, XXX, k3E, XXX }, \
  66. { k40, XXX, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, XXX }, \
  67. { k50, k51, k52, k53, XXX, XXX, k56, XXX, k58, k59, k5A, k5B, k5C, k5D, k5E, XXX } \
  68. }
  69. #define LAYOUT_all( \
  70. k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F, \
  71. k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, k1F, \
  72. k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, \
  73. k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E, \
  74. k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, \
  75. k50, k51, k52, k53, k56, k58, k59, k5A, k5B, k5C, k5D, k5E \
  76. ) { \
  77. { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F }, \
  78. { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, k1F }, \
  79. { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, XXX }, \
  80. { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E, XXX }, \
  81. { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, XXX }, \
  82. { k50, k51, k52, k53, XXX, XXX, k56, XXX, k58, k59, k5A, k5B, k5C, k5D, k5E, XXX } \
  83. }
  84. #define LAYOUT_iso( \
  85. k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F, \
  86. k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1F, \
  87. k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, \
  88. k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3E, \
  89. k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, \
  90. k50, k51, k52, k53, k56, k58, k59, k5A, k5B, k5C, k5D, k5E \
  91. ) { \
  92. { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F }, \
  93. { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, XXX, k1F }, \
  94. { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, XXX }, \
  95. { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, XXX, k3E, XXX }, \
  96. { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, XXX }, \
  97. { k50, k51, k52, k53, XXX, XXX, k56, XXX, k58, k59, k5A, k5B, k5C, k5D, k5E, XXX } \
  98. }