Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
816f2f9cc2 | ||
|
|
666623d39a | ||
|
|
0eabb01e27 | ||
|
|
b664db3cf3 | ||
|
|
a5ecd4eb87 | ||
|
|
f3f444c1df | ||
|
|
81c51ec51c | ||
|
|
b5a12fa6d3 | ||
|
|
29c82cfb33 | ||
|
|
2cd684f8e0 | ||
|
|
c4d05010cb | ||
|
|
6276f54752 |
No files matched your search
@@ -0,0 +1,48 @@
|
|||||||
|
/* Copyright 2021 Leon Anavi <[email protected]>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
|
||||||
|
enum custom_keycodes {
|
||||||
|
GITCOMMIT = SAFE_RANGE,
|
||||||
|
GITPUSH
|
||||||
|
};
|
||||||
|
|
||||||
|
void keyboard_post_init_user(void) {
|
||||||
|
// Set backlight to the maximum brightness
|
||||||
|
backlight_level(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
switch (keycode) {
|
||||||
|
case GITCOMMIT:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("git commit -s\n");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case GITPUSH:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("git push\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = LAYOUT(
|
||||||
|
GITCOMMIT, GITPUSH
|
||||||
|
)
|
||||||
|
};
|
||||||
@@ -39,4 +39,15 @@ led_config_t g_led_config = {
|
|||||||
2, 2, 2, 2, 2, 2
|
2, 2, 2, 2, 2, 2
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
void suspend_power_down_kb(void) {
|
||||||
|
rgb_matrix_set_suspend_state(true);
|
||||||
|
suspend_power_down_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
void suspend_wakeup_init_kb(void) {
|
||||||
|
rgb_matrix_set_suspend_state(false);
|
||||||
|
suspend_wakeup_init_user();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -50,3 +50,6 @@
|
|||||||
#ifdef RGB_DI_PIN
|
#ifdef RGB_DI_PIN
|
||||||
#define RGB_MATRIX_KEYPRESSES // reacts to keypresses
|
#define RGB_MATRIX_KEYPRESSES // reacts to keypresses
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef RGB_MATRIX_ENABLE
|
||||||
|
# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended
|
||||||
|
#endif
|
||||||
+12
-27
@@ -26,34 +26,19 @@ led_config_t g_led_config = { {
|
|||||||
{ 58, 59, 60, NO_LED, NO_LED, NO_LED, 61, NO_LED, NO_LED, 62, 63, 64, 65, 66, 67 }
|
{ 58, 59, 60, NO_LED, NO_LED, NO_LED, 61, NO_LED, NO_LED, 62, 63, 64, 65, 66, 67 }
|
||||||
}, {
|
}, {
|
||||||
// LED Index to Physical Position
|
// LED Index to Physical Position
|
||||||
//I have no idea how to calculate this based on a templete, nor do have a good enough ruler to measure this.
|
{ 0, 0}, { 15, 0}, { 30, 0}, { 45, 0}, { 60, 0}, { 75, 0}, { 90, 0}, {105, 0}, {120, 0}, {135, 0}, {150, 0}, {165, 0}, {180, 0}, {202, 0}, {225, 0}, // Esc, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, -, =, Backspace, Delete
|
||||||
// Esc, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, -, =, Backspace, Delete
|
{ 4, 16}, { 22, 16}, { 37, 16}, { 52, 16}, { 67, 16}, { 82, 16}, { 97, 16}, {112, 16}, {127, 16}, {142, 16}, {157, 16}, {172, 16}, {187, 16}, {206, 16}, {225, 16}, // Tab, Q, W, E, R, T, Y, U, I, O, P, [, ], backslash , Home
|
||||||
{ 0, 0 }, { 15, 0 }, { 30, 0 }, { 45, 0 }, { 60, 0 }, { 75, 0 }, { 90, 0 }, { 105, 0 }, { 120, 0 }, { 135, 0 }, { 150, 0 }, { 165, 0 }, { 180, 0 }, { 202, 0 }, { 225, 0 },
|
{ 6, 32}, { 26, 32}, { 41, 32}, { 56, 32}, { 71, 32}, { 86, 32}, {101, 32}, {116, 32}, {131, 32}, {146, 32}, {161, 32}, {176, 32}, {201, 32}, {225, 32}, // Capslock, A, S, D, F, G, H, J, K, L, ;, ', Enter, Page up
|
||||||
// Tab, Q, W, E, R, T, Y, U, I, O, P, [, ], backslash , Home
|
{ 9, 48}, { 34, 48}, { 49, 48}, { 64, 48}, { 79, 48}, { 94, 48}, {109, 48}, {124, 48}, {139, 48}, {154, 48}, {169, 48}, {189, 48}, { 10, 48}, {225, 48}, // LShift, Z, X, C, V, B, N, M, ,, ., /, Shift, Up, Page Down
|
||||||
{ 4, 16 }, { 22, 16 }, { 37, 16 }, { 52, 16 }, { 67, 16 }, { 82, 16 }, { 97, 16 }, { 112, 16 }, { 127, 16 }, { 142, 16 }, { 157, 16 }, { 172, 16 }, { 187, 16 }, { 206, 16 }, { 225, 16 },
|
{ 2, 64}, { 21, 64}, { 39, 64}, { 94, 64}, {148, 64}, {163, 64}, {178, 64}, {193, 64}, {208, 64}, {225, 64}, // Ctrl, GUI, Alt, Space, RAlt, FN, Ctrl, Left, Down, Right
|
||||||
// Capslock, A, S, D, F, G, H, J, K, L, ;, ', Enter, Page up
|
{185, 45}, {160, 45}, {125, 45}, { 95, 45}, { 60, 45}, { 25, 45} // UNDERGLOW
|
||||||
{ 6, 32 }, { 26, 32 }, { 41, 32 }, { 56, 32 }, { 71, 32 }, { 86, 32 }, { 101, 32 }, { 116, 32 }, { 131, 32 }, { 146, 32 }, { 161, 32 }, { 176, 32 }, { 201, 32 }, { 225, 32 },
|
|
||||||
// LShift, Z, X, C, V, B, N, M, ,, ., /, Shift, Up, Page Down
|
|
||||||
{ 9, 48 }, { 34, 48 }, { 49, 48 }, { 64, 48 }, { 79, 48 }, { 94, 48 }, { 109, 48 }, { 124, 48 }, { 139, 48 }, { 154, 48 }, { 169, 48 }, { 189, 48 }, { 210, 48 }, { 225, 48 },
|
|
||||||
// Ctrl, GUI, Alt, Space, RAlt, FN, Ctrl, Left, Down, Right
|
|
||||||
{ 2, 64 }, { 21, 64 }, { 39, 64 }, { 94, 64 }, { 148, 64 }, { 163, 64 }, { 178, 64 }, { 193, 64 }, { 208, 64 }, { 225, 64 },
|
|
||||||
// UNDERGLOW
|
|
||||||
{ 185, 45 }, { 160, 45 }, { 125, 45 }, { 95, 45 }, { 60, 45 }, { 25, 45 }
|
|
||||||
}, {
|
}, {
|
||||||
// LED Index to Flag
|
// LED Index to Flag
|
||||||
//need to recheck what should be a modifier
|
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, // Esc, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, -, =, Backspace, Delete
|
||||||
|
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, // Tab, Q, W, E, R, T, Y, U, I, O, P, [, ], backslash , Home
|
||||||
// Esc, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, -, =, Backspace, Delete
|
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, // Capslock, A, S, D, F, G, H, J, K, L, ;, ', Enter, Page up
|
||||||
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1,
|
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, // LShift, Z, X, C, V, B, N, M, ,, ., /, Shift, Up, Page Down
|
||||||
// Tab, Q, W, E, R, T, Y, U, I, O, P, [, ], backslash , Home
|
1, 1, 1, 4, 1, 1, 1, 1, 1, 1, // Ctrl, GUI, Alt, Space, RAlt, FN, Ctrl, Left, Down, Right
|
||||||
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1,
|
2, 2, 2, 2, 2, 2 // UNDERGLOW
|
||||||
// Capslock, A, S, D, F, G, H, J, K, L, ;, ', Enter, Page up
|
|
||||||
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1,
|
|
||||||
// LShift, Z, X, C, V, B, N, M, ,, ., /, Shift, Up, Page Down
|
|
||||||
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1,
|
|
||||||
// Ctrl, GUI, Alt, Space, RAlt, FN, Ctrl, Left, Down, Right
|
|
||||||
1, 1, 1, 4, 1, 1, 1, 1, 1, 1,
|
|
||||||
// UNDERGLOW
|
|
||||||
2, 2, 2, 2, 2, 2
|
|
||||||
} };
|
} };
|
||||||
#endif
|
#endif
|
||||||
@@ -56,30 +56,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
// The number of LEDs connected
|
// The number of LEDs connected
|
||||||
#define DRIVER_LED_TOTAL 74
|
#define DRIVER_LED_TOTAL 74
|
||||||
#ifdef RGB_DI_PIN
|
#ifdef RGB_DI_PIN
|
||||||
#define RGBLED_NUM 74
|
#define RGBLED_NUM 74
|
||||||
//# define RGBLIGHT_HUE_STEP 8
|
#define RGB_MATRIX_KEYPRESSES // reacts to keypresses
|
||||||
//# define RGBLIGHT_SAT_STEP 8
|
|
||||||
//# define RGBLIGHT_VAL_STEP 8
|
|
||||||
//# define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
|
|
||||||
//# define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
|
|
||||||
/*== all animations enable ==*/
|
|
||||||
//# define RGBLIGHT_ANIMATIONS
|
|
||||||
/*== or choose animations ==*/
|
|
||||||
//# 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
|
|
||||||
/*== customize breathing effect ==*/
|
|
||||||
/*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/
|
|
||||||
//# define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64
|
|
||||||
/*==== use exp() and sin() ====*/
|
|
||||||
//# define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7
|
|
||||||
//# define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Templete
|
Template
|
||||||
[ ] = LAYOUT_65_ansi(
|
[ ] = LAYOUT_65_ansi(
|
||||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ BOOTLOADER = atmel-dfu
|
|||||||
# Build Options
|
# Build Options
|
||||||
# change yes to no to disable
|
# change yes to no to disable
|
||||||
#
|
#
|
||||||
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
|
BOOTMAGIC_ENABLE = full # Virtual DIP switch configuration
|
||||||
MOUSEKEY_ENABLE = yes # Mouse keys
|
MOUSEKEY_ENABLE = yes # Mouse keys
|
||||||
EXTRAKEY_ENABLE = yes # Audio control and System control
|
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||||
CONSOLE_ENABLE = no # Console for debug
|
CONSOLE_ENABLE = no # Console for debug
|
||||||
@@ -22,6 +22,6 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth
|
|||||||
AUDIO_ENABLE = no # Audio output
|
AUDIO_ENABLE = no # Audio output
|
||||||
RGB_MATRIX_ENABLE = yes
|
RGB_MATRIX_ENABLE = yes
|
||||||
RGB_MATRIX_DRIVER = WS2812
|
RGB_MATRIX_DRIVER = WS2812
|
||||||
#LTO_ENABLE = yes
|
LTO_ENABLE = yes
|
||||||
|
|
||||||
LAYOUTS = 65_ansi
|
LAYOUTS = 65_ansi
|
||||||
@@ -58,6 +58,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#ifdef RGB_MATRIX_ENABLE
|
#ifdef RGB_MATRIX_ENABLE
|
||||||
#define DRIVER_LED_TOTAL 24 // Number of LEDs
|
#define DRIVER_LED_TOTAL 24 // Number of LEDs
|
||||||
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200
|
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200
|
||||||
|
#define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -35,4 +35,15 @@ led_config_t g_led_config = { {
|
|||||||
LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL,
|
LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL,
|
||||||
LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL
|
LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL
|
||||||
} };
|
} };
|
||||||
|
|
||||||
|
|
||||||
|
void suspend_power_down_kb(void) {
|
||||||
|
rgb_matrix_set_suspend_state(true);
|
||||||
|
suspend_power_down_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
void suspend_wakeup_init_kb(void) {
|
||||||
|
rgb_matrix_set_suspend_state(false);
|
||||||
|
suspend_wakeup_init_user();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -29,7 +29,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
*/
|
*/
|
||||||
#define MATRIX_ROW_PINS { C5, C4, B6, B7, C7 }
|
#define MATRIX_ROW_PINS { C5, C4, B6, B7, C7 }
|
||||||
#define MATRIX_ROW_PINS_RIGHT { D3, D2, D5, D6, B0 }
|
#define MATRIX_ROW_PINS_RIGHT { D3, D2, D5, D6, B0 }
|
||||||
#define MATRIX_COL_PINS { C6, B4, B3, B2, B1, B0 }
|
/* The last three NO_PIN are dummies to make the same size as MATRIX_ROW_PINS_RIGHT. */
|
||||||
|
#define MATRIX_COL_PINS { C6, B4, B3, B2, B1, B0, NO_PIN, NO_PIN, NO_PIN }
|
||||||
#define MATRIX_COL_PINS_RIGHT { C7, B7, B6, B5, B4, B3, B2, C6, D4 }
|
#define MATRIX_COL_PINS_RIGHT { C7, B7, B6, B5, B4, B3, B2, C6, D4 }
|
||||||
#define UNUSED_PINS
|
#define UNUSED_PINS
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,112 @@
|
|||||||
|
/*Copyright 2021 Blake Drayson / Draytronics
|
||||||
|
|
||||||
|
Contact [email protected]
|
||||||
|
|
||||||
|
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"
|
||||||
|
|
||||||
|
#define VENDOR_ID 0x4454 //DT for DrayTronics
|
||||||
|
#define PRODUCT_ID 0x4441 //DA for Daisy
|
||||||
|
#define DEVICE_VER 0x0100 //Version 1
|
||||||
|
#define MANUFACTURER Draytronics
|
||||||
|
#define PRODUCT DAISY
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
#define MATRIX_ROWS 3
|
||||||
|
#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)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define MATRIX_ROW_PINS { B0, C0, C1}
|
||||||
|
#define MATRIX_COL_PINS { C2, C3, C4, C5 }
|
||||||
|
#define UNUSED_PINS
|
||||||
|
|
||||||
|
#define ENCODERS_PAD_A { B1, D0 }
|
||||||
|
#define ENCODERS_PAD_B { B2, D1 }
|
||||||
|
/* COL2ROW, ROW2COL*/
|
||||||
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
#define TAP_CODE_DELAY 10
|
||||||
|
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||||
|
#define DEBOUNCE 5
|
||||||
|
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||||
|
//#define MATRIX_HAS_GHOST
|
||||||
|
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||||
|
#define LOCKING_SUPPORT_ENABLE
|
||||||
|
/* Locking resynchronize hack */
|
||||||
|
#define LOCKING_RESYNC_ENABLE
|
||||||
|
/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
|
||||||
|
* This is useful for the Windows task manager shortcut (ctrl+shift+esc).
|
||||||
|
*/
|
||||||
|
//#define GRAVE_ESC_CTRL_OVERRIDE
|
||||||
|
/*
|
||||||
|
* Force NKRO
|
||||||
|
*
|
||||||
|
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
|
||||||
|
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
|
||||||
|
* makefile for this to work.)
|
||||||
|
*
|
||||||
|
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
|
||||||
|
* until the next keyboard reset.
|
||||||
|
*
|
||||||
|
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
|
||||||
|
* fully operational during normal computer usage.
|
||||||
|
*
|
||||||
|
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
|
||||||
|
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
|
||||||
|
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
|
||||||
|
* power-up.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
//#define FORCE_NKRO
|
||||||
|
/*
|
||||||
|
* Feature disable options
|
||||||
|
* These options are also useful to firmware size reduction.
|
||||||
|
*/
|
||||||
|
/* disable debug print */
|
||||||
|
//#define NO_DEBUG
|
||||||
|
/* disable print */
|
||||||
|
//#define NO_PRINT
|
||||||
|
/* disable action features */
|
||||||
|
//#define NO_ACTION_LAYER
|
||||||
|
//#define NO_ACTION_TAPPING
|
||||||
|
//#define NO_ACTION_ONESHOT
|
||||||
|
/* disable these deprecated features by default */
|
||||||
|
#define NO_ACTION_MACRO
|
||||||
|
#define NO_ACTION_FUNCTION
|
||||||
|
|
||||||
|
//Underglow
|
||||||
|
#define RGB_DI_PIN D4 // Underglow led pin
|
||||||
|
#ifdef RGB_DI_PIN
|
||||||
|
#define RGBLED_NUM 4
|
||||||
|
#define RGBLIGHT_HUE_STEP 8
|
||||||
|
#define RGBLIGHT_SAT_STEP 8
|
||||||
|
#define RGBLIGHT_VAL_STEP 8
|
||||||
|
#define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
|
||||||
|
#define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
|
||||||
|
/*== all animations enable ==*/
|
||||||
|
#define RGBLIGHT_ANIMATIONS
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
/*Copyright 2021 Blake Drayson / Draytronics
|
||||||
|
|
||||||
|
Contact [email protected]
|
||||||
|
|
||||||
|
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 "daisy.h"
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
/*Copyright 2021 Blake Drayson / Draytronics
|
||||||
|
|
||||||
|
Contact [email protected]
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
#define _x_ KC_NO
|
||||||
|
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
#define LAYOUT_daisy( \
|
||||||
|
K00, K03, \
|
||||||
|
K10, K11, K12, K13, \
|
||||||
|
K20, K21, K22, K23 \
|
||||||
|
) { \
|
||||||
|
{ K00, _x_, _x_, K03, }, \
|
||||||
|
{ K10, K11, K12, K13, }, \
|
||||||
|
{ K20, K21, K22, K23, }, \
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"keyboard_name": "Draytronics DAISY",
|
||||||
|
"url": "https://www.draytronics.co.uk/daisy",
|
||||||
|
"maintainer": "ghostseven",
|
||||||
|
"width": 4,
|
||||||
|
"height": 3,
|
||||||
|
"layouts": {
|
||||||
|
"LAYOUT": {
|
||||||
|
"layout": [
|
||||||
|
{"label":"", "x":0, "y":0},
|
||||||
|
{"label":"", "x":3, "y":0},
|
||||||
|
|
||||||
|
{"label":"", "x":0, "y":1},
|
||||||
|
{"label":"", "x":1, "y":1},
|
||||||
|
{"label":"", "x":2, "y":1},
|
||||||
|
{"label":"", "x":3, "y":1},
|
||||||
|
|
||||||
|
{"label":"", "x":0, "y":2},
|
||||||
|
{"label":"", "x":1, "y":2},
|
||||||
|
{"label":"", "x":2, "y":2},
|
||||||
|
{"label":"", "x":3, "y":1, "h":2}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
/*Copyright 2021 Blake Drayson / Draytronics
|
||||||
|
|
||||||
|
Contact [email protected]
|
||||||
|
|
||||||
|
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
|
||||||
|
#define _BASE 0 // Base layer
|
||||||
|
#define _CODE 1 // Code layer
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[_BASE] = LAYOUT_daisy(
|
||||||
|
KC_MUTE, KC_HOME,
|
||||||
|
MO(_CODE), KC_MPRV, KC_MNXT, KC_MPLY,
|
||||||
|
C(KC_LEFT), C(KC_UP), C(KC_DOWN), C(KC_RIGHT)
|
||||||
|
),
|
||||||
|
[_CODE] = LAYOUT_daisy(
|
||||||
|
KC_MUTE, KC_END,
|
||||||
|
_______, RGB_MOD, RGB_VAI, RGB_TOG,
|
||||||
|
G(S(KC_5)), G(A(KC_ESC)), G(KC_F), RESET
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
void encoder_update_user(uint8_t index, bool clockwise) {
|
||||||
|
if (index == 0) {
|
||||||
|
if (clockwise) {
|
||||||
|
tap_code(KC_VOLD);
|
||||||
|
} else {
|
||||||
|
tap_code(KC_VOLU);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (index == 1) {
|
||||||
|
if (clockwise) {
|
||||||
|
tap_code(KC_PGUP);
|
||||||
|
} else {
|
||||||
|
tap_code(KC_PGDN);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
# DAISY
|
||||||
|

|
||||||
|
|
||||||
|
An open source macro pad with rotary encoders and under glow, designed to be easily built with (mostly) through hole components. More info / kits / PCB designs available at [draytronics.co.uk/daisy](https://www.draytronics.co.uk/daisy)
|
||||||
|
|
||||||
|
* Keyboard Maintainer: [Blake Drayson](https://github.com/ghostseven)
|
||||||
|
* Hardware Supported: DAISY PCB / ATMega328P
|
||||||
|
* Hardware Availability: [draytronics.co.uk](https://draytronics.co.uk)
|
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
make draytronics/daisy:default
|
||||||
|
|
||||||
|
Flashing example for this keyboard:
|
||||||
|
|
||||||
|
make draytronics/daisy:default:flash
|
||||||
|
|
||||||
|
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).
|
||||||
|
|
||||||
|
VIA design config file avaliable [here](https://www.draytronics.co.uk/f_daisy/draytronics_daisy_via_config.json)
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# MCU name
|
||||||
|
MCU = atmega328p
|
||||||
|
|
||||||
|
# Bootloader selection
|
||||||
|
BOOTLOADER = USBasp
|
||||||
|
|
||||||
|
# Build Options
|
||||||
|
# change yes to no to disable
|
||||||
|
#
|
||||||
|
BOOTMAGIC_ENABLE = lite # 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
|
||||||
|
# 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 = yes # Enable keyboard RGB underglow
|
||||||
|
BLUETOOTH_ENABLE = no # Enable Bluetooth
|
||||||
|
AUDIO_ENABLE = no # Audio output
|
||||||
|
ENCODER_ENABLE = yes # Rotary encoder support
|
||||||
@@ -2,11 +2,11 @@
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
A open source 17 key numpad keyboard, designed to be easily built at home with through hole components. More info / kits / PCB designs available at [draytronics.co.uk/scarlet](draytronics.co.uk)
|
A open source 17 key numpad keyboard, designed to be easily built at home with through hole components. More info / kits / PCB designs available at [draytronics.co.uk/scarlet](https://draytronics.co.uk)
|
||||||
|
|
||||||
* Keyboard Maintainer: [Blake Drayson](https://github.com/ghostseven)
|
* Keyboard Maintainer: [Blake Drayson](https://github.com/ghostseven)
|
||||||
* Hardware Supported: SCARLET PCB / ATMega32A
|
* Hardware Supported: SCARLET PCB / ATMega32A
|
||||||
* Hardware Availability: [draytronics.co.uk](draytronics.co.uk)
|
* Hardware Availability: [draytronics.co.uk](https://draytronics.co.uk)
|
||||||
|
|
||||||
Make example for this keyboard (after setting up your build environment):
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,9 @@
|
|||||||
#include <print.h>
|
#include <print.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__)
|
||||||
|
#define kc5(a,b,c,d,e) KC_##a, KC_##b, KC_##c, KC_##d, KC_##e
|
||||||
|
|
||||||
extern keymap_config_t keymap_config;
|
extern keymap_config_t keymap_config;
|
||||||
|
|
||||||
#ifdef RGBLIGHT_ENABLE
|
#ifdef RGBLIGHT_ENABLE
|
||||||
@@ -46,43 +49,33 @@ enum custom_keycodes {
|
|||||||
EUCALYN,
|
EUCALYN,
|
||||||
NUML,
|
NUML,
|
||||||
NUMR,
|
NUMR,
|
||||||
KC_xEISU,
|
xEISU,
|
||||||
KC_xKANA,
|
xKANA,
|
||||||
KC_ZERO2,
|
ZERO2,
|
||||||
RGBRST
|
RGBRST
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
|
|
||||||
//Macros
|
//Macros
|
||||||
#define KC_LOWER MO(_LOWER)
|
#define LT_NUML_SP LT(_NUML,KC_SPC)
|
||||||
#define KC_NUML LT(_NUML,KC_SPC)
|
#define LT_NUMR_SP LT(_NUMR,KC_SPC)
|
||||||
#define KC_NUMR LT(_NUMR,KC_SPC)
|
#define LT_RA_BSPC LT(_RAISE,KC_BSPC)
|
||||||
#define KC_RABS LT(_RAISE,KC_BSPC)
|
#define LT_RA_ENT LT(_RAISE,KC_ENT)
|
||||||
#define KC_RAEN LT(_RAISE,KC_ENT)
|
|
||||||
#define KC_____ _______
|
|
||||||
#define KC_XXXX XXXXXXX
|
|
||||||
#define KC_ADJ MO(_ADJUST)
|
|
||||||
#define KC_LSMI LSFT(KC_MINS)
|
|
||||||
#define KC_LSEQ LSFT(KC_EQL)
|
|
||||||
#define KC_LSRB LSFT(KC_RBRC)
|
|
||||||
#define KC_LSLB LSFT(KC_LBRC)
|
|
||||||
#define KC_LSGR LSFT(KC_GRV)
|
|
||||||
#define KC_LSQT LSFT(KC_QUOT)
|
|
||||||
#define ___ _______
|
#define ___ _______
|
||||||
#define KC_S0 LSFT(KC_0)
|
|
||||||
#define KC_S1 LSFT(KC_1)
|
|
||||||
#define KC_S2 LSFT(KC_2)
|
|
||||||
#define KC_S3 LSFT(KC_3)
|
|
||||||
#define KC_S4 LSFT(KC_4)
|
|
||||||
#define KC_S5 LSFT(KC_5)
|
|
||||||
#define KC_S6 LSFT(KC_6)
|
|
||||||
#define KC_S7 LSFT(KC_7)
|
|
||||||
#define KC_S8 LSFT(KC_8)
|
|
||||||
#define KC_S9 LSFT(KC_9)
|
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
/* Qwerty
|
/* Qwerty */
|
||||||
* ,-----------------------------------------. ,-----------------------------------------.
|
#define Q_____W_____E_____R_____T kc5( Q, W, E, R, T )
|
||||||
|
#define Y_____U_____I_____O_____P kc5( Y, U, I, O, P )
|
||||||
|
#define A_____S_____D_____F_____G kc5( A, S, D, F, G )
|
||||||
|
#define H_____J_____K_____L__SCLN kc5( H, J, K, L, SCLN )
|
||||||
|
#define Z_____X_____C_____V_____B kc5( Z, X, C, V, B )
|
||||||
|
#define N_____M__COMM___DOT__SLSH kc5( N, M, COMM, DOT, SLSH )
|
||||||
|
#define LOWER___LOWER__CAPS__LALT__LGUI__NUML__RABS MO(_LOWER), MO(_LOWER), KC_CAPS, KC_LALT, KC_LGUI, LT_NUML_SP, LT_RA_BSPC
|
||||||
|
#define RAEN_NUMR__RGUI__RALT___APP_LOWER__LOWER LT_RA_ENT, LT_NUMR_SP, KC_RGUI, KC_RALT, KC_APP, MO(_LOWER), MO(_LOWER)
|
||||||
|
/* ,-----------------------------------------. ,-----------------------------------------.
|
||||||
* | ESC | Q | W | E | R | T | | Y | U | I | O | P | \ |
|
* | ESC | Q | W | E | R | T | | Y | U | I | O | P | \ |
|
||||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||||
* | Ctrl | A | S | D | F | G | | H | J | K | L | ; | Ctrl |
|
* | Ctrl | A | S | D | F | G | | H | J | K | L | ; | Ctrl |
|
||||||
@@ -92,15 +85,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
* |Lower | Lower| Caps | Alt | GUI | Space| BS | Enter| Space| GUI | Alt | Menu |Lower |Lower |
|
* |Lower | Lower| Caps | Alt | GUI | Space| BS | Enter| Space| GUI | Alt | Menu |Lower |Lower |
|
||||||
* `-------------------------------------------------------------------------------------------------'
|
* `-------------------------------------------------------------------------------------------------'
|
||||||
*/
|
*/
|
||||||
[_QWERTY] = LAYOUT_kc( \
|
[_QWERTY] = LAYOUT_wrapper(
|
||||||
ESC, Q, W, E, R, T, Y, U, I, O, P, BSLS, \
|
KC_ESC, Q_____W_____E_____R_____T, Y_____U_____I_____O_____P, KC_BSLS,
|
||||||
LCTL, A, S, D, F, G, H, J, K, L, SCLN, RCTL, \
|
KC_LCTL, A_____S_____D_____F_____G, H_____J_____K_____L__SCLN, KC_RCTL,
|
||||||
LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, \
|
KC_LSFT, Z_____X_____C_____V_____B, N_____M__COMM___DOT__SLSH, KC_RSFT,
|
||||||
LOWER,LOWER, CAPS, LALT, LGUI,NUML, RABS, RAEN,NUMR, RGUI, RALT, APP,LOWER, LOWER \
|
LOWER___LOWER__CAPS__LALT__LGUI__NUML__RABS, RAEN_NUMR__RGUI__RALT___APP_LOWER__LOWER
|
||||||
),
|
),
|
||||||
|
|
||||||
/* Colemak
|
/* Colemak */
|
||||||
* ,-----------------------------------------. ,-----------------------------------------.
|
#define Q_____W_____F_____P_____G kc5( Q, W, F, P, G )
|
||||||
|
#define J_____L_____U_____Y__SCLN kc5( J, L, U, Y, SCLN )
|
||||||
|
#define A_____R_____S_____T_____D kc5( A, R, S, T, D )
|
||||||
|
#define H_____N_____E_____I_____O kc5( H, N, E, I, O )
|
||||||
|
#define K_____M__COMM___DOT__SLSH kc5( K, M, COMM, DOT, SLSH )
|
||||||
|
/* ,-----------------------------------------. ,-----------------------------------------.
|
||||||
* | ESC | Q | W | F | P | G | | J | L | U | Y | ; | \ |
|
* | ESC | Q | W | F | P | G | | J | L | U | Y | ; | \ |
|
||||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||||
* | Ctrl | A | R | S | T | D | | H | N | E | I | O | Ctrl |
|
* | Ctrl | A | R | S | T | D | | H | N | E | I | O | Ctrl |
|
||||||
@@ -110,15 +108,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
* |Lower | Lower| Caps | Alt | GUI | Space| BS | Enter| Space| GUI | Alt | Menu |Lower |Lower |
|
* |Lower | Lower| Caps | Alt | GUI | Space| BS | Enter| Space| GUI | Alt | Menu |Lower |Lower |
|
||||||
* `-------------------------------------------------------------------------------------------------'
|
* `-------------------------------------------------------------------------------------------------'
|
||||||
*/
|
*/
|
||||||
[_COLEMAK] = LAYOUT_kc( \
|
[_COLEMAK] = LAYOUT_wrapper(
|
||||||
ESC, Q, W, F, P, G, J, L, U, Y, SCLN, BSLS, \
|
KC_ESC, Q_____W_____F_____P_____G, J_____L_____U_____Y__SCLN, KC_BSLS,
|
||||||
LCTL, A, R, S, T, D, H, N, E, I, O, RCTL, \
|
KC_LCTL, A_____R_____S_____T_____D, H_____N_____E_____I_____O, KC_RCTL,
|
||||||
LSFT, Z, X, C, V, B, K, M, COMM, DOT, SLSH, RSFT, \
|
KC_LSFT, Z_____X_____C_____V_____B, K_____M__COMM___DOT__SLSH, KC_RSFT,
|
||||||
LOWER,LOWER, CAPS, LALT, LGUI,NUML, RABS, RAEN,NUMR, RGUI, RALT, APP,LOWER, LOWER \
|
LOWER___LOWER__CAPS__LALT__LGUI__NUML__RABS, RAEN_NUMR__RGUI__RALT___APP_LOWER__LOWER
|
||||||
),
|
),
|
||||||
|
|
||||||
/* Dvorak
|
/* Dvorak */
|
||||||
* ,-----------------------------------------. ,-----------------------------------------.
|
#define QUOT__COMM___DOT_____P_____Y kc5( QUOT, COMM, DOT, P, Y )
|
||||||
|
#define F_____G_____C_____R_____L kc5( F, G, C, R, L )
|
||||||
|
#define A_____O_____E_____U_____I kc5( A, O, E, U, I )
|
||||||
|
#define D_____H_____T_____N_____S kc5( D, H, T, N, S )
|
||||||
|
#define SCLN_____Q_____J_____K_____X kc5( SCLN, Q, J, K, X )
|
||||||
|
#define B_____M_____W_____V_____Z kc5( B, M, W, V, Z )
|
||||||
|
/* ,-----------------------------------------. ,-----------------------------------------.
|
||||||
* | ESC | ' | , | . | P | Y | | F | G | C | R | L | \ |
|
* | ESC | ' | , | . | P | Y | | F | G | C | R | L | \ |
|
||||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||||
* | Ctrl | A | O | E | U | I | | D | H | T | N | S | Ctrl |
|
* | Ctrl | A | O | E | U | I | | D | H | T | N | S | Ctrl |
|
||||||
@@ -128,15 +132,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
* |Lower | Lower| Caps | Alt | GUI | Space| BS | Enter| Space| GUI | Alt | Menu |Lower |Lower |
|
* |Lower | Lower| Caps | Alt | GUI | Space| BS | Enter| Space| GUI | Alt | Menu |Lower |Lower |
|
||||||
* `-------------------------------------------------------------------------------------------------'
|
* `-------------------------------------------------------------------------------------------------'
|
||||||
*/
|
*/
|
||||||
[_DVORAK] = LAYOUT_kc( \
|
[_DVORAK] = LAYOUT_wrapper(
|
||||||
ESC, QUOT, COMM, DOT, P, Y, F, G, C, R, L, BSLS, \
|
KC_ESC, QUOT__COMM___DOT_____P_____Y, F_____G_____C_____R_____L, KC_BSLS,
|
||||||
LCTL, A, O, E, U, I, D, H, T, N, S, RCTL, \
|
KC_LCTL, A_____O_____E_____U_____I, D_____H_____T_____N_____S, KC_RCTL,
|
||||||
LSFT, SCLN, Q, J, K, X, B, M, W, V, Z, RSFT, \
|
KC_LSFT, SCLN_____Q_____J_____K_____X, B_____M_____W_____V_____Z, KC_RSFT,
|
||||||
LOWER,LOWER, CAPS, LALT, LGUI,NUML, RABS, RAEN,NUMR, RGUI, RALT, APP,LOWER, LOWER \
|
LOWER___LOWER__CAPS__LALT__LGUI__NUML__RABS, RAEN_NUMR__RGUI__RALT___APP_LOWER__LOWER
|
||||||
),
|
),
|
||||||
|
|
||||||
/* Eucalyn (http://eucalyn.hatenadiary.jp/entry/about-eucalyn-layout)
|
/* Eucalyn (http://eucalyn.hatenadiary.jp/entry/about-eucalyn-layout) */
|
||||||
* ,-----------------------------------------. ,-----------------------------------------.
|
#define Q_____W__COMM___DOT__SCLN kc5( Q, W, COMM, DOT, SCLN )
|
||||||
|
#define M_____R_____D_____Y_____P kc5( M, R, D, Y, P )
|
||||||
|
#define A_____O_____E_____I_____U kc5( A, O, E, I, U )
|
||||||
|
#define G_____T_____K_____S_____N kc5( G, T, K, S, N )
|
||||||
|
#define Z_____X_____C_____V_____F kc5( Z, X, C, V, F )
|
||||||
|
#define B_____H_____J_____L__SLSH kc5( B, H, J, L, SLSH )
|
||||||
|
/* ,-----------------------------------------. ,-----------------------------------------.
|
||||||
* | ESC | Q | W | , | . | ; | | M | R | D | Y | P | \ |
|
* | ESC | Q | W | , | . | ; | | M | R | D | Y | P | \ |
|
||||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||||
* | Ctrl | A | O | E | I | U | | G | T | K | S | N | Ctrl |
|
* | Ctrl | A | O | E | I | U | | G | T | K | S | N | Ctrl |
|
||||||
@@ -146,15 +156,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
* |Lower | Lower| Caps | Alt | GUI | Space| BS | Enter| Space| GUI | Alt | Menu |Lower |Lower |
|
* |Lower | Lower| Caps | Alt | GUI | Space| BS | Enter| Space| GUI | Alt | Menu |Lower |Lower |
|
||||||
* `-------------------------------------------------------------------------------------------------'
|
* `-------------------------------------------------------------------------------------------------'
|
||||||
*/
|
*/
|
||||||
[_EUCALYN] = LAYOUT_kc( \
|
[_EUCALYN] = LAYOUT_wrapper(
|
||||||
ESC, Q, W, COMM, DOT, SCLN, M, R, D, Y, P, BSLS, \
|
KC_ESC, Q_____W__COMM___DOT__SCLN, M_____R_____D_____Y_____P, KC_BSLS,
|
||||||
LCTL, A, O, E, I, U, G, T, K, S, N, RCTL, \
|
KC_LCTL, A_____O_____E_____I_____U, G_____T_____K_____S_____N, KC_RCTL,
|
||||||
LSFT, Z, X, C, V, F, B, H, J, L, SLSH, RSFT, \
|
KC_LSFT, Z_____X_____C_____V_____F, B_____H_____J_____L__SLSH, KC_RSFT,
|
||||||
LOWER,LOWER, CAPS, LALT, LGUI,NUML, RABS, RAEN,NUMR, RGUI, RALT, APP,LOWER, LOWER \
|
LOWER___LOWER__CAPS__LALT__LGUI__NUML__RABS, RAEN_NUMR__RGUI__RALT___APP_LOWER__LOWER
|
||||||
),
|
),
|
||||||
|
|
||||||
/* Num
|
/* Num */
|
||||||
* ,-----------------------------------------. ,-----------------------------------------.
|
#define EXLM__AT__HASH___DLR__PERC kc5( EXLM, AT, HASH, DLR, PERC )
|
||||||
|
#define CIRC_AMPR_ASTR__LPRN__RPRN kc5( CIRC, AMPR, ASTR, LPRN, RPRN )
|
||||||
|
#define _1_____2_____3_____4_____5 kc5( 1, 2, 3, 4, 5 )
|
||||||
|
#define _6_____7_____8_____9_____0 kc5( 6, 7, 8, 9, 0 )
|
||||||
|
#define F1____F2____F3____F4____F5 kc5( F1, F2, F3, F4, F5 )
|
||||||
|
#define F6____F7____F8____F9___F10 kc5( F6, F7, F8, F9, F10 )
|
||||||
|
#define ____z_____z_____z_____z _______, _______, _______, _______
|
||||||
|
#define ____z_____z_____z _______, _______, _______
|
||||||
|
#define ____z_____z _______, _______
|
||||||
|
/* ,-----------------------------------------. ,-----------------------------------------.
|
||||||
* | | ! | @ | # | $ | % | | ^ | & | * | ( | ) | |
|
* | | ! | @ | # | $ | % | | ^ | & | * | ( | ) | |
|
||||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||||
* | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | F12 |
|
* | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | F12 |
|
||||||
@@ -164,40 +183,53 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
* | | | | | | | | | | | | | | |
|
* | | | | | | | | | | | | | | |
|
||||||
* `-------------------------------------------------------------------------------------------------'
|
* `-------------------------------------------------------------------------------------------------'
|
||||||
*/
|
*/
|
||||||
[_NUML] = LAYOUT_kc( \
|
[_NUML] = LAYOUT_wrapper(
|
||||||
____, S1, S2, S3, S4, S5, S6, S7, S8, S9, S0, ____, \
|
_______, EXLM__AT__HASH___DLR__PERC, CIRC_AMPR_ASTR__LPRN__RPRN, _______,
|
||||||
____, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, F12, \
|
_______, _1_____2_____3_____4_____5, _6_____7_____8_____9_____0, KC_F12,
|
||||||
____, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, \
|
_______, F1____F2____F3____F4____F5, F6____F7____F8____F9___F10, KC_F11,
|
||||||
____, ____, ____, ____, ____, ____, ____, ____, SPC, ____, ____, ____, ____, ____ \
|
_______, ____z_____z_____z_____z,____z_____z_____z,KC_SPC, ____z_____z_____z_____z, _______
|
||||||
),
|
),
|
||||||
|
[_NUMR] = LAYOUT_wrapper(
|
||||||
[_NUMR] = LAYOUT_kc( \
|
_______, EXLM__AT__HASH___DLR__PERC, CIRC_AMPR_ASTR__LPRN__RPRN, _______,
|
||||||
____, S1, S2, S3, S4, S5, S6, S7, S8, S9, S0, ____, \
|
_______, _1_____2_____3_____4_____5, _6_____7_____8_____9_____0, KC_F12,
|
||||||
____, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, F12, \
|
_______, F1____F2____F3____F4____F5, F6____F7____F8____F9___F10, KC_F11,
|
||||||
____, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, \
|
_______, ____z_____z_____z_____z,KC_SPC, ____z_____z_____z,____z_____z_____z_____z, _______
|
||||||
____, ____, ____, ____, ____, SPC, ____, ____, ____, ____, ____, ____, ____, ____ \
|
),
|
||||||
),
|
/* Lower */
|
||||||
|
#define XXXX__PAUS__SLCK___INS__XXXX XXXXXXX, KC_PAUS, KC_SLCK, KC_INS, XXXXXXX
|
||||||
/* Lower
|
#define XXXX___INS__SLCK__PAUS__XXXX XXXXXXX, KC_INS, KC_SLCK, KC_PAUS, XXXXXXX
|
||||||
* ,-----------------------------------------. ,-----------------------------------------.
|
#define HOME__XXXX____UP___DEL__PGUP KC_HOME, XXXXXXX, KC_UP, KC_DEL, KC_PGUP
|
||||||
|
#define PGUP___DEL____UP__XXXX__HOME KC_PGUP, KC_DEL, KC_UP, XXXXXXX, KC_HOME
|
||||||
|
#define END___LEFT__DOWN__RGHT__PGDN kc5( END, LEFT, DOWN, RGHT, PGDN )
|
||||||
|
#define PGDN__LEFT__DOWN__RGHT___END kc5( PGDN, LEFT, DOWN, RGHT, END )
|
||||||
|
#define ______PSCR__________________ _______, KC_PSCR, _______, _______, _______
|
||||||
|
#define __________________PSCR______ _______, _______, _______, KC_PSCR, _______
|
||||||
|
#define ADJ___ADJ MO(_ADJUST), MO(_ADJUST)
|
||||||
|
/* ,-----------------------------------------. ,-----------------------------------------.
|
||||||
* | | |Pause | ScrLk| Ins | | | | Ins | ScrLk|Pause | | |
|
* | | |Pause | ScrLk| Ins | | | | Ins | ScrLk|Pause | | |
|
||||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||||
* | | PgUp | | Up |Delete| Home | | Home |Delete| Up | | PgUp | |
|
* | | Home | | Up |Delete| PgUp | | PgUp |Delete| Up | | Home | |
|
||||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||||
* | | PgDn | Left | Down | Right| End | | End | Left | Down | Right| PgDn | |
|
* | | End | Left | Down | Right| PgDn | | PgDn | Left | Down | Right| End | |
|
||||||
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
|
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
* | | | PrtSc| | | |Adjust|Adjust| | | | PrtSc| | |
|
* | | | PrtSc| | | |Adjust|Adjust| | | | PrtSc| | |
|
||||||
* `-------------------------------------------------------------------------------------------------'
|
* `-------------------------------------------------------------------------------------------------'
|
||||||
*/
|
*/
|
||||||
[_LOWER] = LAYOUT_kc( \
|
[_LOWER] = LAYOUT_wrapper(
|
||||||
XXXX, XXXX, PAUS, SLCK, INS, XXXX, XXXX, INS, SLCK, PAUS, XXXX, ____, \
|
XXXXXXX, XXXX__PAUS__SLCK___INS__XXXX, XXXX___INS__SLCK__PAUS__XXXX, _______,
|
||||||
____, HOME, XXXX, UP, DEL, PGUP, PGUP, DEL, UP, XXXX, HOME, ____, \
|
_______, HOME__XXXX____UP___DEL__PGUP, PGUP___DEL____UP__XXXX__HOME, _______,
|
||||||
____, END, LEFT, DOWN, RGHT, PGDN, PGDN, LEFT, DOWN, RGHT, END, ____, \
|
_______, END___LEFT__DOWN__RGHT__PGDN, PGDN__LEFT__DOWN__RGHT___END, _______,
|
||||||
____, ____, PSCR, ____, ____, ____, ADJ, ADJ, ____, ____, ____, PSCR, ____, ____ \
|
_______, ______PSCR__________________, ADJ___ADJ, __________________PSCR______, _______
|
||||||
),
|
),
|
||||||
|
/* Raise */
|
||||||
/* Raise
|
#define XXXX__XXXX__XXXX__UNDS__MINS XXXXXXX, XXXXXXX, XXXXXXX, KC_UNDS, KC_MINS
|
||||||
* ,-----------------------------------------. ,-----------------------------------------.
|
#define EQL__PLUS__XXXX__XXXX__XXXX KC_EQL, KC_PLUS, XXXXXXX, XXXXXXX, XXXXXXX
|
||||||
|
#define XXXX__XXXX__XXXX__LCBR__LBRC XXXXXXX, XXXXXXX, XXXXXXX, KC_LCBR, KC_LBRC
|
||||||
|
#define RBRC__RCBR__XXXX__XXXX__XXXX KC_RBRC, KC_RCBR, XXXXXXX, XXXXXXX, XXXXXXX
|
||||||
|
#define XXXX__XXXX__XXXX__TILD___GRV XXXXXXX, XXXXXXX, XXXXXXX, KC_TILD, KC_GRV
|
||||||
|
#define QUOT___DQT__XXXX__XXXX__XXXX KC_QUOT, KC_DQT, XXXXXXX, XXXXXXX, XXXXXXX
|
||||||
|
#define XXXX______________XXXX XXXXXXX, _______, _______, XXXXXXX
|
||||||
|
/* ,-----------------------------------------. ,-----------------------------------------.
|
||||||
* | TAB | | | | _ | - | | = | + | | | | |
|
* | TAB | | | | _ | - | | = | + | | | | |
|
||||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||||
* | EISU | | | | { | [ | | ] | } | | | | KANA |
|
* | EISU | | | | { | [ | | ] | } | | | | KANA |
|
||||||
@@ -207,13 +239,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
* | | | | | | | | | | | | | | |
|
* | | | | | | | | | | | | | | |
|
||||||
* `-------------------------------------------------------------------------------------------------'
|
* `-------------------------------------------------------------------------------------------------'
|
||||||
*/
|
*/
|
||||||
[_RAISE] = LAYOUT_kc( \
|
[_RAISE] = LAYOUT_wrapper(
|
||||||
TAB, XXXX, XXXX, XXXX, LSMI, MINS, EQL, LSEQ, XXXX, XXXX, XXXX, XXXX, \
|
KC_TAB, XXXX__XXXX__XXXX__UNDS__MINS, EQL__PLUS__XXXX__XXXX__XXXX, XXXXXXX,
|
||||||
xEISU, XXXX, XXXX, XXXX, LSLB, LBRC, RBRC, LSRB, XXXX, XXXX, XXXX, xKANA, \
|
xEISU, XXXX__XXXX__XXXX__LCBR__LBRC, RBRC__RCBR__XXXX__XXXX__XXXX, xKANA,
|
||||||
XXXX, XXXX, XXXX, XXXX, LSGR, GRV, QUOT, LSQT, XXXX, XXXX, XXXX, XXXX, \
|
XXXXXXX, XXXX__XXXX__XXXX__TILD___GRV, QUOT___DQT__XXXX__XXXX__XXXX, XXXXXXX,
|
||||||
ADJ, ADJ, XXXX, ____, ____, XXXX, ____, ____, XXXX, ____, ____, XXXX, ADJ, ADJ \
|
ADJ___ADJ, XXXX______________XXXX, ____z_____z, XXXX______________XXXX, ADJ___ADJ
|
||||||
),
|
),
|
||||||
|
|
||||||
/* Adjust (Lower + Raise)
|
/* Adjust (Lower + Raise)
|
||||||
* ,-----------------------------------------. ,-----------------------------------------.
|
* ,-----------------------------------------. ,-----------------------------------------.
|
||||||
* | | Reset|RGBRST|RGB ON|Aud on| Win | | Win | |Qwerty|Euclyn|Colemk|Dvorak|
|
* | | Reset|RGBRST|RGB ON|Aud on| Win | | Win | |Qwerty|Euclyn|Colemk|Dvorak|
|
||||||
@@ -226,10 +257,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
* `-------------------------------------------------------------------------------------------------'
|
* `-------------------------------------------------------------------------------------------------'
|
||||||
*/
|
*/
|
||||||
[_ADJUST] = LAYOUT( \
|
[_ADJUST] = LAYOUT( \
|
||||||
XXXXXXX, RESET, RGBRST, RGB_TOG, AU_ON, AG_SWAP, AG_SWAP, XXXXXXX, QWERTY, EUCALYN, COLEMAK, DVORAK, \
|
XXXXXXX, RESET, RGBRST, RGB_TOG, AU_ON, AG_SWAP, AG_SWAP, XXXXXXX, QWERTY, EUCALYN, COLEMAK, DVORAK, \
|
||||||
RGB_HUI, RGB_SAI, RGB_VAI, RGB_MOD, AU_OFF, AG_NORM, AG_NORM, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
|
RGB_HUI, RGB_SAI, RGB_VAI, RGB_MOD, AU_OFF, AG_NORM, AG_NORM, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
|
||||||
RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
|
RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
|
||||||
_______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, ___,___, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______ \
|
_______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, ___,___, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______ \
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -302,7 +333,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
case KC_xEISU:
|
case xEISU:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
if(keymap_config.swap_lalt_lgui==false){
|
if(keymap_config.swap_lalt_lgui==false){
|
||||||
register_code(KC_LANG2);
|
register_code(KC_LANG2);
|
||||||
@@ -314,7 +345,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
case KC_xKANA:
|
case xKANA:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
if(keymap_config.swap_lalt_lgui==false){
|
if(keymap_config.swap_lalt_lgui==false){
|
||||||
register_code(KC_LANG1);
|
register_code(KC_LANG1);
|
||||||
|
|||||||
@@ -0,0 +1,131 @@
|
|||||||
|
/* Copyright 2021 hlmtre
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
|
||||||
|
enum alt_keycodes {
|
||||||
|
U_T_AUTO = SAFE_RANGE, //USB Extra Port Toggle Auto Detect / Always Active
|
||||||
|
U_T_AGCR, //USB Toggle Automatic GCR control
|
||||||
|
DBG_TOG, //DEBUG Toggle On / Off
|
||||||
|
DBG_MTRX, //DEBUG Toggle Matrix Prints
|
||||||
|
DBG_KBD, //DEBUG Toggle Keyboard Prints
|
||||||
|
DBG_MOU, //DEBUG Toggle Mouse Prints
|
||||||
|
MD_BOOT, //Restart into bootloader after hold timeout
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = LAYOUT_65_ansi_blocker(
|
||||||
|
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_HOME, \
|
||||||
|
MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \
|
||||||
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT \
|
||||||
|
),
|
||||||
|
[1] = LAYOUT_65_ansi_blocker(
|
||||||
|
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_MUTE, \
|
||||||
|
_______, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, U_T_AUTO, KC_INS, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_END, \
|
||||||
|
_______, RGB_RMOD,RGB_VAD, RGB_MOD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, \
|
||||||
|
_______, RGB_TOG, _______, _______, _______, MD_BOOT, NK_TOGG, DBG_TOG, _______, _______, _______, _______, KC_VOLU, KC_VOLD, \
|
||||||
|
_______, _______, _______, KC_MPLY, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT \
|
||||||
|
),
|
||||||
|
/*
|
||||||
|
[X] = LAYOUT(
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||||
|
),
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
|
||||||
|
#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT))
|
||||||
|
#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL))
|
||||||
|
#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT))
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
static uint32_t key_timer;
|
||||||
|
|
||||||
|
switch (keycode) {
|
||||||
|
case U_T_AUTO:
|
||||||
|
if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
|
||||||
|
TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case U_T_AGCR:
|
||||||
|
if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
|
||||||
|
TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case DBG_TOG:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case DBG_MTRX:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
TOGGLE_FLAG_AND_PRINT(debug_matrix, "Debug matrix");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case DBG_KBD:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
TOGGLE_FLAG_AND_PRINT(debug_keyboard, "Debug keyboard");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case DBG_MOU:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
TOGGLE_FLAG_AND_PRINT(debug_mouse, "Debug mouse");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case MD_BOOT:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
key_timer = timer_read32();
|
||||||
|
} else {
|
||||||
|
if (timer_elapsed32(key_timer) >= 500) {
|
||||||
|
reset_keyboard();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case RGB_TOG:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
switch (rgb_matrix_get_flags()) {
|
||||||
|
case LED_FLAG_ALL: {
|
||||||
|
rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR);
|
||||||
|
rgb_matrix_set_color_all(0, 0, 0);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case (LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR): {
|
||||||
|
rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
|
||||||
|
rgb_matrix_set_color_all(0, 0, 0);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case LED_FLAG_UNDERGLOW: {
|
||||||
|
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||||
|
rgb_matrix_disable_noeeprom();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default: {
|
||||||
|
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||||
|
rgb_matrix_enable_noeeprom();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
default:
|
||||||
|
return true; //Process all other keycodes normally
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
/* Copyright 2021 Nix Studio
|
||||||
|
*
|
||||||
|
* 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 0x6E78
|
||||||
|
#define PRODUCT_ID 0x3830
|
||||||
|
#define DEVICE_VER 0x0001
|
||||||
|
#define MANUFACTURER Nix Studio
|
||||||
|
#define PRODUCT OXALYS80
|
||||||
|
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
#define MATRIX_ROWS 12
|
||||||
|
#define MATRIX_COLS 9
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#define MATRIX_ROW_PINS { C6, B6, B5, B4, D7, D6, D4, D5, D3, D2, D1, D0 }
|
||||||
|
#define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, C7, B0, B1 }
|
||||||
|
#define UNUSED_PINS
|
||||||
|
|
||||||
|
/* COL2ROW, ROW2COL*/
|
||||||
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
|
||||||
|
#define BACKLIGHT_PIN B7
|
||||||
|
// #define BACKLIGHT_BREATHING
|
||||||
|
#define BACKLIGHT_LEVELS 3
|
||||||
|
|
||||||
|
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||||
|
#define DEBOUNCE 5
|
||||||
|
|
||||||
|
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||||
|
//#define MATRIX_HAS_GHOST
|
||||||
|
|
||||||
|
/* number of backlight levels */
|
||||||
|
|
||||||
|
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||||
|
#define LOCKING_SUPPORT_ENABLE
|
||||||
|
/* Locking resynchronize hack */
|
||||||
|
#define LOCKING_RESYNC_ENABLE
|
||||||
|
|
||||||
|
#define RGB_DI_PIN B3
|
||||||
|
#ifdef RGB_DI_PIN
|
||||||
|
#define RGBLIGHT_ANIMATIONS
|
||||||
|
#define RGBLED_NUM 24
|
||||||
|
#define RGBLIGHT_HUE_STEP 8
|
||||||
|
#define RGBLIGHT_SAT_STEP 8
|
||||||
|
#define RGBLIGHT_VAL_STEP 8
|
||||||
|
#define RGBLIGHT_LIMIT_VAL 200
|
||||||
|
#define RGBLIGHT_SLEEP // RGB will turn off when PC is put to sleep
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define LED_CAPS_LOCK_PIN E6
|
||||||
|
#define LED_SCROLL_LOCK_PIN B2
|
||||||
|
#define LED_PIN_ON_STATE 0
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,36 @@
|
|||||||
|
/* Copyright 2021 Nix Studio
|
||||||
|
*
|
||||||
|
* 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_all(
|
||||||
|
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS,
|
||||||
|
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, KC_INS, KC_HOME, KC_PGUP,
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_DEL, KC_END, KC_PGDN,
|
||||||
|
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
||||||
|
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_TRNS, KC_UP,
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
|
||||||
|
|
||||||
|
[1] = LAYOUT_all(
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, BL_TOGG, BL_DEC, BL_INC,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MNXT, KC_VOLD,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||||
|
|
||||||
|
};
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
# The default keymap for oxalys80
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
/* Copyright 2021 Nix Studio
|
||||||
|
*
|
||||||
|
* 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_all(
|
||||||
|
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS,
|
||||||
|
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_GRV, KC_INS, KC_HOME, KC_PGUP,
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN,
|
||||||
|
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
||||||
|
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_TRNS, KC_UP,
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
|
||||||
|
|
||||||
|
[1] = LAYOUT_all(
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, BL_TOGG, BL_DEC, BL_INC,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MNXT, KC_VOLD,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||||
|
|
||||||
|
[2] = LAYOUT_all(
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, BL_TOGG, BL_DEC, BL_INC,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MNXT, KC_VOLD,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||||
|
|
||||||
|
[3] = LAYOUT_all(
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, BL_TOGG, BL_DEC, BL_INC,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MNXT, KC_VOLD,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||||
|
|
||||||
|
};
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
# The default VIA keymap for oxalys80
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
VIA_ENABLE = yes
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
/* Copyright 2021 Nix Studio
|
||||||
|
*
|
||||||
|
* 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 "oxalys80.h"
|
||||||
|
|
||||||
|
|
||||||
|
void eeconfig_init_kb(void) { // EEPROM is getting reset!
|
||||||
|
rgblight_enable(); // Enable RGB by default
|
||||||
|
rgblight_sethsv(0, 255, 128); // Set default HSV - red hue, full saturation, medium brightness
|
||||||
|
rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL + 2); // set to RGB_RAINBOW_SWIRL by default
|
||||||
|
|
||||||
|
eeconfig_update_kb(0);
|
||||||
|
eeconfig_init_user();
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
/* Copyright 2021 Nix Studio
|
||||||
|
*
|
||||||
|
* 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"
|
||||||
|
|
||||||
|
// This a shortcut to help you visually see your layout.
|
||||||
|
// The following is an example using the Planck MIT layout
|
||||||
|
// The first section contains all of the arguments
|
||||||
|
// The second converts the arguments into a two-dimensional array
|
||||||
|
|
||||||
|
#define LAYOUT_all(\
|
||||||
|
K000, K001, K011, K002, K012, K003, K013, K004, K014, K005, K015, K006, K016, K007, K017, K008, \
|
||||||
|
K020, K030, K021, K031, K022, K032, K023, K033, K024, K034, K025, K035, K026, K036, K066, K027, K037, K028, \
|
||||||
|
K040, K050, K041, K051, K042, K052, K043, K053, K044, K054, K045, K055, K046, K056, K047, K057, K048, \
|
||||||
|
K060, K070, K061, K071, K062, K072, K063, K073, K064, K074, K065, K075, K076, \
|
||||||
|
K080, K090, K081, K091, K082, K092, K083, K093, K084, K094, K085, K095, K086, K096, K097, \
|
||||||
|
K100, K110, K101, K103, K105, K115, K106, K116, K107, K117, K108 \
|
||||||
|
) { \
|
||||||
|
{ K000, K001, K002, K003, K004, K005, K006, K007, K008 }, \
|
||||||
|
{ KC_NO, K011, K012, K013, K014, K015, K016, K017, KC_NO }, \
|
||||||
|
{ K020, K021, K022, K023, K024, K025, K026, K027, K028 }, \
|
||||||
|
{ K030, K031, K032, K033, K034, K035, K036, K037, KC_NO }, \
|
||||||
|
{ K040, K041, K042, K043, K044, K045, K046, K047, K048 }, \
|
||||||
|
{ K050, K051, K052, K053, K054, K055, K056, K057, KC_NO }, \
|
||||||
|
{ K060, K061, K062, K063, K064, K065, K066, KC_NO, KC_NO }, \
|
||||||
|
{ K070, K071, K072, K073, K074, K075, K076, KC_NO, KC_NO }, \
|
||||||
|
{ K080, K081, K082, K083, K084, K085, K086, KC_NO, KC_NO }, \
|
||||||
|
{ K090, K091, K092, K093, K094, K095, K096, K097, KC_NO }, \
|
||||||
|
{ K100, K101, KC_NO, K103, KC_NO, K105, K106, K107, K108 }, \
|
||||||
|
{ K110, KC_NO, KC_NO, KC_NO, KC_NO, K115, K116, K117, KC_NO } \
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
oxalys80
|
||||||
|
===
|
||||||
|
|
||||||
|
A QMK-powered replacement PCB for custom TKL keyboards. This PCB has the same size of the b.87 PCB, Hiney H87a, KBD8X.
|
||||||
|
|
||||||
|
Keyboard Maintainer: [Nix Studio](https://github.com/Nix-Studio)
|
||||||
|
Hardware Supported: oxalys80 ver. 1.0
|
||||||
|
Hardware Availability: [Nix Studio](https://www.instagram.com/nix.studio/)
|
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
make nix_studio/oxalys80: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).
|
||||||
|
|
||||||
|
## oxalys80 hardware information
|
||||||
|
|
||||||
|
Controller: Atmega32u4
|
||||||
|
|
||||||
|
/* Column pin configuration
|
||||||
|
* col: 0 1 2 3 4 5 6 7 8
|
||||||
|
* pin: F0 F1 F4 F5 F6 F7 C7 B0 B1
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Row pin configuration
|
||||||
|
* row: 0 1 2 3 4 5 6 7 8 9 10 11
|
||||||
|
* pin: C6 B6 B5 B4 D7 D6 D4 D5 D3 D2 D1 D0
|
||||||
|
*/
|
||||||
|
|
||||||
|
The oxalys PCB utilizes duplex matrix organization.
|
||||||
|
|
||||||
|
Caps Lock LED: E6
|
||||||
|
Scroll Lock LED: B2
|
||||||
|
Num Lock LED: not supported
|
||||||
|
Backlight Pin: B7
|
||||||
|
RGB Data Pin: B3
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
In-switch indicators:
|
||||||
|
To connect the Caps Lock LED to the main backlight matrix, turn switch to top position on SW3. To use the Caps Lock LED as an indicator, turn switch to bottom position on SW3.
|
||||||
|
|
||||||
|
To connect the Scroll Lock LED to the main backlight matrix, turn switch to left position on SW2. To use the Scroll Lock LED as an indicator, turn switch to right position on SW2.
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# MCU name
|
||||||
|
MCU = atmega32u4
|
||||||
|
|
||||||
|
BOOTLOADER = atmel-dfu
|
||||||
|
|
||||||
|
# Build Options
|
||||||
|
# change yes to no to disable
|
||||||
|
#
|
||||||
|
BOOTMAGIC_ENABLE = lite # 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
|
||||||
|
# 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 = yes # Enable keyboard backlight functionality on B7 by default
|
||||||
|
RGBLIGHT_ENABLE = yes # Enable RGB underglow
|
||||||
|
UNICODE_ENABLE = no # Unicode
|
||||||
|
BLUETOOTH_ENABLE = no # Enable Bluetooth
|
||||||
|
AUDIO_ENABLE = no # Audio output
|
||||||
|
LTO_ENABLE = yes
|
||||||
@@ -0,0 +1,197 @@
|
|||||||
|
/* Copyright 2021 Colin Lam (Ploopy Corporation)
|
||||||
|
* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <[email protected]>
|
||||||
|
* Copyright 2019 Sunjun Kim
|
||||||
|
* Copyright 2019 Hiroyuki Okada
|
||||||
|
*
|
||||||
|
* 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 "adns5050.h"
|
||||||
|
#include "quantum.h"
|
||||||
|
#include "wait.h"
|
||||||
|
|
||||||
|
#ifdef CONSOLE_ENABLE
|
||||||
|
# include "print.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef OPTIC_ROTATED
|
||||||
|
# define OPTIC_ROTATED false
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Definitions for the ADNS serial line.
|
||||||
|
// These really ought to be defined in your config.h, but defaults are
|
||||||
|
// here if you're really lazy.
|
||||||
|
#ifndef ADNS_SCLK_PIN
|
||||||
|
# define ADNS_SCLK_PIN B7
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef ADNS_SDIO_PIN
|
||||||
|
# define ADNS_SDIO_PIN C6
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef ADNS_CS_PIN
|
||||||
|
# define ADNS_CS_PIN B4
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONSOLE_ENABLE
|
||||||
|
void print_byte(uint8_t byte) { dprintf("%c%c%c%c%c%c%c%c|", (byte & 0x80 ? '1' : '0'), (byte & 0x40 ? '1' : '0'), (byte & 0x20 ? '1' : '0'), (byte & 0x10 ? '1' : '0'), (byte & 0x08 ? '1' : '0'), (byte & 0x04 ? '1' : '0'), (byte & 0x02 ? '1' : '0'), (byte & 0x01 ? '1' : '0')); }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Initialize the ADNS serial pins.
|
||||||
|
void adns_init(void) {
|
||||||
|
setPinOutput(ADNS_SCLK_PIN);
|
||||||
|
setPinOutput(ADNS_SDIO_PIN);
|
||||||
|
setPinOutput(ADNS_CS_PIN);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Perform a synchronization with the ADNS.
|
||||||
|
// Just as with the serial protocol, this is used by the slave to send a
|
||||||
|
// synchronization signal to the master.
|
||||||
|
void adns_sync(void) {
|
||||||
|
writePinLow(ADNS_CS_PIN);
|
||||||
|
wait_us(1);
|
||||||
|
writePinHigh(ADNS_CS_PIN);
|
||||||
|
}
|
||||||
|
|
||||||
|
void adns_cs_select(void) {
|
||||||
|
writePinLow(ADNS_CS_PIN);
|
||||||
|
}
|
||||||
|
|
||||||
|
void adns_cs_deselect(void) {
|
||||||
|
writePinHigh(ADNS_CS_PIN);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t adns_serial_read(void) {
|
||||||
|
setPinInput(ADNS_SDIO_PIN);
|
||||||
|
uint8_t byte = 0;
|
||||||
|
|
||||||
|
for (uint8_t i = 0; i < 8; ++i) {
|
||||||
|
writePinLow(ADNS_SCLK_PIN);
|
||||||
|
wait_us(1);
|
||||||
|
|
||||||
|
byte = (byte << 1) | readPin(ADNS_SDIO_PIN);
|
||||||
|
|
||||||
|
writePinHigh(ADNS_SCLK_PIN);
|
||||||
|
wait_us(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return byte;
|
||||||
|
}
|
||||||
|
|
||||||
|
void adns_serial_write(uint8_t data) {
|
||||||
|
setPinOutput(ADNS_SDIO_PIN);
|
||||||
|
|
||||||
|
for (int8_t b = 7; b >= 0; b--) {
|
||||||
|
writePinLow(ADNS_SCLK_PIN);
|
||||||
|
|
||||||
|
if (data & (1 << b))
|
||||||
|
writePinHigh(ADNS_SDIO_PIN);
|
||||||
|
else
|
||||||
|
writePinLow(ADNS_SDIO_PIN);
|
||||||
|
|
||||||
|
wait_us(2);
|
||||||
|
|
||||||
|
writePinHigh(ADNS_SCLK_PIN);
|
||||||
|
}
|
||||||
|
|
||||||
|
// tSWR. See page 15 of the ADNS spec sheet.
|
||||||
|
// Technically, this is only necessary if the next operation is an SDIO
|
||||||
|
// read. This is not guaranteed to be the case, but we're being lazy.
|
||||||
|
wait_us(4);
|
||||||
|
|
||||||
|
// Note that tSWW is never necessary. All write operations require at
|
||||||
|
// least 32us, which exceeds tSWW, so there's never a need to wait for it.
|
||||||
|
}
|
||||||
|
|
||||||
|
// Read a byte of data from a register on the ADNS.
|
||||||
|
// Don't forget to use the register map (as defined in the header file).
|
||||||
|
uint8_t adns_read_reg(uint8_t reg_addr) {
|
||||||
|
adns_cs_select();
|
||||||
|
|
||||||
|
adns_serial_write(reg_addr);
|
||||||
|
|
||||||
|
// We don't need a minimum tSRAD here. That's because a 4ms wait time is
|
||||||
|
// already included in adns_serial_write(), so we're good.
|
||||||
|
// See page 10 and 15 of the ADNS spec sheet.
|
||||||
|
//wait_us(4);
|
||||||
|
|
||||||
|
uint8_t byte = adns_serial_read();
|
||||||
|
|
||||||
|
// tSRW & tSRR. See page 15 of the ADNS spec sheet.
|
||||||
|
// Technically, this is only necessary if the next operation is an SDIO
|
||||||
|
// read or write. This is not guaranteed to be the case.
|
||||||
|
// Honestly, this wait could probably be removed.
|
||||||
|
wait_us(1);
|
||||||
|
|
||||||
|
adns_cs_deselect();
|
||||||
|
|
||||||
|
return byte;
|
||||||
|
}
|
||||||
|
|
||||||
|
void adns_write_reg(uint8_t reg_addr, uint8_t data) {
|
||||||
|
adns_cs_select();
|
||||||
|
adns_serial_write(reg_addr);
|
||||||
|
adns_serial_write(data);
|
||||||
|
adns_cs_deselect();
|
||||||
|
}
|
||||||
|
|
||||||
|
report_adns_t adns_read_burst(void) {
|
||||||
|
adns_cs_select();
|
||||||
|
|
||||||
|
report_adns_t data;
|
||||||
|
data.dx = 0;
|
||||||
|
data.dy = 0;
|
||||||
|
|
||||||
|
adns_serial_write(REG_MOTION_BURST);
|
||||||
|
|
||||||
|
// We don't need a minimum tSRAD here. That's because a 4ms wait time is
|
||||||
|
// already included in adns_serial_write(), so we're good.
|
||||||
|
// See page 10 and 15 of the ADNS spec sheet.
|
||||||
|
//wait_us(4);
|
||||||
|
|
||||||
|
uint8_t x = adns_serial_read();
|
||||||
|
uint8_t y = adns_serial_read();
|
||||||
|
|
||||||
|
// Burst mode returns a bunch of other shit that we don't really need.
|
||||||
|
// Setting CS to high ends burst mode early.
|
||||||
|
adns_cs_deselect();
|
||||||
|
|
||||||
|
data.dx = convert_twoscomp(x);
|
||||||
|
data.dy = convert_twoscomp(y);
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert a two's complement byte from an unsigned data type into a signed
|
||||||
|
// data type.
|
||||||
|
int8_t convert_twoscomp(uint8_t data) {
|
||||||
|
if ((data & 0x80) == 0x80)
|
||||||
|
return -128 + (data & 0x7F);
|
||||||
|
else
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Don't forget to use the definitions for CPI in the header file.
|
||||||
|
void adns_set_cpi(uint8_t cpi) {
|
||||||
|
adns_write_reg(REG_MOUSE_CONTROL2, cpi);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool adns_check_signature(void) {
|
||||||
|
uint8_t pid = adns_read_reg(REG_PRODUCT_ID);
|
||||||
|
uint8_t rid = adns_read_reg(REG_REVISION_ID);
|
||||||
|
uint8_t pid2 = adns_read_reg(REG_PRODUCT_ID2);
|
||||||
|
|
||||||
|
return (pid == 0x12 && rid == 0x01 && pid2 == 0x26);
|
||||||
|
}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
/* Copyright 2021 Colin Lam (Ploopy Corporation)
|
||||||
|
* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <[email protected]>
|
||||||
|
* Copyright 2019 Sunjun Kim
|
||||||
|
* Copyright 2019 Hiroyuki Okada
|
||||||
|
*
|
||||||
|
* 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 <stdbool.h>
|
||||||
|
|
||||||
|
// Registers
|
||||||
|
#define REG_PRODUCT_ID 0x00
|
||||||
|
#define REG_REVISION_ID 0x01
|
||||||
|
#define REG_MOTION 0x02
|
||||||
|
#define REG_DELTA_X 0x03
|
||||||
|
#define REG_DELTA_Y 0x04
|
||||||
|
#define REG_SQUAL 0x05
|
||||||
|
#define REG_SHUTTER_UPPER 0x06
|
||||||
|
#define REG_SHUTTER_LOWER 0x07
|
||||||
|
#define REG_MAXIMUM_PIXEL 0x08
|
||||||
|
#define REG_PIXEL_SUM 0x09
|
||||||
|
#define REG_MINIMUM_PIXEL 0x0a
|
||||||
|
#define REG_PIXEL_GRAB 0x0b
|
||||||
|
#define REG_MOUSE_CONTROL 0x0d
|
||||||
|
#define REG_MOUSE_CONTROL2 0x19
|
||||||
|
#define REG_LED_DC_MODE 0x22
|
||||||
|
#define REG_CHIP_RESET 0x3a
|
||||||
|
#define REG_PRODUCT_ID2 0x3e
|
||||||
|
#define REG_INV_REV_ID 0x3f
|
||||||
|
#define REG_MOTION_BURST 0x63
|
||||||
|
|
||||||
|
// CPI values
|
||||||
|
#define CPI125 0x11
|
||||||
|
#define CPI250 0x12
|
||||||
|
#define CPI375 0x13
|
||||||
|
#define CPI500 0x14
|
||||||
|
#define CPI625 0x15
|
||||||
|
#define CPI750 0x16
|
||||||
|
#define CPI875 0x17
|
||||||
|
#define CPI1000 0x18
|
||||||
|
#define CPI1125 0x19
|
||||||
|
#define CPI1250 0x1a
|
||||||
|
#define CPI1375 0x1b
|
||||||
|
|
||||||
|
#ifdef CONSOLE_ENABLE
|
||||||
|
void print_byte(uint8_t byte);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
int8_t dx;
|
||||||
|
int8_t dy;
|
||||||
|
} report_adns_t;
|
||||||
|
|
||||||
|
// A bunch of functions to implement the ADNS5050-specific serial protocol.
|
||||||
|
// Note that the "serial.h" driver is insufficient, because it does not
|
||||||
|
// manually manipulate a serial clock signal.
|
||||||
|
void adns_init(void);
|
||||||
|
void adns_sync(void);
|
||||||
|
uint8_t adns_serial_read(void);
|
||||||
|
void adns_serial_write(uint8_t data);
|
||||||
|
uint8_t adns_read_reg(uint8_t reg_addr);
|
||||||
|
void adns_write_reg(uint8_t reg_addr, uint8_t data);
|
||||||
|
report_adns_t adns_read_burst(void);
|
||||||
|
int8_t convert_twoscomp(uint8_t data);
|
||||||
|
void adns_set_cpi(uint8_t cpi);
|
||||||
|
bool adns_check_signature(void);
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
/* Copyright 2021 Colin Lam (Ploopy Corporation)
|
||||||
|
* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <[email protected]>
|
||||||
|
* Copyright 2019 Sunjun Kim
|
||||||
|
* Copyright 2019 Hiroyuki Okada
|
||||||
|
*
|
||||||
|
* 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 0x5043
|
||||||
|
#define PRODUCT_ID 0x1EAB
|
||||||
|
#define DEVICE_VER 0x0001
|
||||||
|
#define MANUFACTURER PloopyCo
|
||||||
|
#define PRODUCT Trackball Mini
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
#define MATRIX_ROWS 1
|
||||||
|
#define MATRIX_COLS 5
|
||||||
|
|
||||||
|
|
||||||
|
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||||
|
#define DEBOUNCE 5
|
||||||
|
|
||||||
|
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||||
|
//#define MATRIX_HAS_GHOST
|
||||||
|
|
||||||
|
/* disable action features */
|
||||||
|
//#define NO_ACTION_LAYER
|
||||||
|
//#define NO_ACTION_TAPPING
|
||||||
|
//#define NO_ACTION_ONESHOT
|
||||||
|
#define NO_ACTION_MACRO
|
||||||
|
#define NO_ACTION_FUNCTION
|
||||||
|
|
||||||
|
/* Much more so than a keyboard, speed matters for a mouse. So we'll go for as high
|
||||||
|
a polling rate as possible. */
|
||||||
|
#define USB_POLLING_INTERVAL_MS 1
|
||||||
|
#define USB_MAX_POWER_CONSUMPTION 100
|
||||||
|
|
||||||
|
/* Bootmagic Lite key configuration */
|
||||||
|
#define BOOTMAGIC_LITE_ROW 0
|
||||||
|
#define BOOTMAGIC_LITE_COLUMN 3
|
||||||
|
|
||||||
|
// If board has a debug LED, you can enable it by defining this
|
||||||
|
// #define DEBUG_LED_PIN F7
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"keyboard_name": "Ploopy Trackball Mini",
|
||||||
|
"url": "www.ploopy.co",
|
||||||
|
"maintainer": "ploopyco",
|
||||||
|
"manufacturer": "Ploopy Corporation",
|
||||||
|
"width": 8,
|
||||||
|
"height": 3,
|
||||||
|
"layouts": {
|
||||||
|
"LAYOUT": {
|
||||||
|
"layout": [
|
||||||
|
{"x":0, "y":0, "h":2},
|
||||||
|
{"x":1, "y":0.25, "h":1.5},
|
||||||
|
{"x":2, "y":0, "h":2},
|
||||||
|
{"x":3.5, "y":0, "h":2},
|
||||||
|
{"x":4.5, "y":0, "h":2}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
/* Copyright 2021 Colin Lam (Ploopy Corporation)
|
||||||
|
* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <[email protected]>
|
||||||
|
* Copyright 2019 Sunjun Kim
|
||||||
|
* Copyright 2019 Hiroyuki Okada
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
|
||||||
|
// safe range starts at `PLOOPY_SAFE_RANGE` instead.
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = LAYOUT( /* Base */
|
||||||
|
KC_BTN1, KC_BTN3, KC_BTN2,
|
||||||
|
KC_BTN4, KC_BTN5
|
||||||
|
),
|
||||||
|
};
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
The default keymap for the Ploopy Trackball Mini.
|
||||||
|
|
||||||
|
Note that kits bought from PloopyCo actually ship with the VIA keymap, not this one.
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <[email protected]>
|
||||||
|
* Copyright 2019 Sunjun Kim
|
||||||
|
* Copyright 2020 Ploopy Corporation
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
|
||||||
|
// used for tracking the state
|
||||||
|
bool is_drag_scroll = false;
|
||||||
|
|
||||||
|
enum custom_keycodes {
|
||||||
|
DRAG_SCROLL = PLOOPY_SAFE_RANGE,
|
||||||
|
};
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
switch (keycode) {
|
||||||
|
case DRAG_SCROLL:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
// this toggles the state each time you tap it
|
||||||
|
is_drag_scroll ^= 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// The real magic is here.
|
||||||
|
// This function is called to translate the processed sensor movement
|
||||||
|
// from the mouse sensor and translates it into x and y movement for
|
||||||
|
// the mouse report. Normally. So if "drag scroll" is toggled on,
|
||||||
|
// moving the ball scrolls instead. You could remove the x or y here
|
||||||
|
// to only scroll in one direction, if you wanted, as well. In fact,
|
||||||
|
// there is no reason that you need to send this to the mouse report.
|
||||||
|
// You could have it register a key, instead.
|
||||||
|
void process_mouse_user(report_mouse_t* mouse_report, int16_t x, int16_t y) {
|
||||||
|
if (is_drag_scroll) {
|
||||||
|
mouse_report->h = x;
|
||||||
|
mouse_report->v = y;
|
||||||
|
} else {
|
||||||
|
mouse_report->x = x;
|
||||||
|
mouse_report->y = y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = LAYOUT( /* Base */
|
||||||
|
KC_BTN1, KC_BTN3, KC_BTN2,
|
||||||
|
KC_BTN4, LT(1, KC_BTN5)
|
||||||
|
),
|
||||||
|
[1] = LAYOUT(
|
||||||
|
DRAG_SCROLL, _______, _______,
|
||||||
|
_______, _______
|
||||||
|
)
|
||||||
|
};
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# The Drag Scroll keymap for the Ploopy Trackball Mini
|
||||||
|
|
||||||
|
This is a sample keymap showing off what you can do with the custom callback drivers.
|
||||||
|
|
||||||
|
This particular example enables "drag scrolling". The movement of the ball is used to scroll up and down.
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <[email protected]>
|
||||||
|
* Copyright 2019 Sunjun Kim
|
||||||
|
* Copyright 2020 Ploopy Corporation
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
|
||||||
|
#define DYNAMIC_KEYMAP_LAYER_COUNT 8
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <[email protected]>
|
||||||
|
* Copyright 2019 Sunjun Kim
|
||||||
|
* Copyright 2020 Ploopy Corporation
|
||||||
|
*
|
||||||
|
* 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_BTN1, KC_BTN3, KC_BTN2, KC_BTN4, KC_BTN5 ),
|
||||||
|
[1] = LAYOUT( _______, _______, _______, _______, _______ ),
|
||||||
|
[2] = LAYOUT( _______, _______, _______, _______, _______ ),
|
||||||
|
[3] = LAYOUT( _______, _______, _______, _______, _______ ),
|
||||||
|
[4] = LAYOUT( _______, _______, _______, _______, _______ ),
|
||||||
|
[5] = LAYOUT( _______, _______, _______, _______, _______ ),
|
||||||
|
[6] = LAYOUT( _______, _______, _______, _______, _______ ),
|
||||||
|
[7] = LAYOUT( _______, _______, _______, _______, _______ )
|
||||||
|
};
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
VIA_ENABLE = yes
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
|
||||||
|
# Ploopy Trackball Mini
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
It's a DIY, QMK Powered Trackball...Mini!
|
||||||
|
|
||||||
|
* Maintainer: [PloopyCo](https://github.com/ploopyco)
|
||||||
|
* Key contributors: [Drashna Jael're](https://github.com/drashna/), [Germ](https://github.com/germ/)
|
||||||
|
* Hardware Supported: ATMega32u4 16MHz(5v)
|
||||||
|
* Hardware Availability: [Store](https://ploopy.co), [GitHub](https://github.com/ploopyco)
|
||||||
|
|
||||||
|
Make example for this trackball (after setting up your build environment):
|
||||||
|
|
||||||
|
make ploopyco/trackball_mini/rev1_001:default:flash
|
||||||
|
make ploopyco/trackball_mini/rev1_001:via:flash
|
||||||
|
|
||||||
|
To jump to the bootloader, hold down "Button 4" (immediate right of the ball)
|
||||||
|
|
||||||
|
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).
|
||||||
|
|
||||||
|
## Hardware Reset Button
|
||||||
|
|
||||||
|
The Ploopy Mini has a handy bootloader reset mechanism: two via pins on the board, designated by the reference designator `MCU.J.X BOOTLOADER`. If you stick an uninsulated paperclip or a pair of metal tweezers into both holes and plug in the Mini, it will start in bootloader mode.
|
||||||
|
|
||||||
|
## Revisions
|
||||||
|
|
||||||
|
Occasionally, new revisions of the PCB will be released. Every board comes with a designator that looks something like `R1.001`.
|
||||||
|
|
||||||
|
Match the firmware that you flash onto the board with the designator on the board.
|
||||||
|
|
||||||
|
# Customzing your Ploopy Mini Trackball
|
||||||
|
|
||||||
|
While the defaults are designed so that it can be plugged in and used right away, there are a number of things that you may want to change, such as adding DPI control, or using the ball to scroll while holding a button. To allow for this sort of control, there is a callback for both the scroll wheel and the mouse sensor.
|
||||||
|
|
||||||
|
The default behavior for this is:
|
||||||
|
|
||||||
|
```c
|
||||||
|
void process_wheel_user(report_mouse_t* mouse_report, int16_t h, int16_t v) {
|
||||||
|
mouse_report->h = h;
|
||||||
|
mouse_report->v = v;
|
||||||
|
}
|
||||||
|
|
||||||
|
void process_mouse_user(report_mouse_t* mouse_report, int16_t x, int16_t y) {
|
||||||
|
mouse_report->x = x;
|
||||||
|
mouse_report->y = y;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
This should allow you to more heavily customize the behavior.
|
||||||
|
|
||||||
|
Alternatively, the `process_wheel` and `process_mouse` functions can both be replaced too, to allow for even more functionality.
|
||||||
|
|
||||||
|
Additionally, you can change the DPI/CPI or speed of the trackball by calling `adns_set_cpi` at any time. Additionally, there is a `DPI_CONFIG` macro that will cycle through an array of options for the DPI. This is set to 375, 750, and 1375, but can be changed. 750 is the default.
|
||||||
|
|
||||||
|
To configure/set your own array, there are two defines to use, `PLOOPY_DPI_OPTIONS` to set the array, and `PLOOPY_DPI_DEFAULT`.
|
||||||
|
|
||||||
|
```c
|
||||||
|
#define PLOOPY_DPI_OPTIONS { CPI375, CPI750, CPI1375}
|
||||||
|
#define PLOOPY_DPI_DEFAULT 1
|
||||||
|
```
|
||||||
|
|
||||||
|
The `PLOOPY_DPI_OPTIONS` array sets the values that you want to be able to cycle through, and the order they are in. The "default" define lets the firmware know which of these options is the default and should be loaded by default.
|
||||||
|
|
||||||
|
The `DPI_CONFIG` macro will cycle through the values in the array, each time you hit it. It stores this value in persistent memory, so it will load it the next time the device powers up.
|
||||||
|
|
||||||
|
## Fuse settings
|
||||||
|
|
||||||
|
When flashing the bootloader, use the following fuse settings:
|
||||||
|
|
||||||
|
| Fuse | Setting |
|
||||||
|
|----------|-------------|
|
||||||
|
| Low | `0x5E` |
|
||||||
|
| High | `0x99` |
|
||||||
|
| Extended | `0xC3` |
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
/* Copyright 2021 Colin Lam (Ploopy Corporation)
|
||||||
|
* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <[email protected]>
|
||||||
|
* Copyright 2019 Sunjun Kim
|
||||||
|
* Copyright 2019 Hiroyuki Okada
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#define DIRECT_PINS \
|
||||||
|
{ \
|
||||||
|
{ D4, D2, E6, D7, B6 } \
|
||||||
|
}
|
||||||
|
|
||||||
|
// These pins are not broken out, and cannot be used normally.
|
||||||
|
// They are set as output and pulled high, by default
|
||||||
|
#define UNUSED_PINS \
|
||||||
|
{ B5, C7, D0, D1, D3, D5, D6, F1, F3, F5, F6, F7 }
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
See the main readme for more details. This is just here for when future revisions are released.
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
/* Copyright 2021 Colin Lam (Ploopy Corporation)
|
||||||
|
* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <[email protected]>
|
||||||
|
* Copyright 2019 Sunjun Kim
|
||||||
|
* Copyright 2019 Hiroyuki Okada
|
||||||
|
*
|
||||||
|
* 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 "trackball_mini.h"
|
||||||
Whitespace-only changes.
@@ -0,0 +1,32 @@
|
|||||||
|
# MCU name
|
||||||
|
MCU = atmega32u4
|
||||||
|
|
||||||
|
# Processor frequency
|
||||||
|
F_CPU = 16000000
|
||||||
|
|
||||||
|
# Bootloader selection
|
||||||
|
BOOTLOADER = atmel-dfu
|
||||||
|
|
||||||
|
# Build Options
|
||||||
|
# change yes to no to disable
|
||||||
|
#
|
||||||
|
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
|
||||||
|
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
|
||||||
|
UNICODE_ENABLE = no # Unicode
|
||||||
|
BLUETOOTH_ENABLE = no # Enable Bluetooth
|
||||||
|
AUDIO_ENABLE = no # Audio output
|
||||||
|
POINTING_DEVICE_ENABLE = yes
|
||||||
|
MOUSEKEY_ENABLE = no # Mouse keys
|
||||||
|
|
||||||
|
QUANTUM_LIB_SRC += analog.c
|
||||||
|
SRC += adns5050.c opt_encoder.c
|
||||||
|
|
||||||
|
DEFAULT_FOLDER = ploopyco/trackball_mini/rev1_001
|
||||||
@@ -0,0 +1,235 @@
|
|||||||
|
/* Copyright 2021 Colin Lam (Ploopy Corporation)
|
||||||
|
* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <[email protected]>
|
||||||
|
* Copyright 2019 Sunjun Kim
|
||||||
|
* Copyright 2019 Hiroyuki Okada
|
||||||
|
*
|
||||||
|
* 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 "trackball_mini.h"
|
||||||
|
|
||||||
|
#ifndef OPT_DEBOUNCE
|
||||||
|
# define OPT_DEBOUNCE 5 // (ms) Time between scroll events
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef SCROLL_BUTT_DEBOUNCE
|
||||||
|
# define SCROLL_BUTT_DEBOUNCE 100 // (ms) Time between scroll events
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef OPT_THRES
|
||||||
|
# define OPT_THRES 150 // (0-1024) Threshold for actication
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef OPT_SCALE
|
||||||
|
# define OPT_SCALE 1 // Multiplier for wheel
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef PLOOPY_DPI_OPTIONS
|
||||||
|
# define PLOOPY_DPI_OPTIONS { CPI375, CPI750, CPI1375 }
|
||||||
|
# ifndef PLOOPY_DPI_DEFAULT
|
||||||
|
# define PLOOPY_DPI_DEFAULT 2
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef PLOOPY_DPI_DEFAULT
|
||||||
|
# define PLOOPY_DPI_DEFAULT 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Transformation constants for delta-X and delta-Y
|
||||||
|
const static float ADNS_X_TRANSFORM = -1.0;
|
||||||
|
const static float ADNS_Y_TRANSFORM = 1.0;
|
||||||
|
|
||||||
|
keyboard_config_t keyboard_config;
|
||||||
|
uint16_t dpi_array[] = PLOOPY_DPI_OPTIONS;
|
||||||
|
#define DPI_OPTION_SIZE (sizeof(dpi_array) / sizeof(uint16_t))
|
||||||
|
|
||||||
|
// TODO: Implement libinput profiles
|
||||||
|
// https://wayland.freedesktop.org/libinput/doc/latest/pointer-acceleration.html
|
||||||
|
// Compile time accel selection
|
||||||
|
// Valid options are ACC_NONE, ACC_LINEAR, ACC_CUSTOM, ACC_QUADRATIC
|
||||||
|
|
||||||
|
// Trackball State
|
||||||
|
bool is_scroll_clicked = false;
|
||||||
|
bool BurstState = false; // init burst state for Trackball module
|
||||||
|
uint16_t MotionStart = 0; // Timer for accel, 0 is resting state
|
||||||
|
uint16_t lastScroll = 0; // Previous confirmed wheel event
|
||||||
|
uint16_t lastMidClick = 0; // Stops scrollwheel from being read if it was pressed
|
||||||
|
uint8_t OptLowPin = OPT_ENC1;
|
||||||
|
bool debug_encoder = false;
|
||||||
|
|
||||||
|
__attribute__((weak)) void process_wheel_user(report_mouse_t* mouse_report, int16_t h, int16_t v) {
|
||||||
|
mouse_report->h = h;
|
||||||
|
mouse_report->v = v;
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__((weak)) void process_wheel(report_mouse_t* mouse_report) {
|
||||||
|
// If the mouse wheel was just released, do not scroll.
|
||||||
|
if (timer_elapsed(lastMidClick) < SCROLL_BUTT_DEBOUNCE)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Limit the number of scrolls per unit time.
|
||||||
|
if (timer_elapsed(lastScroll) < OPT_DEBOUNCE)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Don't scroll if the middle button is depressed.
|
||||||
|
if (is_scroll_clicked) {
|
||||||
|
#ifndef IGNORE_SCROLL_CLICK
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
lastScroll = timer_read();
|
||||||
|
uint16_t p1 = adc_read(OPT_ENC1_MUX);
|
||||||
|
uint16_t p2 = adc_read(OPT_ENC2_MUX);
|
||||||
|
|
||||||
|
if (debug_encoder)
|
||||||
|
dprintf("OPT1: %d, OPT2: %d\n", p1, p2);
|
||||||
|
|
||||||
|
uint8_t dir = opt_encoder_handler(p1, p2);
|
||||||
|
|
||||||
|
if (dir == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
process_wheel_user(mouse_report, mouse_report->h, (int)(mouse_report->v + (dir * OPT_SCALE)));
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__((weak)) void process_mouse_user(report_mouse_t* mouse_report, int16_t x, int16_t y) {
|
||||||
|
// x and y are swapped
|
||||||
|
// the sensor is rotated
|
||||||
|
// by 90 degrees
|
||||||
|
int16_t temp = x;
|
||||||
|
x = y;
|
||||||
|
y = temp;
|
||||||
|
|
||||||
|
// Apply delta-X and delta-Y transformations.
|
||||||
|
float xt = (float) x * ADNS_X_TRANSFORM;
|
||||||
|
float yt = (float) y * ADNS_Y_TRANSFORM;
|
||||||
|
|
||||||
|
int16_t xti = xt;
|
||||||
|
int16_t yti = yt;
|
||||||
|
|
||||||
|
mouse_report->x = xti;
|
||||||
|
mouse_report->y = yti;
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__((weak)) void process_mouse(report_mouse_t* mouse_report) {
|
||||||
|
report_adns_t data = adns_read_burst();
|
||||||
|
|
||||||
|
if (data.dx != 0 || data.dy != 0) {
|
||||||
|
if (debug_mouse)
|
||||||
|
dprintf("Raw ] X: %d, Y: %d\n", data.dx, data.dy);
|
||||||
|
|
||||||
|
process_mouse_user(mouse_report, data.dx, data.dy);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_kb(uint16_t keycode, keyrecord_t* record) {
|
||||||
|
xprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed);
|
||||||
|
|
||||||
|
// Update Timer to prevent accidental scrolls
|
||||||
|
if ((record->event.key.col == 1) && (record->event.key.row == 0)) {
|
||||||
|
lastMidClick = timer_read();
|
||||||
|
is_scroll_clicked = record->event.pressed;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!process_record_user(keycode, record))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (keycode == DPI_CONFIG && record->event.pressed) {
|
||||||
|
keyboard_config.dpi_config = (keyboard_config.dpi_config + 1) % DPI_OPTION_SIZE;
|
||||||
|
eeconfig_update_kb(keyboard_config.raw);
|
||||||
|
adns_set_cpi(dpi_array[keyboard_config.dpi_config]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If Mousekeys is disabled, then use handle the mouse button
|
||||||
|
* keycodes. This makes things simpler, and allows usage of
|
||||||
|
* the keycodes in a consistent manner. But only do this if
|
||||||
|
* Mousekeys is not enable, so it's not handled twice.
|
||||||
|
*/
|
||||||
|
#ifndef MOUSEKEY_ENABLE
|
||||||
|
if (IS_MOUSEKEY_BUTTON(keycode)) {
|
||||||
|
report_mouse_t currentReport = pointing_device_get_report();
|
||||||
|
if (record->event.pressed) {
|
||||||
|
currentReport.buttons |= 1 << (keycode - KC_MS_BTN1);
|
||||||
|
} else {
|
||||||
|
currentReport.buttons &= ~(1 << (keycode - KC_MS_BTN1));
|
||||||
|
}
|
||||||
|
pointing_device_set_report(currentReport);
|
||||||
|
pointing_device_send();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hardware Setup
|
||||||
|
void keyboard_pre_init_kb(void) {
|
||||||
|
// debug_enable = true;
|
||||||
|
// debug_matrix = true;
|
||||||
|
debug_mouse = true;
|
||||||
|
// debug_encoder = true;
|
||||||
|
|
||||||
|
setPinInput(OPT_ENC1);
|
||||||
|
setPinInput(OPT_ENC2);
|
||||||
|
|
||||||
|
/* Ground all output pins connected to ground. This provides additional
|
||||||
|
* pathways to ground. If you're messing with this, know this: driving ANY
|
||||||
|
* of these pins high will cause a short. On the MCU. Ka-blooey.
|
||||||
|
*/
|
||||||
|
#ifdef UNUSED_PINS
|
||||||
|
const pin_t unused_pins[] = UNUSED_PINS;
|
||||||
|
|
||||||
|
for (uint8_t i = 0; i < (sizeof(unused_pins) / sizeof(pin_t)); i++) {
|
||||||
|
setPinOutput(unused_pins[i]);
|
||||||
|
writePinLow(unused_pins[i]);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
keyboard_pre_init_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
void pointing_device_init(void) {
|
||||||
|
adns_init();
|
||||||
|
opt_encoder_init();
|
||||||
|
}
|
||||||
|
|
||||||
|
void pointing_device_task(void) {
|
||||||
|
report_mouse_t mouse_report = pointing_device_get_report();
|
||||||
|
process_wheel(&mouse_report);
|
||||||
|
process_mouse(&mouse_report);
|
||||||
|
pointing_device_set_report(mouse_report);
|
||||||
|
pointing_device_send();
|
||||||
|
}
|
||||||
|
|
||||||
|
void eeconfig_init_kb(void) {
|
||||||
|
keyboard_config.dpi_config = PLOOPY_DPI_DEFAULT;
|
||||||
|
eeconfig_update_kb(keyboard_config.raw);
|
||||||
|
eeconfig_init_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_init_kb(void) {
|
||||||
|
// is safe to just read DPI setting since matrix init
|
||||||
|
// comes before pointing device init.
|
||||||
|
keyboard_config.raw = eeconfig_read_kb();
|
||||||
|
if (keyboard_config.dpi_config > DPI_OPTION_SIZE) {
|
||||||
|
eeconfig_init_kb();
|
||||||
|
}
|
||||||
|
matrix_init_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
void keyboard_post_init_kb(void) {
|
||||||
|
adns_set_cpi(dpi_array[keyboard_config.dpi_config]);
|
||||||
|
|
||||||
|
keyboard_post_init_user();
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
/* Copyright 2021 Colin Lam (Ploopy Corporation)
|
||||||
|
* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <[email protected]>
|
||||||
|
* Copyright 2019 Sunjun Kim
|
||||||
|
* Copyright 2019 Hiroyuki Okada
|
||||||
|
*
|
||||||
|
* 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"
|
||||||
|
#include "adns5050.h"
|
||||||
|
#include "analog.h"
|
||||||
|
#include "opt_encoder.h"
|
||||||
|
#include "pointing_device.h"
|
||||||
|
|
||||||
|
// Sensor defs
|
||||||
|
#define OPT_ENC1 F0
|
||||||
|
#define OPT_ENC2 F4
|
||||||
|
#define OPT_ENC1_MUX 0
|
||||||
|
#define OPT_ENC2_MUX 4
|
||||||
|
|
||||||
|
void process_mouse(report_mouse_t* mouse_report);
|
||||||
|
void process_mouse_user(report_mouse_t* mouse_report, int16_t x, int16_t y);
|
||||||
|
void process_wheel(report_mouse_t* mouse_report);
|
||||||
|
void process_wheel_user(report_mouse_t* mouse_report, int16_t h, int16_t v);
|
||||||
|
|
||||||
|
#define LAYOUT(BL, BM, BR, BF, BB) \
|
||||||
|
{ {BL, BM, BR, BF, BB}, }
|
||||||
|
|
||||||
|
typedef union {
|
||||||
|
uint32_t raw;
|
||||||
|
struct {
|
||||||
|
uint8_t dpi_config;
|
||||||
|
};
|
||||||
|
} keyboard_config_t;
|
||||||
|
|
||||||
|
extern keyboard_config_t keyboard_config;
|
||||||
|
|
||||||
|
enum ploopy_keycodes {
|
||||||
|
DPI_CONFIG = SAFE_RANGE,
|
||||||
|
PLOOPY_SAFE_RANGE,
|
||||||
|
};
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
/* Copyright 2021 Colin Lam (Ploopy Corporation)
|
||||||
|
* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <[email protected]>
|
||||||
|
* Copyright 2019 Sunjun Kim
|
||||||
|
* Copyright 2019 Hiroyuki Okada
|
||||||
|
*
|
||||||
|
* 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 0x5043
|
||||||
|
#define PRODUCT_ID 0x1EAB
|
||||||
|
#define DEVICE_VER 0x0001
|
||||||
|
#define MANUFACTURER PloopyCo
|
||||||
|
#define PRODUCT Trackball Nano
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
#define MATRIX_ROWS 1
|
||||||
|
#define MATRIX_COLS 1
|
||||||
|
|
||||||
|
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||||
|
#define DEBOUNCE 0
|
||||||
|
|
||||||
|
/* disable action features */
|
||||||
|
//#define NO_ACTION_LAYER
|
||||||
|
//#define NO_ACTION_TAPPING
|
||||||
|
//#define NO_ACTION_ONESHOT
|
||||||
|
#define NO_ACTION_MACRO
|
||||||
|
#define NO_ACTION_FUNCTION
|
||||||
|
|
||||||
|
/* Much more so than a keyboard, speed matters for a mouse. So we'll go for as high
|
||||||
|
a polling rate as possible. */
|
||||||
|
#define USB_POLLING_INTERVAL_MS 1
|
||||||
|
#define USB_MAX_POWER_CONSUMPTION 100
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"keyboard_name": "Ploopy Trackball Nano",
|
||||||
|
"url": "www.ploopy.co",
|
||||||
|
"maintainer": "ploopyco",
|
||||||
|
"manufacturer": "Ploopy Corporation",
|
||||||
|
"layouts": {
|
||||||
|
"LAYOUT": {
|
||||||
|
"layout": [
|
||||||
|
{"x":0, "y":0}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
/* Copyright 2021 Colin Lam (Ploopy Corporation)
|
||||||
|
* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <[email protected]>
|
||||||
|
* Copyright 2019 Sunjun Kim
|
||||||
|
* Copyright 2019 Hiroyuki Okada
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
|
||||||
|
// safe range starts at `PLOOPY_SAFE_RANGE` instead.
|
||||||
|
|
||||||
|
// placeholder file so it will compile
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
The default keymap for the Ploopy Trackball Mini.
|
||||||
|
|
||||||
|
Note that kits bought from PloopyCo actually ship with the VIA keymap, not this one.
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# Ploopy Trackball Nano
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
It's a DIY, QMK Powered Trackball...Nano!
|
||||||
|
|
||||||
|
* Maintainer: [PloopyCo](https://github.com/ploopyco)
|
||||||
|
* Key contributors: [Drashna Jael're](https://github.com/drashna/), [Germ](https://github.com/germ/)
|
||||||
|
* Hardware Supported: ATMega32u4 16MHz(5v)
|
||||||
|
* Hardware Availability: [Store](https://ploopy.co/nano-trackball), [GitHub](https://github.com/ploopyco/nano-trackball)
|
||||||
|
|
||||||
|
Make example for this trackball (after setting up your build environment):
|
||||||
|
|
||||||
|
make ploopyco/trackball_nano/rev1_001:default:flash
|
||||||
|
make ploopyco/trackball_nano/rev1_001:via:flash
|
||||||
|
|
||||||
|
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).
|
||||||
|
|
||||||
|
## Hardware Reset Button
|
||||||
|
|
||||||
|
The Ploopy Nano has a handy bootloader reset mechanism: two via pins on the board, designated by the reference designator `MCU.J.X BOOTLOADER`. If you stick an uninsulated paperclip or a pair of metal tweezers into both holes and plug in the Nano, it will start in bootloader mode.
|
||||||
|
|
||||||
|
## Revisions
|
||||||
|
|
||||||
|
Occasionally, new revisions of the PCB will be released. Every board comes with a designator that looks something like `R1.001`.
|
||||||
|
|
||||||
|
Match the firmware that you flash onto the board with the designator on the board.
|
||||||
|
|
||||||
|
# Customzing your Ploopy Nano Trackball
|
||||||
|
|
||||||
|
You can change the DPI/CPI or speed of the trackball by calling `adns_set_cpi` at any time. Additionally, there is a `DPI_CONFIG` macro that will cycle through an array of options for the DPI. This is set to 375, 750, and 1375, but can be changed. 750 is the default.
|
||||||
|
|
||||||
|
To configure/set your own array, there are two defines to use, `PLOOPY_DPI_OPTIONS` to set the array, and `PLOOPY_DPI_DEFAULT`.
|
||||||
|
|
||||||
|
```c
|
||||||
|
#define PLOOPY_DPI_OPTIONS { CPI375, CPI750, CPI1375}
|
||||||
|
#define PLOOPY_DPI_DEFAULT 1
|
||||||
|
```
|
||||||
|
|
||||||
|
The `PLOOPY_DPI_OPTIONS` array sets the values that you want to be able to cycle through, and the order they are in. The "default" define lets the firmware know which of these options is the default and should be loaded by default.
|
||||||
|
|
||||||
|
The `DPI_CONFIG` macro will cycle through the values in the array, each time you hit it. It stores this value in persistent memory, so it will load it the next time the device powers up.
|
||||||
|
|
||||||
|
## Fuse settings
|
||||||
|
|
||||||
|
When flashing the bootloader, use the following fuse settings:
|
||||||
|
|
||||||
|
| Fuse | Setting |
|
||||||
|
|----------|-------------|
|
||||||
|
| Low | `0x5E` |
|
||||||
|
| High | `0x99` |
|
||||||
|
| Extended | `0xC3` |
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
/* Copyright 2021 Colin Lam (Ploopy Corporation)
|
||||||
|
* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <[email protected]>
|
||||||
|
* Copyright 2019 Sunjun Kim
|
||||||
|
* Copyright 2019 Hiroyuki Okada
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#define DIRECT_PINS {}
|
||||||
|
|
||||||
|
// These pins are not broken out, and cannot be used normally.
|
||||||
|
// They are set as output and pulled high, by default
|
||||||
|
#define UNUSED_PINS \
|
||||||
|
{ B5, B6, C7, D0, D1, D2, D3, D4, D5, D6, D7, E6, F1, F3, F5, F6, F7 }
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
See the main readme for more details. This is just here for when future revisions of the board are released.
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
/* Copyright 2021 Colin Lam (Ploopy Corporation)
|
||||||
|
* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <[email protected]>
|
||||||
|
* Copyright 2019 Sunjun Kim
|
||||||
|
* Copyright 2019 Hiroyuki Okada
|
||||||
|
*
|
||||||
|
* 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 "trackball_mini.h"
|
||||||
Whitespace-only changes.
@@ -0,0 +1,32 @@
|
|||||||
|
# MCU name
|
||||||
|
MCU = atmega32u4
|
||||||
|
|
||||||
|
# Processor frequency
|
||||||
|
F_CPU = 16000000
|
||||||
|
|
||||||
|
# Bootloader selection
|
||||||
|
BOOTLOADER = atmel-dfu
|
||||||
|
|
||||||
|
# Build Options
|
||||||
|
# change yes to no to disable
|
||||||
|
#
|
||||||
|
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
|
||||||
|
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
|
||||||
|
UNICODE_ENABLE = no # Unicode
|
||||||
|
BLUETOOTH_ENABLE = no # Enable Bluetooth
|
||||||
|
AUDIO_ENABLE = no # Audio output
|
||||||
|
POINTING_DEVICE_ENABLE = yes
|
||||||
|
MOUSEKEY_ENABLE = no # Mouse keys
|
||||||
|
|
||||||
|
QUANTUM_LIB_SRC += analog.c
|
||||||
|
SRC += adns5050.c opt_encoder.c
|
||||||
|
|
||||||
|
DEFAULT_FOLDER = ploopyco/trackball_nano/rev1_001
|
||||||
@@ -0,0 +1,211 @@
|
|||||||
|
/* Copyright 2021 Colin Lam (Ploopy Corporation)
|
||||||
|
* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <[email protected]>
|
||||||
|
* Copyright 2019 Sunjun Kim
|
||||||
|
* Copyright 2019 Hiroyuki Okada
|
||||||
|
*
|
||||||
|
* 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 "trackball_nano.h"
|
||||||
|
|
||||||
|
#ifndef OPT_DEBOUNCE
|
||||||
|
# define OPT_DEBOUNCE 5 // (ms) Time between scroll events
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef SCROLL_BUTT_DEBOUNCE
|
||||||
|
# define SCROLL_BUTT_DEBOUNCE 100 // (ms) Time between scroll events
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef OPT_THRES
|
||||||
|
# define OPT_THRES 150 // (0-1024) Threshold for actication
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef OPT_SCALE
|
||||||
|
# define OPT_SCALE 1 // Multiplier for wheel
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef PLOOPY_DPI_OPTIONS
|
||||||
|
# define PLOOPY_DPI_OPTIONS { CPI375, CPI750, CPI1375 }
|
||||||
|
# ifndef PLOOPY_DPI_DEFAULT
|
||||||
|
# define PLOOPY_DPI_DEFAULT 2
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef PLOOPY_DPI_DEFAULT
|
||||||
|
# define PLOOPY_DPI_DEFAULT 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { };
|
||||||
|
|
||||||
|
// Transformation constants for delta-X and delta-Y
|
||||||
|
const static float ADNS_X_TRANSFORM = -1.0;
|
||||||
|
const static float ADNS_Y_TRANSFORM = 1.0;
|
||||||
|
|
||||||
|
keyboard_config_t keyboard_config;
|
||||||
|
uint16_t dpi_array[] = PLOOPY_DPI_OPTIONS;
|
||||||
|
#define DPI_OPTION_SIZE (sizeof(dpi_array) / sizeof(uint16_t))
|
||||||
|
|
||||||
|
// TODO: Implement libinput profiles
|
||||||
|
// https://wayland.freedesktop.org/libinput/doc/latest/pointer-acceleration.html
|
||||||
|
// Compile time accel selection
|
||||||
|
// Valid options are ACC_NONE, ACC_LINEAR, ACC_CUSTOM, ACC_QUADRATIC
|
||||||
|
|
||||||
|
// Trackball State
|
||||||
|
bool is_scroll_clicked = false;
|
||||||
|
bool BurstState = false; // init burst state for Trackball module
|
||||||
|
uint16_t MotionStart = 0; // Timer for accel, 0 is resting state
|
||||||
|
uint16_t lastScroll = 0; // Previous confirmed wheel event
|
||||||
|
uint16_t lastMidClick = 0; // Stops scrollwheel from being read if it was pressed
|
||||||
|
uint8_t OptLowPin = OPT_ENC1;
|
||||||
|
bool debug_encoder = false;
|
||||||
|
|
||||||
|
__attribute__((weak)) void process_wheel_user(report_mouse_t* mouse_report, int16_t h, int16_t v) {
|
||||||
|
// There's no scroller on this device.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__((weak)) void process_wheel(report_mouse_t* mouse_report) {
|
||||||
|
// There's no scroller on this device.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__((weak)) void process_mouse_user(report_mouse_t* mouse_report, int16_t x, int16_t y) {
|
||||||
|
// x and y are swapped
|
||||||
|
// the sensor is rotated
|
||||||
|
// by 90 degrees
|
||||||
|
int16_t temp = x;
|
||||||
|
x = y;
|
||||||
|
y = temp;
|
||||||
|
|
||||||
|
// Apply delta-X and delta-Y transformations.
|
||||||
|
float xt = (float) x * ADNS_X_TRANSFORM;
|
||||||
|
float yt = (float) y * ADNS_Y_TRANSFORM;
|
||||||
|
|
||||||
|
int16_t xti = xt;
|
||||||
|
int16_t yti = yt;
|
||||||
|
|
||||||
|
mouse_report->x = xti;
|
||||||
|
mouse_report->y = yti;
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__((weak)) void process_mouse(report_mouse_t* mouse_report) {
|
||||||
|
report_adns_t data = adns_read_burst();
|
||||||
|
|
||||||
|
if (data.dx != 0 || data.dy != 0) {
|
||||||
|
if (debug_mouse)
|
||||||
|
dprintf("Raw ] X: %d, Y: %d\n", data.dx, data.dy);
|
||||||
|
|
||||||
|
process_mouse_user(mouse_report, data.dx, data.dy);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_kb(uint16_t keycode, keyrecord_t* record) {
|
||||||
|
xprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed);
|
||||||
|
|
||||||
|
// Update Timer to prevent accidental scrolls
|
||||||
|
if ((record->event.key.col == 1) && (record->event.key.row == 0)) {
|
||||||
|
lastMidClick = timer_read();
|
||||||
|
is_scroll_clicked = record->event.pressed;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!process_record_user(keycode, record))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (keycode == DPI_CONFIG && record->event.pressed) {
|
||||||
|
keyboard_config.dpi_config = (keyboard_config.dpi_config + 1) % DPI_OPTION_SIZE;
|
||||||
|
eeconfig_update_kb(keyboard_config.raw);
|
||||||
|
adns_set_cpi(dpi_array[keyboard_config.dpi_config]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If Mousekeys is disabled, then use handle the mouse button
|
||||||
|
* keycodes. This makes things simpler, and allows usage of
|
||||||
|
* the keycodes in a consistent manner. But only do this if
|
||||||
|
* Mousekeys is not enable, so it's not handled twice.
|
||||||
|
*/
|
||||||
|
#ifndef MOUSEKEY_ENABLE
|
||||||
|
if (IS_MOUSEKEY_BUTTON(keycode)) {
|
||||||
|
report_mouse_t currentReport = pointing_device_get_report();
|
||||||
|
if (record->event.pressed) {
|
||||||
|
currentReport.buttons |= 1 << (keycode - KC_MS_BTN1);
|
||||||
|
} else {
|
||||||
|
currentReport.buttons &= ~(1 << (keycode - KC_MS_BTN1));
|
||||||
|
}
|
||||||
|
pointing_device_set_report(currentReport);
|
||||||
|
pointing_device_send();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hardware Setup
|
||||||
|
void keyboard_pre_init_kb(void) {
|
||||||
|
// debug_enable = true;
|
||||||
|
// debug_matrix = true;
|
||||||
|
debug_mouse = true;
|
||||||
|
// debug_encoder = true;
|
||||||
|
|
||||||
|
setPinInput(OPT_ENC1);
|
||||||
|
setPinInput(OPT_ENC2);
|
||||||
|
|
||||||
|
/* Ground all output pins connected to ground. This provides additional
|
||||||
|
* pathways to ground. If you're messing with this, know this: driving ANY
|
||||||
|
* of these pins high will cause a short. On the MCU. Ka-blooey.
|
||||||
|
*/
|
||||||
|
#ifdef UNUSED_PINS
|
||||||
|
const pin_t unused_pins[] = UNUSED_PINS;
|
||||||
|
|
||||||
|
for (uint8_t i = 0; i < (sizeof(unused_pins) / sizeof(pin_t)); i++) {
|
||||||
|
setPinOutput(unused_pins[i]);
|
||||||
|
writePinLow(unused_pins[i]);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
keyboard_pre_init_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
void pointing_device_init(void) {
|
||||||
|
adns_init();
|
||||||
|
opt_encoder_init();
|
||||||
|
}
|
||||||
|
|
||||||
|
void pointing_device_task(void) {
|
||||||
|
report_mouse_t mouse_report = pointing_device_get_report();
|
||||||
|
process_wheel(&mouse_report);
|
||||||
|
process_mouse(&mouse_report);
|
||||||
|
pointing_device_set_report(mouse_report);
|
||||||
|
pointing_device_send();
|
||||||
|
}
|
||||||
|
|
||||||
|
void eeconfig_init_kb(void) {
|
||||||
|
keyboard_config.dpi_config = PLOOPY_DPI_DEFAULT;
|
||||||
|
eeconfig_update_kb(keyboard_config.raw);
|
||||||
|
eeconfig_init_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_init_kb(void) {
|
||||||
|
// is safe to just read DPI setting since matrix init
|
||||||
|
// comes before pointing device init.
|
||||||
|
keyboard_config.raw = eeconfig_read_kb();
|
||||||
|
if (keyboard_config.dpi_config > DPI_OPTION_SIZE) {
|
||||||
|
eeconfig_init_kb();
|
||||||
|
}
|
||||||
|
matrix_init_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
void keyboard_post_init_kb(void) {
|
||||||
|
adns_set_cpi(dpi_array[keyboard_config.dpi_config]);
|
||||||
|
|
||||||
|
keyboard_post_init_user();
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
/* Copyright 2021 Colin Lam (Ploopy Corporation)
|
||||||
|
* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <[email protected]>
|
||||||
|
* Copyright 2019 Sunjun Kim
|
||||||
|
* Copyright 2019 Hiroyuki Okada
|
||||||
|
*
|
||||||
|
* 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"
|
||||||
|
#include "adns5050.h"
|
||||||
|
#include "analog.h"
|
||||||
|
#include "opt_encoder.h"
|
||||||
|
#include "pointing_device.h"
|
||||||
|
|
||||||
|
// Sensor defs
|
||||||
|
#define OPT_ENC1 F0
|
||||||
|
#define OPT_ENC2 F4
|
||||||
|
#define OPT_ENC1_MUX 0
|
||||||
|
#define OPT_ENC2_MUX 4
|
||||||
|
|
||||||
|
void process_mouse(report_mouse_t* mouse_report);
|
||||||
|
void process_mouse_user(report_mouse_t* mouse_report, int16_t x, int16_t y);
|
||||||
|
void process_wheel(report_mouse_t* mouse_report);
|
||||||
|
void process_wheel_user(report_mouse_t* mouse_report, int16_t h, int16_t v);
|
||||||
|
|
||||||
|
#define LAYOUT(k00) {{ KC_NO }}
|
||||||
|
|
||||||
|
typedef union {
|
||||||
|
uint32_t raw;
|
||||||
|
struct {
|
||||||
|
uint8_t dpi_config;
|
||||||
|
};
|
||||||
|
} keyboard_config_t;
|
||||||
|
|
||||||
|
extern keyboard_config_t keyboard_config;
|
||||||
|
|
||||||
|
enum ploopy_keycodes {
|
||||||
|
DPI_CONFIG = SAFE_RANGE,
|
||||||
|
PLOOPY_SAFE_RANGE,
|
||||||
|
};
|
||||||
+1
-1
@@ -108,7 +108,7 @@ static uint8_t wheel_unit(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# else /* #ifndef MK_COMBINED */
|
# else /* #ifndef MK_COMBINED */
|
||||||
# ifndef MK_KINETIC_SPEED
|
# ifdef MK_KINETIC_SPEED
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Kinetic movement acceleration algorithm
|
* Kinetic movement acceleration algorithm
|
||||||
|
|||||||
@@ -884,22 +884,6 @@ typedef void (*effect_func_t)(animation_status_t *anim);
|
|||||||
|
|
||||||
// Animation timer -- use system timer (AVR Timer0)
|
// Animation timer -- use system timer (AVR Timer0)
|
||||||
void rgblight_timer_init(void) {
|
void rgblight_timer_init(void) {
|
||||||
// OLD!!!! Animation timer -- AVR Timer3
|
|
||||||
// static uint8_t rgblight_timer_is_init = 0;
|
|
||||||
// if (rgblight_timer_is_init) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// rgblight_timer_is_init = 1;
|
|
||||||
// /* Timer 3 setup */
|
|
||||||
// TCCR3B = _BV(WGM32) // CTC mode OCR3A as TOP
|
|
||||||
// | _BV(CS30); // Clock selelct: clk/1
|
|
||||||
// /* Set TOP value */
|
|
||||||
// uint8_t sreg = SREG;
|
|
||||||
// cli();
|
|
||||||
// OCR3AH = (RGBLED_TIMER_TOP >> 8) & 0xff;
|
|
||||||
// OCR3AL = RGBLED_TIMER_TOP & 0xff;
|
|
||||||
// SREG = sreg;
|
|
||||||
|
|
||||||
rgblight_status.timer_enabled = false;
|
rgblight_status.timer_enabled = false;
|
||||||
RGBLIGHT_SPLIT_SET_CHANGE_TIMER_ENABLE;
|
RGBLIGHT_SPLIT_SET_CHANGE_TIMER_ENABLE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -170,9 +170,6 @@ enum RGBLIGHT_EFFECT_MODE {
|
|||||||
# define RGBLIGHT_LIMIT_VAL 255
|
# define RGBLIGHT_LIMIT_VAL 255
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# define RGBLED_TIMER_TOP F_CPU / (256 * 64)
|
|
||||||
// #define RGBLED_TIMER_TOP 0xFF10
|
|
||||||
|
|
||||||
# include <stdint.h>
|
# include <stdint.h>
|
||||||
# include <stdbool.h>
|
# include <stdbool.h>
|
||||||
# include "eeconfig.h"
|
# include "eeconfig.h"
|
||||||
|
|||||||
Reference in new issue
Block a user