Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for bigknob #11291

Merged
merged 9 commits into from
Jan 6, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 5 additions & 0 deletions keyboards/leafcutterlabs/bigknob/bigknob.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "bigknob.h"
LeafCutterLabs marked this conversation as resolved.
Show resolved Hide resolved

void matrix_init_kb(void) {
matrix_init_user();
}
LeafCutterLabs marked this conversation as resolved.
Show resolved Hide resolved
11 changes: 11 additions & 0 deletions keyboards/leafcutterlabs/bigknob/bigknob.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#pragma once
LeafCutterLabs marked this conversation as resolved.
Show resolved Hide resolved

#include "quantum.h"

#define LAYOUT_ortho_1x5( \
k01, k02, k03, k04, k05\
) { \
{ k01, k02, k03, k04, k05 } \
}

#define LAYOUT LAYOUT_ortho_1x5
63 changes: 63 additions & 0 deletions keyboards/leafcutterlabs/bigknob/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>

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 0xCEEB
#define PRODUCT_ID 0x0007
#define DEVICE_VER 0x0001
#define MANUFACTURER leafcutterlabs
#define PRODUCT bigKNOB
#define DESCRIPTION 5 key with rotary encoder board

LeafCutterLabs marked this conversation as resolved.
Show resolved Hide resolved
/* key matrix size */
#define MATRIX_ROWS 1
#define MATRIX_COLS 5

/*
* 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
*
*/

// Srating with closest to USB port
#define DIRECT_PINS { \
{ B7, D4, D6, F6, F7} \
}
//speed for double tap
#define TAPPING_TERM 300

LeafCutterLabs marked this conversation as resolved.
Show resolved Hide resolved
#define UNUSED_PINS

/* rotary encoder 1,2,3 closest to usb port is 0*/
#define ENCODERS_PAD_A { D0}
#define ENCODERS_PAD_B { D2}
#define ENCODER_RESOLUTION 8 //default/suggested
LeafCutterLabs marked this conversation as resolved.
Show resolved Hide resolved

/* ws2812 RGB LED */
#define RGB_DI_PIN C7 //D3 - underglow C7 - backlight
#define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 5 // Number of LEDs
12 changes: 12 additions & 0 deletions keyboards/leafcutterlabs/bigknob/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"keyboard_name": "bigknob",
"url": "",
"maintainer": "qmk",
"width": 5,
"height": 1,
"layouts": {
"LAYOUT_ortho_1x5": {
"layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}]
}
}
}
40 changes: 40 additions & 0 deletions keyboards/leafcutterlabs/bigknob/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#include QMK_KEYBOARD_H
LeafCutterLabs marked this conversation as resolved.
Show resolved Hide resolved

#define _MAIN 0

void encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) {
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
}
}

enum {
TD_RGB = 0
};

void dance_rgb_finished (qk_tap_dance_state_t *state, void *user_data) {
if (state->count == 1) {
register_code (KC_MEDIA_NEXT_TRACK);
unregister_code (KC_MEDIA_NEXT_TRACK);
LeafCutterLabs marked this conversation as resolved.
Show resolved Hide resolved
} else if (state->count == 2) {
rgblight_toggle();
} else if (state->count == 3) {
rgblight_step();
}
}

//All tap dance functions would go here. Only showing this one.
qk_tap_dance_action_t tap_dance_actions[] = {
[TD_RGB] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_rgb_finished, NULL)
};

//
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //buttion closest to usb is first
[_MAIN] = LAYOUT(
KC_MUTE, KC_MEDIA_PREV_TRACK, KC_MEDIA_PLAY_PAUSE, KC_MEDIA_STOP, TD(TD_RGB)
)
};
15 changes: 15 additions & 0 deletions keyboards/leafcutterlabs/bigknob/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# bigknob

A 4 key Macropad with Rotatry Encoder based on Atmega32u4.
LeafCutterLabs marked this conversation as resolved.
Show resolved Hide resolved

![](https://github.com/LeafCutterLabs/bigKNOB/blob/master/Media/thinkpad.jpg)
LeafCutterLabs marked this conversation as resolved.
Show resolved Hide resolved

* Keyboard Maintainer: [LeafCutterLabs](https://github.com/LeafCutterLabs)
* Hardware Supported: Atmega32u4
* Hardware availability: Case files are available [here](https://github.com/LeafCutterLabs/bigKNOB)

Make example for this keyboard (after setting up your build environment):

make bigknob:default
LeafCutterLabs marked this conversation as resolved.
Show resolved Hide resolved

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).
27 changes: 27 additions & 0 deletions keyboards/leafcutterlabs/bigknob/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 to "no" to disable the options, or define them in the Makefile in
# the appropriate keymap folder that will get included automatically
#
ENCODER_ENABLE = yes #enable rotary encoders
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
MOUSEKEY_ENABLE = yes # 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 # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = no # Audio output on port C6
UNICODE_ENABLE = yes # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
TAP_DANCE_ENABLE = yes # Double press does something different

# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
LeafCutterLabs marked this conversation as resolved.
Show resolved Hide resolved