aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Broqua <dbroqua@mousur.org>2017-05-30 22:15:07 +0200
committerDamien Broqua <dbroqua@mousur.org>2017-05-30 22:15:07 +0200
commit55d675025430df2d22bdafdc76d9493af53b7eb8 (patch)
treeff57d2f46b5d7133687455f6600ad7c1786c2d17
parent6b994ecd82f660feb44bac376ae7d0147d40d818 (diff)
parente280f7aad7cb0abeaae2cfeb47bba02d4b83875e (diff)
downloadqmk_firmware-55d675025430df2d22bdafdc76d9493af53b7eb8.tar.gz
qmk_firmware-55d675025430df2d22bdafdc76d9493af53b7eb8.zip
Merge remote-tracking branch 'origin/feature/DK60'
-rw-r--r--keyboards/dk60/Makefile3
-rw-r--r--keyboards/dk60/config.h56
-rw-r--r--keyboards/dk60/dk60.c34
-rw-r--r--keyboards/dk60/dk60.h42
-rw-r--r--keyboards/dk60/keymaps/default/keymap.c80
-rw-r--r--keyboards/dk60/readme.md6
-rw-r--r--keyboards/dk60/rules.mk21
7 files changed, 242 insertions, 0 deletions
diff --git a/keyboards/dk60/Makefile b/keyboards/dk60/Makefile
new file mode 100644
index 000000000..4e2a6f00f
--- /dev/null
+++ b/keyboards/dk60/Makefile
@@ -0,0 +1,3 @@
1ifndef MAKEFILE_INCLUDED
2 include ../../Makefile
3endif \ No newline at end of file
diff --git a/keyboards/dk60/config.h b/keyboards/dk60/config.h
new file mode 100644
index 000000000..e586056cf
--- /dev/null
+++ b/keyboards/dk60/config.h
@@ -0,0 +1,56 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#ifndef CONFIG_H
19 #define CONFIG_H
20
21 #include "config_common.h"
22
23 /* USB Device descriptor parameter */
24 #define VENDOR_ID 0xFEED
25 #define PRODUCT_ID 0x6060
26 #define DEVICE_VER 0x0003
27 #define MANUFACTURER DARKOU
28 #define PRODUCT DK60
29 #define DESCRIPTION QMK keyboard firmware for DK60 support
30
31 /* key matrix size */
32 #define MATRIX_ROWS 5
33 #define MATRIX_COLS 13
34
35 // ROWS: Top to bottom, COLS: Left to right
36
37 #define MATRIX_ROW_PINS { B6, B4, D7, D6, D4 }
38 #define MATRIX_COL_PINS { B0, B3, B2, B1, D3, D5, B5, B7, C6, C7, D0, D1, D2 }
39 #define UNUSED_PINS
40
41 /* COL2ROW or ROW2COL */
42 #define DIODE_DIRECTION COL2ROW
43
44 /* Set 0 if debouncing isn't needed */
45 #define DEBOUNCING_DELAY 5
46
47 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
48 #define LOCKING_SUPPORT_ENABLE
49 /* Locking resynchronize hack */
50 #define LOCKING_RESYNC_ENABLE
51
52 /* key combination for command */
53 #define IS_COMMAND() ( \
54 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
55 )
56#endif
diff --git a/keyboards/dk60/dk60.c b/keyboards/dk60/dk60.c
new file mode 100644
index 000000000..93aeb33b4
--- /dev/null
+++ b/keyboards/dk60/dk60.c
@@ -0,0 +1,34 @@
1#include "dk60.h"
2
3void dk60_blink_all_leds(void)
4{
5 dk60_led_all_off();
6 dk60_led_all_on();
7 _delay_ms(500);
8 dk60_led_all_off();
9}
10
11void matrix_init_kb(void) {
12 led_init_ports();
13 dk60_blink_all_leds();
14
15 matrix_init_user();
16}
17
18void led_init_ports(void) {
19 // * Set our LED pins as output
20 DDRE |= (1<<6);
21 DDRF |= (1<<0);
22}
23
24void led_set_kb(uint8_t usb_led) {
25 if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
26 // Turn capslock on
27 dk60_caps_led_on();
28 } else {
29 // Turn capslock off
30 dk60_caps_led_off();
31 }
32
33 led_set_user(usb_led);
34}
diff --git a/keyboards/dk60/dk60.h b/keyboards/dk60/dk60.h
new file mode 100644
index 000000000..859e88e03
--- /dev/null
+++ b/keyboards/dk60/dk60.h
@@ -0,0 +1,42 @@
1#ifndef DK60_H
2 #define DK60_H
3
4 #include "quantum.h"
5 #include <util/delay.h>
6// #include "led.h"
7
8 inline void dk60_caps_led_on(void) { PORTE |= (1<<6); }
9 inline void dk60_esc_led_on(void) { PORTF |= (1<<0); }
10
11 inline void dk60_caps_led_off(void) { PORTE &= ~(1<<6); }
12 inline void dk60_esc_led_off(void) { PORTF &= ~(1<<0); }
13
14 inline void dk60_led_all_on(void)
15 {
16 dk60_caps_led_on();
17 dk60_esc_led_on();
18 }
19
20 inline void dk60_led_all_off(void)
21 {
22 dk60_caps_led_off();
23 dk60_esc_led_off();
24 }
25
26 #define ___ KC_NO
27
28 #define KEYMAP( \
29 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K4B, K4A, \
30 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K4C, \
31 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \
32 K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \
33 K41, K42, K45, K48, K49 \
34 ) { \
35 { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C }, \
36 { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C }, \
37 { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C }, \
38 { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C }, \
39 { ___, K41, K42, ___, ___, K45, ___, ___, K48, K49, K4A, K4B, K4C } \
40 }
41
42#endif
diff --git a/keyboards/dk60/keymaps/default/keymap.c b/keyboards/dk60/keymaps/default/keymap.c
new file mode 100644
index 000000000..a6a3b83f0
--- /dev/null
+++ b/keyboards/dk60/keymaps/default/keymap.c
@@ -0,0 +1,80 @@
1#include "dk60.h"
2#include "action_layer.h"
3
4enum planck_layers {
5 _QWERTY,
6 _FN,
7 _DVORAK,
8 _LOWER,
9 _RAISE,
10 _PLOVER,
11 _ADJUST
12};
13
14enum planck_keycodes {
15 QWERTY = SAFE_RANGE,
16 FN
17};
18
19// Fillers to make layering more clear
20#define ______ KC_TRNS
21
22const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
23/* Qwerty gui/alt/space/alt/gui
24 * ,-----------------------------------------------------------------------------------------.
25 * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` |
26 * |-----------------------------------------------------------------------------------------+
27 * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Bksp |
28 * |-----------------------------------------------------------------------------------------+
29 * | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | Enter |
30 * |-----------------------------------------------------------------------------------------+
31 * | Shift | Z | X | C | V | B | N | M | , | . | / | RShift | FN |
32 * |-----------------------------------------------------------------------------------------+
33 * |LGUI | LAlt | Space | RAlt |RGUI |
34 * `-----------------------------------------------------------------'
35 */
36 [_QWERTY] = KEYMAP( /* Basic QWERTY */
37 KC_ESC, 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_BSLS, KC_GRV, \
38 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_BSPC, \
39 KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \
40 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, FN, \
41 KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI \
42 ),
43
44/* FN Layer
45 * ,-----------------------------------------------------------------------------------------.
46 * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del |
47 * |-----------------------------------------------------------------------------------------+
48 * | CAPS | | | | | | | | Psc | Slck| Paus| Up | | |
49 * |-----------------------------------------------------------------------------------------+
50 * | | Vol-| Vol+| Mute| | | * | / | Home| PgUp| Left|Right| |
51 * |-----------------------------------------------------------------------------------------+
52 * | | Prev| Play| Next| | | + | - | End |PgDn| Down| | |
53 * |-----------------------------------------------------------------------------------------+
54 * | | | | Stop | |
55 * `-----------------------------------------------------------------'
56 */
57 [_FN] = KEYMAP( /* Layer 1 */
58 ______, 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_INS, KC_DEL, \
59 KC_CAPS, ______, ______, ______, ______, ______, ______, ______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, ______, ______, \
60 ______, KC_VOLD,KC_VOLU,KC_MUTE,______, ______, KC_PAST,KC_PSLS,KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, ______, \
61 ______, KC_MPRV,KC_MPLY,KC_MNXT,______, ______, KC_PPLS,KC_PMNS,KC_END, KC_PGDN, KC_DOWN, ______, ______, \
62 ______, ______, ______, KC_MSTP, ______ \
63 )
64};
65
66bool process_record_user(uint16_t keycode, keyrecord_t *record) {
67 switch (keycode) {
68 case FN:
69 if (record->event.pressed) {
70 layer_on(_FN);
71 dk60_esc_led_on();
72 } else {
73 layer_off(_FN);
74 dk60_esc_led_off();
75 }
76 return false;
77 break;
78 }
79 return true;
80}
diff --git a/keyboards/dk60/readme.md b/keyboards/dk60/readme.md
new file mode 100644
index 000000000..82e6d0c32
--- /dev/null
+++ b/keyboards/dk60/readme.md
@@ -0,0 +1,6 @@
1DK60 keyboard firmware
2======================
3
4Another 60% keyboard with different HHKB layout
5
6More information here: https://github.com/Dbroqua/MX_HHKB \ No newline at end of file
diff --git a/keyboards/dk60/rules.mk b/keyboards/dk60/rules.mk
new file mode 100644
index 000000000..36c6bed17
--- /dev/null
+++ b/keyboards/dk60/rules.mk
@@ -0,0 +1,21 @@
1MCU = atmega32u4
2F_CPU = 16000000
3ARCH = AVR8
4F_USB = $(F_CPU)
5OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
6OPT_DEFS += -DBOOTLOADER_SIZE=4096
7
8BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
9MOUSEKEY_ENABLE ?= no # Mouse keys(+4700)
10EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
11# CONSOLE_ENABLE ?= yes # Console for debug(+400)
12# COMMAND_ENABLE ?= yes # Commands for debug and configuration
13KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key
14NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
15RGBLIGHT_ENABLE ?= no # Enable keyboard underlight functionality (+4870)
16BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality (+1150)
17MIDI_ENABLE ?= no # MIDI controls
18AUDIO_ENABLE ?= no
19UNICODE_ENABLE ?= yes # Unicode
20BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
21SLEEP_LED_ENABLE ?= yes