aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjvbroek <70871975+jvbroek@users.noreply.github.com>2020-11-15 17:43:20 -0700
committerGitHub <noreply@github.com>2020-11-16 00:43:20 +0000
commitcfc9a358c584e65782b2dade05d31700719a18e7 (patch)
tree00239ad24065e3419c6c7aa34b3becbcfce91434
parente4236278b5b2dd84fb32e01cab5002b4597e7d35 (diff)
downloadqmk_firmware-cfc9a358c584e65782b2dade05d31700719a18e7.tar.gz
qmk_firmware-cfc9a358c584e65782b2dade05d31700719a18e7.zip
[Keyboard] Add "Uno" (#10579)
* Add all files * Update keyboards/uno/config.h Co-authored-by: Joel Challis <git@zvecr.com> * Update keyboards/uno/config.h Co-authored-by: Joel Challis <git@zvecr.com> * Update keyboards/uno/rules.mk Co-authored-by: Joel Challis <git@zvecr.com> * Update keyboards/uno/keymaps/default/keymap.c Co-authored-by: Joel Challis <git@zvecr.com> * Update keyboards/uno/keymaps/default/keymap.c Co-authored-by: Joel Challis <git@zvecr.com> * Update keyboards/uno/info.json Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/uno/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update readme.md Co-authored-by: Joshua Broekhuijsen <j.broekhuijsen@gmail.com> Co-authored-by: Joel Challis <git@zvecr.com> Co-authored-by: Ryan <fauxpark@gmail.com>
-rw-r--r--keyboards/uno/config.h69
-rw-r--r--keyboards/uno/info.json13
-rw-r--r--keyboards/uno/keymaps/default/keymap.c102
-rw-r--r--keyboards/uno/keymaps/default/readme.md4
-rw-r--r--keyboards/uno/readme.md19
-rw-r--r--keyboards/uno/rules.mk22
-rw-r--r--keyboards/uno/uno.c17
-rw-r--r--keyboards/uno/uno.h24
8 files changed, 270 insertions, 0 deletions
diff --git a/keyboards/uno/config.h b/keyboards/uno/config.h
new file mode 100644
index 000000000..1cae17f50
--- /dev/null
+++ b/keyboards/uno/config.h
@@ -0,0 +1,69 @@
1/* Copyright 2020 Snipeye
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#pragma once
17#include "config_common.h"
18
19/* USB Device descriptor parameter */
20#define VENDOR_ID 0xFEED
21#define PRODUCT_ID 0xACC8
22#define DEVICE_VER 0x0001
23#define MANUFACTURER Broekhuijsen
24#define PRODUCT Uno
25
26/* key matrix size */
27#define MATRIX_ROWS 1
28#define MATRIX_COLS 1
29
30/* Uno default pinout */
31#define DIRECT_PINS { \
32 { B6 } \
33}
34#define UNUSED_PINS
35
36#define RGB_DI_PIN F6
37#ifdef RGB_DI_PIN
38#define RGBLED_NUM 1
39// #define RGBLIGHT_HUE_STEP 32
40// #define RGBLIGHT_SAT_STEP 32
41// #define RGBLIGHT_VAL_STEP 32
42// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
43// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
44// /*== all animations enable ==*/
45#define RGBLIGHT_ANIMATIONS
46// /*== or choose animations ==*/
47// #define RGBLIGHT_EFFECT_BREATHING
48// #define RGBLIGHT_EFFECT_RAINBOW_MOOD
49// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL
50// #define RGBLIGHT_EFFECT_SNAKE
51// #define RGBLIGHT_EFFECT_KNIGHT
52// #define RGBLIGHT_EFFECT_CHRISTMAS
53// #define RGBLIGHT_EFFECT_STATIC_GRADIENT
54// #define RGBLIGHT_EFFECT_RGB_TEST
55// #define RGBLIGHT_EFFECT_ALTERNATING
56// /*== customize breathing effect ==*/
57// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/
58// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64
59// /*==== use exp() and sin() ====*/
60// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7
61// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255
62#endif
63
64/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
65#define DEBOUNCE 5
66
67/* disable these deprecated features by default */
68#define NO_ACTION_MACRO
69#define NO_ACTION_FUNCTION
diff --git a/keyboards/uno/info.json b/keyboards/uno/info.json
new file mode 100644
index 000000000..3460c25d5
--- /dev/null
+++ b/keyboards/uno/info.json
@@ -0,0 +1,13 @@
1{
2 "keyboard_name": "Uno",
3 "keyboard_folder": "uno",
4 "url": "https://www.reddit.com/r/mechmarket/comments/gyijm7/gb_uno/",
5 "maintainer": "Snipeye",
6 "width": 1,
7 "height": 1,
8 "layouts": {
9 "LAYOUT": {
10 "layout": [ {"x": 0, "y": 0 }]
11 }
12 }
13 }
diff --git a/keyboards/uno/keymaps/default/keymap.c b/keyboards/uno/keymaps/default/keymap.c
new file mode 100644
index 000000000..bb19ea7dd
--- /dev/null
+++ b/keyboards/uno/keymaps/default/keymap.c
@@ -0,0 +1,102 @@
1/* Copyright 2020 Snipeye
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
18enum uno_keycode
19{
20 UNO = SAFE_RANGE
21};
22
23static uint16_t pressTimer = 0xFFFF;
24#define CUSTOM_LONGPRESS 150
25#define CUSTOM_LONGERPRESS 750
26#define CUSTOM_STRING "I can put a whole buncha text in here and type it all with a single keypress."
27#define RESET_LENGTH 3000
28const uint8_t PROGMEM RGBLED_RAINBOW_MOOD_INTERVALS[] = { 10, 25, 50 };
29
30char stringToSend[2] = "a";
31char maxLetter = 'z';
32
33uint8_t presetCounter = 0;
34
35#define COUNTER X_A
36
37
38const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
39 [0] = LAYOUT(
40 UNO
41 )
42};
43
44bool process_record_user(uint16_t keycode, keyrecord_t *record) {
45 switch (keycode) {
46 case UNO:
47 if (record->event.pressed) {
48 pressTimer = timer_read();
49 } else {
50 uint16_t timeElapsed = timer_elapsed(pressTimer);
51 switch (presetCounter) {
52 case 0:
53 SEND_STRING(SS_LCMD("n"));
54 break;
55 case 1:
56 SEND_STRING("Hello!");
57 break;
58 case 2:
59 SEND_STRING(SS_TAP(X_ENTER)SS_TAP(X_ENTER)"I am uno!");
60 break;
61 case 3:
62 SEND_STRING(SS_TAP(X_ENTER)SS_TAP(X_ENTER)"I can do all sorts of useless things!");
63 break;
64 case 4:
65 SEND_STRING(SS_TAP(X_ENTER)SS_TAP(X_ENTER)"And I have a built-in RGB LED!"SS_TAP(X_ENTER)SS_TAP(X_ENTER)SS_TAP(X_ENTER));
66 rgblight_sethsv_noeeprom(255, 255, 255);
67 rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_MOOD);
68 break;
69 default:
70 if (timeElapsed < CUSTOM_LONGPRESS) {
71 // Normal press. We're going to send the current letter and increment the counter.
72 SEND_STRING(SS_TAP(X_BSPACE));
73 send_string(stringToSend);
74 stringToSend[0]++;
75 if (stringToSend[0] > maxLetter) {
76 stringToSend[0] = 'a';
77 }
78 } else if (timeElapsed < CUSTOM_LONGERPRESS) {
79 // Long press, confirm the current letter, reset counter
80 stringToSend[0] = 'a';
81 send_string(stringToSend);
82 } else if (timeElapsed < RESET_LENGTH) {
83 // Longer press, display macro.
84 SEND_STRING(CUSTOM_STRING);
85 } else {
86 reset_keyboard();
87 }
88 presetCounter--;
89 break;
90 }
91 presetCounter++;
92 }
93 break;
94 }
95 return false;
96}
97
98void keyboard_post_init_user(void) {
99 rgblight_enable_noeeprom();
100 rgblight_sethsv_noeeprom(0, 0, 0);
101 rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
102}
diff --git a/keyboards/uno/keymaps/default/readme.md b/keyboards/uno/keymaps/default/readme.md
new file mode 100644
index 000000000..53b762f87
--- /dev/null
+++ b/keyboards/uno/keymaps/default/readme.md
@@ -0,0 +1,4 @@
1# The default keymap for uno
2![Keymap](https://i.imgur.com/lCPZZpO.png)
3
4The 'Macro' key does a few things: If you open up textedit (was made for a mac), it sends "Command+n" for the first press to make a new document. It then types a few different messages, activates the RGB LED, and finally ends in a "scroll through the alphabet with a long press to confirm a certain character" keyboard mode.
diff --git a/keyboards/uno/readme.md b/keyboards/uno/readme.md
new file mode 100644
index 000000000..ce4cccd19
--- /dev/null
+++ b/keyboards/uno/readme.md
@@ -0,0 +1,19 @@
1# uno
2
3 ![uno](https://i.imgur.com/OqPyWbbl.jpg)
4
5A 1-key, in-USB "board" for the lulz
6
7 * Keyboard Maintainer: [Snipeye](https://github.com/Snipeye)
8 * Hardware Supported: uno pcb
9 * Hardware Availability: [GB](https://www.reddit.com/r/mechmarket/comments/gyijm7/gb_uno/)
10
11 Make example for this keyboard (after setting up your build environment):
12
13 make uno:default
14
15 Flashing example for this keyboard:
16
17 make uno:default:flash
18
19 See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
diff --git a/keyboards/uno/rules.mk b/keyboards/uno/rules.mk
new file mode 100644
index 000000000..d23e95512
--- /dev/null
+++ b/keyboards/uno/rules.mk
@@ -0,0 +1,22 @@
1# MCU name
2MCU = atmega32u4
3
4# Bootloader selection
5BOOTLOADER = caterina
6
7# Build Options
8# change yes to no to disable
9#
10BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
11MOUSEKEY_ENABLE = yes # Mouse keys
12EXTRAKEY_ENABLE = yes # Audio control and System control
13CONSOLE_ENABLE = no # Console for debug
14COMMAND_ENABLE = no # Commands for debug and configuration
15# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
16SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
17# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
18NKRO_ENABLE = no # USB Nkey Rollover
19BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
20RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
21BLUETOOTH_ENABLE = no # Enable Bluetooth
22AUDIO_ENABLE = no # Audio output
diff --git a/keyboards/uno/uno.c b/keyboards/uno/uno.c
new file mode 100644
index 000000000..5ffb28865
--- /dev/null
+++ b/keyboards/uno/uno.c
@@ -0,0 +1,17 @@
1/* Copyright 2020 Snipeye
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 "uno.h"
diff --git a/keyboards/uno/uno.h b/keyboards/uno/uno.h
new file mode 100644
index 000000000..91d48d2ad
--- /dev/null
+++ b/keyboards/uno/uno.h
@@ -0,0 +1,24 @@
1/* Copyright 2020 Snipeye
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#pragma once
17
18#include "quantum.h"
19
20#define LAYOUT( \
21 K00 \
22) { \
23 { K00 } \
24}