qmk_firmware

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

config.h (2004B)


      1 /**
      2  * config.h
      3  *
      4  */
      5 
      6 #pragma once
      7 
      8 #define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE
      9 
     10 /* key matrix size */
     11 #define MATRIX_ROWS 6
     12 #define MATRIX_COLS 16
     13 
     14 #define DEF_PIN(port, pin) (((port) << 8) | pin)
     15 #define GET_PORT(pp) (((pp) >> 8) & 0xFF)
     16 #define GET_PIN(pp) ((pp) & 0xFF)
     17 
     18 #define ROW1_MASK 0x80
     19 #define ROW2_MASK 0x40
     20 #define ROW3_MASK 0x01
     21 #define ROW4_MASK 0x04
     22 #define ROW5_MASK 0x10
     23 #define ROW6_MASK 0x20
     24 #define ROW_PORT TCA6424_PORT2
     25 
     26 #define COL1_MASK 0x02
     27 #define COL2_MASK 0x80
     28 #define COL3_MASK 0x40
     29 #define COL4_MASK 0x20
     30 #define COL5_MASK 0x10
     31 #define COL6_MASK 0x08
     32 #define COL7_MASK 0x04
     33 #define COL8_MASK 0x02
     34 #define COL9_MASK 0x01
     35 #define COL10_MASK 0x80
     36 #define COL11_MASK 0x40
     37 #define COL12_MASK 0x20
     38 #define COL13_MASK 0x10
     39 #define COL14_MASK 0x08
     40 #define COL15_MASK 0x04
     41 #define COL16_MASK 0x02
     42 
     43 // Note: MATRIX_ROW_PINS only works with standard pin names.
     44 #define MATRIX_M20_ROW_PINS { \
     45     DEF_PIN(TCA6424_PORT2, 7), \
     46     DEF_PIN(TCA6424_PORT2, 6), \
     47     DEF_PIN(TCA6424_PORT2, 0), \
     48     DEF_PIN(TCA6424_PORT2, 2), \
     49     DEF_PIN(TCA6424_PORT2, 4), \
     50     DEF_PIN(TCA6424_PORT2, 5) }
     51 
     52 // Note: MATRIX_COL_PINS only works with standard pin names.
     53 #define MATRIX_M20_COL_PINS { \
     54     DEF_PIN(TCA6424_PORT2, 1), \
     55     DEF_PIN(TCA6424_PORT1, 7), \
     56     DEF_PIN(TCA6424_PORT1, 6), \
     57     DEF_PIN(TCA6424_PORT1, 5), \
     58     DEF_PIN(TCA6424_PORT1, 4), \
     59     DEF_PIN(TCA6424_PORT1, 3), \
     60     DEF_PIN(TCA6424_PORT1, 2), \
     61     DEF_PIN(TCA6424_PORT1, 1), \
     62     DEF_PIN(TCA6424_PORT1, 0), \
     63     DEF_PIN(TCA6424_PORT0, 7), \
     64     DEF_PIN(TCA6424_PORT0, 6), \
     65     DEF_PIN(TCA6424_PORT0, 5), \
     66     DEF_PIN(TCA6424_PORT0, 4), \
     67     DEF_PIN(TCA6424_PORT0, 3), \
     68     DEF_PIN(TCA6424_PORT0, 2), \
     69     DEF_PIN(TCA6424_PORT0, 1) }
     70 
     71 
     72 
     73 #define DIODE_DIRECTION COL2ROW
     74 
     75 // i2c setting
     76 #define I2C1_SCL_PIN B8
     77 #define I2C1_SDA_PIN B9
     78 #define I2C1_CLOCK_SPEED 400000
     79 #define I2C1_DUTY_CYCLE FAST_DUTY_CYCLE_2
     80 
     81 #define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND
     82 #define IS31FL3731_LED_COUNT 20