2
0

lfkpad.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. // readability
  46. #define ___ KC_NO
  47. #define LAYOUT_numpad_6x4( \
  48. k00, k01, k02, k03, \
  49. k10, k11, k12, k13, \
  50. k20, k21, k22, \
  51. k30, k31, k32, k23, \
  52. k40, k41, k42, \
  53. k50, k52, k43 \
  54. ) { \
  55. { k00, k01, k02, k03 }, \
  56. { k10, k11, k12, k13 }, \
  57. { k20, k21, k22, k23 }, \
  58. { k30, k31, k32, ___ }, \
  59. { k40, k41, k42, k43 }, \
  60. { k50, ___, k52, ___ } \
  61. }
  62. #endif //LFKPAD_H