diff options
author | Zach White <skullydazed@users.noreply.github.com> | 2020-05-06 09:55:44 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-06 09:55:44 -0700 |
commit | a30cc37c09591d15540be00825b3ff4901ea193e (patch) | |
tree | 9f8cba1c8d11ed5ea2c2a4e0a680f18961d172cd /keyboards/clueboard/2x1800/2019 | |
parent | b18c261040f6473fa445e57c80f1c5646797105c (diff) |
New keyboard: Clueboard 2x1800 2019 (#8721)
* Initial support for the 2019 2x1800
* Get all hardware working.
* Fix shake to undo
* Use the method suggested by @reywood
* Remove the unnecessary for loop
* changes suggested by @noroadsleft
* Fix comma, period, and forward slash keys for clueboard 2x1800 default keymap by @reywood
* Call led_set_user at the end of led_set_kb (#6265)
* [Keymap] Add default layouts for 2u spacebar (#6266)
* make progress on drawing mode
* Finish drawing toy mode
* Update keyboards/clueboard/2x1800/2019/config.h
Co-Authored-By: Drashna Jaelre <drashna@live.com>
* Update keyboards/clueboard/2x1800/2019/2019.c
Co-Authored-By: Drashna Jaelre <drashna@live.com>
* Update keyboards/clueboard/2x1800/2019/2019.c
Co-Authored-By: Drashna Jaelre <drashna@live.com>
* Update keyboards/clueboard/2x1800/2019/2019.c
Co-Authored-By: Drashna Jaelre <drashna@live.com>
* Update keyboards/clueboard/2x1800/2019/rules.mk
Co-Authored-By: Drashna Jaelre <drashna@live.com>
* Update keyboards/clueboard/2x1800/2019/rules.mk
Co-Authored-By: Ryan <fauxpark@gmail.com>
* remove unnecessary files
* Update keyboards/clueboard/2x1800/2019/rules.mk
Co-Authored-By: Ryan <fauxpark@gmail.com>
* apply suggestions
* Apply suggestions from code review
Co-Authored-By: Ryan <fauxpark@gmail.com>
Co-authored-by: Sean Dwyer <sean.dwyer@gmail.com>
Co-authored-by: Drashna Jaelre <drashna@live.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
Diffstat (limited to 'keyboards/clueboard/2x1800/2019')
28 files changed, 1053 insertions, 0 deletions
diff --git a/keyboards/clueboard/2x1800/2019/2019.c b/keyboards/clueboard/2x1800/2019/2019.c new file mode 100644 index 0000000000..29f7a4901c --- /dev/null +++ b/keyboards/clueboard/2x1800/2019/2019.c @@ -0,0 +1,182 @@ +/* Copyright 2017 Zach White <skullydazed@gmail.com> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +#include "2019.h" + +void matrix_init_kb(void) { + // Set our LED pins as output + setPinOutput(D6); + setPinOutput(B4); + setPinOutput(B5); + setPinOutput(B6); + + // Set our Tilt Sensor pins as input + setPinInputHigh(SHAKE_PIN_A); + setPinInputHigh(SHAKE_PIN_B); + + // Run the keymap level init + matrix_init_user(); +} + +#ifdef DRAWING_ENABLE +bool drawing_mode = false; +bool btn1_pressed = false; +bool btn2_pressed = false; +bool btn3_pressed = false; +bool btn4_pressed = false; + +void check_encoder_buttons(void) { + if (btn1_pressed && btn2_pressed && btn3_pressed && btn4_pressed) { + // All 4 buttons pressed, toggle drawing mode + if (drawing_mode) { + dprintf("Turning drawing mode off.\n"); + drawing_mode = false; + writePinLow(D6); + unregister_code(KC_BTN1); + } else { + dprintf("Turning drawing mode on.\n"); + drawing_mode = true; + writePinHigh(D6); + register_code(KC_BTN1); + } + } +} +#endif + +#ifdef SHAKE_ENABLE +uint8_t tilt_state = 0x11; +uint8_t detected_shakes = 0; +static uint16_t shake_timer; +#endif + +void matrix_scan_kb(void) { +#ifdef SHAKE_ENABLE + // Read the current state of the tilt sensor. It is physically + // impossible for both pins to register a low state at the same time. + uint8_t tilt_read = (readPin(SHAKE_PIN_A) << 4) | readPin(SHAKE_PIN_B); + + // Check to see if the tilt sensor has changed state since our last read + if (tilt_state != tilt_read) { + shake_timer = timer_read(); + detected_shakes++; + tilt_state = tilt_read; + } + + if ((detected_shakes > 0) && (timer_elapsed(shake_timer) > SHAKE_TIMEOUT)) { + if (detected_shakes > SHAKE_COUNT) { + dprintf("Shake triggered! We detected %d shakes.\n", detected_shakes); + tap_code16(SHAKE_KEY); + } else { + dprintf("Shake not triggered! We detected %d shakes.\n", detected_shakes); + } + detected_shakes = 0; + } +#endif + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { +#ifdef DRAWING_ENABLE + if (keycode == ENC_BTN1) { + if (record->event.pressed) { + btn1_pressed = true; + register_code(KC_BTN1); + } else { + btn1_pressed = false; + unregister_code(KC_BTN1); + } + } + if (keycode == ENC_BTN2) { + if (record->event.pressed) { + btn2_pressed = true; + register_code(KC_BTN2); + } else { + btn2_pressed = false; + unregister_code(KC_BTN2); + } + } + if (keycode == ENC_BTN3) { + if (record->event.pressed) { + btn3_pressed = true; + register_code(KC_BTN3); + } else { + btn3_pressed = false; + unregister_code(KC_BTN3); + } + } + if (keycode == ENC_BTN4) { + if (record->event.pressed) { + btn4_pressed = true; + register_code(KC_BTN4); + } else { + btn4_pressed = false; + unregister_code(KC_BTN4); + } + } + + check_encoder_buttons(); +#endif + + return process_record_user(keycode, record); +} + +bool led_update_kb(led_t led_state) { + bool res = led_update_user(led_state); + if(res) { + writePin(B4, !led_state.num_lock); + writePin(B5, !led_state.caps_lock); + writePin(B6, !led_state.scroll_lock); + } + + return res; +} + +__attribute__ ((weak)) +bool encoder_update_keymap(int8_t index, bool clockwise) { + return false; +} + +void encoder_update_kb(int8_t index, bool clockwise) { + if (!encoder_update_keymap(index, clockwise)) { + // Encoder 1, outside left + if (index == 0 && clockwise) { + tap_code(KC_MS_U); // turned right + } else if (index == 0) { + tap_code(KC_MS_D); // turned left + } + + // Encoder 2, inside left + else if (index == 1 && clockwise) { + tap_code(KC_WH_D); // turned right + } else if (index == 1) { + tap_code(KC_WH_U); // turned left + } + + // Encoder 3, inside right + else if (index == 2 && clockwise) { + tap_code(KC_VOLU); // turned right + } else if (index == 2) { + tap_code(KC_VOLD); // turned left + } + + // Encoder 4, outside right + else if (index == 3 && clockwise) { + tap_code(KC_MS_R); // turned right + } else if (index == 3) { + tap_code(KC_MS_L); // turned left + } + } +} diff --git a/keyboards/clueboard/2x1800/2019/2019.h b/keyboards/clueboard/2x1800/2019/2019.h new file mode 100644 index 0000000000..b9151071fd --- /dev/null +++ b/keyboards/clueboard/2x1800/2019/2019.h @@ -0,0 +1,257 @@ +/* Copyright 2017 Zach White <skullydazed@gmail.com> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +#pragma once + +#include "quantum.h" + +enum TWOx1800_keycodes { + ENC_BTN1 = SAFE_RANGE, + ENC_BTN2, + ENC_BTN3, + ENC_BTN4, + NEW_SAFE_RANGE +}; + +#undef SAFE_RANGE +#define SAFE_RANGE NEW_SAFE_RANGE + +// This a shortcut to help you visually see your layout. +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array +#define LAYOUT_all( \ + e00, e01, e02, e03, \ + k00, k01, k02, k03, k04, k06, k07, k08, k09, k0a, k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6a, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k70, k71, k72, k73, k74, k75, k76, k77, k78, k79, k7a, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k80, k81, k82, k83, k84, k85, k86, k87, k88, k89, k8a, \ + k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k90, k91, k92, k93, k94, k9a, k95, k97, k98, k99, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, ka0, ka1, ka2, ka3, ka4, ka5, k96, ka7, ka8, ka9, kaa, \ + k51, k52, k53, k54, k55, k56, k57, k58, k59, k5a, kb0, kb1, kb2, kb3, kb4, kb5, ka6, kb6, kb7, kb8, kb9 \ +) { \ + { k00, k01, k02, k03, k04, KC_NO, k06, k07, k08, k09, k0a }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a }, \ + { KC_NO, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a }, \ + { KC_NO, k51, k52, k53, k54, k55, k56, k57, k58, k59, k5a }, \ + { k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6a }, \ + { k70, k71, k72, k73, k74, k75, k76, k77, k78, k79, k7a }, \ + { k80, k81, k82, k83, k84, k85, k86, k87, k88, k89, k8a }, \ + { k90, k91, k92, k93, k94, k95, k96, k97, k98, k99, k9a }, \ + { ka0, ka1, ka2, ka3, ka4, ka5, ka6, ka7, ka8, ka9, kaa }, \ + { kb0, kb1, kb2, kb3, kb4, kb5, kb6, kb7, kb8, kb9, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, e00, e01, KC_NO, KC_NO, KC_NO, KC_NO, e02, e03 } \ +} + +#define LAYOUT_1u_ansi( \ + e00, e01, e02, e03, \ + k00, k01, k02, k03, k04, k06, k07, k08, k09, k0a, k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6a, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k70, k71, k72, k73, k74, k75, k76, k77, k78, k79, k7a, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k80, k81, k82, k83, k84, k85, k86, k87, k88, k89, k8a, \ + k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k90, k91, k92, k93, k94, k95, k97, k98, k99, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, ka0, ka1, ka2, ka3, ka4, ka5, k96, ka7, ka8, ka9, kaa, \ + k51, k52, k53, k54, k55, k56, k57, k58, k59, k5a, kb0, kb1, kb2, kb3, kb4, kb5, ka6, kb6, kb7, kb8, kb9 \ +) { \ + { k00, k01, k02, k03, k04, KC_NO, k06, k07, k08, k09, k0a }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a }, \ + { KC_NO, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a }, \ + { KC_NO, k51, k52, k53, k54, k55, k56, k57, k58, k59, k5a }, \ + { k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6a }, \ + { k70, k71, k72, k73, k74, k75, k76, k77, k78, k79, k7a }, \ + { k80, k81, k82, k83, k84, k85, k86, k87, k88, k89, k8a }, \ + { k90, k91, k92, k93, k94, k95, k96, k97, k98, k99, KC_NO }, \ + { ka0, ka1, ka2, ka3, ka4, ka5, ka6, ka7, ka8, ka9, kaa }, \ + { kb0, kb1, kb2, kb3, kb4, kb5, kb6, kb7, kb8, kb9, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, e00, e01, KC_NO, KC_NO, KC_NO, KC_NO, e02, e03 } \ +} + +#define LAYOUT_1u_iso( \ + e00, e01, e02, e03, \ + k00, k01, k02, k03, k04, k06, k07, k08, k09, k0a, k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6a, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k70, k71, k72, k73, k74, k75, k76, k77, k78, k79, k7a, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k80, k81, k82, k83, k84, k85, k87, k88, k89, k8a, \ + k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k90, k91, k92, k93, k94, k9a, k95, k97, k98, k99, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, ka0, ka1, ka2, ka3, ka4, ka5, k96, ka7, ka8, ka9, kaa, \ + k51, k52, k53, k54, k55, k56, k57, k58, k59, k5a, kb0, kb1, kb2, kb3, kb4, kb5, ka6, kb6, kb7, kb8, kb9 \ +) { \ + { k00, k01, k02, k03, k04, KC_NO, k06, k07, k08, k09, k0a }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a }, \ + { KC_NO, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a }, \ + { KC_NO, k51, k52, k53, k54, k55, k56, k57, k58, k59, k5a }, \ + { k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6a }, \ + { k70, k71, k72, k73, k74, k75, k76, k77, k78, k79, k7a }, \ + { k80, k81, k82, k83, k84, k85, KC_NO, k87, k88, k89, k8a }, \ + { k90, k91, k92, k93, k94, k95, k96, k97, k98, k99, k9a }, \ + { ka0, ka1, ka2, ka3, ka4, ka5, ka6, ka7, ka8, ka9, kaa }, \ + { kb0, kb1, kb2, kb3, kb4, kb5, kb6, kb7, kb8, kb9, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, e00, e01, KC_NO, KC_NO, KC_NO, KC_NO, e02, e03 } \ +} + +#define LAYOUT_2u_ansi( \ + e00, e01, e02, e03, \ + k00, k01, k02, k03, k04, k06, k07, k08, k09, k0a, k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6a, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k70, k71, k72, k73, k74, k75, k76, k77, k78, k79, k7a, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k80, k81, k82, k83, k84, k85, k86, k87, k88, k89, k8a, \ + k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k90, k91, k92, k93, k94, k95, k97, k98, k99, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, ka0, ka1, ka2, ka3, ka4, ka5, k96, ka7, ka8, ka9, kaa, \ + k51, k52, k53, k54, k55, k56, k57, k58, k59, kb0, kb1, kb2, kb3, kb4, kb5, ka6, kb6, kb7, kb8, kb9 \ +) { \ + { k00, k01, k02, k03, k04, KC_NO, k06, k07, k08, k09, k0a }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a }, \ + { KC_NO, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a }, \ + { KC_NO, k51, k52, k53, k54, k55, k56, k57, k58, k59, KC_NO }, \ + { k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6a }, \ + { k70, k71, k72, k73, k74, k75, k76, k77, k78, k79, k7a }, \ + { k80, k81, k82, k83, k84, k85, k86, k87, k88, k89, k8a }, \ + { k90, k91, k92, k93, k94, k95, k96, k97, k98, k99, KC_NO }, \ + { ka0, ka1, ka2, ka3, ka4, ka5, ka6, ka7, ka8, ka9, kaa }, \ + { kb0, kb1, kb2, kb3, kb4, kb5, kb6, kb7, kb8, kb9, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, e00, e01, KC_NO, KC_NO, KC_NO, KC_NO, e02, e03 } \ +} + +#define LAYOUT_2u_iso( \ + e00, e01, e02, e03, \ + k00, k01, k02, k03, k04, k06, k07, k08, k09, k0a, k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6a, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k70, k71, k72, k73, k74, k75, k76, k77, k78, k79, k7a, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k80, k81, k82, k83, k84, k85, k87, k88, k89, k8a, \ + k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k90, k91, k92, k93, k94, k9a, k95, k97, k98, k99, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, ka0, ka1, ka2, ka3, ka4, ka5, k96, ka7, ka8, ka9, kaa, \ + k51, k52, k53, k54, k55, k56, k57, k58, k59, kb0, kb1, kb2, kb3, kb4, kb5, ka6, kb6, kb7, kb8, kb9 \ +) { \ + { k00, k01, k02, k03, k04, KC_NO, k06, k07, k08, k09, k0a }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a }, \ + { KC_NO, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a }, \ + { KC_NO, k51, k52, k53, k54, k55, k56, k57, k58, k59, KC_NO }, \ + { k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6a }, \ + { k70, k71, k72, k73, k74, k75, k76, k77, k78, k79, k7a }, \ + { k80, k81, k82, k83, k84, k85, KC_NO, k87, k88, k89, k8a }, \ + { k90, k91, k92, k93, k94, k95, k96, k97, k98, k99, k9a }, \ + { ka0, ka1, ka2, ka3, ka4, ka5, ka6, ka7, ka8, ka9, kaa }, \ + { kb0, kb1, kb2, kb3, kb4, kb5, kb6, kb7, kb8, kb9, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, e00, e01, KC_NO, KC_NO, KC_NO, KC_NO, e02, e03 } \ +} + +#define LAYOUT_4u_ansi( \ + e00, e01, e02, e03, \ + k00, k01, k02, k03, k04, k06, k07, k08, k09, k0a, k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6a, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k70, k71, k72, k73, k74, k75, k76, k77, k78, k79, k7a, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k80, k81, k82, k83, k84, k85, k86, k87, k88, k89, k8a, \ + k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k90, k91, k92, k93, k94, k95, k97, k98, k99, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, ka0, ka1, ka2, ka3, ka4, ka5, k96, ka7, ka8, ka9, kaa, \ + k51, k52, k53, k54, k55, k56, k57, k58, kb0, kb2, kb3, kb4, kb5, ka6, kb6, kb7, kb8, kb9 \ +) { \ + { k00, k01, k02, k03, k04, KC_NO, k06, k07, k08, k09, k0a }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a }, \ + { KC_NO, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a }, \ + { KC_NO, k51, k52, k53, k54, k55, k56, k57, k58, KC_NO, KC_NO }, \ + { k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6a }, \ + { k70, k71, k72, k73, k74, k75, k76, k77, k78, k79, k7a }, \ + { k80, k81, k82, k83, k84, k85, k86, k87, k88, k89, k8a }, \ + { k90, k91, k92, k93, k94, k95, k96, k97, k98, k99, KC_NO }, \ + { ka0, ka1, ka2, ka3, ka4, ka5, ka6, ka7, ka8, ka9, kaa }, \ + { kb0, KC_NO, kb2, kb3, kb4, kb5, kb6, kb7, kb8, kb9, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, e00, e01, KC_NO, KC_NO, KC_NO, KC_NO, e02, e03 } \ +} + +#define LAYOUT_4u_iso( \ + e00, e01, e02, e03, \ + k00, k01, k02, k03, k04, k06, k07, k08, k09, k0a, k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6a, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k70, k71, k72, k73, k74, k75, k76, k77, k78, k79, k7a, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k80, k81, k82, k83, k84, k85, k87, k88, k89, k8a, \ + k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k90, k91, k92, k93, k94, k9a, k95, k97, k98, k99, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, ka0, ka1, ka2, ka3, ka4, ka5, k96, ka7, ka8, ka9, kaa, \ + k51, k52, k53, k54, k55, k56, k57, k58, kb0, kb2, kb3, kb4, kb5, ka6, kb6, kb7, kb8, kb9 \ +) { \ + { k00, k01, k02, k03, k04, KC_NO, k06, k07, k08, k09, k0a }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a }, \ + { KC_NO, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a }, \ + { KC_NO, k51, k52, k53, k54, k55, k56, k57, k58, KC_NO, KC_NO }, \ + { k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6a }, \ + { k70, k71, k72, k73, k74, k75, k76, k77, k78, k79, k7a }, \ + { k80, k81, k82, k83, k84, k85, KC_NO, k87, k88, k89, k8a }, \ + { k90, k91, k92, k93, k94, k95, k96, k97, k98, k99, k9a }, \ + { ka0, ka1, ka2, ka3, ka4, ka5, ka6, ka7, ka8, ka9, kaa }, \ + { kb0, KC_NO, kb2, kb3, kb4, kb5, kb6, kb7, kb8, kb9, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, e00, e01, KC_NO, KC_NO, KC_NO, KC_NO, e02, e03 } \ +} + +#define LAYOUT_7u_ansi( \ + e00, e01, e02, e03, \ + k00, k01, k02, k03, k04, k06, k07, k08, k09, k0a, k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6a, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k70, k71, k72, k73, k74, k75, k76, k77, k78, k79, k7a, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k80, k81, k82, k83, k84, k85, k86, k87, k88, k89, k8a, \ + k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k90, k91, k92, k93, k94, k95, k97, k98, k99, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, ka0, ka1, ka2, ka3, ka4, ka5, k96, ka7, ka8, ka9, kaa, \ + k51, k52, k53, k54, k55, k56, k57, kb0, kb4, kb5, ka6, kb6, kb7, kb8, kb9 \ +) { \ + { k00, k01, k02, k03, k04, KC_NO, k06, k07, k08, k09, k0a }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a }, \ + { KC_NO, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a }, \ + { KC_NO, k51, k52, k53, k54, k55, k56, k57, KC_NO, KC_NO, KC_NO }, \ + { k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6a }, \ + { k70, k71, k72, k73, k74, k75, k76, k77, k78, k79, k7a }, \ + { k80, k81, k82, k83, k84, k85, k86, k87, k88, k89, k8a }, \ + { k90, k91, k92, k93, k94, k95, k96, k97, k98, k99, KC_NO }, \ + { ka0, ka1, ka2, ka3, ka4, ka5, ka6, ka7, ka8, ka9, kaa }, \ + { kb0, KC_NO, KC_NO, KC_NO, kb4, kb5, kb6, kb7, kb8, kb9, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, e00, e01, KC_NO, KC_NO, KC_NO, KC_NO, e02, e03 } \ +} + +#define LAYOUT_7u_iso( \ + e00, e01, e02, e03, \ + k00, k01, k02, k03, k04, k06, k07, k08, k09, k0a, k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6a, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k70, k71, k72, k73, k74, k75, k76, k77, k78, k79, k7a, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k80, k81, k82, k83, k84, k85, k87, k88, k89, k8a, \ + k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k90, k91, k92, k93, k94, k9a, k95, k97, k98, k99, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, ka0, ka1, ka2, ka3, ka4, ka5, k96, ka7, ka8, ka9, kaa, \ + k51, k52, k53, k54, k55, k56, k57, kb0, kb4, kb5, ka6, kb6, kb7, kb8, kb9 \ +) { \ + { k00, k01, k02, k03, k04, KC_NO, k06, k07, k08, k09, k0a }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a }, \ + { KC_NO, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a }, \ + { KC_NO, k51, k52, k53, k54, k55, k56, k57, KC_NO, KC_NO, KC_NO }, \ + { k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6a }, \ + { k70, k71, k72, k73, k74, k75, k76, k77, k78, k79, k7a }, \ + { k80, k81, k82, k83, k84, k85, KC_NO, k87, k88, k89, k8a }, \ + { k90, k91, k92, k93, k94, k95, k96, k97, k98, k99, k9a }, \ + { ka0, ka1, ka2, ka3, ka4, ka5, ka6, ka7, ka8, ka9, kaa }, \ + { kb0, KC_NO, KC_NO, KC_NO, kb4, kb5, kb6, kb7, kb8, kb9, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, e00, e01, KC_NO, KC_NO, KC_NO, KC_NO, e02, e03 } \ +} + +#define LAYOUT LAYOUT_all + +// Encoder update function that returns true/false +__attribute__ ((weak)) +bool encoder_update_keymap(int8_t index, bool clockwise); + +// Encoder button combo check +void check_encoder_buttons(void); diff --git a/keyboards/clueboard/2x1800/2019/config.h b/keyboards/clueboard/2x1800/2019/config.h new file mode 100644 index 0000000000..b9e087f62a --- /dev/null +++ b/keyboards/clueboard/2x1800/2019/config.h @@ -0,0 +1,214 @@ +/* +Copyright 2017 Zach White <skullydazed@clueboard.co> + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xC1ED +#define PRODUCT_ID 0x23A0 +#define DEVICE_VER 0x0002 +#define MANUFACTURER Clueboard +#define PRODUCT 2x1800 2019 +#define DESCRIPTION Mechanical Drawing Toy Edition + +/* key matrix size */ +#define MATRIX_ROWS 13 +#define MATRIX_COLS 11 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { C0, C1, C2, C3, C7, F7, B1, F2, F3, F4, F5, F6, C6 } +#define MATRIX_COL_PINS { D2, D3, D4, D5, D7, E0, E1, B0, E6, B3, B2 } +#define UNUSED_PINS { D0, D1, D6, C5, E7, F0, F1 } + +#define ENCODERS_PAD_A { A5, A4, A2, A1 } +#define ENCODERS_PAD_B { A6, A7, A3, A0 } +#define ENCODER_RESOLUTION 4 + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION ROW2COL + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* audio support */ +#define B7_AUDIO +#define C4_AUDIO +#define AUDIO_CLICKY + +/* number of backlight levels */ +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#define RGB_DI_PIN C5 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 16 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT |