Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Keebfront Vanguard65 #19762

Closed
wants to merge 64 commits into from
Closed
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
1c380c8
Initial commit
mrnoisytiger Jan 8, 2023
2c2be57
update
mrnoisytiger Jan 8, 2023
2c736f0
added two options for the slider
mrnoisytiger Jan 28, 2023
3d53b36
comments
mrnoisytiger Jan 28, 2023
985376e
added rounding for the lower end of the LED values
mrnoisytiger Feb 4, 2023
22c16d6
moved folder, cleaned up code
mrnoisytiger Feb 7, 2023
7912ba9
fixed layout def
mrnoisytiger Feb 7, 2023
d9f4960
fioxed default layout
mrnoisytiger Feb 7, 2023
c8ed95a
Update keyboards/keebfront/vanguard65/config.h
mrnoisytiger Feb 7, 2023
a51d1f6
Update keyboards/keebfront/vanguard65/keymaps/via/keymap.c
mrnoisytiger Feb 7, 2023
c536fe6
Update keyboards/keebfront/vanguard65/keymaps/via/keymap.c
mrnoisytiger Feb 7, 2023
2e45bf8
Update keyboards/keebfront/vanguard65/readme.md
mrnoisytiger Feb 7, 2023
c0a5916
Update keyboards/keebfront/vanguard65/rules.mk
mrnoisytiger Feb 7, 2023
a463710
Update keyboards/keebfront/vanguard65/info.json
mrnoisytiger Feb 7, 2023
58f26a6
updated default keymap to have encoder map functionality
mrnoisytiger Feb 7, 2023
e102cf8
Merge branch 'vanguard65' of https://github.com/FJLabs-Designs/qmk_fi…
mrnoisytiger Feb 7, 2023
cf764f0
Update keyboards/keebfront/vanguard65/rules.mk
mrnoisytiger Feb 7, 2023
0349d63
Update keyboards/keebfront/vanguard65/config.h
mrnoisytiger Feb 7, 2023
902eea4
Update keyboards/keebfront/vanguard65/config.h
mrnoisytiger Feb 7, 2023
8129f8d
add encoder_update_kb
mrnoisytiger Feb 9, 2023
cb7c0d0
Update keyboards/keebfront/vanguard65/vanguard65.c
mrnoisytiger Apr 4, 2023
9885c93
Update keyboards/keebfront/vanguard65/info.json
mrnoisytiger Apr 16, 2023
a4c8a5e
Update keyboards/keebfront/vanguard65/info.json
mrnoisytiger Apr 16, 2023
6d5d45a
Update keyboards/keebfront/vanguard65/vanguard65.c
mrnoisytiger Apr 16, 2023
7ac4a98
Merge branch 'vanguard65' of https://github.com/FJLabs-Designs/qmk_fi…
mrnoisytiger Apr 16, 2023
200aa62
new qmk
mrnoisytiger Apr 16, 2023
20d1ba1
misc fixes
mrnoisytiger Apr 28, 2023
9bde9b7
Test
mrnoisytiger Apr 28, 2023
8cf0fe9
Removed extraneous parts of hte rules.mk
mrnoisytiger May 15, 2023
c82ee93
Remove extra layers in the keymap
mrnoisytiger Jun 12, 2023
ed89048
Revert "Remove extra layers in the keymap"
mrnoisytiger Jun 12, 2023
8167157
removed excess layers
mrnoisytiger Jun 12, 2023
142d9cb
Merge branch 'master' of https://github.com/FJLabs-Designs/qmk_firmwa…
mrnoisytiger Jun 12, 2023
ca51bf7
Merge branch 'master' of https://github.com/qmk/qmk_firmware into van…
mrnoisytiger Jun 12, 2023
8419b8c
update for latest QMK led definition
mrnoisytiger Jun 12, 2023
16749b6
update
mrnoisytiger Jun 24, 2023
ac0b229
Update keyboards/keebfront/vanguard65/info.json
mrnoisytiger Jul 15, 2023
456733e
Update keyboards/keebfront/vanguard65/keymaps/via/keymap.c
mrnoisytiger Jul 15, 2023
0a5bf9f
Update keyboards/keebfront/vanguard65/info.json
mrnoisytiger Aug 29, 2023
4bbf49c
Update keyboards/keebfront/vanguard65/info.json
mrnoisytiger Aug 29, 2023
d50489b
Update keyboards/keebfront/vanguard65/keymaps/default/keymap.c
mrnoisytiger Aug 29, 2023
5e653bd
Update keyboards/keebfront/vanguard65/keymaps/via/keymap.c
mrnoisytiger Aug 29, 2023
9c4c679
Update keyboards/keebfront/vanguard65/readme.md
mrnoisytiger Sep 5, 2023
184462b
Update keyboards/keebfront/vanguard65/keymaps/default/keymap.c
mrnoisytiger Sep 5, 2023
8b99a19
Update keyboards/keebfront/vanguard65/info.json
mrnoisytiger Sep 5, 2023
351d90a
Update keyboards/keebfront/vanguard65/keymaps/default/keymap.c
mrnoisytiger Sep 5, 2023
665672a
Update keyboards/keebfront/vanguard65/keymaps/via/keymap.c
mrnoisytiger Sep 5, 2023
7fafb86
Update keyboards/keebfront/vanguard65/info.json
mrnoisytiger Sep 5, 2023
36cca47
Delete vanguard65.c
mrnoisytiger Sep 6, 2023
0f5bd22
run qmk format_json
mrnoisytiger Sep 6, 2023
db3b81d
Update keyboards/keebfront/vanguard65/rules.mk
mrnoisytiger Sep 6, 2023
2f55115
Update keyboards/keebfront/vanguard65/readme.md
mrnoisytiger Sep 12, 2023
db3970b
Update keyboards/keebfront/vanguard65/readme.md
mrnoisytiger Sep 12, 2023
fc617cc
Update keyboards/keebfront/vanguard65/info.json
mrnoisytiger Sep 12, 2023
71c1cf6
Update keyboards/keebfront/vanguard65/keymaps/default/keymap.c
mrnoisytiger Sep 12, 2023
51d125d
Update keyboards/keebfront/vanguard65/keymaps/via/keymap.c
mrnoisytiger Sep 12, 2023
d196bb4
Update keyboards/keebfront/vanguard65/keymaps/via/keymap.c
mrnoisytiger Sep 13, 2023
9b31f1d
Update keyboards/keebfront/vanguard65/keymaps/default/keymap.c
mrnoisytiger Sep 13, 2023
071d75e
Update keyboards/keebfront/vanguard65/info.json
mrnoisytiger Sep 13, 2023
d54123d
Update keyboards/keebfront/vanguard65/keymaps/via/keymap.c
mrnoisytiger Sep 21, 2023
643b7f1
Update keyboards/keebfront/vanguard65/keymaps/default/keymap.c
mrnoisytiger Sep 21, 2023
11bc0ac
Update keyboards/keebfront/vanguard65/keymaps/default/keymap.c
mrnoisytiger Oct 9, 2023
a378b15
Update keyboards/keebfront/vanguard65/keymaps/default/keymap.c
mrnoisytiger Oct 9, 2023
ee5ea81
Confirm all keymaps compile
mrnoisytiger Oct 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions keyboards/keebfront/vanguard65/config.h
waffle87 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
Copyright 2022 <[email protected]>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

/* Define MIDI */
#define MIDI_ADVANCED
#define SLIDER_PINA D6
743 changes: 743 additions & 0 deletions keyboards/keebfront/vanguard65/info.json

Large diffs are not rendered by default.

46 changes: 46 additions & 0 deletions keyboards/keebfront/vanguard65/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
Copyright 2022 <[email protected]>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include QMK_KEYBOARD_H

enum layers {
_LAYER0,
_LAYER1,
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

[_LAYER0] = LAYOUT_ansi_blocker_split_bs(
KC_MUTE, QK_GESC, 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, KC_DEL, KC_HOME
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, KC_PGUP,
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, KC_BSPC, KC_PGDN,
KC_LSFT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT
),

[_LAYER1] = LAYOUT_ansi_blocker_split_bs(
mrnoisytiger marked this conversation as resolved.
Show resolved Hide resolved
_______, QK_GESC, 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_END,
_______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, KC_PSCR, KC_SCRL, KC_PAUS, QK_BOOT, _______,
_______, RGB_SPI, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, KC_VOLU,
_______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT
mrnoisytiger marked this conversation as resolved.
Show resolved Hide resolved
),
};

#if defined(ENCODER_MAP_ENABLE)
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[_LAYER0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[_LAYER1] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS) },
};
#endif
1 change: 1 addition & 0 deletions keyboards/keebfront/vanguard65/keymaps/default/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ENCODER_MAP_ENABLE = yes
232 changes: 232 additions & 0 deletions keyboards/keebfront/vanguard65/keymaps/via/keymap.c
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default and via keymaps should be simple. Most of this should be removed, or moved to a manufacturer keymap, per PR checklist.

Original file line number Diff line number Diff line change
@@ -0,0 +1,232 @@
/*
Copyright 2022 <[email protected]>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include QMK_KEYBOARD_H
#include "analog.h"
#include "string.h"

enum layers {
_LAYER0,
_LAYER1
};

enum custom_keycodes {
A_CW = QK_KB_0,
A_CCW
};

// Set up EEPROM. Mostly boilerplate from QMK docs
typedef union {
uint32_t raw;
struct {
uint8_t slider_func_state : 8; // Hold only the slider function state. Will be a low value integer, so 8 bits will be used to store.
};
} user_config_t;
user_config_t user_config;

uint8_t slider_func = 0;

// On keyboard initialization, pull the EEPROM values
void keyboard_post_init_user(void) {
// Call the keymap level matrix init.
user_config.raw = eeconfig_read_user();
slider_func = user_config.slider_func_state;
};

// When the EEPROM gets forcefully reset, set the initialization value
void eeconfig_init_user(void) {
user_config.raw = 0;
user_config.slider_func_state = 0;
eeconfig_update_user(user_config.raw);
}

#if defined(ENCODER_MAP_ENABLE)
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
[_LAYER0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU)},
[_LAYER1] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}
};
#endif

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

[_LAYER0] = LAYOUT_ansi_blocker_split_bs(
KC_MUTE, QK_GESC, 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, KC_DEL, KC_HOME
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, KC_PGUP,
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, KC_BSPC, KC_PGDN,
KC_LSFT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT
),

[_LAYER1] = LAYOUT_ansi_blocker_split_bs(
mrnoisytiger marked this conversation as resolved.
Show resolved Hide resolved
_______, QK_GESC, 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_END,
_______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, KC_PSCR, KC_SCRL, KC_PAUS, QK_BOOT, _______,
_______, RGB_SPI, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, KC_VOLU,
_______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT
),

};

/* Configure custom MIDI Keycodes that will be placed on USER_00 and USER_01 */
extern MidiDevice midi_device;
#define MIDI_CC_OFF 0
#define MIDI_CC_ON 127

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case A_CW:
if (record->event.pressed) {
midi_send_cc(&midi_device, midi_config.channel, 89, 1);
}
return true;
case A_CCW:
if (record->event.pressed) {
midi_send_cc(&midi_device, midi_config.channel, 89, 127);
}
return true;
default:
return true;
}
}

// ====== Process VIA Custom UI ======
// enum for the Value ID of the slider control
enum via_slider_control {
id_slider_func = 1
};

// Define the function to set the slider value
void slider_func_set_value ( uint8_t *data ) {
// data = [ value_id, value_data ]
uint8_t *value_id = &(data[0]);
uint8_t *value_data = &(data[1]);

switch ( *value_id )
{
case id_slider_func:
{
slider_func = *value_data;
user_config.slider_func_state = *value_data;
eeconfig_update_user(user_config.raw); // Going to set it here instead of separately in the VIA save function. No point since this value is not being toggled very often
break;
}
}
}

// Define the function to read the slider value [so that VIA UI knows what to display]
void slider_func_get_value( uint8_t *data ) {
// data = [ value_id, value_data ]
uint8_t *value_id = &(data[0]);
uint8_t *value_data = &(data[1]);

switch ( *value_id )
{
case id_slider_func:
{
*value_data = slider_func;
break;
}
}
}

// Boilerplate from VIA Custom UI Documentation. Listen on the custom command channel,
void via_custom_value_command_kb(uint8_t *data, uint8_t length) {
// data = [ command_id, channel_id, value_id, value_data ]
uint8_t *command_id = &(data[0]);
uint8_t *channel_id = &(data[1]);
uint8_t *value_id_and_data = &(data[2]);

if ( *channel_id == id_custom_channel ) {
switch ( *command_id )
{
case id_custom_set_value:
{
slider_func_set_value(value_id_and_data);
break;
}
case id_custom_get_value:
{
slider_func_get_value(value_id_and_data);
break;
}
case id_custom_save:
{
//buttglow_config_save(); // Not doing this
break;
}
default:
{
// Unhandled message.
*command_id = id_unhandled;
break;
}
}
return;
}

// Return the unhandled state
*command_id = id_unhandled;

// DO NOT call raw_hid_send(data,length) here, let caller do this
}

/* MIDI Slider controls */
uint8_t last_val = 0;
uint8_t rgb_hue = 0;
uint8_t rgb_sat = 0;

void slider(void) {

uint8_t current_val = analogReadPin(SLIDER_PINA) >>3; // Bit shift 2^10 [1024] to 2^7 [128]

if ( last_val - current_val < -1 || last_val - current_val > 1 ) {

// Underglow RGB Brightness
if ( slider_func == 0 ) {
uint8_t rounded_val = 0;
uint8_t round_coefficient = 3; // Set round-to-zero value target
rgb_hue = rgblight_get_hue(); // Pull current hue and saturation values since we're just adjusting brightness
rgb_sat = rgblight_get_sat();

// Since the lower end range of the slider can be a little bit noisy, it's going to make the zero-value a little hard to hit when it bounces around between 0-1-2. Better off to round any super low values to zero so the lights will affirmatively turn off at lower values.
if ( current_val < round_coefficient ) {
rounded_val = 0;
} else {
rounded_val = current_val;
}

rgblight_sethsv(rgb_hue, rgb_sat, rounded_val * 2); // At 8 bits, it's going to be 0-128, so double to get full range.
}

// MIDI CC 90
else if ( slider_func == 1 ) {
midi_send_cc(&midi_device, 0, 90, current_val );
}

// Layer shift between layers 1 - 4
else if ( slider_func == 2 ) {
layer_move(current_val >>5); // Bit shift 2^7 to 2^2
}

else {
return;
}

last_val = current_val;
}
}

void housekeeping_task_user(void) {
slider();
}
3 changes: 3 additions & 0 deletions keyboards/keebfront/vanguard65/keymaps/via/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
VIA_ENABLE = yes
ENCODER_MAP_ENABLE = yes
SRC += analog.c
29 changes: 29 additions & 0 deletions keyboards/keebfront/vanguard65/readme.md
mrnoisytiger marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Keebfront Vanguard65

mrnoisytiger marked this conversation as resolved.
Show resolved Hide resolved
![Vanguard65](https://i.imgur.com/1AnyRaEh.png)
The following is the QMK Firmware for the Keebfront Vanguard65


* Keyboard Maintainer: Keebfront
* Hardware Supported: Vanguard65

Make example for this keyboard (after setting up your build environment):

make keebfront/vanguard65:default

Flashing example for this keyboard:

make keebfront/vanguard65:default:flash


See 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).

## Bootloader

Enter the bootloader in 2 ways:

* **Physical reset**: pressing the two reset pads on the back of the PCB with tweezers.
* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available
mrnoisytiger marked this conversation as resolved.
Show resolved Hide resolved

## Matrix Diagram
![MatrixCoordinates](https://i.imgur.com/rQfEXyeh.jpeg)
2 changes: 2 additions & 0 deletions keyboards/keebfront/vanguard65/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Processor frequency
F_CPU = 8000000