From b0da2302137aa180af4e7464a70aa4b63ae919fe Mon Sep 17 00:00:00 2001 From: Alin Marin Elena Date: Sun, 30 Jan 2022 19:13:08 +0000 Subject: [Keyboard] add mlego/m65 oled revision (#15833) --- keyboards/mlego/m65/keymaps/default/keymap.c | 8 +- keyboards/mlego/m65/keymaps/dk/keymap.c | 8 +- keyboards/mlego/m65/keymaps/uk/config.h | 9 +- keyboards/mlego/m65/keymaps/uk/keymap.c | 371 +++++++++++++++++++++------ keyboards/mlego/m65/keymaps/via/keymap.c | 71 ++++- keyboards/mlego/m65/lib/glcdfont.c | 231 +++++++++++++++++ keyboards/mlego/m65/m65.h | 13 +- keyboards/mlego/m65/readme.md | 45 +++- keyboards/mlego/m65/rev4/config.h | 67 +++++ keyboards/mlego/m65/rev4/halconf.h | 32 +++ keyboards/mlego/m65/rev4/mcuconf.h | 33 +++ keyboards/mlego/m65/rev4/rules.mk | 22 ++ 12 files changed, 811 insertions(+), 99 deletions(-) create mode 100644 keyboards/mlego/m65/lib/glcdfont.c create mode 100644 keyboards/mlego/m65/rev4/config.h create mode 100644 keyboards/mlego/m65/rev4/halconf.h create mode 100644 keyboards/mlego/m65/rev4/mcuconf.h create mode 100644 keyboards/mlego/m65/rev4/rules.mk (limited to 'keyboards') diff --git a/keyboards/mlego/m65/keymaps/default/keymap.c b/keyboards/mlego/m65/keymaps/default/keymap.c index 75ad22f398..96a1ced900 100644 --- a/keyboards/mlego/m65/keymaps/default/keymap.c +++ b/keyboards/mlego/m65/keymaps/default/keymap.c @@ -59,8 +59,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_WH_L, KC_WH_D, KC_WH_R), [_ADJ] = LAYOUT_ortho_5x13( - RGB_MOD, RGB_RMOD, A(KC_F2), _______, _______, _______, _______, _______, _______, _______, _______, _______ , RGB_M_SW, - RGB_HUI, RGB_HUD , RGB_M_P , _______, RESET , RGB_M_T, _______, _______, _______, _______, _______, _______ , RGB_M_SN, + RGB_MOD, RGB_RMOD, A(KC_F2), _______, _______, _______, _______, _______, _______, _______, _______, RGB_M_T , RGB_M_SW, + RGB_HUI, RGB_HUD , RGB_M_P , _______, RESET , _______, _______, _______, _______, _______, _______, _______ , RGB_M_SN, RGB_SAI, RGB_SAD , RGB_M_B , _______, _______, _______, _______, _______, _______, _______, _______, _______ , RGB_M_K , RGB_VAI, RGB_VAD , RGB_M_R , _______, _______, _______, _______, _______, _______, _______, _______, _______ , RGB_M_X , RGB_TOG, _______ , _______ , _______, _______, _______, _______, _______, _______, _______, _______, RGB_M_TW, RGB_M_G), @@ -69,8 +69,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // clang-format on // let us assume we start with both layers off -bool toggle_lwr = false; -bool toggle_rse = false; +static bool toggle_lwr = false; +static bool toggle_rse = false; bool led_update_user(led_t led_state) { // Disable the default LED update code, so that lock LEDs could be reused to show layer status. diff --git a/keyboards/mlego/m65/keymaps/dk/keymap.c b/keyboards/mlego/m65/keymaps/dk/keymap.c index a4cb66bb91..5461a354ba 100644 --- a/keyboards/mlego/m65/keymaps/dk/keymap.c +++ b/keyboards/mlego/m65/keymaps/dk/keymap.c @@ -60,8 +60,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_WH_L, KC_WH_D, KC_WH_R), [_ADJ] = LAYOUT_ortho_5x13( - RGB_MOD,RGB_RMOD, A(KC_F2), _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_M_SW , - RGB_HUI, RGB_HUD, RGB_M_P , _______, RESET , RGB_M_T, _______, _______, _______, _______, _______, _______, RGB_M_SN , + RGB_MOD,RGB_RMOD, A(KC_F2), _______, _______, _______, _______, _______, _______, _______, _______, RGB_M_T, RGB_M_SW , + RGB_HUI, RGB_HUD, RGB_M_P , _______, RESET , _______, _______, _______, _______, _______, _______, _______, RGB_M_SN , RGB_SAI, RGB_SAD, RGB_M_B , _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_M_K , RGB_VAI, RGB_VAD, RGB_M_R , _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_M_X , RGB_TOG, _______, _______ , _______, _______, _______, _______, _______, _______, _______, _______, RGB_M_TW, RGB_M_G), @@ -70,8 +70,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // clang-format on // let us assume we start with both layers off -bool toggle_lwr = false; -bool toggle_rse = false; +static bool toggle_lwr = false; +static bool toggle_rse = false; bool led_update_user(led_t led_state) { // Disable the default LED update code, so that lock LEDs could be reused to show layer status. diff --git a/keyboards/mlego/m65/keymaps/uk/config.h b/keyboards/mlego/m65/keymaps/uk/config.h index 9d446777c0..7b5ced9ccb 100644 --- a/keyboards/mlego/m65/keymaps/uk/config.h +++ b/keyboards/mlego/m65/keymaps/uk/config.h @@ -18,5 +18,12 @@ along with this program. If not, see . #pragma once #define TAPPING_TOGGLE 2 -//#define UNICODE_SELECTED_MODES UC_LNX, UC_MAC, UC_WINC + #define UNICODE_SELECTED_MODES UC_LNX +//#define UNICODE_SELECTED_MODES UC_LNX, UC_MAC, UC_WINC + +#ifdef WPM_ENABLE +#define WPM_SAMPLE_SECONDS 10 +#define WPM_SAMPLE_PERIODS 100 +#define WPM_ALLOW_COUNT_REGRESSION +#endif diff --git a/keyboards/mlego/m65/keymaps/uk/keymap.c b/keyboards/mlego/m65/keymaps/uk/keymap.c index 528105fc73..b140ca08c6 100644 --- a/keyboards/mlego/m65/keymaps/uk/keymap.c +++ b/keyboards/mlego/m65/keymaps/uk/keymap.c @@ -31,6 +31,17 @@ enum layer_names { #endif +#ifdef OLED_ENABLE +static uint32_t oled_logo_timer = 0; +static bool clear_logo = true; +static const char PROGMEM m65_logo[] = { + 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, + 0}; +#endif + #ifdef RGBLIGHT_ENABLE const rgblight_segment_t PROGMEM my_qwerty_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, RGBLED_NUM, HSV_PURPLE}); @@ -42,73 +53,134 @@ const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST(m #endif const uint32_t PROGMEM unicode_map[] = { - [la] = 0x03B1, // å - [lA] = 0x0391, // Å - [lb] = 0x03B2, // β - [lB] = 0x0392, // Β - [lc] = 0x03C7, // - [lC] = 0x0307, // - [ld] = 0x03B4, [lD] = 0x2202, [le] = 0x03B5, [lE] = 0x2107, - [lf] = 0x03C6, // - [lF] = 0x03C8, // - [lg] = 0x03B3, // - [lG] = 0x0393, // - [lh] = 0x210F, // - [lH] = 0x1D4D7, // - [li] = 0x222B, // - [lI] = 0x222E, // - [lj] = 0x2208, // - [lJ] = 0x2209, // - [lk] = 0x03F0, // - [lK] = 0x2206, // - [ll] = 0x03BB, // - [lL] = 0x039B, // - [lm] = 0x03BC, // - [lM] = 0x2218, // - [ln] = 0x03B7, // - [lN] = 0x222A, // - [lo] = 0x221E, // - [lO] = 0x2297, // - [lp] = 0x03C0, // - [lP] = 0x220F, // - [lq] = 0x03C3, // - [lQ] = 0x03D5, // - [lr] = 0x03C1, // - [lR] = 0x2207, // - [ls] = 0x2211, // - [lS] = 0x2A0B, // - [lt] = 0x03D1, // - [lT] = 0x03B8, // - [lu] = 0x03C4, // - [lU] = 0x2102, // - [lv] = 0x03BD, // - [lV] = 0x039D, // - [lw] = 0x03C9, // - [lW] = 0x03A9, // - [lx] = 0x03BE, // - [lX] = 0x039E, // - [ly] = 0x211d, - [lY] = 0x2124, // - [lz] = 0x03B6, // - [lZ] = 0x2221, // - [lZ] = 0x2221, // - [lc1] = 0x224A, // - [lC1] = 0x2248, // - [lp1] = 0x00B1, // - [lP1] = 0x2213, // - [lq1] = 0x00D7, // - [lQ1] = 0x22C5, // - [ll1] = 0x1D53C, // - [lL1] = 0x212b, // - [lk1] = 0x221D, // - [lK1] = 0x2112, // - [rc] = 0x00E7, // ç - [rC] = 0x00C7, // Ç + [la] = 0x03B1 , // α + [lA] = 0x0391 , // Α + [lb] = 0x03B2 , // β + [lB] = 0x0392 , // Β + [lc] = 0x03C7 , // χ + [lC] = 0x0307 , // + [ld] = 0x03B4 , // δ + [lD] = 0x2202 , // ∂ + [le] = 0x03B5 , // ε + [lE] = 0x2107 , // ℇ + [lf] = 0x03C6 , // φ + [lF] = 0x03C8 , // ψ + [lg] = 0x03B3 , // γ + [lG] = 0x0393 , // Γ + [lh] = 0x210F , // ℏ + [lH] = 0x1D4D7, // 𝓗 + [li] = 0x222B , // ∫ + [lI] = 0x222E , // ∮ + [lj] = 0x2208 , // ∈ + [lJ] = 0x2209 , // ∉ + [lk] = 0x03F0 , // ϰ + [lK] = 0x2206 , // ∆ + [ll] = 0x03BB , // λ + [lL] = 0x039B , // Λ + [lm] = 0x03BC , // μ + [lM] = 0x2218 , // ∘ + [ln] = 0x03B7 , // η + [lN] = 0x222A , // ∪ + [lo] = 0x221E , // ∞ + [lO] = 0x2297 , // ⊗ + [lp] = 0x03C0 , // π + [lP] = 0x220F , // ∏ + [lq] = 0x03C3 , // σ + [lQ] = 0x03D5 , // ϕ + [lr] = 0x03C1 , // ρ + [lR] = 0x2207 , // ∇ + [ls] = 0x2211 , // ∑ + [lS] = 0x2A0B , // ⨋ + [lt] = 0x03D1 , // ϑ + [lT] = 0x03B8 , // θ + [lu] = 0x03C4 , // τ + [lU] = 0x2102 , // ℂ + [lv] = 0x03BD , // χ + [lV] = 0x039D , // Ν + [lw] = 0x03C9 , // ω + [lW] = 0x03A9 , // Ω + [lx] = 0x03BE , // ξ + [lX] = 0x039E , // Ξ + [ly] = 0x211d , // ℝ + [lY] = 0x2124 , // ℤ + [lz] = 0x03B6 , // ζ + [lZ] = 0x2221 , // ∡ + [lc1] = 0x224A , // ≊ + [lC1] = 0x2248 , // ≈ + [lp1] = 0x00B1 , // ± + [lP1] = 0x2213 , // ∓ + [lq1] = 0x00D7 , // × + [lQ1] = 0x22C5 , // ⋅ + [ll1] = 0x1D53C, // 𝔼 + [lL1] = 0x212b , // Å + [lk1] = 0x221D , // ∝ + [lK1] = 0x2112 , // ℒ + [ra] = 0x0103 , // ă + [rA] = 0x0102 , // Ă + [ra1] = 0x00E2 , // â + [rA1] = 0x00C2 , // Â + [rc] = 0x00E7 , // ç + [rC] = 0x00C7 , // Ç + [ri] = 0x00EE , // î + [rI] = 0x00CE , // Î + [rs] = 0x0219 , // ș + [rS] = 0x0218 , // Ș + [rt] = 0x021B , // ț + [rT] = 0x021A , // Ț }; // clang-format off const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ ⎋ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ ⌫ │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ ↹ │ q │ w │ e │ r │ t │ y │ u │ i │ o │ p │ [ │ ] │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ # │ a │ s │ d │ f │ g │ h │ j │ k │ l │ ; │ ' │ ⏎ │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ ⇧(│ \ │ z │ x │ c │ v │ b │ n │ m │ , │ , │ ↑ │ / │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ ⎈ │mnu│lwr│⎇ │rse│ │ │ │⎇ │ ⇧)│ ← │ ↓ │ → │ + * └───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┘ +shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ ← │ ! │ " │ £ │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ { │ } │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ ~ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ : │ @ │ ⏎ │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ ⇧(│ | │ Z │ X │ C │ V │ B │ N │ M │ < │ > │ │ / │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ │ │ │ │ │ │ │ │ │ ⇧)│ │ │ │ + * └───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┘ +altgr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ ← │ ¹ │ ² │ ³ │ € │ ½ │ ¾ │ { │ [ │ ] │ } │ \ │ │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ │ @ │ ſ │ e │ ¶ │ ŧ │ ← │ ↓ │ → │ ø │ þ │ ä │ ã │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ ~ │ æ │ ß │ ð │ đ │ ŋ │ ħ │ ả │ ĸ │ ł │ á │ â │ent│ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ ± │ | │ « │ » │ ¢ │ „ │ “ │ ” │ µ │ ─ │ · │ │ ạ̣̣ │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ │ │ │ │ │ │ │ │ │ ° │ │ │ │ + * └───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┘ +altgr shift symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ │ ¡ │ ⅛ │ £ │ ¼ │ ⅜ │ ⅝ │ ⅞ │ ™ │ ± │ ° │ ¿ │ │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ │ Ω │ § │ E │ ® │ Ŧ │ ¥ │ ↑ │ ı │ Ø │ Þ │ å │ ā │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ │ Æ │ ẞ │ Ð │ ª │ Ŋ │ Ħ │ a │ & │ Ł │ ˝a│ ǎ │ent│ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ ± │ ¦ │ ‹ │ › │ © │ ‚ │ ‘ │ ’ │ º │ × │ ÷ │ │ ȧ │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ │ │ │ │ │ │ │ │ │ ° │ │ │ │ + * └───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┘ + * +*/ [_QW] = LAYOUT_ortho_5x13( KC_ESC, UK_1 , UK_2 , UK_3 , UK_4 , UK_5 , UK_6 , UK_7 , UK_8 , UK_9 , UK_0 , UK_MINS, KC_BSPC , KC_TAB, UK_Q , UK_W , UK_E , UK_R , UK_T , UK_Y , UK_U , UK_I , UK_O , UK_P , UK_LBRC, UK_RBRC , @@ -116,24 +188,91 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSPO, UK_BSLS, UK_Z , UK_X , UK_C , UK_V , UK_B , UK_N , UK_M , UK_COMM, UK_DOT , KC_UP , UK_SLSH , KC_LCTL, KC_LGUI, TT(_LWR), KC_LALT, TT(_RSE), KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RSPC, KC_LEFT, KC_DOWN, KC_RGHT), - [_LWR] = LAYOUT_ortho_5x13( - KC_GRV , KC_MUTE, KC_VOLU, KC_VOLD, KC_MPRV, KC_MPLY, KC_MNXT, G(KC_P), KC_SLEP, KC_WAKE, KC_PSCR, KC_DEL , UK_EQL , - KC_BTN3, XP(lq , lQ) , XP(lw , lW) , XP(le , lE) , XP(lr , lR) , XP(lt , lT) , XP(ly , lY) , XP(lu, lU) , XP(li, lI) , XP(lo, lO) , XP(lp , lP) , _______, _______, - KC_BTN2, XP(la , lA) , XP(ls , lS) , XP(ld , lD) , XP(lf , lF) , XP(lg , lG) , XP(lh , lH) , XP(lj, lJ) , XP(lk, lK) , XP(ll, lL) , XP(ll1, lL1) , XP(lk1 , lK1) , _______, - _______, KC_BTN1, XP(lz , lZ) , XP(lx , lX) , XP(lc , lC) , XP(lv , lV) , XP(lb , lB) , XP(ln , lN) , XP(lm, lM) , XP(lc1, lC1) , XP(lp1, lP1) , KC_MS_U, XP(lq1 , lQ1) , - _______, KC_BTN4, _______, _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R), - +/* +lower layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ ` │MUT│Vup│Vdn│prv│ply│nxt│EXT│SLP│WAK│PSC│ ⌫ │ = │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ │ σ │ ω │ ε │ ρ │ ϑ │ ℝ │ τ │ ∫ │ ∞ │ π │ [ │ ] │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ │ α │ ∑ │ δ │ φ │ γ │ ℏ │ ∈ │ ϰ │ λ │ 𝔼 │ ∝ │ ⏎ │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ ⇧(│ │ ζ │ ξ │ χ │ ν │ β │ η │ μ │ ≊ │ ± │ │ × │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ ⎈ │ │lwr│⎇ │rse│ │ │ │⎇ │ ⇧)│ │ │ │ + * └───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┘ +lower layer shifted + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ ¬ │ │ │ │ │ │ │ │ │ │ │ ⌫ │ = │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │MB3│ ϕ │ Ω │ ℇ │ ∇ │ θ │ ℤ │ ℂ │ ∮ │ ⊗ │ ∏ │ { │ } │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │MB2│ Α │ ⨋ │ ∂ │ ψ │ Γ │ 𝓗 │ ∉ │ ∆ │ Λ │ Å │ ℒ │ ⏎ │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ ⇧(│MB1│ ∡ │ Ξ │ ̇ │ Ν │ Β │ ∪ │ ∘ │ ≈ │ ∓ │MSU│ ⋅ │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ ⎈ │MB4│lwr│⎇ │rse│ │ │ │⎇ │ ⇧)│MSL│MSD│MSR│ + * └───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┘ +MB - mouse buttons +MS - mouse directions +*/ + [_LWR] = LAYOUT_ortho_5x13( + KC_GRV , KC_MUTE, KC_VOLU, KC_VOLD, KC_MPRV, KC_MPLY, KC_MNXT, G(KC_P), KC_SLEP, KC_WAKE, KC_PSCR, KC_DEL, UK_EQL, + KC_BTN3,XP(lq,lQ),XP(lw,lW),XP(le,lE),XP(lr,lR),XP(lt,lT),XP(ly,lY),XP(lu,lU),XP(li,lI), XP(lo,lO), XP(lp,lP), _______, _______, + KC_BTN2,XP(la,lA),XP(ls,lS),XP(ld,lD),XP(lf,lF),XP(lg,lG),XP(lh,lH),XP(lj,lJ),XP(lk,lK), XP(ll,lL),XP(ll1,lL1), XP(lk1,lK1), _______, + _______, KC_BTN1,XP(lz,lZ),XP(lx,lX),XP(lc,lC),XP(lv,lV),XP(lb,lB),XP(ln,lN),XP(lm,lM),XP(lc1,lC1),XP(lp1,lP1), KC_MS_U, XP(lq1,lQ1), + _______, KC_BTN4, _______, _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R), +/* +raise layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ ⎋ │ F1│ F2│ F3│ F4│ F5│ F6│ F7│ F8│ F9│F10│F11│F12│ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ │ â │ │ │ │ ț │ │ │ î │ │ │ │ │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ ⇪ │ ă │ ș │ │ │ │ │ │ │ │ │ │ │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ │ │ │ │ ç │ │ │ │ │ │ │MWU│ │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ │ │ │ │ │ │ │ │ │ │MWL│MWD│MWR│ + * └───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┘ +MW - mouse wheel +raise layer shifted + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ │ Â │ │ │ │ Ț │ │ │ Î │ │ │ │ │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ │ Ă │ Ș │ │ │ │ │ │ │ │ │ │ │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ │ │ │ │ Ç │ │ │ │ │ │ │ │ │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * └───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┘ +*/ [_RSE] = LAYOUT_ortho_5x13( - KC_ESC , 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_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , - _______, _______, _______, _______,XP(rc,rC), _______, _______, _______, _______, _______, _______, KC_WH_U, _______ , - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_WH_L, KC_WH_D, KC_WH_R), - + KC_ESC , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , + _______,XP(ra1,rA1), _______, _______, _______,XP(rt,rT), _______, _______,XP(ri,rI), _______, _______, _______, _______ , + KC_CAPS, XP(ra,rA), XP(rs,rS), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , + _______, _______, _______, _______,XP(rc,rC), _______, _______, _______, _______, _______, _______, KC_WH_U, _______ , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_WH_L, KC_WH_D, KC_WH_R), +/* +adj layer + * ┌───┬────┬───┬───┬───┬───┬───┬───┬───┬───┬───┬────┬────┐ + * │MOD│RMOD│ │ │ │ │ │ │ │ │ │M_T │M_SW│ + * ├───┼────┼───┼───┼───┼───┼───┼───┼───┼───┼───┼────┼────┤ + * │HUI│HUD │M_P│ │rst│ │ │ │ │ │ │ │M_SN│ + * ├───┼────┼───┼───┼───┼───┼───┼───┼───┼───┼───┼────┼────┤ + * │SAI│SAD │M_B│ │ │ │ │ │ │ │ │ │M_K │ + * ├───┼────┼───┼───┼───┼───┼───┼───┼───┼───┼───┼────┼────┤ + * │VAI│VAD │M_R│ │ │ │ │ │ │ │ │ │M_X │ + * ├───┼────┼───┼───┼───┼───┼───┼───┼───┼───┼───┼────┼────┤ + * │TOG│ │ │ │ │ │ │ │ │ │ │M_TW│M_G │ + * └───┴────┴───┴───┴───┴───┴───┴───┴───┴───┴───┴────┴────┘ +*/ [_ADJ] = LAYOUT_ortho_5x13( - RGB_MOD, RGB_RMOD, A(KC_F2), _______, _______, _______, _______, _______, _______, _______, _______, _______ , RGB_M_SW, - RGB_HUI, RGB_HUD , RGB_M_P , _______, RESET , RGB_M_T, _______, _______, _______, _______, _______, _______ , RGB_M_SN, + RGB_MOD, RGB_RMOD, A(KC_F2), _______, _______, _______, _______, _______, _______, _______, _______, RGB_M_T , RGB_M_SW, + RGB_HUI, RGB_HUD , RGB_M_P , _______, RESET , _______, _______, _______, _______, _______, _______, _______ , RGB_M_SN, RGB_SAI, RGB_SAD , RGB_M_B , _______, _______, _______, _______, _______, _______, _______, _______, _______ , RGB_M_K , RGB_VAI, RGB_VAD , RGB_M_R , _______, _______, _______, _______, _______, _______, _______, _______, _______ , RGB_M_X , RGB_TOG, _______ , _______ , _______, _______, _______, _______, _______, _______, _______, _______, RGB_M_TW, RGB_M_G), @@ -141,8 +280,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // clang-format on // let us assume we start with both layers off -bool toggle_lwr = false; -bool toggle_rse = false; +static bool toggle_lwr = false; +static bool toggle_rse = false; bool led_update_user(led_t led_state) { // Disable the default LED update code, so that lock LEDs could be reused to show layer status. @@ -206,6 +345,10 @@ layer_state_t default_layer_state_set_user(layer_state_t state) { void keyboard_post_init_user(void) { // Enable the LED layers rgblight_layers = my_rgb_layers; +#ifdef OLED_ENABLE + oled_logo_timer = timer_read32(); +#endif + #ifdef CONSOLE_ENABLE debug_enable = true; @@ -249,3 +392,71 @@ bool encoder_update_user(uint8_t index, bool clockwise) { return true; } #endif + +#ifdef OLED_ENABLE + +static void render_logo(void) { + oled_write_P(m65_logo, false); +} + +void user_oled_magic(void) { + // Host Keyboard Layer Status + oled_write_P(PSTR("Layer: "), false); + + switch (get_highest_layer(layer_state)) { + case _QW: + oled_write_P(PSTR("Default\n"), false); + break; + case _LWR: + oled_write_P(PSTR("Lower\n"), false); + break; + case _RSE: + oled_write_P(PSTR("Raise\n"), false); + break; + case _ADJ: + oled_write_P(PSTR("ADJ\n"), false); + break; + default: + // Or use the write_ln shortcut over adding '\n' to the end of your string + oled_write_ln_P(PSTR("Undefined"), false); + } + + // Host Keyboard LED Status + led_t led_state = host_keyboard_led_state(); + oled_write_P(led_state.num_lock ? PSTR("Lower ") : PSTR(" "), false); + oled_write_P(led_state.scroll_lock ? PSTR("Raise ") : PSTR(" "), false); + oled_write_P(led_state.caps_lock ? PSTR("CapsLock ") : PSTR(" "), false); +#ifdef WPM_ENABLE + oled_write_P(PSTR("\nwpm: "), false); + uint8_t wpm = get_current_wpm(); + oled_write_P(wpm != 0 ? get_u8_str(wpm,' ') : PSTR(" "), false); +#endif +} + +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_180; +} + +void clear_screen(void) { + if (clear_logo){ + for (uint8_t i = 0; i < OLED_DISPLAY_HEIGHT; ++i) { + for (uint8_t j = 0; j < OLED_DISPLAY_WIDTH; ++j) { + oled_write_raw_byte(0x0, i*OLED_DISPLAY_WIDTH + j); + } + } + clear_logo = false; + } +} + +# define SHOW_LOGO 5000 +bool oled_task_user(void) { + if ((timer_elapsed32(oled_logo_timer) < SHOW_LOGO)){ + render_logo(); + }else{ + clear_screen(); + user_oled_magic(); + } + return false; +} + +#endif diff --git a/keyboards/mlego/m65/keymaps/via/keymap.c b/keyboards/mlego/m65/keymaps/via/keymap.c index f6bb77bcd4..1422eed34e 100644 --- a/keyboards/mlego/m65/keymaps/via/keymap.c +++ b/keyboards/mlego/m65/keymaps/via/keymap.c @@ -59,17 +59,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_WH_L, KC_WH_D, KC_WH_R), [_ADJ] = LAYOUT_ortho_5x13( - _______, _______, A(KC_F2), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , - _______, _______, _______ , _______, RESET , _______, _______, _______, _______, _______, _______, _______, _______ , - _______, _______, _______ , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , - _______, _______, _______ , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , - _______, _______, _______ , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + RGB_MOD, RGB_RMOD, A(KC_F2), _______, _______, _______, _______, _______, _______, _______, _______, RGB_M_T , RGB_M_SW, + RGB_HUI, RGB_HUD , RGB_M_P , _______, RESET , _______, _______, _______, _______, _______, _______, _______ , RGB_M_SN, + RGB_SAI, RGB_SAD , RGB_M_B , _______, _______, _______, _______, _______, _______, _______, _______, _______ , RGB_M_K , + RGB_VAI, RGB_VAD , RGB_M_R , _______, _______, _______, _______, _______, _______, _______, _______, _______ , RGB_M_X , + RGB_TOG, _______ , _______ , _______, _______, _______, _______, _______, _______, _______, _______, RGB_M_TW, RGB_M_G), }; // clang-format on // let us assume we start with both layers off -bool toggle_lwr = false; -bool toggle_rse = false; +static bool toggle_lwr = false; +static bool toggle_rse = false; bool led_update_user(led_t led_state) { // Disable the default LED update code, so that lock LEDs could be reused to show layer status. @@ -166,3 +166,60 @@ bool encoder_update_user(uint8_t index, bool clockwise) { return true; } #endif + +#ifdef OLED_ENABLE + +static void render_logo(void) { + static const char PROGMEM m65_logo[] = { +// 'slon', 128x32px +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, 0x80, 0x40, 0xc0, 0xa0, 0xa0, +0xa0, 0xd0, 0xf0, 0xe0, 0xe0, 0xe0, 0xe0, 0xc0, 0xc0, 0x80, 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, 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, 0xe0, 0x0c, 0xc3, 0x3c, 0x0f, 0x05, 0x14, 0x14, +0x04, 0xfc, 0x9f, 0x88, 0x80, 0x81, 0xe7, 0xfc, 0x03, 0x03, 0x07, 0x05, 0x06, 0x06, 0x08, 0x0c, +0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x04, 0x10, 0x18, 0x30, 0x40, 0x80, 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, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xe0, 0xde, 0xc1, 0xf0, 0x89, 0x0b, 0x18, 0x08, 0x04, 0x04, +0x01, 0x1a, 0x0f, 0x00, 0x00, 0x80, 0xc0, 0x20, 0x20, 0x20, 0x60, 0x40, 0x40, 0x42, 0x40, 0x40, +0x40, 0x40, 0x40, 0xe0, 0x60, 0x00, 0x00, 0x00, 0x00, 0x08, 0x13, 0x7c, 0xe0, 0xc0, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x05, +0x05, 0x05, 0x07, 0x05, 0x07, 0x07, 0x07, 0x07, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x07, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x04, 0x05, 0x00, 0x00, 0x01, 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(m65_logo, sizeof(m65_logo)); + +} + + +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return rotation; +} + +bool oled_task_user(void) { + //user_oled_magic(); + render_logo(); + return false; +} + +#endif diff --git a/keyboards/mlego/m65/lib/glcdfont.c b/keyboards/mlego/m65/lib/glcdfont.c new file mode 100644 index 0000000000..4b354756b6 --- /dev/null +++ b/keyboards/mlego/m65/lib/glcdfont.c @@ -0,0 +1,231 @@ +// Copyright 2022 @filterpaper +// SPDX-License-Identifier: GPL-2.0+ + +#include "progmem.h" + +static const unsigned char PROGMEM font[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, + 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, + 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, + 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, + 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, + 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, + 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, + 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, + 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, + 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, + 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, + 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, + 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, + 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, + 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, + 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, + 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, + 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, + 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, + 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, + 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, + 0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, + 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, + 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, + 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, + 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, + 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, + 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, + 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, + 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, + 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, + 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, + 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, + 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, + 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, + 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, + 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, + 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, + 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, + 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, + 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, + 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, + 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, + 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, + 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, + 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, + 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, + 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, + 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, + 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, + 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, + 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, + 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, + 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, + 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, + 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, + 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, + 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, + 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, + 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, + 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, + 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, + 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, + 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, + 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, + 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, + 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, + 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, + 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, + 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, + 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, + 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, + 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, + 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x28, 0x00, + 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, + 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, + 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, + 0x18, 0x24, 0x24, 0x1C, 0x78, 0x00, + 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, + 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, + 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, + 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, + 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, + 0x7C, 0x18, 0x24, 0x24, 0x18, 0x00, + 0x18, 0x24, 0x24, 0x18, 0x7C, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, + 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, + 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, + 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, + 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, + 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, + 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, + 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, + 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, + 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, + 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, + 0x00, 0x41, 0x36, 0x08, 0x00, 0x00, + 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, + 0x3C, 0x26, 0x23, 0x26, 0x3C, 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, 0xE0, 0x18, 0x02, + 0x00, 0x3C, 0x1E, 0x06, 0x0E, 0x0A, + 0x1A, 0x0E, 0x26, 0xFF, 0xBF, 0x0D, + 0x00, 0x80, 0x80, 0x81, 0xFF, 0xFE, + 0xF8, 0x01, 0x01, 0x03, 0x03, 0x03, + 0x03, 0x05, 0x05, 0x02, 0x02, 0x0A, + 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, + 0x0C, 0x04, 0x10, 0x18, 0x20, 0xC0, + 0x80, 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, 0xD0, 0x58, 0x78, + 0x68, 0x2C, 0x24, 0x34, 0xF4, 0xF4, + 0x3C, 0x3C, 0xFC, 0xF8, 0xF8, 0x70, + 0xF0, 0xE0, 0xE0, 0xC0, 0xC0, 0x80, + 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, 0xC0, 0x7C, 0x07, 0x80, 0xE0, + 0x60, 0x64, 0xE2, 0x60, 0x10, 0x10, + 0x20, 0x22, 0x12, 0x17, 0x3F, 0x0B, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, + 0x6F, 0xFC, 0xE0, 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, 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, 0x40, + 0x60, 0x60, 0x70, 0x70, 0xF0, 0xF0, + 0xD0, 0xD0, 0xD0, 0xD0, 0x50, 0x50, + 0x50, 0x70, 0x78, 0x78, 0x78, 0x7C, + 0x7F, 0x7D, 0x7C, 0x5E, 0x4F, 0x44, + 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x38, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x58, 0x46, 0x47, 0x41, + 0x41, 0x01, 0x01, 0x03, 0x03, 0x42, + 0x42, 0x42, 0x46, 0x46, 0x46, 0x46, + 0x42, 0x43, 0x43, 0x73, 0x77, 0x72, + 0x70, 0x60, 0x60, 0x60, 0x60, 0x60, + 0x60, 0x61, 0x67, 0x6F, 0x7E, 0x78, + 0x78, 0x70, 0x70, 0x70, 0x70, 0x70, + 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, + 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, + 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, + 0x40, 0x40, 0x40, 0x48, 0x58, 0x58, + 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, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; diff --git a/keyboards/mlego/m65/m65.h b/keyboards/mlego/m65/m65.h index a93a80be74..f5ffd519fa 100644 --- a/keyboards/mlego/m65/m65.h +++ b/keyboards/mlego/m65/m65.h @@ -96,8 +96,18 @@ enum unicode_names { lL1, lk1, lK1, + ra, + rA, + ra1, + rA1, rc, rC, + ri, + rI, + rs, + rS, + rt, + rT, }; static inline void led_lwr(const bool on) { @@ -113,7 +123,7 @@ static inline void led_rse(const bool on) { } static inline void led_caps(const bool on) { #ifdef LED_CAPS_LOCK_PIN - if ((DEVICE_VER == 0x0001) || (DEVICE_VER == 0x0003)) { + if ((DEVICE_VER == 0x0001) || (DEVICE_VER == 0x0003) || (DEVICE_VER == 0x0004)) { writePin(LED_CAPS_LOCK_PIN, !on); } if (DEVICE_VER == 0x0002) { @@ -121,4 +131,3 @@ static inline void led_caps(const bool on) { } #endif } - diff --git a/keyboards/mlego/m65/readme.md b/keyboards/mlego/m65/readme.md index 2526aed31e..8076697a2b 100644 --- a/keyboards/mlego/m65/readme.md +++ b/keyboards/mlego/m65/readme.md @@ -6,7 +6,7 @@ A (13x5) ortholinear keyboard that can be hand wired or using a pcb. * Keyboard Maintainer: [Alin Elena](https://github.com/alinelena) ([@drFaustroll on GitLab](https://gitlab.com/drFaustroll)) * Hardware Supported: custom pcb [see](https://gitlab.com/m-lego/m65) STM/APM32F103C8T6, aka Black Pill (rev1), - GD32F303CCT6 from we act aka Blue Pill Plus (rev2), STM32F401 from we act (rev3) + GD32F303CCT6 from we act aka Blue Pill Plus (rev2), STM32F401 from we act (rev3,rev4) STM32F411 can also be used just ask * Hardware Availability: [custom how to](https://alin.elena.space/blog/keeblego/) @@ -42,6 +42,17 @@ Flashing example for this keyboard: To enter flashing mode, on microcontroller keep pressed BOOT0 and then NRST, release NRST and then after 0.5s or so release BOOT0. +For rev4 + + make mlego/m65/rev4:default + +Flashing example for this keyboard: + + make mlego/m65/rev4:default:flash + +To enter flashing mode, press in the same time, LWR+RSE+r, alternatively on microcontroller keep pressed BOOT0 and then NRST, release NRST and then after 0.5s or so release BOOT0. + + 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). @@ -127,3 +138,35 @@ the pinout is the same for stm32f411 | SCROLL_LOCK | B13 | | RBG_DI | B15 | +## Pins and leds rev4 stm32f401 + +the pinout is the same for stm32f411 + +| Rows | C0 | C1 | C2 | C3 | C4 | C5 | C6 | C7 | C8 | C9 | C10 | C11 | C12 | Pins | +| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | +| R0 | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | Bksp | B10 | +| R1 | Tab | q | w | e | r | t | y | u | i | o | p | [ | ] | A5 | +| R2 | # | a | s | d | f | g | h | j | k | l | ; | ' | Enter | A6 | +| R3 | Shift | \ | z | x | c | v | b | n | m | , | . | Up | / | A7 | +| R4 | Ctrl | Menu | Lower | Alt | Raise | Space | Space | Space | AltGr | Shift | Left | Down | Right | B0 | +| | B14 | A8 | A10 | A15 | B3 | B4 | B5 | B7 | A1 | A2 | A3 | A4 | B1 | | + +### Encoders + + - Pad_A: A0 + - Pad_B: B6 + +### Oled + + - SDA: B9 + - SCL: B8 + +### LEDS + +| Leds | Pin | +| ----------- | --- | +| NUM_LOCK | B12 | +| CAPS_LOCK | C13 | +| SCROLL_LOCK | B13 | +| RBG_DI | B15 | + diff --git a/keyboards/mlego/m65/rev4/config.h b/keyboards/mlego/m65/rev4/config.h new file mode 100644 index 0000000000..ee47061a91 --- /dev/null +++ b/keyboards/mlego/m65/rev4/config.h @@ -0,0 +1,67 @@ +/* +Copyright 2021-2022 Alin M Elena + +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 + +#define DEVICE_VER 0x0004 +#define PRODUCT_ID 0x6060 + +#define LED_NUM_LOCK_PIN B12 +#define LED_SCROLL_LOCK_PIN B13 +#define LED_CAPS_LOCK_PIN C13 + +// 0 1 2 3 4 +#define MATRIX_ROW_PINS \ + { B10, A5, A6, A7, B0 } +// 0 1 2 3 4 5 6 7 8 9 10 11 12 +#define MATRIX_COL_PINS \ + { B14, A8, A10, A15, B3, B4, B5, B7, A1, A2, A3, A4, B1 } + +#define ENCODERS_PAD_A \ + { A0 } +#define ENCODERS_PAD_B \ + { B6 } + +#define RGB_DI_PIN B15 + +#define UNUSED_PINS +#define RGBLIGHT_LAYERS + +#define ENCODER_RESOLUTION 4 + +#undef RGBLED_NUM +#define RGBLED_NUM 20 +#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_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 + +#ifdef OLED_ENABLE +# define OLED_DISPLAY_128X32 +#define I2C1_SCL_PIN B9 +#define I2C1_SDA_PIN B8 +#define OLED_BRIGHTNESS 128 +#define OLED_FONT_H "keyboards/mlego/m65/lib/glcdfont.c" +#endif diff --git a/keyboards/mlego/m65/rev4/halconf.h b/keyboards/mlego/m65/rev4/halconf.h new file mode 100644 index 0000000000..c1a060ad71 --- /dev/null +++ b/keyboards/mlego/m65/rev4/halconf.h @@ -0,0 +1,32 @@ +/* Copyright 2020 QMK + * + * 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 . + */ + +/* + * This file was auto-generated by: + * `qmk chibios-confmigrate -i keyboards/zvecr/zv48/f401/halconf.h -r platforms/chibios/common/configs/halconf.h` + */ + +#pragma once + +#define HAL_USE_PWM TRUE + +#define HAL_USE_SERIAL TRUE + +#define SERIAL_USB_BUFFERS_SIZE 256 + +#define HAL_USE_I2C TRUE + +#include_next diff --git a/keyboards/mlego/m65/rev4/mcuconf.h b/keyboards/mlego/m65/rev4/mcuconf.h new file mode 100644 index 0000000000..ba1cd32fd3 --- /dev/null +++ b/keyboards/mlego/m65/rev4/mcuconf.h @@ -0,0 +1,33 @@ +/* Copyright 2020 QMK + * + * 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 . + */ + +/* + * This file was auto-generated by: + * `qmk chibios-confmigrate -i keyboards/zvecr/zv48/f401/mcuconf.h -r platforms/chibios/BLACKPILL_STM32_F401/configs/mcuconf.h` + */ + +#pragma once + +#include_next + +#undef STM32_PWM_USE_TIM3 +#define STM32_PWM_USE_TIM3 TRUE + +#undef STM32_SERIAL_USE_USART1 +#define STM32_SERIAL_USE_USART1 TRUE + +#undef STM32_I2C_USE_I2C1 +#define STM32_I2C_USE_I2C1 TRUE diff --git a/keyboards/mlego/m65/rev4/rules.mk b/keyboards/mlego/m65/rev4/rules.mk new file mode 100644 index 0000000000..9e1e0ab23b --- /dev/null +++ b/keyboards/mlego/m65/rev4/rules.mk @@ -0,0 +1,22 @@ +# MCU name +MCU = STM32F401 + +# Bootloader selection +BOOTLOADER = stm32-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 = yes # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output +ENCODER_ENABLE = yes # Enable encoder +OLED_ENABLE = yes # Enable OLED +OLED_DRIVER = SSD1306 # Enable Support for SSD1306 or SH1106 OLED Displays; Communicating over I2C +WPM_ENABLE = yes # Enable WPM Counter -- cgit v1.2.3