aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/zfrontier/big_switch/big_switch.c17
-rw-r--r--keyboards/zfrontier/big_switch/big_switch.h34
-rw-r--r--keyboards/zfrontier/big_switch/config.h54
-rw-r--r--keyboards/zfrontier/big_switch/keymaps/default/keymap.c31
-rw-r--r--keyboards/zfrontier/big_switch/keymaps/default/readme.md1
-rw-r--r--keyboards/zfrontier/big_switch/keymaps/longtap/keymap.c118
-rw-r--r--keyboards/zfrontier/big_switch/keymaps/longtap/readme.md4
-rw-r--r--keyboards/zfrontier/big_switch/keymaps/longtap/rules.mk1
-rw-r--r--keyboards/zfrontier/big_switch/readme.md15
-rw-r--r--keyboards/zfrontier/big_switch/rules.mk33
10 files changed, 308 insertions, 0 deletions
diff --git a/keyboards/zfrontier/big_switch/big_switch.c b/keyboards/zfrontier/big_switch/big_switch.c
new file mode 100644
index 000000000..53c3e34e7
--- /dev/null
+++ b/keyboards/zfrontier/big_switch/big_switch.c
@@ -0,0 +1,17 @@
1/* Copyright 2020 zFrontier
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#include "big_switch.h"
diff --git a/keyboards/zfrontier/big_switch/big_switch.h b/keyboards/zfrontier/big_switch/big_switch.h
new file mode 100644
index 000000000..d12184932
--- /dev/null
+++ b/keyboards/zfrontier/big_switch/big_switch.h
@@ -0,0 +1,34 @@
1/* Copyright 2020 zFrontier
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#include "quantum.h"
20
21/* This is a shortcut to help you visually see your layout.
22 *
23 * The first section contains all of the arguments representing the physical
24 * layout of the board and position of the keys.
25 *
26 * The second converts the arguments into a two-dimensional array which
27 * represents the switch matrix.
28 */
29#define LAYOUT( \
30 K00 \
31) \
32{ \
33 { K00 } \
34}
diff --git a/keyboards/zfrontier/big_switch/config.h b/keyboards/zfrontier/big_switch/config.h
new file mode 100644
index 000000000..6b4111c05
--- /dev/null
+++ b/keyboards/zfrontier/big_switch/config.h
@@ -0,0 +1,54 @@
1/*
2Copyright 2020 zFrontier <carl.xia@zfrontier.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#pragma once
19
20#include "config_common.h"
21
22/* USB Device descriptor parameter */
23#define VENDOR_ID 0xFEED
24#define PRODUCT_ID 0x0A01
25#define DEVICE_VER 0x0005
26#define MANUFACTURER zFrontier
27#define PRODUCT Red Comet Big Switch
28#define DESCRIPTION Big Switch
29
30/* key matrix size */
31#define MATRIX_ROWS 1
32#define MATRIX_COLS 1
33
34/* Keyboard Matrix Assignments */
35#define MATRIX_ROW_PINS { F0 }
36#define MATRIX_COL_PINS { F1 }
37#define UNUSED_PINS
38
39/* COL2ROW, ROW2COL*/
40#define DIODE_DIRECTION COL2ROW
41
42/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
43#define DEBOUNCE 5
44
45/* RGB light config */
46#define RGB_DI_PIN B6
47#define RGBLED_NUM 4
48#define RGBLIGHT_VAL_STEP 17
49#define RGBLIGHT_ANIMATIONS
50#define RGBLIGHT_EFFECT_BREATHE_CENTER 2.0
51#define RGBLIGHT_EFFECT_BREATHE_MAX 255
52
53/* long tapping config */
54#define TAPPING_TERM 500
diff --git a/keyboards/zfrontier/big_switch/keymaps/default/keymap.c b/keyboards/zfrontier/big_switch/keymaps/default/keymap.c
new file mode 100644
index 000000000..a30690a39
--- /dev/null
+++ b/keyboards/zfrontier/big_switch/keymaps/default/keymap.c
@@ -0,0 +1,31 @@
1/* Copyright 2020 zFrontier
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#include QMK_KEYBOARD_H
17
18
19
20const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
21 [0] = LAYOUT(KC_ENTER),
22};
23
24
25
26void keyboard_post_init_user(void) {
27 rgblight_enable_noeeprom();
28 rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING);
29 rgblight_sethsv_noeeprom(0,0,128);
30}
31
diff --git a/keyboards/zfrontier/big_switch/keymaps/default/readme.md b/keyboards/zfrontier/big_switch/keymaps/default/readme.md
new file mode 100644
index 000000000..fea7a92a5
--- /dev/null
+++ b/keyboards/zfrontier/big_switch/keymaps/default/readme.md
@@ -0,0 +1 @@
# The default keymap for big_switch
diff --git a/keyboards/zfrontier/big_switch/keymaps/longtap/keymap.c b/keyboards/zfrontier/big_switch/keymaps/longtap/keymap.c
new file mode 100644
index 000000000..a475421a3
--- /dev/null
+++ b/keyboards/zfrontier/big_switch/keymaps/longtap/keymap.c
@@ -0,0 +1,118 @@
1/* Copyright 2020 zFrontier
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#include QMK_KEYBOARD_H
17#include <print.h>
18
19
20enum {
21 TD_ENTER = 0,
22};
23
24
25
26const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
27 LAYOUT( TD(TD_ENTER) ),
28};
29
30
31
32void keyboard_post_init_user(void) {
33 print("zFrontier S01.6 boot...\n");
34 rgblight_enable_noeeprom();
35 rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING);
36 rgblight_sethsv_noeeprom(0,0,128);
37}
38
39
40void zf_switch_rgb_mode(void) {
41 switch (rgblight_get_mode() ) {
42 case RGBLIGHT_MODE_BREATHING:
43 rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_MOOD);
44 break;
45 case RGBLIGHT_MODE_RAINBOW_MOOD:
46 rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_SWIRL);
47 break;
48 case RGBLIGHT_MODE_RAINBOW_SWIRL:
49 rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE);
50 break;
51 case RGBLIGHT_MODE_SNAKE:
52 rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT);
53 break;
54 case RGBLIGHT_MODE_KNIGHT:
55 rgblight_mode_noeeprom(RGBLIGHT_MODE_CHRISTMAS);
56 break;
57 case RGBLIGHT_MODE_CHRISTMAS:
58 rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_GRADIENT);
59 break;
60 case RGBLIGHT_MODE_STATIC_GRADIENT:
61 rgblight_mode_noeeprom(RGBLIGHT_MODE_RGB_TEST);
62 break;
63 case RGBLIGHT_MODE_RGB_TEST:
64 default:
65 rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING);
66 break;
67 }
68}
69
70void zf_send_random_string(void) {
71 uint8_t tmpu8 = (timer_read() & 0x7);
72 switch (tmpu8) {
73 case 0:
74 case 1:
75 SEND_STRING("Sazabi, launching!");
76 break;
77 case 2:
78 case 3:
79 SEND_STRING("I, Char Aznable, will purge them, Amuro!");
80 break;
81 case 4:
82 case 5:
83 SEND_STRING("Their souls are weighted down by gravity!");
84 break;
85 case 6:
86 SEND_STRING("Go, Axis! With my unpleasant memories!");
87 break;
88 case 7:
89 SEND_STRING("Hello from zFrontier!");
90 break;
91 }
92
93 tap_code(KC_ENT);
94}
95
96void dance_finished(qk_tap_dance_state_t *state, void *user_data) {
97 switch (state->count) {
98 case 1:
99 register_code(KC_ENTER);
100 break;
101 case 2:
102 zf_switch_rgb_mode();
103 break;
104 default:
105 zf_send_random_string();
106 break;
107 }
108}
109
110void dance_reset(qk_tap_dance_state_t *state, void *user_data) {
111 if (state->count == 1) {
112 unregister_code(KC_ENTER);
113 }
114}
115
116qk_tap_dance_action_t tap_dance_actions[] = {
117 [TD_ENTER] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_finished, dance_reset)
118};
diff --git a/keyboards/zfrontier/big_switch/keymaps/longtap/readme.md b/keyboards/zfrontier/big_switch/keymaps/longtap/readme.md
new file mode 100644
index 000000000..a94e5c32c
--- /dev/null
+++ b/keyboards/zfrontier/big_switch/keymaps/longtap/readme.md
@@ -0,0 +1,4 @@
1# The longtap keymap for big_switch, the single switch keyboard,
2- tap once : send ENTER
3- tap twice : change RGB backlight mode
4- tap three times : send a pesudo-random string
diff --git a/keyboards/zfrontier/big_switch/keymaps/longtap/rules.mk b/keyboards/zfrontier/big_switch/keymaps/longtap/rules.mk
new file mode 100644
index 000000000..e5ddcae8d
--- /dev/null
+++ b/keyboards/zfrontier/big_switch/keymaps/longtap/rules.mk
@@ -0,0 +1 @@
TAP_DANCE_ENABLE = yes
diff --git a/keyboards/zfrontier/big_switch/readme.md b/keyboards/zfrontier/big_switch/readme.md
new file mode 100644
index 000000000..d0009cfec
--- /dev/null
+++ b/keyboards/zfrontier/big_switch/readme.md
@@ -0,0 +1,15 @@
1# zFrontier Big Switch
2
3![big_switch](https://img.zfrontier.com/cover/20180808/FiuL_XSz1WCP4tm2Q25I-JLtheK3)
4
5A keyboard designed by zFrontier with RGB backlight and only one switch.
6
7* Keyboard Maintainer: [carlxia](https://github.com/carlxia)
8* Hardware Supported: zFrontier Big Switch
9* Hardware Availability: [zFrontier page](https://en.zfrontier.com/products/redcomet-bigswitch-combo)
10
11Make example for this keyboard (after setting up your build environment):
12
13 make zfrontier/big_switch:longtap
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).
diff --git a/keyboards/zfrontier/big_switch/rules.mk b/keyboards/zfrontier/big_switch/rules.mk
new file mode 100644
index 000000000..17be8a47a
--- /dev/null
+++ b/keyboards/zfrontier/big_switch/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 = atmel-dfu
13
14# Build Options
15# change yes to no to disable
16#
17BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
18MOUSEKEY_ENABLE = no # Mouse keys
19EXTRAKEY_ENABLE = no # Audio control and System control
20CONSOLE_ENABLE = yes # Console for debug
21COMMAND_ENABLE = no # Commands for debug and configuration
22# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
23SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
24# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
25NKRO_ENABLE = no # USB Nkey Rollover
26BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
27RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
28MIDI_ENABLE = no # MIDI support
29BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
30AUDIO_ENABLE = no # Audio output on port C6
31FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
32HD44780_ENABLE = no # Enable support for HD44780 based LCDs
33TAP_DANCE_ENABLE = no