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.

73 lines
1.7 KiB

  1. #ifndef LFKPAD_H
  2. #define LFKPAD_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. };
  40. #define CLICK_HZ 500
  41. #define CLICK_MS 2
  42. #define CLICK_ENABLED 0
  43. void reset_keyboard_kb(void);
  44. void click(uint16_t freq, uint16_t duration);
  45. #define LAYOUT( \
  46. k00, k01, k02, k03,\
  47. k10, k11, k12, k13,\
  48. k20, k21, k22, k23,\
  49. k30, k31, k32,\
  50. k40, k41, k42, k43,\
  51. k50, k52\
  52. ) { \
  53. { k00, k01, k02, k03 }, \
  54. { k10, k11, k12, k13 }, \
  55. { k20, k21, k22, k23 }, \
  56. { k30, k31, k32, KC_NO }, \
  57. { k40, k41, k42, k43 }, \
  58. { k50, KC_NO, k52, KC_NO } \
  59. }
  60. #endif //LFKPAD_H