aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXelus22 <17491233+Xelus22@users.noreply.github.com>2021-07-26 15:34:39 +1000
committerGitHub <noreply@github.com>2021-07-25 22:34:39 -0700
commitb9902a3f59b72f2b54396ce6063c726e7fbd60f3 (patch)
tree3fc672f8cc22e1aaab50975e3648acaf10ae98a0
parent9e782e4f1415e25b0f8349d51400fdfe29ebb0c1 (diff)
downloadqmk_firmware-b9902a3f59b72f2b54396ce6063c726e7fbd60f3.tar.gz
qmk_firmware-b9902a3f59b72f2b54396ce6063c726e7fbd60f3.zip
[Keyboard] Valor Rev 2 (#13551)
Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com>
-rw-r--r--keyboards/xelus/valor/rev2/config.h88
-rw-r--r--keyboards/xelus/valor/rev2/halconf.h23
-rw-r--r--keyboards/xelus/valor/rev2/info.json83
-rw-r--r--keyboards/xelus/valor/rev2/keymaps/default/config.h18
-rw-r--r--keyboards/xelus/valor/rev2/keymaps/default/keymap.c79
-rw-r--r--keyboards/xelus/valor/rev2/keymaps/default/readme.md2
-rw-r--r--keyboards/xelus/valor/rev2/keymaps/via/config.h24
-rw-r--r--keyboards/xelus/valor/rev2/keymaps/via/keymap.c127
-rw-r--r--keyboards/xelus/valor/rev2/keymaps/via/readme.md2
-rw-r--r--keyboards/xelus/valor/rev2/keymaps/via/rules.mk1
-rw-r--r--keyboards/xelus/valor/rev2/mcuconf.h30
-rw-r--r--keyboards/xelus/valor/rev2/readme.md20
-rw-r--r--keyboards/xelus/valor/rev2/rev2.c72
-rw-r--r--keyboards/xelus/valor/rev2/rev2.h37
-rw-r--r--keyboards/xelus/valor/rev2/rgb_matrix_kb.inc34
-rw-r--r--keyboards/xelus/valor/rev2/rules.mk32
16 files changed, 672 insertions, 0 deletions
diff --git a/keyboards/xelus/valor/rev2/config.h b/keyboards/xelus/valor/rev2/config.h
new file mode 100644
index 000000000..66669fab4
--- /dev/null
+++ b/keyboards/xelus/valor/rev2/config.h
@@ -0,0 +1,88 @@
1/* Copyright 2021 Harrison Chan (Xelus)
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
17#pragma once
18
19#include "config_common.h"
20
21/* USB Device descriptor parameter */
22#define VENDOR_ID 0x5845 // "XE"
23#define PRODUCT_ID 0x5653 // Valor "VR" + 1
24#define DEVICE_VER 0x0001
25#define MANUFACTURER Xelus
26#define PRODUCT Xelus Valor Rev2
27
28/* key matrix size */
29#define MATRIX_ROWS 5
30#define MATRIX_COLS 15
31
32/* key matrix pins */
33#define MATRIX_ROW_PINS { B11, B10, A3, A1, A2 }
34#define MATRIX_COL_PINS { B2, B1, B0, A7, A6, A5, A4, A13, B7, B6, B5, B4, B3, A15, A14 }
35#define UNUSED_PINS
36
37/* COL2ROW or ROW2COL */
38#define DIODE_DIRECTION COL2ROW
39
40/* Set 0 if debouncing isn't needed */
41#define DEBOUNCE 5
42
43/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
44#define LOCKING_SUPPORT_ENABLE
45
46/* Locking resynchronize hack */
47#define LOCKING_RESYNC_ENABLE
48
49// I2C setup
50#define I2C1_SCL 8
51#define I2C1_SDA 9
52#define I2C1_SCL_PAL_MODE 4
53#define I2C1_SDA_PAL_MODE 4
54#define I2C1_TIMINGR_PRESC 0U
55#define I2C1_TIMINGR_SCLDEL 11U
56#define I2C1_TIMINGR_SDADEL 0U
57#define I2C1_TIMINGR_SCLH 14U
58#define I2C1_TIMINGR_SCLL 42U
59
60// I2C EEPROM
61#define EEPROM_I2C_24LC64
62
63// More EEPROM for layers
64#define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 8191
65
66/* RGB Matrix */
67#define RGB_DI_PIN A9
68#define RGBLED_NUM 28
69#define DRIVER_LED_TOTAL 28
70#define NOP_FUDGE 0.4
71
72// RGB PWM
73#define WS2812_PWM_DRIVER PWMD1
74#define WS2812_PWM_CHANNEL 2
75#define WS2812_PWM_PAL_MODE 1
76#define WS2812_DMA_STREAM STM32_DMA1_STREAM6
77#define WS2812_DMA_CHANNEL 7
78#define WS2812_DMAMUX_ID STM32_DMAMUX1_TIM1_UP
79
80// RGB Pullup
81#define WS2812_EXTERNAL_PULLUP
82
83// RGB Matrix settings
84#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
85#define RGB_MATRIX_KEYPRESSES
86#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200
87#define RGB_DISABLE_WHEN_USB_SUSPENDED true
88#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CUSTOM_test_mode
diff --git a/keyboards/xelus/valor/rev2/halconf.h b/keyboards/xelus/valor/rev2/halconf.h
new file mode 100644
index 000000000..03b15da04
--- /dev/null
+++ b/keyboards/xelus/valor/rev2/halconf.h
@@ -0,0 +1,23 @@
1/* Copyright 2021 QMK
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#define HAL_USE_I2C TRUE
19
20#define HAL_USE_PWM TRUE
21
22#include_next <halconf.h>
23
diff --git a/keyboards/xelus/valor/rev2/info.json b/keyboards/xelus/valor/rev2/info.json
new file mode 100644
index 000000000..712050ca8
--- /dev/null
+++ b/keyboards/xelus/valor/rev2/info.json
@@ -0,0 +1,83 @@
1{
2 "keyboard_name": "Xelus Valor Rev2",
3 "url": "",
4 "maintainer": "Xelus22",
5 "width": 17.75,
6 "height": 5,
7 "layouts": {
8 "LAYOUT_alice_split_bs": {
9 "layout": [
10 {"x":0, "y":0},
11 {"x":1.25, "y":0},
12 {"x":2.25, "y":0},
13 {"x":3.25, "y":0},
14 {"x":4.25, "y":0},
15 {"x":5.25, "y":0},
16 {"x":6.25, "y":0},
17 {"x":7.25, "y":0},
18 {"x":10.25, "y":0},
19 {"x":11.25, "y":0},
20 {"x":12.25, "y":0},
21 {"x":13.25, "y":0},
22 {"x":14.25, "y":0},
23 {"x":15.25, "y":0},
24 {"x":16.25, "y":0},
25 {"x":17.25, "y":0},
26
27 {"x":0, "y":1},
28 {"x":1.25, "y":1, "w":1.5},
29 {"x":2.75, "y":1},
30 {"x":3.75, "y":1},
31 {"x":4.75, "y":1},
32 {"x":5.75, "y":1},
33 {"x":6.75, "y":1},
34 {"x":9.75, "y":1},
35 {"x":10.75, "y":1},
36 {"x":11.75, "y":1},
37 {"x":12.75, "y":1},
38 {"x":13.75, "y":1},
39 {"x":14.75, "y":1},
40 {"x":15.75, "y":1},
41 {"x":16.75, "y":1, "w":1.5},
42
43 {"x":0, "y":2},
44 {"x":1.25, "y":2, "w":1.75},
45 {"x":3, "y":2},
46 {"x":4, "y":2},
47 {"x":5, "y":2},
48 {"x":6, "y":2},
49 {"x":7, "y":2},
50 {"x":10, "y":2},
51 {"x":11, "y":2},
52 {"x":12, "y":2},
53 {"x":13, "y":2},
54 {"x":14, "y":2},
55 {"x":15, "y":2},
56 {"x":16, "y":2, "w":2.25},
57
58 {"x":1.25, "y":3, "w":2.25},
59 {"x":3.5, "y":3},
60 {"x":4.5, "y":3},
61 {"x":5.5, "y":3},
62 {"x":6.5, "y":3},
63 {"x":7.5, "y":3},
64 {"x":9.5, "y":3},
65 {"x":10.5, "y":3},
66 {"x":11.5, "y":3},
67 {"x":12.5, "y":3},
68 {"x":13.5, "y":3},
69 {"x":14.5, "y":3},
70 {"x":15.5, "y":3, "w":1.75},
71 {"x":17.25, "y":3},
72
73 {"x":1.25, "y":4, "w":1.5},
74 {"x":4.25, "y":4, "w":1.5},
75 {"x":5.75, "y":4, "w":2},
76 {"x":7.75, "y":4, "w":1.25},
77 {"x":9.5, "y":4, "w":2.75},
78 {"x":12.25, "y":4, "w":1.5},
79 {"x":16.75, "y":4, "w":1.5}
80 ]
81 }
82 }
83}
diff --git a/keyboards/xelus/valor/rev2/keymaps/default/config.h b/keyboards/xelus/valor/rev2/keymaps/default/config.h
new file mode 100644
index 000000000..824d4633c
--- /dev/null
+++ b/keyboards/xelus/valor/rev2/keymaps/default/config.h
@@ -0,0 +1,18 @@
1/* Copyright 2021 Harrison Chan (Xelus)
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
17#define USB_POLLING_INTERVAL_MS 1
18#define QMK_KEYS_PER_SCAN 4
diff --git a/keyboards/xelus/valor/rev2/keymaps/default/keymap.c b/keyboards/xelus/valor/rev2/keymaps/default/keymap.c
new file mode 100644
index 000000000..eb5f55112
--- /dev/null
+++ b/keyboards/xelus/valor/rev2/keymaps/default/keymap.c
@@ -0,0 +1,79 @@
1/* Copyright 2021 Harrison Chan (Xelus)
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
18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19 [0] = LAYOUT_all(
20 KC_ESC, KC_TILD, 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_DEL, KC_BSPC,
21 KC_PGUP, 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,
22 KC_PGDN, 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,
23 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RGUI,
24 KC_LCTL, KC_LALT, KC_SPC, MO(1), KC_SPC, KC_RALT, KC_RCTL
25 ),
26
27 [1] = LAYOUT_all(
28 RGB_TOG, KC_TRNS, 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_TRNS, KC_TRNS,
29 RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
30 RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
31 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
32 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
33 )
34};
35
36#ifdef RGB_MATRIX_ENABLE
37void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
38 // caps lock cyan
39 if (host_keyboard_led_state().caps_lock) {
40 RGB_MATRIX_INDICATOR_SET_COLOR(27, 0, 128, 128);
41 } else {
42 RGB_MATRIX_INDICATOR_SET_COLOR(27, 0, 0, 0);
43 }
44
45 // num lock cyan
46 if (host_keyboard_led_state().num_lock) {
47 RGB_MATRIX_INDICATOR_SET_COLOR(26, 0, 128, 128);
48 } else {
49 RGB_MATRIX_INDICATOR_SET_COLOR(26, 0, 0, 0);
50 }
51
52 // scroll lock cyan
53 if (host_keyboard_led_state().scroll_lock) {
54 RGB_MATRIX_INDICATOR_SET_COLOR(25, 0, 128, 128);
55 } else {
56 RGB_MATRIX_INDICATOR_SET_COLOR(25, 0, 0, 0);
57 }
58
59 // layer state
60 switch (get_highest_layer(layer_state)) {
61 case 0:
62 RGB_MATRIX_INDICATOR_SET_COLOR(24, 0, 0, 0);
63 break;
64 case 1:
65 RGB_MATRIX_INDICATOR_SET_COLOR(24, 128, 0, 0);
66 break;
67 case 2:
68 RGB_MATRIX_INDICATOR_SET_COLOR(24, 0, 128, 0);
69 break;
70 case 3:
71 RGB_MATRIX_INDICATOR_SET_COLOR(24, 0, 0, 128);
72 break;
73 default:
74 // white
75 RGB_MATRIX_INDICATOR_SET_COLOR(24, 128, 128, 128);
76 break;
77 }
78}
79#endif
diff --git a/keyboards/xelus/valor/rev2/keymaps/default/readme.md b/keyboards/xelus/valor/rev2/keymaps/default/readme.md
new file mode 100644
index 000000000..8648f1c15
--- /dev/null
+++ b/keyboards/xelus/valor/rev2/keymaps/default/readme.md
@@ -0,0 +1,2 @@
1# The Default Valor Rev2 Layout
2
diff --git a/keyboards/xelus/valor/rev2/keymaps/via/config.h b/keyboards/xelus/valor/rev2/keymaps/via/config.h
new file mode 100644
index 000000000..456369d88
--- /dev/null
+++ b/keyboards/xelus/valor/rev2/keymaps/via/config.h
@@ -0,0 +1,24 @@
1/* Copyright 2021 Harrison Chan (Xelus)
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
17// RGB Matrix
18#define VIA_QMK_RGBLIGHT_ENABLE
19
20// More layers
21#define DYNAMIC_KEYMAP_LAYER_COUNT 8
22
23#define USB_POLLING_INTERVAL_MS 1
24#define QMK_KEYS_PER_SCAN 4
diff --git a/keyboards/xelus/valor/rev2/keymaps/via/keymap.c b/keyboards/xelus/valor/rev2/keymaps/via/keymap.c
new file mode 100644
index 000000000..c25665951
--- /dev/null
+++ b/keyboards/xelus/valor/rev2/keymaps/via/keymap.c
@@ -0,0 +1,127 @@
1/* Copyright 2021 Harrison Chan (Xelus)
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
18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19 [0] = LAYOUT_all(
20 KC_ESC, KC_TILD, 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_DEL, KC_BSPC,
21 KC_PGUP, 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,
22 KC_PGDN, 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,
23 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RGUI,
24 KC_LCTL, KC_LALT, KC_SPC, MO(1), KC_SPC, KC_RALT, KC_RCTL
25 ),
26
27 [1] = LAYOUT_all(
28 RGB_TOG, KC_TRNS, 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_TRNS, KC_TRNS,
29 RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
30 RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
31 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
32 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
33 ),
34
35 [2] = LAYOUT_all(
36 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
37 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
38 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
39 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
40 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
41 ),
42
43 [3] = LAYOUT_all(
44 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
45 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
46 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
47 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
48 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
49 ),
50
51 [4] = LAYOUT_all(
52 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
53 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
54 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
55 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
56 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
57 ),
58
59 [5] = LAYOUT_all(
60 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
61 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
62 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
63 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
64 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
65 ),
66
67 [6] = LAYOUT_all(
68 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
69 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
70 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
71 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
72 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
73 ),
74
75 [7] = LAYOUT_all(
76 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
77 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
78 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
79 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
80 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
81 )
82};
83
84#ifdef RGB_MATRIX_ENABLE
85void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
86 // caps lock cyan
87 if (host_keyboard_led_state().caps_lock) {
88 RGB_MATRIX_INDICATOR_SET_COLOR(27, 0, 128, 128);
89 } else {
90 RGB_MATRIX_INDICATOR_SET_COLOR(27, 0, 0, 0);
91 }
92
93 // num lock cyan
94 if (host_keyboard_led_state().num_lock) {
95 RGB_MATRIX_INDICATOR_SET_COLOR(26, 0, 128, 128);
96 } else {
97 RGB_MATRIX_INDICATOR_SET_COLOR(26, 0, 0, 0);
98 }
99
100 // scroll lock cyan
101 if (host_keyboard_led_state().scroll_lock) {
102 RGB_MATRIX_INDICATOR_SET_COLOR(25, 0, 128, 128);
103 } else {
104 RGB_MATRIX_INDICATOR_SET_COLOR(25, 0, 0, 0);
105 }
106
107 // layer state
108 switch (get_highest_layer(layer_state)) {
109 case 0:
110 RGB_MATRIX_INDICATOR_SET_COLOR(24, 0, 0, 0);
111 break;
112 case 1:
113 RGB_MATRIX_INDICATOR_SET_COLOR(24, 128, 0, 0);
114 break;
115 case 2:
116 RGB_MATRIX_INDICATOR_SET_COLOR(24, 0, 128, 0);
117 break;
118 case 3:
119 RGB_MATRIX_INDICATOR_SET_COLOR(24, 0, 0, 128);
120 break;
121 default:
122 // white
123 RGB_MATRIX_INDICATOR_SET_COLOR(24, 128, 128, 128);
124 break;
125 }
126}
127#endif
diff --git a/keyboards/xelus/valor/rev2/keymaps/via/readme.md b/keyboards/xelus/valor/rev2/keymaps/via/readme.md
new file mode 100644
index 000000000..dcdfd4dd9
--- /dev/null
+++ b/keyboards/xelus/valor/rev2/keymaps/via/readme.md
@@ -0,0 +1,2 @@
1# The VIA Valor Rev2 Layout
2
diff --git a/keyboards/xelus/valor/rev2/keymaps/via/rules.mk b/keyboards/xelus/valor/rev2/keymaps/via/rules.mk
new file mode 100644
index 000000000..1e5b99807
--- /dev/null
+++ b/keyboards/xelus/valor/rev2/keymaps/via/rules.mk
@@ -0,0 +1 @@
VIA_ENABLE = yes
diff --git a/keyboards/xelus/valor/rev2/mcuconf.h b/keyboards/xelus/valor/rev2/mcuconf.h
new file mode 100644
index 000000000..736837565
--- /dev/null
+++ b/keyboards/xelus/valor/rev2/mcuconf.h
@@ -0,0 +1,30 @@
1/* Copyright 2021 QMK
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
17#pragma once
18
19#include_next <mcuconf.h>
20
21#undef STM32_I2C_USE_I2C1
22#define STM32_I2C_USE_I2C1 TRUE
23
24#undef STM32_PWM_USE_TIM1
25#define STM32_PWM_USE_TIM1 TRUE
26
27#undef STM32_I2C_I2C1_RX_DMA_STREAM
28#undef STM32_I2C_I2C1_TX_DMA_STREAM
29#define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 6)
30#define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 7)
diff --git a/keyboards/xelus/valor/rev2/readme.md b/keyboards/xelus/valor/rev2/readme.md
new file mode 100644
index 000000000..863f5ef42
--- /dev/null
+++ b/keyboards/xelus/valor/rev2/readme.md
@@ -0,0 +1,20 @@
1# Valor Rev 2
2
3An Alice replacement keyboard PCB.
4
5* Keyboard Maintainer: [Xelus22](https://github.com/Xelus22)
6* Hardware Supported: Valor Rev 2
7* Hardware Availability: Custom keyboard group buys
8
9Make example for this keyboard (after setting up your build environment):
10
11 make xelus/valor/rev2:default
12
13Reset your keyboard in 3 ways:
14<ol>
15<li>Software reset on Fn + PgDn (bottom of the 3 macro buttons)</li>
16<li>Bootmagic reset: hold down the top left key (usually escape) and plugin the keyboard</li>
17<li>Physical reset button: on the back of the PCB, there should be a small golden button you can press</li>
18</ol>
19
20See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
diff --git a/keyboards/xelus/valor/rev2/rev2.c b/keyboards/xelus/valor/rev2/rev2.c
new file mode 100644
index 000000000..f13041879
--- /dev/null
+++ b/keyboards/xelus/valor/rev2/rev2.c
@@ -0,0 +1,72 @@
1/* Copyright 2021 Harrison Chan (Xelus)
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
17#include "rev2.h"
18
19#ifdef RGB_MATRIX_ENABLE
20
21led_config_t g_led_config = { {
22 // Key Matrix to LED Index
23 { 24, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED },
24 { 25, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED },
25 { 26, 27, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED },
26 { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED },
27 { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }
28}, {
29 // LED Index to Physical Position
30 { 224, 0 },
31 { 224, 9 },
32 { 224, 21 },
33 { 224, 33 },
34 { 224, 45 },
35 { 223, 51 },
36 { 206, 52 },
37 { 190, 52 },
38 { 172, 52 },
39 { 154, 57 },
40 { 136, 61 },
41 { 118, 63 },
42 { 101, 64 },
43 { 80 , 60 },
44 { 64 , 57 },
45 { 46 , 53 },
46 { 28 , 53 },
47 { 10 , 52 },
48 { 3 , 51 },
49 { 2 , 45 },
50 { 2 , 33 },
51 { 2 , 20 },
52 { 2 , 9 },
53 { 0 , 0 },
54 { 9 , 3 },
55 { 6 , 14 },
56 { 4 , 26 },
57 { 21 , 27 }
58
59}, {
60 // LED Index to Flag
61 2, 2, 2, 2, 2, 2, 2, 2,
62 2, 2, 2, 2, 2, 2, 2, 2,
63 2, 2, 2, 2, 2, 2, 2, 2,
64 8, 8, 8, 8
65} };
66
67
68void keyboard_pre_init_kb(void) {
69 rgb_matrix_set_flags(LED_FLAG_MODIFIER|LED_FLAG_UNDERGLOW|LED_FLAG_KEYLIGHT);
70 keyboard_pre_init_user();
71}
72#endif
diff --git a/keyboards/xelus/valor/rev2/rev2.h b/keyboards/xelus/valor/rev2/rev2.h
new file mode 100644
index 000000000..9cf78c941
--- /dev/null
+++ b/keyboards/xelus/valor/rev2/rev2.h
@@ -0,0 +1,37 @@
1/* Copyright 2021 Harrison Chan (Xelus)
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
17#pragma once
18
19#include "quantum.h"
20
21#define ____ KC_NO
22
23#define LAYOUT_alice_split_bs( \
24 K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K214, \
25 K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \
26 K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \
27 K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, \
28 K401, K403, K405, K406, K408, K410, K413 \
29) { \
30 { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \
31 { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \
32 { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \
33 { ____, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \
34 { ____, K401, ____, K403, ____, K405, K406, ____, K408, ____, K410, ____, ____, K413, ____ } \
35}
36
37#define LAYOUT_all LAYOUT_alice_split_bs
diff --git a/keyboards/xelus/valor/rev2/rgb_matrix_kb.inc b/keyboards/xelus/valor/rev2/rgb_matrix_kb.inc
new file mode 100644
index 000000000..351840609
--- /dev/null
+++ b/keyboards/xelus/valor/rev2/rgb_matrix_kb.inc
@@ -0,0 +1,34 @@
1// Step 1.
2// Declare custom effects using the RGB_MATRIX_EFFECT macro
3// (note the lack of semicolon after the macro!)
4RGB_MATRIX_EFFECT(test_mode)
5
6// Step 2.
7// Define effects inside the `RGB_MATRIX_CUSTOM_EFFECT_IMPLS` ifdef block
8#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS
9
10// e.g: A simple effect, self-contained within a single method
11static bool test_mode(effect_params_t* params) {
12 uint8_t factor = 9;
13 switch ((g_rgb_timer & (0b11 << factor)) >> factor) {
14 case 0: {
15 rgb_matrix_set_color_all(150, 0, 0);
16 break;
17 }
18 case 1: {
19 rgb_matrix_set_color_all(0, 150, 0);
20 break;
21 }
22 case 2: {
23 rgb_matrix_set_color_all(0, 0, 150);
24 break;
25 }
26 case 3: {
27 rgb_matrix_set_color_all(150, 150, 150);
28 break;
29 }
30 }
31 return false;
32}
33
34#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS
diff --git a/keyboards/xelus/valor/rev2/rules.mk b/keyboards/xelus/valor/rev2/rules.mk
new file mode 100644
index 000000000..7ec6bcc77
--- /dev/null
+++ b/keyboards/xelus/valor/rev2/rules.mk
@@ -0,0 +1,32 @@
1# MCU name
2MCU = STM32L422
3
4# Bootloader selection
5BOOTLOADER = stm32-dfu
6
7# Build Options
8# change yes to no to disable
9#
10BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
11MOUSEKEY_ENABLE = yes # Mouse keys
12EXTRAKEY_ENABLE = yes # Audio control and System control
13CONSOLE_ENABLE = no # Console for debug
14COMMAND_ENABLE = no # Commands for debug and configuration
15# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
16SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
17# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
18NKRO_ENABLE = yes # USB Nkey Rollover
19BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
20RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
21BLUETOOTH_ENABLE = no # Enable Bluetooth
22AUDIO_ENABLE = no # Audio output
23RGB_MATRIX_ENABLE = yes
24RGB_MATRIX_DRIVER = WS2812
25RGB_MATRIX_CUSTOM_KB = yes
26WS2812_DRIVER = pwm
27EEPROM_DRIVER = i2c
28
29OPT = 2
30LTO_ENABLE = yes
31
32LAYOUTS = alice_split_bs