From cbcb4f2ec0bdfb53c68bcf9ce3b62febcb0626e3 Mon Sep 17 00:00:00 2001 From: Jesus Climent Date: Sat, 13 Aug 2022 21:26:05 +0100 Subject: [Keyboard] Added Atreyu keyboard. (#17698) * Add Atreyu keyboard. Co-authored-by: Drashna Jaelre Co-authored-by: Ryan --- keyboards/atreyu/atreyu.c | 17 +++++ keyboards/atreyu/atreyu.h | 21 ++++++ keyboards/atreyu/config.h | 35 +++++++++ keyboards/atreyu/keymaps/default/config.h | 27 +++++++ keyboards/atreyu/keymaps/default/keymap.c | 110 +++++++++++++++++++++++++++++ keyboards/atreyu/keymaps/default/readme.md | 7 ++ keyboards/atreyu/keymaps/default/rules.mk | 1 + keyboards/atreyu/readme.md | 29 ++++++++ keyboards/atreyu/rev1/config.h | 72 +++++++++++++++++++ keyboards/atreyu/rev1/info.json | 77 ++++++++++++++++++++ keyboards/atreyu/rev1/rev1.c | 47 ++++++++++++ keyboards/atreyu/rev1/rev1.h | 40 +++++++++++ keyboards/atreyu/rev1/rules.mk | 0 keyboards/atreyu/rules.mk | 22 ++++++ 14 files changed, 505 insertions(+) create mode 100644 keyboards/atreyu/atreyu.c create mode 100644 keyboards/atreyu/atreyu.h create mode 100644 keyboards/atreyu/config.h create mode 100644 keyboards/atreyu/keymaps/default/config.h create mode 100644 keyboards/atreyu/keymaps/default/keymap.c create mode 100644 keyboards/atreyu/keymaps/default/readme.md create mode 100644 keyboards/atreyu/keymaps/default/rules.mk create mode 100644 keyboards/atreyu/readme.md create mode 100644 keyboards/atreyu/rev1/config.h create mode 100644 keyboards/atreyu/rev1/info.json create mode 100644 keyboards/atreyu/rev1/rev1.c create mode 100644 keyboards/atreyu/rev1/rev1.h create mode 100644 keyboards/atreyu/rev1/rules.mk create mode 100644 keyboards/atreyu/rules.mk diff --git a/keyboards/atreyu/atreyu.c b/keyboards/atreyu/atreyu.c new file mode 100644 index 0000000000..0c5a97d18a --- /dev/null +++ b/keyboards/atreyu/atreyu.c @@ -0,0 +1,17 @@ +/* Copyright 2022 Jesus Climent (@climent) + * + * 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 . + */ + +#include "atreyu.h" diff --git a/keyboards/atreyu/atreyu.h b/keyboards/atreyu/atreyu.h new file mode 100644 index 0000000000..92471092ef --- /dev/null +++ b/keyboards/atreyu/atreyu.h @@ -0,0 +1,21 @@ +/* Copyright 2022 Jesus Climent (@climent) + * + * 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 . + */ + +#pragma once + +#if defined(KEYBOARD_atreyu_rev1) +# include "rev1.h" +#endif diff --git a/keyboards/atreyu/config.h b/keyboards/atreyu/config.h new file mode 100644 index 0000000000..ba12b366a9 --- /dev/null +++ b/keyboards/atreyu/config.h @@ -0,0 +1,35 @@ +/* Copyright 2022 Jesus Climent (@climent) + * + * 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 . + */ + +#pragma once + +#include "config_common.h" + +/* + * 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 diff --git a/keyboards/atreyu/keymaps/default/config.h b/keyboards/atreyu/keymaps/default/config.h new file mode 100644 index 0000000000..748a95e439 --- /dev/null +++ b/keyboards/atreyu/keymaps/default/config.h @@ -0,0 +1,27 @@ +/* Copyright 2022 Jesus Climent (@climent) + * + * 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 . + */ + +#pragma once + +#include "config_common.h" + +// place overrides here +#ifdef TAPPING_TERM +#undef TAPPING_TERM +#define TAPPING_TERM 150 +#endif + +#define RETRO_TAPPING diff --git a/keyboards/atreyu/keymaps/default/keymap.c b/keyboards/atreyu/keymaps/default/keymap.c new file mode 100644 index 0000000000..f6e15d26cb --- /dev/null +++ b/keyboards/atreyu/keymaps/default/keymap.c @@ -0,0 +1,110 @@ +/* Copyright 2022 Jesus Climent (@climent) + * + * 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 . + */ + +#include QMK_KEYBOARD_H + + +enum custom_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LWR, + RSE, + ADJ +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_QWERTY] = LAYOUT( + KC_ESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 ,KC_GRV , + KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P ,KC_BSPC , + KC_LCTRL, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN ,KC_QUOT , + 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_LCTL, LWR , KC_LALT, KC_LGUI, KC_ENT , KC_LBRC, KC_RBRC, KC_SPC , RSE , KC_NO , KC_NO , KC_RCTL + + ), + +[_RAISE] = LAYOUT( + _______, _______, _______, _______, _______, _______, KC_HOME, KC_END , _______, KC_LCBR, KC_RCBR, KC_TILD, + _______, _______, _______, _______, KC_HOME, KC_END , KC_PGUP, XXXXXXX, KC_UP , KC_LBRC, KC_RBRC, KC_DEL , + _______, _______, _______, _______, _______, _______, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_PIPE, KC_ENT , + _______, _______, _______, _______, _______, _______, KC_UNDS, KC_MINS, KC_EQL , KC_PLUS, KC_BSLS, _______, + _______, _______, _______, _______, KC_SPC , KC_HOME, KC_END , _______, _______, KC_RGUI, KC_RALT, _______ +), + +[_LOWER] = LAYOUT( + KC_GRV , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , _______, + _______, KC_VOLU, _______, _______, TG(_RAISE), AG_TOGG, _______, _______, _______, _______, _______, KC_DEL , + _______, KC_VOLD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, KC_SPC , KC_VOLD, KC_VOLU, _______, _______, _______, _______, _______ +), + +[_ADJUST] = LAYOUT( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, _______, _______, _______, _______ , _______, _______ , _______, _______, _______, _______, _______ +) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case LWR: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + + case RSE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + + case KC_ESC: + if ((get_mods() & MOD_BIT(KC_LGUI)) == MOD_BIT(KC_LGUI)) { + if (record->event.pressed) { + register_code(KC_GRV); + } else { + unregister_code(KC_GRV); + } + return false; + } + return true; + break; + } + return true; +} + diff --git a/keyboards/atreyu/keymaps/default/readme.md b/keyboards/atreyu/keymaps/default/readme.md new file mode 100644 index 0000000000..7037fa1885 --- /dev/null +++ b/keyboards/atreyu/keymaps/default/readme.md @@ -0,0 +1,7 @@ +# Atreyu Keymap + +The default keymap provided here is useful for testing and as a base +for your own mapping. It only includes basic layers and is missing many +keycodes. To build the default keymap: + +make atreyu:default diff --git a/keyboards/atreyu/keymaps/default/rules.mk b/keyboards/atreyu/keymaps/default/rules.mk new file mode 100644 index 0000000000..433146d8d0 --- /dev/null +++ b/keyboards/atreyu/keymaps/default/rules.mk @@ -0,0 +1 @@ +ENCODER_ENABLE = no diff --git a/keyboards/atreyu/readme.md b/keyboards/atreyu/readme.md new file mode 100644 index 0000000000..877e8788d2 --- /dev/null +++ b/keyboards/atreyu/readme.md @@ -0,0 +1,29 @@ +# atreyu + +![atreyu](https://i.imgur.com/NP0cux1h.jpg) + +An unsplit, modified version of a Lily58 having a baby with a Sofle keyboard + +* Keyboard Maintainer: [Jesus Climent](https://github.com/Jesus Climent) +* Hardware Supported: AtreyuKeyboard PCB, ProMicro +* Hardware Availability: [PCB and case data](https://github.com/climent/atreyu) + +Make example for this keyboard (after setting up your build environment): + + make atreyu:default + +Flashing example for this keyboard: + + make atreyu:default:flash + +## Bootloader + +Enter the bootloader in 3 ways: + +* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard +* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead +* **Keycode in layout**: Press the key mapped to `RESET` if it is available + +## More information + +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). diff --git a/keyboards/atreyu/rev1/config.h b/keyboards/atreyu/rev1/config.h new file mode 100644 index 0000000000..36cf04dd86 --- /dev/null +++ b/keyboards/atreyu/rev1/config.h @@ -0,0 +1,72 @@ +/* Copyright 2022 Jesus Climent (@climent) + * + * 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 . + */ + +#pragma once + +#include "config_common.h" + +/* key matrix size */ +#define MATRIX_ROWS 10 +#define MATRIX_COLS 6 + +/* + * 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 { D7, E6, B4, B5, F6, F7, B1, B3, B6, B2 } +#define MATRIX_COL_PINS { C6, D4, D0, D1, D2, D3 } + +/* encoder support */ +#define ENCODERS_PAD_A { F5 } +#define ENCODERS_PAD_B { F4 } +#define ENCODERS_PAD_A_RIGHT { F4 } +#define ENCODERS_PAD_B_RIGHT { F5 } +#define ENCODER_RESOLUTION 4 + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 diff --git a/keyboards/atreyu/rev1/info.json b/keyboards/atreyu/rev1/info.json new file mode 100644 index 0000000000..d0b3c0eb42 --- /dev/null +++ b/keyboards/atreyu/rev1/info.json @@ -0,0 +1,77 @@ +{ + "keyboard_name": "Atreyu", + "manufacturer": "Heyzeus", + "url": "https://github.com/climent/atreyu", + "maintainer": "Jesus Climent ", + "usb": { + "vid": "0xFEED", + "pid": "0x0001", + "device_version": "0.0.1" + }, + "layouts": { + "LAYOUT": { + "layout": [ + {"x":0, "y":0.5}, + {"x":1, "y":0.375}, + {"x":2, "y":0.125}, + {"x":3, "y":0}, + {"x":4, "y":0.125}, + {"x":5, "y":0.25}, + {"x":10.5, "y":0.25}, + {"x":11.5, "y":0.125}, + {"x":12.5, "y":0}, + {"x":13.5, "y":0.125}, + {"x":14.5, "y":0.375}, + {"x":15.5, "y":0.5}, + {"x":0, "y":1.5}, + {"x":1, "y":1.375}, + {"x":2, "y":1.125}, + {"x":3, "y":1}, + {"x":4, "y":1.125}, + {"x":5, "y":1.25}, + {"x":10.5, "y":1.25}, + {"x":11.5, "y":1.125}, + {"x":12.5, "y":1}, + {"x":13.5, "y":1.125}, + {"x":14.5, "y":1.375}, + {"x":15.5, "y":1.5}, + {"x":0, "y":2.5}, + {"x":1, "y":2.375}, + {"x":2, "y":2.125}, + {"x":3, "y":2}, + {"x":4, "y":2.125}, + {"x":5, "y":2.25}, + {"x":10.5, "y":2.25}, + {"x":11.5, "y":2.125}, + {"x":12.5, "y":2}, + {"x":13.5, "y":2.125}, + {"x":14.5, "y":2.375}, + {"x":15.5, "y":2.5}, + {"x":0, "y":3.5}, + {"x":1, "y":3.375}, + {"x":2, "y":3.125}, + {"x":3, "y":3}, + {"x":4, "y":3.125}, + {"x":5, "y":3.25}, + {"x":6, "y":2.75}, + {"x":9.5, "y":2.75}, + {"x":10.5, "y":3.25}, + {"x":11.5, "y":3.125}, + {"x":12.5, "y":3}, + {"x":13.5, "y":3.125}, + {"x":14.5, "y":3.375}, + {"x":15.5, "y":3.5}, + {"x":0, "y":4.5}, + {"x":2.5, "y":4.125}, + {"x":3.5, "y":4.15}, + {"x":4.5, "y":4.25}, + {"x":6, "y":4.25, "h":1.25}, + {"x":9.5, "y":4.25, "h":1.25}, + {"x":11, "y":4.25}, + {"x":12, "y":4.15}, + {"x":13, "y":4.125}, + {"x": 14.5, "y": 4.5} + ] + } + } +} diff --git a/keyboards/atreyu/rev1/rev1.c b/keyboards/atreyu/rev1/rev1.c new file mode 100644 index 0000000000..3d6829fbd5 --- /dev/null +++ b/keyboards/atreyu/rev1/rev1.c @@ -0,0 +1,47 @@ +/* Copyright 2022 Jesus Climent (@climent) + * + * 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 . + */ + +#ifdef ENCODER_ENABLE +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { + return false; + } + + if (index == 1) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } + if (index == 0) { + if (IS_LAYER_ON(_LOWER)) { + if (clockwise) { + tap_code(KC_WH_U); + } else { + tap_code(KC_WH_D); + } + } else { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } + } + return true; +} +#endif diff --git a/keyboards/atreyu/rev1/rev1.h b/keyboards/atreyu/rev1/rev1.h new file mode 100644 index 0000000000..4f6852593f --- /dev/null +++ b/keyboards/atreyu/rev1/rev1.h @@ -0,0 +1,40 @@ +/* Copyright 2022 Jesus Climent (@climent) + * + * 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 . + */ + +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k11,\ + k12, k13, k14, k15, k16, k17, k18, k19, k20, k21, k22, k23,\ + k24, k25, k26, k27, k28, k29, k30, k31, k32, k33, k34, k35,\ + k36, k37, k38, k39, k40, k41, k42, k43, k44, k45, k46, k47,\ + k48, k49, k50, k51, k52, k53, k54, k55, k56, k57, k58, k59\ +) \ +{ \ + { k00, k01, k02, k03, k04, k05 },\ + { k12, k13, k14, k15, k16, k17 },\ + { k24, k25, k26, k27, k28, k29 },\ + { k36, k37, k38, k39, k40, k41 },\ + { k11, k10, k09, k08, k07, k06 },\ + { k23, k22, k21, k20, k19, k18 },\ + { k35, k34, k33, k32, k31, k30 },\ + { k47, k46, k45, k44, k43, k42 },\ + { k48, k49, k50, k51, k52, k53 },\ + { k59, k58, k57, k56, k55, k54 } \ +} + diff --git a/keyboards/atreyu/rev1/rules.mk b/keyboards/atreyu/rev1/rules.mk new file mode 100644 index 0000000000..e69de29bb2 diff --git a/keyboards/atreyu/rules.mk b/keyboards/atreyu/rules.mk new file mode 100644 index 0000000000..1e05f827de --- /dev/null +++ b/keyboards/atreyu/rules.mk @@ -0,0 +1,22 @@ +DEFAULT_FOLDER = atreyu/rev1 + +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = atmel-dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output + +ENCODER_ENABLE = no -- cgit v1.2.3