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.

40 lines
1.3 KiB

[Keyboard] Gingham (#6212) * Initial * Prepare for final release * Final * Update keyboards/gingham/matrix.c Co-Authored-By: Drashna Jaelre <drashna@live.com> * Update keyboards/gingham/rules.mk Co-Authored-By: Drashna Jaelre <drashna@live.com> * Update keyboards/gingham/rules.mk Co-Authored-By: fauxpark <fauxpark@gmail.com> * Update keyboards/gingham/config.h Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/gingham/gingham.h Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/hs60/v1/rules.mk Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/gingham/info.json Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/gingham/info.json Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/gingham/info.json Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/gingham/gingham.h Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/gingham/gingham.h Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> * Fixing copypastas * Update keyboards/gingham/info.json Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/gingham/info.json Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/gingham/info.json Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/gingham/info.json Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> * More thingies
5 years ago
  1. /* Copyright 2019 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 "gingham.h"
  17. #include "i2c_master.h"
  18. uint8_t send_data;
  19. void matrix_init_kb(void) {
  20. // Due to the way the port expander is setup both LEDs are already outputs. This is set n matrix.copy
  21. //Turn the red LED on as power indicator.
  22. send_data = 0x10;
  23. i2c_writeReg((PORT_EXPANDER_ADDRESS << 1), 0x09, &send_data, 1, 20);
  24. matrix_init_user();
  25. }
  26. void led_set_kb(uint8_t usb_led) {
  27. // Bit 3 is Green LED, bit 4 is Red LED.
  28. if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
  29. send_data = 0x18;
  30. } else {
  31. send_data = 0x10;
  32. }
  33. i2c_writeReg((PORT_EXPANDER_ADDRESS << 1), 0x09, &send_data, 1, 20);
  34. led_set_user(usb_led);
  35. }