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.8 KiB

  1. /* Copyright 2018 Ryan "Izzy" Bales
  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 "yd68.h"
  17. void matrix_init_kb(void) {
  18. // put your keyboard start-up code here
  19. // runs once when the firmware starts up
  20. //Capslock LED Output Low
  21. DDRD |= (1<<4);
  22. PORTD &= ~(1<<4);
  23. //Backlight LEDs Output Low
  24. DDRD |= (1<<6);
  25. PORTD &= ~(1<<6);
  26. //RGB power output low
  27. DDRE |= (1<<2);
  28. PORTE &= ~(1<<2);
  29. //Bluetooth power output high
  30. DDRB |= (1<<2);
  31. PORTB |= (1<<2);
  32. //RGB data output low
  33. DDRB |= (1<<3);
  34. PORTB &= ~(1<<3);
  35. matrix_init_user();
  36. }
  37. void matrix_scan_kb(void) {
  38. // put your looping keyboard code here
  39. // runs every cycle (a lot)
  40. matrix_scan_user();
  41. }
  42. bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
  43. // put your per-action keyboard code here
  44. // runs for every action, just before processing by the firmware
  45. return process_record_user(keycode, record);
  46. }
  47. void led_set_kb(uint8_t usb_led) {
  48. // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
  49. if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
  50. // output low
  51. DDRD |= (1<<4);
  52. PORTD &= ~(1<<4);
  53. } else {
  54. // output high
  55. DDRD |= (1<<4);
  56. PORTD |= (1<<4);
  57. }
  58. led_set_user(usb_led);
  59. }