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.

89 lines
2.8 KiB

  1. #ifndef LFK87_H
  2. #define LFK87_H
  3. /* if the kb.h file exists (because we're running from qmkbuilder) include it */
  4. #if __has_include("kb.h")
  5. #include "kb.h"
  6. #endif
  7. #include "quantum.h"
  8. #include "matrix.h"
  9. #include <avr/sfr_defs.h>
  10. #ifndef cbi
  11. #define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
  12. #endif
  13. #ifndef sbi
  14. #define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
  15. #endif
  16. typedef struct RGB_Color {
  17. uint16_t red;
  18. uint16_t green;
  19. uint16_t blue;
  20. } RGB_Color;
  21. typedef struct Layer_Info {
  22. uint32_t layer;
  23. uint32_t mask;
  24. RGB_Color color;
  25. } Layer_Info;
  26. extern const uint32_t layer_count;
  27. extern const Layer_Info layer_info[];
  28. enum action_functions {
  29. LFK_CLEAR = 0, // Resets all layers
  30. LFK_ESC_TILDE, // esc+lshift = ~
  31. LFK_SET_DEFAULT_LAYER, // changes and saves current base layer to eeprom
  32. LFK_CLICK_TOGGLE, // Adjusts click duration
  33. LFK_CLICK_FREQ_HIGHER, // Adjusts click frequency
  34. LFK_CLICK_FREQ_LOWER, // Adjusts click frequency
  35. LFK_CLICK_TIME_LONGER, // Adjusts click duration
  36. LFK_CLICK_TIME_SHORTER, // Adjusts click duration
  37. LFK_DEBUG_SETTINGS, // prints LED and click settings to HID
  38. LFK_LED_TEST, // cycles through switch and RGB LEDs
  39. LFK_PLAY_ONEUP
  40. };
  41. #define CLICK_HZ 500
  42. #define CLICK_MS 2
  43. #define CLICK_ENABLED 0
  44. void reset_keyboard_kb(void);
  45. void click(uint16_t freq, uint16_t duration);
  46. #define k00 KC_NO
  47. // a = 10
  48. // b = 11
  49. // c = 12
  50. // d = 13
  51. // e = 14
  52. // f = 15
  53. // g = 16
  54. // h = 17
  55. // i = 18
  56. // j = 19
  57. #ifndef KEYMAP
  58. #define LAYOUT( \
  59. k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1f, k1g, k1h, k1i, k1j,\
  60. k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, k2g, k2h, k2i, k2j,\
  61. k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k2f, k3g, k3h, k3i, k3j,\
  62. k41, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4d, k4f, k4g, k4h, k4i, k4j,\
  63. k51, k52, k53, k56, k5b, k5c, k5d, k5f, k5g, k5h, k5i, k5j \
  64. ) \
  65. { \
  66. {k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k00, k1f, k1g, k1h, k1i, k1j}, \
  67. {k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, k2f, k2g, k2h, k2i, k2j}, \
  68. {k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k00, k00, k00, k3g, k3h, k3i, k3j}, \
  69. {k41, k00, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4d, k00, k4f, k4g, k4h, k4i, k4j}, \
  70. {k51, k52, k53, k00, k00, k56, k00, k00, k00, k00, k5b, k5c, k5d, k00, k5f, k5g, k5h, k5i, k5j}, \
  71. }
  72. #endif //!KEYMAP#endif
  73. #endif //LFK87_H