logo

qmk_firmware

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

remote_kb.h (1427B)


  1. /* Copyright 2021 Jay Greco
  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. #pragma once
  17. #include <stdint.h>
  18. #include "action.h"
  19. #define SERIAL_UART_BAUD 76800 //low error rate for 32u4 @ 16MHz
  20. #define UART_PREAMBLE 0x69
  21. #define UART_MSG_LEN 5
  22. #define UART_NULL 0
  23. #define IDX_PREAMBLE 0
  24. #define IDX_KCLSB 1
  25. #define IDX_KCMSB 2
  26. #define IDX_PRESSED 3
  27. #define IDX_CHECKSUM 4
  28. #define IS_HID_KC(x) ((x > 0) && (x < 0xFF))
  29. #define IS_RM_KC(x) ((x >= RM_BASE) && (x <= 0xFFFF))
  30. #define RM_BASE 0xFFFF-16
  31. enum remote_macros {
  32. RM_1 = RM_BASE,
  33. RM_2, RM_3,
  34. RM_4, RM_5,
  35. RM_6, RM_7,
  36. RM_8, RM_9,
  37. RM_10, RM_11,
  38. RM_12, RM_13,
  39. RM_14, RM_15,
  40. };
  41. // Public functions
  42. void
  43. matrix_init_remote_kb(void),
  44. process_record_remote_kb(uint16_t keycode, keyrecord_t *record),
  45. matrix_scan_remote_kb(void);