Skip to content

Commit b9902a3

Browse files
Xelus22drashnafauxpark
authored
[Keyboard] Valor Rev 2 (#13551)
Co-authored-by: Drashna Jaelre <[email protected]> Co-authored-by: Ryan <[email protected]>
1 parent 9e782e4 commit b9902a3

File tree

16 files changed

+672
-0
lines changed

16 files changed

+672
-0
lines changed

keyboards/xelus/valor/rev2/config.h

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

keyboards/xelus/valor/rev2/halconf.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+

keyboards/xelus/valor/rev2/info.json

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
18+
const 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
37+
void 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
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# The Default Valor Rev2 Layout
2+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

0 commit comments

Comments
 (0)