logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

nk65b.c (2743B)


  1. /* Copyright 2022 Yiancar
  2. *
  3. * This program is free software: you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation, either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #include "quantum.h"
  17. void led_init_ports(void) {
  18. // Set our LED pins as open drain outputs
  19. palSetLineMode(LED_CAPS_LOCK_PIN, PAL_MODE_OUTPUT_OPENDRAIN);
  20. palSetLineMode(A15, PAL_MODE_OUTPUT_OPENDRAIN);
  21. palSetLineMode(B3, PAL_MODE_OUTPUT_OPENDRAIN);
  22. }
  23. layer_state_t layer_state_set_kb(layer_state_t state) {
  24. gpio_write_pin(A15, !layer_state_cmp(state, 1));
  25. gpio_write_pin(B3, !layer_state_cmp(state, 2));
  26. return layer_state_set_user(state);
  27. }
  28. #ifdef RGB_MATRIX_ENABLE
  29. // clang-format off
  30. led_config_t g_led_config = { {
  31. { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 },
  32. { 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, NO_LED, 15 },
  33. { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 16, 43 },
  34. { 57, NO_LED, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44 },
  35. { 58, 59, 60, NO_LED, NO_LED, NO_LED, 61, NO_LED, NO_LED, 61, 62, 63, 64, 65, 66 }
  36. }, {
  37. { 0,0 }, { 15,0 }, { 30,0 }, { 45,0 }, { 60,0 }, { 75,0 }, { 90,0 }, {105,0 }, {120,0 }, {135,0 }, {150,0 }, {165,0 }, {180,0 }, {203,0 },
  38. {225,0 }, {225,16 }, {206,16 }, {188,16 }, {173,16 }, {158,16 }, {143,16 }, {128,16 }, {113,16 }, { 98,16 }, { 83,16 }, { 68,16 }, { 53,16 }, { 38,16 },
  39. { 23,16 }, { 4,16 }, { 6,32 }, { 26,32 }, { 41,32 }, { 56,32 }, { 71,32 }, { 86,32 }, {101,32 }, {116,32 }, {131,32 }, {146,32 }, {161,32 }, {176,32 },
  40. {201,32 }, {225,32 }, {225,48 }, {210,48 }, {189,48 }, {169,48 }, {154,48 }, {139,48 }, {124,48 }, {109,48 }, { 94,48 }, { 79,48 }, { 64,48 }, { 49,48 },
  41. { 34,48 }, { 9,48 }, { 2,64 }, { 21,64 }, { 39,64 }, { 96,64 }, {150,64 }, {165,64 }, {180,64 }, {195,64 }, {210,64 }, {225,64 }
  42. }, {
  43. 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1,
  44. 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1,
  45. 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1,
  46. 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1,
  47. 1, 1, 1, 4, 1, 1, 1, 1, 1, 1
  48. } };
  49. // clang-format on
  50. #endif