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

Add Ristretto Keyboard #13479

Merged
merged 8 commits into from
Jul 22, 2021
Merged
Show file tree
Hide file tree
Changes from 4 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
50 changes: 50 additions & 0 deletions keyboards/ristretto/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/* Copyright 2021 Brandon Lewis
*
* 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 0x666B // fk
#define PRODUCT_ID 0x7273 // rs
#define DEVICE_VER 0x0001 // rev 1
#define MANUFACTURER fruitykeeb
#define PRODUCT ristretto

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

/* key matrix pins */
#define MATRIX_ROW_PINS { B1, B2, B3, D3 }
#define MATRIX_COL_PINS { C7, C6, B6, B5, B4, D7, B7, F0, F1, F4, F5, F6, F7 }

/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW

/* Set 0 if debouncing isn't 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

#define ENCODERS_PAD_A { D4 }
#define ENCODERS_PAD_B { D6 }
#define ENCODER_RESOLUTION 4
17 changes: 17 additions & 0 deletions keyboards/ristretto/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"keyboard_name": "ristretto",
"url": "https://www.fruitykeeb.xyz/product/ristretto",
"maintainer": "Fruit",
"width": 13,
"height": 4,
"layouts": {
"LAYOUT": {
"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":7, "y":0}, {"label":"U", "x":8, "y":0}, {"label":"I", "x":9, "y":0}, {"label":"O", "x":10, "y":0}, {"label":"P", "x":11, "y":0}, {"label":"BKSP", "x":12, "y":0},
{"label":"TAB", "x":0, "y":1}, {"label":"A", "x":1, "y":1}, {"label":"S", "x":2, "y":1}, {"label":"D", "x":3, "y":1}, {"label":"F", "x":4, "y":1}, {"label":"G", "x":5, "y":1} , {"label":"H", "x":7, "y":1}, {"label":"J", "x":8, "y":1}, {"label":"K", "x":9, "y":1}, {"label":"L", "x":10, "y":1}, {"label":";", "x":11, "y":1}, {"label":"'", "x":12, "y":2},
{"label":"LSFT", "x":0, "y":2},{"label":"Z", "x":1, "y":2}, {"label":"X", "x":2, "y":2}, {"label":"C", "x":3, "y":2}, {"label":"V", "x":4, "y":2}, {"label":"B", "x":5, "y":2} , {"label":"N", "x":7, "y":2}, {"label":"M", "x":8, "y":2}, {"label":"<", "x":9, "y":2}, {"label":">", "x":10, "y":2}, {"label":"?", "x":11, "y":2}, {"label":"ENTR", "x":12, "y":2},
{"label":"LCTL", "x":0, "y":3},{"label":"LGUI","x":1,"y":3},{"label":"LALT","x":2,"y":3},{"label":"" , "x":3, "y":3}, {"label":"" , "x":4, "y":3}, {"label":"" , "x":5, "y":3}, {"label":"Rotary", "x":6, "y":3}, {"label":"" , "x":7, "y":3}, {"label":"" , "x":8, "y":3}, {"label":"" , "x":9, "y":3}, {"label":"RALT","x":10,"y":3},{"label":"RGUI","x":11,"y":3}, {"label":"RCTL","x":12, "y":3}
]
}
}
}
93 changes: 93 additions & 0 deletions keyboards/ristretto/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/* Copyright 2021 Brandon Lewis
*
* 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 {
_BASE,
_RAISE,
_LOWER,
_ADJUST
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_BASE] = LAYOUT(
KC_ESC , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_BSPC ,
KC_TAB , 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_ENT ,
KC_LCTL , KC_LGUI , KC_LALT ,MO(_LOWER),KC_ENT , KC_SPC , KC_MUTE , KC_SPC , KC_RSFT ,MO(_RAISE),KC_RALT , KC_RGUI , KC_RCTRL
),
[_RAISE] = LAYOUT(
KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_DEL ,
KC_CAPS , KC_MINS , KC_EQL , KC_LBRC , KC_RBRC , KC_BSLS , KC_NO , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT , KC_BSLS ,
KC_TRNS , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO ,
KC_TRNS , KC_TRNS , KC_TRNS ,MO(_ADJUST),KC_ENT , KC_NO , KC_MPLY , KC_NO , KC_RSFT , KC_NO , KC_TRNS , KC_TRNS , KC_TRNS
),
[_LOWER] = LAYOUT(
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_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_LBRC , KC_RBRC , KC_NO ,
KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO ,
KC_TRNS , KC_TRNS , KC_TRNS , KC_NO , KC_ENT , KC_NO , KC_MUTE , KC_NO , KC_RSFT ,MO(_ADJUST),KC_TRNS, KC_TRNS , KC_TRNS
),
[_ADJUST] = LAYOUT(
XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX ,
XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , KC_CAPS , KC_NLCK , KC_SLCK , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX ,
XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX ,
KC_TRNS , KC_TRNS , KC_TRNS , XXXXXXX , XXXXXXX , XXXXXXX , KC_MUTE , XXXXXXX , XXXXXXX , XXXXXXX , KC_TRNS , KC_TRNS , KC_TRNS
),
};

bool encoder_update_user(uint8_t index, bool clockwise) {
if(index == 0) {
if (clockwise) {
tap_code(KC_VOLD);
} else {
tap_code(KC_VOLU);
}
}
return true;
}

#ifdef OLED_DRIVER_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
return OLED_ROTATION_270;
}

static void print_oled(void) {
oled_write_P(PSTR("\n\n"), false);
oled_write_ln_P(PSTR("LAYER"), false);
oled_write_ln_P(PSTR(""), false);
switch (get_highest_layer(layer_state)) {
case _BASE:
oled_write_P(PSTR("BASE\n"), false);
break;
case _RAISE:
oled_write_P(PSTR("RAISE\n"), false);
break;
case _LOWER:
oled_write_P(PSTR("LOWER\n"), false);
break;
case _ADJUST:
oled_write_P(PSTR("ADJ\n"), false);
break;
}
}

void oled_task_user(void) {
print_oled();
}

blewis308 marked this conversation as resolved.
Show resolved Hide resolved
#endif
16 changes: 16 additions & 0 deletions keyboards/ristretto/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Ristretto

![Ristretto](https://i.imgur.com/VHX6ktEh.jpg)
![Ristretto-2](https://i.imgur.com/Hrc8vkph.jpg)

An Integrated, Column Stagger, 40% Keyboard with OLED and Rotary Encoder

* Keyboard Maintainer: [Fruit](https://github.com/Blewis308)
* Hardware Supported: Ristretto PCB, Atmega32u4
* Hardware Availability: Through Group Buy - May 2021

Make example for this keyboard (after setting up your build envionment):
blewis308 marked this conversation as resolved.
Show resolved Hide resolved

make ristretto:default

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).
17 changes: 17 additions & 0 deletions keyboards/ristretto/ristretto.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* Copyright 2021 Brandon Lewis
*
* 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 "ristretto.h"
31 changes: 31 additions & 0 deletions keyboards/ristretto/ristretto.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/* Copyright 2021 Brandon Lewis
*
* 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 "quantum.h"

#define LAYOUT( \
K000, K001, K002, K003, K004, K005, K007, K008, K009, K010, K011, K012, \
K100, K101, K102, K103, K104, K105, K107, K108, K109, K110, K111, K112, \
K200, K201, K202, K203, K204, K205, K207, K208, K209, K210, K211, K212, \
K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312 \
) { \
{K000, K001, K002, K003, K004, K005, KC_NO, K007, K008, K009, K010, K011, K012}, \
{K100, K101, K102, K103, K104, K105, KC_NO, K107, K108, K109, K110, K111, K112}, \
{K200, K201, K202, K203, K204, K205, KC_NO, K207, K208, K209, K210, K211, K212}, \
{K300, K301, K302, K303, K304, K305, K306 , K307, K308, K309, K310, K311, K312} \
}
14 changes: 14 additions & 0 deletions keyboards/ristretto/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# MCU name
MCU = atmega32u4

# Bootloader selection
BOOTLOADER = caterina

# Build Options
# change yes to no to disable
#
ENCODER_ENABLE = yes
OLED_DRIVER_ENABLE = yes
EXTRAKEY_ENABLE = yes
WAIT_FOR_USB = yes
NKRO_ENABLE = yes
blewis308 marked this conversation as resolved.
Show resolved Hide resolved