Merge branch 'master' of github.com:jackhumbert/qmk_firmware
commit
101416eb82
@ -0,0 +1,3 @@
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
@ -0,0 +1 @@
|
||||
#include "converter.h"
|
@ -0,0 +1 @@
|
||||
#include "quantum.h"
|
@ -0,0 +1,3 @@
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../../Makefile
|
||||
endif
|
@ -0,0 +1,40 @@
|
||||
Keyboard converter for IBM terminal keyboard
|
||||
============================================
|
||||
|
||||
This is a port of TMK's converter/terminal_usb to QMK.
|
||||
|
||||
It supports PS/2 Scan Code Set 3 and runs on USB AVR chips such like PJRC Teensy.
|
||||
I tested the converter on ATMega32U4 with 1392595(102keys) and 6110345(122keys).
|
||||
|
||||
Source code: https://github.com/tmk/tmk_keyboard
|
||||
Article: http://geekhack.org/index.php?topic=27272.0
|
||||
|
||||
|
||||
CONNECTION
|
||||
----------
|
||||
Keyboard ATMega32U4
|
||||
----------------------
|
||||
Data: PD2
|
||||
Clock: PD5
|
||||
|
||||
And VCC and GND, of course. See RESOURCE for keyboard connector pin assign.
|
||||
|
||||
|
||||
BUILD
|
||||
-----
|
||||
$ git clone https://github.com/tmk/tmk_keyboard.git
|
||||
$ cd converter/terminal_usb
|
||||
$ make
|
||||
|
||||
|
||||
RESOURCE
|
||||
--------
|
||||
Soarer's Converter: http://geekhack.org/index.php?topic=17458.0
|
||||
102keys(1392595): http://geekhack.org/index.php?topic=10737.0
|
||||
122keys(1390876): http://www.seasip.info/VintagePC/ibm_1390876.html
|
||||
KbdBabel: http://www.kbdbabel.org/
|
||||
RJ45 Connector: http://www.kbdbabel.org/conn/kbd_connector_ibmterm.png
|
||||
DIN Connector: http://www.kbdbabel.org/conn/kbd_connector_ibm3179_318x_319x.png
|
||||
WinAVR: http://winavr.sourceforge.net/
|
||||
|
||||
EOF
|
@ -0,0 +1,138 @@
|
||||
/*
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
Copyright 2016 Priyadi Iman Nurcahyo <priyadi@priyadi.net>
|
||||
|
||||
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/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x6535
|
||||
#define DEVICE_VER 0x0100
|
||||
#define MANUFACTURER QMK
|
||||
#define PRODUCT IBM Terminal Keyboard
|
||||
#define DESCRIPTION USB converter for IBM Terminal Keyboard
|
||||
|
||||
|
||||
/* matrix size */
|
||||
#define MATRIX_ROWS 17 // keycode bit: 3-0
|
||||
#define MATRIX_COLS 8 // keycode bit: 6-4
|
||||
|
||||
|
||||
/* legacy keymap support */
|
||||
#define USE_LEGACY_KEYMAP
|
||||
|
||||
|
||||
/* key combination for command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT) | MOD_BIT(KC_RALT) | MOD_BIT(KC_RCTL)) \
|
||||
)
|
||||
|
||||
|
||||
/*
|
||||
* PS/2 USART configuration for ATMega32U4
|
||||
*/
|
||||
#ifdef PS2_USE_USART
|
||||
/* XCK for clock line */
|
||||
#define PS2_CLOCK_PORT PORTD
|
||||
#define PS2_CLOCK_PIN PIND
|
||||
#define PS2_CLOCK_DDR DDRD
|
||||
#define PS2_CLOCK_BIT 5
|
||||
/* RXD for data line */
|
||||
#define PS2_DATA_PORT PORTD
|
||||
#define PS2_DATA_PIN PIND
|
||||
#define PS2_DATA_DDR DDRD
|
||||
#define PS2_DATA_BIT 2
|
||||
|
||||
/* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */
|
||||
/* set DDR of CLOCK as input to be slave */
|
||||
#define PS2_USART_INIT() do { \
|
||||
PS2_CLOCK_DDR &= ~(1<<PS2_CLOCK_BIT); \
|
||||
PS2_DATA_DDR &= ~(1<<PS2_DATA_BIT); \
|
||||
UCSR1C = ((1 << UMSEL10) | \
|
||||
(3 << UPM10) | \
|
||||
(0 << USBS1) | \
|
||||
(3 << UCSZ10) | \
|
||||
(0 << UCPOL1)); \
|
||||
UCSR1A = 0; \
|
||||
UBRR1H = 0; \
|
||||
UBRR1L = 0; \
|
||||
} while (0)
|
||||
#define PS2_USART_RX_INT_ON() do { \
|
||||
UCSR1B = ((1 << RXCIE1) | \
|
||||
(1 << RXEN1)); \
|
||||
} while (0)
|
||||
#define PS2_USART_RX_POLL_ON() do { \
|
||||
UCSR1B = (1 << RXEN1); \
|
||||
} while (0)
|
||||
#define PS2_USART_OFF() do { \
|
||||
UCSR1C = 0; \
|
||||
UCSR1B &= ~((1 << RXEN1) | \
|
||||
(1 << TXEN1)); \
|
||||
} while (0)
|
||||
#define PS2_USART_RX_READY (UCSR1A & (1<<RXC1))
|
||||
#define PS2_USART_RX_DATA UDR1
|
||||
#define PS2_USART_ERROR (UCSR1A & ((1<<FE1) | (1<<DOR1) | (1<<UPE1)))
|
||||
#define PS2_USART_RX_VECT USART1_RX_vect
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* PS/2 Interrupt configuration
|
||||
*/
|
||||
#ifdef PS2_USE_INT
|
||||
/* uses INT1 for clock line(ATMega32U4) */
|
||||
#define PS2_CLOCK_PORT PORTD
|
||||
#define PS2_CLOCK_PIN PIND
|
||||
#define PS2_CLOCK_DDR DDRD
|
||||
#define PS2_CLOCK_BIT 1
|
||||
|
||||
#define PS2_DATA_PORT PORTD
|
||||
#define PS2_DATA_PIN PIND
|
||||
#define PS2_DATA_DDR DDRD
|
||||
#define PS2_DATA_BIT 0
|
||||
|
||||
#define PS2_INT_INIT() do { \
|
||||
EICRA |= ((1<<ISC11) | \
|
||||
(0<<ISC10)); \
|
||||
} while (0)
|
||||
#define PS2_INT_ON() do { \
|
||||
EIMSK |= (1<<INT1); \
|
||||
} while (0)
|
||||
#define PS2_INT_OFF() do { \
|
||||
EIMSK &= ~(1<<INT1); \
|
||||
} while (0)
|
||||
#define PS2_INT_VECT INT1_vect
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* PS/2 Busywait configuration
|
||||
*/
|
||||
#ifdef PS2_USE_BUSYWAIT
|
||||
#define PS2_CLOCK_PORT PORTD
|
||||
#define PS2_CLOCK_PIN PIND
|
||||
#define PS2_CLOCK_DDR DDRD
|
||||
#define PS2_CLOCK_BIT 1
|
||||
|
||||
#define PS2_DATA_PORT PORTD
|
||||
#define PS2_DATA_PIN PIND
|
||||
#define PS2_DATA_DDR DDRD
|
||||
#define PS2_DATA_BIT 0
|
||||
#endif
|
||||
|
||||
#endif
|
@ -0,0 +1,6 @@
|
||||
#include "ibm_terminal.h"
|
||||
|
||||
// void matrix_init_kb(void) {
|
||||
|
||||
// matrix_init_user();
|
||||
// }
|
@ -0,0 +1,82 @@
|
||||
#ifndef IBM_TERMINAL_H
|
||||
#define IBM_TERMINAL_H
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
void matrix_init_user(void);
|
||||
|
||||
/*
|
||||
* IBM Terminal keyboard 6110345(122keys)/1392595(102keys)
|
||||
* http://geekhack.org/showthread.php?10737-What-Can-I-Do-With-a-Terminal-Model-M
|
||||
* http://www.seasip.info/VintagePC/ibm_1391406.html
|
||||
*
|
||||
* Keymap array:
|
||||
* 8 bytes
|
||||
* +---------+
|
||||
* 0| |
|
||||
* :| | 0x00-0x87
|
||||
* ;| |
|
||||
* 17| |
|
||||
* +---------+
|
||||
*/
|
||||
#define KEYMAP( \
|
||||
K08,K10,K18,K20,K28,K30,K38,K40,K48,K50,K57,K5F, \
|
||||
K07,K0F,K17,K1F,K27,K2F,K37,K3F,K47,K4F,K56,K5E, \
|
||||
\
|
||||
K05,K06, K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K5D,K66, K67,K6E,K6F, K76,K77,K7E,K84, \
|
||||
K04,K0C, K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B, K5C, K64,K65,K6D, K6C,K75,K7D,K7C, \
|
||||
K03,K0B, K14,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K53,K5A, K63, K6B,K73,K74,K7B, \
|
||||
K83,K0A, K12,K13,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K51,K59, K61,K62,K6A, K69,K72,K7A,K79, \
|
||||
K01,K09, K11, K19, K29, K39, K58, K60, K68,K70,K71,K78 \
|
||||
) { \
|
||||
{ KC_NO, K01, KC_NO, K03, K04, K05, K06, K07 }, \
|
||||
{ K08, K09, K0A, K0B, K0C, K0D, K0E, K0F }, \
|
||||
{ K10, K11, K12, K13, K14, K15, K16, K17 }, \
|
||||
{ K18, K19, K1A, K1B, K1C, K1D, K1E, K1F }, \
|
||||
{ K20, K21, K22, K23, K24, K25, K26, K27 }, \
|
||||
{ K28, K29, K2A, K2B, K2C, K2D, K2E, K2F }, \
|
||||
{ K30, K31, K32, K33, K34, K35, K36, K37 }, \
|
||||
{ K38, K39, K3A, K3B, K3C, K3D, K3E, K3F }, \
|
||||
{ K40, K41, K42, K43, K44, K45, K46, K47 }, \
|
||||
{ K48, K49, K4A, K4B, K4C, K4D, K4E, K4F }, \
|
||||
{ K50, K51, K52, K53, K54, K55, K56, K57 }, \
|
||||
{ K58, K59, K5A, K5B, K5C, K5D, K5E, K5F }, \
|
||||
{ K60, K61, K62, K63, K64, K65, K66, K67 }, \
|
||||
{ K68, K69, K6A, K6B, K6C, K6D, K6E, K6F }, \
|
||||
{ K70, K71, K72, K73, K74, K75, K76, K77 }, \
|
||||
{ K78, K79, K7A, K7B, K7C, K7D, K7E, KC_NO }, \
|
||||
{ KC_NO, KC_NO, KC_NO, K83, K84, KC_NO, KC_NO, KC_NO,}, \
|
||||
}
|
||||
|
||||
/*
|
||||
* IBM Terminal keyboard 1399625, 101-key
|
||||
*/
|
||||
#define KEYMAP_101( \
|
||||
K08, K07,K0F,K17,K1F,K27,K2F,K37,K3F,K47,K4F,K56,K5E, K57,K5F,K62, \
|
||||
\
|
||||
K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, K67,K6E,K6F, K76,K77,K7E,K84, \
|
||||
K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5C, K64,K65,K6D, K6C,K75,K7D, \
|
||||
K14,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K7C, \
|
||||
K12, K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, K63, K69,K72,K7A, \
|
||||
K11, K19, K29, K39, K58, K61,K60,K6A, K70, K71,K79 \
|
||||
) { \
|
||||
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K07 }, \
|
||||
{ K08, KC_NO, KC_NO, KC_NO, KC_NO, K0D, K0E, K0F }, \
|
||||
{ KC_NO, K11, K12, KC_NO, K14, K15, K16, K17 }, \
|
||||
{ KC_NO, K19, K1A, K1B, K1C, K1D, K1E, K1F }, \
|
||||
{ KC_NO, K21, K22, K23, K24, K25, K26, K27 }, \
|
||||
{ KC_NO, K29, K2A, K2B, K2C, K2D, K2E, K2F }, \
|
||||
{ KC_NO, K31, K32, K33, K34, K35, K36, K37 }, \
|
||||
{ KC_NO, K39, K3A, K3B, K3C, K3D, K3E, K3F }, \
|
||||
{ KC_NO, K41, K42, K43, K44, K45, K46, K47 }, \
|
||||
{ KC_NO, K49, K4A, K4B, K4C, K4D, K4E, K4F }, \
|
||||
{ KC_NO, KC_NO, K52, KC_NO, K54, K55, K56, K57 }, \
|
||||
{ K58, K59, K5A, K5B, K5C, KC_NO, K5E, K5F }, \
|
||||
{ K60, K61, K62, K63, K64, K65, K66, K67 }, \
|
||||
{ KC_NO, K69, K6A, K6B, K6C, K6D, K6E, K6F }, \
|
||||
{ K70, K71, K72, K73, K74, K75, K76, K77 }, \
|
||||
{ KC_NO, K79, K7A, KC_NO, K7C, K7D, K7E, KC_NO }, \
|
||||
{ KC_NO, KC_NO, KC_NO, KC_NO, K84, KC_NO, KC_NO, KC_NO,}, \
|
||||
}
|
||||
|
||||
#endif
|
@ -0,0 +1,27 @@
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= no # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= no # Commands for debug and configuration
|
||||
NKRO_ENABLE ?= yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
UNICODEMAP_ENABLE ?= yes
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
PS2_USE_USART ?= yes
|
||||
API_SYSEX_ENABLE ?= no
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../../Makefile
|
||||
endif
|
||||
|
@ -0,0 +1,6 @@
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "../../config.h"
|
||||
|
||||
#endif
|
@ -0,0 +1,69 @@
|
||||
/*
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "keycode.h"
|
||||
#include "print.h"
|
||||
#include "debug.h"
|
||||
#include "util.h"
|
||||
#include "ibm_terminal.h"
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
// Layer 0
|
||||
|
||||
KEYMAP(
|
||||
KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24,
|
||||
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_ESC, 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_NO, KC_BSPC, KC_INS, KC_HOME,KC_PGUP, KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS,
|
||||
KC_SLCK,KC_INT4, 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_NO, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS,
|
||||
KC_PAUS,KC_INT5, KC_LCTL,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_BSLS,KC_ENT, KC_UP, KC_P4, KC_P5, KC_P6, KC_PCMM,
|
||||
KC_APP, KC_INT6, KC_LSFT,KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_NO, KC_RSFT, KC_LEFT,KC_INT2,KC_RGHT, KC_P1, KC_P2, KC_P3, KC_PENT,
|
||||
KC_RGUI,KC_LGUI, KC_LCTL, KC_LALT, KC_SPC, KC_LGUI, KC_GRV, KC_DOWN, KC_NO, KC_P0, KC_PDOT,KC_NO
|
||||
),
|
||||
|
||||
/* 101-key keymaps
|
||||
*/
|
||||
/* 0: default
|
||||
* ,---. ,---------------. ,---------------. ,---------------. ,-----------.
|
||||
* |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|
|
||||
* `---' `---------------' `---------------' `---------------' `-----------'
|
||||
* ,-----------------------------------------------------------. ,-----------. ,---------------.
|
||||
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| |Ins|Hom|PgU| |NmL| /| *| -|
|
||||
* |-----------------------------------------------------------| |-----------| |---------------|
|
||||
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| | 7| 8| 9| |
|
||||
* |-----------------------------------------------------------| `-----------' |-----------| +|
|
||||
* |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Return | | 4| 5| 6| |
|
||||
* |-----------------------------------------------------------| ,---. |---------------|
|
||||
* |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | |Up | | 1| 2| 3| |
|
||||
* |-----------------------------------------------------------| ,-----------. |-----------|Ent|
|
||||
* |Ctrl| |Alt | Space |Alt | |Ctrl| |Lef|Dow|Rig| | 0| .| |
|
||||
* `----' `---------------------------------------' `----' `-----------' `---------------'
|
||||
*/
|
||||
/*
|
||||
KEYMAP_101(
|
||||
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_BRK,
|
||||
|
||||
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_INS,KC_HOME,KC_PGUP, KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS,
|
||||
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_P7, KC_P8, KC_P9,
|
||||
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_P4, KC_P5, KC_P6,KC_PPLS,
|
||||
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_P1, KC_P2, KC_P3,
|
||||
KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT, KC_P0, KC_PDOT,KC_PENT
|
||||
),
|
||||
*/
|
||||
};
|
@ -0,0 +1,27 @@
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= no # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= no # Commands for debug and configuration
|
||||
NKRO_ENABLE ?= yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
UNICODEMAP_ENABLE ?= yes
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
PS2_USE_USART ?= yes
|
||||
API_SYSEX_ENABLE ?= no
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../../Makefile
|
||||
endif
|
||||
|
@ -0,0 +1,6 @@
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "../../config.h"
|
||||
|
||||
#endif
|
@ -0,0 +1,312 @@
|
||||
/*
|
||||
Copyright 2016 Priyadi Iman Nurcahyo <priyadi@priyadi.net>
|
||||
|
||||
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 "keycode.h"
|
||||
#include "print.h"
|
||||
#include "debug.h"
|
||||
#include "util.h"
|
||||
#include "ibm_terminal.h"
|
||||
#include "action_layer.h"
|
||||
|
||||
// Fillers to make layering clearer
|
||||
|
||||
#define _______ KC_TRNS
|
||||
#define XXXXXXX KC_NO
|
||||
|
||||
enum layers {
|
||||
QWE, // qwerty
|
||||
COL, // colemak
|
||||
WOR, // workman
|
||||
DVO, // dvorak
|
||||
|
||||
MOU, // mouse keys
|
||||
EMO, // emoji
|
||||
SYS, // system
|
||||
};
|
||||
|
||||
enum keycodes {
|
||||
// default layout switcher
|
||||
LAY_QWE = SAFE_RANGE,
|
||||
LAY_COL,
|
||||
LAY_WOR,
|
||||
LAY_DVO,
|
||||
|
||||
// layer switchers
|
||||
LYR_SYS,
|
||||
LYR_EMO,
|
||||
|
||||
// os switchers
|
||||
OS_LIN,
|
||||
OS_WIN,
|
||||
OS_MAC,
|
||||
};
|
||||
|
||||
// unicode map
|
||||
|
||||
enum unicode_name {
|
||||
GRIN, // grinning face 😊
|
||||
TJOY, // tears of joy 😂
|
||||
SMILE, // grining face with smiling eyes 😁
|
||||
HEART, // heart ❤
|
||||
EYERT, // smiling face with heart shaped eyes 😍
|
||||
CRY, // crying face 😭
|
||||
SMEYE, // smiling face with smiling eyes 😊
|
||||
UNAMU, // unamused 😒
|
||||
KISS, // kiss 😘
|
||||
HART2, // two hearts 💕
|
||||
WEARY, // weary 😩
|
||||
OKHND, // ok hand sign 👌
|
||||
PENSV, // pensive 😔
|
||||
SMIRK, // smirk 😏
|
||||
RECYC, // recycle ♻
|
||||
WINK, // wink 😉
|
||||
THMUP, // thumb up 👍
|
||||
THMDN, // thumb down 👎
|
||||
PRAY, // pray 🙏
|
||||
PHEW, // relieved 😌
|
||||
MUSIC, // musical notes
|
||||
FLUSH, // flushed 😳
|
||||
CELEB, // celebration 🙌
|
||||
CRY2, // crying face 😢
|
||||
COOL, // smile with sunglasses 😎
|
||||
NOEVS, // see no evil
|
||||
NOEVH, // hear no evil
|
||||
NOEVK, // speak no evil
|
||||
POO, // pile of poo
|
||||
EYES, // eyes
|
||||
VIC, // victory hand
|
||||
BHART, // broken heart
|
||||
SLEEP, // sleeping face
|
||||
SMIL2, // smiling face with open mouth & sweat
|
||||
HUNRD, // 100
|
||||
CONFU, // confused
|
||||
TONGU, // face with tongue & winking eye
|
||||
DISAP, // disappointed
|
||||
YUMMY, // face savoring delicious food
|
||||
CLAP, // hand clapping
|
||||
FEAR, // face screaming in fear
|
||||
HORNS, // smiling face with horns
|
||||
HALO, // smiling face with halo
|
||||
BYE, // waving hand
|
||||
SUN, // sun
|
||||
MOON, // moon
|
||||
SKULL, // skull
|
||||
};
|
||||
|
||||
const uint32_t PROGMEM unicode_map[] = {
|
||||
[GRIN] = 0x1F600,
|
||||
[TJOY] = 0x1F602,
|
||||
[SMILE] = 0x1F601,
|
||||
[HEART] = 0x2764,
|
||||
[EYERT] = 0x1f60d,
|
||||
[CRY] = 0x1f62d,
|
||||
[SMEYE] = 0x1F60A,
|
||||
[UNAMU] = 0x1F612,
|
||||
[KISS] = 0x1F618,
|
||||
[HART2] = 0x1F495,
|
||||
[WEARY] = 0x1F629,
|
||||
[OKHND] = 0x1F44C,
|
||||
[PENSV] = 0x1F614,
|
||||
[SMIRK] = 0x1F60F,
|
||||
[RECYC] = 0x267B,
|
||||
[WINK] = 0x1F609,
|
||||
[THMUP] = 0x1F44D,
|
||||
[THMDN] = 0x1F44E,
|
||||
[PRAY] = 0x1F64F,
|
||||
[PHEW] = 0x1F60C,
|
||||
[MUSIC] = 0x1F3B6,
|
||||
[FLUSH] = 0x1F633,
|
||||
[CELEB] = 0x1F64C,
|
||||
[CRY2] = 0x1F622,
|
||||
[COOL] = 0x1F60E,
|
||||
[NOEVS] = 0x1F648,
|
||||
[NOEVH] = 0x1F649,
|
||||
[NOEVK] = 0x1F64A,
|
||||
[POO] = 0x1F4A9,
|
||||
[EYES] = 0x1F440,
|
||||
[VIC] = 0x270C,
|
||||
[BHART] = 0x1F494,
|
||||
[SLEEP] = 0x1F634,
|
||||
[SMIL2] = 0x1F605,
|
||||
[HUNRD] = 0x1F4AF,
|
||||
[CONFU] = 0x1F615,
|
||||
[TONGU] = 0x1F61C,
|
||||
[DISAP] = 0x1F61E,
|
||||
[YUMMY] = 0x1F60B,
|
||||
[CLAP] = 0x1F44F,
|
||||
[FEAR] = 0x1F631,
|
||||
[HORNS] = 0x1F608,
|
||||
[HALO] = 0x1F607,
|
||||
[BYE] = 0x1F44B,
|
||||
[SUN] = 0x2600,
|
||||
[MOON] = 0x1F314,
|
||||
[SKULL] = 0x1F480,
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* qwerty */
|
||||
[QWE] = KEYMAP(
|
||||
KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_PSCR, KC_SLCK, KC_PAUS,
|
||||
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
|
||||
|
||||
MO(EMO), MO(SYS), 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, XXXXXXX, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
|
||||
KC_MNXT, KC_VOLU, 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, XXXXXXX, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS,
|
||||
KC_MPLY, KC_MUTE, 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_BSLS, KC_ENT, KC_UP, KC_P4, KC_P5, KC_P6, KC_PCMM,
|
||||
KC_MPRV, KC_VOLD, KC_LSFT, KC_GRV, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, XXXXXXX, KC_RSFT, KC_LEFT, TG(MOU), KC_RGHT, KC_P1, KC_P2, KC_P3, KC_PENT,
|
||||
KC_LGUI, KC_APP, KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_DOWN, XXXXXXX, KC_P0, KC_PDOT, XXXXXXX
|
||||
),
|
||||
|
||||
/* colemak */
|
||||
[COL] = KEYMAP(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
/* workman */
|
||||
[WOR] = KEYMAP(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_LBRC, KC_RBRC, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, KC_QUOT, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
/* dvorak */
|
||||
[DVO] = KEYMAP(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LBRC, KC_RBRC, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
/* system */
|
||||
[SYS] = KEYMAP(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, LAY_QWE, OS_WIN, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, LAY_DVO, _______, _______, _______, _______, LAY_WOR, OS_LIN, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, LAY_COL, _______, _______, _______, OS_MAC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
/* mouse keys */
|
||||
[MOU] = KEYMAP(
|
||||
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, 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, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, KC_BTN4, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MS_U, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, KC_BTN5, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MS_L, _______, KC_MS_R, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
KC_BTN1, KC_BTN3, KC_BTN2, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MS_D, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
|
||||
),
|
||||
|
||||
/* emoji */
|
||||
[EMO] = KEYMAP(
|
||||
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, 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, XXXXXXX, X(CRY2),X(WEARY),X(EYERT),X(SMIRK), X(TJOY), X(RECYC),X(UNAMU),X(MUSIC),X(OKHND),X(PENSV),XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, X(PRAY),X(SMILE),X(SMIL2),X(FLUSH), X(GRIN), X(HEART),X(BYE), X(KISS), X(CELEB),X(COOL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,X(SLEEP),X(CLAP), X(CRY), X(VIC), X(BHART),X(SUN), X(SMEYE),X(WINK), X(MOON), X(CONFU), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
|
||||
),
|
||||
|
||||
/*
|
||||
[XXX] = KEYMAP(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
*/
|
||||
};
|
||||
|
||||
void persistant_default_layer_set(uint16_t default_layer) {
|
||||
eeconfig_update_default_layer(default_layer);
|
||||
default_layer_set(default_layer);
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
/* layout switcher */
|
||||
case LAY_QWE:
|
||||
if (record->event.pressed) {
|
||||
persistant_default_layer_set(1UL<<QWE);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case LAY_COL:
|
||||
if (record->event.pressed) {
|
||||
persistant_default_layer_set(1UL<<COL);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case LAY_WOR:
|
||||
if (record->event.pressed) {
|
||||
persistant_default_layer_set(1UL<<WOR);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case LAY_DVO:
|
||||
if (record->event.pressed) {
|
||||
persistant_default_layer_set(1UL<<DVO);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
|
||||
/* os switcher */
|
||||
case OS_LIN:
|
||||
set_unicode_input_mode(UC_LNX);
|
||||
return false;
|
||||
break;
|
||||
case OS_WIN:
|
||||
set_unicode_input_mode(UC_WINC);
|
||||
return false;
|
||||
break;
|
||||
case OS_MAC:
|
||||
set_unicode_input_mode(UC_OSX);
|
||||
return false;
|
||||
break;
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void matrix_init_user() {
|
||||
set_unicode_input_mode(UC_LNX);
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
/*
|
||||
Copyright 2011 Jun Wako <wakojun@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "stdint.h"
|
||||
#include "ps2.h"
|
||||
#include "led.h"
|
||||
|
||||
|
||||
void led_set(uint8_t usb_led)
|
||||
{
|
||||
uint8_t ps2_led = 0;
|
||||
if (usb_led & (1<<USB_LED_SCROLL_LOCK))
|
||||
ps2_led |= (1<<PS2_LED_SCROLL_LOCK);
|
||||
if (usb_led & (1<<USB_LED_NUM_LOCK))
|
||||
ps2_led |= (1<<PS2_LED_NUM_LOCK);
|
||||
if (usb_led & (1<<USB_LED_CAPS_LOCK))
|
||||
ps2_led |= (1<<PS2_LED_CAPS_LOCK);
|
||||
ps2_host_set_led(ps2_led);
|
||||
}
|
@ -0,0 +1,237 @@
|
||||
/*
|
||||
Copyright 2011 Jun Wako <wakojun@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <avr/io.h>
|
||||
#include <util/delay.h>
|
||||
#include "print.h"
|
||||
#include "util.h"
|
||||
#include "debug.h"
|
||||
#include "ps2.h"
|
||||
#include "matrix.h"
|
||||
|
||||
#define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
|
||||
#define print_matrix_header() print("\nr/c 01234567\n")
|
||||
#define matrix_bitpop(i) bitpop(matrix[i])
|
||||
#define ROW_SHIFTER ((uint8_t)1)
|
||||
|
||||
|
||||
static void matrix_make(uint8_t code);
|
||||
static void matrix_break(uint8_t code);
|
||||
|
||||
|
||||
/*
|
||||
* Matrix Array usage:
|
||||
* 'Scan Code Set 3' is assigned into 17x8 cell matrix.
|
||||
*
|
||||
* 8bit wide
|
||||
* +---------+
|
||||
* 0| |
|
||||
* :| | 0x00-0x87
|
||||
* ;| |
|
||||
* 17| |
|
||||
* +---------+
|
||||
*/
|
||||
static uint8_t matrix[MATRIX_ROWS];
|
||||
#define ROW(code) (code>>3)
|
||||
#define COL(code) (code&0x07)
|
||||
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_init_user(void) {
|
||||
}
|
||||
|
||||
void matrix_init(void)
|
||||
{
|
||||
debug_enable = true;
|
||||
//debug_matrix = true;
|
||||
//debug_keyboard = true;
|
||||
//debug_mouse = false;
|
||||
|
||||
ps2_host_init();
|
||||
|
||||
// initialize matrix state: all keys off
|
||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00;
|
||||
|
||||
matrix_init_user();
|
||||
return;
|
||||
}
|
||||
|
||||
uint8_t matrix_scan(void)
|
||||
{
|
||||
|
||||
// scan code reading states
|
||||
static enum {
|
||||
RESET,
|
||||
RESET_RESPONSE,
|
||||
KBD_ID0,
|
||||
KBD_ID1,
|
||||
CONFIG,
|
||||
READY,
|
||||
F0,
|
||||
} state = RESET;
|
||||
|
||||
uint8_t code;
|
||||
if ((code = ps2_host_recv())) {
|
||||
debug("r"); debug_hex(code); debug(" ");
|
||||
}
|
||||
|
||||
switch (state) {
|
||||
case RESET:
|
||||
debug("wFF ");
|
||||
if (ps2_host_send(0xFF) == 0xFA) {
|
||||
debug("[ack]\nRESET_RESPONSE: ");
|
||||
state = RESET_RESPONSE;
|
||||
}
|
||||
break;
|
||||
case RESET_RESPONSE:
|
||||
if (code == 0xAA) {
|
||||
debug("[ok]\nKBD_ID: ");
|
||||
state = KBD_ID0;
|
||||
} else if (code) {
|
||||
debug("err\nRESET: ");
|
||||
state = RESET;
|
||||
}
|
||||
break;
|
||||
// after reset receive keyboad ID(2 bytes)
|
||||
case KBD_ID0:
|
||||
if (code) {
|
||||
state = KBD_ID1;
|
||||
}
|
||||
break;
|
||||
case KBD_ID1:
|
||||
if (code) {
|
||||
debug("\nCONFIG: ");
|
||||
state = CONFIG;
|
||||
}
|
||||
break;
|
||||
case CONFIG:
|
||||
debug("wF8 ");
|
||||
if (ps2_host_send(0xF8) == 0xFA) {
|
||||
debug("[ack]\nREADY\n");
|
||||
state = READY;
|
||||
}
|
||||
break;
|
||||
case READY:
|
||||
switch (code) {
|
||||
case 0x00:
|
||||
break;
|
||||
case 0xF0:
|
||||
state = F0;
|
||||
debug(" ");
|
||||
break;
|
||||
default: // normal key make
|
||||
if (code < 0x88) {
|
||||
matrix_make(code);
|
||||
} else {
|
||||
debug("unexpected scan code at READY: "); debug_hex(code); debug("\n");
|
||||
}
|
||||
state = READY;
|
||||
debug("\n");
|
||||
}
|
||||
break;
|
||||
case F0: // Break code
|
||||
switch (code) {
|
||||
case 0x00:
|
||||
break;
|
||||
default:
|
||||
if (code < 0x88) {
|
||||
matrix_break(code);
|
||||
} else {
|
||||
debug("unexpected scan code at F0: "); debug_hex(code); debug("\n");
|
||||
}
|
||||
state = READY;
|
||||
debug("\n");
|
||||
}
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
inline
|
||||
uint8_t matrix_get_row(uint8_t row)
|
||||
{
|
||||
return matrix[row];
|
||||
}
|
||||
|
||||
inline
|
||||
static void matrix_make(uint8_t code)
|
||||
{
|
||||
if (!matrix_is_on(ROW(code), COL(code))) {
|
||||
matrix[ROW(code)] |= 1<<COL(code);
|
||||
}
|
||||
}
|
||||
|
||||
inline
|
||||
static void matrix_break(uint8_t code)
|
||||
{
|
||||
if (matrix_is_on(ROW(code), COL(code))) {
|
||||
matrix[ROW(code)] &= ~(1<<COL(code));
|
||||
}
|
||||
}
|
||||
|
||||
bool matrix_is_on(uint8_t row, uint8_t col)
|
||||
{
|
||||
return (matrix_get_row(row) & (1<<col));
|
||||
}
|
||||
|
||||
void matrix_print(void)
|
||||
{
|
||||
#if (MATRIX_COLS <= 8)
|
||||
print("r/c 01234567\n");
|
||||
#elif (MATRIX_COLS <= 16)
|
||||
print("r/c 0123456789ABCDEF\n");
|
||||
#elif (MATRIX_COLS <= 32)
|
||||
print("r/c 0123456789ABCDEF0123456789ABCDEF\n");
|
||||
#endif
|
||||
|
||||
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||
|
||||
#if (MATRIX_COLS <= 8)
|
||||
xprintf("%02X: %08b%s\n", row, bitrev(matrix_get_row(row)),
|
||||
#elif (MATRIX_COLS <= 16)
|
||||
xprintf("%02X: %016b%s\n", row, bitrev16(matrix_get_row(row)),
|
||||
#elif (MATRIX_COLS <= 32)
|
||||
xprintf("%02X: %032b%s\n", row, bitrev32(matrix_get_row(row)),
|
||||
#endif
|
||||
#ifdef MATRIX_HAS_GHOST
|
||||
matrix_has_ghost_in_row(row) ? " <ghost" : ""
|
||||
#else
|
||||
""
|
||||
#endif
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef MATRIX_HAS_GHOST
|
||||
__attribute__ ((weak))
|
||||
bool matrix_has_ghost_in_row(uint8_t row)
|
||||
{
|
||||
matrix_row_t matrix_row = matrix_get_row(row);
|
||||
// No ghost exists when less than 2 keys are down on the row
|
||||
if (((matrix_row - 1) & matrix_row) == 0)
|
||||
return false;
|
||||
|
||||
// Ghost occurs when the row shares column line with other row
|
||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||
if (i != row && (matrix_get_row(i) & matrix_row))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
@ -0,0 +1,72 @@
|
||||
# MCU name
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= no # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= no # Commands for debug and configuration
|
||||
NKRO_ENABLE ?= yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
UNICODEMAP_ENABLE ?= yes
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
PS2_USE_USART ?= yes
|
||||
API_SYSEX_ENABLE ?= n
|
||||
CUSTOM_MATRIX = yes
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
|
||||
SRC = matrix.c led.c
|
@ -0,0 +1,140 @@
|
||||
#include "ergodox.h"
|
||||
#include "debug.h"
|
||||
#include "action_layer.h"
|
||||
#include "version.h"
|
||||
|
||||
#define BASE 0 // default layer
|
||||
#define SYMB 1 // symbols
|
||||
#define MDIA 2 // media keys
|
||||
|
||||
enum custom_keycodes {
|
||||
PLACEHOLDER = SAFE_RANGE, // can always be here
|
||||
EPRM,
|
||||
VRSN,
|
||||
RGB_SLD
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap 0: Basic layer
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | Del | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | BkSp | A | S | D | F | G |------| |------| H | J | K | L |; / L2|' / Cmd |
|
||||
* |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------|
|
||||
* | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | App | LGui | | Alt |Ctrl/Esc|
|
||||
* ,------|------|------| |------+--------+------.
|
||||
* | | | Home | | PgUp | | |
|
||||
* | Space|Backsp|------| |------| Tab |Enter |
|
||||
* | |ace | End | | PgDn | | |
|
||||
* `--------------------' `----------------------'
|
||||
*/
|
||||
// If it accepts an argument (i.e, is a function), it doesn't need KC_.
|
||||
// Otherwise, it needs KC_*
|
||||
[BASE] = KEYMAP( // layer 0 : default
|
||||
// left hand
|
||||
EPRM, EPRM, EPRM, EPRM, EPRM, EPRM, EPRM,
|
||||
EPRM, EPRM, EPRM, EPRM, EPRM, EPRM, EPRM,
|
||||
EPRM, EPRM, EPRM, EPRM, EPRM, EPRM,
|
||||
EPRM, EPRM, EPRM, EPRM, EPRM, EPRM, EPRM,
|
||||
EPRM, EPRM, EPRM, EPRM,EPRM,
|
||||
EPRM, EPRM,
|
||||
EPRM,
|
||||
EPRM,EPRM,EPRM,
|
||||
// right hand
|
||||
EPRM, EPRM, EPRM, EPRM, EPRM, EPRM, EPRM,
|
||||
EPRM, EPRM, EPRM, EPRM, EPRM, EPRM, EPRM,
|
||||
EPRM, EPRM, EPRM, EPRM, EPRM,EPRM,
|
||||
EPRM,EPRM, EPRM, EPRM,EPRM, EPRM, EPRM,
|
||||
EPRM, EPRM,EPRM,EPRM, EPRM,
|
||||
EPRM, EPRM,
|
||||
EPRM,
|
||||
EPRM,EPRM, EPRM
|
||||
)
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols)
|
||||
};
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
// MACRODOWN only works in this function
|
||||
switch(id) {
|
||||
case 0:
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (record->event.pressed) { // For resetting EEPROM
|
||||
eeconfig_init();
|
||||
}
|
||||
break;
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
// dynamically generate these.
|
||||
case EPRM:
|
||||
if (record->event.pressed) {
|
||||
eeconfig_init();
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case VRSN:
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case RGB_SLD:
|
||||
if (record->event.pressed) {
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
rgblight_mode(1);
|
||||
#endif
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Runs just one time when the keyboard initializes.
|
||||
void matrix_init_user(void) {
|
||||
|
||||
};
|
||||
|
||||
|
||||
// Runs constantly in the background, in a loop.
|
||||
void matrix_scan_user(void) {
|
||||
|
||||
uint8_t layer = biton32(layer_state);
|
||||
|
||||
ergodox_board_led_off();
|
||||
ergodox_right_led_1_off();
|
||||
ergodox_right_led_2_off();
|
||||
ergodox_right_led_3_off();
|
||||
switch (layer) {
|
||||
// TODO: Make this relevant to the ErgoDox EZ.
|
||||
case 1:
|
||||
ergodox_right_led_1_on();
|
||||
break;
|
||||
case 2:
|
||||
ergodox_right_led_2_on();
|
||||
break;
|
||||
default:
|
||||
// none
|
||||
break;
|
||||
}
|
||||
|
||||
};
|
@ -0,0 +1,3 @@
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../../Makefile
|
||||
endif
|
@ -0,0 +1,162 @@
|
||||
/*
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x6060
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER You
|
||||
#define PRODUCT pilcrow
|
||||
#define DESCRIPTION A custom keyboard
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 4
|
||||
#define MATRIX_COLS 10
|
||||
|
||||
/*
|
||||
* 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 { B4, F7, B1, B3 }
|
||||
#define MATRIX_COL_PINS { D4, C6, D7, E6, F5, F6, B6, B2, F4, B5}
|
||||
#define UNUSED_PINS
|
||||
|
||||
/* COL2ROW or 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 DEBOUNCING_DELAY 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
|
||||
|
||||
/*
|
||||
* 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
|
||||
|
||||
/*
|
||||
* Magic Key Options
|
||||
*
|
||||
* Magic keys are hotkey commands that allow control over firmware functions of
|
||||
* the keyboard. They are best used in combination with the HID Listen program,
|
||||
* found here: https://www.pjrc.com/teensy/hid_listen.html
|
||||
*
|
||||
* The options below allow the magic key functionality to be changed. This is
|
||||
* useful if your keyboard/keypad is missing keys and you want magic key support.
|
||||
*
|
||||
*/
|
||||
|
||||
/* key combination for magic key command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||
)
|
||||
|
||||
/* control how magic key switches layers */
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
|
||||
|
||||
/* override magic key keymap */
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
|
||||
//#define MAGIC_KEY_HELP1 H
|
||||
//#define MAGIC_KEY_HELP2 SLASH
|
||||
//#define MAGIC_KEY_DEBUG D
|
||||
//#define MAGIC_KEY_DEBUG_MATRIX X
|
||||
//#define MAGIC_KEY_DEBUG_KBD K
|
||||
//#define MAGIC_KEY_DEBUG_MOUSE M
|
||||
//#define MAGIC_KEY_VERSION V
|
||||
//#define MAGIC_KEY_STATUS S
|
||||
//#define MAGIC_KEY_CONSOLE C
|
||||
//#define MAGIC_KEY_LAYER0_ALT1 ESC
|
||||
//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
|
||||
//#define MAGIC_KEY_LAYER0 0
|
||||
//#define MAGIC_KEY_LAYER1 1
|
||||
//#define MAGIC_KEY_LAYER2 2
|
||||
//#define MAGIC_KEY_LAYER3 3
|
||||
//#define MAGIC_KEY_LAYER4 4
|
||||
//#define MAGIC_KEY_LAYER5 5
|
||||
//#define MAGIC_KEY_LAYER6 6
|
||||
//#define MAGIC_KEY_LAYER7 7
|
||||
//#define MAGIC_KEY_LAYER8 8
|
||||
//#define MAGIC_KEY_LAYER9 9
|
||||
//#define MAGIC_KEY_BOOTLOADER PAUSE
|
||||
//#define MAGIC_KEY_LOCK CAPS
|
||||
//#define MAGIC_KEY_EEPROM E
|
||||
//#define MAGIC_KEY_NKRO N
|
||||
//#define MAGIC_KEY_SLEEP_LED Z
|
||||
|
||||
/*
|
||||
* 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
|
||||
//#define NO_ACTION_MACRO
|
||||
//#define NO_ACTION_FUNCTION
|
||||
|
||||
#endif
|
@ -0,0 +1,21 @@
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
@ -0,0 +1,8 @@
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "../../config.h"
|
||||
|
||||
// place overrides here
|
||||
|
||||
#endif
|
@ -0,0 +1,88 @@
|
||||
#include "pilcrow.h"
|
||||
#define _______ KC_TRNS
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = KEYMAP( \
|
||||
KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \
|
||||
KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, \
|
||||
KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, \
|
||||
KC_LCTL, KC_LALT, KC_LGUI, MO(1), KC_SPC, MT(MOD_LSFT, KC_SPC), MO(2), MO(3), KC_DEL, KC_ESC \
|
||||
),
|
||||
|
||||
/* Colemak
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Esc | A | R | S | T | D | H | N | E | I | O | " |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[1] = KEYMAP( \
|
||||
KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, \
|
||||
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, \
|
||||
KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_PIPE, S(KC_QUOT), \
|
||||
_______, _______, _______, _______, KC_BSPC, KC_BSPC, _______, KC_MNXT, KC_VOLD, KC_GRV \
|
||||
),
|
||||
[2] = KEYMAP( \
|
||||
KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, \
|
||||
KC_TAB, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT,KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, \
|
||||
OSM(MOD_LSFT), KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_BSLS, KC_QUOT, \
|
||||
_______, _______, _______, _______, KC_ENT, KC_ENT, _______, KC_MNXT, KC_VOLD, KC_VOLU \
|
||||
),
|
||||
|
||||
/* Adjust (Lower + Raise)
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | | Reset| | | | | | | | | | Del |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[3] = KEYMAP( \
|
||||
RESET, KC_UP, _______, _______, _______, _______, _______, KC_MS_WH_DOWN, KC_MS_U, KC_MS_WH_UP, \
|
||||
KC_LEFT, KC_DOWN, KC_RIGHT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, KC_MS_L,KC_MS_D, KC_MS_R, \
|
||||
RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, \
|
||||
_______, _______, _______, _______, KC_MS_BTN1, KC_MS_BTN2, _______, _______, _______, _______ \
|
||||
)
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
|
||||
};
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
// MACRODOWN only works in this function
|
||||
switch(id) {
|
||||
case 0:
|
||||
if (record->event.pressed) {
|
||||
register_code(KC_RSFT);
|
||||
} else {
|
||||
unregister_code(KC_RSFT);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
|
||||
void matrix_init_user(void) {
|
||||
|
||||
}
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void led_set_user(uint8_t usb_led) {
|
||||
|
||||
}
|
@ -0,0 +1 @@
|
||||
# The default keymap for pilcrow
|
@ -0,0 +1,28 @@
|
||||
#include "pilcrow.h"
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
// put your keyboard start-up code here
|
||||
// runs once when the firmware starts up
|
||||
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
void matrix_scan_kb(void) {
|
||||
// put your looping keyboard code here
|
||||
// runs every cycle (a lot)
|
||||
|
||||
matrix_scan_user();
|
||||
}
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
// put your per-action keyboard code here
|
||||
// runs for every action, just before processing by the firmware
|
||||
|
||||
return process_record_user(keycode, record);
|
||||
}
|
||||
|
||||
void led_set_kb(uint8_t usb_led) {
|
||||
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
||||
|
||||
led_set_user(usb_led);
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
#ifndef PILCROW_H
|
||||
#define PILCROW_H
|
||||
|
||||
#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 arguements
|
||||
// The second converts the arguments into a two-dimensional array
|
||||
#define KEYMAP( \
|
||||
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, \
|
||||
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, \
|
||||
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, \
|
||||
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39 \
|
||||
) \
|
||||
{ \
|
||||
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09 }, \
|
||||
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19 }, \
|
||||
{ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29 }, \
|
||||
{ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39 } \
|
||||
}
|
||||
|
||||
#endif
|
@ -0,0 +1,28 @@
|
||||
pilcrow keyboard firmware
|
||||
======================
|
||||
|
||||
## Quantum MK Firmware
|
||||
|
||||
For the full Quantum feature list, see [the parent readme](/).
|
||||
|
||||
## Building
|
||||
|
||||
Download or clone the whole firmware and navigate to the keyboards/pilcrow folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file.
|
||||
|
||||
Depending on which keymap you would like to use, you will have to compile slightly differently.
|
||||
|
||||
### Default
|
||||
|
||||
To build with the default keymap, simply run `make default`.
|
||||
|
||||
### Other Keymaps
|
||||
|
||||
Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a folder with the name of your keymap in the keymaps folder, and see keymap documentation (you can find in top readme.md) and existant keymap files.
|
||||
|
||||
To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
|
||||
|
||||
```
|
||||
$ make [default|jack|<name>]
|
||||
```
|
||||
|
||||
Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.
|
@ -0,0 +1,67 @@
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=512
|
||||
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # 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 on B7 by default
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
Before Width: | Height: | Size: 860 KiB After Width: | Height: | Size: 860 KiB |
@ -0,0 +1,3 @@
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
Binary file not shown.
After Width: | Height: | Size: 1.8 MiB |
@ -0,0 +1,68 @@
|
||||
/*
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x6060
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER XIUDI
|
||||
#define PRODUCT XD60
|
||||
#define DESCRIPTION XD60 Keyboard by XIUDI
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 5
|
||||
#define MATRIX_COLS 14
|
||||
|
||||
/*
|
||||
* 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 { D0, D1, D2, D3, D5 }
|
||||
#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B7, B5, B4, D7, D6, B3 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||
#define DEBOUNCING_DELAY 5
|
||||
|
||||
/* number of backlight levels */
|
||||
#define BACKLIGHT_LEVELS 3
|
||||
|
||||
/* 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
|
||||
|
||||
/* key combination for magic key command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||
)
|
||||
|
||||
#endif
|
@ -0,0 +1,64 @@
|
||||
#include "xd60.h"
|
||||
#include "action_layer.h"
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
// 0: Base Layer
|
||||
KEYMAP(
|
||||
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_BSLS, KC_GRV, \
|
||||
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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \
|
||||
KC_LSFT, KC_NO, 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_DEL, \
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RGUI, KC_RALT, KC_LEFT, KC_DOWN, KC_RIGHT),
|
||||
|
||||
// 1: Function Layer
|
||||
KEYMAP(
|
||||
RESET, 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_F13, KC_F14, \
|
||||
KC_NO, KC_WH_U, KC_UP, KC_WH_D, KC_BSPC,KC_HOME,KC_CALC,KC_NO, KC_INS, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_DEL, \
|
||||
KC_NO, KC_LEFT, KC_DOWN, KC_RIGHT,KC_DEL, KC_END, KC_PGDN,KC_NO, KC_NO, KC_NO, KC_HOME, KC_PGUP, KC_NO, KC_ENT, \
|
||||
KC_LSFT, KC_NO, KC_NO, KC_APP, BL_TOGG,BL_DEC, BL_INC, KC_VOLD,KC_VOLU,KC_MUTE, KC_END, KC_PGDN, KC_RSFT, KC_PGUP, KC_NO, \
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, F(0), KC_HOME, KC_PGDOWN,KC_END),
|
||||
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay
|
||||
};
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
// MACRODOWN only works in this function
|
||||
|
||||
switch(id) {
|
||||
case 0:
|
||||
if (record->event.pressed) {
|
||||
register_code(KC_RSFT);
|
||||
} else {
|
||||
unregister_code(KC_RSFT);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
|
||||
// Layer LED indicators
|
||||
uint32_t layer = layer_state;
|
||||
|
||||
if (layer & (1<<1)) {
|
||||
xd60_esc_led_on();
|
||||
} else {
|
||||
xd60_esc_led_off();
|
||||
}
|
||||
|
||||
/*
|
||||
if (layer & (1<<2)) {
|
||||
xd60_poker_leds_on();
|
||||
xd60_esc_led_on();
|
||||
} else {
|
||||
xd60_poker_leds_off();
|
||||
xd60_esc_led_off();
|
||||
}
|
||||
*/
|
||||
};
|
@ -0,0 +1,9 @@
|
||||
# Default Keymap for XIUDI's 60% XD60 PCB
|
||||
|
||||
![Default Keymap for XD60](https://img.alicdn.com/imgextra/i1/1713761720/TB2K0gTalPxQeBjy1XcXXXHzVXa_!!1713761720.png)
|
||||
|
||||
## Additional Notes
|
||||
Default Keymap for XD60 as indicated on the original sale page.
|
||||
|
||||
## Build
|
||||
To build the default keymap, simply run `make xd60-default`.
|
@ -0,0 +1,60 @@
|
||||
#include "xd60.h"
|
||||
#include "action_layer.h"
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
// 0: Base Layer
|
||||
KEYMAP(
|
||||
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_BSLS, KC_GRV, \
|
||||
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, \
|
||||
F(0), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \
|
||||
KC_LSFT, KC_NO, 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_DEL, \
|
||||
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_LEFT, KC_DOWN, KC_RIGHT),
|
||||
|
||||
// 1: Function Layer
|
||||
KEYMAP(
|
||||
RESET, 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_F13, KC_F14, \
|
||||
KC_CAPS, KC_MPRV, KC_UP, KC_MNXT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, BL_STEP, BL_TOGG, KC_DEL, \
|
||||
F(0), KC_LEFT, KC_DOWN, KC_RIGHT,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_ENT, \
|
||||
KC_LSFT, KC_NO, KC_VOLD, KC_MUTE, KC_VOLU,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_RSFT, KC_PGUP, KC_INS, \
|
||||
KC_LCTL, KC_LALT, KC_LGUI, KC_MPLY, KC_RGUI, KC_RALT, KC_HOME, KC_PGDOWN,KC_END),
|
||||
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay
|
||||
};
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
// MACRODOWN only works in this function
|
||||
|
||||
switch(id) {
|
||||
case 0:
|
||||
if (record->event.pressed) {
|
||||
register_code(KC_RSFT);
|
||||
} else {
|
||||
unregister_code(KC_RSFT);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
|
||||
// Layer LED indicators
|
||||
uint32_t layer = layer_state;
|
||||
|
||||
if (layer & (1<<1)) {
|
||||
xd60_wasd_leds_on();
|
||||
xd60_fn_led_on();
|
||||
xd60_esc_led_on();
|
||||
xd60_poker_leds_on();
|
||||
} else {
|
||||
xd60_wasd_leds_off();
|
||||
xd60_fn_led_off();
|
||||
xd60_esc_led_off();
|
||||
xd60_poker_leds_off();
|
||||
}
|
||||
};
|
@ -0,0 +1,13 @@
|
||||
# QMK Firmware for XIUDI's 60% XD60 PCB
|
||||
|
||||
![Top View of XD60 Keyboard, with DSA Dolch keycaps](./top-view.JPG)
|
||||
![Angled View of XD60 Keyboard Arrow Cluster, with DSA Dolch keycaps](./arrow-cluster.JPG)
|
||||
|
||||
## Quantum MK Firmware
|
||||
For the full Quantum feature list, see [the parent readme.md](/readme.md).
|
||||
|
||||
## Additional Notes
|
||||
The XD60 is essentially a GH60 rev. C, with support for a right-hand arrow cluster. Includes full compatibility with GH60 expansion boards. Board also supports in-switch LEDs (two-pin, single colour), as well as WS2182 LED strips for underglow lighting. Default keymap included, matching configuration on sale page.
|
||||
|
||||
## Build
|
||||
To build the default keymap, simply run `make xd60-default`.
|
@ -0,0 +1,65 @@
|
||||
# MCU name
|
||||
# MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
# LUFA specific
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
Binary file not shown.
After Width: | Height: | Size: 2.0 MiB |
@ -0,0 +1,25 @@
|
||||
#include "xd60.h"
|
||||
|
||||
void led_set_kb(uint8_t usb_led) {
|
||||
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
||||
|
||||
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
|
||||
xd60_caps_led_on();
|
||||
} else {
|
||||
xd60_caps_led_off();
|
||||
}
|
||||
|
||||
// if (usb_led & (1<<USB_LED_NUM_LOCK)) {
|
||||
// xd60_esc_led_on();
|
||||
// } else {
|
||||
// xd60_esc_led_off();
|
||||
// }
|
||||
|
||||
// if (usb_led & (1<<USB_LED_SCROLL_LOCK)) {
|
||||
// xd60_fn_led_on();
|
||||
// } else {
|
||||
// xd60_fn_led_off();
|
||||
// }
|
||||
|
||||
led_set_user(usb_led);
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
#ifndef XD60_H
|
||||
#define XD60_H
|
||||
|
||||
#include "quantum.h"
|
||||
#include "led.h"
|
||||
|
||||
/* XD60 LEDs
|
||||
* GPIO pads
|
||||
* 0 F7 WASD LEDs
|
||||
* 1 F6 ESC LED
|
||||
* 2 F5 FN LED
|
||||
* 3 F4 POKER Arrow LEDs
|
||||
* B2 Capslock LED
|
||||
* B0 not connected
|
||||
*/
|
||||
inline void xd60_caps_led_on(void) { DDRB |= (1<<2); PORTB &= ~(1<<2); }
|
||||
inline void xd60_poker_leds_on(void) { DDRF |= (1<<4); PORTF &= ~(1<<4); }
|
||||
inline void xd60_fn_led_on(void) { DDRF |= (1<<5); PORTF &= ~(1<<5); }
|
||||
inline void xd60_esc_led_on(void) { DDRF |= (1<<6); PORTF &= ~(1<<6); }
|
||||
inline void xd60_wasd_leds_on(void) { DDRF |= (1<<7); PORTF &= ~(1<<7); }
|
||||
|
||||
inline void xd60_caps_led_off(void) { DDRB &= ~(1<<2); PORTB &= ~(1<<2); }
|
||||
inline void xd60_poker_leds_off(void) { DDRF &= ~(1<<4); PORTF &= ~(1<<4); }
|
||||
inline void xd60_fn_led_off(void) { DDRF &= ~(1<<5); PORTF &= ~(1<<5); }
|
||||
inline void xd60_esc_led_off(void) { DDRF &= ~(1<<6); PORTF &= ~(1<<6); }
|
||||
inline void xd60_wasd_leds_off(void) { DDRF &= ~(1<<7); PORTF &= ~(1<<7); }
|
||||
|
||||
/* XD60 Keymap Definition Macro */
|
||||
#define KEYMAP( \
|
||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K49, \
|
||||
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
|
||||
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \
|
||||
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K47, K3D, K3C, \
|
||||
K40, K41, K42, K45, K4A, K4B, K48, K4C, K4D \
|
||||
) { \
|
||||
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
|
||||
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \
|
||||
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \
|
||||
{ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \
|
||||
{ K40, K41, K42, KC_NO,KC_NO,K45, KC_NO,K47, K48, K49, K4A, K4B, K4C, K4D } \
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue