From fae437cfadcd393009e148442e48c046c126a5b0 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Wed, 7 Feb 2018 17:17:39 -0500 Subject: [PATCH] update matrix --- drivers/arm/twi2c.c | 33 +++++++++++++++++++ drivers/arm/twi2c.h | 18 ++++++++++ keyboards/_qmk_handwire/_qmk_handwire.h | 12 +++++++ keyboards/_qmk_handwire/config.h | 2 +- .../_qmk_handwire/keymaps/default/keymap.c | 7 ++++ 5 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 drivers/arm/twi2c.c create mode 100644 drivers/arm/twi2c.h diff --git a/drivers/arm/twi2c.c b/drivers/arm/twi2c.c new file mode 100644 index 00000000..e6cab25b --- /dev/null +++ b/drivers/arm/twi2c.c @@ -0,0 +1,33 @@ +/* Copyright 2018 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "twi2c.h" + +#ifndef I2C_DRIVER + #define I2C_DRIVER &I2CD1 +#endif + +static const I2CConfig i2cconfig = { + STM32_TIMINGR_PRESC(15U) | + STM32_TIMINGR_SCLDEL(4U) | STM32_TIMINGR_SDADEL(2U) | + STM32_TIMINGR_SCLH(15U) | STM32_TIMINGR_SCLL(21U), + 0, + 0 +}; + +void twi2c_init(void) { + i2cStart(I2C_DRIVER, &i2cconfig); +} \ No newline at end of file diff --git a/drivers/arm/twi2c.h b/drivers/arm/twi2c.h new file mode 100644 index 00000000..a1847d43 --- /dev/null +++ b/drivers/arm/twi2c.h @@ -0,0 +1,18 @@ +/* Copyright 2018 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "ch.h" +#include "hal.h" \ No newline at end of file diff --git a/keyboards/_qmk_handwire/_qmk_handwire.h b/keyboards/_qmk_handwire/_qmk_handwire.h index e16ae3ba..f482861f 100644 --- a/keyboards/_qmk_handwire/_qmk_handwire.h +++ b/keyboards/_qmk_handwire/_qmk_handwire.h @@ -29,6 +29,12 @@ /* The fully-featured KEYMAP() that has every single key available in the matrix. */ #define KEYMAP(\ + j00, j01, j02, j03, j04, j05, j06, \ + j10, j11, j12, j13, j14, j15, j16, \ + j20, j21, j22, j23, j24, j25, j26, \ + j30, j31, j32, j33, j34, j35, \ + j40, j41, j42, j43, j44, \ + j54, j55, j56, \ k00, k01, k02, k03, k04, k05, k06, \ k10, k11, k12, k13, k14, k15, k16, \ k20, k21, k22, k23, k24, k25, k26, \ @@ -36,6 +42,12 @@ k42, k43, k44, k45, k46, \ k50, k51, k52 \ ) { \ + { j00, j01, j02, j03, j04, j05, j06 }, \ + { j10, j11, j12, j13, j14, j15, j16 }, \ + { j20, j21, j22, j23, j24, j25, j26 }, \ + { j30, j31, j32, j33, j34, j35, 0 }, \ + { j40, j41, j42, j43, j44, 0, 0 }, \ + { 0, 0, 0, 0, j54, j55, j56 }, \ { k00, k01, k02, k03, k04, k05, k06 }, \ { k10, k11, k12, k13, k14, k15, k16 }, \ { k20, k21, k22, k23, k24, k25, k26 }, \ diff --git a/keyboards/_qmk_handwire/config.h b/keyboards/_qmk_handwire/config.h index 70930b25..6b3042ce 100644 --- a/keyboards/_qmk_handwire/config.h +++ b/keyboards/_qmk_handwire/config.h @@ -29,7 +29,7 @@ #define DESCRIPTION "Handwire protoboard" /* key matrix size */ -#define MATRIX_ROWS 6 +#define MATRIX_ROWS 12 #define MATRIX_COLS 7 /* diff --git a/keyboards/_qmk_handwire/keymaps/default/keymap.c b/keyboards/_qmk_handwire/keymaps/default/keymap.c index 01af5340..8469b6c3 100644 --- a/keyboards/_qmk_handwire/keymaps/default/keymap.c +++ b/keyboards/_qmk_handwire/keymaps/default/keymap.c @@ -34,6 +34,13 @@ enum custom_keycodes { const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = KEYMAP( + KC_INS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_PGUP, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, + KC_PGDN, KC_H, KC_J, KC_K, KC_L, KC_COLN, KC_QUOT, + KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + KC_RCTL, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, + MO(2), MO(1), KC_SPC, + KC_INS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, KC_PGUP, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, KC_PGDN, KC_H, KC_J, KC_K, KC_L, KC_COLN, KC_QUOT,