aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Allen <ylixir@gmail.com>2017-10-12 23:51:21 -0500
committerJack Humbert <jack.humb@gmail.com>2017-10-13 05:23:23 -1000
commitc037d4bb306613085a823e73f37653f1e71c0f0d (patch)
tree1e451de605b6150bd85ae5352376eb0cbdd782d8
parent66f45c9e2eb60b9bf7ecab10df0568bad5fbfc3f (diff)
downloadqmk_firmware-c037d4bb306613085a823e73f37653f1e71c0f0d.tar.gz
qmk_firmware-c037d4bb306613085a823e73f37653f1e71c0f0d.zip
Add the Tomato keyboard
-rw-r--r--keyboards/tomato/config.h51
-rw-r--r--keyboards/tomato/keymaps/default/keymap.c158
-rw-r--r--keyboards/tomato/readme.md20
-rw-r--r--keyboards/tomato/rules.mk56
-rw-r--r--keyboards/tomato/tomato.c1
-rw-r--r--keyboards/tomato/tomato.h18
6 files changed, 304 insertions, 0 deletions
diff --git a/keyboards/tomato/config.h b/keyboards/tomato/config.h
new file mode 100644
index 000000000..f33c13108
--- /dev/null
+++ b/keyboards/tomato/config.h
@@ -0,0 +1,51 @@
1#ifndef CONFIG_H
2#define CONFIG_H
3
4#include "config_common.h"
5
6/* USB Device descriptor parameter */
7#define VENDOR_ID 0xFEED
8#define PRODUCT_ID 0x6060
9#define DEVICE_VER 0x0001
10#define MANUFACTURER 40 Percent Club
11#define PRODUCT Tomato
12#define DESCRIPTION A 30 key ortholinear keyboard with RGB backlighting
13
14/* key matrix size */
15#define MATRIX_ROWS 5
16#define MATRIX_COLS 6
17
18/* key matrix pins */
19#define MATRIX_ROW_PINS { F7, B1, B3, B2, B6 }
20#define MATRIX_COL_PINS { B4, E6, D7, C6, D4, D0 }
21#define UNUSED_PINS
22
23/* COL2ROW or ROW2COL */
24#define DIODE_DIRECTION COL2ROW
25
26/* Set 0 if debouncing isn't needed */
27#define DEBOUNCING_DELAY 5
28
29/* Locking resynchronize hack */
30#define LOCKING_RESYNC_ENABLE
31
32/* key combination for command */
33#define IS_COMMAND() ( \
34 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
35)
36
37/* prevent stuck modifiers */
38#define PREVENT_STUCK_MODIFIERS
39
40/* eliminate lag on space cadet mods */
41#define PERMISSIVE_HOLD
42
43/* setup lighting */
44#define RGB_DI_PIN B5
45#define RGBLIGHT_ANIMATIONS
46#define RGBLED_NUM 30
47#define RGBLIGHT_HUE_STEP 8
48#define RGBLIGHT_SAT_STEP 8
49#define RGBLIGHT_VAL_STEP 8
50
51#endif
diff --git a/keyboards/tomato/keymaps/default/keymap.c b/keyboards/tomato/keymaps/default/keymap.c
new file mode 100644
index 000000000..26335b718
--- /dev/null
+++ b/keyboards/tomato/keymaps/default/keymap.c
@@ -0,0 +1,158 @@
1#include "tomato.h"
2
3#define SPC_F1 LT(1,KC_SPC)
4#define BS_F2 LT(2,KC_BSPC)
5#define C_F3 LT(3,KC_C)
6#define V_F4 LT(4,KC_V)
7#define B_F5 LT(5,KC_B)
8#define Z_CTL MT(MOD_LCTL, KC_Z)
9#define X_ALT MT(MOD_LALT, KC_X)
10#define N_ALT MT(MOD_RALT, KC_N)
11#define M_CTL MT(MOD_RCTL, KC_M)
12#define ENT_SFT MT(MOD_RSFT, KC_ENT)
13
14const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
15 /* Level 0: Default Layer
16 * ,-------------------------------------------------------------------------------.
17 * | Q | W | E | R | T | Y | U | I | O | P |
18 * |-------------------------------------------------------------------------------|
19 * | A | S | D | F | G | H | J | K | L | ESC |
20 * |-------------------------------------------------------------------------------|
21 * | Z | X | C | V | BSPC | SPC | B | N | M | ENT |
22 * '-------------------------------------------------------------------------------'
23 */
24 KEYMAP
25 ( KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P
26 , KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ESC
27 , Z_CTL, X_ALT, C_F3, V_F4, BS_F2, SPC_F1, B_F5, N_ALT, M_CTL, ENT_SFT
28 ),
29 /* Level 1: Numbers Layer
30 * ,-------------------------------------------------------------------------------.
31 * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 |
32 * |-------------------------------------------------------------------------------|
33 * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 |
34 * |-------------------------------------------------------------------------------|
35 * | | | | | DEL | | | | | |
36 * '-------------------------------------------------------------------------------'
37 */
38 KEYMAP
39 ( KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0
40 , KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10
41 , KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_DEL, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS
42 ),
43 /* Level 2: Symbols Layer
44 * ,-------------------------------------------------------------------------------.
45 * | ! | @ | # | $ | % | ^ | & | * | ( | ) |
46 * |-------------------------------------------------------------------------------|
47 * | F11 | F12 | | | | | | | | ` |
48 * |-------------------------------------------------------------------------------|
49 * | | | | | | | | | | |
50 * '-------------------------------------------------------------------------------'
51 */
52 KEYMAP
53 ( KC_EXLM,KC_AT, KC_HASH,KC_DLR, KC_PERC,KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN
54 , KC_F11, KC_F12,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_GRAVE
55 , KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS
56 ),
57 /* Level 3: RGB Layer
58 * ,-------------------------------------------------------------------------------.
59 * | | | | | | - | = | [ | ] | \ |
60 * |-------------------------------------------------------------------------------|
61 * | Tab | | | | | , | . | / | ; | ' |
62 * |-------------------------------------------------------------------------------|
63 * | | | | | | | Left | Down | Up | Right |
64 * '-------------------------------------------------------------------------------'
65 */
66 KEYMAP
67 ( KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_MINS,KC_EQL, KC_LBRC,KC_RBRC,KC_BSLS
68 , KC_TAB, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_COMM,KC_DOT, KC_SLSH,KC_SCLN,KC_QUOT
69 , KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_LEFT,KC_DOWN,KC_UP, KC_RGHT
70 ),
71 /* Level 4: RGB Layer
72 * ,-------------------------------------------------------------------------------.
73 * | | | | | | _ | + | { | } | | |
74 * |-------------------------------------------------------------------------------|
75 * | Tab | | | | | < | > | ? | : | " |
76 * |-------------------------------------------------------------------------------|
77 * | | | | | | | Home | PgDn | PgUp | End |
78 * '-------------------------------------------------------------------------------'
79 */
80 KEYMAP
81 ( KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_UNDS,KC_PLUS,KC_LCBR,KC_RCBR,KC_PIPE
82 , KC_TAB, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_LT, KC_GT, KC_QUES,KC_COLN,KC_DQUO
83 , KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_HOME,KC_PGUP,KC_PGDN,KC_END
84 ),
85 /* Level 5: RGB Layer
86 * ,-------------------------------------------------------------------------------.
87 * | Calc | Web | Mail |Explore| | | | | | |
88 * |-------------------------------------------------------------------------------|
89 * |RGB_TOG|RGB_MOD|RGB_HUI|RGB_HUD|xxxxxxx|xxxxxxx|RGB_SAI|RGB_SAD|RGB_VAI|RGB_VAD|
90 * |-------------------------------------------------------------------------------|
91 * | | | | | Flash | | | | | |
92 * '-------------------------------------------------------------------------------'
93 */
94 KEYMAP
95 ( KC_CALC,KC_WSCH,KC_MAIL,KC_MYCM,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS
96 , RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,KC_NO, KC_NO, RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD
97 , KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,RESET, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS
98 ),
99};
100
101const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
102{
103 // MACRODOWN only works in this function
104 switch(id) {
105 case 0:
106 if (record->event.pressed) {
107 register_code(KC_RSFT);
108 } else {
109 unregister_code(KC_RSFT);
110 }
111 break;
112 }
113 return MACRO_NONE;
114};
115
116void matrix_init_user(void) {
117}
118
119void matrix_scan_user(void) {
120}
121
122bool process_record_user(uint16_t keycode, keyrecord_t *record) {
123 return true;
124}
125
126void led_set_user(uint8_t usb_led) {
127
128 if (usb_led & (1 << USB_LED_NUM_LOCK)) {
129
130 } else {
131
132 }
133
134 if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
135
136 } else {
137
138 }
139
140 if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
141
142 } else {
143
144 }
145
146 if (usb_led & (1 << USB_LED_COMPOSE)) {
147
148 } else {
149
150 }
151
152 if (usb_led & (1 << USB_LED_KANA)) {
153
154 } else {
155
156 }
157
158}
diff --git a/keyboards/tomato/readme.md b/keyboards/tomato/readme.md
new file mode 100644
index 000000000..fb3808996
--- /dev/null
+++ b/keyboards/tomato/readme.md
@@ -0,0 +1,20 @@
1Tomato
2===
3
4A 30 key keyboard with programmable rgb backlighting.
5
6* [The fluff](http://www.40percent.club/2017/07/tomato-in-gherkin.html)
7* [The meat](https://github.com/di0ib/Misc/tree/master/tomato)
8
9Keyboard Maintainer: QMK Community
10Hardware Supported: Tomato PCB
11Hardware Availability: [Gherkin project on 40% Keyboards](http://www.40percent.club/2017/07/tomato-in-gherkin.html)
12
13Make example for this keyboard (after setting up your build environment):
14
15 make tomato-default
16
17See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
18
19First pass at adding support for the tomato keyboard. Completely
20untested. Intended to kick-start development.
diff --git a/keyboards/tomato/rules.mk b/keyboards/tomato/rules.mk
new file mode 100644
index 000000000..482f99b22
--- /dev/null
+++ b/keyboards/tomato/rules.mk
@@ -0,0 +1,56 @@
1# MCU name
2MCU = atmega32u4
3
4# Processor frequency.
5# This will define a symbol, F_CPU, in all source code files equal to the
6# processor frequency in Hz. You can then use this symbol in your source code to
7# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
8# automatically to create a 32-bit value in your source code.
9#
10# This will be an integer division of F_USB below, as it is sourced by
11# F_USB after it has run through any CPU prescalers. Note that this value
12# does not *change* the processor frequency - it should merely be updated to
13# reflect the processor speed set externally so that the code can use accurate
14# software delays.
15F_CPU = 16000000
16
17#
18# LUFA specific
19#
20# Target architecture (see library "Board Types" documentation).
21ARCH = AVR8
22
23# Input clock frequency.
24# This will define a symbol, F_USB, in all source code files equal to the
25# input clock frequency (before any prescaling is performed) in Hz. This value may
26# differ from F_CPU if prescaling is used on the latter, and is required as the
27# raw input clock is fed directly to the PLL sections of the AVR for high speed
28# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
29# at the end, this will be done automatically to create a 32-bit value in your
30# source code.
31#
32# If no clock division is performed on the input clock inside the AVR (via the
33# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
34F_USB = $(F_CPU)
35
36# Interrupt driven control endpoint task(+60)
37OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
38
39
40# Boot Section Size in *bytes*
41OPT_DEFS += -DBOOTLOADER_SIZE=4096
42
43
44# Build Options
45# comment out to disable the options.
46#
47BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
48MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
49EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
50CONSOLE_ENABLE = no # Console for debug(+400)
51COMMAND_ENABLE = no # Commands for debug and configuration
52SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
53NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
54BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
55AUDIO_ENABLE = no
56RGBLIGHT_ENABLE = yes
diff --git a/keyboards/tomato/tomato.c b/keyboards/tomato/tomato.c
new file mode 100644
index 000000000..dbf8bfe12
--- /dev/null
+++ b/keyboards/tomato/tomato.c
@@ -0,0 +1 @@
#include "tomato.h"
diff --git a/keyboards/tomato/tomato.h b/keyboards/tomato/tomato.h
new file mode 100644
index 000000000..ebb2303ac
--- /dev/null
+++ b/keyboards/tomato/tomato.h
@@ -0,0 +1,18 @@
1#ifndef GHERKIN_H
2#define GHERKIN_H
3
4#include "quantum.h"
5
6#define KEYMAP( \
7 K00, K01, K02, K03, K04, K05, K10, K11, K12, K13 , \
8 K14, K15, K20, K21, K22, K23, K24, K25, K30, K31 , \
9 K32, K33, K34, K35, K40, K41, K42, K43, K44, K45 \
10) { \
11 { K00, K01, K02, K03, K04, K05 }, \
12 { K10, K11, K12, K13, K14, K15 }, \
13 { K20, K21, K22, K23, K24, K25 }, \
14 { K30, K31, K32, K33, K34, K35 }, \
15 { K40, K41, K42, K43, K44, K45 } \
16}
17
18#endif