qmk_firmware

QMK firmware for my keyboards (Corne, Sweep Ferris) and trackball (Ploopy Adept)
Log | Files | Refs | Submodules | LICENSE

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