Skip to content

Commit

Permalink
[Keyboard] add pegasus (#16701)
Browse files Browse the repository at this point in the history
Co-authored-by: Joel Challis <git@zvecr.com>
Co-authored-by: Drashna Jaelre <drashna@live.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
  • Loading branch information
4 people authored Apr 13, 2022
1 parent 9a38ebc commit f3a4987
Show file tree
Hide file tree
Showing 12 changed files with 457 additions and 0 deletions.
80 changes: 80 additions & 0 deletions keyboards/pegasus/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
Copyright 2020 melonbred
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

#include "config_common.h"

/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x0000
#define DEVICE_VER 0x0001
#define MANUFACTURER melonbred
#define PRODUCT Pegasus

/* key matrix size */
#define MATRIX_ROWS 4
#define MATRIX_COLS 12

/*
* Keyboard Matrix Assignments
*
* Change this to how you wired your keyboard
* COLS: AVR pins used for columns, left to right
* ROWS: AVR pins used for rows, top to bottom
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
*
*/
#define MATRIX_ROW_PINS { F0, F1, F4, E6 }
#define MATRIX_COL_PINS { D2, D4, D6, D7, B4, B5, B6, C6, C7, F7, F6, F5 }
//#define UNUSED_PINS { B0, B1, B2, B3, B7 }


/* COL2ROW, ROW2COL*/
#define DIODE_DIRECTION COL2ROW


/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5


/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE


/* Rotary Encoder Definitions */
#define ENCODERS_PAD_A { D0, D5 }
#define ENCODERS_PAD_B { D1, D3 }

/*
* Feature disable options
* These options are also useful to firmware size reduction.
*/

/* disable debug print */
//#define NO_DEBUG

/* disable print */
//#define NO_PRINT

/* disable action features */
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT
100 changes: 100 additions & 0 deletions keyboards/pegasus/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"keyboard_name": "pegasus",
"url": "",
"maintainer": "melonbred",
"layouts": {
"LAYOUT_default": {
"layout": [
{"label":"Esc", "x":0, "y":0},
{"label":"Q", "x":1, "y":0},
{"label":"W", "x":2, "y":0},
{"label":"E", "x":3, "y":0},
{"label":"R", "x":4, "y":0},
{"label":"T", "x":5, "y":0},
{"label":"Y", "x":6, "y":0},
{"label":"U", "x":7, "y":0},
{"label":"I", "x":8, "y":0},
{"label":"O", "x":9, "y":0},
{"label":"P", "x":10, "y":0},
{"label":"Backspace", "x":11, "y":0, "w":1.75},
{"label":"Control", "x":0, "y":1, "w":1.25},
{"label":"A", "x":1.25, "y":1},
{"label":"S", "x":2.25, "y":1},
{"label":"D", "x":3.25, "y":1},
{"label":"F", "x":4.25, "y":1},
{"label":"G", "x":5.25, "y":1},
{"label":"H", "x":6.25, "y":1},
{"label":"J", "x":7.25, "y":1},
{"label":"K", "x":8.25, "y":1},
{"label":"L", "x":9.25, "y":1},
{"label":":", "x":10.25, "y":1},
{"label":"Enter", "x":11.25, "y":1, "w":1.5},
{"label":"Shift", "x":0, "y":2, "w":1.75},
{"label":"Z", "x":1.75, "y":2},
{"label":"X", "x":2.75, "y":2},
{"label":"C", "x":3.75, "y":2},
{"label":"V", "x":4.75, "y":2},
{"label":"B", "x":5.75, "y":2},
{"label":"N", "x":6.75, "y":2},
{"label":"M", "x":7.75, "y":2},
{"label":"<", "x":8.75, "y":2},
{"label":">", "x":9.75, "y":2},
{"label":"?", "x":10.75, "y":2},
{"label":"Shift", "x":11.75, "y":2},
{"label":"Fn", "x":0, "y":3, "w":1.25},
{"label":"Alt", "x":2, "y":3, "w":1.25},
{"x":3.25, "y":3, "w":6.25},
{"label":"Alt", "x":9.5, "y":3, "w":1.25},
{"label":"Ctrl", "x":11.5, "y":3, "w":1.25}
]
},
"LAYOUT_split": {
"layout": [
{"label":"Esc", "x":0, "y":0},
{"label":"Q", "x":1, "y":0},
{"label":"W", "x":2, "y":0},
{"label":"E", "x":3, "y":0},
{"label":"R", "x":4, "y":0},
{"label":"T", "x":5, "y":0},
{"label":"Y", "x":6, "y":0},
{"label":"U", "x":7, "y":0},
{"label":"I", "x":8, "y":0},
{"label":"O", "x":9, "y":0},
{"label":"P", "x":10, "y":0},
{"label":"Backspace", "x":11, "y":0, "w":1.75},
{"label":"Control", "x":0, "y":1, "w":1.25},
{"label":"A", "x":1.25, "y":1},
{"label":"S", "x":2.25, "y":1},
{"label":"D", "x":3.25, "y":1},
{"label":"F", "x":4.25, "y":1},
{"label":"G", "x":5.25, "y":1},
{"label":"H", "x":6.25, "y":1},
{"label":"J", "x":7.25, "y":1},
{"label":"K", "x":8.25, "y":1},
{"label":"L", "x":9.25, "y":1},
{"label":":", "x":10.25, "y":1},
{"label":"Enter", "x":11.25, "y":1, "w":1.5},
{"label":"Shift", "x":0, "y":2, "w":1.75},
{"label":"Z", "x":1.75, "y":2},
{"label":"X", "x":2.75, "y":2},
{"label":"C", "x":3.75, "y":2},
{"label":"V", "x":4.75, "y":2},
{"label":"B", "x":5.75, "y":2},
{"label":"N", "x":6.75, "y":2},
{"label":"M", "x":7.75, "y":2},
{"label":"<", "x":8.75, "y":2},
{"label":">", "x":9.75, "y":2},
{"label":"?", "x":10.75, "y":2},
{"label":"Shift", "x":11.75, "y":2},
{"label":"Fn", "x":0, "y":3, "w":1.25},
{"label":"Alt", "x":2, "y":3, "w":1.25},
{"x":3.25, "y":3},
{"x":4.25, "y":3, "w":2},
{"x":6.25, "y":3, "w":2.25},
{"x":8.5, "y":3},
{"label":"Alt", "x":9.5, "y":3, "w":1.25},
{"label":"Ctrl", "x":11.5, "y":3, "w":1.25}
]
}
}
}
20 changes: 20 additions & 0 deletions keyboards/pegasus/keymaps/default/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* Copyright 2020 melonbred
*
* 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

// place overrides here
#define TAPPING_TERM 175
50 changes: 50 additions & 0 deletions keyboards/pegasus/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/* Copyright 2020 melonbred
*
* 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

// Defines names for use in layer keycodes and the keymap
enum layer_names {
_BASE,
_LAYER1,
_LAYER2

};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_BASE] = LAYOUT_default(
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
CTL_T(KC_TAB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
MO(_LAYER2), KC_LALT, LT(_LAYER1, KC_SPC), KC_RALT, KC_RGUI
),

[_LAYER1] = LAYOUT_default(
KC_GRV, KC_QUOT, _______, KC_UP, _______, _______, _______, _______, KC_7, KC_8, KC_9, KC_DEL,
KC_CAPS, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_PSLS, KC_PMNS, KC_4, KC_5, KC_6, KC_ENT,
KC_LSFT, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, KC_PAST, KC_PPLS, KC_1, KC_2, KC_3, KC_RSFT,
_______, _______, _______, KC_0, KC_PDOT
),

[_LAYER2] = LAYOUT_default(
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_VOLU,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, XXXXXXX, XXXXXXX, KC_RALT, KC_RCTL, KC_DEL, KC_VOLD,
_______, XXXXXXX, XXXXXXX, XXXXXXX, KC_MPLY
),
};



1 change: 1 addition & 0 deletions keyboards/pegasus/keymaps/default/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# The default keymap for pegasus
20 changes: 20 additions & 0 deletions keyboards/pegasus/keymaps/split/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* Copyright 2020 melonbred
*
* 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

// place overrides here
#define TAPPING_TERM 175
49 changes: 49 additions & 0 deletions keyboards/pegasus/keymaps/split/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/* Copyright 2020 melonbred
*
* 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

// Defines names for use in layer keycodes and the keymap
enum layer_names {
_BASE,
_LAYER1,
_LAYER2

};


const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_BASE] = LAYOUT_split(
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
CTL_T(KC_TAB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
MO(_LAYER2), KC_LALT, KC_LCTL, KC_SPC, LT(_LAYER1, KC_SPC), KC_RCTL, KC_RALT, KC_RGUI
),

[_LAYER1] = LAYOUT_split(
KC_GRV, KC_QUOT, _______, KC_UP, _______, _______, _______, _______, KC_7, KC_8, KC_9, KC_DEL,
KC_CAPS, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_PSLS, KC_PMNS, KC_4, KC_5, KC_6, KC_ENT,
KC_LSFT, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, KC_PAST, KC_PPLS, KC_1, KC_2, KC_3, KC_RSFT,
_______, _______, _______, _______, _______, _______, KC_0, KC_PDOT
),

[_LAYER2] = LAYOUT_split(
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_VOLU,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, XXXXXXX, XXXXXXX, KC_RALT, KC_RCTL, KC_DEL, KC_VOLD,
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MPLY
),
};

1 change: 1 addition & 0 deletions keyboards/pegasus/keymaps/split/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# The default keymap for pegasus
37 changes: 37 additions & 0 deletions keyboards/pegasus/pegasus.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/* Copyright 2020 melonbred
*
* 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 "pegasus.h"

#ifdef ENCODER_ENABLE
bool encoder_update_kb(uint8_t index, bool clockwise) {
if (!encoder_update_user(index, clockwise)) { return false; }
if (index == 0) {
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
} else if (index == 1) {
if (clockwise) {
tap_code(KC_PGDN);
} else {
tap_code(KC_PGUP);
}
}
return true;
}
#endif
Loading

0 comments on commit f3a4987

Please sign in to comment.