aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSalicylic-acid3 <46864619+Salicylic-acid3@users.noreply.github.com>2019-11-16 03:20:57 +0900
committerJames Young <18669334+noroadsleft@users.noreply.github.com>2019-11-15 10:20:57 -0800
commitad36bb37dd775de5132a68fbd6ad9cdf73b0c070 (patch)
tree25e68a9a00e4958d77e8f7537f723bef2c79b57f
parent1c9e4502181dc36ed9853dec4341765c87530240 (diff)
downloadqmk_firmware-ad36bb37dd775de5132a68fbd6ad9cdf73b0c070.tar.gz
qmk_firmware-ad36bb37dd775de5132a68fbd6ad9cdf73b0c070.zip
[Keyboard] Add keyboard Nafuda (#7367)
* [Keyboard] Add keyboard Nafuda Add Nafuda keyboard. A 7 keys keyboard. Salicylic-acid3 * Update keyboards/nafuda/info.json * Update keyboards/nafuda/readme.md * Update keyboards/nafuda/readme.md * Update keyboards/nafuda/nafuda.h * Update keyboards/nafuda/readme.md * Update keyboards/nafuda/rules.mk * Update keyboards/nafuda/rules.mk * Update keyboards/nafuda/rules.mk * Update keyboards/nafuda/rules.mk * info.json Update * Update keyboards/nafuda/rules.mk
-rw-r--r--keyboards/nafuda/config.h69
-rw-r--r--keyboards/nafuda/info.json20
-rw-r--r--keyboards/nafuda/keymaps/default/config.h23
-rw-r--r--keyboards/nafuda/keymaps/default/keymap.c61
-rw-r--r--keyboards/nafuda/keymaps/default/readme.md34
-rw-r--r--keyboards/nafuda/nafuda.c5
-rw-r--r--keyboards/nafuda/nafuda.h24
-rw-r--r--keyboards/nafuda/readme.md17
-rw-r--r--keyboards/nafuda/rules.mk33
9 files changed, 286 insertions, 0 deletions
diff --git a/keyboards/nafuda/config.h b/keyboards/nafuda/config.h
new file mode 100644
index 000000000..3db4401d4
--- /dev/null
+++ b/keyboards/nafuda/config.h
@@ -0,0 +1,69 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3Copyright 2015 Jack Humbert
4
5This program is free software: you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation, either version 2 of the License, or
8(at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#pragma once
20
21#include "config_common.h"
22
23/* USB Device descriptor parameter */
24#define VENDOR_ID 0xFEED
25#define PRODUCT_ID 0x3060
26#define DEVICE_VER 0x0012
27#define MANUFACTURER Salicylic_Acid
28#define PRODUCT nafuda
29#define DESCRIPTION A custom cursorpad
30
31/* key matrix size */
32#define MATRIX_ROWS 3
33#define MATRIX_COLS 3
34
35// wiring of each half
36#define MATRIX_ROW_PINS { D1, D0, D4 }
37#define MATRIX_COL_PINS { F4, F5, F6 }
38
39/* Set 0 if debouncing isn't needed */
40#define DEBOUNCE 5
41
42/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
43#define LOCKING_SUPPORT_ENABLE
44/* Locking resynchronize hack */
45#define LOCKING_RESYNC_ENABLE
46
47/* ws2812 RGB LED */
48#define RGB_DI_PIN D3
49
50#define RGBLED_NUM 7 // Number of LEDs
51#define RGBLIGHT_ANIMATIONS
52
53#ifndef IOS_DEVICE_ENABLE
54 #define RGBLIGHT_LIMIT_VAL 180
55 #define RGBLIGHT_VAL_STEP 17
56#else
57 #define RGBLIGHT_LIMIT_VAL 50
58 #define RGBLIGHT_VAL_STEP 4
59#endif
60#define RGBLIGHT_HUE_STEP 10
61#define RGBLIGHT_SAT_STEP 17
62
63#if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE)
64 #define USB_MAX_POWER_CONSUMPTION 400
65#else
66 // fix iPhone and iPad power adapter issue
67 // iOS device need lessthan 100
68 #define USB_MAX_POWER_CONSUMPTION 100
69#endif
diff --git a/keyboards/nafuda/info.json b/keyboards/nafuda/info.json
new file mode 100644
index 000000000..d5bf2b055
--- /dev/null
+++ b/keyboards/nafuda/info.json
@@ -0,0 +1,20 @@
1{
2 "keyboard_name": "nafuda",
3 "url": "https://salicylic-acid3.hatenablog.com/",
4 "maintainer": "Salicylic_acid3",
5 "width": 3,
6 "height": 3,
7 "layouts": {
8 "LAYOUT": {
9 "layout": [
10 {"label":"Mouse", "x":1, "y":0},
11 {"label":"Backspace", "x":0, "y":0.5},
12 {"label":"\u2191", "x":1, "y":1},
13 {"label":"Browser", "x":2, "y":0.5},
14 {"label":"\u2190", "x":0, "y":1.5},
15 {"label":"\u2193", "x":1, "y":2},
16 {"label":"\u2192", "x":2, "y":1.5}
17 ]
18 }
19 }
20}
diff --git a/keyboards/nafuda/keymaps/default/config.h b/keyboards/nafuda/keymaps/default/config.h
new file mode 100644
index 000000000..e35fe2ccd
--- /dev/null
+++ b/keyboards/nafuda/keymaps/default/config.h
@@ -0,0 +1,23 @@
1/* Copyright 2018 Salicylic_acid3
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#pragma once
18
19/* Select hand configuration */
20
21#define TAPPING_FORCE_HOLD
22#define TAPPING_TERM 180
23
diff --git a/keyboards/nafuda/keymaps/default/keymap.c b/keyboards/nafuda/keymaps/default/keymap.c
new file mode 100644
index 000000000..f0baff6c2
--- /dev/null
+++ b/keyboards/nafuda/keymaps/default/keymap.c
@@ -0,0 +1,61 @@
1#include QMK_KEYBOARD_H
2
3#ifdef RGBLIGHT_ENABLE
4//Following line allows macro to read current RGB settings
5extern rgblight_config_t rgblight_config;
6#endif
7
8extern uint8_t is_master;
9
10// Each layer gets a name for readability, which is then used in the keymap matrix below.
11// The underscores don't mean anything - you can have a layer called STUFF or any other name.
12// Layer names don't all need to be of the same length, obviously, and you can also skip them
13// entirely and just use numbers.
14enum layer_number {
15 _BASE,
16 _MOUSE,
17 _BROWSER,
18 _ADJUST,
19};
20
21const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
22 [_BASE] = LAYOUT(
23 //|-------------------------------------------|
24 TG(_MOUSE),
25 //|---------------+---------------+-----------|
26LT(_ADJUST, KC_BSPC), KC_UP,TG(_BROWSER),
27 //|---------------+---------------+-----------|
28 KC_LEFT, KC_DOWN, KC_RIGHT
29 //|-------------------------------------------|
30 ),
31
32 [_MOUSE] = LAYOUT(
33 //|-------------------------------------------|
34 TG(_MOUSE),
35 //|---------------+---------------+-----------|
36 KC_BTN1, KC_MS_U, KC_BTN2,
37 //|---------------+---------------+-----------|
38 KC_MS_L, KC_MS_D, KC_MS_R
39 //|-------------------------------------------|
40 ),
41
42 [_BROWSER] = LAYOUT(
43 //|-------------------------------------------|
44 LCTL(KC_W),
45 //|---------------+---------------+-----------|
46 LCTL(LSFT(KC_T)), KC_WH_U,TG(_BROWSER),
47 //|---------------+---------------+-----------|
48 LCTL(LSFT(KC_TAB)), KC_WH_D,LCTL(KC_TAB)
49 //|-------------------------------------------|
50 ),
51
52 [_ADJUST] = LAYOUT( /* Base */
53 //|-------------------------------------------|
54 RGB_VAD,
55 //|---------------+---------------+-----------|
56 MO(_ADJUST), RGB_SAD, RGB_VAI,
57 //|---------------+---------------+-----------|
58 RGB_MOD, RGB_TOG, RGB_SAI
59 //|-------------------------------------------|
60 )
61};
diff --git a/keyboards/nafuda/keymaps/default/readme.md b/keyboards/nafuda/keymaps/default/readme.md
new file mode 100644
index 000000000..b84276bf8
--- /dev/null
+++ b/keyboards/nafuda/keymaps/default/readme.md
@@ -0,0 +1,34 @@
1# The default keymap for nafuda
2
3## Base
4| 1 | 2 | 3 |
5|:--------------:|:--------:|:-----:|
6| | MOUSE | |
7| ADJUST or BSPC | UP |BROWSER|
8| LEFT | DOWN | RIGHT|
9
10
11## MOUSE
12| 1 | 2 | 3 |
13|:--------:|:--------:|:---------:|
14| | BASE | |
15| Btn 1 | MOUSE_UP | Btn2 |
16|MOUSE_LEFT|MOUSE_DOWN|MOUSE_RIGHT|
17
18
19## BROWSER
20| 1 | 2 | 3 |
21|:-----------:|:--------:|:-------:|
22| | LCTL(W) | |
23| LCTL+LSFT(T)| WHEEL_UP | BROWSER |
24|LCTL+SFT(TAB)|WHEEL_DOWN|LCTL(TAB)|
25
26
27## Adjust
28| 1 | 2 | 3 |
29|:-------:|:-------:|:------:|
30| | RGB_VAD | |
31| Adjust | RGB_SAD | RGB_VAI|
32| RGB_MOD | RGB_TOG | RGB_SAI|
33
34
diff --git a/keyboards/nafuda/nafuda.c b/keyboards/nafuda/nafuda.c
new file mode 100644
index 000000000..d2061181e
--- /dev/null
+++ b/keyboards/nafuda/nafuda.c
@@ -0,0 +1,5 @@
1#include "nafuda.h"
2
3void matrix_init_kb(void) {
4 matrix_init_user();
5};
diff --git a/keyboards/nafuda/nafuda.h b/keyboards/nafuda/nafuda.h
new file mode 100644
index 000000000..008a9c16f
--- /dev/null
+++ b/keyboards/nafuda/nafuda.h
@@ -0,0 +1,24 @@
1#pragma once
2
3#include "quantum.h"
4
5/*
6 * ,-----------------.
7 * | | L01 | |
8 * |-----------------+
9 * | L10 | L11 | L12 |
10 * |-----------------+
11 * | L20 | L21 | L22 |
12 * |-----------------'
13 */
14
15#define LAYOUT( \
16 L01, \
17 L10, L11, L12, \
18 L20, L21, L22 \
19 ) \
20 { \
21 {KC_NO, L01,KC_NO }, \
22 { L10, L11, L12 }, \
23 { L20, L21, L22 } \
24 }
diff --git a/keyboards/nafuda/readme.md b/keyboards/nafuda/readme.md
new file mode 100644
index 000000000..73007ed01
--- /dev/null
+++ b/keyboards/nafuda/readme.md
@@ -0,0 +1,17 @@
1# nafuda
2
3![nafuda](https://cdn-ak.f.st-hatena.com/images/fotolife/S/Salicylic_acid3/20190608/20190608024901.jpg)
4
5This is 7 keys cursor macropad.
6
7* Keyboard Maintainer: [Salicylic_acid3](https://github.com/Salicylic-acid3)
8* Hardware Supported: Nafuda PCB, Pro Micro
9* Hardware Availability: [PCB & Case Data](https://github.com/Salicylic-acid3/PCB_Data), [Booth Shop](https://salicylic-acid3.booth.pm/items/1271706)
10
11Make example for this keyboard (after setting up your build environment):
12
13 make nafuda:default
14
15See 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).
16
17[Build guide](https://salicylic-acid3.hatenablog.com/entry/nafuda-build-guide)
diff --git a/keyboards/nafuda/rules.mk b/keyboards/nafuda/rules.mk
new file mode 100644
index 000000000..bdc863464
--- /dev/null
+++ b/keyboards/nafuda/rules.mk
@@ -0,0 +1,33 @@
1# MCU name
2MCU = atmega32u4
3
4# Bootloader selection
5# Teensy halfkay
6# Pro Micro caterina
7# Atmel DFU atmel-dfu
8# LUFA DFU lufa-dfu
9# QMK DFU qmk-dfu
10# ATmega32A bootloadHID
11# ATmega328P USBasp
12BOOTLOADER = caterina
13
14# Build Options
15# change yes to no to disable
16#
17BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
18MOUSEKEY_ENABLE = yes # Mouse keys
19EXTRAKEY_ENABLE = yes # Audio control and System control
20CONSOLE_ENABLE = no # Console for debug
21COMMAND_ENABLE = yes # Commands for debug and configuration
22NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
23BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
24MIDI_ENABLE = no # MIDI controls
25AUDIO_ENABLE = no # Audio output on port C6
26UNICODE_ENABLE = no # Unicode
27BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
28RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
29TAP_DANCE_ENABLE = no
30OLED_DRIVER_ENABLE = no
31# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
32SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
33