~ruther/qmk_firmware

a3d2c89c4cff53f2a72dc349227ad2075e61c363 — Leon Anavi 2 years ago 7b3ad56
[Keyboard] Add ANAVI Macro Pad 10 (#18620)

A keyboards/anavi/macropad10/config.h => keyboards/anavi/macropad10/config.h +11 -0
@@ 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

A keyboards/anavi/macropad10/info.json => keyboards/anavi/macropad10/info.json +72 -0
@@ 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"
    }
}

A keyboards/anavi/macropad10/keymaps/default/keymap.c => keyboards/anavi/macropad10/keymaps/default/keymap.c +16 -0
@@ 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
    )
};

A keyboards/anavi/macropad10/macropad10.c => keyboards/anavi/macropad10/macropad10.c +16 -0
@@ 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


A keyboards/anavi/macropad10/readme.md => keyboards/anavi/macropad10/readme.md +21 -0
@@ 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.

A keyboards/anavi/macropad10/rules.mk => keyboards/anavi/macropad10/rules.mk +1 -0
@@ 0,0 1,1 @@
WS2812_DRIVER = vendor