qmk_firmware

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

config.h (2549B)


      1 /**
      2  * config.h
      3  *
      4  * Copyright 2020 astro <yuleiz@gmail.com>
      5  *
      6  * This program is free software: you can redistribute it and/or modify
      7  * it under the terms of the GNU General Public License as published by
      8  * the Free Software Foundation, either version 2 of the License, or
      9  * (at your option) any later version.
     10  *
     11  * This program is distributed in the hope that it will be useful,
     12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     14  * GNU General Public License for more details.
     15  *
     16  * You should have received a copy of the GNU General Public License
     17  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
     18  */
     19 
     20 #pragma once
     21 
     22 /* key matrix size */
     23 #define MATRIX_ROWS 6
     24 #define MATRIX_COLS 16
     25 
     26 #define DEF_PIN(port, pin) (((port) << 8) | pin)
     27 #define GET_PORT(pp) (((pp) >> 8) & 0xFF)
     28 #define GET_PIN(pp) ((pp) & 0xFF)
     29 
     30 #define CUSTOM_MATRIX_ROW_PINS { \
     31     DEF_PIN(TCA6424_PORT2, 7), \
     32     DEF_PIN(TCA6424_PORT2, 6), \
     33     DEF_PIN(TCA6424_PORT2, 0), \
     34     DEF_PIN(TCA6424_PORT2, 2), \
     35     DEF_PIN(TCA6424_PORT2, 4), \
     36     DEF_PIN(TCA6424_PORT2, 5) }
     37 
     38 #define CUSTOM_MATRIX_COL_PINS { \
     39     DEF_PIN(TCA6424_PORT2, 1), \
     40     DEF_PIN(TCA6424_PORT1, 7), \
     41     DEF_PIN(TCA6424_PORT1, 6), \
     42     DEF_PIN(TCA6424_PORT1, 5), \
     43     DEF_PIN(TCA6424_PORT1, 4), \
     44     DEF_PIN(TCA6424_PORT1, 3), \
     45     DEF_PIN(TCA6424_PORT1, 2), \
     46     DEF_PIN(TCA6424_PORT1, 1), \
     47     DEF_PIN(TCA6424_PORT1, 0), \
     48     DEF_PIN(TCA6424_PORT0, 7), \
     49     DEF_PIN(TCA6424_PORT0, 6), \
     50     DEF_PIN(TCA6424_PORT0, 5), \
     51     DEF_PIN(TCA6424_PORT0, 4), \
     52     DEF_PIN(TCA6424_PORT0, 3), \
     53     DEF_PIN(TCA6424_PORT0, 2), \
     54     DEF_PIN(TCA6424_PORT0, 1) }
     55 
     56 #define ROW1_MASK 0x80
     57 #define ROW2_MASK 0x40
     58 #define ROW3_MASK 0x01
     59 #define ROW4_MASK 0x04
     60 #define ROW5_MASK 0x10
     61 #define ROW6_MASK 0x20
     62 #define ROW_PORT TCA6424_PORT2
     63 
     64 #define COL1_MASK 0x02
     65 #define COL2_MASK 0x80
     66 #define COL3_MASK 0x40
     67 #define COL4_MASK 0x20
     68 #define COL5_MASK 0x10
     69 #define COL6_MASK 0x08
     70 #define COL7_MASK 0x04
     71 #define COL8_MASK 0x02
     72 #define COL9_MASK 0x01
     73 #define COL10_MASK 0x80
     74 #define COL11_MASK 0x40
     75 #define COL12_MASK 0x20
     76 #define COL13_MASK 0x10
     77 #define COL14_MASK 0x08
     78 #define COL15_MASK 0x04
     79 #define COL16_MASK 0x02
     80 
     81 
     82 #define DIODE_DIRECTION COL2ROW
     83 
     84 // i2c setting
     85 #define USE_I2CV1
     86 #define I2C1_SCL 8
     87 #define I2C1_SDA 9
     88 #define I2C1_CLOCK_SPEED 400000
     89 #define I2C1_DUTY_CYCLE FAST_DUTY_CYCLE_2
     90 
     91 #define AW9523B_RGB_NUM 4
     92 #define WS2812_LED_COUNT 5
     93 
     94 #define EARLY_INIT_PERFORM_BOOTLOADER_JUMP FALSE