diff --git a/keyboards/adafruit/macropad/keymaps/mls_v100/keymap.c b/keyboards/adafruit/macropad/keymaps/mls_v100/keymap.c new file mode 100644 index 00000000..642f0300 --- /dev/null +++ b/keyboards/adafruit/macropad/keymaps/mls_v100/keymap.c @@ -0,0 +1,121 @@ +/* Copyright 2022 Jose Pablo Ramirez + * + * 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 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + LT(1,KC_MUTE), + KC_ENT, KC_0, KC_BSPC, + KC_7, KC_8, KC_9, + KC_4, KC_5, KC_6, + KC_1, KC_2, KC_3 + ), + [1] = LAYOUT( + _______, + CK_TOGG, AU_TOGG, _______, + _______, _______, _______, + _______, _______, _______, + _______, _______, _______ + ), +}; + +#ifdef ENCODER_MAP_ENABLE +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [1] = { ENCODER_CCW_CW(_______, _______) }, +}; +#endif + + +#ifdef OLED_ENABLE +static void render_qmk_logo(void) { + static const char PROGMEM qmk_logo[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3f, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x3f, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, + 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x83, 0x83, 0x83, 0x83, 0x83, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, + 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xfe, 0xfe, 0xfe, 0xfe, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x83, 0x83, 0x83, 0x83, 0x03, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x81, 0x83, 0x83, 0x83, 0x83, 0x83, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x83, 0x83, 0x83, 0x83, 0x81, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x07, 0x1f, 0x3f, 0x7f, 0x7e, 0xf8, 0xf0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xff, 0xff, + 0xff, 0xff, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xf0, 0xf8, 0x7e, 0x7f, 0x3f, 0x1f, 0x07, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0xff, 0xff, + 0xff, 0xff, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xfc, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xfc, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, + 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xfc, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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(qmk_logo, sizeof(qmk_logo)); +} + +bool oled_task_user(void) { + render_qmk_logo(); + return true; +} + +#endif diff --git a/keyboards/adafruit/macropad/keymaps/mls_v100/rules.mk b/keyboards/adafruit/macropad/keymaps/mls_v100/rules.mk new file mode 100644 index 00000000..ee325681 --- /dev/null +++ b/keyboards/adafruit/macropad/keymaps/mls_v100/rules.mk @@ -0,0 +1 @@ +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/aks_mls/test/config.h b/keyboards/aks_mls/test/config.h new file mode 100644 index 00000000..ffbe65d5 --- /dev/null +++ b/keyboards/aks_mls/test/config.h @@ -0,0 +1,45 @@ +/* + * 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 + +/* OLED SPI Defines */ +#define OLED_DISPLAY_128X64 +#define OLED_IC OLED_IC_SH1106 + +/* OLED SPI Pins */ +#define OLED_DC_PIN GP11 +#define OLED_CS_PIN GP12 +#define OLED_RST_PIN GP13 + +/* Shift OLED columns by 2 pixels */ +#define OLED_COLUMN_OFFSET 2 + +/* Divisor for OLED */ +#define OLED_SPI_DIVISOR 4 + + + +/* ChibiOS SPI definitions */ +#define SPI_DRIVER SPID1 +#define SPI_SCK_PIN GP26 +#define SPI_MOSI_PIN GP27 +/* #define SPI_MISO_PIN GP20 */ + +/* Double tap the side button to enter bootloader */ +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED GP25 +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 500U + diff --git a/keyboards/aks_mls/test/halconf.h b/keyboards/aks_mls/test/halconf.h new file mode 100644 index 00000000..6cd66fd5 --- /dev/null +++ b/keyboards/aks_mls/test/halconf.h @@ -0,0 +1,28 @@ +/* Copyright 2022 Jose Pablo Ramirez + * + * 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_next + +#undef HAL_USE_SPI +#define HAL_USE_SPI TRUE + +#undef SPI_USE_WAIT +#define SPI_USE_WAIT TRUE + +#undef SPI_SELECT_MODE +#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD diff --git a/keyboards/aks_mls/test/keyboard.json b/keyboards/aks_mls/test/keyboard.json new file mode 100644 index 00000000..7e363d2d --- /dev/null +++ b/keyboards/aks_mls/test/keyboard.json @@ -0,0 +1,38 @@ +{ + "manufacturer": "Allan Seidel", + "keyboard_name": "handwired/aks_mls", + "maintainer": "Allan Seidel", + "usb": { + "device_version": "1.0.0", + "pid": "0x0000", + "vid": "0xFEED" + }, + "bootmagic": { + "matrix": [3, 2] + }, + "processor": "RP2040", + "bootloader": "rp2040", + "diode_direction": "COL2ROW", + "matrix_pins": { + "cols": ["GP0", "GP2", "GP4"], + "rows": ["GP22", "GP21", "GP20", "GP28"] + }, + "layouts": { + "LAYOUT": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3} + ] + } + } +} diff --git a/keyboards/aks_mls/test/keymaps/default/keymap.c b/keyboards/aks_mls/test/keymaps/default/keymap.c new file mode 100644 index 00000000..a0af3a38 --- /dev/null +++ b/keyboards/aks_mls/test/keymaps/default/keymap.c @@ -0,0 +1,118 @@ +/* + * 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 layer_names { + _BASE, + _SPECIAL1, + _SPECIAL2, + _STANDBY +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┬───┬───┬ + * │ 7 │ 8 │ 9 │ + * ├───┼───┼───┼ + * │ 4 │ 5 │ 6 │ + * ├───┼───┼───┼ + * │ 1 │ 2 │ 3 │ + * ├───┼───┼───┼ + * │ 0 │ . │Ent│ + * └───┴───┴───┘ + */ + [_BASE] = LAYOUT( + KC_P7, KC_P8, KC_P9, + KC_P4, KC_P5, KC_P6, + KC_P1, KC_P2, KC_P3, + KC_P0, TO(_SPECIAL1), KC_PENT + ), + [_SPECIAL1] = LAYOUT( + KC_P7, KC_P8, KC_P9, + KC_P4, KC_P5, KC_P6, + KC_P1, KC_P2, KC_P3, + KC_P0, TO(_SPECIAL2), KC_PENT + ), + [_SPECIAL2] = LAYOUT( + KC_P7, KC_P8, KC_P9, + KC_P4, KC_P5, KC_P6, + KC_P1, KC_P2, KC_P3, + KC_P0, TO(_STANDBY), KC_PENT + ), + [_STANDBY] = LAYOUT( + KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, + KC_NO, TO(_BASE), KC_NO + ), + +}; + +#ifdef OLED_ENABLE + + static void render_logo(void) { + static const char PROGMEM aks_mls_logo[] = { + 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, 0x00 + }; + + // oled_write_P(aks_mls_logo, false); + oled_write_raw_P(aks_mls_logo, sizeof(aks_mls_logo)); + } + + bool oled_init(oled_rotation_t(OLED_ROTATION_0)); + + bool oled_task_user(void) { + render_logo(); + + oled_set_cursor(0, 3); + // oled_write(PSTR("Layer: "), false); + + switch (get_highest_layer(layer_state)) { + case _BASE: + // oled_write_ln(PSTR("Base"), false); + oled_write_ln(PSTR("Default Actions"), false); + oled_advance_page(true); + oled_advance_page(true); + break; + case _SPECIAL1: + // oled_write_ln(PSTR("Special1"), false); + oled_write_ln(PSTR("Special Actions 1"), false); + oled_advance_page(true); + break; + case _SPECIAL2: + // oled_write_ln(PSTR("Special2"), false); + oled_write_ln(PSTR("Special Actions 2"), false); + oled_advance_page(true); + oled_advance_page(true); + break; + case _STANDBY: + oled_write_ln(PSTR("Standby Mode"), false); + oled_write_ln(PSTR("Keys do nothing"), false); + oled_write_ln(PSTR("Layer key re-engages"), false); + break; + default: + oled_write_ln_P(PSTR("Undefined"), false); + oled_advance_page(true); + oled_advance_page(true); + + } + + return false; + } +#endif diff --git a/keyboards/aks_mls/test/keymaps/default/rules.mk b/keyboards/aks_mls/test/keymaps/default/rules.mk new file mode 100644 index 00000000..6c605dae --- /dev/null +++ b/keyboards/aks_mls/test/keymaps/default/rules.mk @@ -0,0 +1 @@ +MOUSEKEY_ENABLE = yes diff --git a/keyboards/aks_mls/test/mcuconf.h b/keyboards/aks_mls/test/mcuconf.h new file mode 100644 index 00000000..198a2eea --- /dev/null +++ b/keyboards/aks_mls/test/mcuconf.h @@ -0,0 +1,22 @@ +/* Copyright 2022 Jose Pablo Ramirez + * + * 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_next + +#undef RP_SPI_USE_SPI1 +#define RP_SPI_USE_SPI1 TRUE diff --git a/keyboards/aks_mls/test/rules.mk b/keyboards/aks_mls/test/rules.mk new file mode 100644 index 00000000..a12cd567 --- /dev/null +++ b/keyboards/aks_mls/test/rules.mk @@ -0,0 +1,14 @@ +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no # 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 +OLED_ENABLE = yes +OLED_TRANSPORT = spi +LTO_ENABLE = yes diff --git a/keyboards/aks_mls/test/testreadme.md b/keyboards/aks_mls/test/testreadme.md new file mode 100644 index 00000000..cdec5f22 --- /dev/null +++ b/keyboards/aks_mls/test/testreadme.md @@ -0,0 +1,3 @@ +aks_mls test qmk is for the handwired v01 setup prior to when encorders were added. + +You may get nowhere trying to use it!!! diff --git a/keyboards/aks_mls/testadapad/config.h b/keyboards/aks_mls/testadapad/config.h new file mode 100644 index 00000000..205df6c2 --- /dev/null +++ b/keyboards/aks_mls/testadapad/config.h @@ -0,0 +1,109 @@ +/* Copyright 2022 Jose Pablo Ramirez + * + * 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 + +/* OLED SPI Defines */ +#define OLED_DISPLAY_128X64 +#define OLED_IC OLED_IC_SH1106 + +/* OLED SPI Pins */ +#define OLED_DC_PIN GP24 +#define OLED_CS_PIN GP22 +#define OLED_RST_PIN GP23 + +#define OLED_BRIGHTNESS 128 + +/* Shift OLED columns by 2 pixels */ +#define OLED_COLUMN_OFFSET 2 + +/* Divisor for OLED */ +#define OLED_SPI_DIVISOR 4 + +/* ChibiOS SPI definitions */ +#define SPI_DRIVER SPID1 +#define SPI_SCK_PIN GP26 +#define SPI_MOSI_PIN GP27 +#define SPI_MISO_PIN GP28 + +/* Double tap the side button to enter bootloader */ +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED GP13 +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 500U + +/* Audio */ +#define AUDIO_PIN GP16 +#define AUDIO_PWM_DRIVER PWMD0 +#define AUDIO_PWM_CHANNEL RP2040_PWM_CHANNEL_A +#define AUDIO_INIT_DELAY +#define AUDIO_CLICKY + +#define SPEAKER_SHUTDOWN GP14 +#define AUDIO_DAC_SAMPLE_MAX 200U + +#ifdef RGB_MATRIX_ENABLE + + /* RGB Defines */ +# define RGB_MATRIX_LED_COUNT 12 + + /* Enable Framebuffer and keypress effects */ +# define RGB_MATRIX_FRAMEBUFFER_EFFECTS +# define RGB_MATRIX_KEYPRESSES + +# define ENABLE_RGB_MATRIX_ALPHAS_MODS +# define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN +# define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT +# define ENABLE_RGB_MATRIX_BREATHING +# define ENABLE_RGB_MATRIX_BAND_SAT +# define ENABLE_RGB_MATRIX_BAND_VAL +# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +# define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT +# define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL +# define ENABLE_RGB_MATRIX_CYCLE_ALL +# define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +# define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN +# define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN +# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +# define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL +# define ENABLE_RGB_MATRIX_CYCLE_SPIRAL +# define ENABLE_RGB_MATRIX_DUAL_BEACON +# define ENABLE_RGB_MATRIX_RAINBOW_BEACON +# define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS +# define ENABLE_RGB_MATRIX_RAINDROPS +# define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +# define ENABLE_RGB_MATRIX_HUE_BREATHING +# define ENABLE_RGB_MATRIX_HUE_PENDULUM +# define ENABLE_RGB_MATRIX_HUE_WAVE +# define ENABLE_RGB_MATRIX_PIXEL_RAIN +# define ENABLE_RGB_MATRIX_PIXEL_FLOW +# define ENABLE_RGB_MATRIX_PIXEL_FRACTAL +# define ENABLE_RGB_MATRIX_TYPING_HEATMAP +# define ENABLE_RGB_MATRIX_DIGITAL_RAIN +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +# define ENABLE_RGB_MATRIX_SPLASH +# define ENABLE_RGB_MATRIX_MULTISPLASH +# define ENABLE_RGB_MATRIX_SOLID_SPLASH +# define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH +#endif diff --git a/keyboards/aks_mls/testadapad/halconf.h b/keyboards/aks_mls/testadapad/halconf.h new file mode 100644 index 00000000..2e3be29b --- /dev/null +++ b/keyboards/aks_mls/testadapad/halconf.h @@ -0,0 +1,31 @@ +/* Copyright 2022 Jose Pablo Ramirez + * + * 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_next + +#undef HAL_USE_SPI +#define HAL_USE_SPI TRUE + +#undef SPI_USE_WAIT +#define SPI_USE_WAIT TRUE + +#undef SPI_SELECT_MODE +#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD + +#undef HAL_USE_PWM +#define HAL_USE_PWM TRUE diff --git a/keyboards/aks_mls/testadapad/keyboard.json b/keyboards/aks_mls/testadapad/keyboard.json new file mode 100644 index 00000000..5e052b00 --- /dev/null +++ b/keyboards/aks_mls/testadapad/keyboard.json @@ -0,0 +1,92 @@ +{ + "keyboard_name": "MLS AdaFruit RP2040 Macropad", + "manufacturer": "aks_mls", + "url": "https://learn.adafruit.com/adafruit-macropad-rp2040", + "maintainer": "aks-mls", + "usb": { + "pid": "0x0004", + "vid": "0xDF04", + // "vid": "0x239A", + // "pid": "0x0108", + "device_version": "0.0.1" + }, + "features": { + "bootmagic": true, + "mousekey": false, + "extrakey": true, + "nkro": true, + "audio": true, + "encoder": true, + "rgb_matrix": true, + "oled": true + }, + "audio": { + "driver": "pwm_hardware", + "power_control": { + "pin": "GP14" + } + }, + "encoder": { + "rotary": [ + {"pin_a": "GP18", "pin_b": "GP17"} + ] + }, + "rgb_matrix": { + "animations": { + "breathing": true, + "hue_breathing": true + }, + "driver": "ws2812", + "layout": [ + {"matrix": [1, 0], "x": 0, "y": 0, "flags": 4}, + {"matrix": [1, 1], "x": 112, "y": 0, "flags": 4}, + {"matrix": [1, 2], "x": 224, "y": 0, "flags": 4}, + {"matrix": [2, 0], "x": 0, "y": 21, "flags": 4}, + {"matrix": [2, 1], "x": 112, "y": 21, "flags": 4}, + {"matrix": [2, 2], "x": 224, "y": 21, "flags": 4}, + {"matrix": [3, 0], "x": 0, "y": 42, "flags": 4}, + {"matrix": [3, 1], "x": 112, "y": 42, "flags": 4}, + {"matrix": [3, 2], "x": 224, "y": 42, "flags": 4}, + {"matrix": [4, 0], "x": 0, "y": 64, "flags": 4}, + {"matrix": [4, 1], "x": 112, "y": 64, "flags": 4}, + {"matrix": [4, 2], "x": 224, "y": 64, "flags": 4} + ] + }, + "bootmagic": { + "matrix": [1, 2] + }, + "ws2812": { + "pin": "GP19", + "driver": "vendor" + }, + "processor": "RP2040", + "bootloader": "rp2040", + "matrix_pins": { + "direct": [ + [null, null, "GP0"], + ["GP1", "GP2", "GP3"], + ["GP4", "GP5", "GP6"], + ["GP7", "GP8", "GP9"], + ["GP10", "GP11", "GP12"] + ] + }, + "layouts": { + "LAYOUT": { + "layout": [ + {"x": 2, "y": 0, "matrix": [0, 2]}, + {"x": 0, "y": 1, "matrix": [1, 0]}, + {"x": 1, "y": 1, "matrix": [1, 1]}, + {"x": 2, "y": 1, "matrix": [1, 2]}, + {"x": 0, "y": 2, "matrix": [2, 0]}, + {"x": 1, "y": 2, "matrix": [2, 1]}, + {"x": 2, "y": 2, "matrix": [2, 2]}, + {"x": 0, "y": 3, "matrix": [3, 0]}, + {"x": 1, "y": 3, "matrix": [3, 1]}, + {"x": 2, "y": 3, "matrix": [3, 2]}, + {"x": 0, "y": 4, "matrix": [4, 0]}, + {"x": 1, "y": 4, "matrix": [4, 1]}, + {"x": 2, "y": 4, "matrix": [4, 2]} + ] + } + } +} diff --git a/keyboards/aks_mls/testadapad/keymaps/mls001/config.h b/keyboards/aks_mls/testadapad/keymaps/mls001/config.h new file mode 100644 index 00000000..c1eb09bd --- /dev/null +++ b/keyboards/aks_mls/testadapad/keymaps/mls001/config.h @@ -0,0 +1,20 @@ + +#define RGBLIGHT_EFFECT_BREATHING true + +#undef RGBLIGHT_MODE_BREATHING +#define RGBLIGHT_MODE_BREATHING 0 + + + + +#undef BREATHING_PERIOD +#define BREATHING_PERIOD 1000 + + + + + +#ifdef RGBLIGHT_LIMIT_VAL + #undef RGBLIGHT_LIMIT_VAL + #define RGBLIGHT_LIMIT_VAL 40 +#endif diff --git a/keyboards/aks_mls/testadapad/keymaps/mls001/keymap.c b/keyboards/aks_mls/testadapad/keymaps/mls001/keymap.c new file mode 100644 index 00000000..69b62e03 --- /dev/null +++ b/keyboards/aks_mls/testadapad/keymaps/mls001/keymap.c @@ -0,0 +1,152 @@ +/* Copyright 2022 Jose Pablo Ramirez + * + * 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 layer_names { + _BASE, + _SPECIAL1, + _SPECIAL2, + _STANDBY +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT( + TO(_SPECIAL1), + KC_7, KC_8, KC_9, + KC_4, KC_5, KC_6, + KC_1, KC_2, KC_3, + KC_ENT, KC_0, KC_BSPC + ), + [_SPECIAL1] = LAYOUT( + TO(_SPECIAL2), + KC_ESC, KC_MS_U, KC_NO, + KC_MS_L, KC_MS_D, KC_MS_R, + KC_NO, KC_WH_U, KC_NO, + KC_WH_L, KC_WH_D, KC_WH_R + ), + [_SPECIAL2] = LAYOUT( + TO(_STANDBY), + KC_NO, KC_NO, KC_NO, + RGB_MOD, RGB_RMOD, KC_NO, + RGB_M_B, RGB_M_R, RGB_M_SW, + RGB_TOG, RGB_M_P, KC_NO + ), + [_STANDBY] = LAYOUT( + TO(_BASE), + KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO + ), +}; + +#ifdef ENCODER_MAP_ENABLE + /* This sets what the encoder turns do at each layer. + There has to be a setting for each defined layer. + Otherwise there will be a compile error. + + Keep in mind the transparency encoding applies. + */ + const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + [_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [_SPECIAL1] = { ENCODER_CCW_CW(CK_DOWN, CK_UP) }, + [_SPECIAL2] = { ENCODER_CCW_CW(AU_PREV, AU_NEXT) }, + [_STANDBY] = { ENCODER_CCW_CW(KC_NO, KC_NO) } + }; +#endif + + +#ifdef OLED_ENABLE + + static void render_logo(void) { + static const char PROGMEM aks_mls_logo[] = { + // 'mls_logo_layers_totop', 128x24px + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x10, 0x18, + 0x08, 0xc4, 0xc4, 0x84, 0x02, 0x02, 0x02, 0x83, 0xc1, 0x01, 0x01, 0xc1, 0xc1, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x03, 0x82, 0xc2, 0x42, 0x44, 0x44, 0x84, 0x08, 0x18, 0x10, 0x20, 0xc0, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x80, 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, 0xe0, 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, 0x0f, 0x30, 0x40, 0x80, 0x80, + 0x00, 0x3f, 0x01, 0x03, 0x07, 0x02, 0x01, 0x3f, 0x3f, 0x00, 0x00, 0x3f, 0x3f, 0x20, 0x20, 0x20, + 0x20, 0x00, 0x00, 0x13, 0x27, 0x26, 0x26, 0x3e, 0x1c, 0x00, 0x80, 0x80, 0x40, 0x30, 0x0f, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x01, 0x03, 0x07, 0x02, 0x01, 0x3f, 0x3f, 0x00, 0x00, + 0x18, 0x3d, 0x25, 0x25, 0x3f, 0x3e, 0x00, 0x00, 0x1e, 0x3f, 0x21, 0x21, 0x21, 0x00, 0x3f, 0x3f, + 0x02, 0x03, 0x03, 0x00, 0x1e, 0x3f, 0x21, 0x21, 0x3f, 0x1e, 0x00, 0xff, 0xff, 0x21, 0x21, 0x3f, + 0x1e, 0x00, 0x00, 0x18, 0x3d, 0x25, 0x25, 0x3f, 0x3e, 0x00, 0x1e, 0x3f, 0x21, 0x21, 0x3f, 0x3f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x01, 0x02, 0x02, 0x06, 0x04, 0x04, 0x04, 0x0c, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x0c, 0x04, 0x04, 0x04, 0x06, 0x02, 0x02, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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(aks_mls_logo, sizeof(aks_mls_logo)); + } + + bool oled_init(oled_rotation_t(OLED_ROTATION_0)); + + bool oled_task_user(void) { + render_logo(); + + oled_set_cursor(0, 3); + // oled_write(PSTR("Layer: "), false); + + switch (get_highest_layer(layer_state)) { + case _BASE: + // oled_write_ln(PSTR("Base"), false); + oled_write_ln(PSTR("Default Actions"), false); + oled_advance_page(true); + oled_advance_page(true); + rgblight_sethsv_noeeprom(HSV_GREEN); + break; + case _SPECIAL1: + // oled_write_ln(PSTR("Special1"), false); + oled_write_ln(PSTR("Special Actions 1"), false); + oled_advance_page(true); + rgblight_sethsv_noeeprom(HSV_BLUE); + break; + case _SPECIAL2: + // oled_write_ln(PSTR("Special2"), false); + oled_write_ln(PSTR("Special Actions 2"), false); + oled_advance_page(true); + oled_advance_page(true); + rgblight_sethsv_noeeprom(HSV_MAGENTA); + break; + case _STANDBY: + oled_write_ln(PSTR("Standby Mode"), false); + oled_write_ln(PSTR("Keys do nothing"), false); + oled_write_ln(PSTR("Layer key re-engages"), false); + rgblight_sethsv_noeeprom(HSV_RED); + + break; + default: + oled_write_ln_P(PSTR("Undefined"), false); + oled_advance_page(true); + oled_advance_page(true); + + } + + return false; + } +#endif + diff --git a/keyboards/aks_mls/testadapad/keymaps/mls001/rules.mk b/keyboards/aks_mls/testadapad/keymaps/mls001/rules.mk new file mode 100644 index 00000000..af6f731e --- /dev/null +++ b/keyboards/aks_mls/testadapad/keymaps/mls001/rules.mk @@ -0,0 +1,3 @@ +ENCODER_MAP_ENABLE = yes +AUDIO_ENABLE = no +MOUSEKEY_ENABLE = yes diff --git a/keyboards/aks_mls/testadapad/keymaps/mls002/config.h b/keyboards/aks_mls/testadapad/keymaps/mls002/config.h new file mode 100644 index 00000000..3342b852 --- /dev/null +++ b/keyboards/aks_mls/testadapad/keymaps/mls002/config.h @@ -0,0 +1,25 @@ + +#define RGBLIGHT_EFFECT_BREATHING true + +#undef RGBLIGHT_MODE_BREATHING +#define RGBLIGHT_MODE_BREATHING 0 + + +#undef BREATHING_PERIOD +#define BREATHING_PERIOD 1000 + + +#ifdef RGBLIGHT_LIMIT_VAL + #undef RGBLIGHT_LIMIT_VAL + #define RGBLIGHT_LIMIT_VAL 40 +#endif + +// The default brightness level of the OLED, from 0 to 255. +#undef OLED_BRIGHTNESS +#define OLED_BRIGHTNESS 128 + +// Turns off the OLED screen after 60000ms of screen update inactivity. +// Helps reduce OLED Burn-in. Set to 0 to disable. +// Default is 60000ms ie 60 seconds +#undef OLED_TIMEOUT +#define OLED_TIMEOUT 60000 diff --git a/keyboards/aks_mls/testadapad/keymaps/mls002/keymap.c b/keyboards/aks_mls/testadapad/keymaps/mls002/keymap.c new file mode 100644 index 00000000..e843f634 --- /dev/null +++ b/keyboards/aks_mls/testadapad/keymaps/mls002/keymap.c @@ -0,0 +1,160 @@ +/* Copyright 2022 Jose Pablo Ramirez + * + * 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 layer_names { + _BASE, + _SPECIAL1, + _SPECIAL2, + _STANDBY +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT( + TO(_SPECIAL1), + KC_7, KC_8, KC_9, + KC_4, KC_5, KC_6, + KC_1, KC_2, KC_3, + KC_ENT, KC_0, KC_BSPC + ), + [_SPECIAL1] = LAYOUT( + TO(_SPECIAL2), + KC_ESC, KC_MS_U, KC_NO, + KC_MS_L, KC_MS_D, KC_MS_R, + KC_NO, KC_WH_U, KC_NO, + KC_WH_L, KC_WH_D, KC_WH_R + ), + [_SPECIAL2] = LAYOUT( + TO(_STANDBY), + KC_NO, KC_NO, KC_NO, + RGB_MOD, RGB_RMOD, KC_NO, + RGB_M_B, RGB_M_R, RGB_M_SW, + RGB_TOG, RGB_M_P, KC_NO + ), + [_STANDBY] = LAYOUT( + TO(_BASE), + KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO + ), +}; + +#ifdef ENCODER_MAP_ENABLE + /* This sets what the encoder turns do at each layer. + There has to be a setting for each defined layer. + Otherwise there will be a compile error. + + Keep in mind the transparency encoding applies. + */ + const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + [_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [_SPECIAL1] = { ENCODER_CCW_CW(CK_DOWN, CK_UP) }, + [_SPECIAL2] = { ENCODER_CCW_CW(AU_PREV, AU_NEXT) }, + [_STANDBY] = { ENCODER_CCW_CW(KC_NO, KC_NO) } + }; +#endif + + +#ifdef OLED_ENABLE + + + // static void render_logo(void) { + // static const char PROGMEM aks_mls_logo[] = { + // // 'mls_logo_layers_totop', 128x24px + // 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x10, 0x18, + // 0x08, 0xc4, 0xc4, 0x84, 0x02, 0x02, 0x02, 0x83, 0xc1, 0x01, 0x01, 0xc1, 0xc1, 0x01, 0x01, 0x01, + // 0x01, 0x01, 0x03, 0x82, 0xc2, 0x42, 0x44, 0x44, 0x84, 0x08, 0x18, 0x10, 0x20, 0xc0, 0x00, 0x00, + // 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x80, 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, 0xe0, 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, 0x0f, 0x30, 0x40, 0x80, 0x80, + // 0x00, 0x3f, 0x01, 0x03, 0x07, 0x02, 0x01, 0x3f, 0x3f, 0x00, 0x00, 0x3f, 0x3f, 0x20, 0x20, 0x20, + // 0x20, 0x00, 0x00, 0x13, 0x27, 0x26, 0x26, 0x3e, 0x1c, 0x00, 0x80, 0x80, 0x40, 0x30, 0x0f, 0x00, + // 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x01, 0x03, 0x07, 0x02, 0x01, 0x3f, 0x3f, 0x00, 0x00, + // 0x18, 0x3d, 0x25, 0x25, 0x3f, 0x3e, 0x00, 0x00, 0x1e, 0x3f, 0x21, 0x21, 0x21, 0x00, 0x3f, 0x3f, + // 0x02, 0x03, 0x03, 0x00, 0x1e, 0x3f, 0x21, 0x21, 0x3f, 0x1e, 0x00, 0xff, 0xff, 0x21, 0x21, 0x3f, + // 0x1e, 0x00, 0x00, 0x18, 0x3d, 0x25, 0x25, 0x3f, 0x3e, 0x00, 0x1e, 0x3f, 0x21, 0x21, 0x3f, 0x3f, + // 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + // 0x01, 0x02, 0x02, 0x06, 0x04, 0x04, 0x04, 0x0c, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + // 0x08, 0x08, 0x0c, 0x04, 0x04, 0x04, 0x06, 0x02, 0x02, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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(aks_mls_logo, sizeof(aks_mls_logo)); + // } + + // OLED_ROTATION_0 = 0 + // OLED_ROTATION_90 = 1 + // OLED_ROTATION_180 = 2 + // OLED_ROTATION_270 = 3 + // ???? work ??? + + bool oled_init(oled_rotation_t(OLED_ROTATION_0)); + + bool oled_task_user(void) { + // not showing logo all the time + // render_logo(); + + oled_set_cursor(0, 3); + // oled_write(PSTR("Layer: "), false); + + switch (get_highest_layer(layer_state)) { + case _BASE: + // oled_write_ln(PSTR("Base"), false); + oled_write_ln(PSTR("Default Actions"), false); + oled_advance_page(true); + oled_advance_page(true); + rgblight_sethsv_noeeprom(HSV_GREEN); + break; + case _SPECIAL1: + // oled_write_ln(PSTR("Special1"), false); + oled_write_ln(PSTR("Special Actions 1"), false); + oled_advance_page(true); + rgblight_sethsv_noeeprom(HSV_BLUE); + break; + case _SPECIAL2: + // oled_write_ln(PSTR("Special2"), false); + oled_write_ln(PSTR("Special Actions 2"), false); + oled_advance_page(true); + oled_advance_page(true); + rgblight_sethsv_noeeprom(HSV_MAGENTA); + break; + case _STANDBY: + oled_write_ln(PSTR("Standby Mode"), false); + oled_write_ln(PSTR("Keys do nothing"), false); + oled_write_ln(PSTR("Layer key re-engages"), false); + rgblight_sethsv_noeeprom(HSV_RED); + + break; + default: + oled_write_ln_P(PSTR("Undefined"), false); + oled_advance_page(true); + oled_advance_page(true); + + } + + return false; + } +#endif + diff --git a/keyboards/aks_mls/testadapad/keymaps/mls002/rules.mk b/keyboards/aks_mls/testadapad/keymaps/mls002/rules.mk new file mode 100644 index 00000000..af6f731e --- /dev/null +++ b/keyboards/aks_mls/testadapad/keymaps/mls002/rules.mk @@ -0,0 +1,3 @@ +ENCODER_MAP_ENABLE = yes +AUDIO_ENABLE = no +MOUSEKEY_ENABLE = yes diff --git a/keyboards/aks_mls/testadapad/keymaps/via/keymap.c b/keyboards/aks_mls/testadapad/keymaps/via/keymap.c new file mode 100644 index 00000000..cb2e4800 --- /dev/null +++ b/keyboards/aks_mls/testadapad/keymaps/via/keymap.c @@ -0,0 +1,137 @@ +/* Copyright 2022 Jose Pablo Ramirez + * + * 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 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + LT(1,KC_MUTE), + KC_ENT, KC_0, KC_BSPC, + KC_7, KC_8, KC_9, + KC_4, KC_5, KC_6, + KC_1, KC_2, KC_3 + ), + [1] = LAYOUT( + _______, + CK_TOGG, AU_TOGG, _______, + _______, _______, _______, + _______, _______, _______, + _______, _______, _______ + ), + [2] = LAYOUT( + _______, + _______, _______, _______, + _______, _______, _______, + _______, _______, _______, + _______, _______, _______ + ), + [3] = LAYOUT( + _______, + _______, _______, _______, + _______, _______, _______, + _______, _______, _______, + _______, _______, _______ + ), +}; + +#ifdef ENCODER_MAP_ENABLE +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [1] = { ENCODER_CCW_CW(_______, _______) }, + [2] = { ENCODER_CCW_CW(_______, _______) }, + [3] = { ENCODER_CCW_CW(_______, _______) } +}; +#endif + + +#ifdef OLED_ENABLE +static void render_qmk_logo(void) { + static const char PROGMEM qmk_logo[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3f, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x3f, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, + 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x83, 0x83, 0x83, 0x83, 0x83, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, + 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xfe, 0xfe, 0xfe, 0xfe, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x83, 0x83, 0x83, 0x83, 0x03, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x81, 0x83, 0x83, 0x83, 0x83, 0x83, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x83, 0x83, 0x83, 0x83, 0x81, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x07, 0x1f, 0x3f, 0x7f, 0x7e, 0xf8, 0xf0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xff, 0xff, + 0xff, 0xff, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xf0, 0xf8, 0x7e, 0x7f, 0x3f, 0x1f, 0x07, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0xff, 0xff, + 0xff, 0xff, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xfc, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xfc, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, + 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xfc, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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(qmk_logo, sizeof(qmk_logo)); +} + +bool oled_task_user(void) { + render_qmk_logo(); + return true; +} + +#endif diff --git a/keyboards/aks_mls/testadapad/keymaps/via/rules.mk b/keyboards/aks_mls/testadapad/keymaps/via/rules.mk new file mode 100644 index 00000000..715838ec --- /dev/null +++ b/keyboards/aks_mls/testadapad/keymaps/via/rules.mk @@ -0,0 +1,2 @@ +ENCODER_MAP_ENABLE = yes +VIA_ENABLE = yes diff --git a/keyboards/aks_mls/testadapad/mcuconf.h b/keyboards/aks_mls/testadapad/mcuconf.h new file mode 100644 index 00000000..153a319d --- /dev/null +++ b/keyboards/aks_mls/testadapad/mcuconf.h @@ -0,0 +1,25 @@ +/* Copyright 2022 Jose Pablo Ramirez + * + * 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_next + +#undef RP_SPI_USE_SPI1 +#define RP_SPI_USE_SPI1 TRUE + +#undef RP_PWM_USE_PWM0 +#define RP_PWM_USE_PWM0 TRUE diff --git a/keyboards/aks_mls/testadapad/readme.md b/keyboards/aks_mls/testadapad/readme.md new file mode 100644 index 00000000..a7d3632f --- /dev/null +++ b/keyboards/aks_mls/testadapad/readme.md @@ -0,0 +1,45 @@ +# This "testadapad" setup applies to a Adafruit MacroPad RP2040. + +![AdafruitMacropad](https://i.imgur.com/dSBSwcJh.jpeg) + +A RP2040-powered Macropad with a 3x4 layout. + +- Original Keyboard Maintainer: [Jpe230](https://github.com/jpe230/) +- Hardware Supported: Adafruit MacroPad RP2040 +- Hardware Availability: [Barebones kit](https://www.adafruit.com/product/5100) [Starter Kit](https://www.adafruit.com/product/5128) + +Make example for this board (after setting up your build environment): + +```sh +qmk compile -kb handwired/aks_mls/testadapad -km mls001 + +once the macropad is in flash mode (double click the side button) this will flash the macropad: + +qmk flash -kb handwired/aks_mls/testadapad -km mls001 + +Note that flash will recompile if changes were made. + +``` + +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). + +## Features + +- Raspberry Pi RP2040 Chip + 8MB Flash memory - Dual-core Cortex M0+ at ~130MHz with 264KB of RAM. +- 3x4 Mechanical key switch sockets - accepts any Cherry MX-compatible switches. Individually tied to GPIO pins (not matrix wired) +- One NeoPixel RGB LED per switch, on north side. +- Rotary encoder, 20 detents per rotation, with push-switch on GPIO pin. Push switch is also used for entering bootloader mode when held down on power-up or reset. +- 128x64 SH1106 Monochrome OLED display - On high-speed hardware SPI port for quick updates. +- 8mm Speaker/Buzzer - With Class D amplifier and RC filter, can be used to make simple beeps and sounds effects. (Unsupported for now) +- STEMMA QT Connector - Allows adding any I2C sensors/displays/devices with plug-and-play cables. +- Reset button - On the side, for quick restarting, press it twice to enter bootloader. +- Four M3 mounting bosses - Make custom enclosures easily. + +## Bootloader + +Enter the bootloader in 4 ways: + +* **Bootmagic reset**: Hold down the key just below the rotary encoder push-button on power-up. +* **Physical reset button**: Press twice the button on the side while the board is connected. +* **BOOT button** Hold down the rotary encoder push-button on power-up or reset. +* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available. diff --git a/keyboards/aks_mls/testadapad/rules.mk b/keyboards/aks_mls/testadapad/rules.mk new file mode 100644 index 00000000..6f391227 --- /dev/null +++ b/keyboards/aks_mls/testadapad/rules.mk @@ -0,0 +1,19 @@ +# Build Options +# change yes to no to disable +# +# NOTE Commenting out features that are defines in keyboard.json (ie info.json). +# +# BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +# MOUSEKEY_ENABLE = no # 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 = yes # Audio output +# AUDIO_DRIVER = pwm_hardware +# ENCODER_ENABLE = yes +# RGB_MATRIX_ENABLE = yes +# OLED_ENABLE = yes +OLED_TRANSPORT = spi diff --git a/keyboards/aks_mls/testadapad/testadapad.c b/keyboards/aks_mls/testadapad/testadapad.c new file mode 100644 index 00000000..e4e0ba15 --- /dev/null +++ b/keyboards/aks_mls/testadapad/testadapad.c @@ -0,0 +1,130 @@ +/* Copyright 2022 Jose Pablo Ramirez + * + * 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 "quantum.h" + +#ifdef RGB_MATRIX_ENABLE + +#define NA NO_LED + +/* RGB Positioning */ +led_config_t g_led_config = { { + { NA, NA, NA }, + { 0, 1, 2 }, + { 3, 4, 5 }, + { 6, 7, 8 }, + { 9, 10, 11 } +}, { + { 0, 0 }, { 112, 0 }, { 224, 0}, + { 0, 21 }, { 112, 21 }, { 224, 21}, + { 0, 42 }, { 112, 42 }, { 224, 42}, + { 0, 64 }, { 112, 64 }, { 224, 64} +}, { + 4, 4, 4, + 4, 4, 4, + 4, 4, 4, + 4, 4, 4 +} }; + +#endif + +#ifdef AUDIO_ENABLE +void keyboard_pre_init_kb(void) { + // ensure pin is set and enabled pre-audio init + setPinOutput(SPEAKER_SHUTDOWN); + writePinHigh(SPEAKER_SHUTDOWN); + keyboard_pre_init_user(); +} + +void keyboard_post_init_kb(void) { + // set pin based on active status + writePin(SPEAKER_SHUTDOWN, audio_is_on()); + keyboard_post_init_user(); +} + +void audio_on_user(void) { + writePinHigh(SPEAKER_SHUTDOWN); +} + +void audio_off_user(void) { + // needs a delay or it runs right after play note. + wait_ms(200); + writePinLow(SPEAKER_SHUTDOWN); +} +#endif + +#ifdef OLED_ENABLE +static uint32_t oled_logo_timer = 0; + // static void render_logo(void) { + static const char PROGMEM aks_mls_logo[] = { + // 'mls_logo_layers_totop', 128x24px + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x10, 0x18, + 0x08, 0xc4, 0xc4, 0x84, 0x02, 0x02, 0x02, 0x83, 0xc1, 0x01, 0x01, 0xc1, 0xc1, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x03, 0x82, 0xc2, 0x42, 0x44, 0x44, 0x84, 0x08, 0x18, 0x10, 0x20, 0xc0, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x80, 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, 0xe0, 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, 0x0f, 0x30, 0x40, 0x80, 0x80, + 0x00, 0x3f, 0x01, 0x03, 0x07, 0x02, 0x01, 0x3f, 0x3f, 0x00, 0x00, 0x3f, 0x3f, 0x20, 0x20, 0x20, + 0x20, 0x00, 0x00, 0x13, 0x27, 0x26, 0x26, 0x3e, 0x1c, 0x00, 0x80, 0x80, 0x40, 0x30, 0x0f, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x01, 0x03, 0x07, 0x02, 0x01, 0x3f, 0x3f, 0x00, 0x00, + 0x18, 0x3d, 0x25, 0x25, 0x3f, 0x3e, 0x00, 0x00, 0x1e, 0x3f, 0x21, 0x21, 0x21, 0x00, 0x3f, 0x3f, + 0x02, 0x03, 0x03, 0x00, 0x1e, 0x3f, 0x21, 0x21, 0x3f, 0x1e, 0x00, 0xff, 0xff, 0x21, 0x21, 0x3f, + 0x1e, 0x00, 0x00, 0x18, 0x3d, 0x25, 0x25, 0x3f, 0x3e, 0x00, 0x1e, 0x3f, 0x21, 0x21, 0x3f, 0x3f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x01, 0x02, 0x02, 0x06, 0x04, 0x04, 0x04, 0x0c, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x0c, 0x04, 0x04, 0x04, 0x06, 0x02, 0x02, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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(aks_mls_logo, sizeof(aks_mls_logo)); + + // } + + bool oled_init(oled_rotation_t(OLED_ROTATION_0)); + +void render_logo(void) { + oled_write_raw_P(aks_mls_logo, sizeof(aks_mls_logo)); +} + + // trying to render the logo only during startup +#ifndef SHOW_LOGO +# define SHOW_LOGO 4000 +#endif +bool oled_task_kb(void) { + + // if (!oled_task_user()) { return false; } + // render_logo(); + if ((timer_elapsed32(oled_logo_timer) < SHOW_LOGO)){ + // render_logo(); + // oled_scroll_left(); + // oled_write(PSTR("Layer: "), false); + }else{ + render_logo(); + oled_task_user(); + } + return false; +} + + + +#endif diff --git a/keyboards/aks_mls/v01/config.h b/keyboards/aks_mls/v01/config.h new file mode 100644 index 00000000..fa77da13 --- /dev/null +++ b/keyboards/aks_mls/v01/config.h @@ -0,0 +1,46 @@ +// Copyright 2023 Allan Seidel (@Allan Seidel) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +/* + * 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 + +/* OLED SPI Defines */ +#define OLED_DISPLAY_128X64 +#define OLED_IC OLED_IC_SH1106 + +/* OLED SPI Pins */ +#define OLED_DC_PIN GP11 +#define OLED_CS_PIN GP12 +#define OLED_RST_PIN GP13 + +/* Shift OLED columns by 2 pixels */ +#define OLED_COLUMN_OFFSET 2 + +/* Divisor for OLED */ +#define OLED_SPI_DIVISOR 4 + +/* ChibiOS SPI definitions */ +#define SPI_DRIVER SPID1 +#define SPI_SCK_PIN GP26 +#define SPI_MOSI_PIN GP27 + +/* Double tap the pico reset button to enter bootloader. */ +/* Pico reset button is the RUN pin (side hole #30). */ +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED GP25 +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 500U diff --git a/keyboards/aks_mls/v01/halconf.h b/keyboards/aks_mls/v01/halconf.h new file mode 100644 index 00000000..cd71dc48 --- /dev/null +++ b/keyboards/aks_mls/v01/halconf.h @@ -0,0 +1,35 @@ +/* Copyright 2023 Allan Seidel + * + * 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_next + +/* + * As per the documentation ChibiOS/ARM Configuration :id=arm-configuration + * for spi_driver. + * + * A modification to the mcuconf.h is also necessary to enable which spi port + * will be used. +*/ +#undef HAL_USE_SPI +#define HAL_USE_SPI TRUE + +#undef SPI_USE_WAIT +#define SPI_USE_WAIT TRUE + +#undef SPI_SELECT_MODE +#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD diff --git a/keyboards/aks_mls/v01/keyboard.json b/keyboards/aks_mls/v01/keyboard.json new file mode 100644 index 00000000..276130b7 --- /dev/null +++ b/keyboards/aks_mls/v01/keyboard.json @@ -0,0 +1,71 @@ +{ + "manufacturer": "mls_aks", + "keyboard_name": "handwired/aks_mls", + "maintainer": "mls_aks", + // "url": "https://soemthing_even_bs_has_to_be_here???_learn.adafruit.com/adafruit-macropad-rp2040", + "url": "", + "usb": { + "device_version": "1.0.0", + // "pid": "0x0000", + "pid": "0x0004", + "vid": "0xDF04" + // "vid": "0xFEED" + }, + "processor": "RP2040", + "bootloader": "rp2040", + "diode_direction": "COL2ROW", + "features": { + "bootmagic": true, + "command": false, + "console": false, + "extrakey": true, + "mousekey": true, + "nkro": true + }, + "matrix_pins": { + "cols": ["GP0", "GP2", "GP4", "GP5"], + "rows": ["GP22", "GP21", "GP20", "GP28"] + }, + "encoder": { + "rotary": [ + {"pin_a": "GP1", "pin_b": "GP3"}, + {"pin_a": "GP6", "pin_b": "GP7"}, + {"pin_a": "GP19", "pin_b": "GP18"}, + {"pin_a": "GP17", "pin_b": "GP16"} + ] + }, + + "bootmagic": { + "matrix": [3, 3] + }, + "layouts": { + "LAYOUT": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + + {"matrix": [0, 3], "x": 3, "y": 0}, + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + + {"matrix": [1, 3], "x": 3, "y": 1}, + + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + + {"matrix": [2, 3], "x": 3, "y": 2}, + + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3}, + + {"matrix": [3, 3], "x": 3, "y": 3} + + ] + } + } +} diff --git a/keyboards/aks_mls/v01/keymaps/default/keymap.c b/keyboards/aks_mls/v01/keymaps/default/keymap.c new file mode 100644 index 00000000..62316a8f --- /dev/null +++ b/keyboards/aks_mls/v01/keymaps/default/keymap.c @@ -0,0 +1,240 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + + +enum layer_names { + _BASE, + _SPECIAL1, + _SPECIAL2, + _STANDBY +}; + +enum custom_keycodes { + LYR_MUL = SAFE_RANGE, + LYR_MUR, + LYR_MDL, + LYR_MDR, + NXTAPP +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * The matrix is logically this: + * ┌─────┬─────┬─────┬───────────┐ + * │ 0,0 │ 0,1 │ 0,2 │ 0,3 Enc 1 │ + * ├─────┼─────┼─────┼───────────┤ + * │ 1,0 │ 1,1 │ 1,2 │ 1,3 Enc 2 │ + * ├─────┼─────┼─────┼───────────┤ + * │ 2,0 │ 2,1 │ 2,2 │ 2,3 Enc 3 │ + * ├─────┼─────┼─────┼───────────┤ + * │ 3,0 │ 3,1 │ 3,2 │ 3,3 Enc 4 │ + * └─────┴─────┴─────┴───────────┘ + * + * But is physically mounted like this: + * + * ┌───────────┐ ┌───────────┐ + * │ 0,3 Enc 1 │ │ 1,3 Enc 2 │ + * └───────────┘ └───────────┘ + * ┌─────┬─────┬─────┬─────┐ + * │ 3,0 │ 2,0 │ 1,0 │ 0,0 │ ┌───────────┐ + * ├─────┼─────┼─────┼─────┤ │ 2,3 Enc 3 │ + * │ 3,1 │ 2,1 │ 1,1 │ 0,1 │ └───────────┘ + * ├─────┼─────┼─────┼─────┤ ┌───────────┐ + * │ 3,2 │ 2,2 │ 1,2 │ 0,2 │ │ 3,3 Enc 4 │ + * └─────┴─────┴─────┴─────┘ └───────────┘ + * + * + */ + [_BASE] = LAYOUT( + KC_P3, KC_P7, NXTAPP, KC_BSPC, + KC_P2, KC_P6, KC_DOT, KC_DEL, + KC_P1, KC_P5, KC_P9, KC_SPC, + KC_P0, KC_P4, KC_P8, TO(_SPECIAL1) + ), + [_SPECIAL1] = LAYOUT( + KC_P7, KC_P8, KC_P9, KC_NO, + KC_P4, KC_P5, KC_P6, KC_NO, + KC_P1, KC_P2, KC_P3, KC_NO, + KC_P0, KC_PENT, KC_NO, TO(_SPECIAL2) + ), + [_SPECIAL2] = LAYOUT( + KC_ACL0, KC_ACL1, KC_ACL2, KC_NO, + LYR_MUR, KC_MS_R, LYR_MDR, KC_NO, + KC_MS_U, KC_MS_BTN1, KC_MS_D, KC_NO, + LYR_MUL, KC_MS_L, LYR_MDL, TO(_STANDBY) + ), + [_STANDBY] = LAYOUT( + 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_NO, KC_NO, TO(_BASE) + ) +}; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + [_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_UP, KC_DOWN), + + ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN), + + ENCODER_CCW_CW(KC_WH_U, KC_WH_D) + }, + [_SPECIAL1] = { ENCODER_CCW_CW(KC_TRNS,KC_TRNS), ENCODER_CCW_CW(KC_MS_L, KC_MS_R), + + ENCODER_CCW_CW(KC_PGUP, KC_PGDN), + + ENCODER_CCW_CW(KC_TRNS,KC_TRNS) + }, + [_SPECIAL2] = { ENCODER_CCW_CW(KC_TRNS,KC_TRNS), ENCODER_CCW_CW(KC_WH_U, KC_WH_D), + + ENCODER_CCW_CW(KC_PGUP, KC_PGDN), + + ENCODER_CCW_CW(KC_TRNS,KC_TRNS) + }, + [_STANDBY] = { ENCODER_CCW_CW(KC_NO, KC_NO), ENCODER_CCW_CW(KC_NO, KC_NO), + + ENCODER_CCW_CW(KC_NO, KC_NO), + + ENCODER_CCW_CW(KC_NO, KC_NO) + }, +}; +#endif + + + + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case LYR_MUL: + if (record->event.pressed){ + register_code(KC_MS_U); + register_code(KC_MS_L); + } else { + unregister_code(KC_MS_U); + unregister_code(KC_MS_L); + } + break; + case LYR_MUR: + if (record->event.pressed){ + register_code(KC_MS_U); + register_code(KC_MS_R); + } else { + unregister_code(KC_MS_U); + unregister_code(KC_MS_R); + } + break; + case LYR_MDL: + if (record->event.pressed){ + register_code(KC_MS_D); + register_code(KC_MS_L); + } else { + unregister_code(KC_MS_D); + unregister_code(KC_MS_L); + } + break; + case LYR_MDR: + if (record->event.pressed){ + register_code(KC_MS_D); + register_code(KC_MS_R); + } else { + unregister_code(KC_MS_D); + unregister_code(KC_MS_R); + } + break; + case NXTAPP: + if (record->event.pressed){ + SEND_STRING(SS_LGUI("\t")); + } + return false; + break; + } + return true; +} + + + + +#ifdef OLED_ENABLE + + static void render_logo(void) { + static const char PROGMEM aks_mls_logo[] = { + // 'mls_logo_layers_totop', 128x24px + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x10, 0x18, + 0x08, 0xc4, 0xc4, 0x84, 0x02, 0x02, 0x02, 0x83, 0xc1, 0x01, 0x01, 0xc1, 0xc1, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x03, 0x82, 0xc2, 0x42, 0x44, 0x44, 0x84, 0x08, 0x18, 0x10, 0x20, 0xc0, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x80, 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, 0xe0, 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, 0x0f, 0x30, 0x40, 0x80, 0x80, + 0x00, 0x3f, 0x01, 0x03, 0x07, 0x02, 0x01, 0x3f, 0x3f, 0x00, 0x00, 0x3f, 0x3f, 0x20, 0x20, 0x20, + 0x20, 0x00, 0x00, 0x13, 0x27, 0x26, 0x26, 0x3e, 0x1c, 0x00, 0x80, 0x80, 0x40, 0x30, 0x0f, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x01, 0x03, 0x07, 0x02, 0x01, 0x3f, 0x3f, 0x00, 0x00, + 0x18, 0x3d, 0x25, 0x25, 0x3f, 0x3e, 0x00, 0x00, 0x1e, 0x3f, 0x21, 0x21, 0x21, 0x00, 0x3f, 0x3f, + 0x02, 0x03, 0x03, 0x00, 0x1e, 0x3f, 0x21, 0x21, 0x3f, 0x1e, 0x00, 0xff, 0xff, 0x21, 0x21, 0x3f, + 0x1e, 0x00, 0x00, 0x18, 0x3d, 0x25, 0x25, 0x3f, 0x3e, 0x00, 0x1e, 0x3f, 0x21, 0x21, 0x3f, 0x3f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x01, 0x02, 0x02, 0x06, 0x04, 0x04, 0x04, 0x0c, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x0c, 0x04, 0x04, 0x04, 0x06, 0x02, 0x02, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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(aks_mls_logo, sizeof(aks_mls_logo)); + } + + bool oled_init(oled_rotation_t(OLED_ROTATION_0)); + + bool oled_task_user(void) { + render_logo(); + + oled_set_cursor(0, 3); + // oled_write(PSTR("Layer: "), false); + + switch (get_highest_layer(layer_state)) { + case _BASE: + // oled_write_ln(PSTR("Base"), false); + oled_write_ln(PSTR("_Base Layer"), false); + oled_advance_page(true); + oled_advance_page(true); + break; + case _SPECIAL1: + // oled_write_ln(PSTR("Special1"), false); + oled_write_ln(PSTR("_Special1 Layer"), false); + oled_advance_page(true); + break; + case _SPECIAL2: + // oled_write_ln(PSTR("Special2"), false); + oled_write_ln(PSTR("_Special2 Layer"), false); + oled_advance_page(true); + oled_advance_page(true); + break; + case _STANDBY: + oled_write_ln(PSTR("_Standby Layer"), false); + oled_write_ln(PSTR("Keys do nothing"), false); + oled_write_ln(PSTR("Layer key re-engages"), false); + break; + default: + oled_write_ln_P(PSTR("Undefined"), false); + oled_advance_page(true); + oled_advance_page(true); + + } + + return false; + } + + // bool oled_task_kb(void) { + // oled_set_cursor(0,8); + // oled_write_ln(PSTR("Key Pressed"), false); + // return false; + // } + +#endif diff --git a/keyboards/aks_mls/v01/mcuconf.h b/keyboards/aks_mls/v01/mcuconf.h new file mode 100644 index 00000000..39a93dc6 --- /dev/null +++ b/keyboards/aks_mls/v01/mcuconf.h @@ -0,0 +1,29 @@ +/* Copyright 2023 Allan Seidel + * + * 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_next + +/* + * As per the documentation ChibiOS/ARM Configuration :id=arm-configuration + * for spi_driver. + * + * A modification to the mcuconf.h is necessary to enable which spi port + * will be used. +*/ +#undef RP_SPI_USE_SPI1 +#define RP_SPI_USE_SPI1 TRUE diff --git a/keyboards/aks_mls/v01/readme.md b/keyboards/aks_mls/v01/readme.md new file mode 100644 index 00000000..da8d69f1 --- /dev/null +++ b/keyboards/aks_mls/v01/readme.md @@ -0,0 +1,29 @@ +# This "handwired/aks_mls/v01" setup applies to the aks handwired macroPad that uses +# the RP2040 pico. This setup mimics the physical layout of the ?? macropad +# handwired/aks_mls + +![handwired/aks_mls](imgur.com image replace me!) + +* A short description of the keyboard/project* + +* Keyboard Maintainer: [Allan Seidel]( Seidel) +* Hardware Supported: *The PCBs, controllers supported* +* Hardware Availability: *Links to where you can find this hardware* + +Make example for this keyboard (after setting up your build environment): + + qmk compile -kb handwired/aks_mls/v01 -km default + +Flashing example for this keyboard: + + qmk flash -kb handwired/aks_mls/v01 -km 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). + +## 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 `QK_BOOT` if it is available diff --git a/keyboards/aks_mls/v01/rules.mk b/keyboards/aks_mls/v01/rules.mk new file mode 100644 index 00000000..2f4248c8 --- /dev/null +++ b/keyboards/aks_mls/v01/rules.mk @@ -0,0 +1,21 @@ +# Build Options +# change yes to no to disable +# +# +# NOTE: These options are present in the info.json, so they +# are commented out here. +# BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +# MOUSEKEY_ENABLE = no # 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 +OLED_ENABLE = yes +OLED_TRANSPORT = spi +LTO_ENABLE = yes +ENCODER_ENABLE = yes +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/aks_mls/via/config.h b/keyboards/aks_mls/via/config.h new file mode 100644 index 00000000..fa77da13 --- /dev/null +++ b/keyboards/aks_mls/via/config.h @@ -0,0 +1,46 @@ +// Copyright 2023 Allan Seidel (@Allan Seidel) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +/* + * 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 + +/* OLED SPI Defines */ +#define OLED_DISPLAY_128X64 +#define OLED_IC OLED_IC_SH1106 + +/* OLED SPI Pins */ +#define OLED_DC_PIN GP11 +#define OLED_CS_PIN GP12 +#define OLED_RST_PIN GP13 + +/* Shift OLED columns by 2 pixels */ +#define OLED_COLUMN_OFFSET 2 + +/* Divisor for OLED */ +#define OLED_SPI_DIVISOR 4 + +/* ChibiOS SPI definitions */ +#define SPI_DRIVER SPID1 +#define SPI_SCK_PIN GP26 +#define SPI_MOSI_PIN GP27 + +/* Double tap the pico reset button to enter bootloader. */ +/* Pico reset button is the RUN pin (side hole #30). */ +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED GP25 +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 500U diff --git a/keyboards/aks_mls/via/halconf.h b/keyboards/aks_mls/via/halconf.h new file mode 100644 index 00000000..cd71dc48 --- /dev/null +++ b/keyboards/aks_mls/via/halconf.h @@ -0,0 +1,35 @@ +/* Copyright 2023 Allan Seidel + * + * 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_next + +/* + * As per the documentation ChibiOS/ARM Configuration :id=arm-configuration + * for spi_driver. + * + * A modification to the mcuconf.h is also necessary to enable which spi port + * will be used. +*/ +#undef HAL_USE_SPI +#define HAL_USE_SPI TRUE + +#undef SPI_USE_WAIT +#define SPI_USE_WAIT TRUE + +#undef SPI_SELECT_MODE +#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD diff --git a/keyboards/aks_mls/via/info.json b/keyboards/aks_mls/via/info.json new file mode 100644 index 00000000..477b32e1 --- /dev/null +++ b/keyboards/aks_mls/via/info.json @@ -0,0 +1,49 @@ +{ + "manufacturer": "AllanSeidel", + "keyboard_name": "handwired/aks_mls", + "maintainer": "AllanSeidel", + + "features": { + "bootmagic": true, + "command": false, + "console": false, + "extrakey": true, + "mousekey": true, + "nkro": true + }, + "processor": "RP2040", + "bootloader": "rp2040", + "diode_direction": "COL2ROW", + "matrix_pins": { + "cols": ["GP0", "GP2", "GP4"], + "rows": ["GP22", "GP21", "GP20", "GP28"] + }, + + "url": "", + "usb": { + "device_version": "1.0.0", + "pid": "0x0000", + "vid": "0x6173" + }, + "bootmagic": { + "matrix": [3, 2] + }, + "layouts": { + "LAYOUT": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3} + ] + } + } +} diff --git a/keyboards/aks_mls/via/keymaps/default/keymap.c b/keyboards/aks_mls/via/keymaps/default/keymap.c new file mode 100644 index 00000000..70f9be79 --- /dev/null +++ b/keyboards/aks_mls/via/keymaps/default/keymap.c @@ -0,0 +1,184 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + + +enum layer_names { + _BASE, + _SPECIAL1, + _SPECIAL2, + _STANDBY +}; + +enum custom_keycodes { + LYR_MUL = SAFE_RANGE, + LYR_MUR, + LYR_MDL, + LYR_MDR +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┬───┬───┬ + * │ 7 │ 8 │ 9 │ + * ├───┼───┼───┼ + * │ 4 │ 5 │ 6 │ + * ├───┼───┼───┼ + * │ 1 │ 2 │ 3 │ + * ├───┼───┼───┼ + * │ 0 │Ent│Lyr│ + * └───┴───┴───┘ + */ + [_BASE] = LAYOUT( + KC_P7, KC_P8, KC_P9, + KC_P4, KC_P5, KC_P6, + KC_P1, KC_P2, KC_P3, + KC_P0, KC_PENT, TO(_SPECIAL1) + ), + [_SPECIAL1] = LAYOUT( + KC_P7, KC_P8, KC_P9, + KC_P4, KC_P5, KC_P6, + KC_P1, KC_P2, KC_P3, + KC_P0, KC_PENT, TO(_SPECIAL2) + ), + [_SPECIAL2] = LAYOUT( + LYR_MUL, KC_MS_U, LYR_MUR, + KC_MS_L, KC_MS_BTN1, KC_MS_R, + LYR_MDL, KC_MS_D, LYR_MDR, + KC_ACL0, KC_ACL1, TO(_STANDBY) + ), + [_STANDBY] = LAYOUT( + KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, TO(_BASE) + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case LYR_MUL: + if (record->event.pressed){ + register_code(KC_MS_U); + register_code(KC_MS_L); + } else { + unregister_code(KC_MS_U); + unregister_code(KC_MS_L); + } + break; + case LYR_MUR: + if (record->event.pressed){ + register_code(KC_MS_U); + register_code(KC_MS_R); + } else { + unregister_code(KC_MS_U); + unregister_code(KC_MS_R); + } + break; + case LYR_MDL: + if (record->event.pressed){ + register_code(KC_MS_D); + register_code(KC_MS_L); + } else { + unregister_code(KC_MS_D); + unregister_code(KC_MS_L); + } + break; + case LYR_MDR: + if (record->event.pressed){ + register_code(KC_MS_D); + register_code(KC_MS_R); + } else { + unregister_code(KC_MS_D); + unregister_code(KC_MS_R); + } + break; + } + return true; +} + + + + +#ifdef OLED_ENABLE + + static void render_logo(void) { + static const char PROGMEM aks_mls_logo[] = { + // 'mls_logo_layers_totop', 128x24px + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x10, 0x18, + 0x08, 0xc4, 0xc4, 0x84, 0x02, 0x02, 0x02, 0x83, 0xc1, 0x01, 0x01, 0xc1, 0xc1, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x03, 0x82, 0xc2, 0x42, 0x44, 0x44, 0x84, 0x08, 0x18, 0x10, 0x20, 0xc0, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x80, 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, 0xe0, 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, 0x0f, 0x30, 0x40, 0x80, 0x80, + 0x00, 0x3f, 0x01, 0x03, 0x07, 0x02, 0x01, 0x3f, 0x3f, 0x00, 0x00, 0x3f, 0x3f, 0x20, 0x20, 0x20, + 0x20, 0x00, 0x00, 0x13, 0x27, 0x26, 0x26, 0x3e, 0x1c, 0x00, 0x80, 0x80, 0x40, 0x30, 0x0f, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x01, 0x03, 0x07, 0x02, 0x01, 0x3f, 0x3f, 0x00, 0x00, + 0x18, 0x3d, 0x25, 0x25, 0x3f, 0x3e, 0x00, 0x00, 0x1e, 0x3f, 0x21, 0x21, 0x21, 0x00, 0x3f, 0x3f, + 0x02, 0x03, 0x03, 0x00, 0x1e, 0x3f, 0x21, 0x21, 0x3f, 0x1e, 0x00, 0xff, 0xff, 0x21, 0x21, 0x3f, + 0x1e, 0x00, 0x00, 0x18, 0x3d, 0x25, 0x25, 0x3f, 0x3e, 0x00, 0x1e, 0x3f, 0x21, 0x21, 0x3f, 0x3f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x01, 0x02, 0x02, 0x06, 0x04, 0x04, 0x04, 0x0c, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x0c, 0x04, 0x04, 0x04, 0x06, 0x02, 0x02, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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(aks_mls_logo, sizeof(aks_mls_logo)); + } + + bool oled_init(oled_rotation_t(OLED_ROTATION_0)); + + bool oled_task_user(void) { + render_logo(); + + oled_set_cursor(0, 3); + // oled_write(PSTR("Layer: "), false); + + switch (get_highest_layer(layer_state)) { + case _BASE: + // oled_write_ln(PSTR("Base"), false); + oled_write_ln(PSTR("Default Actions"), false); + oled_advance_page(true); + oled_advance_page(true); + break; + case _SPECIAL1: + // oled_write_ln(PSTR("Special1"), false); + oled_write_ln(PSTR("Special Actions 1"), false); + oled_advance_page(true); + break; + case _SPECIAL2: + // oled_write_ln(PSTR("Special2"), false); + oled_write_ln(PSTR("Mouse Moves"), false); + oled_advance_page(true); + oled_advance_page(true); + break; + case _STANDBY: + oled_write_ln(PSTR("Standby Mode"), false); + oled_write_ln(PSTR("Keys do nothing"), false); + oled_write_ln(PSTR("Layer key re-engages"), false); + break; + default: + oled_write_ln_P(PSTR("Undefined"), false); + oled_advance_page(true); + oled_advance_page(true); + + } + + return false; + } + + // bool oled_task_kb(void) { + // oled_set_cursor(0,8); + // oled_write_ln(PSTR("Key Pressed"), false); + // return false; + // } + +#endif diff --git a/keyboards/aks_mls/via/keymaps/default/via.json b/keyboards/aks_mls/via/keymaps/default/via.json new file mode 100644 index 00000000..693aa48f --- /dev/null +++ b/keyboards/aks_mls/via/keymaps/default/via.json @@ -0,0 +1,18 @@ +{ + "name": "v01-via", + "productId": "0x0000", + "vendorId": "0x6173", + "matrix": { + "cols": 3, + "rows": 4 + }, + + "layouts": { + "keymap": [ + ["0,0","0,1","0,2"], + ["1,0","1,1","1,2"], + ["2,0","2,1","2,2"], + ["3,0","3,1","3,2"] + ] + } +} diff --git a/keyboards/aks_mls/via/mcuconf.h b/keyboards/aks_mls/via/mcuconf.h new file mode 100644 index 00000000..39a93dc6 --- /dev/null +++ b/keyboards/aks_mls/via/mcuconf.h @@ -0,0 +1,29 @@ +/* Copyright 2023 Allan Seidel + * + * 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_next + +/* + * As per the documentation ChibiOS/ARM Configuration :id=arm-configuration + * for spi_driver. + * + * A modification to the mcuconf.h is necessary to enable which spi port + * will be used. +*/ +#undef RP_SPI_USE_SPI1 +#define RP_SPI_USE_SPI1 TRUE diff --git a/keyboards/aks_mls/via/readme.md b/keyboards/aks_mls/via/readme.md new file mode 100644 index 00000000..d2671892 --- /dev/null +++ b/keyboards/aks_mls/via/readme.md @@ -0,0 +1,27 @@ +# handwired/aks_mls + +![handwired/aks_mls](imgur.com image replace me!) + +*A short description of the keyboard/project* + +* Keyboard Maintainer: [Allan Seidel](https://github.com/Allan Seidel) +* Hardware Supported: *The PCBs, controllers supported* +* Hardware Availability: *Links to where you can find this hardware* + +Make example for this keyboard (after setting up your build environment): + + make handwired/aks_mls:default + +Flashing example for this keyboard: + + make handwired/aks_mls:default: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 + +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 `QK_BOOT` if it is available diff --git a/keyboards/aks_mls/via/rules.mk b/keyboards/aks_mls/via/rules.mk new file mode 100644 index 00000000..aa327edb --- /dev/null +++ b/keyboards/aks_mls/via/rules.mk @@ -0,0 +1,20 @@ +# Build Options +# change yes to no to disable +# +# +# NOTE: These options are present in the info.json, so they +# are commented out here. +# BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +# MOUSEKEY_ENABLE = no # 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 +OLED_ENABLE = yes +OLED_TRANSPORT = spi +LTO_ENABLE = yes +VIA_ENABLE = yes diff --git a/qmk.json b/qmk.json index 3afc389f..9b2b2d91 100644 --- a/qmk.json +++ b/qmk.json @@ -1,4 +1,6 @@ { - "userspace_version": "1.0", - "build_targets": [] + "userspace_version": "1.1", + "build_targets": [ + ["adafruit/macropad", "mls_v100"] + ] } \ No newline at end of file