Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions Firmware/QMK_VIA/danibcorr/QMK VIA Macropad Info.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# QMK VIA Macropad Information

I've encountered several issues when using KMK with my macropad over time, as it would often stop working, requiring me to disconnect and reconnect the cable. I attempted to update Circuitpython and the KMK firmware, but didn't succeed. As an alternative, I thought about installing QMK along with VIA since I have a Keychron V4 with that firmware, and the ability to visually change my macropad configuration seems more appealing.

First, I recommend watching this [video](https://www.youtube.com/watch?v=hjml-K-pV4E) to learn how to set up QMK, in addition to following the official documentation to create a QMK environment. Once you have a QMK environment, you can place the files from this repository in the "Firmware/QMK_VIA/danibcorr" folder. If you prefer not to set up a QMK environment, there's a file with a ".uf2" extension in the same folder that can be flashed directly onto the KB 2040 microcontroller, and its configuration can be modified later in VIA. Due to the fact that I configured QMK along with VIA locally, VIA won't automatically recognize the macropad, so you'll need to follow the instructions in this [video](https://www.youtube.com/watch?v=7d5yzBOup9U).

Although the video shows the pins to which each element on the PCB is connected, I'm grouping them below:

- Column 1 → Pin D3 → GP3.
- Column 2 → Pin D4 → GP4.
- Column 3 → Pin D5 → GP5.
- Column 4 → Pin D6 → GP6.
- Row 1 → Pin D7 → GP7.
- Row 2 → Pin D8 → GP8.
- Row 3 → Pin D9 → GP9.
- ROT1_A → Pin A2 → GP28.
- ROT1_B → Pin A1 → GP27.
- ROT1_SWITCH → Pin A0 → GP26.
- ROT2_A → Pin SCK → GP18.
- ROT2_B → Pin MISO → GP20.
- ROT2_SWITCH → Pin MOSI → GP19.
- NEOPIXEL → D10 → GP10.
6 changes: 6 additions & 0 deletions Firmware/QMK_VIA/danibcorr/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#pragma once

#define ENCODERS_PAD_A { GP28, GP18 }
#define ENCODERS_PAD_B { GP27, GP20 }

#define DIP_SWITCH_PINS { GP26, GP19 }
Binary file not shown.
Binary file not shown.
69 changes: 69 additions & 0 deletions Firmware/QMK_VIA/danibcorr/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"manufacturer": "Adafruit",
"keyboard_name": "Macropad ocreeb12",
"maintainer": "danibcorr",
"bootloader": "rp2040",
"diode_direction": "COL2ROW",
"features": {
"bootmagic": true,
"command": false,
"console": false,
"extrakey": true,
"mousekey": true,
"nkro": true
},
"rgblight": {
"saturation_steps": 8,
"brightness_steps": 8,
"led_count": 8,
"sleep": true,
"animations": {
"breathing": true,
"rainbow_mood": true,
"rainbow_swirl": true,
"snake": true,
"knight": true,
"christmas": true,
"static_gradient": true,
"rgb_test": true,
"alternating": true,
"twinkle": true
}
},
"ws2812": {
"pin": "GP10"
},
"matrix_pins": {
"cols": ["GP3", "GP4", "GP5", "GP6"],
"rows": ["GP0", "GP7", "GP8", "GP9"]
},
"processor": "RP2040",
"usb": {
"device_version": "1.0.0",
"pid": "0x0001",
"vid": "0x5241"
},
"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}
]
}
}
}

52 changes: 52 additions & 0 deletions Firmware/QMK_VIA/danibcorr/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#include QMK_KEYBOARD_H
#include "macros.h"

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT(
ENC03, KC_NO, KC_NO, ENC12,
M00, M01, M02, M03,
M10, M11, M12, M13,
M20, M21, M22, M23
)
};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[0] = { ENCODER_CCW_CW(ENC01, ENC02), ENCODER_CCW_CW(ENC11, ENC12) }
};
#endif

bool dip_switch_update_user(uint8_t index, bool active)
{
switch (index)
{
case 0:

if(active)
{
tap_code(ENC03);
}
else
{

}

break;

case 1:

if(active)
{
tap_code(ENC12);
}
else
{

}

break;
}

return true;
}

32 changes: 32 additions & 0 deletions Firmware/QMK_VIA/danibcorr/keymaps/via/macros.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// macros.h
#pragma once

#include QMK_KEYBOARD_H

// MACROS ROW 1
#define M00 LGUI(KC_ESCAPE)
#define M01 KC_NO
#define M02 KC_NO
#define M03 KC_NO

// MACROS ROW 2
#define M10 KC_LEFT
#define M11 KC_MEDIA_PLAY_PAUSE
#define M12 KC_RIGHT
#define M13 KC_NO

// MACROS ROW 3
#define M20 KC_PRINT_SCREEN
#define M21 KC_NO
#define M22 KC_NO
#define M23 KC_NO

// MACROS ENCODER 1
#define ENC01 KC_VOLU
#define ENC02 KC_VOLD
#define ENC03 KC_MUTE

// MACROS ENCODER 2
#define ENC10 LCTL(KC_EQUAL)
#define ENC11 LCTL(KC_MINUS)
#define ENC12 KC_MUTE
8 changes: 8 additions & 0 deletions Firmware/QMK_VIA/danibcorr/keymaps/via/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
VIA_ENABLE=yes
ENCODER_ENABLE=yes
ENCODER_MAP_ENABLE=yes
DIP_SWITCH_ENABLE=yes

RGBLIGHT_ENABLE = yes
WS2812_DRIVER_REQUIRED = yes
WS2812_DRIVER = vendor
6 changes: 6 additions & 0 deletions Firmware/QMK_VIA/danibcorr/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ENCODER_ENABLE=yes
DIP_SWITCH_ENABLE=yes

RGBLIGHT_ENABLE = yes
WS2812_DRIVER_REQUIRED = yes
WS2812_DRIVER = vendor
23 changes: 23 additions & 0 deletions Firmware/QMK_VIA/danibcorr/via.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "Macropad Ocreeb12",
"vendorId": "0x5241",
"productId": "0x0001",
"matrix": {
"rows": 4,
"cols": 4
},
"keycodes": [
"qmk_lighting"
],
"menus": [
"qmk_rgblight"
],
"layouts": {
"keymap": [
["0,0\n\n\n\n\n\n\n\n\ne0",{"x": 2}, "0,3\n\n\n\n\n\n\n\n\ne1"],
["1,0","1,1","1,2","1,3"],
["2,0","2,1","2,2","2,3"],
["3,0","3,1","3,2","3,3"]
]
}
}