Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
machineabuse authored Jul 21, 2021
1 parent 8f5a1c8 commit f9e5196
Show file tree
Hide file tree
Showing 4 changed files with 185 additions and 0 deletions.
15 changes: 15 additions & 0 deletions VIA Source Code/DumbpadVIA.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "DUMBPAD V1.1",
"vendorId": "0xA153",
"productId": "0xF3BE",
"lighting": "none",
"matrix": { "rows": 4, "cols": 5 },
"layouts": {
"keymap": [
[{"x": 1.25}, "0,1", "0,2", "0,3", "0,4"],
[{"x": 1.25}, "1,1", "1,2", "1,3", "1,4"],
[{"x": 1.25}, "2,1", "2,2", "2,3", "2,4"],
["3,0", {"x": 0.25}, "3,1", "3,2", "3,3", "3,4"]
]
}
}
47 changes: 47 additions & 0 deletions VIA Source Code/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
Copyright 2020 imchipwood
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"

/* USB Device descriptor parameter */
#define VENDOR_ID 0xA153 // machineabuse
#define PRODUCT_ID 0xF3BE // autogenerated
#define DEVICE_VER 0x0010
#define MANUFACTURER imchipwood
#define PRODUCT DumbPad V1.1
#define DESCRIPTION DumbPad V1.1

/* Column/Row IO definitions */
#define MATRIX_ROWS 4
#define MATRIX_COLS 5
#define MATRIX_ROW_PINS { F4, F5, F6, F7 }
#define MATRIX_COL_PINS { C6, D7, E6, B4, B5 }
#define UNUSED_PINS

/* Single rotary encoder */
#define ENCODERS_PAD_A { B2 }
#define ENCODERS_PAD_B { D4 }

/* Onboard LEDs */
#define LED_00 B6
#define LED_01 B1
#define LED_02 B3

/* Bootmagic - hold down rotary encoder pushbutton while plugging in to enter bootloader */
#define BOOTMAGIC_LITE_ROW 3
#define BOOTMAGIC_LITE_COLUMN 0
96 changes: 96 additions & 0 deletions VIA Source Code/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/* Copyright 2020 imchipwood
*
* 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/>.
*/
#include QMK_KEYBOARD_H

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT(
KC_BSPC, KC_P7, KC_P8, KC_P9,
KC_TAB, KC_P4, KC_P5, KC_P6,
KC_NLCK, KC_P1, KC_P2, KC_P3,
KC_MUTE, KC_CALC, RSFT_T(KC_KP_DOT), KC_P0, LT(1,KC_ENT)
),
[1] = LAYOUT(
KC_PGUP, KC_HOME, KC_UP, KC_END,
KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT,
KC_PMNS, KC_PPLS, KC_PSLS, KC_PAST,
KC_MSTP, TO(2), TO(3), KC_MPLY, KC_TRNS
),
[2] = LAYOUT(
KC_F21, KC_F22, KC_F23, KC_F24,
KC_F17, KC_F18, KC_F19, KC_F20,
KC_F13, KC_F14, KC_F15, KC_F16,
TO(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
),
[3] = LAYOUT(
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
TO(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
),
};

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
// If console is enabled, it will print the matrix position and status of each key pressed
/*
#ifdef CONSOLE_ENABLE
uprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed);
#endif
*/
return true;
}

void keyboard_post_init_user(void) {
// Customise these values to desired behaviour
//debug_enable = true;
//debug_matrix = true;
//debug_keyboard = true;
//debug_mouse = true;
}

bool encoder_update_user(uint8_t index, bool clockwise) {
/* Custom encoder control - handles CW/CCW turning of encoder
* Default behavior:
* main layer:
* CW: Volume Up
* CCW: Volume Down
* other layers:
* CW: = (Right Arrow to scrub media backwards)
* CCW: - (Left Arrow to scrub media forwards)
* Both Axis on my unit appear to have been flipped from the original defaults.
*/
if (index == 0) {
switch (get_highest_layer(layer_state)) {
case 0:
// main layer - Volume Up and Down
if (clockwise) {
tap_code(KC_VOLD);
} else {
tap_code(KC_VOLU);
}
break;

default:
// other layers - left and right arrows for scrubbing media
if (clockwise) {
tap_code(KC_LEFT);
} else {
tap_code(KC_RGHT);
}
break;
}
}
return true;
}
27 changes: 27 additions & 0 deletions VIA Source Code/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# MCU name
MCU = atmega32u4

# Bootloader selection
BOOTLOADER = caterina

# Build Options
# change yes to no to disable
#
VIA_ENABLE = yes # Enable VIA compatibility
LTO_ENABLE = yes # Enable Link Time Optimization
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
MOUSEKEY_ENABLE = yes # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = yes # Console for debug
COMMAND_ENABLE = no # Commands for debug and configuration
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
NKRO_ENABLE = no # USB Nkey Rollover
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
BLUETOOTH_ENABLE = no # Enable Bluetooth
AUDIO_ENABLE = no # Audio output

ENCODER_ENABLE = yes
KEY_LOCK_ENABLE = yes

0 comments on commit f9e5196

Please sign in to comment.