summaryrefslogtreecommitdiffstats
path: root/keyboards
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards')
-rw-r--r--keyboards/mehkee96/config.h18
-rw-r--r--keyboards/mehkee96/i2c.c106
-rw-r--r--keyboards/mehkee96/i2c.h27
-rw-r--r--keyboards/mehkee96/info.json12
-rw-r--r--keyboards/mehkee96/keymaps/default/keymap.c80
-rw-r--r--keyboards/mehkee96/keymaps/johann/keymap.c80
-rw-r--r--keyboards/mehkee96/matrix.c130
-rw-r--r--keyboards/mehkee96/mehkee96.c81
-rw-r--r--keyboards/mehkee96/mehkee96.h24
-rw-r--r--keyboards/mehkee96/program105
-rw-r--r--keyboards/mehkee96/readme.md16
-rw-r--r--keyboards/mehkee96/rules.mk35
-rw-r--r--keyboards/mehkee96/usbconfig.h396
-rw-r--r--keyboards/melody96/keymaps/default/keymap.c6
14 files changed, 1110 insertions, 6 deletions
diff --git a/keyboards/mehkee96/config.h b/keyboards/mehkee96/config.h
new file mode 100644
index 0000000000..70ca273c36
--- /dev/null
+++ b/keyboards/mehkee96/config.h
@@ -0,0 +1,18 @@
+#pragma once
+
+#include "config_common.h"
+
+/* USB Device descriptor parameter */
+#define VENDOR_ID 0x20A0
+#define PRODUCT_ID 0x422D
+#define MANUFACTURER mehkee
+#define PRODUCT 96kee
+
+/* matrix size */
+#define MATRIX_ROWS 8
+#define MATRIX_COLS 15
+
+#define RGBLED_NUM 16
+#define RGBLIGHT_ANIMATIONS
+/* key combination for command */
+#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))
diff --git a/keyboards/mehkee96/i2c.c b/keyboards/mehkee96/i2c.c
new file mode 100644
index 0000000000..a4f9521352
--- /dev/null
+++ b/keyboards/mehkee96/i2c.c
@@ -0,0 +1,106 @@
+/*
+Copyright 2016 Luiz Ribeiro <luizribeiro@gmail.com>
+
+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 <http://www.gnu.org/licenses/>.
+*/
+
+// Please do not modify this file
+
+#include <avr/io.h>
+#include <util/twi.h>
+
+#include "i2c.h"
+
+void i2c_set_bitrate(uint16_t bitrate_khz) {
+ uint8_t bitrate_div = ((F_CPU / 1000l) / bitrate_khz);
+ if (bitrate_div >= 16) {
+ bitrate_div = (bitrate_div - 16) / 2;
+ }
+ TWBR = bitrate_div;
+}
+
+void i2c_init(void) {
+ // set pull-up resistors on I2C bus pins
+ PORTC |= 0b11;
+
+ i2c_set_bitrate(400);
+
+ // enable TWI (two-wire interface)
+ TWCR |= (1 << TWEN);
+
+ // enable TWI interrupt and slave address ACK
+ TWCR |= (1 << TWIE);
+ TWCR |= (1 << TWEA);
+}
+
+uint8_t i2c_start(uint8_t address) {
+ // reset TWI control register
+ TWCR = 0;
+
+ // begin transmission and wait for it to end
+ TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN);
+ while (!(TWCR & (1<<TWINT)));
+
+ // check if the start condition was successfully transmitted
+ if ((TWSR & 0xF8) != TW_START) {
+ return 1;
+ }
+
+ // transmit address and wait
+ TWDR = address;
+ TWCR = (1<<TWINT) | (1<<TWEN);
+ while (!(TWCR & (1<<TWINT)));
+
+ // check if the device has acknowledged the READ / WRITE mode
+ uint8_t twst = TW_STATUS & 0xF8;
+ if ((twst != TW_MT_SLA_ACK) && (twst != TW_MR_SLA_ACK)) {
+ return 1;
+ }
+
+ return 0;
+}
+
+void i2c_stop(void) {
+ TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
+}
+
+uint8_t i2c_write(uint8_t data) {
+ TWDR = data;
+
+ // transmit data and wait
+ TWCR = (1<<TWINT) | (1<<TWEN);
+ while (!(TWCR & (1<<TWINT)));
+
+ if ((TWSR & 0xF8) != TW_MT_DATA_ACK) {
+ return 1;
+ }
+
+ return 0;
+}
+
+uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length) {
+ if (i2c_start(address)) {
+ return 1;
+ }
+
+ for (uint16_t i = 0; i < length; i++) {
+ if (i2c_write(data[i])) {
+ return 1;
+ }
+ }
+
+ i2c_stop();
+
+ return 0;
+}
diff --git a/keyboards/mehkee96/i2c.h b/keyboards/mehkee96/i2c.h
new file mode 100644
index 0000000000..7ce50cdb57
--- /dev/null
+++ b/keyboards/mehkee96/i2c.h
@@ -0,0 +1,27 @@
+/*
+Copyright 2016 Luiz Ribeiro <luizribeiro@gmail.com>
+
+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 <http://www.gnu.org/licenses/>.
+*/
+
+// Please do not modify this file
+
+#ifndef __I2C_H__
+#define __I2C_H__
+
+void i2c_init(void);
+void i2c_set_bitrate(uint16_t bitrate_khz);
+uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length);
+
+#endif
diff --git a/keyboards/mehkee96/info.json b/keyboards/mehkee96/info.json
new file mode 100644
index 0000000000..75da3e591d
--- /dev/null
+++ b/keyboards/mehkee96/info.json
@@ -0,0 +1,12 @@
+{
+ "keyboard_name": "mehkee96",
+ "url": "",
+ "maintainer": "qmk",
+ "width": 19,
+ "height": 6,
+ "layouts": {
+ "LAYOUT": {
+ "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"Print Screen", "x":13, "y":0}, {"label":"Delete", "x":14, "y":0}, {"label":"Home", "x":15, "y":0}, {"label":"End", "x":16, "y":0}, {"label":"Page Up", "x":17, "y":0}, {"label":"Page Down", "x":18, "y":0}, {"label":"`", "x":0, "y":1}, {"label":"1", "x":1, "y":1}, {"label":"2", "x":2, "y":1}, {"label":"3", "x":3, "y":1}, {"label":"4", "x":4, "y":1}, {"label":"5", "x":5, "y":1}, {"label":"6", "x":6, "y":1}, {"label":"7", "x":7, "y":1}, {"label":"8", "x":8, "y":1}, {"label":"9", "x":9, "y":1}, {"label":"0", "x":10, "y":1}, {"label":"-", "x":11, "y":1}, {"label":"=", "x":12, "y":1}, {"label":"Backspace", "x":13, "y":1, "w":2}, {"label":"Num Lock", "x":15, "y":1}, {"label":"P/", "x":16, "y":1}, {"label":"P*", "x":17, "y":1}, {"label":"P-", "x":18, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"[", "x":11.5, "y":2}, {"label":"]", "x":12.5, "y":2}, {"label":"\\", "x":13.5, "y":2, "w":1.5}, {"label":"P7", "x":15, "y":2}, {"label":"P8", "x":16, "y":2}, {"label":"P9", "x":17, "y":2}, {"label":"P+", "x":18, "y":2}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":";", "x":10.75, "y":3}, {"label":"'", "x":11.75, "y":3}, {"label":"Enter", "x":12.75, "y":3, "w":2.25}, {"label":"P4", "x":15, "y":3}, {"label":"P5", "x":16, "y":3}, {"label":"P6", "x":17, "y":3}, {"label":"P+", "x":18, "y":3}, {"label":"Shift", "x":0, "y":4, "w":2.25}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":",", "x":9.25, "y":4}, {"label":".", "x":10.25, "y":4}, {"label":"/", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"label":"Up", "x":14, "y":4}, {"label":"P1", "x":15, "y":4}, {"label":"P2", "x":16, "y":4}, {"label":"P3", "x":17, "y":4}, {"label":"PEnter", "x":18, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5}, {"label":"Win", "x":11, "y":5}, {"label":"Fn", "x":12, "y":5}, {"label":"Left", "x":13, "y":5}, {"label":"Down", "x":14, "y":5}, {"label":"Right", "x":15, "y":5}, {"label":"P0", "x":16, "y":5}, {"label":"P.", "x":17, "y":5}, {"label":"PEnter", "x":18, "y":5}]
+ }
+ }
+}
diff --git a/keyboards/mehkee96/keymaps/default/keymap.c b/keyboards/mehkee96/keymaps/default/keymap.c
new file mode 100644
index 0000000000..cd69fb2fe9
--- /dev/null
+++ b/keyboards/mehkee96/keymaps/default/keymap.c
@@ -0,0 +1,80 @@
+#include QMK_KEYBOARD_H
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+ /* Layer 0, default layer
+____________________________________________________________________________________________________________________________________________________________________________
+| | | | | | | | | | | | | | | | | | | |
+| ESC* | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | P SCN | DEL | HOME | END | P Up | P Down |
+|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|
+| | | | | | | | | | | | | | | BACK | NUM | | | |
+| ~` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | _ - | = + | \ | SPACE | LOCK | / | * | - |
+|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|
+| | | | | | | | | | | | [ | ] | | | | | |
+| TAB | Q | W | E | R | T | Y | U | I | O | P | { | } | | \ | 7 | 8 | 9 | + |
+|____________|________|________|________|________|________|________|________|________|________|________|________|________|_____________|________|________|________|________|
+| | | | | | | | | | | ; | ' | | | | | |
+| CAPS LOCK | A | S | D | F | G | H | J | K | L | : | " | ENTER | 4 | 5 | 6 | + |
+|______________|________|________|________|________|________|________|________|________|________|________|________|____________________|________|________|________|________|
+| | | | | | | | | , | . | / | | | | | | |
+| SHIFT | Z | X | C | V | B | N | M | < | > | ? | SHIFT | UP | 1 | 2 | 3 | ENTER |
+|__________________|________|________|________|________|________|________|________|________|________|________|________________|________|________|________|________|________|
+| | | | | | | MO | | | | | | |
+| CTRL | LGUI | L ALT | SPACE | R ALT | RGUI | _FN | LEFT | DOWN | RIGHT | 0 | . | ENTER |
+|__________|__________|__________|________________________________________________________|________|________|________|________|________|________|________|________|________|
+*/
+
+
+
+ LAYOUT(
+ KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, KC_HOME, KC_END, KC_PGUP, KC_PGDN,
+ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
+ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PPLS,
+ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS,
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT,
+ KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT),
+
+
+
+ /* Layer 1, function layer
+____________________________________________________________________________________________________________________________________________________________________________
+| | | | | | | | | | | | | | | VOL | VOL | | | |
+| RESET | | | | | | | | | | | | | MUTE | DOWN | UP | | | |
+|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|
+| | | | | | | | | | | | | | | | | | | |
+| | | | | | | | | | | | | | | | | | | |
+|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|
+| | RGB | | RGB | HUE | HUE | SATUR. | SATUR. | VALUE | VALUE | | | | | | | | |
+| | TOGGLE | | MODE |INCREASE| DCRSE |INCREASE| DCRSE |INCREASE| DCRSE | | | | | | | | |
+|____________|________|________|________|________|________|________|________|________|________|________|________|________|_____________|________|________|________|________|
+| BACKLIGHT | | | | | | | | | | | | | | | | |
+| TOGGLE | | | | | | | | | | | | | | | | |
+|______________|________|________|________|________|________|________|________|________|________|________|________|____________________|________|________|________|________|
+| | | | |BACKLHT |BACKLHT |BACKLHT | | | | | | | | | | | |
+| | | | | DCRSE |TOGGLE |INCREASE| | | | | | | | | | | |
+|_________|________|________|________|________|________|________|________|________|________|________|________|________________|________|________|________|________|________|
+| | | | | | | | | | | | | |
+| | | | | | | | | | | | | |
+|__________|__________|__________|________________________________________________________|________|________|________|________|________|________|________|________|________|
+BL_TOGG, BL_DEC, BL_INC changes the in-switch LEDs
+*/
+
+
+ LAYOUT(
+ RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, RGB_TOG, _______, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______,
+ BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______ , _______, _______, BL_DEC, BL_TOGG, BL_INC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
+};
+
+void matrix_init_user(void) {
+}
+
+void matrix_scan_user(void) {
+}
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ return true;
+}
diff --git a/keyboards/mehkee96/keymaps/johann/keymap.c b/keyboards/mehkee96/keymaps/johann/keymap.c
new file mode 100644
index 0000000000..a0212702ab
--- /dev/null
+++ b/keyboards/mehkee96/keymaps/johann/keymap.c
@@ -0,0 +1,80 @@
+#include "mehkee96.h"
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+ /* Layer 0, default layer
+____________________________________________________________________________________________________________________________________________________________________________
+| | | | | | | | | | | | | | | | | | | |
+| ESC* | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | P SCN | HOME | DEL | INSERT | P Up | P Down |
+|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|
+| | | | | | | | | | | | | | | BACK | NUM | | | Play |
+| ~` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | _ - | = + | \ | SPACE | LOCK | / | * | Pause |
+|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|
+| | | | | | | | | | | | [ | ] | | | | | |
+| TAB | Q | W | E | R | T | Y | U | I | O | P | { | } | | \ | 7 | 8 | 9 | Next |
+|____________|________|________|________|________|________|________|________|________|________|________|________|________|_____________|________|________|________|________|
+| | | | | | | | | | | ; | ' | | | | | |
+| CAPS LOCK | A | S | D | F | G | H | J | K | L | : | " | ENTER | 4 | 5 | 6 | - |
+|______________|________|________|________|________|________|________|________|________|________|________|________|____________________|________|________|________|________|
+| | | | | | | | | , | . | / | | | | | | |
+| SHIFT | Z | X | C | V | B | N | M | < | > | ? | SHIFT | UP | 1 | 2 | 3 | + |
+|__________________|________|________|________|________|________|________|________|________|________|________|________________|________|________|________|________|________|
+| | | | | | | MO | | | | | | |
+| CTRL | LGUI | L ALT | SPACE | R ALT | RGUI | _FN | LEFT | DOWN | RIGHT | 0 | . | ENTER |
+|__________|__________|__________|________________________________________________________|________|________|________|________|________|________|________|________|________|
+*/
+
+
+
+ LAYOUT(
+ KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_HOME, KC_DEL, KC_INS, KC_PGUP, KC_PGDN,
+ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_MPLY,
+ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_MNXT,
+ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PMNS,
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PPLS,
+ KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT),
+
+
+
+ /* Layer 1, function layer
+____________________________________________________________________________________________________________________________________________________________________________
+| | | | | | | | | | | | | | | VOL | VOL | | | |
+| RESET | | | | | | | | | | | | | MUTE | DOWN | UP | | | |
+|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|
+| | | | | | | | | | | | | | | | | | | |
+| | | | | | | | | | | | | | | | | | | |
+|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|
+| | RGB | | RGB | HUE | HUE | SATUR. | SATUR. | VALUE | VALUE | | | | | | | | |
+| | TOGGLE | | MODE |INCREASE| DCRSE |INCREASE| DCRSE |INCREASE| DCRSE | | | | | | | | |
+|____________|________|________|________|________|________|________|________|________|________|________|________|________|_____________|________|________|________|________|
+| BACKLIGHT | | | | | | | | | | | | | | | | |
+| TOGGLE | | | | | | | | | | | | | | | | |
+|______________|________|________|________|________|________|________|________|________|________|________|________|____________________|________|________|________|________|
+| | | | |BACKLHT |BACKLHT |BACKLHT | | | | | | | | | | | |
+| | | | | DCRSE |TOGGLE |INCREASE| | | | | | | | | | | |
+|_________|________|________|________|________|________|________|________|________|________|________|________|________________|________|________|________|________|________|
+| | | | | | | | | | | | | |
+| | | | | | | | | | | | | |
+|__________|__________|__________|________________________________________________________|________|________|________|________|________|________|________|________|________|
+BL_TOGG, BL_DEC, BL_INC changes the in-switch LEDs
+*/
+
+
+ LAYOUT(
+ RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, RGB_TOG, _______, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______,
+ BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______ , _______, _______, BL_DEC, BL_TOGG, BL_INC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
+};
+
+void matrix_init_user(void) {
+}
+
+void matrix_scan_user(void) {
+}
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ return true;
+}
diff --git a/keyboards/mehkee96/matrix.c b/keyboards/mehkee96/matrix.c
new file mode 100644
index 0000000000..bbb84e52e4
--- /dev/null
+++ b/keyboards/mehkee96/matrix.c
@@ -0,0 +1,130 @@
+/*
+Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
+
+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 <http://www.gnu.org/licenses/>.
+*/
+
+#include <avr/io.h>
+#include <util/delay.h>
+
+#include "matrix.h"
+
+#ifndef DEBOUNCE
+# define DEBOUNCE 5
+#endif
+
+static uint8_t debouncing = DEBOUNCE;
+
+static matrix_row_t matrix[MATRIX_ROWS];
+static matrix_row_t matrix_debouncing[MATRIX_ROWS];
+
+void matrix_set_row_status(uint8_t row);
+uint8_t bit_reverse(uint8_t x);
+
+__attribute__ ((weak))
+void matrix_init_kb(void) {
+ matrix_init_user();
+}
+
+__attribute__ ((weak))
+void matrix_scan_kb(void) {
+ matrix_scan_user();
+}
+
+__attribute__ ((weak))
+void matrix_init_user(void) {
+}
+
+__attribute__ ((weak))
+void matrix_scan_user(void) {
+}
+
+void matrix_init(void) {
+ // all outputs for rows high
+ DDRB = 0xFF;
+ PORTB = 0xFF;
+ // all inputs for columns
+ DDRA = 0x00;
+ DDRC &= ~(0x111111<<2);
+ DDRD &= ~(1<<PIND7);
+ // all columns are pulled-up
+ PORTA = 0xFF;
+ PORTC |= (0b111111<<2);
+ PORTD |= (1<<PIND7);
+
+ // initialize matrix state: all keys off
+ for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
+ matrix[row] = 0x00;
+ matrix_debouncing[row] = 0x00;
+ }
+
+ matrix_init_quantum();
+}
+
+uint8_t matrix_scan(void) {
+ for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
+ matrix_set_row_status(row);
+ _delay_us(5);
+
+ matrix_row_t cols = (
+ // cols 0..7, PORTA 0 -> 7
+ (~PINA) & 0xFF
+ ) | (
+ // cols 8..13, PORTC 7 -> 0
+ bit_reverse((~PINC) & 0xFF) << 8
+ ) | (
+ // col 14, PORTD 7
+ ((~PIND) & (1 << PIND7)) << 7
+ );
+
+ if (matrix_debouncing[row] != cols) {
+ matrix_debouncing[row] = cols;
+ debouncing = DEBOUNCE;
+ }
+ }
+
+ if (debouncing) {
+ if (--debouncing) {
+ _delay_ms(1);
+ } else {
+ for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
+ matrix[i] = matrix_debouncing[i];
+ }
+ }
+ }
+
+ matrix_scan_quantum();
+
+ return 1;
+}
+
+// declarations
+void matrix_set_row_status(uint8_t row) {
+ DDRB = (1 << row);
+ PORTB = ~(1 << row);
+}
+
+uint8_t bit_reverse(uint8_t x) {
+ x = ((x >> 1) & 0x55) | ((x << 1) & 0xaa);
+ x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc);
+ x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0);
+ return x;
+}
+
+inline matrix_row_t matrix_get_row(uint8_t row) {
+ return matrix[row];
+}
+
+void matrix_print(void) {
+}
diff --git a/keyboards/mehkee96/mehkee96.c b/keyboards/mehkee96/mehkee96.c
new file mode 100644
index 0000000000..604fad8032
--- /dev/null
+++ b/keyboards/mehkee96/mehkee96.c
@@ -0,0 +1,81 @@
+/*
+Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
+
+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 <http://www.gnu.org/licenses/>.
+*/
+
+#include "mehkee96.h"
+#include "rgblight.h"
+
+#include <avr/pgmspace.h>
+
+#include "action_layer.h"
+#include "i2c.h"
+#include "quantum.h"
+
+// for keyboard subdirectory level init functions
+// @Override
+void matrix_init_kb(void) {
+ // call user level keymaps, if any
+ matrix_init_user();
+}
+
+#ifdef RGBLIGHT_ENABLE
+extern rgblight_config_t rgblight_config;
+
+// custom RGB driver
+void rgblight_set(void) {
+ if (!rgblight_config.enable) {
+ for (uint8_t i=0; i<RGBLED_NUM; i++) {
+ led[i].r = 0;
+ led[i].g = 0;
+ led[i].b = 0;
+ }
+ }
+
+ i2c_init();
+ i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM);
+}
+
+bool rgb_init = false;
+
+void matrix_scan_kb(void) {
+ // if LEDs were previously on before poweroff, turn them back on
+ if (rgb_init == false && rgblight_config.enable) {
+ i2c_init();
+ i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM);
+ rgb_init = true;
+ }
+
+#ifdef RGBLIGHT_ANIMATION
+ rgblight_task();
+#endif
+
+#else
+void matrix_scan_kb(void) {
+#endif
+ matrix_scan_user();
+ /* Nothing else for now. */
+}
+
+__attribute__((weak)) // overridable
+void matrix_init_user(void) {
+
+}
+
+
+__attribute__((weak)) // overridable
+void matrix_scan_user(void) {
+
+}
diff --git a/keyboards/mehkee96/mehkee96.h b/keyboards/mehkee96/mehkee96.h
new file mode 100644
index 0000000000..1e1eb44a64
--- /dev/null
+++ b/keyboards/mehkee96/mehkee96.h
@@ -0,0 +1,24 @@
+#ifndef KEYMAP_COMMON_H
+#define KEYMAP_COMMON_H
+
+#include "quantum.h"
+
+#define LAYOUT( \
+ K05, K25, K35, K45, K55, K06, KA6, KA7, K07, KB5, KC5, KD5, KE5, KD1, KE2, KD0, K67, K87, K97, \
+ K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, K64, K74, K84, K94, \
+ K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC3, KD3, K63, K73, K83, K93, \
+ K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KB2, KD2, K62, K72, K82, K92, \
+ K01, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KB1, K86, K61, K71, K81, K91, \
+ K00, K10, K20, K56, K57, KA0, KB0, K66, K76, K96, K60, K80, K90 \
+) { \
+ { K00, K10, K20, KC_NO, KC_NO, KC_NO, K60, KC_NO, K80, K90, KA0, KB0, KC_NO, KD0, KC_NO }, \
+ { K01, K11, K21, K31, K41, K51, K61, K71, K81, K91, KA1, KB1, KC_NO, KD1, KC_NO }, \
+ { K02, K12, K22, K32, K42, K52, K62, K72, K82, K92, KA2, KB2, KC_NO, KD2, KE2 }, \
+ { K03, K13, K23, K33, K43, K53, K63, K73, K83, K93, KA3, KB3, KC3, KD3, KC_NO }, \
+ { K04, K14, K24, K34, K44, K54, K64, K74, K84, K94, KA4, KB4, KC4, KC_NO, KE4 }, \
+ { K05, KC_NO, K25, K35, K45, K55, KC_NO, KC_NO,KC_NO, KC_NO, KC_NO, KB5, KC5, KD5, KE5 }, \
+ { K06, K16, K26, K36, K46, K56, K66, K76, K86, K96, KA6, KB6, KC6, KD6, KE6 }, \
+ { K07, K17, K27, K37, K47, K57, K67, KC_NO,K87, K97, KA7, KB7, KC7, KD7, KE7 } \
+}
+
+#endif
diff --git a/keyboards/mehkee96/program b/keyboards/mehkee96/program
new file mode 100644
index 0000000000..b777b91106
--- /dev/null
+++ b/keyboards/mehkee96/program
@@ -0,0 +1,105 @@
+#!/usr/bin/env python
+# Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>, Sebastian Kaim <sebb@sebb767.de>
+#
+# 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 <http://www.gnu.org/licenses/>.
+
+from __future__ import print_function
+
+import os
+import sys
+import time
+import usb
+
+
+def checkForKeyboardInNormalMode():
+ """Returns a device if a ps2avrGB device in normal made (that is in keyboard mode) or None if it is not found."""
+ return usb.core.find(idVendor=0x20A0, idProduct=0x422D)
+
+def checkForKeyboardInBootloaderMode():
+ """Returns True if a ps2avrGB device in bootloader (flashable) mode is found and False otherwise."""
+ return (usb.core.find(idVendor=0x16c0, idProduct=0x05df) is not None)
+
+def flashKeyboard(firmware_file):
+ """Calls bootloadHID to flash the given file to the device."""
+ print('Flashing firmware to device ...')
+ if os.system('bootloadHID -r "%s"' % firmware_file) == 0:
+ print('\nDone!')
+ else:
+ print('\nbootloadHID returned an error.')
+
+def printDeviceInfo(dev):
+ """Prints all infos for a given USB device"""
+ print('Device Information:')
+ print(' idVendor: %d (0x%04x)' % (dev.idVendor, dev.idVendor))
+ print(' idProduct: %d (0x%04x)' % (dev.idProduct, dev.idProduct))
+ print('Manufacturer: %s' % (dev.iManufacturer))
+ print('Serial: %s' % (dev.iSerialNumber))
+ print('Product: %s' % (dev.iProduct), end='\n\n')
+
+def sendDeviceToBootloaderMode(dev):
+ """Tries to send a given ps2avrGB keyboard to bootloader mode to allow flashing."""
+ try:
+ dev.set_configuration()
+
+ request_type = usb.util.build_request_type(
+ usb.util.CTRL_OUT,
+ usb.util.CTRL_TYPE_CLASS,
+ usb.util.CTRL_RECIPIENT_DEVICE)
+
+ USBRQ_HID_SET_REPORT = 0x09
+ HID_REPORT_OPTION = 0x0301
+
+ dev.ctrl_transfer(request_type, USBRQ_HID_SET_REPORT, HID_REPORT_OPTION, 0, [0, 0, 0xFF] + [0] * 5)
+ except usb.core.USBError:
+ # for some reason I keep getting USBError, but it works!
+ pass
+
+
+if len(sys.argv) < 2:
+ print('Usage: %s <firmware.hex>' % sys.argv[0])
+ sys.exit(1)
+
+kb = checkForKeyboardInNormalMode()
+
+if kb is not None:
+ print('Found a keyboard in normal mode. Attempting to send it to bootloader mode ...', end='')
+ sendDeviceToBootloaderMode(kb)
+ print(' done.')
+ print("Hint: If your keyboard can't be set to bootloader mode automatically, plug it in while pressing the bootloader key to do so manually.")
+ print(" You can find more infos about this here: https://github.com/qmk/qmk_firmware/tree/master/keyboards/ps2avrGB#setting-the-board-to-bootloader-mode")
+
+attempts = 12 # 60 seconds
+found = False
+for attempt in range(1, attempts + 1):
+ print("Searching for keyboard in bootloader mode (%i/%i) ... " % (attempt, attem