Browse Source

Add Support for Lilly58 r2g (#19862)

* Add support for lilly58 r2g by Mechboards
pull/20021/head
Elliot Powell 1 year ago
committed by GitHub
parent
commit
127b53bd23
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 530 additions and 0 deletions
  1. +32
    -0
      keyboards/lily58/keymaps/mb_via/config.h
  2. +121
    -0
      keyboards/lily58/keymaps/mb_via/keymap.c
  3. +5
    -0
      keyboards/lily58/keymaps/mb_via/rules.mk
  4. +57
    -0
      keyboards/lily58/r2g/config.h
  5. +118
    -0
      keyboards/lily58/r2g/info.json
  6. +169
    -0
      keyboards/lily58/r2g/r2g.c
  7. +27
    -0
      keyboards/lily58/r2g/readme.md
  8. +1
    -0
      keyboards/lily58/r2g/rules.mk

+ 32
- 0
keyboards/lily58/keymaps/mb_via/config.h View File

@ -0,0 +1,32 @@
/*
This is the c configuration file for the keymap
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2015 Jack Humbert
Copyright 2023 Elliot Powell
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 TAPPING_FORCE_HOLD
#define TAPPING_TERM 100

+ 121
- 0
keyboards/lily58/keymaps/mb_via/keymap.c View File

@ -0,0 +1,121 @@
/* Copyright 2020 Naoki Katahira
* Copyright 2023 Elliot Powell
*
* 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 layer_number {
_QWERTY = 0,
_LOWER,
_RAISE,
_ADJUST,
};
#define RAISE MO(_RAISE)
#define LOWER MO(_LOWER)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* QWERTY
* ,-----------------------------------------. ,-----------------------------------------.
* | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | ~ |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | Tab | Q | W | E | R | T | | Y | U | I | O | P | - |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* |LCTRL | A | S | D | F | G |-------. ,-------| H | J | K | L | ; | ' |
* |------+------+------+------+------+------| [ | | ] |------+------+------+------+------+------|
* |LShift| Z | X | C | V | B |-------| |-------| N | M | , | . | / |RShift|
* `-----------------------------------------/ / \ \-----------------------------------------'
* |LOWER | LGUI | Alt | /Space / \Enter \ |BackSP| RGUI |RAISE |
* | | | |/ / \ \ | | | |
* `-------------------''-------' '------''--------------------'
*/
[_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_MINS,
KC_LCTL, 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_LBRC, KC_RBRC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
LOWER, KC_LGUI, KC_LALT, KC_SPC, KC_ENT, KC_BSPC, KC_RGUI, RAISE
),
/* LOWER
* ,-----------------------------------------. ,-----------------------------------------.
* | | | | | | | | | | | | | |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | | ! | @ | # | $ | % | | ^ | & | * | ( | ) | |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | | 1 | 2 | 3 | 4 | 5 |-------. ,-------| 6 | 7 | 8 | 9 | 0 | |
* |------+------+------+------+------+------| [ | | ] |------+------+------+------+------+------|
* | | | | | | |-------| |-------| | | ` | + | { | } | |
* `-----------------------------------------/ / \ \-----------------------------------------'
* |LOWER | LGUI | Alt | /Space / \Enter \ |BackSP| RGUI |RAISE |
* | | | |/ / \ \ | | | |
* `-------------------''-------' '------''--------------------'
*/
[_LOWER] = LAYOUT(
_______, _______, _______, _______, _______, _______, _______, _______, _______,_______, _______, _______,
_______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______,
_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______,
_______, _______, _______, _______, _______, _______, _______, _______, KC_PIPE, KC_GRAVE, KC_PLUS, KC_LCBR, KC_RCBR, _______,
_______, _______, _______, _______, _______, _______, _______, _______
),
/* RAISE
* ,-----------------------------------------. ,-----------------------------------------.
* | | | | | | | | | | | | | |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* |RGBTOG|RGBHUI|RGBSAI|RGBVAI| |-------. ,-------| | Left | Down | Up |Right | |
* |------+------+------+------+------+------| [ | | ] |------+------+------+------+------+------|
* |RGBMOD|RGBHUD|RGBSAD|RGBVAD| | |-------| |-------| + | = | [ | ] | \ | |
* `-----------------------------------------/ / \ \-----------------------------------------'
* |LOWER | LGUI | Alt | /Space / \Enter \ |BackSP| RGUI |RAISE |
* | | | |/ / \ \ | | | |
* `-------------------''-------' '------''--------------------'
*/
[_RAISE] = 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,
RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX,
RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, KC_PLUS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, _______,
_______, _______, _______, _______, _______, _______, _______, _______
),
/* ADJUST
* ,-----------------------------------------. ,-----------------------------------------.
* | | | | | | | | | | | | | |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | | | | | | | | | | | | | |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | | | | | | |-------. ,-------| | | | | | |
* |------+------+------+------+------+------| | | |------+------+------+------+------+------|
* | | | | | | |-------| |-------| | | | | | |
* `-----------------------------------------/ / \ \-----------------------------------------'
* |LOWER | LGUI | Alt | /Space / \Enter \ |BackSP| RGUI |RAISE |
* | | | |/ / \ \ | | | |
* `----------------------------' '------''--------------------'
*/
[_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, XXXXXXX, XXXXXXX,
_______, _______, _______, _______, _______, _______, _______, _______
)
};

+ 5
- 0
keyboards/lily58/keymaps/mb_via/rules.mk View File

@ -0,0 +1,5 @@
VIA_ENABLE = yes
OLED_ENABLE = yes
OLED_DRIVER = SSD1306
MOUSEKEY_ENABLE = yes
EXTRAKEY_ENABLE = yes

+ 57
- 0
keyboards/lily58/r2g/config.h View File

@ -0,0 +1,57 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2015 Jack Humbert
Copyright 2017 F_YUUCHI
Copyright 2023 Elliot Powell
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 SERIAL_USE_MULTI_TRANSACTION
#ifdef RGB_MATRIX_ENABLE
# define RGB_DI_PIN D3
# define RGB_MATRIX_LED_COUNT 74
# define RGB_DISABLE_WHEN_USB_SUSPENDED
# define RGB_MATRIX_LED_FLUSH_LIMIT 16
# define RGB_MATRIX_KEYPRESSES
# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 120
# define RGB_MATRIX_KEYPRESSES
# define RGB_MATRIX_KEYRELEASES
# define RGB_MATRIX_FRAMEBUFFER_EFFECTS
# define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN
# define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT
# define ENABLE_RGB_MATRIX_ALPHAS_MODS
# define ENABLE_RGB_MATRIX_BREATHING
# define ENABLE_RGB_MATRIX_HUE_WAVE
# define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
# define ENABLE_RGB_MATRIX_RAINBOW_BEACON
#if defined(RGB_MATRIX_KEYPRESSES) || defined(RGB_MATRIX_KEYRELEASES)
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE
# define ENABLE_RGB_MATRIX_MULTISPLASH
#endif
# define SPLIT_TRANSPORT_MIRROR
#endif
#ifdef RGBLIGHT_ENABLE
# define RGBLIGHT_LIMIT_VAL 120
#endif

+ 118
- 0
keyboards/lily58/r2g/info.json View File

@ -0,0 +1,118 @@
{
"keyboard_name": "Lily58 R2G",
"manufacturer": "Mechboards UK",
"url": "",
"maintainer": "Elliot Powell",
"processor": "atmega32u4",
"bootloader": "atmel-dfu",
"features": {
"bootmagic": true,
"oled": true,
"rgb_matrix": true
},
"usb": {
"vid": "0x04D8",
"pid": "0xEB2E",
"device_version": "1.0.0"
},
"diode_direction": "COL2ROW",
"matrix_pins": {
"rows": ["C6", "D7", "E6", "B4", "B5"],
"cols": ["F6", "F7", "B1", "B3", "B2", "B6"]
},
"split": {
"enabled": true,
"soft_serial_pin": "D2"
},
"layouts": {
"LAYOUT": {
"layout": [
{"matrix": [0, 0], "x":0, "y":0.5}, {"matrix": [0, 1], "x":1, "y":0.375}, {"matrix": [0, 2], "x":2, "y":0.125}, {"matrix": [0, 3], "x":3, "y":0}, {"matrix": [0, 4], "x":4, "y":0.125}, {"matrix": [0, 5], "x":5, "y":0.25}, {"matrix": [5, 5], "x":10.5, "y":0.25}, {"matrix": [5, 4], "x":11.5, "y":0.125}, {"matrix": [5, 3], "x":12.5, "y":0}, {"matrix": [5, 2], "x":13.5, "y":0.125}, {"matrix": [5, 1], "x":14.5, "y":0.375}, {"matrix": [5, 0], "x":15.5, "y":0.5},
{"matrix": [1, 0], "x":0, "y":1.5}, {"matrix": [1, 1], "x":1, "y":1.375}, {"matrix": [1, 2], "x":2, "y":1.125}, {"matrix": [1, 3], "x":3, "y":1}, {"matrix": [1, 4], "x":4, "y":1.125}, {"matrix": [1, 5], "x":5, "y":1.25}, {"matrix": [6, 5], "x":10.5, "y":1.25}, {"matrix": [6, 4], "x":11.5, "y":1.125}, {"matrix": [6, 3], "x":12.5, "y":1}, {"matrix": [6, 2], "x":13.5, "y":1.125}, {"matrix": [6, 1], "x":14.5, "y":1.375}, {"matrix": [6, 0], "x":15.5, "y":1.5},
{"matrix": [2, 0], "x":0, "y":2.5}, {"matrix": [2, 1], "x":1, "y":2.375}, {"matrix": [2, 2], "x":2, "y":2.125}, {"matrix": [2, 3], "x":3, "y":2}, {"matrix": [2, 4], "x":4, "y":2.125}, {"matrix": [2, 5], "x":5, "y":2.25}, {"matrix": [7, 5], "x":10.5, "y":2.25}, {"matrix": [7, 4], "x":11.5, "y":2.125}, {"matrix": [7, 3], "x":12.5, "y":2}, {"matrix": [7, 2], "x":13.5, "y":2.125}, {"matrix": [7, 1], "x":14.5, "y":2.375}, {"matrix": [7, 0], "x":15.5, "y":2.5},
{"matrix": [3, 0], "x":0, "y":3.5}, {"matrix": [3, 1], "x":1, "y":3.375}, {"matrix": [3, 2], "x":2, "y":3.125}, {"matrix": [3, 3], "x":3, "y":3}, {"matrix": [3, 4], "x":4, "y":3.125}, {"matrix": [3, 5], "x":5, "y":3.25}, {"matrix": [4, 5], "x":6, "y":2.75}, {"matrix": [9, 5], "x":9.5, "y":2.75}, {"matrix": [8, 5], "x":10.5, "y":3.25}, {"matrix": [8, 4], "x":11.5, "y":3.125}, {"matrix": [8, 3], "x":12.5, "y":3}, {"matrix": [8, 2], "x":13.5, "y":3.125}, {"matrix": [8, 1], "x":14.5, "y":3.375}, {"matrix": [8, 0], "x":15.5, "y":3.5},
{"matrix": [4, 1], "x":2.5,"y":4.125},{"matrix": [4, 2], "x":3.5, "y":4.15},{"matrix": [4, 3], "x":4.5,"y":4.25},{"matrix": [4, 4], "x":6, "y":4.25, "h":1.5}, {"matrix": [9, 4], "x":9.5, "y":4.25, "h":1.5}, {"matrix": [9, 3], "x":11, "y":4.25}, {"matrix": [9, 2], "x":12, "y":4.15}, {"matrix": [9, 1], "x":13, "y":4.15}
]
}
},
"rgb_matrix": {
"driver": "WS2812",
"split_count": [37, 37],
"layout": [
{"flags": 4, "matrix": [0, 5], "x": 72, "y": 4}, // L SW06
{"flags": 4, "matrix": [0, 4], "x": 58, "y": 2}, // L SW05
{"flags": 4, "matrix": [0, 3], "x": 43, "y": 0}, // L SW04
{"flags": 4, "matrix": [0, 2], "x": 29, "y": 2}, // L SW03
{"flags": 4, "matrix": [0, 1], "x": 14, "y": 6}, // L SW02
{"flags": 4, "matrix": [0, 0], "x": 0, "y": 8}, // L SW01
{"flags": 4, "matrix": [1, 0], "x": 0, "y": 23}, // L SW07
{"flags": 4, "matrix": [1, 1], "x": 14, "y": 21}, // L SW08
{"flags": 4, "matrix": [1, 2], "x": 29, "y": 17}, // L SW09
{"flags": 4, "matrix": [1, 3], "x": 43, "y": 15}, // L SW10
{"flags": 4, "matrix": [1, 4], "x": 58, "y": 17}, // L SW11
{"flags": 4, "matrix": [1, 5], "x": 72, "y": 19}, // L SW12
{"flags": 4, "matrix": [2, 5], "x": 72, "y": 34}, // L SW18
{"flags": 4, "matrix": [2, 4], "x": 58, "y": 32}, // L SW17
{"flags": 4, "matrix": [2, 3], "x": 43, "y": 30}, // L SW16
{"flags": 4, "matrix": [2, 2], "x": 29, "y": 32}, // L SW15
{"flags": 4, "matrix": [2, 1], "x": 14, "y": 36}, // L SW14
{"flags": 4, "matrix": [2, 0], "x": 0, "y": 38}, // L SW13
{"flags": 4, "matrix": [3, 0], "x": 0, "y": 53}, // L SW20
{"flags": 4, "matrix": [3, 1], "x": 14, "y": 51}, // L SW21
{"flags": 4, "matrix": [3, 2], "x": 29, "y": 47}, // L SW22
{"flags": 4, "matrix": [3, 3], "x": 43, "y": 45}, // L SW23
{"flags": 4, "matrix": [3, 4], "x": 58, "y": 47}, // L SW24
{"flags": 4, "matrix": [3, 5], "x": 72, "y": 49}, // L SW25
{"flags": 4, "matrix": [4, 5], "x": 87, "y": 41},
{"flags": 4, "matrix": [4, 4], "x": 87, "y": 64},
{"flags": 4, "matrix": [4, 3], "x": 65, "y": 64},
{"flags": 4, "matrix": [4, 2], "x": 51, "y": 62},
{"flags": 4, "matrix": [4, 1], "x": 36, "y": 62},
{"flags": 2, "x": 96, "y": 64}, // L RGB1
{"flags": 2, "x": 32, "y": 64}, // L RGB2
{"flags": 2, "x": 0, "y": 64}, // L RGB3
{"flags": 2, "x": 0, "y": 32}, // L RGB4
{"flags": 2, "x": 16, "y": 0}, // L RGB5
{"flags": 2, "x": 50, "y": 0}, // L RGB6
{"flags": 2, "x": 80, "y": 0}, // L RGB7
{"flags": 2, "x": 96, "y": 32}, // L RGB8
{"flags": 4, "matrix": [5, 5], "x": 152, "y": 4}, // R SW06
{"flags": 4, "matrix": [5, 4], "x": 166, "y": 2}, // R SW05
{"flags": 4, "matrix": [5, 3], "x": 181, "y": 0}, // R SW04
{"flags": 4, "matrix": [5, 2], "x": 195, "y": 2}, // R SW03
{"flags": 4, "matrix": [5, 1], "x": 210, "y": 6}, // R SW02
{"flags": 4, "matrix": [5, 0], "x": 224, "y": 8}, // R SW01
{"flags": 4, "matrix": [6, 0], "x": 224, "y": 23}, // R SW07
{"flags": 4, "matrix": [6, 1], "x": 210, "y": 21}, // R SW08
{"flags": 4, "matrix": [6, 2], "x": 195, "y": 17}, // R SW09
{"flags": 4, "matrix": [6, 3], "x": 181, "y": 15}, // R SW10
{"flags": 4, "matrix": [6, 4], "x": 166, "y": 17}, // R SW11
{"flags": 4, "matrix": [6, 5], "x": 152, "y": 19}, // R SW12
{"flags": 4, "matrix": [7, 5], "x": 152, "y": 34}, // R SW18
{"flags": 4, "matrix": [7, 4], "x": 166, "y": 32}, // R SW17
{"flags": 4, "matrix": [7, 3], "x": 181, "y": 30}, // R SW16
{"flags": 4, "matrix": [7, 2], "x": 195, "y": 32}, // R SW15
{"flags": 4, "matrix": [7, 1], "x": 210, "y": 36}, // R SW14
{"flags": 4, "matrix": [7, 0], "x": 224, "y": 38}, // R SW13
{"flags": 4, "matrix": [8, 0], "x": 224, "y": 53}, // R SW20
{"flags": 4, "matrix": [8, 1], "x": 210, "y": 51}, // R SW21
{"flags": 4, "matrix": [8, 2], "x": 195, "y": 47}, // R SW22
{"flags": 4, "matrix": [8, 3], "x": 181, "y": 45}, // R SW23
{"flags": 4, "matrix": [8, 4], "x": 166, "y": 47}, // R SW24
{"flags": 4, "matrix": [8, 5], "x": 152, "y": 49}, // R SW25
{"flags": 4, "matrix": [9, 5], "x": 137, "y": 41},
{"flags": 4, "matrix": [9, 4], "x": 137, "y": 64},
{"flags": 4, "matrix": [9, 3], "x": 159, "y": 64},
{"flags": 4, "matrix": [9, 2], "x": 173, "y": 62},
{"flags": 4, "matrix": [9, 1], "x": 188, "y": 62},
{"flags": 2, "x": 128, "y": 64}, // R RGB1
{"flags": 2, "x": 192, "y": 64}, // R RGB2
{"flags": 2, "x": 224, "y": 64}, // R RGB3
{"flags": 2, "x": 224, "y": 32}, // R RGB4
{"flags": 2, "x": 206, "y": 0}, // R RGB5
{"flags": 2, "x": 150, "y": 0}, // R RGB6
{"flags": 2, "x": 140, "y": 0}, // R RGB7
{"flags": 2, "x": 128, "y": 32} // R RGB8
]
}
}

+ 169
- 0
keyboards/lily58/r2g/r2g.c View File

@ -0,0 +1,169 @@
/* Copyright 2023 Elliot Powell
*
* 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 "quantum.h"
#ifdef OLED_ENABLE
oled_rotation_t oled_init_kb(oled_rotation_t rotation) {
if (!is_keyboard_master()) {
return OLED_ROTATION_180; // flips the display 180 degrees if offhand
}
return rotation;
}
void oled_render_layer_state_r2g(void) {
oled_write_P(PSTR("Layer: "), false);
switch (get_highest_layer(layer_state)) {
case 0:
oled_write_ln_P(PSTR("Default"), false);
break;
case 1:
oled_write_ln_P(PSTR("Lower"), false);
break;
case 2:
oled_write_ln_P(PSTR("Raise"), false);
break;
case 3:
oled_write_ln_P(PSTR("Adjust"), false);
break;
default:
oled_write_ln_P(PSTR("Unknown"), false);
break;
}
}
//char keylog_str_r2g[24] = {};
const char code_to_name_r2g[60] = {
' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
'R', 'E', 'B', 'T', '_', '-', '=', '[', ']', '\\',
'#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '};
char key_name_r2g = ' ';
uint16_t last_keycode_r2g;
uint8_t last_row_r2g;
uint8_t last_col_r2g;
void set_keylog_r2g(uint16_t keycode, keyrecord_t *record) {
key_name_r2g = ' ';
last_keycode_r2g = keycode;
if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) ||
(keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { last_keycode_r2g = keycode & 0xFF; }
if (keycode < 60) {
key_name_r2g = code_to_name_r2g[keycode];
}
last_row_r2g = record->event.key.row;
last_col_r2g = record->event.key.col;
}
const char *depad_str(const char *depad_str, char depad_char) {
while (*depad_str == depad_char) ++depad_str;
return depad_str;
}
void oled_render_keylog_r2g(void) {
//oled_write(keylog_str_r2g, false);
const char *last_row_r2g_str = get_u8_str(last_row_r2g, ' ');
oled_write(depad_str(last_row_r2g_str, ' '), false);
oled_write_P(PSTR("x"), false);
const char *last_col_r2g_str = get_u8_str(last_col_r2g, ' ');
oled_write(depad_str(last_col_r2g_str, ' '), false);
oled_write_P(PSTR(", k"), false);
const char *last_keycode_r2g_str = get_u16_str(last_keycode_r2g, ' ');
oled_write(depad_str(last_keycode_r2g_str, ' '), false);
oled_write_P(PSTR(":"), false);
oled_write_char(key_name_r2g, false);
}
void render_bootmagic_status_r2g(bool status) {
/* Show Ctrl-Gui Swap options */
static const char PROGMEM logo[][2][3] = {
{{0x97, 0x98, 0}, {0xb7, 0xb8, 0}},
{{0x95, 0x96, 0}, {0xb5, 0xb6, 0}},
};
if (status) {
oled_write_ln_P(logo[0][0], false);
oled_write_ln_P(logo[0][1], false);
} else {
oled_write_ln_P(logo[1][0], false);
oled_write_ln_P(logo[1][1], false);
}
}
void oled_render_logo_r2g(void) {
static const char PROGMEM mb_logo[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f,
0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x83, 0x83, 0x83, 0x83, 0x83, 0xff, 0xff,
0x83, 0x83, 0x83, 0x83, 0xff, 0xff, 0x83, 0x83, 0x83, 0x83, 0x83, 0xff, 0xff, 0x83, 0x83, 0x83,
0x83, 0xff, 0xff, 0x83, 0x83, 0x83, 0x83, 0x83, 0xff, 0xff, 0xff, 0xff, 0x82, 0x82, 0x82, 0x82,
0x82, 0xff, 0xff, 0x83, 0x83, 0x83, 0x83, 0xff, 0xff, 0x83, 0x83, 0x83, 0x83, 0x83, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xfc, 0xfc, 0xfc,
0x9c, 0x9c, 0xfc, 0xfc, 0xf8, 0xf8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x78, 0x7c, 0x3c,
0x9c, 0xfc, 0xfc, 0xf8, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xf0, 0xf8, 0xf8, 0x3c, 0x3c,
0x9c, 0xbc, 0xfc, 0xb8, 0xb8, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x41, 0x41, 0x41, 0x41, 0x41, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x41, 0x41, 0x41, 0x41, 0x41, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x41, 0x41, 0x41, 0x41, 0x41, 0xff, 0xff, 0xff, 0xff, 0x41, 0x41, 0x41, 0x41,
0x41, 0xff, 0xff, 0x7f, 0x7f, 0x7f, 0x7f, 0xff, 0xff, 0x41, 0x41, 0x41, 0x41, 0x41, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f,
0x03, 0x07, 0x0f, 0x3f, 0x3f, 0x3e, 0x38, 0x20, 0x00, 0x00, 0x00, 0x00, 0x38, 0x3c, 0x3e, 0x3f,
0x3f, 0x3f, 0x3b, 0x39, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0f, 0x1f, 0x3f, 0x3c, 0x38,
0x3b, 0x3b, 0x3f, 0x1f, 0x1f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0,
0xf0, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff,
0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
oled_write_raw_P(mb_logo, sizeof(mb_logo));
//oled_set_cursor(oled_max_chars()/2,oled_max_lines()/2);
//oled_write_P(PSTR("R2G"), false);
}
bool oled_task_kb(void) {
if (!oled_task_user()) { return false; }
if (is_keyboard_master()) {
oled_render_layer_state_r2g();
oled_render_keylog_r2g();
} else {
oled_render_logo_r2g();
}
return false;
}
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
set_keylog_r2g(keycode, record);
}
return process_record_user(keycode, record);
}
#endif // OLED_ENABLE

+ 27
- 0
keyboards/lily58/r2g/readme.md View File

@ -0,0 +1,27 @@
# Lily58 R2G
Lily58 R2G is factory assembled version of the lilly 58 featuring hotswap and perkey rgb
![Lily58_R2G](https://i.imgur.com/4vPkIQ5.png)
Keyboard Maintainer: [Elliot Powell](https://github.com/e11i0t23)
Hardware Supported: Lily58 R2G PCB
Hardware Availability: [Mechboards UK](https://mechboards.co.uk/products/lily58-r2g-ready2go-kit)
Make example for this keyboard (after setting up your build environment):
```sh
make crkbd/r2g:mb_via
```
Flash example for this keyboard:
```sh
make crkbd/r2g:mb_via: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
These PCBs have a reset on the underside of the PCB next to the controller which may be pressed to enter in to the bootloader.
Additionally, if you hold down the "ESC" or "GRV" buttons when plugging in that half of the keyboard (per the default QWERTY layout), this will jump to the bootloader and reset the EEPROM (persistent storage).

+ 1
- 0
keyboards/lily58/r2g/rules.mk View File

@ -0,0 +1 @@
LTO_ENABLE = yes

Loading…
Cancel
Save