aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/readme.md1
-rw-r--r--keyboards/xd004/info.json11
-rw-r--r--keyboards/xd004/keymaps/default/keymap.c13
-rw-r--r--keyboards/xd004/keymaps/default/readme.md7
-rw-r--r--keyboards/xd004/keymaps/system_and_media/keymap.c61
-rw-r--r--keyboards/xd004/keymaps/system_and_media/readme.md9
-rw-r--r--keyboards/xd004/readme.md16
-rw-r--r--keyboards/xd004/v1/config.h80
-rw-r--r--keyboards/xd004/v1/rules.mk70
-rw-r--r--keyboards/xd004/xd004.c7
-rw-r--r--keyboards/xd004/xd004.h15
-rw-r--r--layouts/community/ortho_1x4/belgorath/keymap.c24
-rw-r--r--layouts/community/ortho_1x4/layout.json1
13 files changed, 315 insertions, 0 deletions
diff --git a/keyboards/readme.md b/keyboards/readme.md
index 8b6e40721..db2a18cc9 100644
--- a/keyboards/readme.md
+++ b/keyboards/readme.md
@@ -59,5 +59,6 @@ These keyboards are part of the QMK repository, but their manufacturers are not
59* [TheVan 44](/keyboards/tv44) — A 44-key staggered keybard by Evangs. 59* [TheVan 44](/keyboards/tv44) — A 44-key staggered keybard by Evangs.
60* [WhiteFox](/keyboards/whitefox) — A 65% keyboard designed as a partnership by matt3o, Massdrop and Input Club 60* [WhiteFox](/keyboards/whitefox) — A 65% keyboard designed as a partnership by matt3o, Massdrop and Input Club
61* [Vision Division](/keyboards/vision_division) — Full Size / Split Linear Keyboard by IBNobody. 61* [Vision Division](/keyboards/vision_division) — Full Size / Split Linear Keyboard by IBNobody.
62* [XD004](/keyboards/xd004) — 1x4 macro keyboard sold by KPrepublic.
62* [XD75](/keyboards/xd75) — 15x5 ortholinear keyboard by XIUDI. 63* [XD75](/keyboards/xd75) — 15x5 ortholinear keyboard by XIUDI.
63* [YMDK NP21](/keyboards/ymdk_np21) — ps2avrGB based number pad (numpad) sold by YMDK on Aliexpress. 64* [YMDK NP21](/keyboards/ymdk_np21) — ps2avrGB based number pad (numpad) sold by YMDK on Aliexpress.
diff --git a/keyboards/xd004/info.json b/keyboards/xd004/info.json
new file mode 100644
index 000000000..72c15da7f
--- /dev/null
+++ b/keyboards/xd004/info.json
@@ -0,0 +1,11 @@
1{
2 "keyboard_name": "XD004",
3 "maintainer": "",
4 "width": 4,
5 "height": 1,
6 "layouts": {
7 "LAYOUT_all": {
8 "layout": [{"label":"L", "x":0, "y":0}, {"label":"O", "x":1, "y":0}, {"label":"V", "x":2, "y":0}, {"label":"E", "x":3, "y":0}]
9 }
10 }
11}
diff --git a/keyboards/xd004/keymaps/default/keymap.c b/keyboards/xd004/keymaps/default/keymap.c
new file mode 100644
index 000000000..e82ce5e97
--- /dev/null
+++ b/keyboards/xd004/keymaps/default/keymap.c
@@ -0,0 +1,13 @@
1#include QMK_KEYBOARD_H
2
3const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
4
5 // 0: Base Layer
6 LAYOUT_all(KC_L, KC_O, KC_V, KC_E),
7
8};
9
10// Loop
11void matrix_scan_user(void){
12 // Empty
13};
diff --git a/keyboards/xd004/keymaps/default/readme.md b/keyboards/xd004/keymaps/default/readme.md
new file mode 100644
index 000000000..fdf07cc87
--- /dev/null
+++ b/keyboards/xd004/keymaps/default/readme.md
@@ -0,0 +1,7 @@
1# Default Keymap for XD004 PCB
2
3This keymap is not very useful, but it will validate that the board works.
4
5## Build
6
7To build the default keymap, simply run `make xd004:default`.
diff --git a/keyboards/xd004/keymaps/system_and_media/keymap.c b/keyboards/xd004/keymaps/system_and_media/keymap.c
new file mode 100644
index 000000000..740132639
--- /dev/null
+++ b/keyboards/xd004/keymaps/system_and_media/keymap.c
@@ -0,0 +1,61 @@
1#include QMK_KEYBOARD_H
2
3#define _BASE 0 // Base layer
4#define _SYSTEM 1 // System actions
5#define _VOLUME 2 // Volume actions
6
7#define SUPER_ALT_F4_TIMER 300 // Timeout on the super alt-f4 key
8
9/*
10 The idea of this is pretty simple: base layer has four action, two of which (the outermost)
11 are regular keystrokes on tap, and a momentary layer switch on hold, sending you to layers 1 and 2.
12
13 The other bit of customization here is the 'Super Alt F4' which does Alt-F4, and then Enter if tapped
14 again SUPER_ALT_F4_TIMER miliseconds after. This lets you Alt-F4 applications, and finally quickly
15 double-tap it to Alt-F4+Enter to shut down the PC.
16*/
17
18bool is_alt_f4_active = false;
19uint16_t alt_f4_timer = 0;
20
21enum custom_keycodes { // Make sure have the awesome keycode ready
22 SUPER_ALT_F4 = SAFE_RANGE,
23};
24
25const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
26
27 // 0: Base Layer
28 [_BASE] = LAYOUT_all(LT(_SYSTEM, KC_F5), C(G(KC_LEFT)), C(G(KC_RIGHT)), LT(_VOLUME, KC_F7)),
29
30 // 1: System actions
31 [_SYSTEM] = LAYOUT_all(_______, SUPER_ALT_F4, G(KC_D), G(KC_L)),
32
33 // 2: Volume actions
34 [_VOLUME] = LAYOUT_all(KC_MEDIA_NEXT_TRACK, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, _______),
35
36};
37
38bool process_record_user(uint16_t keycode, keyrecord_t *record) {
39 switch (keycode) { // This will do most of the grunt work with the keycodes.
40 case SUPER_ALT_F4:
41 if (record->event.pressed) {
42 if (!is_alt_f4_active) {
43 is_alt_f4_active = true;
44 tap_code_16(LALT(KC_F4); // Alt-F4
45 } else {
46 tap_code(KC_ENTER); // Tap enter
47 }
48 } else {
49 unregister_code(KC_TAB);
50 }
51 alt_f4_timer = timer_read();
52 break;
53 }
54 return true;
55}
56
57void matrix_scan_user(void) {
58 if (is_alt_f4_active && timer_elapsed(alt_f4_timer) > SUPER_ALT_F4_TIMER) {
59 is_alt_f4_active = false;
60 }
61};
diff --git a/keyboards/xd004/keymaps/system_and_media/readme.md b/keyboards/xd004/keymaps/system_and_media/readme.md
new file mode 100644
index 000000000..0fb3c61b6
--- /dev/null
+++ b/keyboards/xd004/keymaps/system_and_media/readme.md
@@ -0,0 +1,9 @@
1# Default Keymap for XD004 PCB
2
3A somehow more useful keymap, allowing one to move across virtual desktops on Windows, etc.
4
5It also has a 'Super Alt-F4' key for Windows that, when tapped does Alt-F4, unless two consecutive taps are less than 300ms apart, in which case the second tap becomes Enter. This allows you to close all apps doing taps, and then when the System shutdown window arrives you do a second quick tap and it will type enter, thus shutting down the computer.
6
7## Build
8
9To build the keymap, simply run `make xd004:system_and_media`.
diff --git a/keyboards/xd004/readme.md b/keyboards/xd004/readme.md
new file mode 100644
index 000000000..8b32c6a48
--- /dev/null
+++ b/keyboards/xd004/readme.md
@@ -0,0 +1,16 @@
1XD004
2==
3
44-keys board
5
6![Top View of a XD004 board](https://ae01.alicdn.com/kf/HTB1_G9IX21H3KVjSZFHq6zKppXa0/xd004-xiudi-4-Custom-Mechanical-Keyboard-4-keys-switch-leds-PCB-programmed-hot-swappable-macro-key.jpg)
7
8Keyboard Maintainer: QMK Community
9Hardware Supported: XD004 PCB v1.0
10Hardware Availability: [KPRepublic](https://kprepublic.com/products/xd004-xiudi-4-custom-mechanical-keyboard-4-keys-switch-leds-pcb-programmed-hot-swappable-macro-key-silver-case-micro-port)
11
12To build with a default keymap (not useful at all, have a look at other keymaps):
13
14```make xd004/v1:default```
15
16See 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).
diff --git a/keyboards/xd004/v1/config.h b/keyboards/xd004/v1/config.h
new file mode 100644
index 000000000..a141137e9
--- /dev/null
+++ b/keyboards/xd004/v1/config.h
@@ -0,0 +1,80 @@
1/*
2Copyright 2019 Sidney Bovet <sidney.bovet@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18/*
19Note: the following configuration uses 98% of the flash memory, be
20careful if you enable anything else. Also have a look at rules.mk
21where some things are disabled to save space as well.
22*/
23
24#pragma once
25
26#include "config_common.h"
27
28/* USB Device descriptor parameter */
29#define VENDOR_ID 0xCDCD
30#define PRODUCT_ID 0x0404
31#define DEVICE_VER 0x0001
32// Note: unsure about manufacturer
33#define MANUFACTURER XIUDI
34#define PRODUCT XD004 v1
35#define DESCRIPTION XD004 v1 Keyboard PCB
36
37/* key matrix size */
38#define MATRIX_ROWS 1
39#define MATRIX_COLS 4
40
41/*
42 * Keyboard Matrix Assignments
43 *
44 * On this board we have direct connection: no diodes.
45 */
46#define DIRECT_PINS \
47 { \
48 { D3, D0, C4, B4 } \
49 }
50#define UNUSED_PINS
51
52/* Backlight Setup */
53// Looks like each backlight LED is connected to a single output, D5 is the one furtherst away from USB port
54#define BACKLIGHT_PIN D5
55#define BACKLIGHT_LEVELS 6
56
57/* COL2ROW or ROW2COL */
58#define DIODE_DIRECTION COL2ROW
59
60/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
61#define DEBOUNCE 5
62
63/* RGB Underglow
64This will not be used, as RGBLIGHT_ENABLE is set to 'no' in rules.mk
65We do not have enough space in the flash for this at the moment, maybe
66further optimizations can be done on that side.
67*/
68#define RGB_DI_PIN C6
69#define RGBLIGHT_EFFECT_STATIC_GRADIENT
70#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
71#define RGBLED_NUM 2
72#define RGBLIGHT_HUE_STEP 10
73#define RGBLIGHT_SAT_STEP 17
74#define RGBLIGHT_VAL_STEP 17
75
76/* disable action features */
77// #define NO_ACTION_ONESHOT // 462 bytes <- this needs to be un-commented out if Link Time Optimization is disabled, otherwise file is too large
78// The two below are implicit since we use LINK_TIME_OPTIMIZATION_ENABLE (in rules.mk)
79// #define NO_ACTION_MACRO
80// #define NO_ACTION_FUNCTION \ No newline at end of file
diff --git a/keyboards/xd004/v1/rules.mk b/keyboards/xd004/v1/rules.mk
new file mode 100644
index 000000000..ad2d732d4
--- /dev/null
+++ b/keyboards/xd004/v1/rules.mk
@@ -0,0 +1,70 @@
1# MCU name
2MCU = atmega16u2
3
4
5# Processor frequency.
6# This will define a symbol, F_CPU, in all source code files equal to the
7# processor frequency in Hz. You can then use this symbol in your source code to
8# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
9# automatically to create a 32-bit value in your source code.
10#
11# This will be an integer division of F_USB below, as it is sourced by
12# F_USB after it has run through any CPU prescalers. Note that this value
13# does not *change* the processor frequency - it should merely be updated to
14# reflect the processor speed set externally so that the code can use accurate
15# software delays.
16F_CPU = 16000000
17
18
19# LUFA specific
20# Target architecture (see library "Board Types" documentation).
21ARCH = AVR8
22
23
24# Input clock frequency.
25# This will define a symbol, F_USB, in all source code files equal to the
26# input clock frequency (before any prescaling is performed) in Hz. This value may
27# differ from F_CPU if prescaling is used on the latter, and is required as the
28# raw input clock is fed directly to the PLL sections of the AVR for high speed
29# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
30# at the end, this will be done automatically to create a 32-bit value in your
31# source code.
32#
33# If no clock division is performed on the input clock inside the AVR (via the
34# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
35F_USB = $(F_CPU)
36
37
38# Interrupt driven control endpoint task(+60)
39OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
40
41
42# Boot Section Size in *bytes*
43# Teensy halfKay 512
44# Teensy++ halfKay 2048
45# Atmel DFU loader 4096
46# LUFA bootloader 4096
47# USBaspLoader 2048
48OPT_DEFS += -DBOOTLOADER_SIZE=4096
49BOOTLOADER = atmel-dfu
50
51
52# Build Options
53BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
54MOUSEKEY_ENABLE = no # Mouse keys(+4700)
55EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
56CONSOLE_ENABLE = no # Console for debug(+400)
57COMMAND_ENABLE = no # Commands for debug and configuration
58NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
59BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
60MIDI_ENABLE = no # MIDI controls
61AUDIO_ENABLE = no # Audio output on port C6
62UNICODE_ENABLE = no # Unicode
63BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
64RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
65SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
66
67# Saves about 5% of space:
68LINK_TIME_OPTIMIZATION_ENABLE = yes
69
70#LAYOUTS = ortho_1x4
diff --git a/keyboards/xd004/xd004.c b/keyboards/xd004/xd004.c
new file mode 100644
index 000000000..37a1dca14
--- /dev/null
+++ b/keyboards/xd004/xd004.c
@@ -0,0 +1,7 @@
1#include "xd004.h"
2
3void led_set_kb(uint8_t usb_led) {
4 // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
5
6 led_set_user(usb_led);
7}
diff --git a/keyboards/xd004/xd004.h b/keyboards/xd004/xd004.h
new file mode 100644
index 000000000..a53ad537f
--- /dev/null
+++ b/keyboards/xd004/xd004.h
@@ -0,0 +1,15 @@
1#pragma once
2
3#include "quantum.h"
4//#include "led.h"
5
6/* XD60 Keymap Definition Macro */
7/*
8 +--------------------------------+
9 | K0 K1 K2 K3 [----- USB
10 +--------------------------------+
11*/
12#define LAYOUT_all(K00, K01, K02, K03) \
13 { \
14 { K00, K01, K02, K03 } \
15 }
diff --git a/layouts/community/ortho_1x4/belgorath/keymap.c b/layouts/community/ortho_1x4/belgorath/keymap.c
new file mode 100644
index 000000000..ace402295
--- /dev/null
+++ b/layouts/community/ortho_1x4/belgorath/keymap.c
@@ -0,0 +1,24 @@
1#include QMK_KEYBOARD_H
2
3extern keymap_config_t keymap_config;
4
5// Each layer gets a name for readability, which is then used in the keymap matrix below.
6// The underscores don't mean anything - you can have a layer called STUFF or any other name.
7// Layer names don't all need to be of the same length, obviously, and you can also skip them
8// entirely and just use numbers.
9
10#define _DEFAULT 0
11#define _LOWER 1
12#define LOWER LT(_LOWER, KC_PENT)
13
14const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
15
16[_DEFAULT] = LAYOUT_ortho_1x4 (
17 LOWER, KC_P0, KC_PDOT,KC_PAST
18),
19
20/* Lower */
21[_LOWER] = LAYOUT_ortho_1x4 (
22 _______,_______,_______,_______
23),
24};
diff --git a/layouts/community/ortho_1x4/layout.json b/layouts/community/ortho_1x4/layout.json
new file mode 100644
index 000000000..6103c7e24
--- /dev/null
+++ b/layouts/community/ortho_1x4/layout.json
@@ -0,0 +1 @@
["","","",""] \ No newline at end of file