diff options
author | lokher <lokher@gmail.com> | 2022-12-06 17:04:10 +0800 |
---|---|---|
committer | lokher <lokher@gmail.com> | 2022-12-06 17:04:10 +0800 |
commit | 27fc28fd2ff52e079a5bc58d6aaea4c752420615 (patch) | |
tree | 7ac943fb1ba4f430a7220efd18f66f6a77205c30 /keyboards/anavi | |
parent | e736133392fe6427cfb995da0787337189828272 (diff) | |
parent | 2709b6ed616f8012ff4cfd3ee69a822a8d188351 (diff) |
Merge upstream master
Diffstat (limited to 'keyboards/anavi')
-rw-r--r-- | keyboards/anavi/knob1/config.h | 34 | ||||
-rw-r--r-- | keyboards/anavi/knob1/info.json | 60 | ||||
-rw-r--r-- | keyboards/anavi/knob1/keymaps/default/keymap.c | 16 | ||||
-rw-r--r-- | keyboards/anavi/knob1/knob1.c | 59 | ||||
-rw-r--r-- | keyboards/anavi/knob1/knob1.h | 30 | ||||
-rw-r--r-- | keyboards/anavi/knob1/mcuconf.h | 12 | ||||
-rw-r--r-- | keyboards/anavi/knob1/readme.md | 21 | ||||
-rw-r--r-- | keyboards/anavi/knob1/rules.mk | 6 | ||||
-rw-r--r-- | keyboards/anavi/macropad10/config.h | 11 | ||||
-rw-r--r-- | keyboards/anavi/macropad10/info.json | 72 | ||||
-rw-r--r-- | keyboards/anavi/macropad10/keymaps/default/keymap.c | 16 | ||||
-rw-r--r-- | keyboards/anavi/macropad10/macropad10.c | 16 | ||||
-rw-r--r-- | keyboards/anavi/macropad10/readme.md | 21 | ||||
-rw-r--r-- | keyboards/anavi/macropad10/rules.mk | 1 | ||||
-rw-r--r-- | keyboards/anavi/macropad8/config.h | 72 | ||||
-rw-r--r-- | keyboards/anavi/macropad8/keymaps/git/config.h | 24 |
16 files changed, 471 insertions, 0 deletions
diff --git a/keyboards/anavi/knob1/config.h b/keyboards/anavi/knob1/config.h new file mode 100644 index 0000000000..f677aa9b23 --- /dev/null +++ b/keyboards/anavi/knob1/config.h @@ -0,0 +1,34 @@ +// Copyright 2022 Leon Anavi <leon@anavi.org> +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "config_common.h" + +/* key matrix size */ +#define MATRIX_ROWS 1 +#define MATRIX_COLS 1 + +/* Keyboard Matrix Assignments */ +// clang-format off +#define DIRECT_PINS { \ + { GP26 } \ +} + +#define RGBLIGHT_DEFAULT_MODE 9 + +/* Double tap reset button to enter bootloader */ +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED GP17 +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 500U + + +#define I2C_DRIVER I2CD2 +#define I2C1_SDA_PIN GP6 +#define I2C1_SCL_PIN GP7 + +#ifdef OLED_ENABLE +# define OLED_DISPLAY_128X64 +# define OLED_TIMEOUT 60000 +# define OLED_BRIGHTNESS 128 +#endif diff --git a/keyboards/anavi/knob1/info.json b/keyboards/anavi/knob1/info.json new file mode 100644 index 0000000000..7ed1767a24 --- /dev/null +++ b/keyboards/anavi/knob1/info.json @@ -0,0 +1,60 @@ +{ + "keyboard_name": "Knob 1", + "manufacturer": "ANAVI", + "url": "https://github.com/AnaviTechnology/anavi-knob-1", + "maintainer": "leon-anavi", + "processor": "RP2040", + "bootloader": "rp2040", + "debounce": 5, + "features": { + "bootmagic": false, + "command": false, + "console": false, + "extrakey": true, + "mousekey": false, + "nkro": true, + "rgblight": true + }, + "rgblight": { + "pin": "GP12", + "led_count": 1, + "hue_steps": 10, + "saturation_steps": 17, + "brightness_steps": 17, + "max_brightness": 255, + "animations": { + "alternating": true, + "breathing": true, + "christmas": true, + "knight": true, + "rainbow_mood": true, + "rainbow_swirl": true, + "rgb_test": true, + "snake": true, + "static_gradient": true, + "twinkle": true + } + }, + "encoder": { + "enabled": true, + "rotary": [ + { + "pin_a": "GP27", + "pin_b": "GP28", + "resolution": 2 + } + ] + }, + "layouts": { + "LAYOUT_k1": { + "layout": [ + { "label":"Mute", "x": 0, "y": 0 } + ] + } + }, + "usb": { + "device_version": "1.0.0", + "pid": "0x9A25", + "vid": "0xFEED" + } +} diff --git a/keyboards/anavi/knob1/keymaps/default/keymap.c b/keyboards/anavi/knob1/keymaps/default/keymap.c new file mode 100644 index 0000000000..a17be455e4 --- /dev/null +++ b/keyboards/anavi/knob1/keymaps/default/keymap.c @@ -0,0 +1,16 @@ +// Copyright 2022 Leon Anavi <leon@anavi.org> +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +//#include <stdio.h> + +enum layer_names { + _BASE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_k1( + KC_MUTE + ) +}; diff --git a/keyboards/anavi/knob1/knob1.c b/keyboards/anavi/knob1/knob1.c new file mode 100644 index 0000000000..cfc3ac8a65 --- /dev/null +++ b/keyboards/anavi/knob1/knob1.c @@ -0,0 +1,59 @@ +// Copyright 2022 Leon Anavi <leon@anavi.org> +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "encoder.h" +#include <stdio.h> + +void keyboard_post_init_kb(void) { + // Enable RGB LED + setPinOutput(GP11); + writePinHigh(GP11); + rgblight_enable(); + + // Offload to the user func + keyboard_post_init_user(); +} + +#ifdef ENCODER_ENABLE +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + return true; +} +#endif + +#ifdef OLED_ENABLE + +bool oled_task_kb(void) { + + if (!oled_task_user()) { + return false; + } + + // Host Keyboard Layer Status + oled_write_ln_P(PSTR("ANAVI Knob 1"), false); + oled_write_ln_P(PSTR("Keymap: Default"), false); + + // Host Keyboard LED Status + led_t led_state = host_keyboard_led_state(); + oled_write_P(PSTR("Num Lock: "), false); + oled_write_ln_P(led_state.num_lock ? PSTR("On") : PSTR("Off"), false); + oled_write_P(PSTR("Caps Lock: "), false); + oled_write_ln_P(led_state.caps_lock ? PSTR("On") : PSTR("Off"), false); + oled_write_P(PSTR("Scroll Lock: "), false); + oled_write_ln_P(led_state.scroll_lock ? PSTR("On") : PSTR("Off"), false); +#ifdef RGBLIGHT_ENABLE + static char rgbStatusLine1[26] = {0}; + snprintf(rgbStatusLine1, sizeof(rgbStatusLine1), "RGB Mode: %d", rgblight_get_mode()); + oled_write_ln(rgbStatusLine1, false); + static char rgbStatusLine2[26] = {0}; + snprintf(rgbStatusLine2, sizeof(rgbStatusLine2), "h:%d s:%d v:%d", rgblight_get_hue(), rgblight_get_sat(), rgblight_get_val()); + oled_write_ln(rgbStatusLine2, false); +#endif + return false; +} +#endif diff --git a/keyboards/anavi/knob1/knob1.h b/keyboards/anavi/knob1/knob1.h new file mode 100644 index 0000000000..c48170928c --- /dev/null +++ b/keyboards/anavi/knob1/knob1.h @@ -0,0 +1,30 @@ +/* Copyright 2022 Leon Anavi <leon@anavi.org> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#pragma once + +#include "quantum.h" + +#define ___ KC_NO + +// clang-format off + #define LAYOUT_k1( \ + K02 \ + ) \ + { \ + { K02 } \ + } +// clang-format on diff --git a/keyboards/anavi/knob1/mcuconf.h b/keyboards/anavi/knob1/mcuconf.h new file mode 100644 index 0000000000..eb1c98372f --- /dev/null +++ b/keyboards/anavi/knob1/mcuconf.h @@ -0,0 +1,12 @@ +// Copyright 2022 Leon Anavi (@leon-anavi) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include_next <mcuconf.h> + +#undef RP_I2C_USE_I2C0 +#define RP_I2C_USE_I2C0 FALSE + +#undef RP_I2C_USE_I2C1 +#define RP_I2C_USE_I2C1 TRUE diff --git a/keyboards/anavi/knob1/readme.md b/keyboards/anavi/knob1/readme.md new file mode 100644 index 0000000000..08f8f92197 --- /dev/null +++ b/keyboards/anavi/knob1/readme.md @@ -0,0 +1,21 @@ +# ANAVI Knob 1 + +Mini mechanical keyboard with a clickable rotary encoder, USB-C, RP2040 microcontroller and I2C slot. + +* Keyboard Maintainer: [Leon Anavi](https://github.com/leon-anavi) +* Hardware Supported: ANAVI Knob 1 +* Hardware Availability: [Crowd Supply](https://www.crowdsupply.com/anavi-technology/anavi-macro-pad-10), [GitHub repository](https://github.com/AnaviTechnology/anavi-knob-1) + +Make example for this keyboard (after setting up your build environment): + + qmk compile -kb anavi/knob1 -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 top left key on the left half, or top right key on the right half, and then plug in the USB cable on that keyboard half. +* **Physical reset button**: Double tap the reset button on the XIAO RP2040. +* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available. diff --git a/keyboards/anavi/knob1/rules.mk b/keyboards/anavi/knob1/rules.mk new file mode 100644 index 0000000000..ed8acbe4ac --- /dev/null +++ b/keyboards/anavi/knob1/rules.mk @@ -0,0 +1,6 @@ +WS2812_DRIVER = vendor + +OLED_ENABLE = yes +OLED_DRIVER = SSD1306 # Enable Support for SSD1306 or SH1106 OLED Displays; Communicating over I2C + +OPT_DEFS += -DHAL_USE_I2C=TRUE diff --git a/keyboards/anavi/macropad10/config.h b/keyboards/anavi/macropad10/config.h new file mode 100644 index 0000000000..8d81cf3675 --- /dev/null +++ b/keyboards/anavi/macropad10/config.h @@ -0,0 +1,11 @@ +// Copyright 2022 Leon Anavi <leon@anavi.org> +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "config_common.h" + +/* Double tap reset button to enter bootloader */ +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED GP17 +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 500U diff --git a/keyboards/anavi/macropad10/info.json b/keyboards/anavi/macropad10/info.json new file mode 100644 index 0000000000..5b1a9d8546 --- /dev/null +++ b/keyboards/anavi/macropad10/info.json @@ -0,0 +1,72 @@ +{ + "keyboard_name": "Macro Pad 10", + "manufacturer": "ANAVI", + "url": "https://github.com/AnaviTechnology/anavi-macro-pad-10", + "maintainer": "leon-anavi", + "processor": "RP2040", + "bootloader": "rp2040", + "diode_direction": "COL2ROW", + "matrix_pins": { + "cols": ["GP6", "GP7", "GP0"], + "rows": ["GP29", "GP28", "GP27"] + }, + "features": { + "bootmagic": false, + "command": false, + "console": false, + "extrakey": true, + "mousekey": false, + "nkro": true, + "rgblight": true + }, + "rgblight": { + "pin": "GP3", + "led_count": 4, + "hue_steps": 10, + "saturation_steps": 17, + "brightness_steps": 17, + "max_brightness": 255, + "animations": { + "alternating": true, + "breathing": true, + "christmas": true, + "knight": true, + "rainbow_mood": true, + "rainbow_swirl": true, + "rgb_test": true, + "snake": true, + "static_gradient": true, + "twinkle": true + } + }, + "encoder": { + "enabled": true, + "rotary": [ + { + "pin_a": "GP1", + "pin_b": "GP2", + "resolution": 2 + } + ] + }, + "layouts": { + "LAYOUT_mp10": { + "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 } + ] + } + }, + "usb": { + "device_version": "1.0.0", + "pid": "0x9A25", + "vid": "0xFEED" + } +} diff --git a/keyboards/anavi/macropad10/keymaps/default/keymap.c b/keyboards/anavi/macropad10/keymaps/default/keymap.c new file mode 100644 index 0000000000..8a02b392c0 --- /dev/null +++ b/keyboards/anavi/macropad10/keymaps/default/keymap.c @@ -0,0 +1,16 @@ +// Copyright 2022 Leon Anavi <leon@anavi.org> +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +enum layer_names { + _BASE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_mp10( + KC_A , KC_B , KC_C , + KC_D , KC_E , KC_F , + RGB_M_R , RGB_MOD , RGB_TOG + ) +}; diff --git a/keyboards/anavi/macropad10/macropad10.c b/keyboards/anavi/macropad10/macropad10.c new file mode 100644 index 0000000000..bebefd0da9 --- /dev/null +++ b/keyboards/anavi/macropad10/macropad10.c @@ -0,0 +1,16 @@ +// Copyright 2022 Leon Anavi <leon@anavi.org> +// SPDX-License-Identifier: GPL-2.0-or-later +#include "encoder.h" + +#ifdef ENCODER_ENABLE +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + return true; +} +#endif + diff --git a/keyboards/anavi/macropad10/readme.md b/keyboards/anavi/macropad10/readme.md new file mode 100644 index 0000000000..0a740db1a3 --- /dev/null +++ b/keyboards/anavi/macropad10/readme.md @@ -0,0 +1,21 @@ +# ANAVI Macro Pad 10 + +Mini hot-swappable mechanical keyboard with a clickable rotary encoder, 9 Cherry MX compatible switches, translucent key caps, USB-C, RP2040 microcontroller, backlighting and under lighting. + +* Keyboard Maintainer: [Leon Anavi](https://github.com/leon-anavi) +* Hardware Supported: ANAVI Macro Pad 10 +* Hardware Availability: [Crowd Supply](https://www.crowdsupply.com/anavi-technology/anavi-macro-pad-10), [GitHub repository](https://github.com/AnaviTechnology/anavi-macro-pad-10) + +Make example for this keyboard (after setting up your build environment): + + qmk compile -kb anavi/macropad10 -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 top left key on the left half, or top right key on the right half, and then plug in the USB cable on that keyboard half. +* **Physical reset button**: Double tap the reset button on the XIAO RP2040. +* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available. diff --git a/keyboards/anavi/macropad10/rules.mk b/keyboards/anavi/macropad10/rules.mk new file mode 100644 index 0000000000..997fce7e65 --- /dev/null +++ b/keyboards/anavi/macropad10/rules.mk @@ -0,0 +1 @@ +WS2812_DRIVER = vendor diff --git a/keyboards/anavi/macropad8/config.h b/keyboards/anavi/macropad8/config.h new file mode 100644 index 0000000000..92453494d5 --- /dev/null +++ b/keyboards/anavi/macropad8/config.h @@ -0,0 +1,72 @@ +/* +Copyright 2020 Leon Anavi <leon@anavi.org> + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#pragma once + +#include "config_common.h" + +/* key matrix size */ +#define MATRIX_ROWS 2 +#define MATRIX_COLS 4 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * NO_DIODE = switches are directly connected to AVR pins + * +*/ +#define DIRECT_PINS { \ + { D4, F6, B5, E6 }, \ + { F5, F7, B4, C6 } \ +} + +#define BACKLIGHT_PIN D7 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 +#define RGBLIGHT_SLEEP + + +/* ws2812B RGB LED */ +#ifdef RGBLIGHT_ENABLE +# define RGB_DI_PIN F4 +# 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 RGBLED_NUM 4 +# define RGBLIGHT_HUE_STEP 10 +# define RGBLIGHT_SAT_STEP 17 +# define RGBLIGHT_VAL_STEP 17 +# define RGBLIGHT_LIMIT_VAL 255 +#endif + +#ifdef OLED_ENABLE +# define OLED_DISPLAY_128X64 +# define OLED_TIMEOUT 60000 +# define OLED_FONT_H "keyboards/anavi/macropad8/glcdfont.c" +#endif diff --git a/keyboards/anavi/macropad8/keymaps/git/config.h b/keyboards/anavi/macropad8/keymaps/git/config.h new file mode 100644 index 0000000000..370eb86ca8 --- /dev/null +++ b/keyboards/anavi/macropad8/keymaps/git/config.h @@ -0,0 +1,24 @@ +/* Copyright 2021 Leon Anavi <leon@anavi.org> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#pragma once + +#undef RGBLIGHT_EFFECT_RAINBOW_SWIRL +#undef RGBLIGHT_EFFECT_KNIGHT +#undef RGBLIGHT_EFFECT_STATIC_GRADIENT +#undef RGBLIGHT_EFFECT_RGB_TEST +#undef RGBLIGHT_EFFECT_ALTERNATING +#undef RGBLIGHT_EFFECT_TWINKLE |