aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryiancar <yiangosyiangou@cytanet.com.cy>2018-02-10 23:47:15 +0100
committerJack Humbert <jack.humb@gmail.com>2018-02-10 17:47:15 -0500
commit88a7fa762f0b6b696b15334dde4851fdc601b558 (patch)
treeea283f660750e58853347ff860954f795c937c45
parentcd0c089b49c1b6e5b0fb13491935f278e9c1986f (diff)
downloadqmk_firmware-88a7fa762f0b6b696b15334dde4851fdc601b558.tar.gz
qmk_firmware-88a7fa762f0b6b696b15334dde4851fdc601b558.zip
New keyboard: Cu75 (#2374)
* Added Modular keyboards L,R and NUM Created code modules for the 3 modules of the modular keyboard. Original idea by MechboardsUK. Uses i2c implementation similar to lets split * Remove modular from master This is to fix incorrect branching * Addition of cu75 Addition of cu75 keyboard, uses libraries from LFKeyboards directory which are path linked to reduce file duplication. Minor fix on cu24 readme * Minor Readme Fix
-rw-r--r--keyboards/cu24/readme.md2
-rw-r--r--keyboards/cu75/config.h151
-rw-r--r--keyboards/cu75/cu75.c179
-rw-r--r--keyboards/cu75/cu75.h110
-rw-r--r--keyboards/cu75/keymaps/default/config.h8
-rw-r--r--keyboards/cu75/keymaps/default/keymap.c91
-rw-r--r--keyboards/cu75/keymaps/default/rules.mk53
-rw-r--r--keyboards/cu75/keymaps/iso/config.h8
-rw-r--r--keyboards/cu75/keymaps/iso/keymap.c91
-rw-r--r--keyboards/cu75/keymaps/iso/rules.mk53
-rw-r--r--keyboards/cu75/readme.md17
-rw-r--r--keyboards/cu75/rules.mk41
12 files changed, 803 insertions, 1 deletions
diff --git a/keyboards/cu24/readme.md b/keyboards/cu24/readme.md
index a017cd665..4624c1aa9 100644
--- a/keyboards/cu24/readme.md
+++ b/keyboards/cu24/readme.md
@@ -6,7 +6,7 @@ A luxurious 24 key keypad with various layouts. Includes RGB underglow, backligh
6 6
7Keyboard Maintainer: [Yiancar](https://github.com/yiancar) 7Keyboard Maintainer: [Yiancar](https://github.com/yiancar)
8Hardware Supported: PCB v1.0 (uses a 32u4) 8Hardware Supported: PCB v1.0 (uses a 32u4)
9Hardware Availability: http://caps-unlocked.com/ 9Hardware Availability: [caps-unlocked.com](http://caps-unlocked.com/)
10 10
11Make example for this keyboard (after setting up your build environment): 11Make example for this keyboard (after setting up your build environment):
12 12
diff --git a/keyboards/cu75/config.h b/keyboards/cu75/config.h
new file mode 100644
index 000000000..c21e1da01
--- /dev/null
+++ b/keyboards/cu75/config.h
@@ -0,0 +1,151 @@
1/*
2Copyright 2012 Jun Wako <wakojun@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#ifndef CONFIG_H
19#define CONFIG_H
20
21#include "config_common.h"
22
23#define VENDOR_ID 0xFEED
24#define PRODUCT_ID 0x6062
25#define DEVICE_VER 0x0001
26#define MANUFACTURER LFKeyboards/CapsUnlocked
27#define PRODUCT CU75
28#define DESCRIPTION A luxurious fully customisable 75%
29
30#define DIODE_DIRECTION COL2ROW
31#define MATRIX_ROWS 6
32#define MATRIX_COLS 16
33#define MATRIX_ROW_PINS {F1, B7, B3, D2, D3, B2}
34#define MATRIX_COL_PINS {F4, F5, F6, F7, C7, C6, B6, B5, B4, D7, D6, D4, D5, B1, B0, F0}
35#define UNUSED_PINS {}
36
37#define RGB_DI_PIN C7 // Have to set it to something to get the ws2812 code to compile
38#define RGBLED_NUM 24 // Number of LEDs
39#define RGBLIGHT_ANIMATIONS
40#define RGBLIGHT_HUE_STEP 10
41#define RGBLIGHT_SAT_STEP 17
42#define RGBLIGHT_VAL_STEP 17
43
44/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
45#define DEBOUNCING_DELAY 5
46
47/* define if matrix has ghost (lacks anti-ghosting diodes) */
48//#define MATRIX_HAS_GHOST
49
50/* number of backlight levels */
51#define BACKLIGHT_LEVELS 8
52#define BACKLIGHT_PWM_MAP {8, 16, 40, 55, 70, 128, 200, 255}
53
54/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
55#define LOCKING_SUPPORT_ENABLE
56/* Locking resynchronize hack */
57#define LOCKING_RESYNC_ENABLE
58
59/*
60 * Force NKRO
61 *
62 * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
63 * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
64 * makefile for this to work.)
65 *
66 * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
67 * until the next keyboard reset.
68 *
69 * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
70 * fully operational during normal computer usage.
71 *
72 * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
73 * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
74 * bootmagic, NKRO mode will always be enabled until it is toggled again during a
75 * power-up.
76 *
77 */
78//#define FORCE_NKRO
79
80/*
81 * Magic Key Options
82 *
83 * Magic keys are hotkey commands that allow control over firmware functions of
84 * the keyboard. They are best used in combination with the HID Listen program,
85 * found here: https://www.pjrc.com/teensy/hid_listen.html
86 *
87 * The options below allow the magic key functionality to be changed. This is
88 * useful if your keyboard/keypad is missing keys and you want magic key support.
89 *
90 */
91
92/* key combination for magic key command */
93#define IS_COMMAND() ( \
94 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
95)
96
97/* control how magic key switches layers */
98//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
99//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
100//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
101
102/* override magic key keymap */
103//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
104//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
105//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
106//#define MAGIC_KEY_HELP1 H
107//#define MAGIC_KEY_HELP2 SLASH
108//#define MAGIC_KEY_DEBUG D
109//#define MAGIC_KEY_DEBUG_MATRIX X
110//#define MAGIC_KEY_DEBUG_KBD K
111//#define MAGIC_KEY_DEBUG_MOUSE M
112//#define MAGIC_KEY_VERSION V
113//#define MAGIC_KEY_STATUS S
114//#define MAGIC_KEY_CONSOLE C
115//#define MAGIC_KEY_LAYER0_ALT1 ESC
116//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
117//#define MAGIC_KEY_LAYER0 0
118//#define MAGIC_KEY_LAYER1 1
119//#define MAGIC_KEY_LAYER2 2
120//#define MAGIC_KEY_LAYER3 3
121//#define MAGIC_KEY_LAYER4 4
122//#define MAGIC_KEY_LAYER5 5
123//#define MAGIC_KEY_LAYER6 6
124//#define MAGIC_KEY_LAYER7 7
125//#define MAGIC_KEY_LAYER8 8
126//#define MAGIC_KEY_LAYER9 9
127//#define MAGIC_KEY_BOOTLOADER PAUSE
128//#define MAGIC_KEY_LOCK CAPS
129//#define MAGIC_KEY_EEPROM E
130//#define MAGIC_KEY_NKRO N
131//#define MAGIC_KEY_SLEEP_LED Z
132
133/*
134 * Feature disable options
135 * These options are also useful to firmware size reduction.
136 */
137
138/* disable debug print */
139//#define NO_DEBUG
140
141/* disable print */
142//#define NO_PRINT
143
144/* disable action features */
145//#define NO_ACTION_LAYER
146//#define NO_ACTION_TAPPING
147//#define NO_ACTION_ONESHOT
148//#define NO_ACTION_MACRO
149//#define NO_ACTION_FUNCTION
150
151#endif
diff --git a/keyboards/cu75/cu75.c b/keyboards/cu75/cu75.c
new file mode 100644
index 000000000..6dc289845
--- /dev/null
+++ b/keyboards/cu75/cu75.c
@@ -0,0 +1,179 @@
1#include <avr/sfr_defs.h>
2#include <avr/timer_avr.h>
3#include <avr/wdt.h>
4#include "cu75.h"
5#include "keymap.h"
6#include "debug.h"
7#include "../lfkeyboards/issi.h"
8#include "../lfkeyboards/TWIlib.h"
9#include "../lfkeyboards/lighting.h"
10
11#ifdef AUDIO_ENABLE
12float test_sound[][2] = SONG(STARTUP_SOUND);
13#include <audio/audio.h>
14#endif
15
16uint16_t click_hz = CLICK_HZ;
17uint16_t click_time = CLICK_MS;
18uint8_t click_toggle = CLICK_ENABLED;
19
20
21void matrix_init_kb(void)
22{
23 // put your keyboard start-up code here
24 // runs once when the firmware starts up
25 matrix_init_user();
26
27#ifdef AUDIO_ENABLE
28 audio_init();
29 PLAY_NOTE_ARRAY(test_sound, false, STACCATO);
30 // Fix port B5
31 cbi(DDRB, 5);
32 sbi(PORTB, 5);
33#else
34 // If we're not using the audio pin, drive it low
35 sbi(DDRC, 6);
36 cbi(PORTC, 6);
37#endif
38#ifdef ISSI_ENABLE
39 issi_init();
40#endif
41}
42
43void matrix_scan_kb(void)
44{
45#ifdef WATCHDOG_ENABLE
46 wdt_reset();
47#endif
48#ifdef ISSI_ENABLE
49 // switch/underglow lighting update
50 static uint32_t issi_device = 0;
51 static uint32_t twi_last_ready = 0;
52 if(twi_last_ready > 1000){
53 // Its been way too long since the last ISSI update, reset the I2C bus and start again
54 dprintf("TWI failed to recover, TWI re-init\n");
55 twi_last_ready = 0;
56 TWIInit();
57 force_issi_refresh();
58 }
59 if(isTWIReady()){
60 twi_last_ready = 0;
61 // If the i2c bus is available, kick off the issi update, alternate between devices
62 update_issi(issi_device, issi_device);
63 if(issi_device){
64 issi_device = 0;
65 }else{
66 issi_device = 3;
67 }
68 }else{
69 twi_last_ready++;
70 }
71#endif
72 matrix_scan_user();
73}
74
75void click(uint16_t freq, uint16_t duration){
76#ifdef AUDIO_ENABLE
77 if(freq >= 100 && freq <= 20000 && duration < 100){
78 play_note(freq, 10);
79 for (uint16_t i = 0; i < duration; i++){
80 _delay_ms(1);
81 }
82 stop_all_notes();
83 }
84#endif
85}
86
87bool process_record_kb(uint16_t keycode, keyrecord_t* record)
88{
89 // Test code that turns on the switch led for the key that is pressed
90 // set_backlight_by_keymap(record->event.key.col, record->event.key.row);
91 if (click_toggle && record->event.pressed){
92 click(click_hz, click_time);
93 }
94 if (keycode == RESET) {
95 reset_keyboard_kb();
96 } else {
97 }
98 return process_record_user(keycode, record);
99}
100
101void action_function(keyrecord_t *event, uint8_t id, uint8_t opt)
102{
103#ifdef AUDIO_ENABLE
104 int8_t sign = 1;
105#endif
106 if(id == LFK_ESC_TILDE){
107 // Send ~ on shift-esc
108 void (*method)(uint8_t) = (event->event.pressed) ? &add_key : &del_key;
109 uint8_t shifted = get_mods() & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT));
110 method(shifted ? KC_GRAVE : KC_ESCAPE);
111 send_keyboard_report();
112 }else if(event->event.pressed){
113 switch(id){
114 case LFK_SET_DEFAULT_LAYER:
115 // set/save the current base layer to eeprom, falls through to LFK_CLEAR
116 eeconfig_update_default_layer(1UL << opt);
117 default_layer_set(1UL << opt);
118 case LFK_CLEAR:
119 // Go back to default layer
120 layer_clear();
121 break;
122#ifdef AUDIO_ENABLE
123 case LFK_CLICK_FREQ_LOWER:
124 sign = -1; // continue to next statement
125 case LFK_CLICK_FREQ_HIGHER:
126 click_hz += sign * 100;
127 click(click_hz, click_time);
128 break;
129 case LFK_CLICK_TOGGLE:
130 if(click_toggle){
131 click_toggle = 0;
132 click(4000, 100);
133 click(1000, 100);
134 }else{
135 click_toggle = 1;
136 click(1000, 100);
137 click(4000, 100);
138 }
139 break;
140 case LFK_CLICK_TIME_SHORTER:
141 sign = -1; // continue to next statement
142 case LFK_CLICK_TIME_LONGER:
143 click_time += sign;
144 click(click_hz, click_time);
145 break;
146#endif
147 case LFK_DEBUG_SETTINGS:
148 dprintf("Click:\n");
149 dprintf(" toggle: %d\n", click_toggle);
150 dprintf(" freq(hz): %d\n", click_hz);
151 dprintf(" duration(ms): %d\n", click_time);
152 break;
153 }
154 }
155}
156
157void reset_keyboard_kb(){
158#ifdef WATCHDOG_ENABLE
159 MCUSR = 0;
160 wdt_disable();
161 wdt_reset();
162#endif
163 reset_keyboard();
164}
165
166void led_set_kb(uint8_t usb_led)
167{
168 // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
169
170 led_set_user(usb_led);
171}
172
173// LFK lighting info
174const uint8_t switch_matrices[] = {0, 1};
175const uint8_t rgb_matrices[] = {6, 7};
176const uint8_t rgb_sequence[] = {
177 24, 23, 22, 21, 20, 19, 18, 17, 1, 2, 3, 4, 5,
178 6, 7, 8, 10, 11, 12, 13, 14, 15, 16, 9
179};
diff --git a/keyboards/cu75/cu75.h b/keyboards/cu75/cu75.h
new file mode 100644
index 000000000..e4d7f2f93
--- /dev/null
+++ b/keyboards/cu75/cu75.h
@@ -0,0 +1,110 @@
1#ifndef CU75_H
2#define CU75_H
3
4/* if the kb.h file exists (because we're running from qmkbuilder) include it */
5#ifdef __has_include
6#if __has_include("kb.h")
7#include "kb.h"
8#endif
9#endif
10
11#include "quantum.h"
12#include "matrix.h"
13#include <avr/sfr_defs.h>
14
15#ifndef cbi
16#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
17#endif
18
19#ifndef sbi
20#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
21#endif
22
23
24typedef struct RGB_Color {
25 uint16_t red;
26 uint16_t green;
27 uint16_t blue;
28} RGB_Color;
29
30typedef struct Layer_Info {
31 uint32_t layer;
32 uint32_t mask;
33 RGB_Color color;
34} Layer_Info;
35
36extern const uint32_t layer_count;
37extern const Layer_Info layer_info[];
38
39enum action_functions {
40 LFK_CLEAR = 0, // Resets all layers
41 LFK_ESC_TILDE, // esc+lshift = ~
42 LFK_SET_DEFAULT_LAYER, // changes and saves current base layer to eeprom
43 LFK_CLICK_TOGGLE, // Adjusts click duration
44 LFK_CLICK_FREQ_HIGHER, // Adjusts click frequency
45 LFK_CLICK_FREQ_LOWER, // Adjusts click frequency
46 LFK_CLICK_TIME_LONGER, // Adjusts click duration
47 LFK_CLICK_TIME_SHORTER, // Adjusts click duration
48 LFK_DEBUG_SETTINGS, // prints LED and click settings to HID
49 LFK_LED_TEST // cycles through switch and RGB LEDs
50};
51
52#define CLICK_HZ 500
53#define CLICK_MS 2
54#define CLICK_ENABLED 0
55
56void reset_keyboard_kb(void);
57void click(uint16_t freq, uint16_t duration);
58
59/* Vanilla Keymap */
60// This a shortcut to help you visually see your layout.
61/*
62* ,-------------------------------------------------------------------------------.
63* | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 0A | 0B | 0C | 0D | 0E | 0F | 0G |
64* |-------------------------------------------------------------------------------|
65* | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 1A | 1B | 1C | 1D | 1E | 1G |
66* |-------------------------------------------------------------------------------|
67* | 21 | 22 |23 | 24 | 25 | 26 | 27 | 28 | 29 | 2A | 2B | 2C | 2D | 2E | 2F |
68* |-------------------------------------------------------------------------------|
69* | 31 | 32 |33 | 34 | 35 | 36 | 37 | 38 | 39 | 3A | 3B | 3C | 3D | 3F |
70* |-------------------------------------------------------------------------------|
71* | 41 | 42 |43 | 45 | 46 | 47 | 48 | 49 | 4A | 4B | 4C | 4D | 4E | 4F |
72* |-------------------------------------------------------------------------------|
73* | 51 | 52 | 53 | 54 | 57 | 59 | 5A | 5B | 5C | 5D | 5E | 5F |
74* `-------------------------------------------------------------------------------'
75*/
76// The first section contains all of the arguements
77// The second converts the arguments into a two-dimensional array
78#define KEYMAP( \
79 k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F, k0G, \
80 k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, k1G, \
81 k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, k2F, \
82 k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3F, \
83 k41, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, k4F, \
84 k51, k52, k53, k54, k57, k59, k5A, k5B, k5C, k5D, k5E, k5F \
85) { \
86 {k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F, k0G}, \
87 {k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, KC_NO, k1G}, \
88 {k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, k2F, KC_NO}, \
89 {k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, KC_NO, k3F, KC_NO}, \
90 {k41, KC_NO, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, k4F, KC_NO}, \
91 {k51, k52, k53, k54, KC_NO, KC_NO, k57, KC_NO, k59, k5A, k5B, k5C, k5D, k5E, k5F, KC_NO}, \
92}
93
94#define ISO_KEYMAP( \
95 k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F, k0G, \
96 k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, k1G, \
97 k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k3D, k2F, \
98 k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k2E, k3F, \
99 k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, k4F, \
100 k51, k52, k53, k54, k57, k59, k5A, k5B, k5C, k5D, k5E, k5F \
101) { \
102 {k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F, k0G}, \
103 {k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, KC_NO, k1G}, \
104 {k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, k2F, KC_NO}, \
105 {k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, KC_NO, k3F, KC_NO}, \
106 {k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, k4F, KC_NO}, \
107 {k51, k52, k53, k54, KC_NO, KC_NO, k57, KC_NO, k59, k5A, k5B, k5C, k5D, k5E, k5F, KC_NO}, \
108}
109
110#endif //CU75_H
diff --git a/keyboards/cu75/keymaps/default/config.h b/keyboards/cu75/keymaps/default/config.h
new file mode 100644
index 000000000..8893d122e
--- /dev/null
+++ b/keyboards/cu75/keymaps/default/config.h
@@ -0,0 +1,8 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6// place overrides here
7
8#endif
diff --git a/keyboards/cu75/keymaps/default/keymap.c b/keyboards/cu75/keymaps/default/keymap.c
new file mode 100644
index 000000000..dfd96fbd5
--- /dev/null
+++ b/keyboards/cu75/keymaps/default/keymap.c
@@ -0,0 +1,91 @@
1#include "cu75.h"
2#include "action_layer.h"
3
4//Define a shorter 'transparent' key code to make the keymaps more compact
5#define KC_TR KC_TRNS
6
7enum keymap_layout {
8 VANILLA = 0,
9 FUNC,
10 SETTINGS,
11};
12
13
14const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
15[VANILLA] = KEYMAP(
16 /* Keymap VANILLA: (Base Layer) Default Layer
17 * ,------------------------------------------------------------.----.
18 * |Esc | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|F13|F14| F15|
19 * |------------------------------------------------------------|----|
20 * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backspa| Ins|
21 * |------------------------------------------------------------|----|
22 * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| Del|
23 * |------------------------------------------------------------|----|
24 * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |PgUp|
25 * |------------------------------------------------------------|----|
26 * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Up |PgDn|
27 * |-----------------------------------------------------------------|
28 * |Ctrl|Win |Alt |Space| Space |Space|Alt |Ctrl|Func|Lft| Dn |Rig |
29 * `-----------------------------------------------------------------'
30 */
31 KC_ESC,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15,
32 KC_GRV,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS,
33 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL,
34 KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP,
35 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN,
36 KC_LCTL, KC_LGUI, KC_LALT,KC_SPC, KC_SPC, KC_SPC,KC_RALT, KC_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT),
37
38[FUNC] = KEYMAP(
39 /* Keymap VANILLA: Function Layer
40 * ,-------------------------------------------------------------------.
41 * | | | | | | | | | | | | | | | | |
42 * |-------------------------------------------------------------------|
43 * | | | | | | | | | | | | | | | |
44 * |-------------------------------------------------------------------|
45 * | | | | | | | | | | | | | | | RGB_TOG|
46 * |-------------------------------------------------------------------|
47 * | | | | | | | | | | | | |RESET |RGB_MODE|
48 * |-------------------------------------------------------------------|
49 * | | | | | | | | | | | | |RGB_HUI| |
50 * |-------------------------------------------------------------------|
51 * | | | | | | | |RGB_SAD|RGB_HUD|RGB_SAI|
52 * `-------------------------------------------------------------------'
53 */
54 KC_TR,KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR,
55 KC_TR,KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR,
56 KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR,KC_TR, RGB_TOG,
57 KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, RESET, RGB_MOD,
58 KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, RGB_VAD, RGB_VAI, KC_TR, KC_TR, RGB_HUI, KC_TR,
59 KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, RGB_SAD, RGB_HUD, RGB_SAI),
60};
61
62const uint16_t PROGMEM fn_actions[] = {
63 ACTION_FUNCTION(LFK_CLEAR), // FN0 - reset layers
64 ACTION_FUNCTION(LFK_ESC_TILDE), // FN1 - esc+shift = ~, else escape
65 };
66
67
68const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
69{
70 // MACRODOWN only works in this function
71 switch(id) {
72 }
73 return MACRO_NONE;
74};
75
76
77void matrix_init_user(void) {
78
79}
80
81void matrix_scan_user(void) {
82
83}
84
85bool process_record_user(uint16_t keycode, keyrecord_t *record) {
86 return true;
87}
88
89void led_set_user(uint8_t usb_led) {
90
91}
diff --git a/keyboards/cu75/keymaps/default/rules.mk b/keyboards/cu75/keymaps/default/rules.mk
new file mode 100644
index 000000000..39f6eca8b
--- /dev/null
+++ b/keyboards/cu75/keymaps/default/rules.mk
@@ -0,0 +1,53 @@
1# Build Options
2# change to "no" to disable the options, or define them in the Makefile in
3# the appropriate keymap folder that will get included automatically
4#
5
6BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
7MOUSEKEY_ENABLE = no # Mouse keys(+4700)
8EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
9CONSOLE_ENABLE = no # Console for debug(+400)
10COMMAND_ENABLE = no # Commands for debug and configuration
11NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
12BACKLIGHT_ENABLE = yes # Disable keyboard backlight functionality
13MIDI_ENABLE = no # MIDI controls
14AUDIO_ENABLE = no # Audio output on port C6
15UNICODE_ENABLE = no # Unicode
16BLUETOOTH_ENABLE = no # Disable Bluetooth with the Adafruit EZ-Key HID
17RGBLIGHT_ENABLE = yes # Disable RGB underlight
18RGBLIGHT_CUSTOM_DRIVER = yes # RGB code is implemented in lefkeyboards, not WS2812
19SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
20TAP_DANCE_ENABLE = no
21
22ISSI_ENABLE = yes # If the I2C pullup resistors aren't install this must be disabled
23WATCHDOG_ENABLE = no # Resets keyboard if matrix_scan isn't run every 250ms
24
25
26ifndef QUANTUM_DIR
27 include ../../../../Makefile
28endif
29
30ifeq ($(strip $(ISSI_ENABLE)), yes)
31 TMK_COMMON_DEFS += -DISSI_ENABLE
32endif
33
34ifeq ($(strip $(WATCHDOG_ENABLE)), yes)
35 TMK_COMMON_DEFS += -DWATCHDOG_ENABLE
36endif
37
38
39# # Set the LFK78 hardware version. This is defined in rules.mk, but can be overidden here if desired
40# #
41# # RevB - first public release, uses atmega32u4, has audio, ISSI matrix split between RGB and backlight
42# # RevC/D - at90usb1286, no audio, ISSI device 0 is backlight, 4 is RGB
43# #
44# # Set to B, C or D
45# LFK_REV = D
46
47# ifeq ($(LFK_REV), B)
48# MCU = atmega32u4
49# else
50# MCU = at90usb1286
51# endif
52# OPT_DEFS += -DLFK_REV_$(LFK_REV)
53# OPT_DEFS += -DUSB_PRODUCT=\"LFK_Rev$(LFK_REV)\"
diff --git a/keyboards/cu75/keymaps/iso/config.h b/keyboards/cu75/keymaps/iso/config.h
new file mode 100644
index 000000000..8893d122e
--- /dev/null
+++ b/keyboards/cu75/keymaps/iso/config.h
@@ -0,0 +1,8 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6// place overrides here
7
8#endif
diff --git a/keyboards/cu75/keymaps/iso/keymap.c b/keyboards/cu75/keymaps/iso/keymap.c
new file mode 100644
index 000000000..f00788e6a
--- /dev/null
+++ b/keyboards/cu75/keymaps/iso/keymap.c
@@ -0,0 +1,91 @@
1#include "cu75.h"
2#include "action_layer.h"
3
4//Define a shorter 'transparent' key code to make the keymaps more compact
5#define KC_TR KC_TRNS
6
7enum keymap_layout {
8 VANILLA = 0,
9 FUNC,
10 SETTINGS,
11};
12
13
14const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
15[VANILLA] = ISO_KEYMAP(
16 /* Keymap VANILLA: (Base Layer) Default Layer
17 * ,------------------------------------------------------------.----.
18 * |Esc | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|F13|F14| F15|
19 * |------------------------------------------------------------|----|
20 * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backspa| Ins|
21 * |------------------------------------------------------------|----|
22 * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| Ret | Del|
23 * |--------------------------------------------------------. |----|
24 * |CAPS | A| S| D| F| G| H| J| K| L| ;| '| # | |PgUp|
25 * |------------------------------------------------------------|----|
26 * |Shft| \ | Z| X| C| V| B| N| M| ,| .| /|Shift | Up |PgDn|
27 * |-----------------------------------------------------------------|
28 * |Ctrl|Win |Alt | Space |Alt |Ctrl|Func|Lft| Dn |Rig |
29 * `-----------------------------------------------------------------'
30 */
31 KC_ESC,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15,
32 KC_GRV,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS,
33 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_ENT, KC_DEL,
34 KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_PGUP,
35 KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN,
36 KC_LCTL, KC_LGUI, KC_LALT,KC_SPC, KC_SPC, KC_SPC,KC_RALT, KC_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT),
37
38[FUNC] = KEYMAP(
39 /* Keymap VANILLA: Function Layer
40 * ,-------------------------------------------------------------------.
41 * | | | | | | | | | | | | | | | | |
42 * |-------------------------------------------------------------------|
43 * | | | | | | | | | | | | | | | |
44 * |-------------------------------------------------------------------|
45 * | | | | | | | | | | | | | | | RGB_TOG|
46 * |-------------------------------------------------------------------|
47 * | | | | | | | | | | | | |RESET |RGB_MODE|
48 * |-------------------------------------------------------------------|
49 * | | | | | | | | | | | | |RGB_HUI| |
50 * |-------------------------------------------------------------------|
51 * | | | | | | | |RGB_SAD|RGB_HUD|RGB_SAI|
52 * `-------------------------------------------------------------------'
53 */
54 KC_TR,KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR,
55 KC_TR,KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR,
56 KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR,KC_TR, RGB_TOG,
57 KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, RESET, RGB_MOD,
58 KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, RGB_VAD, RGB_VAI, KC_TR, KC_TR, RGB_HUI, KC_TR,
59 KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, RGB_SAD, RGB_HUD, RGB_SAI),
60};
61
62const uint16_t PROGMEM fn_actions[] = {
63 ACTION_FUNCTION(LFK_CLEAR), // FN0 - reset layers
64 ACTION_FUNCTION(LFK_ESC_TILDE), // FN1 - esc+shift = ~, else escape
65 };
66
67
68const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
69{
70 // MACRODOWN only works in this function
71 switch(id) {
72 }
73 return MACRO_NONE;
74};
75
76
77void matrix_init_user(void) {
78
79}
80
81void matrix_scan_user(void) {
82
83}
84
85bool process_record_user(uint16_t keycode, keyrecord_t *record) {
86 return true;
87}
88
89void led_set_user(uint8_t usb_led) {
90
91}
diff --git a/keyboards/cu75/keymaps/iso/rules.mk b/keyboards/cu75/keymaps/iso/rules.mk
new file mode 100644
index 000000000..f8b4d5568
--- /dev/null
+++ b/keyboards/cu75/keymaps/iso/rules.mk
@@ -0,0 +1,53 @@
1# Build Options
2# change to "no" to disable the options, or define them in the Makefile in
3# the appropriate keymap folder that will get included automatically
4#
5
6BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
7MOUSEKEY_ENABLE = no # Mouse keys(+4700)
8EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
9CONSOLE_ENABLE = yes # Console for debug(+400)
10COMMAND_ENABLE = yes # Commands for debug and configuration
11NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
12# BACKLIGHT_ENABLE = no # Disable keyboard backlight functionality
13MIDI_ENABLE = no # MIDI controls
14AUDIO_ENABLE = no # Audio output on port C6
15UNICODE_ENABLE = no # Unicode
16BLUETOOTH_ENABLE = no # Disable Bluetooth with the Adafruit EZ-Key HID
17RGBLIGHT_ENABLE = no # Disable RGB underlight
18RGBLIGHT_CUSTOM_DRIVER = yes # RGB code is implemented in lefkeyboards, not WS2812
19SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
20TAP_DANCE_ENABLE = no
21
22ISSI_ENABLE = no # If the I2C pullup resistors aren't install this must be disabled
23WATCHDOG_ENABLE = yes # Resets keyboard if matrix_scan isn't run every 250ms
24
25
26ifndef QUANTUM_DIR
27 include ../../../../Makefile
28endif
29
30ifeq ($(strip $(ISSI_ENABLE)), yes)
31 TMK_COMMON_DEFS += -DISSI_ENABLE
32endif
33
34ifeq ($(strip $(WATCHDOG_ENABLE)), yes)
35 TMK_COMMON_DEFS += -DWATCHDOG_ENABLE
36endif
37
38
39# # Set the LFK78 hardware version. This is defined in rules.mk, but can be overidden here if desired
40# #
41# # RevB - first public release, uses atmega32u4, has audio, ISSI matrix split between RGB and backlight
42# # RevC/D - at90usb1286, no audio, ISSI device 0 is backlight, 4 is RGB
43# #
44# # Set to B, C or D
45# LFK_REV = D
46
47# ifeq ($(LFK_REV), B)
48# MCU = atmega32u4
49# else
50# MCU = at90usb1286
51# endif
52# OPT_DEFS += -DLFK_REV_$(LFK_REV)
53# OPT_DEFS += -DUSB_PRODUCT=\"LFK_Rev$(LFK_REV)\"
diff --git a/keyboards/cu75/readme.md b/keyboards/cu75/readme.md
new file mode 100644
index 000000000..6c3029a3f
--- /dev/null
+++ b/keyboards/cu75/readme.md
@@ -0,0 +1,17 @@
1# CU75
2
3![CU75](https://geekhack.org/index.php?action=dlattach;topic=91767.0;attach=179167;image)
4
5A luxurious 75% keyboard with various layouts. Includes RGB underglow, backlight and an aluminium, brass and nylon case.
6
7Keyboard Maintainer: [Yiancar](https://github.com/yiancar) and [LFKeyboards](https://github.com/lfkeyboards)
8Hardware Supported: PCB v1.0 (uses a 32u4)
9Hardware Availability: [caps-unlocked.com](http://caps-unlocked.com/)
10
11This PCB uses lighting libraries from LFKeyboards
12
13Make example for this keyboard (after setting up your build environment):
14
15 make CU75: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.
diff --git a/keyboards/cu75/rules.mk b/keyboards/cu75/rules.mk
new file mode 100644
index 000000000..a84343f05
--- /dev/null
+++ b/keyboards/cu75/rules.mk
@@ -0,0 +1,41 @@
1MCU = atmega32u4
2OPT_DEFS += -DBOOTLOADER_SIZE=4096
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#
20# LUFA specific
21#
22# Target architecture (see library "Board Types" documentation).
23ARCH = AVR8
24
25# Input clock frequency.
26# This will define a symbol, F_USB, in all source code files equal to the
27# input clock frequency (before any prescaling is performed) in Hz. This value may
28# differ from F_CPU if prescaling is used on the latter, and is required as the
29# raw input clock is fed directly to the PLL sections of the AVR for high speed
30# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
31# at the end, this will be done automatically to create a 32-bit value in your
32# source code.
33#
34# If no clock division is performed on the input clock inside the AVR (via the
35# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
36F_USB = $(F_CPU)
37
38# Interrupt driven control endpoint task(+60)
39OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
40
41SRC = ../lfkeyboards/TWIlib.c ../lfkeyboards/issi.c ../lfkeyboards/lighting.c \ No newline at end of file