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

Custom Boards #19

Merged
merged 1 commit into from
Dec 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
63 changes: 63 additions & 0 deletions keyboards/crkbd/keymaps/harvester/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# KidBrazil's custom CRKBD Layout

![Loose Transistor Crkbd](https://user-images.githubusercontent.com/4823043/71268460-0862c000-231b-11ea-8f32-2fe8da4d348a.jpg)

This is a simple layout that I use for both programming and gaming. It is very
closely based on the original CRKBD layout with some modifications to the
position of CTRL and SHIFT.

## Layers
This keymap includes a total of 4 Layers:
- QWERTY
- NUMBERS
- SYMBOLS
- GAMING
- WEAPONS

The first three layers are pretty self explanatory and follow closely the
default keymap for this keyboard. The magic really starts to happen with the
gaming layer.

### Gaming Layer
The gaming layer can be toggled on/off from the SYMBOLS layer. Once on the
gaming layer it will stay there until you toggle it off again. The gaming layer
includes normal WASD and most of the keys FPS games use on the left hand. On the
right hand we have F1-F12 and a few other special keys for games that require
it.

### Weapon
The weapon layer is a momentary layer that can only be reached from the gaming
layer. This layer preserves the left hand almost unchanged, except for when the
layer is activated the top row becomes NUM 1 - 6 for wepon selection. The right
hand is KC_TRNS the whole way so basically it is still the gaming layer.

## Custom Font
This keymap includes a custom font for my LooseTransistor logo. It is fine if
you want to use it I certainly don't mind but if you want your own, just replace
the glcdfont file here and you should be fine.

Alternatively you could remove the font config line from the config.h file so it
will use the default QMK one.

## OLED
This Keymap is setup to use the newer OLED API. Some work has been done to
customize this with showing layer and USB information. I also tried my best to
get a dormant / sleep state going but it is hit or miss and often only works on
the master hand.

## OLED & RGB Matrix timeout
This keymap will set a automated timeout system for the OLED screen and the RGB
matrix. After 3 minutes or so the LED screen will display the logo on both
halves and 5 minutes after that both the LED and the Matrix will be switched
off.

Once a user hits the keys again, the LED matrix will turn back on unless the
user has disabled it via RGB_TOG.

## Flashing
To flash this on your CRKBD simply use the `make crkbd:kidbrazil:flash`
command.

### TODO
- Wait for Spit_common to be implemented in CRKBD and revisit the special color
layers and animations
131 changes: 131 additions & 0 deletions keyboards/crkbd/keymaps/harvester/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
/*
Copyright 2019 @foostan
Copyright 2020 Drashna Jaelre <@drashna>

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

/* Select hand configuration */

#define MASTER_LEFT
//#define MASTER_RIGHT
//#define EE_HANDS

#define SPLIT_TRANSPORT_MIRROR
#define SPLIT_LAYER_STATE_ENABLE
#define SPLIT_LED_STATE_ENABLE
#define SPLIT_MODS_ENABLE

//#define TAPPING_FORCE_HOLD
#define TAPPING_TERM 200

#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET // Activates the double-tap behavior
#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 200U // Timeout window in ms in which the double tap can occur.
#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED_MASK 0U // Specify a optional status led which blinks when entering the bootloader

//#define SERIAL_USART_TX_PIN D2
#define SPLIT_USB_DETECT
#define SERIAL_PIO_USE_PIO1

#ifdef RGBLIGHT_ENABLE
#define RGBLIGHT_EFFECT_BREATHING
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
#define RGBLIGHT_EFFECT_SNAKE
#define RGBLIGHT_EFFECT_KNIGHT
#define RGBLIGHT_EFFECT_CHRISTMAS
#define RGBLIGHT_EFFECT_STATIC_GRADIENT
// #define RGBLIGHT_EFFECT_RGB_TEST
// #define RGBLIGHT_EFFECT_ALTERNATING
// #define RGBLIGHT_EFFECT_TWINKLE
#define RGBLIGHT_LIMIT_VAL 120
#define RGBLIGHT_HUE_STEP 10
#define RGBLIGHT_SAT_STEP 17
#define RGBLIGHT_VAL_STEP 17
#endif

#ifdef RGB_MATRIX_ENABLE
# define RGB_MATRIX_KEYPRESSES // reacts to keypresses
// # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses)
// # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
# define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
# define RGB_MATRIX_FRAMEBUFFER_EFFECTS
// # define RGB_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness)
// # define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 // limits maximum brightness of LEDs to 150 out of 255. Higher may cause the controller to crash.
# define RGB_MATRIX_HUE_STEP 8
# define RGB_MATRIX_SAT_STEP 8
# define RGB_MATRIX_VAL_STEP 8
# define RGB_MATRIX_SPD_STEP 10

/* Enable the animations you want/need. You may need to enable only a small number of these because *
* they take up a lot of space. Enable and confirm that you can still successfully compile your firmware. */
// RGB Matrix Animation modes. Explicitly enabled
// For full list of effects, see:
// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects
# define ENABLE_RGB_MATRIX_ALPHAS_MODS
# define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN
# define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT
# define ENABLE_RGB_MATRIX_BREATHING
# define ENABLE_RGB_MATRIX_BAND_SAT
# define ENABLE_RGB_MATRIX_BAND_VAL
# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT
# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL
# define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT
# define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL
# define ENABLE_RGB_MATRIX_CYCLE_ALL
# define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
# define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN
# define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN
# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL
# define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL
# define ENABLE_RGB_MATRIX_CYCLE_SPIRAL
# define ENABLE_RGB_MATRIX_DUAL_BEACON
# define ENABLE_RGB_MATRIX_RAINBOW_BEACON
# define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS
# define ENABLE_RGB_MATRIX_RAINDROPS
# define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
# define ENABLE_RGB_MATRIX_HUE_BREATHING
# define ENABLE_RGB_MATRIX_HUE_PENDULUM
# define ENABLE_RGB_MATRIX_HUE_WAVE
# define ENABLE_RGB_MATRIX_PIXEL_RAIN
# define ENABLE_RGB_MATRIX_PIXEL_FLOW
# define ENABLE_RGB_MATRIX_PIXEL_FRACTAL
// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined
# define ENABLE_RGB_MATRIX_TYPING_HEATMAP
# define ENABLE_RGB_MATRIX_DIGITAL_RAIN
// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
# define ENABLE_RGB_MATRIX_SPLASH
# define ENABLE_RGB_MATRIX_MULTISPLASH
# define ENABLE_RGB_MATRIX_SOLID_SPLASH
# define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
#endif

#define OLED_FONT_H "keyboards/crkbd/lib/glcdfont.c"

#define USB_POLLING_INTERVAL_MS 1
#define QMK_KEYS_PER_SCAN 12

#define DYNAMIC_KEYMAP_LAYER_COUNT 10
29 changes: 29 additions & 0 deletions keyboards/crkbd/keymaps/harvester/enums.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// [CRKBD layers Init] -------------------------------------------------------//
typedef enum {
_BASE,
_NUM,
_FUN,
_MEDIA,
_GAME,
_MOD,
_NAV,
_MSE,
_SYM
}CRKBD_LAYERS;

extern enum CRKBD_LAYERS crkbd_layers;

typedef enum {
_RGB_INDICATORS,
_RGB_DANGER,
_RGB_NUM,
_RGB_FUNC,
_RGB_MEDIA,
_RGB_GAME,
_RGB_MOD,
_RGB_DEFAULT,
_RGB_TRANS,
_RGB_DISABLED
}CRKBD_RGB;

extern enum CRKBD_RGB crkbd_rgb;
132 changes: 132 additions & 0 deletions keyboards/crkbd/keymaps/harvester/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
/*
Copyright 2019 @foostan
Copyright 2020 Drashna Jaelre <@drashna>

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 <stdio.h>
#include "oled.c"


const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_BASE]= LAYOUT_split_3x6_3(
//,-----------------------------------------------------. ,-----------------------------------------------------.
KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, RSFT_T(KC_QUOT),
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RALT,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
LT(_MEDIA,KC_ESC), LT(_NAV,KC_TAB), LT(_MSE,KC_SPC), LT(_SYM,KC_ENT), LT(_NUM,KC_BSPC), LT(_FUN,KC_DEL)
//`--------------------------' `--------------------------'
),

[_GAME] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------. ,-----------------------------------------------------.
KC_ESC, KC_T, KC_Q, KC_W, KC_E, KC_R, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
_______, KC_F, KC_A, KC_S, KC_D, KC_F, KC_H, KC_J, KC_K, KC_L, KC_SCLN, _______,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
_______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
MO(_NUM), MO(_MOD), KC_SPC, KC_ENT, KC_BSPC , KC_DEL
//`--------------------------' `--------------------------'
),

[_NAV] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------. ,-----------------------------------------------------.
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, C(KC_Y), C(KC_V), C(KC_C), C(KC_X), C(KC_Z), C(KC_S),
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
_______, C(KC_A), C(KC_S), XXXXXXX, XXXXXXX, XXXXXXX, KC_CAPS, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
_______, C(KC_Z), C(KC_X), C(KC_C), C(KC_V), XXXXXXX, KC_INS, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
XXXXXXX, _______, XXXXXXX, KC_ENT, KC_BSPC, KC_DEL
//`--------------------------' `--------------------------'
),

[_MSE] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------. ,-----------------------------------------------------.
QK_BOOT, XXXXXXX, XXXXXXX, LGUI(KC_E), LGUI(KC_R), XXXXXXX, C(KC_Y), C(KC_V), C(KC_C), C(KC_X), C(KC_Z), C(KC_S),
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
_______, XXXXXXX, LGUI(LSFT(KC_S)), XXXXXXX, XXXXXXX, TO(_GAME), XXXXXXX, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, _______,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
EE_CLR, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
XXXXXXX, XXXXXXX, _______, KC_BTN1, KC_BTN3, KC_BTN2
//`--------------------------' `--------------------------'
),

[_MEDIA] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------. ,-----------------------------------------------------.
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
_______, KC_LGUI, KC_LALT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT, _______,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, NK_TOGG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
_______, XXXXXXX, XXXXXXX, KC_MPLY, KC_MSTP, KC_MUTE
//`--------------------------' `--------------------------'
),

[_NUM] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------. ,-----------------------------------------------------.
XXXXXXX, KC_LBRC, KC_7, KC_8, KC_9, KC_RBRC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
_______, KC_SCLN, KC_4, KC_5, KC_6, KC_EQL, XXXXXXX, KC_RSFT, KC_RCTL, KC_RALT, KC_LGUI, _______,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
_______, KC_GRV, KC_1, KC_2, KC_3, KC_BSLS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
KC_DOT, KC_0, KC_MINS, XXXXXXX, _______, XXXXXXX
//`--------------------------' `--------------------------'
),

[_SYM] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------. ,-----------------------------------------------------.
XXXXXXX, KC_LCBR, KC_AMPR, KC_ASTR, KC_LPRN, KC_RCBR, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
_______, KC_COLN, KC_DLR, KC_PERC, KC_CIRC, KC_PLUS, XXXXXXX, KC_RSFT, KC_RCTL, KC_RALT, KC_LGUI, _______,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
_______, KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_PIPE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
KC_LPRN, KC_RPRN, KC_UNDS, _______, XXXXXXX, XXXXXXX
//`--------------------------' `--------------------------'
),

[_FUN] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------. ,-----------------------------------------------------.
XXXXXXX, KC_F12, KC_F7, KC_F8, KC_F9, KC_PSCR, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
_______, KC_F11, KC_F4, KC_F5, KC_F6, KC_SCRL, XXXXXXX, KC_RSFT, KC_RCTL, KC_RALT, KC_LGUI, _______,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
_______, KC_F10, KC_F1, KC_F2, KC_F3, KC_PAUS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
KC_MENU, KC_TAB, KC_SPC, XXXXXXX, XXXXXXX, _______
//`--------------------------' `--------------------------'
),

[_MOD] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------. ,-----------------------------------------------------.
XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, TO(_BASE),
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
_______, XXXXXXX, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
MO(_FUN), _______, KC_ENT, XXXXXXX, _______, XXXXXXX
//`--------------------------' `--------------------------'
)
};
Loading