aboutsummaryrefslogtreecommitdiff
path: root/keyboards/ok60
diff options
context:
space:
mode:
authoredwardbrowncross <35063432+edwardbrowncross@users.noreply.github.com>2018-03-09 18:14:50 +0000
committerJack Humbert <jack.humb@gmail.com>2018-03-09 13:14:50 -0500
commiteba4b08a4a8734bb6c74602e317981a4542c634d (patch)
tree8c7e97699ac9ba5f2e08c5b25588e725ddce6e6d /keyboards/ok60
parent7d9dc61504d1251f8d0bd8ab58fb6a47234b52ef (diff)
downloadqmk_firmware-eba4b08a4a8734bb6c74602e317981a4542c634d.tar.gz
qmk_firmware-eba4b08a4a8734bb6c74602e317981a4542c634d.zip
Add the OK60 keyboard (#2488)
* Add the OK60 keyboard * Fix ok60 incorrect ANSI keymap signature Add support for default ansi and iso 60 keymaps
Diffstat (limited to 'keyboards/ok60')
-rw-r--r--keyboards/ok60/config.h84
-rw-r--r--keyboards/ok60/keymaps/default/keymap.c18
-rw-r--r--keyboards/ok60/keymaps/ebrowncross/keymap.c29
-rw-r--r--keyboards/ok60/ok60.c1
-rw-r--r--keyboards/ok60/ok60.h37
-rw-r--r--keyboards/ok60/pinout.txt12
-rw-r--r--keyboards/ok60/readme.md16
-rw-r--r--keyboards/ok60/rules.mk66
8 files changed, 263 insertions, 0 deletions
diff --git a/keyboards/ok60/config.h b/keyboards/ok60/config.h
new file mode 100644
index 000000000..61c2fa0ed
--- /dev/null
+++ b/keyboards/ok60/config.h
@@ -0,0 +1,84 @@
1/*
2Copyright 2018 Edward Browncross
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 0x0001
27#define MANUFACTURER OK60
28#define PRODUCT OK60
29#define DESCRIPTION qmk keyboard firmware for OK60
30
31/* key matrix size */
32#define MATRIX_ROWS 5
33#define MATRIX_COLS 15
34
35/*
36 * Keyboard Matrix Assignments
37 *
38 * Change this to how you wired your keyboard
39 * COLS: AVR pins used for columns, left to right
40 * ROWS: AVR pins used for rows, top to bottom
41 * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
42 * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
43 *
44*/
45#define MATRIX_ROW_PINS { B5, B4, D7, D6, D4 }
46#define MATRIX_COL_PINS { D0, D1, D2, D3, D5, B6, C6, C7, F1, F0, E6, B3, B2, B1, B0 }
47#define UNUSED_PINS
48
49#define BACKLIGHT_PIN B7
50
51/* COL2ROW or ROW2COL */
52#define DIODE_DIRECTION COL2ROW
53
54/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
55#define DEBOUNCING_DELAY 5
56
57/* define if matrix has ghost (lacks anti-ghosting diodes) */
58//#define MATRIX_HAS_GHOST
59
60/* number of backlight levels */
61#define BACKLIGHT_LEVELS 5
62
63/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
64#define LOCKING_SUPPORT_ENABLE
65
66/* Locking resynchronize hack */
67#define LOCKING_RESYNC_ENABLE
68
69/* key combination for command */
70#define IS_COMMAND() ( \
71 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
72)
73
74/* prevent stuck modifiers */
75#define PREVENT_STUCK_MODIFIERS
76
77#define RGB_DI_PIN F6
78#define RGBLIGHT_ANIMATIONS
79#define RGBLED_NUM 10
80#define RGBLIGHT_HUE_STEP 8
81#define RGBLIGHT_SAT_STEP 8
82#define RGBLIGHT_VAL_STEP 8
83
84#endif
diff --git a/keyboards/ok60/keymaps/default/keymap.c b/keyboards/ok60/keymaps/default/keymap.c
new file mode 100644
index 000000000..7fd3b8f72
--- /dev/null
+++ b/keyboards/ok60/keymaps/default/keymap.c
@@ -0,0 +1,18 @@
1#include "ok60.h"
2
3const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
4
5 KEYMAP_ANSI(
6 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_BSPC,
7 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,
8 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,
9 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT,
10 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, MO(1), KC_MENU, KC_LCTL),
11
12 KEYMAP_ANSI(
13 RESET, 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_DEL,
14 KC_TRNS, RGB_TOG, KC_UP, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
15 KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
16 KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
17 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
18};
diff --git a/keyboards/ok60/keymaps/ebrowncross/keymap.c b/keyboards/ok60/keymaps/ebrowncross/keymap.c
new file mode 100644
index 000000000..904262f03
--- /dev/null
+++ b/keyboards/ok60/keymaps/ebrowncross/keymap.c
@@ -0,0 +1,29 @@
1#include "ok60.h"
2
3// An ISO UK keymap
4
5#define _______ KC_TRNS
6
7const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
8
9 KEYMAP_ISO(
10 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_BSPC,
11 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,
12 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_NUHS, KC_ENT,
13 KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
14 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_LGUI, KC_MENU, KC_LCTL),
15
16 KEYMAP_ISO(
17 KC_GRAVE, 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_DEL,
18 _______, KC_HOME, KC_UP, KC_END, KC_PGUP, _______, _______, _______, _______, _______, KC_INS, KC_HOME, KC_PGUP,
19 _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, _______, _______, _______, _______, KC_DEL, KC_END, KC_PGDN, KC_PSCR,
20 _______, _______, BL_DEC, BL_TOGG, BL_INC, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU,
21 _______, _______, _______, _______, _______, MO(2), _______, _______),
22
23 KEYMAP_ISO(
24 _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_F9, KC_F10, KC_F11, KC_F12, _______,
25 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
26 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
27 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
28 _______, _______, _______, _______, _______, _______, _______, _______),
29};
diff --git a/keyboards/ok60/ok60.c b/keyboards/ok60/ok60.c
new file mode 100644
index 000000000..052656205
--- /dev/null
+++ b/keyboards/ok60/ok60.c
@@ -0,0 +1 @@
#include "ok60.h"
diff --git a/keyboards/ok60/ok60.h b/keyboards/ok60/ok60.h
new file mode 100644
index 000000000..5511bf0f5
--- /dev/null
+++ b/keyboards/ok60/ok60.h
@@ -0,0 +1,37 @@
1#ifndef OK60_H
2#define OK60_H
3
4#include "quantum.h"
5
6#define KEYMAP_ANSI( \
7 K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, \
8 K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \
9 K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K213, \
10 K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \
11 K400, K401, K402, K406, K410, K411, K412, K413 \
12) { \
13 { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, K014 }, \
14 { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, KC_NO }, \
15 { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, KC_NO, K213, KC_NO }, \
16 { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO }, \
17 { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, K412, K413, KC_NO } \
18}
19
20#define KEYMAP_ISO( \
21 K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, \
22 K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, \
23 K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \
24 K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \
25 K400, K401, K402, K406, K410, K411, K412, K413 \
26) { \
27 { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, K014 }, \
28 { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, KC_NO, KC_NO }, \
29 { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \
30 { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO }, \
31 { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, K412, K413, KC_NO } \
32}
33
34#define LAYOUT_60_ansi KEYMAP_ANSI
35#define LAYOUT_60_iso KEYMAP_ISO
36
37#endif
diff --git a/keyboards/ok60/pinout.txt b/keyboards/ok60/pinout.txt
new file mode 100644
index 000000000..ec557ce4b
--- /dev/null
+++ b/keyboards/ok60/pinout.txt
@@ -0,0 +1,12 @@
1 /* Column pin configuration
2 * col: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
3 * pin: D0 D1 D2 D3 D5 B6 C6 C7 F1 F0 E6 B3 B2 B1 B0
4 */
5
6 /* Row pin configuration
7 * row: 0 1 2 3 4
8 * pin: B5 B4 D7 D6 D4
9 */
10
11 B7 LED backlight
12 F6 WS2812 Strip
diff --git a/keyboards/ok60/readme.md b/keyboards/ok60/readme.md
new file mode 100644
index 000000000..cd9951c54
--- /dev/null
+++ b/keyboards/ok60/readme.md
@@ -0,0 +1,16 @@
1# OK60
2
3![OK60](https://i.imgur.com/X1rISXS.png)
4
5A 60% keyboard PCB sold on AliExpress by Shenzhen YMD Tech Co.,Ltd.
6It supports the same layouts and cases as the GH60 but comes with WS2812 RGB underglow.
7
8Keyboard Maintainer: [Edward Browncross](https://github.com/edwardbrowncross)
9Hardware Supported: OK60 PCB, OK60XRGB, Diamond 60 Keyboard
10Hardware Availability: [AliExpress](https://www.aliexpress.com/store/product/Free-shipping-Pre-soldered-Diode-Resistance-Satan-GH60-PCB-Board-Programmable-DIY-Mechanical-Keyboard-Poker-2/429151_32809893696.html)
11
12Make example for this keyboard (after setting up your build environment):
13
14 make ok60:default
15
16See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
diff --git a/keyboards/ok60/rules.mk b/keyboards/ok60/rules.mk
new file mode 100644
index 000000000..a642c83b0
--- /dev/null
+++ b/keyboards/ok60/rules.mk
@@ -0,0 +1,66 @@
1# MCU name
2MCU = atmega32u4
3
4# Processor frequency.
5# This will define a symbol, F_CPU, in all source code files equal to the
6# processor frequency in Hz. You can then use this symbol in your source code to
7# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
8# automatically to create a 32-bit value in your source code.
9#
10# This will be an integer division of F_USB below, as it is sourced by
11# F_USB after it has run through any CPU prescalers. Note that this value
12# does not *change* the processor frequency - it should merely be updated to
13# reflect the processor speed set externally so that the code can use accurate
14# software delays.
15F_CPU = 16000000
16
17
18#
19# LUFA specific
20#
21# Target architecture (see library "Board Types" documentation).
22ARCH = AVR8
23
24# Input clock frequency.
25# This will define a symbol, F_USB, in all source code files equal to the
26# input clock frequency (before any prescaling is performed) in Hz. This value may
27# differ from F_CPU if prescaling is used on the latter, and is required as the
28# raw input clock is fed directly to the PLL sections of the AVR for high speed
29# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
30# at the end, this will be done automatically to create a 32-bit value in your
31# source code.
32#
33# If no clock division is performed on the input clock inside the AVR (via the
34# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
35F_USB = $(F_CPU)
36
37# Interrupt driven control endpoint task(+60)
38OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
39
40
41# Boot Section Size in *bytes*
42# Teensy halfKay 512
43# Teensy++ halfKay 1024
44# Atmel DFU loader 4096
45# LUFA bootloader 4096
46# USBaspLoader 2048
47OPT_DEFS += -DBOOTLOADER_SIZE=4096
48
49
50# Build Options
51# comment out to disable the options.
52#
53BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
54MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
55EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
56# CONSOLE_ENABLE = yes # Console for debug(+400)
57# COMMAND_ENABLE = yes # Commands for debug and configuration
58KEYBOARD_LOCK_ENABLE = yes # Allow locking of keyboard via magic key
59NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
60BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
61RGBLIGHT_ENABLE = yes # Enable the RGB backlight
62# MIDI_ENABLE = YES # MIDI controls
63# UNICODE_ENABLE = YES # Unicode
64# BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID
65
66LAYOUTS = 60_ansi 60_iso