diff options
author | yulei <yuleiz@gmail.com> | 2020-08-23 04:45:06 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-22 13:45:06 -0700 |
commit | ac3dfa742a92de541f86846b94269aab87d55d3c (patch) | |
tree | a14cd8d42a963e8aa2e50b214e57f89973f9ea8e /keyboards/matrix/m20add/config.h | |
parent | e02f4798f97f7432e8df55846f8eb496b6ac45d1 (diff) | |
download | qmk_firmware-ac3dfa742a92de541f86846b94269aab87d55d3c.tar.gz |
[Keyboard] added matrix 8xv2.0 additional (#9470)
* added matrix 8xv2.0 additional keyboard
* Apply suggestions from code review
Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
* add copyright and speed up the matrix scanning
* Update keyboards/matrix/m20add/rules.mk
Co-authored-by: Drashna Jaelre <drashna@live.com>
Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
Co-authored-by: Drashna Jaelre <drashna@live.com>
Diffstat (limited to 'keyboards/matrix/m20add/config.h')
-rw-r--r-- | keyboards/matrix/m20add/config.h | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/keyboards/matrix/m20add/config.h b/keyboards/matrix/m20add/config.h new file mode 100644 index 000000000..8c3f922ab --- /dev/null +++ b/keyboards/matrix/m20add/config.h @@ -0,0 +1,96 @@ +/** + * config.h + * + */ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x4D58 // MX +#define PRODUCT_ID 0x20AD // 8XV2.0 Additional +#define DEVICE_VER 0x0001 +#define MANUFACTURER MATRIX +#define PRODUCT 8XV2.0 Additional + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 16 + +#define DEF_PIN(port, pin) (((port) << 8) | pin) +#define GET_PORT(pp) (((pp) >> 8) & 0xFF) +#define GET_PIN(pp) ((pp) & 0xFF) + +#define ROW1_MASK 0x80 +#define ROW2_MASK 0x40 +#define ROW3_MASK 0x01 +#define ROW4_MASK 0x04 +#define ROW5_MASK 0x10 +#define ROW6_MASK 0x20 +#define ROW_PORT TCA6424_PORT2 + +#define COL1_MASK 0x02 +#define COL2_MASK 0x80 +#define COL3_MASK 0x40 +#define COL4_MASK 0x20 +#define COL5_MASK 0x10 +#define COL6_MASK 0x08 +#define COL7_MASK 0x04 +#define COL8_MASK 0x02 +#define COL9_MASK 0x01 +#define COL10_MASK 0x80 +#define COL11_MASK 0x40 +#define COL12_MASK 0x20 +#define COL13_MASK 0x10 +#define COL14_MASK 0x08 +#define COL15_MASK 0x04 +#define COL16_MASK 0x02 + +#define MATRIX_ROW_PINS { \ + DEF_PIN(TCA6424_PORT2, 7), \ + DEF_PIN(TCA6424_PORT2, 6), \ + DEF_PIN(TCA6424_PORT2, 0), \ + DEF_PIN(TCA6424_PORT2, 2), \ + DEF_PIN(TCA6424_PORT2, 4), \ + DEF_PIN(TCA6424_PORT2, 5) } + +#define MATRIX_COL_PINS { \ + DEF_PIN(TCA6424_PORT2, 1), \ + DEF_PIN(TCA6424_PORT1, 7), \ + DEF_PIN(TCA6424_PORT1, 6), \ + DEF_PIN(TCA6424_PORT1, 5), \ + DEF_PIN(TCA6424_PORT1, 4), \ + DEF_PIN(TCA6424_PORT1, 3), \ + DEF_PIN(TCA6424_PORT1, 2), \ + DEF_PIN(TCA6424_PORT1, 1), \ + DEF_PIN(TCA6424_PORT1, 0), \ + DEF_PIN(TCA6424_PORT0, 7), \ + DEF_PIN(TCA6424_PORT0, 6), \ + DEF_PIN(TCA6424_PORT0, 5), \ + DEF_PIN(TCA6424_PORT0, 4), \ + DEF_PIN(TCA6424_PORT0, 3), \ + DEF_PIN(TCA6424_PORT0, 2), \ + DEF_PIN(TCA6424_PORT0, 1) } + +#define UNUSED_PINS + + +#define DIODE_DIRECTION COL2ROW +#define DEBOUNCE 5 + +// i2c setting +#define USE_I2CV1 +#define I2C1_SCL 8 +#define I2C1_SDA 9 +#define I2C1_CLOCK_SPEED 400000 +#define I2C1_DUTY_CYCLE FAST_DUTY_CYCLE_2 + +// rgb light setting +#define RGB_DI_PIN B4 // reserved pin for future usage +#define RGBLED_NUM 20 +#define RGBLIGHT_ANIMATIONS + +#define DRIVER_ADDR_1 0b1110100 +#define DRIVER_COUNT 1 +#define DRIVER_LED_TOTAL RGBLED_NUM + +#define EARLY_INIT_PERFORM_BOOTLOADER_JUMP FALSE // disable jump to system bootloader |