keymap.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. #include "mini.h"
  2. /*KNOPS_MISC*/
  3. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  4. /*KNOPS_KEYMAP*/
  5. };
  6. void set_led_state(int ledId, bool state) {
  7. if(state) {
  8. switch(ledId) {
  9. /* LED 0 to 5 are the leds of each keyswitch. From left to right, top to bottom. These are equal to the numbers in the legends of the default keycaps. */
  10. case 0:
  11. PORTD |= (1<<7);
  12. break;
  13. case 1:
  14. PORTC |= (1<<6);
  15. break;
  16. case 2:
  17. PORTD |= (1<<4);
  18. break;
  19. case 3:
  20. PORTE |= (1<<6);
  21. break;
  22. case 4:
  23. PORTB |= (1<<4);
  24. break;
  25. case 5:
  26. PORTD |= (1<<6);
  27. break;
  28. /* LED 6 to 8 are the three layer leds in front of the device from left to right. */
  29. case 6:
  30. PORTD &= ~(1<<5);
  31. break;
  32. case 7:
  33. PORTB |= (1<<6);
  34. break;
  35. case 8:
  36. PORTB &= ~(1<<0);
  37. break;
  38. }
  39. } else {
  40. switch(ledId) {
  41. case 0:
  42. PORTD &= ~(1<<7);
  43. break;
  44. case 1:
  45. PORTC &= ~(1<<6);
  46. break;
  47. case 2:
  48. PORTD &= ~(1<<4);
  49. break;
  50. case 3:
  51. PORTE &= ~(1<<6);
  52. break;
  53. case 4:
  54. PORTB &= ~(1<<4);
  55. break;
  56. case 5:
  57. PORTD &= ~(1<<6);
  58. break;
  59. case 6:
  60. PORTD |= (1<<5);
  61. break;
  62. case 7:
  63. PORTB &= ~(1<<6);
  64. break;
  65. case 8:
  66. PORTB |= (1<<0);
  67. break;
  68. }
  69. }
  70. }
  71. void led_init_ports() {
  72. DDRD |= (1<<7);
  73. DDRC |= (1<<6);
  74. DDRD |= (1<<4);
  75. DDRE |= (1<<6);
  76. DDRB |= (1<<4);
  77. DDRD |= (1<<6);
  78. DDRD |= (1<<5);
  79. DDRB |= (1<<6);
  80. DDRB |= (1<<0);
  81. }
  82. void matrix_init_user(void) {
  83. led_init_ports();
  84. led_set_layer(0);
  85. /*KNOPS_INIT*/
  86. }
  87. const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
  88. //keyevent_t event = record->event;
  89. /*KNOPS_MACRO*/
  90. }
  91. void matrix_scan_user(void) {
  92. /*KNOPS_SCAN*/
  93. }
  94. void led_set_user(uint8_t usb_led) {
  95. /*KNOPS_FUNCTIONALLED_STATES*/
  96. }
  97. void led_set_layer(int layer) {
  98. /*KNOPS_SIMPLELED_STATES*/
  99. }
  100. bool process_record_user (uint16_t keycode, keyrecord_t *record) {
  101. /*KNOPS_PROCESS_STATE*/
  102. }