aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyrre Havik <Kyrremann@gmail.com>2022-02-05 04:06:49 +0100
committerGitHub <noreply@github.com>2022-02-04 19:06:49 -0800
commit719881c2ee2b61b15ed02d82c2870f7ae93e70e5 (patch)
tree09db4cabfd676497a17b748cbb200a8b110df7f4
parent1febea8d4b18f87844618492d43aefc5c22c8174 (diff)
downloadqmk_firmware-719881c2ee2b61b15ed02d82c2870f7ae93e70e5.tar.gz
qmk_firmware-719881c2ee2b61b15ed02d82c2870f7ae93e70e5.zip
[Keyboard] Add Xenon keyboard (#15915)
Co-authored-by: Sam Mohr <smores56@users.noreply.github.com> Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: Joel Challis <git@zvecr.com>
-rw-r--r--keyboards/xenon/config.h65
-rw-r--r--keyboards/xenon/info.json70
-rw-r--r--keyboards/xenon/keymaps/default/keymap.c64
-rw-r--r--keyboards/xenon/readme.md30
-rw-r--r--keyboards/xenon/rules.mk21
-rw-r--r--keyboards/xenon/xenon.c97
-rw-r--r--keyboards/xenon/xenon.h40
7 files changed, 387 insertions, 0 deletions
diff --git a/keyboards/xenon/config.h b/keyboards/xenon/config.h
new file mode 100644
index 000000000..b14861140
--- /dev/null
+++ b/keyboards/xenon/config.h
@@ -0,0 +1,65 @@
1/*
2Copyright 2020 Kyrre Havik Eriksen
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#pragma once
19
20#include "config_common.h"
21
22/* USB Device descriptor parameter */
23#define VENDOR_ID 0xFEED
24#define PRODUCT_ID 0x3404
25#define DEVICE_VER 0x0001
26#define PRODUCT Xenon
27
28/* key matrix size */
29/* Rows are doubled up */
30#define MATRIX_ROWS 10
31#define MATRIX_COLS 7
32
33// wiring
34#define MATRIX_ROW_PINS { D4, C6, D7, E6, B4 }
35#define MATRIX_COL_PINS { B2, B3, B1, F7, F6, F5, F4 }
36
37#define ENCODERS_PAD_A { B6 }
38#define ENCODERS_PAD_B { B5 }
39
40/* COL2ROW, ROW2COL*/
41#define DIODE_DIRECTION COL2ROW
42
43/* define if matrix has ghost (lacks anti-ghosting diodes) */
44//#define MATRIX_HAS_GHOST
45
46/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
47#define DEBOUNCE 5
48
49/*
50 * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN.
51 */
52#define SOFT_SERIAL_PIN D2
53
54/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
55#define LOCKING_SUPPORT_ENABLE
56/* Locking resynchronize hack */
57#define LOCKING_RESYNC_ENABLE
58
59#ifdef OLED_ENABLE
60 #define OLED_DISPLAY_128X32
61#endif
62
63// If you are using an Elite C rev3 on the slave side, uncomment the lines below:
64// #define SPLIT_USB_DETECT
65// #define NO_USB_STARTUP_CHECK
diff --git a/keyboards/xenon/info.json b/keyboards/xenon/info.json
new file mode 100644
index 000000000..e0b5e9526
--- /dev/null
+++ b/keyboards/xenon/info.json
@@ -0,0 +1,70 @@
1{
2 "keyboard_name": "Xenon",
3 "url": "https://github.com/narinari/xenon-keyboard",
4 "maintainer": "Kyrremann",
5 "manufacturer": "narinari",
6 "layouts": {
7 "LAYOUT": {
8 "layout": [
9 {"x":3, "y":0},
10 {"x":11, "y":0},
11 {"x":2, "y":0.25},
12 {"x":4, "y":0.25},
13 {"x":10, "y":0.25},
14 {"x":12, "y":0.25},
15 {"x":5, "y":0.5},
16 {"x":9, "y":0.5},
17 {"x":0, "y":0.75},
18 {"x":1, "y":0.75},
19 {"x":13, "y":0.75},
20 {"x":14, "y":0.75},
21
22 {"x":3, "y":1},
23 {"x":11, "y":1},
24 {"x":2, "y":1.25},
25 {"x":4, "y":1.25},
26 {"x":10, "y":1.25},
27 {"x":12, "y":1.25},
28 {"x":5, "y":1.5},
29 {"x":9, "y":1.5},
30 {"x":0, "y":1.75},
31 {"x":1, "y":1.75},
32 {"x":13, "y":1.75},
33 {"x":14, "y":1.75},
34
35 {"x":3, "y":2},
36 {"x":11, "y":2},
37 {"x":2, "y":2.25},
38 {"x":4, "y":2.25},
39 {"x":10, "y":2.25},
40 {"x":12, "y":2.25},
41 {"x":5, "y":2.5},
42 {"x":9, "y":2.5},
43 {"x":0, "y":2.75},
44 {"x":1, "y":2.75},
45 {"x":13, "y":2.75},
46 {"x":14, "y":2.75},
47
48 {"x":3, "y":3},
49 {"x":11, "y":3},
50 {"x":2, "y":3.25},
51 {"x":4, "y":3.25},
52 {"x":10, "y":3.25},
53 {"x":12, "y":3.25},
54 {"x":5, "y":3.5},
55 {"x":6, "y":3.5},
56 {"x":8, "y":3.5},
57 {"x":9, "y":3.5},
58
59 {"x":3, "y":4},
60 {"x":11, "y":4},
61 {"x":4, "y":4.25},
62 {"x":10, "y":4.25},
63 {"x":5, "y":4.5},
64 {"x":6, "y":4.5},
65 {"x":8, "y":4.5},
66 {"x":9, "y":4.5}
67 ]
68 }
69 }
70}
diff --git a/keyboards/xenon/keymaps/default/keymap.c b/keyboards/xenon/keymaps/default/keymap.c
new file mode 100644
index 000000000..97d101664
--- /dev/null
+++ b/keyboards/xenon/keymaps/default/keymap.c
@@ -0,0 +1,64 @@
1/* Copyright 2020 Kyrre Havik Eriksen
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include QMK_KEYBOARD_H
17
18enum layers {
19 _QWERTY = 0,
20 _LOWER,
21 _RAISE,
22 _ADJUST
23};
24
25#define M_LWR MO(_LOWER)
26#define M_RSE MO(_RAISE)
27#define L(kc) (LSFT(kc))
28#define R(kc) (RALT(kc))
29
30const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
31 [_QWERTY] = LAYOUT(
32 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,
33 KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
34 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_ENT),
35 KC_MUTE, KC_RALT, KC_LALT, KC_LGUI, KC_SPC, KC_ENT, M_LWR, KC_BSPC, M_RSE, KC_MPLY,
36 KC_DEL , KC_PGDN, KC_PGUP, KC_ESC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
37 ),
38 [_LOWER] = LAYOUT(
39 KC_BSLS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
40 KC_TRNS, L(KC_1),L(KC_2), L(KC_3), L(KC_4),L(KC_5), L(KC_6), L(KC_7), L(KC_8), L(KC_9), L(KC_0), L(KC_MINS),
41 KC_TRNS, KC_GRV, KC_TRNS, L(KC_EQL),L(KC_RBRC),L(KC_BSLS), KC_BSLS, KC_RBRC, KC_EQL, KC_VOLD, KC_VOLU, KC_TRNS,
42 KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_ENT, KC_SPC, KC_TRNS, KC_TRNS, KC_RALT,
43 KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_ENT, KC_SPC, KC_TAB, KC_BSPC
44 ),
45 [_RAISE] = LAYOUT(
46 KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
47 KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
48 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_ENT),
49 KC_LGUI, KC_DEL, KC_ENT, KC_SPC, KC_ESC, KC_ENT, KC_SPC, KC_TAB, KC_BSPC, KC_RALT,
50 KC_DEL, KC_ENT, KC_SPC, KC_ESC, KC_ENT, KC_SPC, KC_TAB, KC_BSPC
51 )
52};
53
54bool process_record_user(uint16_t keycode, keyrecord_t *record) {
55 // If console is enabled, it will print the matrix position and status of each key pressed
56#ifdef CONSOLE_ENABLE
57 uprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed);
58#endif
59 return true;
60}
61
62layer_state_t layer_state_set_user(layer_state_t state) {
63 return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
64}
diff --git a/keyboards/xenon/readme.md b/keyboards/xenon/readme.md
new file mode 100644
index 000000000..d3b446471
--- /dev/null
+++ b/keyboards/xenon/readme.md
@@ -0,0 +1,30 @@
1# Xenon
2
3![Xenon](https://i.imgur.com/QYMDzGFh.jpg)
4
5Xenon is 60% columnar staggered keyboard.
6
7* Cherry MX and Kailh low profile key switch support
8* OLED display
9* Full color LED
10* Prototype board area (behind the promicro)
11
12* Keyboard Maintainer: [Narinari](https://github.com/narinari)
13* Keymap Maintainer: [Kyrremann](https://github.com/Kyrremann)
14* Keyboard files can be found here: https://github.com/narinari/xenon-keyboard
15
16Make example for this keyboard (after setting up your build environment):
17
18 make xenon:default
19
20Example of flashing this keyboard:
21
22 make xenon:default:flash
23
24How to enter bootloader (DFU):
25
26Press the reset button next to the TRRS port on the side you are trying to flash (USB must be connected to the Pro Micro that you are flashing).
27
28See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the
29[make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with
30the [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
diff --git a/keyboards/xenon/rules.mk b/keyboards/xenon/rules.mk
new file mode 100644
index 000000000..aeaa1fd10
--- /dev/null
+++ b/keyboards/xenon/rules.mk
@@ -0,0 +1,21 @@
1# MCU name
2MCU = atmega32u4
3
4# Bootloader selection
5BOOTLOADER = caterina
6
7# Build Options
8# change yes to no to disable
9#
10BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite
11MOUSEKEY_ENABLE = no # Mouse keys
12EXTRAKEY_ENABLE = yes # Audio control and System control
13CONSOLE_ENABLE = yes # Console for debug
14COMMAND_ENABLE = no # Commands for debug and configuration
15NKRO_ENABLE = no # Enable N-Key Rollover
16BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
17RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
18AUDIO_ENABLE = no # Audio output
19SPLIT_KEYBOARD = yes
20OLED_ENABLE = yes
21ENCODER_ENABLE = yes
diff --git a/keyboards/xenon/xenon.c b/keyboards/xenon/xenon.c
new file mode 100644
index 000000000..9ca572077
--- /dev/null
+++ b/keyboards/xenon/xenon.c
@@ -0,0 +1,97 @@
1/* Copyright 2020 Kyrre Havik Eriksen
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include "xenon.h"
17
18#ifdef OLED_ENABLE
19oled_rotation_t oled_init_kb(oled_rotation_t rotation) {
20 if (!is_keyboard_master()) {
21 return OLED_ROTATION_180; // flips the display 180 degrees if offhand
22 }
23
24 return OLED_ROTATION_270;
25}
26
27static void render_named_logo(void) {
28 static const char PROGMEM raw_logo[] = {
29 12, 60,252,252,252,236,236,140, 12, 28,248,192, 0,192,248,252,252,252,108, 12, 12,140,236, 60, 12, 0, 0, 0,248,252,252,252,236,204,204,204,204,204,204,204,204,204,204,204,204,140, 12,252,248, 0, 0, 0,252,252,252,252,236,236,236,204, 12, 60,240,192, 0, 0, 0,252,252,252,236,236, 12, 12, 12,252,248, 0, 0,192,224, 96, 48, 24, 24,140,140,132,196,196,196,196,132,140,140, 12, 24, 48, 48, 96,192,128, 0, 0,252,252,252,236,236,236,236,140, 28,120,224,128, 0, 0,252,252,252,252,236,236, 12, 12, 12,252,
30 0, 0, 0, 3, 15,255,255,255,254,248,192,195,223,255,255, 63, 15, 1,224,248, 30, 7, 1, 0, 0, 0, 0, 0,255,255,255,255,255,255, 0, 0, 1, 63, 63, 51, 51, 51, 51, 51, 51, 51,243, 3, 1, 0, 0, 0,255,255,255,255,255, 1, 15,127,255,252,240,195, 15, 60,240,255,255,255,255,255, 0, 0, 0,255,255,254,255,255,255,127, 14, 2,195,247, 63, 31, 15, 15, 15, 15, 31, 63,255,255,254,252,248,224, 1, 3, 30,252,255,255,255,255,255, 3, 31,255,254,248,225,135, 30,120,255,255,255,255,255,255, 0, 0, 0,255,
31 0, 0,128,240,252,255,255,255, 63, 7, 1,227,127,255,255,255,248,224, 1, 7, 62,240,192, 0, 0, 0, 0, 0,255,255,255,255,255,255, 1, 3, 7,255,255,207,207,207,207,207,206,204,207,192,128, 0, 0, 0,255,255,255,255,255, 0, 0, 0,255,255, 15,127,255,252,240,227,143,127,255,255, 0, 0, 0,255,255, 63,255,255,255,254,240,192,131,135, 12, 24, 48, 48, 48, 48, 24, 28, 15,159,255, 63, 31, 7,128,192,120, 31,255,255,255,255,255, 0, 0, 0,255,255, 31,127,255,252,241,199, 31,127,255,255, 0, 0, 0,255,
32 48, 62, 63, 63, 63, 63, 63, 56, 48, 60, 31, 3, 0, 3, 31, 63, 63, 63, 63, 60, 60, 56, 59, 63, 56, 0, 0, 0, 31, 63, 63, 63, 63, 63, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 56, 63, 31, 0, 0, 0, 63, 63, 63, 63, 63, 60, 56, 48, 63, 63, 0, 0, 0, 3, 31, 63, 63, 62, 61, 63, 60, 56, 48, 63, 31, 0, 0, 1, 7, 7, 15, 31, 31, 63, 63, 63, 62, 62, 62, 62, 63, 63, 63, 31, 31, 15, 14, 6, 3, 1, 0, 0, 63, 63, 63, 63, 63, 60, 56, 56, 63, 31, 0, 0, 1, 7, 31, 63, 63, 60, 63, 63, 60, 56, 48, 63
33 };
34 oled_write_raw_P(raw_logo, sizeof(raw_logo));
35}
36
37static void render_status(void) {
38 oled_write_P(PSTR("\n\n\n-----\nXENON\n-----\n\n"), false);
39
40 // Host Keyboard Layer Status
41 switch (get_highest_layer(layer_state)) {
42 case 0:
43 oled_write_P(PSTR("Base \n"), false);
44 break;
45 case 1:
46 oled_write_P(PSTR("Lower\n"), false);
47 break;
48 case 2:
49 oled_write_P(PSTR("Raise\n"), false);
50 break;
51 default:
52 oled_write_P(PSTR("Undef\n"), false);
53 }
54 oled_write_P(PSTR("Layer\n"), false);
55}
56
57bool oled_task_kb(void) {
58 if (!oled_task_user()) {
59 return false;
60 }
61
62 if (is_keyboard_master()) {
63 render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc)
64 } else {
65 render_named_logo();
66 }
67
68 return true;
69}
70#endif
71
72#ifdef ENCODER_ENABLE
73bool encoder_update_kb(uint8_t index, bool clockwise) {
74 if (!encoder_update_user(index, clockwise)) {
75 return false;
76 }
77
78 if (index == 0) {
79 // Volume control
80 if (clockwise) {
81 tap_code(KC_VOLD);
82 } else {
83 tap_code(KC_VOLU);
84 }
85 }
86 else if (index == 1) {
87 // Page up/Page down
88 if (clockwise) {
89 tap_code(KC_PGDN);
90 } else {
91 tap_code(KC_PGUP);
92 }
93 }
94
95 return true;
96}
97#endif
diff --git a/keyboards/xenon/xenon.h b/keyboards/xenon/xenon.h
new file mode 100644
index 000000000..030d9bcb8
--- /dev/null
+++ b/keyboards/xenon/xenon.h
@@ -0,0 +1,40 @@
1/* Copyright 2020 Kyrre Havik Eriksen
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#pragma once
17
18#include "quantum.h"
19
20#define XXX KC_NO
21
22#define LAYOUT( \
23 L00, L01, L02, L03, L04, L05, R06, R07, R08, R09, R10, R11, \
24 L12, L13, L14, L15, L16, L17, R18, R19, R20, R21, R22, R23, \
25 L24, L25, L26, L27, L28, L29, R30, R31, R32, R33, R34, R35, \
26 L36, L37, L38, L39, L40, R41, R42, R43, R44, R45, \
27 L46, L47, L48, L49, R50, R51, R52, R53 \
28) \
29{ \
30 { XXX, L05, L04, L03, L02, L01, L00 }, \
31 { XXX, L17, L16, L15, L14, L13, L12 }, \
32 { XXX, L29, L28, L27, L26, L25, L24 }, \
33 { L40, L39, L38, L37, L36, XXX, XXX }, \
34 { L49, L48, L47, L46, XXX, XXX, XXX }, \
35 { XXX, R06, R07, R08, R09, R10, R11 }, \
36 { XXX, R18, R19, R20, R21, R22, R23 }, \
37 { XXX, R30, R31, R32, R33, R34, R35 }, \
38 { R41, R42, R43, R44, R45, XXX, XXX }, \
39 { R50, R51, R52, R53, XXX, XXX, XXX } \
40}