diff options
Diffstat (limited to 'keyboards')
857 files changed, 39131 insertions, 6205 deletions
diff --git a/keyboards/1upkeyboards/1up60hse/keymaps/default/keymap.c b/keyboards/1upkeyboards/1up60hse/keymaps/default/keymap.c index 48350a53e0..39473f6067 100644 --- a/keyboards/1upkeyboards/1up60hse/keymaps/default/keymap.c +++ b/keyboards/1upkeyboards/1up60hse/keymaps/default/keymap.c @@ -22,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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_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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_LCTL + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL ), [1] = LAYOUT_60_ansi( diff --git a/keyboards/1upkeyboards/1up60hte/1up60hte.h b/keyboards/1upkeyboards/1up60hte/1up60hte.h index eb4082f1ae..b6d3c8e0d1 100644 --- a/keyboards/1upkeyboards/1up60hte/1up60hte.h +++ b/keyboards/1upkeyboards/1up60hte/1up60hte.h @@ -19,12 +19,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "quantum.h" -#define LAYOUT_all( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, \ +#define LAYOUT_tsangan( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K413, \ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, \ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, \ - K400, K401, K402, K406, K410, K411, K412, K413 \ + K400, K401, K402, K406, K410, K411, K412 \ ) { \ { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013 }, \ { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113 }, \ @@ -35,11 +35,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. /* HHKB Variant */ #define LAYOUT_60_hhkb( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K413, \ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, \ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, \ - K401, K402, K406, K410, K411, K413 \ + K401, K402, K406, K410, K411 \ ) { \ { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013 }, \ { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113 }, \ @@ -47,4 +47,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, KC_NO }, \ { KC_NO, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, KC_NO, K413 } \ } - diff --git a/keyboards/1upkeyboards/1up60hte/config.h b/keyboards/1upkeyboards/1up60hte/config.h index c7e023a5ed..892a8b9fe8 100644 --- a/keyboards/1upkeyboards/1up60hte/config.h +++ b/keyboards/1upkeyboards/1up60hte/config.h @@ -62,4 +62,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 -#endif +#endif
\ No newline at end of file diff --git a/keyboards/1upkeyboards/1up60hte/info.json b/keyboards/1upkeyboards/1up60hte/info.json new file mode 100644 index 0000000000..86521d36bd --- /dev/null +++ b/keyboards/1upkeyboards/1up60hte/info.json @@ -0,0 +1,15 @@ +{ + "keyboard_name": "1up60hte", + "url": "https://www.1upkeyboards.com/shop/controllers/1up-rgb-60-pcb-hte/", + "maintainer": "1upkeyboards", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_tsangan": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Alt", "x":1.5, "y":4}, {"label":"Meta", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Meta", "x":11, "y":4, "w":1.5}, {"label":"Alt", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}] + }, + "LAYOUT_60_hhkb": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Alt", "x":1.5, "y":4}, {"label":"Meta", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Meta", "x":11, "y":4, "w":1.5}, {"label":"Alt", "x":12.5, "y":4}] + } + } +} diff --git a/keyboards/1upkeyboards/1up60hte/keymaps/default/keymap.c b/keyboards/1upkeyboards/1up60hte/keymaps/default/keymap.c index 8c3916629f..359ac75406 100644 --- a/keyboards/1upkeyboards/1up60hte/keymaps/default/keymap.c +++ b/keyboards/1upkeyboards/1up60hte/keymaps/default/keymap.c @@ -17,21 +17,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [0] = LAYOUT_all( - KC_ESC, 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_GRV, - 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_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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_NO, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, KC_LGUI, KC_LCTL, KC_BSPC), - - [1] = LAYOUT_all( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) - + [0] = LAYOUT_tsangan( + KC_ESC, 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_BSLS, KC_GRV, + 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_BSPC, + KC_LCTL, 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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL), + + [1] = LAYOUT_tsangan( + RESET, 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_INS, KC_DEL, + KC_CAPS, BL_TOGG, BL_DEC, BL_INC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_CLR, + KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_MPLY, KC_MPRV, KC_MNXT, RGB_VAD, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, + KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) }; void matrix_init_user(void) { diff --git a/keyboards/1upkeyboards/1up60hte/keymaps/hhkb/keymap.c b/keyboards/1upkeyboards/1up60hte/keymaps/hhkb/keymap.c index 1b06739b68..5312e3b675 100644 --- a/keyboards/1upkeyboards/1up60hte/keymaps/hhkb/keymap.c +++ b/keyboards/1upkeyboards/1up60hte/keymaps/hhkb/keymap.c @@ -17,20 +17,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [0] = LAYOUT_all( - KC_ESC, 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_GRV, - 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_LCTL, 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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, MO(1), - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, KC_LGUI, KC_LCTL, KC_BSPC), - - [1] = LAYOUT_all( - RESET, 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_INS, - KC_CAPS, BL_TOGG, BL_DEC, BL_INC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_TRNS, - KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_MPLY, KC_MPRV, KC_MNXT, RGB_VAD, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, - KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL) + [0] = LAYOUT_tsangan( + KC_ESC, 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_BSLS, KC_GRV, + 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_BSPC, + KC_LCTL, 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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), + KC_NO, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_NO), + + [1] = LAYOUT_tsangan( + RESET, 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_INS, KC_DEL, + KC_CAPS, BL_TOGG, BL_DEC, BL_INC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_CLR, + KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_MPLY, KC_MPRV, KC_MNXT, RGB_VAD, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, + KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) }; void matrix_init_user(void) { @@ -45,35 +44,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } void led_set_user(uint8_t usb_led) { - - if (usb_led & (1 << USB_LED_NUM_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { writePinLow(B6); } else { writePinHigh(B6); } - - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_COMPOSE)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_KANA)) { - - } else { - - } - } diff --git a/keyboards/1upkeyboards/1up60rgb/keymaps/default/keymap.c b/keyboards/1upkeyboards/1up60rgb/keymaps/default/keymap.c index cb372e15d7..8567b780a7 100644 --- a/keyboards/1upkeyboards/1up60rgb/keymaps/default/keymap.c +++ b/keyboards/1upkeyboards/1up60rgb/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -#include "1up60rgb.h" +#include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboards/1upkeyboards/1up60rgb/keymaps/mdyevimnav/keymap.c b/keyboards/1upkeyboards/1up60rgb/keymaps/mdyevimnav/keymap.c new file mode 100644 index 0000000000..bb0d10405c --- /dev/null +++ b/keyboards/1upkeyboards/1up60rgb/keymaps/mdyevimnav/keymap.c @@ -0,0 +1,48 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* + * Layer 0 + * ,-----------------------------------------------------------------------------------------. + * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bksp | + * |-----------------------------------------------------------------------------------------+ + * | Tab | q | w | e | r | t | y | u | i | o | p | [ | ] | \ | + * |-----------------------------------------------------------------------------------------+ + * | Esc | a | s | d | f | g | h | j | k | l | ; | ' | Enter | + * |-----------------------------------------------------------------------------------------+ + * | Shift | z | x | c | v | b | n | m | , | . | / | Shift | + * |-----------------------------------------------------------------------------------------+ + * | Ctrl | L1 | Alt | space | Alt | Sup | L1 | Ctrl | + * \-----------------------------------------------------------------------------------------/ + * + */ + LAYOUT_all( + 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_BSPC, + 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_ESC, 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_ENT, + KC_LSHIFT, KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSHIFT, KC_RSHIFT, + KC_LCTL, MO(1), KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL), + +/* + * Layer 1 + * ,-----------------------------------------------------------------------------------------. + * | | f1 | f2 | f3 | f4 | f5 | f6 | f7 | f8 | f9 | f10 | f11 | f12 | Del | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | Ins | | Paus| | | Prnt | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | L | D | U | R | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | Hom | PDn | PUp | End | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | + * \-----------------------------------------------------------------------------------------/ + * + */ + LAYOUT_all( + KC_TRNS, 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_TRNS, KC_DEL, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_TRNS, KC_PAUS, KC_TRNS, KC_TRNS, KC_PSCR, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; diff --git a/keyboards/1upkeyboards/sweet16/keymaps/default/keymap.c b/keyboards/1upkeyboards/sweet16/keymaps/default/keymap.c index 899afaba17..4cc754dc16 100644 --- a/keyboards/1upkeyboards/sweet16/keymaps/default/keymap.c +++ b/keyboards/1upkeyboards/sweet16/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -#include "sweet16.h" +#include QMK_KEYBOARD_H enum custom_keycodes { UP_URL = SAFE_RANGE diff --git a/keyboards/40percentclub/half_n_half/config.h b/keyboards/40percentclub/half_n_half/config.h index 9aa8e810dd..c74fcacbb9 100644 --- a/keyboards/40percentclub/half_n_half/config.h +++ b/keyboards/40percentclub/half_n_half/config.h @@ -46,12 +46,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define UNUSED_PINS /* COL2ROW, ROW2COL*/ -#define DIODE_DIRECTION ROW2COL +#define DIODE_DIRECTION COL2ROW /* * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. */ #define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 +#define USE_SERIAL // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING diff --git a/keyboards/40percentclub/half_n_half/half_n_half.h b/keyboards/40percentclub/half_n_half/half_n_half.h index e20d42fde1..bc330c9cb7 100644 --- a/keyboards/40percentclub/half_n_half/half_n_half.h +++ b/keyboards/40percentclub/half_n_half/half_n_half.h @@ -42,3 +42,7 @@ { R26, R25, R24, R23, R22, R21, R20 }, \ { ___, ___, ___, ___, R32, ___, ___ } \ } + +#ifdef USE_I2C + #error "I2C not Supported" +#endif diff --git a/keyboards/40percentclub/half_n_half/keymaps/Boy_314/config.h b/keyboards/40percentclub/half_n_half/keymaps/Boy_314/config.h new file mode 100644 index 0000000000..f73fd055cc --- /dev/null +++ b/keyboards/40percentclub/half_n_half/keymaps/Boy_314/config.h @@ -0,0 +1,22 @@ +/* Copyright 2019 Boy_314 + * + * 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 + +// place overrides here +#define IGNORE_MOD_TAP_INTERRUPT +#define PERMISSIVE_HOLD +#define TAPPING_TERM 200 diff --git a/keyboards/40percentclub/half_n_half/keymaps/Boy_314/keymap.c b/keyboards/40percentclub/half_n_half/keymaps/Boy_314/keymap.c new file mode 100644 index 0000000000..2eef3dc48b --- /dev/null +++ b/keyboards/40percentclub/half_n_half/keymaps/Boy_314/keymap.c @@ -0,0 +1,173 @@ +/* Copyright 2019 Boy_314 + * + * 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 QMK_KEYBOARD_H + +// Tap Dance Declarations +enum { + TD_SWAP_LAYERS = 0 +}; + +enum layers { + _DVORAK, + _QWERTY, + _LOWER, + _RAISE, +}; + +enum halfnhalf_keycodes { + NEWTAB = SAFE_RANGE, + ALTF4, + CLSTAB, + PRVWIN, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* DVORAK + * ,-------------------------------------------------------------------------------------------------. + * |Tab |' |, |. |P |Y |Brght+|= |F |G |C |R |L |Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |CtlCps|A |O |E |U |I |Brght-|Ctrl+F|D |H |T |N |S |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |LShift|; |Q |J |K |X |LAlt |- |B |M |W |V |Z |RShift| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |TD Swap Layer| |Space | + * `-------------' `-------------' + */ + [_DVORAK] = LAYOUT(/* Base Dvorak */ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_BRIU, KC_EQL, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + LCTL_T(KC_CAPS), KC_A, KC_O, KC_E, KC_U, KC_I, KC_BRID, LCTL(KC_F), KC_D, KC_H, KC_T, KC_N, KC_S, KC_ENT, + KC_LSPO, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_LALT, KC_MINS, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSPC, + TD(TD_SWAP_LAYERS), KC_SPC + ), + + /* QWERTY + * ,-------------------------------------------------------------------------------------------------. + * |Tab |Q |W |E |R |T |Brght+|' |Y |U |I |O |P |Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |CtlCps|A |S |D |F |G |Brght-|Ctrl+F|H |J |K |L |; |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |LShift|Z |X |C |V |B |LAlt |- |N |M |, |. |/ |RShift| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |TD Swap Layer| |Space | + * `-------------' `-------------' + */ + [_QWERTY] = LAYOUT(/* Base Qwerty */ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_BRIU, KC_QUOT, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + LCTL_T(KC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G, KC_BRID, LCTL(KC_F), KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LALT, KC_MINS, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, + TD(TD_SWAP_LAYERS), KC_SPC + ), + + /* LOWER + * ,-------------------------------------------------------------------------------------------------. + * |Esc |1 |2 |3 |4 |5 | | |6 |7 |8 |9 |0 |/ | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |Caps |F1 |F2 |F3 |F4 |F5 |F6 |Vol Up|Play |_ |+ |{ |} || | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | |F7 |F8 |F9 |F10 |F11 |F12 |Vol Dn|Next |Home |PgDn |PgUp |End | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | + * `-------------' `-------------' + */ + [_LOWER] = LAYOUT(/* Numbers, Function Row, Media Control, Shifted Symbols, Dvorak Slash Key */ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_SLSH, + KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_VOLU, KC_MPLY, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_VOLD, KC_MNXT, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_TRNS, + KC_TRNS, KC_TRNS + ), + + /* RAISE + * ,-------------------------------------------------------------------------------------------------. + * |Reset | | |Up | | | |PRVWIN|CLSTAB| | | | |Del | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |` | |Left |Down |Right | | |NEWTAB|ALTF4 |- |= |[ |] |\ | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | |! |@ |# |$ |% | | |^ |& |* |( |) | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | + * `-------------' `-------------' + */ + [_RAISE] = LAYOUT(/* Arrows, Shifted Numbers, Symbols, Delete, Macros */ + RESET, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, PRVWIN, CLSTAB, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, + KC_GRV, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, NEWTAB, ALTF4, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + KC_TRNS, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_TRNS, KC_TRNS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_TRNS, + KC_TRNS, KC_TRNS + ) +}; + +void tap_dance_choose_layer (qk_tap_dance_state_t *state, void *user_data) { + switch (state->count) { + case 1: + layer_on(_LOWER); + break; + case 2: + layer_on(_RAISE); + break; + } +} + +void tap_dance_choose_layer_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (state->count) { + case 1: + layer_off(_LOWER); + break; + case 2: + layer_off(_RAISE); + break; + case 3: + if (biton32(default_layer_state) == _DVORAK) { + set_single_persistent_default_layer(_QWERTY); + } + else if (biton32(default_layer_state) == _QWERTY) { + set_single_persistent_default_layer(_DVORAK); + } + break; + } +} + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_SWAP_LAYERS] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tap_dance_choose_layer, tap_dance_choose_layer_reset) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + // Control + T + case NEWTAB: + if (record->event.pressed) { + SEND_STRING(SS_LCTRL("t")); + } + break; + // Alt + F4 + case ALTF4: + if (record->event.pressed) { + SEND_STRING(SS_DOWN(X_LALT)SS_TAP(X_F4)SS_UP(X_LALT)); + } + break; + // Control + W + case CLSTAB: + if (record->event.pressed) { + SEND_STRING(SS_LCTRL("w")); + } + break; + // Control + Shift + N + case PRVWIN: + if (record->event.pressed) { + SEND_STRING(SS_LCTRL(SS_LSFT("n"))); + } + break; + } + return true; +} diff --git a/keyboards/40percentclub/half_n_half/keymaps/Boy_314/readme.md b/keyboards/40percentclub/half_n_half/keymaps/Boy_314/readme.md new file mode 100644 index 0000000000..9eff08b5ea --- /dev/null +++ b/keyboards/40percentclub/half_n_half/keymaps/Boy_314/readme.md @@ -0,0 +1,2 @@ +# Boy_314's keymap for half_n_half +# Currently only supports DVORAK. QWERTY Support is on the TODO list.
\ No newline at end of file diff --git a/keyboards/40percentclub/half_n_half/keymaps/Boy_314/rules.mk b/keyboards/40percentclub/half_n_half/keymaps/Boy_314/rules.mk new file mode 100644 index 0000000000..59c7ccf827 --- /dev/null +++ b/keyboards/40percentclub/half_n_half/keymaps/Boy_314/rules.mk @@ -0,0 +1,5 @@ +TAP_DANCE_ENABLE = yes # Enable Tap Dance +NKRO_ENABLE = yes # USB Nkey Rollover + +# Enable generic behavior for split boards +SPLIT_KEYBOARD = yes
\ No newline at end of file diff --git a/keyboards/40percentclub/half_n_half/rules.mk b/keyboards/40percentclub/half_n_half/rules.mk index bd0d8f808c..cc5fccee98 100644 --- a/keyboards/40percentclub/half_n_half/rules.mk +++ b/keyboards/40percentclub/half_n_half/rules.mk @@ -79,3 +79,6 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID AUDIO_ENABLE = no # Audio output on port C6 FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +# Enable generic behavior for split boards +SPLIT_KEYBOARD = yes diff --git a/keyboards/40percentclub/mf68/keymaps/default/keymap.c b/keyboards/40percentclub/mf68/keymaps/default/keymap.c index ae7e7297cb..c91b9b908a 100644 --- a/keyboards/40percentclub/mf68/keymaps/default/keymap.c +++ b/keyboards/40percentclub/mf68/keymaps/default/keymap.c @@ -3,51 +3,29 @@ #define _QWERTY 0 #define _FN1 1 #define _FN2 2 -#define KC_ KC_TRNS -#define KC_X0 LT(_FN2, KC_GRV) -#define KC_X1 MO(_FN1) -#define KC_X2 BL_STEP + +#define FN2_GRV LT(_FN2, KC_GRV) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT_kc( - /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ - ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS,EQL , BSPC , INS ,PGUP, - /*|----`----`----`----`----`----`----`----`----`----`----`----`----`--------| |----`----| */ - TAB , Q , W , E , R , T , Y , U , I , O , P ,LBRC,RBRC, BSLS , DEL ,PGDN, - /*|------`----`----`----`----`----`----`----`----`----`----`----`----`------| `----`----' */ - X0 , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, ENTER , - /*|-------`----`----`----`----`----`----`----`----`----`----`----`----------| ,----. */ - LSFT , Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, RSFT , UP , - /*|---------`----`----`----`----`----`----`----`----`----`----`-------------.--|----|----. */ - LCTL ,LGUI ,LALT , SPACE , X1 ,RALT ,RCTL , LEFT,DOWN,RGHT - /*`-----+-----+-----+------------------------------+------+-----+-----' `----+----+----' */ + [_QWERTY] = LAYOUT_68_ansi( + KC_ESC, 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, KC_PGUP, + 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, KC_PGDN, + FN2_GRV, 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_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_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ), - - [_FN1] = LAYOUT_kc( - /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ - GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC , VOLU,HOME, - /*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| |ins-`pgup| */ - , , , UP , , , , , , , , , X2 , , VOLD,END, - /*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| `del-`pgdn' */ - , ,LEFT,DOWN,RGHT, , , , , , , , , - /*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| ,----. */ - , , , , , , ,MUTE, , , , , MUTE, - /*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-.--|-up-|----. */ - , , , , , , , MPRV,MPLY,MNXT - /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' `left+down+rght' */ + [_FN1] = LAYOUT_68_ansi( + KC_GRV, 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_BSPC, KC_VOLU, KC_HOME, + _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, BL_STEP, _______, KC_VOLD, KC_END, + _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, _______, _______, _______, KC_MUTE, + _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT ), - - [_FN2] = LAYOUT_kc( - /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ - GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC , VOLU,HOME, - /*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| |ins-`pgup| */ - , , , UP , , , , 7 , 8 , 9 , , , , , VOLD,END, - /*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| `del-`pgdn' */ - , ,LEFT,DOWN,RGHT, , , 4 , 5 , 6 , , , , - /*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| ,----. */ - , , , , , , 0 , 1 , 2 , 3 , , , MUTE, - /*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-.--|-up-|----. */ - , , , , , , , MPRV,MPLY,MNXT - /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' `left+down+rght' */ + [_FN2] = LAYOUT_68_ansi( + KC_GRV, 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_BSPC, KC_VOLU, KC_HOME, + _______, _______, _______, KC_UP, _______, _______, _______, KC_7, KC_8, KC_9, _______, _______, _______, _______, KC_VOLD, KC_END, + _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_4, KC_5, KC_6, _______, _______, _______, + _______, _______, _______, _______, _______, _______, KC_0, KC_1, KC_2, KC_3, _______, _______, KC_MUTE, + _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT ) }; diff --git a/keyboards/40percentclub/ut47/keymaps/default/config.h b/keyboards/40percentclub/ut47/keymaps/default/config.h index f88ebf7e80..023c753c27 100644 --- a/keyboards/40percentclub/ut47/keymaps/default/config.h +++ b/keyboards/40percentclub/ut47/keymaps/default/config.h @@ -16,6 +16,4 @@ #pragma once -#include "config_common.h" - // place overrides here diff --git a/keyboards/ai03/orbit/config.h b/keyboards/ai03/orbit/config.h new file mode 100644 index 0000000000..f4dc4fd636 --- /dev/null +++ b/keyboards/ai03/orbit/config.h @@ -0,0 +1,249 @@ +/* +Copyright 2018 Ryota Goto + +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 0xA103 +#define PRODUCT_ID 0x0003 +#define DEVICE_VER 0x0003 +#define MANUFACTURER ai03 Keyboard Designs +#define PRODUCT Orbit +#define DESCRIPTION Split ergonomic keyboard + +/* key matrix size */ +#define MATRIX_ROWS 10 // Double rows for split keyboards. Orbit has 5, so define 10 +#define MATRIX_COLS 7 + +/* + * 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 { F7, F6, F5, F4, D3 } +#define MATRIX_COL_PINS { C7, B4, D7, D6, D4, F1, F0 } +#define MATRIX_ROW_PINS_RIGHT { B6, B5, B4, D7, E6 } +#define MATRIX_COL_PINS_RIGHT { D4, D6, F1, F0, F4, F5, C6 } + +#define SPLIT_HAND_PIN D5 + +//#define USE_I2C + +#define SELECT_SOFT_SERIAL_SPEED 1 + +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +#define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* 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 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/ai03/orbit/info.json b/keyboards/ai03/orbit/info.json new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/keyboards/ai03/orbit/info.json diff --git a/keyboards/ai03/orbit/keymaps/default/keymap.c b/keyboards/ai03/orbit/keymaps/default/keymap.c new file mode 100644 index 0000000000..4c8c39fb0f --- /dev/null +++ b/keyboards/ai03/orbit/keymaps/default/keymap.c @@ -0,0 +1,91 @@ +/* Copyright 2018 Ryota Goto + * + * 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 QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + MANUAL = SAFE_RANGE, + DBLZERO +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + TO(1), KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_BSPC, \ + TO(1), KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RBRC, KC_BSLS, \ + KC_NO, 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_NO, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_PSCR, KC_DEL, \ + KC_LCTL, KC_LCTL, KC_LGUI, KC_LALT, MO(1), KC_SPC, KC_SPC, MO(2), KC_GRV, KC_MENU, KC_MINS, KC_EQL + ), + [1] = LAYOUT( /* Fn, Arrowkeys, Media control, Backlight */ + TO(2), _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_VOLU, _______, \ + TO(2), _______, _______, KC_PGUP, _______, _______, KC_F11, KC_F12, _______, KC_UP, _______, _______, KC_VOLD, BL_STEP, \ + TO(0), _______, KC_HOME, KC_PGDN, KC_END, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_MPLY, _______, \ + TO(0), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + [2] = LAYOUT( /* Mousekeys and Numpad */ + KC_NO, _______, _______, _______, _______, _______, _______, KC_NLCK, KC_P7, KC_P8, KC_P9, KC_PSLS, _______, _______, \ + KC_NO, _______, KC_BTN1, KC_MS_U, KC_BTN2, KC_WH_U, _______, _______, KC_P4, KC_P5, KC_P6, KC_PAST, _______, _______, \ + TO(1), _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, _______, _______, KC_P1, KC_P2, KC_P3, KC_PMNS, _______, _______, \ + TO(1), _______, KC_ACL0, KC_ACL1, KC_ACL2, KC_BTN3, _______, DBLZERO, KC_P0, KC_PDOT, KC_PENT, KC_PPLS, _______, MANUAL, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case MANUAL: + if (record->event.pressed) + { + // Keypress + SEND_STRING("https://kb.ai03.me/redir/orbit"); + } + else + { + // Key release + } + break; + case DBLZERO: + if (record->event.pressed) + { + // Keypress + SEND_STRING("00"); + } + else + { + // Key release + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} + +uint32_t layer_state_set_user(uint32_t state) { + + return state; +} diff --git a/keyboards/ai03/orbit/keymaps/default/readme.md b/keyboards/ai03/orbit/keymaps/default/readme.md new file mode 100644 index 0000000000..63c528abfa --- /dev/null +++ b/keyboards/ai03/orbit/keymaps/default/readme.md @@ -0,0 +1,3 @@ +# The default keymap for Orbit + +[KLE of layout](http://www.keyboard-layout-editor.com/#/gists/53ebf59524de12515cb7e2e6de94f0d6)
\ No newline at end of file diff --git a/keyboards/ai03/orbit/matrix.c b/keyboards/ai03/orbit/matrix.c new file mode 100644 index 0000000000..a1509666cd --- /dev/null +++ b/keyboards/ai03/orbit/matrix.c @@ -0,0 +1,328 @@ +/* +Copyright 2012 Jun Wako <wakojun@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/>. +*/ + +/* + * scan matrix + */ +#include <stdint.h> +#include <stdbool.h> +#include "wait.h" +#include "util.h" +#include "matrix.h" +#include "split_util.h" +#include "config.h" +#include "split_flags.h" +#include "quantum.h" +#include "debounce.h" +#include "transport.h" + +#if (MATRIX_COLS <= 8) +# define print_matrix_header() print("\nr/c 01234567\n") +# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop(matrix[i]) +# define ROW_SHIFTER ((uint8_t)1) +#elif (MATRIX_COLS <= 16) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop16(matrix[i]) +# define ROW_SHIFTER ((uint16_t)1) +#elif (MATRIX_COLS <= 32) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop32(matrix[i]) +# define ROW_SHIFTER ((uint32_t)1) +#endif + +#define ERROR_DISCONNECT_COUNT 5 + +//#define ROWS_PER_HAND (MATRIX_ROWS / 2) + +#ifdef DIRECT_PINS +static pin_t direct_pins[MATRIX_ROWS][MATRIX_COLS] = DIRECT_PINS; +#else +static pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; +#endif + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t raw_matrix[ROWS_PER_HAND]; + +// row offsets for each hand +uint8_t thisHand, thatHand; + +// user-defined overridable functions + +__attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); } + +__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); } + +__attribute__((weak)) void matrix_init_user(void) {} + +__attribute__((weak)) void matrix_scan_user(void) {} + +__attribute__((weak)) void matrix_slave_scan_user(void) {} + +// helper functions + +inline uint8_t matrix_rows(void) { return MATRIX_ROWS; } + +inline uint8_t matrix_cols(void) { return MATRIX_COLS; } + +bool matrix_is_modified(void) { + if (debounce_active()) return false; + return true; +} + +inline bool matrix_is_on(uint8_t row, uint8_t col) { return (matrix[row] & ((matrix_row_t)1 << col)); } + +inline matrix_row_t matrix_get_row(uint8_t row) { return matrix[row]; } + +void matrix_print(void) { + print_matrix_header(); + + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + phex(row); + print(": "); + print_matrix_row(row); + print("\n"); + } +} + +uint8_t matrix_key_count(void) { + uint8_t count = 0; + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + count += matrix_bitpop(i); + } + return count; +} + +// matrix code + +#ifdef DIRECT_PINS + +static void init_pins(void) { + for (int row = 0; row < MATRIX_ROWS; row++) { + for (int col = 0; col < MATRIX_COLS; col++) { + pin_t pin = direct_pins[row][col]; + if (pin != NO_PIN) { + setPinInputHigh(pin); + } + } + } +} + +static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) { + matrix_row_t last_row_value = current_matrix[current_row]; + current_matrix[current_row] = 0; + + for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { + pin_t pin = direct_pins[current_row][col_index]; + if (pin != NO_PIN) { + current_matrix[current_row] |= readPin(pin) ? 0 : (ROW_SHIFTER << col_index); + } + } + + return (last_row_value != current_matrix[current_row]); +} + +#elif (DIODE_DIRECTION == COL2ROW) + +static void select_row(uint8_t row) { + setPinOutput(row_pins[row]); + writePinLow(row_pins[row]); +} + +static void unselect_row(uint8_t row) { setPinInputHigh(row_pins[row]); } + +static void unselect_rows(void) { + for (uint8_t x = 0; x < ROWS_PER_HAND; x++) { + setPinInputHigh(row_pins[x]); + } +} + +static void init_pins(void) { + unselect_rows(); + for (uint8_t x = 0; x < MATRIX_COLS; x++) { + setPinInputHigh(col_pins[x]); + } +} + +static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) { + // Store last value of row prior to reading + matrix_row_t last_row_value = current_matrix[current_row]; + + // Clear data in matrix row + current_matrix[current_row] = 0; + + // Select row and wait for row selecton to stabilize + select_row(current_row); + wait_us(30); + + // For each col... + for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { + // Populate the matrix row with the state of the col pin + current_matrix[current_row] |= readPin(col_pins[col_index]) ? 0 : (ROW_SHIFTER << col_index); + } + + // Unselect row + unselect_row(current_row); + + return (last_row_value != current_matrix[current_row]); +} + +#elif (DIODE_DIRECTION == ROW2COL) + +static void select_col(uint8_t col) { + setPinOutput(col_pins[col]); + writePinLow(col_pins[col]); +} + +static void unselect_col(uint8_t col) { setPinInputHigh(col_pins[col]); } + +static void unselect_cols(void) { + for (uint8_t x = 0; x < MATRIX_COLS; x++) { + setPinInputHigh(col_pins[x]); + } +} + +static void init_pins(void) { + unselect_cols(); + for (uint8_t x = 0; x < ROWS_PER_HAND; x++) { + setPinInputHigh(row_pins[x]); + } +} + +static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) { + bool matrix_changed = false; + + // Select col and wait for col selecton to stabilize + select_col(current_col); + wait_us(30); + + // For each row... + for (uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) { + // Store last value of row prior to reading + matrix_row_t last_row_value = current_matrix[row_index]; + + // Check row pin state + if (readPin(row_pins[row_index])) { + // Pin HI, clear col bit + current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); + } else { + // Pin LO, set col bit + current_matrix[row_index] |= (ROW_SHIFTER << current_col); + } + + // Determine if the matrix changed state + if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) { + matrix_changed = true; + } + } + + // Unselect col + unselect_col(current_col); + + return matrix_changed; +} + +#endif + +void matrix_init(void) { + debug_enable = true; + debug_matrix = true; + debug_mouse = true; + + // Set pinout for right half if pinout for that half is defined + if (!isLeftHand) { +#ifdef MATRIX_ROW_PINS_RIGHT + const uint8_t row_pins_right[MATRIX_ROWS] = MATRIX_ROW_PINS_RIGHT; + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + row_pins[i] = row_pins_right[i]; + } +#endif +#ifdef MATRIX_COL_PINS_RIGHT + const uint8_t col_pins_right[MATRIX_COLS] = MATRIX_COL_PINS_RIGHT; + for (uint8_t i = 0; i < MATRIX_COLS; i++) { + col_pins[i] = col_pins_right[i]; + } +#endif + } + + thisHand = isLeftHand ? 0 : (ROWS_PER_HAND); + thatHand = ROWS_PER_HAND - thisHand; + + // initialize key pins + init_pins(); + + // initialize matrix state: all keys off + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + } + + debounce_init(ROWS_PER_HAND); + + matrix_init_quantum(); +} + +uint8_t _matrix_scan(void) { + bool changed = false; + +#if defined(DIRECT_PINS) || (DIODE_DIRECTION == COL2ROW) + // Set row, read cols + for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) { + changed |= read_cols_on_row(raw_matrix, current_row); + } +#elif (DIODE_DIRECTION == ROW2COL) + // Set col, read rows + for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { + changed |= read_rows_on_col(raw_matrix, current_col); + } +#endif + + debounce(raw_matrix, matrix + thisHand, ROWS_PER_HAND, changed); + + return 1; +} + +uint8_t matrix_scan(void) { + uint8_t ret = _matrix_scan(); + + if (is_keyboard_master()) { + static uint8_t error_count; + + if (!transport_master(matrix + thatHand)) { + error_count++; + + if (error_count > ERROR_DISCONNECT_COUNT) { + // reset other half if disconnected + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[thatHand + i] = 0; + } + } + } else { + error_count = 0; + } + + matrix_scan_quantum(); + } else { + transport_slave(matrix + thisHand); + matrix_slave_scan_user(); + } + + return ret; +} diff --git a/keyboards/ai03/orbit/matrix.h b/keyboards/ai03/orbit/matrix.h new file mode 100644 index 0000000000..c2bdd3098c --- /dev/null +++ b/keyboards/ai03/orbit/matrix.h @@ -0,0 +1,3 @@ +#pragma once + +#include <common/matrix.h> diff --git a/keyboards/ai03/orbit/orbit.c b/keyboards/ai03/orbit/orbit.c new file mode 100644 index 0000000000..2f149875b1 --- /dev/null +++ b/keyboards/ai03/orbit/orbit.c @@ -0,0 +1,228 @@ +/* Copyright 2018 Ryota Goto + * + * 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 "orbit.h" +#include "split_util.h" +#include "transport.h" + + +// Call led_toggle to set LEDs easily +// LED IDs: +// +// (LEFT) 0 1 2 | 3 4 5 (RIGHT) + +void led_toggle(int id, bool on) { + + if (isLeftHand) { + switch(id) { + case 0: + // Left hand C6 + if (on) + //PORTC |= (1<<6); + writePinHigh(C6); + else + //PORTC &= ~(1<<6); + writePinLow(C6); + break; + case 1: + // Left hand B6 + if (on) + //PORTB |= (1<<6); + writePinHigh(B6); + else + //PORTB &= ~(1<<6); + writePinLow(B6); + break; + case 2: + // Left hand B5 + if (on) + //PORTB |= (1<<5); + writePinHigh(B5); + else + //PORTB &= ~(1<<5); + writePinLow(B5); + break; + default: + break; + } + } else { + switch(id) { + case 3: + // Right hand F6 + if (on) + //PORTF |= (1<<6); + writePinHigh(F6); + else + //PORTF &= ~(1<<6); + writePinLow(F6); + break; + case 4: + // Right hand F7 + if (on) + //PORTF |= (1<<7); + writePinHigh(F7); + else + //PORTF &= ~(1<<7); + writePinLow(F7); + break; + case 5: + // Right hand C7 + if (on) + //PORTC |= (1<<7); + writePinHigh(C7); + else + //PORTC &= ~(1<<7); + writePinLow(C7); + break; + default: + break; + } + } +} + +// Set all LEDs at once using an array of 6 booleans +// LED IDs: +// +// (LEFT) 0 1 2 | 3 4 5 (RIGHT) +// +// Ex. set_all_leds({ false, false, false, true, true, true }) would turn off left hand, turn on right hand + +void set_all_leds(bool leds[6]) { + for (int i = 0; i < 6; i++) { + led_toggle(i, leds[i]); + } +} + +void set_layer_indicators(uint8_t layer) { + + switch (layer) + { + case 0: + led_toggle(0, true); + led_toggle(1, false); + led_toggle(2, false); + break; + case 1: + led_toggle(0, true); + led_toggle(1, true); + led_toggle(2, false); + break; + case 2: + led_toggle(0, true); + led_toggle(1, true); + led_toggle(2, true); + break; + case 3: + led_toggle(0, false); + led_toggle(1, true); + led_toggle(2, true); + break; + case 4: + led_toggle(0, false); + led_toggle(1, false); + led_toggle(2, true); + break; + default: + led_toggle(0, true); + led_toggle(1, false); + led_toggle(2, true); + break; + } + +} + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + // Initialize indicator LEDs to output + if (isLeftHand) + { + setPinOutput(C6); + setPinOutput(B6); + setPinOutput(B5); + //DDRC |= (1<<6); + //DDRB |= (1<<6); + //DDRB |= (1<<5); + } + else + { + setPinOutput(F6); + setPinOutput(F7); + setPinOutput(C7); + //DDRF |= (1<<6); + //DDRF |= (1<<7); + //DDRC |= (1<<7); + } + + set_layer_indicators(0); + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + if (is_keyboard_master()) { + + serial_m2s_buffer.nlock_led = IS_LED_ON(usb_led, USB_LED_NUM_LOCK); + serial_m2s_buffer.clock_led = IS_LED_ON(usb_led, USB_LED_CAPS_LOCK); + serial_m2s_buffer.slock_led = IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK); + + led_toggle(3, IS_LED_ON(usb_led, USB_LED_NUM_LOCK)); + led_toggle(4, IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)); + led_toggle(5, IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)); + + } + + led_set_user(usb_led); +} + +uint32_t layer_state_set_kb(uint32_t state) { + + if (is_keyboard_master()) + { + + current_layer = biton32(state); + serial_m2s_buffer.current_layer = biton32(state); + + // If left half, do the LED toggle thing + if (isLeftHand) + { + set_layer_indicators(biton32(state)); + } + + } + // NOTE: Do not set slave LEDs here. + // This is not called on slave + + return layer_state_set_user(state); +} + + diff --git a/keyboards/ai03/orbit/orbit.h b/keyboards/ai03/orbit/orbit.h new file mode 100644 index 0000000000..211b9ebca9 --- /dev/null +++ b/keyboards/ai03/orbit/orbit.h @@ -0,0 +1,65 @@ +/* Copyright 2018 Ryota Goto + * + * 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/>. + */ +#ifndef ORBIT_H +#define ORBIT_H + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ + +#ifdef USE_I2C +#include <stddef.h> +#ifdef __AVR__ + #include <avr/io.h> + #include <avr/interrupt.h> +#endif +#endif + + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ + L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ + L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45 \ +) \ +{ \ + { L00, L01, L02, L03, L04, L05, L06 }, \ + { L10, L11, L12, L13, L14, L15, L16 }, \ + { L20, L21, L22, L23, L24, L25, L26 }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { KC_NO, L41, L42, L43, L44, L45, L46 }, \ + { R00, R01, R02, R03, R04, R05, R06 }, \ + { R10, R11, R12, R13, R14, R15, R16 }, \ + { R20, R21, R22, R23, R24, R25, R26 }, \ + { R30, R31, R32, R33, R34, R35, R36 }, \ + { R40, R41, R42, R43, R44, R45, KC_NO } \ +} + +uint8_t current_layer; + +extern void led_toggle(int id, bool on); +void set_all_leds(bool leds[6]); +extern void set_layer_indicators(uint8_t layer); + +#endif diff --git a/keyboards/ai03/orbit/readme.md b/keyboards/ai03/orbit/readme.md new file mode 100644 index 0000000000..58ba2079d5 --- /dev/null +++ b/keyboards/ai03/orbit/readme.md @@ -0,0 +1,15 @@ +# Orbit + +![Orbit](https://raw.githubusercontent.com/ai03-2725/Orbit/master/Images/PCB-R2.0.jpg) + +A split ergonomic keyboard project. + +Keyboard Maintainer: [ai03](https://github.com/ai03-2725) +Hardware Supported: The [Orbit PCB](https://github.com/ai03-2725/Orbit) +Hardware Availability: [This repository](https://github.com/ai03-2725/Orbit) has PCB files. Case group buy orders are currently closed. + +Make example for this keyboard (after setting up your build environment): + + make ai03/orbit:default + +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/ai03/orbit/rules.mk b/keyboards/ai03/orbit/rules.mk new file mode 100644 index 0000000000..4b40e47cb7 --- /dev/null +++ b/keyboards/ai03/orbit/rules.mk @@ -0,0 +1,92 @@ +SRC += split_util.c \ + split_flags.c \ + serial.c \ + transport.c \ + matrix.c + +# MCU name +#MCU = at90usb1286 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +USE_I2C = no # I2C for split communication +CUSTOM_MATRIX = yes # For providing custom matrix.c (in this case, override regular matrix.c with split matrix.c) +# SPLIT_KEYBOARD = yes # Split keyboard flag disabled as manual edits had to be done to the split common files + + diff --git a/keyboards/ai03/orbit/serial.c b/keyboards/ai03/orbit/serial.c new file mode 100644 index 0000000000..1315377a34 --- /dev/null +++ b/keyboards/ai03/orbit/serial.c @@ -0,0 +1,546 @@ +/* + * WARNING: be careful changing this code, it is very timing dependent + * + * 2018-10-28 checked + * avr-gcc 4.9.2 + * avr-gcc 5.4.0 + * avr-gcc 7.3.0 + */ + +#ifndef F_CPU +#define F_CPU 16000000 +#endif + +#include <avr/io.h> +#include <avr/interrupt.h> +#include <util/delay.h> +#include <stddef.h> +#include <stdbool.h> +#include "serial.h" +//#include <pro_micro.h> + +#ifdef SOFT_SERIAL_PIN + +#ifdef __AVR_ATmega32U4__ + // if using ATmega32U4 I2C, can not use PD0 and PD1 in soft serial. + #ifdef USE_AVR_I2C + #if SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1 + #error Using ATmega32U4 I2C, so can not use PD0, PD1 + #endif + #endif + + #if SOFT_SERIAL_PIN >= D0 && SOFT_SERIAL_PIN <= D3 + #define SERIAL_PIN_DDR DDRD + #define SERIAL_PIN_PORT PORTD + #define SERIAL_PIN_INPUT PIND + #if SOFT_SERIAL_PIN == D0 + #define SERIAL_PIN_MASK _BV(PD0) + #define EIMSK_BIT _BV(INT0) + #define EICRx_BIT (~(_BV(ISC00) | _BV(ISC01))) + #define SERIAL_PIN_INTERRUPT INT0_vect + #elif SOFT_SERIAL_PIN == D1 + #define SERIAL_PIN_MASK _BV(PD1) + #define EIMSK_BIT _BV(INT1) + #define EICRx_BIT (~(_BV(ISC10) | _BV(ISC11))) + #define SERIAL_PIN_INTERRUPT INT1_vect + #elif SOFT_SERIAL_PIN == D2 + #define SERIAL_PIN_MASK _BV(PD2) + #define EIMSK_BIT _BV(INT2) + #define EICRx_BIT (~(_BV(ISC20) | _BV(ISC21))) + #define SERIAL_PIN_INTERRUPT INT2_vect + #elif SOFT_SERIAL_PIN == D3 + #define SERIAL_PIN_MASK _BV(PD3) + #define EIMSK_BIT _BV(INT3) + #define EICRx_BIT (~(_BV(ISC30) | _BV(ISC31))) + #define SERIAL_PIN_INTERRUPT INT3_vect + #endif + #elif SOFT_SERIAL_PIN == E6 + #define SERIAL_PIN_DDR DDRE + #define SERIAL_PIN_PORT PORTE + #define SERIAL_PIN_INPUT PINE + #define SERIAL_PIN_MASK _BV(PE6) + #define EIMSK_BIT _BV(INT6) + #define EICRx_BIT (~(_BV(ISC60) | _BV(ISC61))) + #define SERIAL_PIN_INTERRUPT INT6_vect + #else + #error invalid SOFT_SERIAL_PIN value + #endif + +#else + #error serial.c now support ATmega32U4 only +#endif + +#define ALWAYS_INLINE __attribute__((always_inline)) +#define NO_INLINE __attribute__((noinline)) +#define _delay_sub_us(x) __builtin_avr_delay_cycles(x) + +// parity check +#define ODD_PARITY 1 +#define EVEN_PARITY 0 +#define PARITY EVEN_PARITY + +#ifdef SERIAL_DELAY + // custom setup in config.h + // #define TID_SEND_ADJUST 2 + // #define SERIAL_DELAY 6 // micro sec + // #define READ_WRITE_START_ADJUST 30 // cycles + // #define READ_WRITE_WIDTH_ADJUST 8 // cycles +#else +// ============ Standard setups ============ + +#ifndef SELECT_SOFT_SERIAL_SPEED +#define SELECT_SOFT_SERIAL_SPEED 1 +// 0: about 189kbps (Experimental only) +// 1: about 137kbps (default) +// 2: about 75kbps +// 3: about 39kbps +// 4: about 26kbps +// 5: about 20kbps +#endif + +#if __GNUC__ < 6 + #define TID_SEND_ADJUST 14 +#else + #define TID_SEND_ADJUST 2 +#endif + +#if SELECT_SOFT_SERIAL_SPEED == 0 + // Very High speed + #define SERIAL_DELAY 4 // micro sec + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 34 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 1 + // High speed + #define SERIAL_DELAY 6 // micro sec + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 2 + // Middle speed + #define SERIAL_DELAY 12 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 3 + // Low speed + #define SERIAL_DELAY 24 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 4 + // Very Low speed + #define SERIAL_DELAY 36 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 5 + // Ultra Low speed + #define SERIAL_DELAY 48 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#else +#error invalid SELECT_SOFT_SERIAL_SPEED value +#endif /* SELECT_SOFT_SERIAL_SPEED */ +#endif /* SERIAL_DELAY */ + +#define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) +#define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) + +#define SLAVE_INT_WIDTH_US 1 +#ifndef SERIAL_USE_MULTI_TRANSACTION + #define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY +#else + #define SLAVE_INT_ACK_WIDTH_UNIT 2 + #define SLAVE_INT_ACK_WIDTH 4 +#endif + +static SSTD_t *Transaction_table = NULL; +static uint8_t Transaction_table_size = 0; + +inline static void serial_delay(void) ALWAYS_INLINE; +inline static +void serial_delay(void) { + _delay_us(SERIAL_DELAY); +} + +inline static void serial_delay_half1(void) ALWAYS_INLINE; +inline static +void serial_delay_half1(void) { + _delay_us(SERIAL_DELAY_HALF1); +} + +inline static void serial_delay_half2(void) ALWAYS_INLINE; +inline static +void serial_delay_half2(void) { + _delay_us(SERIAL_DELAY_HALF2); +} + +inline static void serial_output(void) ALWAYS_INLINE; +inline static +void serial_output(void) { + SERIAL_PIN_DDR |= SERIAL_PIN_MASK; +} + +// make the serial pin an input with pull-up resistor +inline static void serial_input_with_pullup(void) ALWAYS_INLINE; +inline static +void serial_input_with_pullup(void) { + SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +inline static uint8_t serial_read_pin(void) ALWAYS_INLINE; +inline static +uint8_t serial_read_pin(void) { + return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); +} + +inline static void serial_low(void) ALWAYS_INLINE; +inline static +void serial_low(void) { + SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; +} + +inline static void serial_high(void) ALWAYS_INLINE; +inline static +void serial_high(void) { + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size) +{ + Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; + serial_output(); + serial_high(); +} + +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size) +{ + Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; + serial_input_with_pullup(); + + // Enable INT0-INT3,INT6 + EIMSK |= EIMSK_BIT; +#if SERIAL_PIN_MASK == _BV(PE6) + // Trigger on falling edge of INT6 + EICRB &= EICRx_BIT; +#else + // Trigger on falling edge of INT0-INT3 + EICRA &= EICRx_BIT; +#endif +} + +// Used by the sender to synchronize timing with the reciver. +static void sync_recv(void) NO_INLINE; +static +void sync_recv(void) { + for (uint8_t i = 0; i < SERIAL_DELAY*5 && serial_read_pin(); i++ ) { + } + // This shouldn't hang if the target disconnects because the + // serial line will float to high if the target does disconnect. + while (!serial_read_pin()); +} + +// Used by the reciver to send a synchronization signal to the sender. +static void sync_send(void) NO_INLINE; +static +void sync_send(void) { + serial_low(); + serial_delay(); + serial_high(); +} + +// Reads a byte from the serial line +static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) NO_INLINE; +static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) { + uint8_t byte, i, p, pb; + + _delay_sub_us(READ_WRITE_START_ADJUST); + for( i = 0, byte = 0, p = PARITY; i < bit; i++ ) { + serial_delay_half1(); // read the middle of pulses + if( serial_read_pin() ) { + byte = (byte << 1) | 1; p ^= 1; + } else { + byte = (byte << 1) | 0; p ^= 0; + } + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); + } + /* recive parity bit */ + serial_delay_half1(); // read the middle of pulses + pb = serial_read_pin(); + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); + + *pterrcount += (p != pb)? 1 : 0; + + return byte; +} + +// Sends a byte with MSB ordering +void serial_write_chunk(uint8_t data, uint8_t bit) NO_INLINE; +void serial_write_chunk(uint8_t data, uint8_t bit) { + uint8_t b, p; + for( p = PARITY, b = 1<<(bit-1); b ; b >>= 1) { + if(data & b) { + serial_high(); p ^= 1; + } else { + serial_low(); p ^= 0; + } + serial_delay(); + } + /* send parity bit */ + if(p & 1) { serial_high(); } + else { serial_low(); } + serial_delay(); + + serial_low(); // sync_send() / senc_recv() need raise edge +} + +static void serial_send_packet(uint8_t *buffer, uint8_t size) NO_INLINE; +static +void serial_send_packet(uint8_t *buffer, uint8_t size) { + for (uint8_t i = 0; i < size; ++i) { + uint8_t data; + data = buffer[i]; + sync_send(); + serial_write_chunk(data,8); + } +} + +static uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) NO_INLINE; +static +uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) { + uint8_t pecount = 0; + for (uint8_t i = 0; i < size; ++i) { + uint8_t data; + sync_recv(); + data = serial_read_chunk(&pecount, 8); + buffer[i] = data; + } + return pecount == 0; +} + +inline static +void change_sender2reciver(void) { + sync_send(); //0 + serial_delay_half1(); //1 + serial_low(); //2 + serial_input_with_pullup(); //2 + serial_delay_half1(); //3 +} + +inline static +void change_reciver2sender(void) { + sync_recv(); //0 + serial_delay(); //1 + serial_low(); //3 + serial_output(); //3 + serial_delay_half1(); //4 +} + +static inline uint8_t nibble_bits_count(uint8_t bits) +{ + bits = (bits & 0x5) + (bits >> 1 & 0x5); + bits = (bits & 0x3) + (bits >> 2 & 0x3); + return bits; +} + +// interrupt handle to be used by the target device +ISR(SERIAL_PIN_INTERRUPT) { + +#ifndef SERIAL_USE_MULTI_TRANSACTION + serial_low(); + serial_output(); + SSTD_t *trans = Transaction_table; +#else + // recive transaction table index + uint8_t tid, bits; + uint8_t pecount = 0; + sync_recv(); + bits = serial_read_chunk(&pecount,7); + tid = bits>>3; + bits = (bits&7) != nibble_bits_count(tid); + if( bits || pecount> 0 || tid > Transaction_table_size ) { + return; + } + serial_delay_half1(); + + serial_high(); // response step1 low->high + serial_output(); + _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT*SLAVE_INT_ACK_WIDTH); + SSTD_t *trans = &Transaction_table[tid]; + serial_low(); // response step2 ack high->low +#endif + + // target send phase + if( trans->target2initiator_buffer_size > 0 ) + serial_send_packet((uint8_t *)trans->target2initiator_buffer, + trans->target2initiator_buffer_size); + // target switch to input + change_sender2reciver(); + + // target recive phase + if( trans->initiator2target_buffer_size > 0 ) { + if (serial_recive_packet((uint8_t *)trans->initiator2target_buffer, + trans->initiator2target_buffer_size) ) { + *trans->status = TRANSACTION_ACCEPTED; + } else { + *trans->status = TRANSACTION_DATA_ERROR; + } + } else { + *trans->status = TRANSACTION_ACCEPTED; + } + + sync_recv(); //weit initiator output to high +} + +///////// +// start transaction by initiator +// +// int soft_serial_transaction(int sstd_index) +// +// Returns: +// TRANSACTION_END +// TRANSACTION_NO_RESPONSE +// TRANSACTION_DATA_ERROR +// this code is very time dependent, so we need to disable interrupts +#ifndef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_transaction(void) { + SSTD_t *trans = Transaction_table; +#else +int soft_serial_transaction(int sstd_index) { + if( sstd_index > Transaction_table_size ) + return TRANSACTION_TYPE_ERROR; + SSTD_t *trans = &Transaction_table[sstd_index]; +#endif + cli(); + + // signal to the target that we want to start a transaction + serial_output(); + serial_low(); + _delay_us(SLAVE_INT_WIDTH_US); + +#ifndef SERIAL_USE_MULTI_TRANSACTION + // wait for the target response + serial_input_with_pullup(); + _delay_us(SLAVE_INT_RESPONSE_TIME); + + // check if the target is present + if (serial_read_pin()) { + // target failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; + sei(); + return TRANSACTION_NO_RESPONSE; + } + +#else + // send transaction table index + int tid = (sstd_index<<3) | (7 & nibble_bits_count(sstd_index)); + sync_send(); + _delay_sub_us(TID_SEND_ADJUST); + serial_write_chunk(tid, 7); + serial_delay_half1(); + + // wait for the target response (step1 low->high) + serial_input_with_pullup(); + while( !serial_read_pin() ) { + _delay_sub_us(2); + } + + // check if the target is present (step2 high->low) + for( int i = 0; serial_read_pin(); i++ ) { + if (i > SLAVE_INT_ACK_WIDTH + 1) { + // slave failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; + sei(); + return TRANSACTION_NO_RESPONSE; + } + _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT); + } +#endif + + // initiator recive phase + // if the target is present syncronize with it + if( trans->target2initiator_buffer_size > 0 ) { + if (!serial_recive_packet((uint8_t *)trans->target2initiator_buffer, + trans->target2initiator_buffer_size) ) { + serial_output(); + serial_high(); + *trans->status = TRANSACTION_DATA_ERROR; + sei(); + return TRANSACTION_DATA_ERROR; + } + } + + // initiator switch to output + change_reciver2sender(); + + // initiator send phase + if( trans->initiator2target_buffer_size > 0 ) { + serial_send_packet((uint8_t *)trans->initiator2target_buffer, + trans->initiator2target_buffer_size); + } + + // always, release the line when not in use + sync_send(); + + *trans->status = TRANSACTION_END; + sei(); + return TRANSACTION_END; +} + +#ifdef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_get_and_clean_status(int sstd_index) { + SSTD_t *trans = &Transaction_table[sstd_index]; + cli(); + int retval = *trans->status; + *trans->status = 0;; + sei(); + return retval; +} +#endif + +#endif + +// Helix serial.c history +// 2018-1-29 fork from let's split and add PD2, modify sync_recv() (#2308, bceffdefc) +// 2018-6-28 bug fix master to slave comm and speed up (#3255, 1038bbef4) +// (adjusted with avr-gcc 4.9.2) +// 2018-7-13 remove USE_SERIAL_PD2 macro (#3374, f30d6dd78) +// (adjusted with avr-gcc 4.9.2) +// 2018-8-11 add support multi-type transaction (#3608, feb5e4aae) +// (adjusted with avr-gcc 4.9.2) +// 2018-10-21 fix serial and RGB animation conflict (#4191, 4665e4fff) +// (adjusted with avr-gcc 7.3.0) +// 2018-10-28 re-adjust compiler depend value of delay (#4269, 8517f8a66) +// (adjusted with avr-gcc 5.4.0, 7.3.0) +// 2018-12-17 copy to TOP/quantum/split_common/ and remove backward compatibility code (#4669) diff --git a/keyboards/ai03/orbit/serial.h b/keyboards/ai03/orbit/serial.h new file mode 100644 index 0000000000..1c1e640069 --- /dev/null +++ b/keyboards/ai03/orbit/serial.h @@ -0,0 +1,62 @@ +#pragma once + +#include <stdbool.h> + +// ///////////////////////////////////////////////////////////////// +// Need Soft Serial defines in config.h +// ///////////////////////////////////////////////////////////////// +// ex. +// #define SOFT_SERIAL_PIN ?? // ?? = D0,D1,D2,D3,E6 +// OPTIONAL: #define SELECT_SOFT_SERIAL_SPEED ? // ? = 1,2,3,4,5 +// // 1: about 137kbps (default) +// // 2: about 75kbps +// // 3: about 39kbps +// // 4: about 26kbps +// // 5: about 20kbps +// +// //// USE simple API (using signle-type transaction function) +// /* nothing */ +// //// USE flexible API (using multi-type transaction function) +// #define SERIAL_USE_MULTI_TRANSACTION +// +// ///////////////////////////////////////////////////////////////// + +// Soft Serial Transaction Descriptor +typedef struct _SSTD_t { + uint8_t *status; + uint8_t initiator2target_buffer_size; + uint8_t *initiator2target_buffer; + uint8_t target2initiator_buffer_size; + uint8_t *target2initiator_buffer; +} SSTD_t; +#define TID_LIMIT( table ) (sizeof(table) / sizeof(SSTD_t)) + +// initiator is transaction start side +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size); +// target is interrupt accept side +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size); + +// initiator resullt +#define TRANSACTION_END 0 +#define TRANSACTION_NO_RESPONSE 0x1 +#define TRANSACTION_DATA_ERROR 0x2 +#define TRANSACTION_TYPE_ERROR 0x4 +#ifndef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_transaction(void); +#else +int soft_serial_transaction(int sstd_index); +#endif + +// target status +// *SSTD_t.status has +// initiator: +// TRANSACTION_END +// or TRANSACTION_NO_RESPONSE +// or TRANSACTION_DATA_ERROR +// target: +// TRANSACTION_DATA_ERROR +// or TRANSACTION_ACCEPTED +#define TRANSACTION_ACCEPTED 0x8 +#ifdef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_get_and_clean_status(int sstd_index); +#endif diff --git a/keyboards/ai03/orbit/split_flags.c b/keyboards/ai03/orbit/split_flags.c new file mode 100644 index 0000000000..1f5825d650 --- /dev/null +++ b/keyboards/ai03/orbit/split_flags.c @@ -0,0 +1,5 @@ +#include "split_flags.h" + +volatile bool RGB_DIRTY = false; + +volatile bool BACKLIT_DIRTY = false;
\ No newline at end of file diff --git a/keyboards/ai03/orbit/split_flags.h b/keyboards/ai03/orbit/split_flags.h new file mode 100644 index 0000000000..aaac474a7d --- /dev/null +++ b/keyboards/ai03/orbit/split_flags.h @@ -0,0 +1,15 @@ +#pragma once + +#include <stdbool.h> +#include <stdint.h> + +/** +* Global Flags +**/ + +//RGB Stuff +extern volatile bool RGB_DIRTY; + + +//Backlight Stuff +extern volatile bool BACKLIT_DIRTY; diff --git a/keyboards/ai03/orbit/split_util.c b/keyboards/ai03/orbit/split_util.c new file mode 100644 index 0000000000..5095cb8fdc --- /dev/null +++ b/keyboards/ai03/orbit/split_util.c @@ -0,0 +1,87 @@ +#include "split_util.h" +#include "matrix.h" +#include "keyboard.h" +#include "config.h" +#include "timer.h" +#include "split_flags.h" +#include "transport.h" +#include "quantum.h" + +#ifdef EE_HANDS +# include "tmk_core/common/eeprom.h" +# include "eeconfig.h" +#endif + +volatile bool isLeftHand = true; + +__attribute__((weak)) +bool is_keyboard_left(void) { + #ifdef SPLIT_HAND_PIN + // Test pin SPLIT_HAND_PIN for High/Low, if low it's right hand + setPinInput(SPLIT_HAND_PIN); + return readPin(SPLIT_HAND_PIN); + #else + #ifdef EE_HANDS + return eeprom_read_byte(EECONFIG_HANDEDNESS); + #else + #ifdef MASTER_RIGHT + return !is_keyboard_master(); + #else + return is_keyboard_master(); + #endif + #endif + #endif +} + +bool is_keyboard_master(void) +{ +#ifdef __AVR__ + static enum { UNKNOWN, MASTER, SLAVE } usbstate = UNKNOWN; + + // only check once, as this is called often + if (usbstate == UNKNOWN) + { + USBCON |= (1 << OTGPADE); // enables VBUS pad + wait_us(5); + + usbstate = (USBSTA & (1 << VBUS)) ? MASTER : SLAVE; // checks state of VBUS + } + + return (usbstate == MASTER); +#else + return true; +#endif +} + +static void keyboard_master_setup(void) { +#if defined(USE_I2C) || defined(EH) + #ifdef SSD1306OLED + matrix_master_OLED_init (); + #endif +#endif + transport_master_init(); + + // For master the Backlight info needs to be sent on startup + // Otherwise the salve won't start with the proper info until an update + BACKLIT_DIRTY = true; +} + +static void keyboard_slave_setup(void) +{ + transport_slave_init(); +} + +// this code runs before the usb and keyboard is initialized +void matrix_setup(void) +{ + isLeftHand = is_keyboard_left(); + + if (is_keyboard_master()) + { + keyboard_master_setup(); + } + else + { + keyboard_slave_setup(); + } +} diff --git a/keyboards/ai03/orbit/split_util.h b/keyboards/ai03/orbit/split_util.h new file mode 100644 index 0000000000..20f7535bf4 --- /dev/null +++ b/keyboards/ai03/orbit/split_util.h @@ -0,0 +1,10 @@ +#pragma once + +#include <stdbool.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> + +extern volatile bool isLeftHand; + +void matrix_master_OLED_init (void); diff --git a/keyboards/ai03/orbit/transport.c b/keyboards/ai03/orbit/transport.c new file mode 100644 index 0000000000..adedf24322 --- /dev/null +++ b/keyboards/ai03/orbit/transport.c @@ -0,0 +1,238 @@ + +#include "transport.h" + +#include "config.h" +#include "matrix.h" +#include "quantum.h" + +#include "orbit.h" + +#define ROWS_PER_HAND (MATRIX_ROWS/2) + +#ifdef RGBLIGHT_ENABLE +# include "rgblight.h" +#endif + +#ifdef BACKLIGHT_ENABLE +# include "backlight.h" + extern backlight_config_t backlight_config; +#endif + +#if defined(USE_I2C) || defined(EH) + +#include "i2c.h" + +#ifndef SLAVE_I2C_ADDRESS +# define SLAVE_I2C_ADDRESS 0x32 +#endif + +#if (MATRIX_COLS > 8) +# error "Currently only supports 8 COLS" +#endif + +// Get rows from other half over i2c +bool transport_master(matrix_row_t matrix[]) { + int err = 0; + + // write backlight info +#ifdef BACKLIGHT_ENABLE + if (BACKLIT_DIRTY) { + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + if (err) { goto i2c_error; } + + // Backlight location + err = i2c_master_write(I2C_BACKLIT_START); + if (err) { goto i2c_error; } + + // Write backlight + i2c_master_write(get_backlight_level()); + + BACKLIT_DIRTY = false; + } +#endif + + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + if (err) { goto i2c_error; } + + // start of matrix stored at I2C_KEYMAP_START + err = i2c_master_write(I2C_KEYMAP_START); + if (err) { goto i2c_error; } + + // Start read + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); + if (err) { goto i2c_error; } + + if (!err) { + int i; + for (i = 0; i < ROWS_PER_HAND-1; ++i) { + matrix[i] = i2c_master_read(I2C_ACK); + } + matrix[i] = i2c_master_read(I2C_NACK); + i2c_master_stop(); + } else { +i2c_error: // the cable is disconnceted, or something else went wrong + i2c_reset_state(); + return false; + } + +#ifdef RGBLIGHT_ENABLE + if (RGB_DIRTY) { + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + if (err) { goto i2c_error; } + + // RGB Location + err = i2c_master_write(I2C_RGB_START); + if (err) { goto i2c_error; } + + uint32_t dword = eeconfig_read_rgblight(); + + // Write RGB + err = i2c_master_write_data(&dword, 4); + if (err) { goto i2c_error; } + + RGB_DIRTY = false; + i2c_master_stop(); + } +#endif + + return true; +} + +void transport_slave(matrix_row_t matrix[]) { + + for (int i = 0; i < ROWS_PER_HAND; ++i) + { + i2c_slave_buffer[I2C_KEYMAP_START + i] = matrix[i]; + } + // Read Backlight Info + #ifdef BACKLIGHT_ENABLE + if (BACKLIT_DIRTY) + { + backlight_set(i2c_slave_buffer[I2C_BACKLIT_START]); + BACKLIT_DIRTY = false; + } + #endif + #ifdef RGBLIGHT_ENABLE + if (RGB_DIRTY) + { + // Disable interupts (RGB data is big) + cli(); + // Create new DWORD for RGB data + uint32_t dword; + + // Fill the new DWORD with the data that was sent over + uint8_t * dword_dat = (uint8_t *)(&dword); + for (int i = 0; i < 4; i++) + { + dword_dat[i] = i2c_slave_buffer[I2C_RGB_START + i]; + } + + // Update the RGB now with the new data and set RGB_DIRTY to false + rgblight_update_dword(dword); + RGB_DIRTY = false; + // Re-enable interupts now that RGB is set + sei(); + } + #endif +} + +void transport_master_init(void) { + i2c_master_init(); +} + +void transport_slave_init(void) { + i2c_slave_init(SLAVE_I2C_ADDRESS); +} + +#else // USE_SERIAL + +#include "serial.h" + + + +volatile Serial_s2m_buffer_t serial_s2m_buffer = {}; +volatile Serial_m2s_buffer_t serial_m2s_buffer = {}; +uint8_t volatile status0 = 0; + +SSTD_t transactions[] = { + { (uint8_t *)&status0, + sizeof(serial_m2s_buffer), (uint8_t *)&serial_m2s_buffer, + sizeof(serial_s2m_buffer), (uint8_t *)&serial_s2m_buffer + } +}; + +uint8_t slave_layer_cache; +uint8_t slave_nlock_cache; +uint8_t slave_clock_cache; +uint8_t slave_slock_cache; + +void transport_master_init(void) +{ soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } + +void transport_slave_init(void) +{ + soft_serial_target_init(transactions, TID_LIMIT(transactions)); + slave_layer_cache = 255; + slave_nlock_cache = 255; + slave_clock_cache = 255; + slave_slock_cache = 255; +} + +bool transport_master(matrix_row_t matrix[]) { + + if (soft_serial_transaction()) { + return false; + } + + // TODO: if MATRIX_COLS > 8 change to unpack() + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[i] = serial_s2m_buffer.smatrix[i]; + } + + #if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) + // Code to send RGB over serial goes here (not implemented yet) + #endif + + #ifdef BACKLIGHT_ENABLE + // Write backlight level for slave to read + serial_m2s_buffer.backlight_level = backlight_config.enable ? backlight_config.level : 0; + #endif + + return true; +} + +void transport_slave(matrix_row_t matrix[]) { + + // TODO: if MATRIX_COLS > 8 change to pack() + for (int i = 0; i < ROWS_PER_HAND; ++i) + { + serial_s2m_buffer.smatrix[i] = matrix[i]; + } + #ifdef BACKLIGHT_ENABLE + backlight_set(serial_m2s_buffer.backlight_level); + #endif + #if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) + // Add serial implementation for RGB here + #endif + + if (slave_layer_cache != serial_m2s_buffer.current_layer) { + slave_layer_cache = serial_m2s_buffer.current_layer; + set_layer_indicators(slave_layer_cache); + } + + if (slave_nlock_cache != serial_m2s_buffer.nlock_led) { + slave_nlock_cache = serial_m2s_buffer.nlock_led; + led_toggle(3, slave_nlock_cache); + } + if (slave_clock_cache != serial_m2s_buffer.clock_led) { + slave_clock_cache = serial_m2s_buffer.clock_led; + led_toggle(4, slave_clock_cache); + } + if (slave_slock_cache != serial_m2s_buffer.slock_led) { + slave_slock_cache = serial_m2s_buffer.slock_led; + led_toggle(5, slave_slock_cache); + } + +} + +#endif diff --git a/keyboards/ai03/orbit/transport.h b/keyboards/ai03/orbit/transport.h new file mode 100644 index 0000000000..422e2ecb99 --- /dev/null +++ b/keyboards/ai03/orbit/transport.h @@ -0,0 +1,42 @@ +#pragma once + +#include <common/matrix.h> + +#define ROWS_PER_HAND (MATRIX_ROWS/2) + +typedef struct _Serial_s2m_buffer_t { + // TODO: if MATRIX_COLS > 8 change to uint8_t packed_matrix[] for pack/unpack + matrix_row_t smatrix[ROWS_PER_HAND]; +} Serial_s2m_buffer_t; + +typedef struct _Serial_m2s_buffer_t { +#ifdef BACKLIGHT_ENABLE + uint8_t backlight_level; +#endif +#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) + rgblight_config_t rgblight_config; //not yet use + // + // When MCUs on both sides drive their respective RGB LED chains, + // it is necessary to synchronize, so it is necessary to communicate RGB information. + // In that case, define the RGBLIGHT_SPLIT macro. + // + // Otherwise, if the master side MCU drives both sides RGB LED chains, + // there is no need to communicate. +#endif + + uint8_t current_layer; + uint8_t nlock_led; + uint8_t clock_led; + uint8_t slock_led; + +} Serial_m2s_buffer_t; + +extern volatile Serial_s2m_buffer_t serial_s2m_buffer; +extern volatile Serial_m2s_buffer_t serial_m2s_buffer; + +void transport_master_init(void); +void transport_slave_init(void); + +// returns false if valid data not received from slave +bool transport_master(matrix_row_t matrix[]); +void transport_slave(matrix_row_t matrix[]); diff --git a/keyboards/alice/alice.h b/keyboards/alice/alice.h index 16460ed701..1486612f9f 100644 --- a/keyboards/alice/alice.h +++ b/keyboards/alice/alice.h @@ -1,5 +1,5 @@ /* -Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> +Copyright 2019 Felipe Coury <felipe.coury@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 @@ -21,30 +21,30 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. /* LAYOUT * ┌───┐ ┌───┬───┬───┬───┬───┬───┬───┐ ┌───┬───┬───┬───┬───┬───┬───┬───┐ - * │63 │ │00 │01 │02 │03 │04 │05 │06 │ │07 │08 │09 │10 │11 │12 │13 │14 │ + * │50 │ │00 │01 │02 │03 │04 │05 │06 │ │07 │08 │09 │0A │0B │0C │0D │0E │ * ├───┤ ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┘ ┌─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ - * │64 │ │15 │16 │17 │18 │19 │20 │ │21 │22 │23 │24 │25 │26 │27 │28 │ + * │51 │ │10 │11 │12 │13 │14 │15 │ │16 │17 │18 │19 │1A │1B │1C │1D │ * ├───┤ ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ └┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │65 │ │29 │30 │31 │32 │33 │34 │ │35 │36 │37 │38 │39 │40 │41 │ + * │52 │ │20 │21 │22 │23 │24 │25 │ │26 │27 │28 │29 │2A │2B │2C │ * └───┘ ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┐ ┌─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ - * │42 │43 │44 │45 │46 │47 │ │48 │49 │50 │51 │52 │53 │54 │55 │ + * │30 │31 │32 │33 │34 │35 │ │36 │37 │38 │39 │4A │4B │4C │4D │ * ├─────┬──┴──┬┴───┴┬──┴───┴┬──┴─┐ ├───┴───┴──┬┴───┴┬──┴───┴────┬─┴───┤ - * │56 │ │57 │58 │59 │ │60 │61 │ │62 │ + * │40 │ │41 │42 │43 │ │46 │47 │ │48 │ * └─────┘ └─────┴───────┴────┘ └──────────┴─────┘ └─────┘ */ #define LAYOUT( \ - K63, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, K13, K14, \ - K64, K15, K16, K17, K18, K19, K20, K21, K22, K23, K24, K25, K26, K27, K28, \ - K65, K29, K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K40, K41, \ - K42, K43, K44, K45, K46, K47, K48, K49, K50, K51, K52, K53, K54, K55, \ - K56, K57, K58, K59, K60, K61, K62 \ + K50, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K51, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K52, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K4A, K4B, K4C, K4D, \ + K40, K41, K42, K43, K46, K47, K48 \ ) \ { \ - { K00 , K01 , K02 , K03 , K04 , K05 , K06 , K07 , K08 , K09 , K10 , K11 , K12 , K13 , K14 }, \ - { K15 , K16 , K17 , K18 , K19 , K20 , K21 , K22 , K23 , K24 , K25 , K26 , K27 , K28 , KC_NO }, \ - { K29 , K30 , K31 , K32 , K33 , K34 , K35 , K36 , K37 , K38 , K39 , K40 , K41 , KC_NO, KC_NO }, \ - { K42 , K43 , K44 , K45 , K46 , K47 , K48 , K49 , K50 , K51 , K52 , K53 , K54 , K55 , KC_NO }, \ - { K56 , K57 , K58 , K59 , KC_NO, KC_NO, K60 , K61 , K62 , KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { K63 , K64 , K65 , KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ + { K00 , K01 , K02 , K03 , K04 , K05 , K06 , K07 , K08 , K09 , K0A , K0B , K0C , K0D , K0E }, \ + { K10 , K11 , K12 , K13 , K14 , K15 , K16 , K17 , K18 , K19 , K1A , K1B , K1C , K1D , KC_NO }, \ + { K20 , K21 , K22 , K23 , K24 , K25 , K26 , K27 , K28 , K29 , K2A , K2B , K2C , KC_NO, KC_NO }, \ + { K30 , K31 , K32 , K33 , K34 , K35 , K36 , K37 , K38 , K39 , K4A , K4B , K4C , K4D , KC_NO }, \ + { K40 , K41 , K42 , K43 , KC_NO, KC_NO, K46 , K47 , K48 , KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { K50 , K51 , K52 , KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ } diff --git a/keyboards/alice/program b/keyboards/alice/program deleted file mode 100755 index 3779bad040..0000000000 --- a/keyboards/alice/program +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/env python -# Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>, Sebastian Kaim <sebb@sebb767.de> -# -# 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/>. - -from __future__ import print_function - -import os -import sys -import time -import usb - - -def checkForKeyboardInNormalMode(): - """Returns a device if a ps2avrGB device in normal made (that is in keyboard mode) or None if it is not found.""" - return usb.core.find(idVendor=0x20A0, idProduct=0x422D) - -def checkForKeyboardInBootloaderMode(): - """Returns True if a ps2avrGB device in bootloader (flashable) mode is found and False otherwise.""" - return (usb.core.find(idVendor=0x16c0, idProduct=0x05df) is not None) - -def flashKeyboard(firmware_file): - """Calls bootloadHID to flash the given file to the device.""" - print('Flashing firmware to device ...') - if os.system('bootloadHID -r "%s"' % firmware_file) == 0: - print('\nDone!') - else: - print('\nbootloadHID returned an error.') - -def printDeviceInfo(dev): - """Prints all infos for a given USB device""" - print('Device Information:') - print(' idVendor: %d (0x%04x)' % (dev.idVendor, dev.idVendor)) - print(' idProduct: %d (0x%04x)' % (dev.idProduct, dev.idProduct)) - print('Manufacturer: %s' % (dev.iManufacturer)) - print('Serial: %s' % (dev.iSerialNumber)) - print('Product: %s' % (dev.iProduct), end='\n\n') - -def sendDeviceToBootloaderMode(dev): - """Tries to send a given ps2avrGB keyboard to bootloader mode to allow flashing.""" - try: - dev.set_configuration() - - request_type = usb.util.build_request_type( - usb.util.CTRL_OUT, - usb.util.CTRL_TYPE_CLASS, - usb.util.CTRL_RECIPIENT_DEVICE) - - USBRQ_HID_SET_REPORT = 0x09 - HID_REPORT_OPTION = 0x0301 - - dev.ctrl_transfer(request_type, USBRQ_HID_SET_REPORT, HID_REPORT_OPTION, 0, [0, 0, 0xFF] + [0] * 5) - except usb.core.USBError: - # for some reason I keep getting USBError, but it works! - pass - - -if len(sys.argv) < 2: - print('Usage: %s <firmware.hex>' % sys.argv[0]) - sys.exit(1) - -kb = checkForKeyboardInNormalMode() - -if kb is not None: - print('Found a keyboard in normal mode. Attempting to send it to bootloader mode ...', end='') - printDeviceInfo(kb) - sendDeviceToBootloaderMode(kb) - print(' done.') - print("Hint: If your keyboard can't be set to bootloader mode automatically, plug it in while pressing the bootloader key to do so manually.") - print(" You can find more infos about this here: https://github.com/qmk/qmk_firmware/tree/master/keyboards/ps2avrGB#setting-the-board-to-bootloader-mode") - -attempts = 12 # 60 seconds -found = False -for attempt in range(1, attempts + 1): - print("Searching for keyboard in bootloader mode (%i/%i) ... " % (attempt, attempts), end='') - - if checkForKeyboardInBootloaderMode(): - print('Found', end='\n\n') - flashKeyboard(sys.argv[1]) - found = True - break - else: - print('Nothing.', end='') - - if attempt != attempts: # no need to wait on the last attempt - print(' Sleeping 5 seconds.', end='') - time.sleep(5) - - # print a newline - print() - -if not found: - print("Couldn't find a flashable keyboard. Aborting.") - sys.exit(2) - diff --git a/keyboards/alice/rules.mk b/keyboards/alice/rules.mk index bb57cbeae3..eecd38d7e7 100644 --- a/keyboards/alice/rules.mk +++ b/keyboards/alice/rules.mk @@ -45,4 +45,4 @@ OPT_DEFS = -DDEBUG_LEVEL=0 SRC += i2c_master.c # programming options -PROGRAM_CMD = ./keyboards/ps2avrGB/program $(TARGET).hex +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/amj96/keymaps/default/config.h b/keyboards/amj96/keymaps/default/config.h index 5e346088ed..0c01a85594 100644 --- a/keyboards/amj96/keymaps/default/config.h +++ b/keyboards/amj96/keymaps/default/config.h @@ -14,11 +14,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "config_common.h" // place overrides here - -#endif diff --git a/keyboards/amjpad/keymaps/default/keymap.c b/keyboards/amjpad/keymaps/default/keymap.c index 431537d258..1c9122c9ec 100644 --- a/keyboards/amjpad/keymaps/default/keymap.c +++ b/keyboards/amjpad/keymaps/default/keymap.c @@ -1,9 +1,5 @@ #include QMK_KEYBOARD_H -#ifdef RGBLIGHT_ENABLE -#include "rgblight.h" -#endif - // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. // Layer names don't all need to be of the same length, obviously, and you can also skip them diff --git a/keyboards/atomic/readme.md b/keyboards/atomic/readme.md index ab2fa4a239..0561c4fea5 100644 --- a/keyboards/atomic/readme.md +++ b/keyboards/atomic/readme.md @@ -3,7 +3,7 @@ Atomic ![Atomic](http://i.imgur.com/3gNDJAh.jpg) -A compact 60% (15x5) ortholinear keyboard kit made and sold by OLKB. [More info on qmk.fm](http://qmk.fm/atomic/) +A compact 60% (15x5) ortholinear keyboard kit made and sold by OLKB. Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) Hardware Supported: Atomic PCB rev1, Teensy 2.0 diff --git a/keyboards/atreus/keymaps/dvorak_42_key/keymap.c b/keyboards/atreus/keymaps/dvorak_42_key/keymap.c index a6efd1befa..0fda245e2e 100644 --- a/keyboards/atreus/keymaps/dvorak_42_key/keymap.c +++ b/keyboards/atreus/keymaps/dvorak_42_key/keymap.c @@ -8,6 +8,21 @@ #define COMBINED 3 #define BROWSER_CONTROL 4 +// aliases +// shell +#define SHELL_DEL_WORD RCTL(KC_W) +// android studio + +#define AS_TABLEFT LALT(KC_LEFT) +#define AS_TABRIGHT LALT(KC_RIGHT) +#define AS_SYMBOL LCTL(LALT(KC_N)) +#define AS_CLASS LCTL(KC_N) +#define AS_FINDUSAGE LALT(KC_F7) +#define AS_BACK LCTL(LALT(KC_LEFT)) +#define AS_GO_DECLARATION LCTL(KC_B) +#define AS_GO_IMPLEMENTATION LCTL(LALT(KC_B)) +#define AS_CLOSETAB LCTL(KC_F4) +#define AS_CLOSETOOLWINDOW LCTL(LSFT(KC_F4)) enum custom_keycodes { PLACEHOLDER = SAFE_RANGE, // can always be here @@ -37,10 +52,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [KEYNAV] = LAYOUT( - KC_ESC, CLOUD9_GOTO_LINE, RCTL(KC_Z), RCTL(KC_S), MEH(KC_F10), KC_TRNS, KC_HOME, KC_UP, KC_END, KC_PGUP, - MEH(KC_F11), CLOUD9_GOTO_SYMBOL, RSFT(KC_TAB), KC_TAB, MEH(KC_A), LCTL(KC_LEFT), KC_LEFT, KC_DOWN, KC_RIGHT, LCTL(KC_RIGHT), - MEH(KC_B), CLOUD9_NAVIGATE, CLOUD9_TAB_LEFT, CLOUD9_TAB_RIGHT, CLOUD9_TAB_CLOSE, KC_TRNS, RCTL(KC_C), RCTL(KC_X), RCTL(KC_V), KC_PGDOWN, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_ENTER, KC_SPACE, KC_BSPC, RCTL(KC_BSPC), KC_DELETE, LCTL(KC_DELETE) + KC_ESC, AS_GO_IMPLEMENTATION, RCTL(KC_Z), RCTL(KC_S), MEH(KC_A), MEH(KC_B), KC_HOME, KC_UP, KC_END, KC_PGUP, + AS_BACK, AS_SYMBOL, RSFT(KC_TAB), KC_TAB, SHELL_DEL_WORD, LCTL(KC_LEFT), KC_LEFT, KC_DOWN, KC_RIGHT, LCTL(KC_RIGHT), + AS_FINDUSAGE, AS_CLASS, AS_TABLEFT, AS_TABRIGHT, AS_CLOSETAB, KC_TRNS, RCTL(KC_C), RCTL(KC_X), RCTL(KC_V), KC_PGDOWN, + AS_CLOSETOOLWINDOW, AS_GO_DECLARATION, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_ENTER, KC_SPACE, KC_BSPC, RCTL(KC_BSPC), KC_DELETE, LCTL(KC_DELETE) ), [KEYSEL] = LAYOUT( diff --git a/keyboards/atreus62/keymaps/jarred/config.h b/keyboards/atreus62/keymaps/jarred/config.h new file mode 100644 index 0000000000..34ab0baaf0 --- /dev/null +++ b/keyboards/atreus62/keymaps/jarred/config.h @@ -0,0 +1,21 @@ +/* Copyright 2018 Jarred Steenvoorden + * + * 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 + +// My hand wire diodes are in the opposite direction to the Atreus62 PCB +#undef DIODE_DIRECTION +#define DIODE_DIRECTION COL2ROW diff --git a/keyboards/atreus62/keymaps/jarred/keymap.c b/keyboards/atreus62/keymaps/jarred/keymap.c new file mode 100644 index 0000000000..7a49b2890c --- /dev/null +++ b/keyboards/atreus62/keymaps/jarred/keymap.c @@ -0,0 +1,26 @@ +/* Copyright 2018 Jarred Steenvoorden + * + * 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 QMK_KEYBOARD_H +#include "jarred.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QW] = LAYOUT_atreus62_grid_wrapper(BLANK_12, QWERTY_1_12, QWERTY_2_12, QWERTY_3_12, QWERTY_L4, KC_NO, KC_NO, QWERTY_R4), + [_LW] = LAYOUT_atreus62_grid_wrapper(BLANK_12, LOWER_1_12 , LOWER_2_12 , LOWER_3_12 , LOWER_L4 , KC_NO, KC_NO, LOWER_R4 ), + [_NV] = LAYOUT_atreus62_grid_wrapper(BLANK_12, NAV_1_12 , NAV_2_12 , NAV_3_12 , NAV_L4 , KC_NO, KC_NO, NAV_R4 ), + [_NP] = LAYOUT_atreus62_grid_wrapper(BLANK_12, NUMPAD_1_12, NUMPAD_2_12, NUMPAD_3_12, NUMPAD_L4, KC_NO, KC_NO, NUMPAD_R4), + [_MS] = LAYOUT_atreus62_grid_wrapper(BLANK_12, MOUSE_1_12 , MOUSE_2_12 , MOUSE_3_12 , MOUSE_L4 , KC_NO, KC_NO, MOUSE_R4 ) +}; diff --git a/keyboards/bm16a/bm16a.c b/keyboards/bm16a/bm16a.c new file mode 100644 index 0000000000..3d616f29e9 --- /dev/null +++ b/keyboards/bm16a/bm16a.c @@ -0,0 +1,43 @@ +/* Copyright 2019 + * + * 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 "bm16a.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/bm16a/bm16a.h b/keyboards/bm16a/bm16a.h new file mode 100644 index 0000000000..cf8bab4730 --- /dev/null +++ b/keyboards/bm16a/bm16a.h @@ -0,0 +1,39 @@ +/* Copyright 2019 + * + * 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" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_ortho_4x4( \ + K01, K02, K03, K04, \ + K11, K12, K13, K14, \ + K21, K22, K23, K24, \ + K31, K32, K33, K34 \ +) \ +{ \ + { K01, K02, K03, K04 }, \ + { K11, K12, K13, K14 }, \ + { K21, K22, K23, K24 }, \ + { K31, K32, K33, K34 } \ +} diff --git a/keyboards/bm16a/config.h b/keyboards/bm16a/config.h new file mode 100644 index 0000000000..c6b460a118 --- /dev/null +++ b/keyboards/bm16a/config.h @@ -0,0 +1,246 @@ +/* Copyright 2019 + * + * 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 0xFEED +#define PRODUCT_ID 0x424D +#define DEVICE_VER 0x0001 +#define MANUFACTURER KPrepublic +#define PRODUCT bm16a +#define DESCRIPTION KPrepublic bm16a + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 4 + +/* + * 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 { D3, D5, D1, D2} +#define MATRIX_COL_PINS { D6, D4, D7, B4} +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +//#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +#define BACKLIGHT_PIN B6 +// #define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 5 + +#define RGB_DI_PIN E2 +#define RGBLED_NUM 4 +#define RGBLIGHT_ANIMATIONS +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* 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. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* 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_HELP H +//#define MAGIC_KEY_HELP_ALT 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 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#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 B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#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 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/bm16a/info.json b/keyboards/bm16a/info.json new file mode 100644 index 0000000000..4f87c5ae1d --- /dev/null +++ b/keyboards/bm16a/info.json @@ -0,0 +1,30 @@ +{ + "keyboard_name": "bm16a", + "url": "", + "maintainer": "qmk", + "width": 4, + "height": 4, + "layouts": { + "LAYOUT_ortho_4x4": { + "key_count": 16, + "layout": [ + {"x":0, "y":0}, + {"x":1, "y":0}, + {"x":2, "y":0}, + {"x":3, "y":0}, + {"x":0, "y":1}, + {"x":1, "y":1}, + {"x":2, "y":1}, + {"x":3, "y":1}, + {"x":0, "y":2}, + {"x":1, "y":2}, + {"x":2, "y":2}, + {"x":3, "y":2}, + {"x":0, "y":3}, + {"x":1, "y":3}, + {"x":2, "y":3}, + {"x":3, "y":3} + ] + } + } + }
\ No newline at end of file diff --git a/keyboards/bm16a/keymaps/default/config.h b/keyboards/bm16a/keymaps/default/config.h new file mode 100644 index 0000000000..08c234aee2 --- /dev/null +++ b/keyboards/bm16a/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 + * + * 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 + +// place overrides here diff --git a/keyboards/bm16a/keymaps/default/keymap.c b/keyboards/bm16a/keymaps/default/keymap.c new file mode 100644 index 0000000000..a0b06ee92a --- /dev/null +++ b/keyboards/bm16a/keymaps/default/keymap.c @@ -0,0 +1,73 @@ +/* Copyright 2019 + * + * 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 QMK_KEYBOARD_H + +enum layers { + _BASE = 0, + _FN1, + _FN2, +}; + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BASE] = LAYOUT_ortho_4x4( + KC_PGUP, KC_HOME, KC_UP, KC_END , \ + KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, \ + MO(_FN2), KC_VOLU, KC_MPLY, KC_MPRV, \ + MO(_FN1), KC_VOLD, KC_MUTE, KC_MNXT \ + ), + [_FN1] = LAYOUT_ortho_4x4( + KC_ESC, KC_P7, KC_P8, KC_P9, \ + KC_TAB, KC_P4, KC_P5, KC_P6, \ + KC_ENT, KC_P1, KC_P2, KC_P3, \ + _______, KC_P0, KC_P0, KC_DOT \ + ), + [_FN2] = LAYOUT_ortho_4x4( + RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ + RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, \ + _______, _______, _______, RESET, \ + BL_STEP, _______, QMKBEST, QMKURL \ + ) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} diff --git a/keyboards/bm16a/keymaps/default/readme.md b/keyboards/bm16a/keymaps/default/readme.md new file mode 100644 index 0000000000..f356f2cca0 --- /dev/null +++ b/keyboards/bm16a/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for bm16a
\ No newline at end of file diff --git a/keyboards/bm16a/readme.md b/keyboards/bm16a/readme.md new file mode 100644 index 0000000000..8d43b7014d --- /dev/null +++ b/keyboards/bm16a/readme.md @@ -0,0 +1,15 @@ +# bm16a + +![bm16a](https://ae01.alicdn.com/kf/HTB1RRRQaZfrK1RjSszcq6xGGFXaY.jpg) + +A 16 key macropad, with USB C, RGB underglow and backlight. + +Keyboard Maintainer: QMK Community +Hardware Supported: The PCBs, controllers supported +Hardware Availability: [KPrepublic](https://kprepublic.com/products/bm16a-16-keys-custom-mechanical-keyboard-pcb-plate-programmed-numpad-layouts-qmk-firmware-with-rgb-bottom-underglow-alps-mx); [AliExpress](https://www.aliexpress.com/store/product/bm16a-16-keys-Custom-Mechanical-Keyboard-PCB-plate-programmed-numpad-layouts-qmk-firmware-with-rgb-bottom/3034003_32970629907.html) + +Make example for this keyboard (after setting up your build environment): + + make bm16a:default + +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/bm16a/rules.mk b/keyboards/bm16a/rules.mk new file mode 100644 index 0000000000..013dac3c90 --- /dev/null +++ b/keyboards/bm16a/rules.mk @@ -0,0 +1,82 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +LAYOUTS = ortho_4x4 diff --git a/keyboards/bpiphany/tiger_lily/keymaps/default/config.h b/keyboards/bpiphany/tiger_lily/keymaps/default/config.h index 8893d122e0..271f48d001 100644 --- a/keyboards/bpiphany/tiger_lily/keymaps/default/config.h +++ b/keyboards/bpiphany/tiger_lily/keymaps/default/config.h @@ -1,8 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/bpiphany/unloved_bastard/keymaps/default/config.h b/keyboards/bpiphany/unloved_bastard/keymaps/default/config.h index c55f7f9f7d..ed56340c39 100644 --- a/keyboards/bpiphany/unloved_bastard/keymaps/default/config.h +++ b/keyboards/bpiphany/unloved_bastard/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/c39/c39.c b/keyboards/c39/c39.c new file mode 100755 index 0000000000..78ecae5a32 --- /dev/null +++ b/keyboards/c39/c39.c @@ -0,0 +1 @@ +#include "c39.h" diff --git a/keyboards/c39/c39.h b/keyboards/c39/c39.h new file mode 100755 index 0000000000..797dd1ef77 --- /dev/null +++ b/keyboards/c39/c39.h @@ -0,0 +1,17 @@ +#pragma once + +#include "quantum.h" + +#define ___ KC_NO + +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C \ + ) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C } \ +} + +#define LAYOUT_ortho_3x13 LAYOUT diff --git a/keyboards/c39/config.h b/keyboards/c39/config.h new file mode 100755 index 0000000000..3adc796701 --- /dev/null +++ b/keyboards/c39/config.h @@ -0,0 +1,89 @@ +/* +Copyright 2012 Jun Wako <wakojun@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 "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCA17 +#define PRODUCT_ID 0xCA39 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Maple Computing +#define PRODUCT C39 +#define DESCRIPTION A compact 39 key keyboard + +/* key matrix size */ +#define MATRIX_ROWS 3 +#define MATRIX_COLS 13 + +#define MATRIX_ROW_PINS { D1, B4, B5 } +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, B6, D7, E6, C6, D2, D3 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* + * 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. + * + */ + +/* + * 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 diff --git a/keyboards/c39/info.json b/keyboards/c39/info.json new file mode 100755 index 0000000000..4ed7f018c8 --- /dev/null +++ b/keyboards/c39/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "C39", + "url": "", + "maintainer": "Space Cat", + "width": 13.25, + "height": 3, + "layouts": { + "LAYOUT": { + "layout": [{"label":"Q", "x":0, "y":0}, {"label":"W", "x":1, "y":0}, {"label":"E", "x":2, "y":0}, {"label":"R", "x":3, "y":0}, {"label":"T", "x":4, "y":0}, {"label":"Back", "x":5, "y":0}, {"label":"Y", "x":6, "y":0}, {"label":"U", "x":7, "y":0}, {"label":"I", "x":8, "y":0}, {"label":"O", "x":9, "y":0}, {"label":"P", "x":10, "y":0}, {"label":"M1", "x":11.25, "y":0}, {"label":"M2", "x":12.25, "y":0}, {"label":"A", "x":0, "y":1}, {"label":"S", "x":1, "y":1}, {"label":"D", "x":2, "y":1}, {"label":"F", "x":3, "y":1}, {"label":"G", "x":4, "y":1}, {"label":"Enter", "x":5, "y":1}, {"label":"H", "x":6, "y":1}, {"label":"J", "x":7, "y":1}, {"label":"K", "x":8, "y":1}, {"label":"L", "x":9, "y":1}, {"label":";", "x":10, "y":1}, {"label":"M3", "x":11.25, "y":1}, {"label":"M4", "x":12.25, "y":1}, {"label":"Z", "x":0, "y":2}, {"label":"X", "x":1, "y":2}, {"label":"C", "x":2, "y":2}, {"label":"V", "x":3, "y":2}, {"label":"B", "x":4, "y":2}, {"label":"Fn", "x":5, "y":2}, {"label":"N", "x":6, "y":2}, {"label":"M", "x":7, "y":2}, {"label":"<", "x":8, "y":2}, {"label":">", "x":9, "y":2}, {"label":"?", "x":10, "y":2}, {"label":"M5", "x":11.25, "y":2}, {"label":"M6", "x":12.25, "y":2}] + } + } +}
\ No newline at end of file diff --git a/keyboards/c39/keymaps/default/config.h b/keyboards/c39/keymaps/default/config.h new file mode 100755 index 0000000000..271f48d001 --- /dev/null +++ b/keyboards/c39/keymaps/default/config.h @@ -0,0 +1,3 @@ +#pragma once + +// place overrides here diff --git a/keyboards/c39/keymaps/default/keymap.c b/keyboards/c39/keymaps/default/keymap.c new file mode 100755 index 0000000000..9de75190d0 --- /dev/null +++ b/keyboards/c39/keymaps/default/keymap.c @@ -0,0 +1,45 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _FN1 1 + +// Defines for task manager and such +#define CALTDEL LCTL(LALT(KC_DEL)) +#define TSKMGR LCTL(LSFT(KC_ESC)) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,----------------------------------------------------------------------------. ,-------------. + * | Q | W | E | R | T | Bksp | Y | U | I | O | P | | M1 | M2 | + * |------+------+------+------+------+------+------+------+------+------+------+ |------+------| + * | A | S | D | F | G | Enter| H | J | K | L | ; | | M3 | M4 | + * |------+------+------+------+------+------+------+------+------+------+------+ |------+------| + * | Z | X | C | V | B | FN1 | N | M | , | . | / | | M5 | M6 | + * `----------------------------------------------------------------------------' `-------------' + */ +[_QWERTY] = LAYOUT( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_1, KC_2, + KC_A, KC_S, KC_D, KC_F, KC_G, MT(MOD_LSFT, KC_ENT), KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_3, KC_4, + KC_Z, KC_X, KC_C, KC_V, KC_B, LT(_FN1, KC_SPC), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_5, KC_6 +), + +/* FN1 + * ,----------------------------------------------------------------------------. ,-------------. + * | 1 | 2 | 3 | 4 | 5 | Bksp | 6 | 7 | 8 | 9 | 0 | | M1 | M2 | + * |------+------+------+------+------+------+------+------+------+------+------+ |------+------| + * | 4 | 5 | 6 | + | | Enter| | | | | | | M3 | M4 | + * |------+------+------+------+------+------+------+------+------+------+------+ |------+------| + * | 7 | 8 | 9 | 0 | | FN1 | | | | | | | M5 | M6 | + * `----------------------------------------------------------------------------' `-------------' + */ +[_FN1] = LAYOUT( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_BSPC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_1, KC_2, + KC_4, KC_5, KC_6, KC_PLUS, _______, KC_ENT, _______, _______, _______, _______, _______, KC_3, KC_4, + KC_7, KC_8, KC_9, KC_0, _______, _______, _______, _______, _______, _______, _______, KC_5, KC_6 +), +}; diff --git a/keyboards/c39/keymaps/default/readme.md b/keyboards/c39/keymaps/default/readme.md new file mode 100755 index 0000000000..f5b1b6ac11 --- /dev/null +++ b/keyboards/c39/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for the C39 diff --git a/keyboards/c39/readme.md b/keyboards/c39/readme.md new file mode 100755 index 0000000000..0454f1c12b --- /dev/null +++ b/keyboards/c39/readme.md @@ -0,0 +1,16 @@ +# C39 +======= + +![C39](https://i.imgur.com/KuWIIuW.png) + +A compact 39 key keyboard. + +Keyboard Maintainer: [Maple Computing]() +Hardware Supported: C39 PCB +Hardware Availability: [SpaceCat.design](https://spacecat.design) + +Make example for this keyboard (after setting up your build environment): + + make c39:default + +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/c39/rules.mk b/keyboards/c39/rules.mk new file mode 100755 index 0000000000..8fcb089817 --- /dev/null +++ b/keyboards/c39/rules.mk @@ -0,0 +1,66 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +RGBLIGHT_ENABLE = no # RGB Enable / Disable diff --git a/keyboards/candybar/keymaps/default/keymap.c b/keyboards/candybar/keymaps/default/keymap.c index bf589289a3..8f4cc08c74 100644 --- a/keyboards/candybar/keymaps/default/keymap.c +++ b/keyboards/candybar/keymaps/default/keymap.c @@ -14,7 +14,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "candybar.h" +#include QMK_KEYBOARD_H #define _BL 0 #define _FL 1 @@ -35,4 +35,4 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB,KC_A,KC_SLCK,KC_D,KC_F,KC_G,KC_H,KC_J,KC_K,KC_L,KC_QUOT,KC_BSLS,KC_P4,KC_P5,KC_P6,KC_VOLD, \ KC_LSFT,KC_Z,KC_X,KC_CAPS,KC_V,KC_B,KC_NLCK,KC_M,KC_COMM,KC_DOT,KC_SLSH,KC_PGUP,KC_P1,KC_P2,KC_P3,KC_PEQL, \ KC_LCTL,KC_LGUI,KC_LALT,KC_SPC,KC_SPC,KC_BSPC,KC_APP,MO(_FL),KC_HOME,KC_PGDN,KC_END,KC_P0,KC_PDOT,KC_PENT), -};
\ No newline at end of file +}; diff --git a/keyboards/cannonkeys/instant60/boards/ST_STM32F072B_DISCOVERY/board.c b/keyboards/cannonkeys/instant60/boards/ST_STM32F072B_DISCOVERY/board.c new file mode 100644 index 0000000000..9d10fbd754 --- /dev/null +++ b/keyboards/cannonkeys/instant60/boards/ST_STM32F072B_DISCOVERY/board.c @@ -0,0 +1,109 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * This file has been automatically generated using ChibiStudio board + * generator plugin. Do not edit manually. + */ + +#include "hal.h" + +#if HAL_USE_PAL || defined(__DOXYGEN__) +/** + * @brief PAL setup. + * @details Digital I/O ports static configuration as defined in @p board.h. + * This variable is used by the HAL when initializing the PAL driver. + */ +const PALConfig pal_default_config = { +#if STM32_HAS_GPIOA + {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, + VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, +#endif +#if STM32_HAS_GPIOB + {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, + VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, +#endif +#if STM32_HAS_GPIOC + {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, + VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, +#endif +#if STM32_HAS_GPIOD + {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, + VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, +#endif +#if STM32_HAS_GPIOE + {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, + VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, +#endif +#if STM32_HAS_GPIOF + {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, + VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH}, +#endif +#if STM32_HAS_GPIOG + {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, + VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH}, +#endif +#if STM32_HAS_GPIOH + {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, + VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH}, +#endif +#if STM32_HAS_GPIOI + {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, + VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH} +#endif +}; +#endif + +void enter_bootloader_mode_if_requested(void); + +/** + * @brief Early initialization code. + * @details This initialization must be performed just after stack setup + * and before any other initialization. + */ +void __early_init(void) { + enter_bootloader_mode_if_requested(); + stm32_clock_init(); +} + +#if HAL_USE_MMC_SPI || defined(__DOXYGEN__) +/** + * @brief MMC_SPI card detection. + */ +bool mmc_lld_is_card_inserted(MMCDriver *mmcp) { + + (void)mmcp; + /* TODO: Fill the implementation.*/ + return true; +} + +/** + * @brief MMC_SPI card write protection detection. + */ +bool mmc_lld_is_write_protected(MMCDriver *mmcp) { + + (void)mmcp; + /* TODO: Fill the implementation.*/ + return false; +} +#endif + +/** + * @brief Board-specific initialization code. + * @todo Add your board-specific code, if any. + */ +void boardInit(void) { +} diff --git a/keyboards/cannonkeys/instant60/boards/ST_STM32F072B_DISCOVERY/board.h b/keyboards/cannonkeys/instant60/boards/ST_STM32F072B_DISCOVERY/board.h new file mode 100644 index 0000000000..de3a93d1ce --- /dev/null +++ b/keyboards/cannonkeys/instant60/boards/ST_STM32F072B_DISCOVERY/board.h @@ -0,0 +1,922 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * This file has been automatically generated using ChibiStudio board + * generator plugin. Do not edit manually. + */ + +#ifndef BOARD_H +#define BOARD_H + +/* + * Setup for ST STM32F072B-Discovery board. + */ + +/* + * Board identifier. + */ +#define BOARD_ST_STM32F072B_DISCOVERY +#define BOARD_NAME "ST STM32F072B-Discovery" + +/* + * Board oscillators-related settings. + * NOTE: HSE not fitted. + */ +#if !defined(STM32_LSECLK) +#define STM32_LSECLK 32768 +#endif + +#define STM32_LSEDRV (3U << 3U) + +#if !defined(STM32_HSECLK) +#define STM32_HSECLK 0U +#endif + +#define STM32_HSE_BYPASS + +/* + * MCU type as defined in the ST header. + */ +#define STM32F072xB + +/* + * IO pins assignments. + */ +#define GPIOA_BUTTON 0U +#define GPIOA_PIN1 1U +#define GPIOA_PIN2 2U +#define GPIOA_PIN3 3U +#define GPIOA_PIN4 4U +#define GPIOA_PIN5 5U +#define GPIOA_PIN6 6U +#define GPIOA_PIN7 7U +#define GPIOA_PIN8 8U +#define GPIOA_PIN9 9U +#define GPIOA_PIN10 10U +#define GPIOA_USB_DM 11U +#define GPIOA_USB_DP 12U +#define GPIOA_SWDIO 13U +#define GPIOA_SWCLK 14U +#define GPIOA_PIN15 15U + +#define GPIOB_PIN0 0U +#define GPIOB_PIN1 1U +#define GPIOB_PIN2 2U +#define GPIOB_PIN3 3U +#define GPIOB_PIN4 4U +#define GPIOB_PIN5 5U +#define GPIOB_PIN6 6U +#define GPIOB_PIN7 7U +#define GPIOB_PIN8 8U +#define GPIOB_PIN9 9U +#define GPIOB_PIN10 10U +#define GPIOB_PIN11 11U +#define GPIOB_PIN12 12U +#define GPIOB_SPI2_SCK 13U +#define GPIOB_SPI2_MISO 14U +#define GPIOB_SPI2_MOSI 15U + +#define GPIOC_MEMS_CS 0U +#define GPIOC_PIN1 1U +#define GPIOC_PIN2 2U +#define GPIOC_PIN3 3U +#define GPIOC_PIN4 4U +#define GPIOC_PIN5 5U +#define GPIOC_LED_RED 6U +#define GPIOC_LED_BLUE 7U +#define GPIOC_LED_ORANGE 8U +#define GPIOC_LED_GREEN 9U +#define GPIOC_PIN10 10U +#define GPIOC_PIN11 11U +#define GPIOC_PIN12 12U +#define GPIOC_PIN13 13U +#define GPIOC_OSC32_IN 14U +#define GPIOC_OSC32_OUT 15U + +#define GPIOD_PIN0 0U +#define GPIOD_PIN1 1U +#define GPIOD_PIN2 2U +#define GPIOD_PIN3 3U +#define GPIOD_PIN4 4U +#define GPIOD_PIN5 5U +#define GPIOD_PIN6 6U +#define GPIOD_PIN7 7U +#define GPIOD_PIN8 8U +#define GPIOD_PIN9 9U +#define GPIOD_PIN10 10U +#define GPIOD_PIN11 11U +#define GPIOD_PIN12 12U +#define GPIOD_PIN13 13U +#define GPIOD_PIN14 14U +#define GPIOD_PIN15 15U + +#define GPIOE_PIN0 0U +#define GPIOE_PIN1 1U +#define GPIOE_PIN2 2U +#define GPIOE_PIN3 3U +#define GPIOE_PIN4 4U +#define GPIOE_PIN5 5U +#define GPIOE_PIN6 6U +#define GPIOE_PIN7 7U +#define GPIOE_PIN8 8U +#define GPIOE_PIN9 9U +#define GPIOE_PIN10 10U +#define GPIOE_PIN11 11U +#define GPIOE_PIN12 12U +#define GPIOE_PIN13 13U +#define GPIOE_PIN14 14U +#define GPIOE_PIN15 15U + +#define GPIOF_OSC_IN 0U +#define GPIOF_OSC_OUT 1U +#define GPIOF_PIN2 2U +#define GPIOF_PIN3 3U +#define GPIOF_PIN4 4U +#define GPIOF_PIN5 5U +#define GPIOF_PIN6 6U +#define GPIOF_PIN7 7U +#define GPIOF_PIN8 8U +#define GPIOF_PIN9 9U +#define GPIOF_PIN10 10U +#define GPIOF_PIN11 11U +#define GPIOF_PIN12 12U +#define GPIOF_PIN13 13U +#define GPIOF_PIN14 14U +#define GPIOF_PIN15 15U + +/* + * IO lines assignments. + */ +#define LINE_BUTTON PAL_LINE(GPIOA, 0U) +#define LINE_USB_DM PAL_LINE(GPIOA, 11U) +#define LINE_USB_DP PAL_LINE(GPIOA, 12U) +#define LINE_SWDIO PAL_LINE(GPIOA, 13U) +#define LINE_SWCLK PAL_LINE(GPIOA, 14U) + +#define LINE_SPI2_SCK PAL_LINE(GPIOB, 13U) +#define LINE_SPI2_MISO PAL_LINE(GPIOB, 14U) +#define LINE_SPI2_MOSI PAL_LINE(GPIOB, 15U) + +#define LINE_MEMS_CS PAL_LINE(GPIOC, 0U) +#define LINE_LED_RED PAL_LINE(GPIOC, 6U) +#define LINE_LED_BLUE PAL_LINE(GPIOC, 7U) +#define LINE_LED_ORANGE PAL_LINE(GPIOC, 8U) +#define LINE_LED_GREEN PAL_LINE(GPIOC, 9U) +#define LINE_OSC32_IN PAL_LINE(GPIOC, 14U) +#define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U) + + + +#define LINE_OSC_IN PAL_LINE(GPIOF, 0U) +#define LINE_OSC_OUT PAL_LINE(GPIOF, 1U) + +/* + * I/O ports initial setup, this configuration is established soon after reset + * in the initialization code. + * Please refer to the STM32 Reference Manual for details. + */ +#define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) +#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) +#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) +#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) +#define PIN_ODR_LOW(n) (0U << (n)) +#define PIN_ODR_HIGH(n) (1U << (n)) +#define PIN_OTYPE_PUSHPULL(n) (0U << (n)) +#define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) +#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) +#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) +#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) +#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) + +/* + * GPIOA setup: + * + * PA0 - BUTTON (input floating). + * PA1 - PIN1 (input pullup). + * PA2 - PIN2 (input pullup). + * PA3 - PIN3 (input pullup). + * PA4 - PIN4 (input pullup). + * PA5 - PIN5 (input pullup). + * PA6 - PIN6 (input pullup). + * PA7 - PIN7 (input pullup). + * PA8 - PIN8 (input pullup). + * PA9 - PIN9 (input pullup). + * PA10 - PIN10 (input pullup). + * PA11 - USB_DM (input floating). + * PA12 - USB_DP (input floating). + * PA13 - SWDIO (alternate 0). + * PA14 - SWCLK (alternate 0). + * PA15 - PIN15 (input pullup). + */ +#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_BUTTON) | \ + PIN_MODE_INPUT(GPIOA_PIN1) | \ + PIN_MODE_INPUT(GPIOA_PIN2) | \ + PIN_MODE_INPUT(GPIOA_PIN3) | \ + PIN_MODE_INPUT(GPIOA_PIN4) | \ + PIN_MODE_INPUT(GPIOA_PIN5) | \ + PIN_MODE_INPUT(GPIOA_PIN6) | \ + PIN_MODE_INPUT(GPIOA_PIN7) | \ + PIN_MODE_INPUT(GPIOA_PIN8) | \ + PIN_MODE_INPUT(GPIOA_PIN9) | \ + PIN_MODE_INPUT(GPIOA_PIN10) | \ + PIN_MODE_INPUT(GPIOA_USB_DM) | \ + PIN_MODE_INPUT(GPIOA_USB_DP) | \ + PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ + PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ + PIN_MODE_INPUT(GPIOA_PIN15)) +#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_BUTTON) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \ + PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \ + PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ + PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_BUTTON) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOA_USB_DM) | \ + PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \ + PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ + PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ + PIN_OSPEED_HIGH(GPIOA_PIN15)) +#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ + PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \ + PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \ + PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \ + PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN15)) +#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_BUTTON) | \ + PIN_ODR_HIGH(GPIOA_PIN1) | \ + PIN_ODR_HIGH(GPIOA_PIN2) | \ + PIN_ODR_HIGH(GPIOA_PIN3) | \ + PIN_ODR_HIGH(GPIOA_PIN4) | \ + PIN_ODR_HIGH(GPIOA_PIN5) | \ + PIN_ODR_HIGH(GPIOA_PIN6) | \ + PIN_ODR_HIGH(GPIOA_PIN7) | \ + PIN_ODR_HIGH(GPIOA_PIN8) | \ + PIN_ODR_HIGH(GPIOA_PIN9) | \ + PIN_ODR_HIGH(GPIOA_PIN10) | \ + PIN_ODR_HIGH(GPIOA_USB_DM) | \ + PIN_ODR_HIGH(GPIOA_USB_DP) | \ + PIN_ODR_HIGH(GPIOA_SWDIO) | \ + PIN_ODR_HIGH(GPIOA_SWCLK) | \ + PIN_ODR_HIGH(GPIOA_PIN15)) +#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_BUTTON, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN7, 0U)) +#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOA_USB_DM, 0U) | \ + PIN_AFIO_AF(GPIOA_USB_DP, 0U) | \ + PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \ + PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN15, 0U)) + +/* + * GPIOB setup: + * + * PB0 - PIN0 (input pullup). + * PB1 - PIN1 (input pullup). + * PB2 - PIN2 (input pullup). + * PB3 - PIN3 (input pullup). + * PB4 - PIN4 (input pullup). + * PB5 - PIN5 (input pullup). + * PB6 - PIN6 (input pullup). + * PB7 - PIN7 (input pullup). + * PB8 - PIN8 (input pullup). + * PB9 - PIN9 (input pullup). + * PB10 - PIN10 (input pullup). + * PB11 - PIN11 (input pullup). + * PB12 - PIN12 (input pullup). + * PB13 - SPI2_SCK (alternate 0). + * PB14 - SPI2_MISO (alternate 0). + * PB15 - SPI2_MOSI (alternate 0). + */ +#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ + PIN_MODE_INPUT(GPIOB_PIN1) | \ + PIN_MODE_INPUT(GPIOB_PIN2) | \ + PIN_MODE_INPUT(GPIOB_PIN3) | \ + PIN_MODE_INPUT(GPIOB_PIN4) | \ + PIN_MODE_INPUT(GPIOB_PIN5) | \ + PIN_MODE_INPUT(GPIOB_PIN6) | \ + PIN_MODE_INPUT(GPIOB_PIN7) | \ + PIN_MODE_INPUT(GPIOB_PIN8) | \ + PIN_MODE_INPUT(GPIOB_PIN9) | \ + PIN_MODE_INPUT(GPIOB_PIN10) | \ + PIN_MODE_INPUT(GPIOB_PIN11) | \ + PIN_MODE_INPUT(GPIOB_PIN12) | \ + PIN_MODE_ALTERNATE(GPIOB_SPI2_SCK) | \ + PIN_MODE_ALTERNATE(GPIOB_SPI2_MISO) | \ + PIN_MODE_ALTERNATE(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOB_SPI2_SCK) | \ + PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MISO) | \ + PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \ + PIN_OSPEED_HIGH(GPIOB_PIN2) | \ + PIN_OSPEED_HIGH(GPIOB_PIN3) | \ + PIN_OSPEED_HIGH(GPIOB_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOB_SPI2_SCK) | \ + PIN_OSPEED_VERYLOW(GPIOB_SPI2_MISO) | \ + PIN_OSPEED_VERYLOW(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ + PIN_PUPDR_FLOATING(GPIOB_SPI2_SCK) | \ + PIN_PUPDR_FLOATING(GPIOB_SPI2_MISO) | \ + PIN_PUPDR_FLOATING(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ + PIN_ODR_HIGH(GPIOB_PIN1) | \ + PIN_ODR_HIGH(GPIOB_PIN2) | \ + PIN_ODR_HIGH(GPIOB_PIN3) | \ + PIN_ODR_HIGH(GPIOB_PIN4) | \ + PIN_ODR_HIGH(GPIOB_PIN5) | \ + PIN_ODR_HIGH(GPIOB_PIN6) | \ + PIN_ODR_HIGH(GPIOB_PIN7) | \ + PIN_ODR_HIGH(GPIOB_PIN8) | \ + PIN_ODR_HIGH(GPIOB_PIN9) | \ + PIN_ODR_HIGH(GPIOB_PIN10) | \ + PIN_ODR_HIGH(GPIOB_PIN11) | \ + PIN_ODR_HIGH(GPIOB_PIN12) | \ + PIN_ODR_HIGH(GPIOB_SPI2_SCK) | \ + PIN_ODR_HIGH(GPIOB_SPI2_MISO) | \ + PIN_ODR_HIGH(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN7, 0U)) +#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOB_SPI2_SCK, 0U) | \ + PIN_AFIO_AF(GPIOB_SPI2_MISO, 0U) | \ + PIN_AFIO_AF(GPIOB_SPI2_MOSI, 0U)) + +/* + * GPIOC setup: + * + * PC0 - MEMS_CS (output pushpull maximum). + * PC1 - PIN1 (input pullup). + * PC2 - PIN2 (input pullup). + * PC3 - PIN3 (input pullup). + * PC4 - PIN4 (input pullup). + * PC5 - PIN5 (input pullup). + * PC6 - LED_RED (output pushpull maximum). + * PC7 - LED_BLUE (output pushpull maximum). + * PC8 - LED_ORANGE (output pushpull maximum). + * PC9 - LED_GREEN (output pushpull maximum). + * PC10 - PIN10 (input pullup). + * PC11 - PIN11 (input pullup). + * PC12 - PIN12 (input pullup). + * PC13 - PIN13 (input pullup). + * PC14 - OSC32_IN (input floating). + * PC15 - OSC32_OUT (input floating). + */ +#define VAL_GPIOC_MODER (PIN_MODE_OUTPUT(GPIOC_MEMS_CS) | \ + PIN_MODE_INPUT(GPIOC_PIN1) | \ + PIN_MODE_INPUT(GPIOC_PIN2) | \ + PIN_MODE_INPUT(GPIOC_PIN3) | \ + PIN_MODE_INPUT(GPIOC_PIN4) | \ + PIN_MODE_INPUT(GPIOC_PIN5) | \ + PIN_MODE_OUTPUT(GPIOC_LED_RED) | \ + PIN_MODE_OUTPUT(GPIOC_LED_BLUE) | \ + PIN_MODE_OUTPUT(GPIOC_LED_ORANGE) | \ + PIN_MODE_OUTPUT(GPIOC_LED_GREEN) | \ + PIN_MODE_INPUT(GPIOC_PIN10) | \ + PIN_MODE_INPUT(GPIOC_PIN11) | \ + PIN_MODE_INPUT(GPIOC_PIN12) | \ + PIN_MODE_INPUT(GPIOC_PIN13) | \ + PIN_MODE_INPUT(GPIOC_OSC32_IN) | \ + PIN_MODE_INPUT(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_MEMS_CS) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOC_LED_RED) | \ + PIN_OTYPE_PUSHPULL(GPIOC_LED_BLUE) | \ + PIN_OTYPE_PUSHPULL(GPIOC_LED_ORANGE) | \ + PIN_OTYPE_PUSHPULL(GPIOC_LED_GREEN) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \ + PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_MEMS_CS) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \ + PIN_OSPEED_HIGH(GPIOC_LED_RED) | \ + PIN_OSPEED_HIGH(GPIOC_LED_BLUE) | \ + PIN_OSPEED_HIGH(GPIOC_LED_ORANGE) | \ + PIN_OSPEED_HIGH(GPIOC_LED_GREEN) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_MEMS_CS) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ + PIN_PUPDR_FLOATING(GPIOC_LED_RED) | \ + PIN_PUPDR_FLOATING(GPIOC_LED_BLUE) | \ + PIN_PUPDR_FLOATING(GPIOC_LED_ORANGE) | \ + PIN_PUPDR_FLOATING(GPIOC_LED_GREEN) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ + PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \ + PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_MEMS_CS) | \ + PIN_ODR_HIGH(GPIOC_PIN1) | \ + PIN_ODR_HIGH(GPIOC_PIN2) | \ + PIN_ODR_HIGH(GPIOC_PIN3) | \ + PIN_ODR_HIGH(GPIOC_PIN4) | \ + PIN_ODR_HIGH(GPIOC_PIN5) | \ + PIN_ODR_LOW(GPIOC_LED_RED) | \ + PIN_ODR_LOW(GPIOC_LED_BLUE) | \ + PIN_ODR_LOW(GPIOC_LED_ORANGE) | \ + PIN_ODR_LOW(GPIOC_LED_GREEN) | \ + PIN_ODR_HIGH(GPIOC_PIN10) | \ + PIN_ODR_HIGH(GPIOC_PIN11) | \ + PIN_ODR_HIGH(GPIOC_PIN12) | \ + PIN_ODR_HIGH(GPIOC_PIN13) | \ + PIN_ODR_HIGH(GPIOC_OSC32_IN) | \ + PIN_ODR_HIGH(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_MEMS_CS, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOC_LED_RED, 0U) | \ + PIN_AFIO_AF(GPIOC_LED_BLUE, 0U)) +#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_LED_ORANGE, 0U) | \ + PIN_AFIO_AF(GPIOC_LED_GREEN, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOC_OSC32_IN, 0U) | \ + PIN_AFIO_AF(GPIOC_OSC32_OUT, 0U)) + +/* + * GPIOD setup: + * + * PD0 - PIN0 (input pullup). + * PD1 - PIN1 (input pullup). + * PD2 - PIN2 (input pullup). + * PD3 - PIN3 (input pullup). + * PD4 - PIN4 (input pullup). + * PD5 - PIN5 (input pullup). + * PD6 - PIN6 (input pullup). + * PD7 - PIN7 (input pullup). + * PD8 - PIN8 (input pullup). + * PD9 - PIN9 (input pullup). + * PD10 - PIN10 (input pullup). + * PD11 - PIN11 (input pullup). + * PD12 - PIN12 (input pullup). + * PD13 - PIN13 (input pullup). + * PD14 - PIN14 (input pullup). + * PD15 - PIN15 (input pullup). + */ +#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ + PIN_MODE_INPUT(GPIOD_PIN1) | \ + PIN_MODE_INPUT(GPIOD_PIN2) | \ + PIN_MODE_INPUT(GPIOD_PIN3) | \ + PIN_MODE_INPUT(GPIOD_PIN4) | \ + PIN_MODE_INPUT(GPIOD_PIN5) | \ + PIN_MODE_INPUT(GPIOD_PIN6) | \ + PIN_MODE_INPUT(GPIOD_PIN7) | \ + PIN_MODE_INPUT(GPIOD_PIN8) | \ + PIN_MODE_INPUT(GPIOD_PIN9) | \ + PIN_MODE_INPUT(GPIOD_PIN10) | \ + PIN_MODE_INPUT(GPIOD_PIN11) | \ + PIN_MODE_INPUT(GPIOD_PIN12) | \ + PIN_MODE_INPUT(GPIOD_PIN13) | \ + PIN_MODE_INPUT(GPIOD_PIN14) | \ + PIN_MODE_INPUT(GPIOD_PIN15)) +#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN15)) +#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN15)) +#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ + PIN_ODR_HIGH(GPIOD_PIN1) | \ + PIN_ODR_HIGH(GPIOD_PIN2) | \ + PIN_ODR_HIGH(GPIOD_PIN3) | \ + PIN_ODR_HIGH(GPIOD_PIN4) | \ + PIN_ODR_HIGH(GPIOD_PIN5) | \ + PIN_ODR_HIGH(GPIOD_PIN6) | \ + PIN_ODR_HIGH(GPIOD_PIN7) | \ + PIN_ODR_HIGH(GPIOD_PIN8) | \ + PIN_ODR_HIGH(GPIOD_PIN9) | \ + PIN_ODR_HIGH(GPIOD_PIN10) | \ + PIN_ODR_HIGH(GPIOD_PIN11) | \ + PIN_ODR_HIGH(GPIOD_PIN12) | \ + PIN_ODR_HIGH(GPIOD_PIN13) | \ + PIN_ODR_HIGH(GPIOD_PIN14) | \ + PIN_ODR_HIGH(GPIOD_PIN15)) +#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN7, 0U)) +#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN15, 0U)) + +/* + * GPIOE setup: + * + * PE0 - PIN0 (input pullup). + * PE1 - PIN1 (input pullup). + * PE2 - PIN2 (input pullup). + * PE3 - PIN3 (input pullup). + * PE4 - PIN4 (input pullup). + * PE5 - PIN5 (input pullup). + * PE6 - PIN6 (input pullup). + * PE7 - PIN7 (input pullup). + * PE8 - PIN8 (input pullup). + * PE9 - PIN9 (input pullup). + * PE10 - PIN10 (input pullup). + * PE11 - PIN11 (input pullup). + * PE12 - PIN12 (input pullup). + * PE13 - PIN13 (input pullup). + * PE14 - PIN14 (input pullup). + * PE15 - PIN15 (input pullup). + */ +#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \ + PIN_MODE_INPUT(GPIOE_PIN1) | \ + PIN_MODE_INPUT(GPIOE_PIN2) | \ + PIN_MODE_INPUT(GPIOE_PIN3) | \ + PIN_MODE_INPUT(GPIOE_PIN4) | \ + PIN_MODE_INPUT(GPIOE_PIN5) | \ + PIN_MODE_INPUT(GPIOE_PIN6) | \ + PIN_MODE_INPUT(GPIOE_PIN7) | \ + PIN_MODE_INPUT(GPIOE_PIN8) | \ + PIN_MODE_INPUT(GPIOE_PIN9) | \ + PIN_MODE_INPUT(GPIOE_PIN10) | \ + PIN_MODE_INPUT(GPIOE_PIN11) | \ + PIN_MODE_INPUT(GPIOE_PIN12) | \ + PIN_MODE_INPUT(GPIOE_PIN13) | \ + PIN_MODE_INPUT(GPIOE_PIN14) | \ + PIN_MODE_INPUT(GPIOE_PIN15)) +#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN15)) +#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN15)) +#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ + PIN_ODR_HIGH(GPIOE_PIN1) | \ + PIN_ODR_HIGH(GPIOE_PIN2) | \ + PIN_ODR_HIGH(GPIOE_PIN3) | \ + PIN_ODR_HIGH(GPIOE_PIN4) | \ + PIN_ODR_HIGH(GPIOE_PIN5) | \ + PIN_ODR_HIGH(GPIOE_PIN6) | \ + PIN_ODR_HIGH(GPIOE_PIN7) | \ + PIN_ODR_HIGH(GPIOE_PIN8) | \ + PIN_ODR_HIGH(GPIOE_PIN9) | \ + PIN_ODR_HIGH(GPIOE_PIN10) | \ + PIN_ODR_HIGH(GPIOE_PIN11) | \ + PIN_ODR_HIGH(GPIOE_PIN12) | \ + PIN_ODR_HIGH(GPIOE_PIN13) | \ + PIN_ODR_HIGH(GPIOE_PIN14) | \ + PIN_ODR_HIGH(GPIOE_PIN15)) +#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN7, 0U)) +#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN15, 0U)) + +/* + * GPIOF setup: + * + * PF0 - OSC_IN (input floating). + * PF1 - OSC_OUT (input floating). + * PF2 - PIN2 (input pullup). + * PF3 - PIN3 (input pullup). + * PF4 - PIN4 (input pullup). + * PF5 - PIN5 (input pullup). + * PF6 - PIN6 (input pullup). + * PF7 - PIN7 (input pullup). + * PF8 - PIN8 (input pullup). + * PF9 - PIN9 (input pullup). + * PF10 - PIN10 (input pullup). + * PF11 - PIN11 (input pullup). + * PF12 - PIN12 (input pullup). + * PF13 - PIN13 (input pullup). + * PF14 - PIN14 (input pullup). + * PF15 - PIN15 (input pullup). + */ +#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_OSC_IN) | \ + PIN_MODE_INPUT(GPIOF_OSC_OUT) | \ + PIN_MODE_INPUT(GPIOF_PIN2) | \ + PIN_MODE_INPUT(GPIOF_PIN3) | \ + PIN_MODE_INPUT(GPIOF_PIN4) | \ + PIN_MODE_INPUT(GPIOF_PIN5) | \ + PIN_MODE_INPUT(GPIOF_PIN6) | \ + PIN_MODE_INPUT(GPIOF_PIN7) | \ + PIN_MODE_INPUT(GPIOF_PIN8) | \ + PIN_MODE_INPUT(GPIOF_PIN9) | \ + PIN_MODE_INPUT(GPIOF_PIN10) | \ + PIN_MODE_INPUT(GPIOF_PIN11) | \ + PIN_MODE_INPUT(GPIOF_PIN12) | \ + PIN_MODE_INPUT(GPIOF_PIN13) | \ + PIN_MODE_INPUT(GPIOF_PIN14) | \ + PIN_MODE_INPUT(GPIOF_PIN15)) +#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_OSC_IN) | \ + PIN_OTYPE_PUSHPULL(GPIOF_OSC_OUT) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_OSC_IN) | \ + PIN_OSPEED_VERYLOW(GPIOF_OSC_OUT) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN15)) +#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \ + PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN15)) +#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_OSC_IN) | \ + PIN_ODR_HIGH(GPIOF_OSC_OUT) | \ + PIN_ODR_HIGH(GPIOF_PIN2) | \ + PIN_ODR_HIGH(GPIOF_PIN3) | \ + PIN_ODR_HIGH(GPIOF_PIN4) | \ + PIN_ODR_HIGH(GPIOF_PIN5) | \ + PIN_ODR_HIGH(GPIOF_PIN6) | \ + PIN_ODR_HIGH(GPIOF_PIN7) | \ + PIN_ODR_HIGH(GPIOF_PIN8) | \ + PIN_ODR_HIGH(GPIOF_PIN9) | \ + PIN_ODR_HIGH(GPIOF_PIN10) | \ + PIN_ODR_HIGH(GPIOF_PIN11) | \ + PIN_ODR_HIGH(GPIOF_PIN12) | \ + PIN_ODR_HIGH(GPIOF_PIN13) | \ + PIN_ODR_HIGH(GPIOF_PIN14) | \ + PIN_ODR_HIGH(GPIOF_PIN15)) +#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_OSC_IN, 0U) | \ + PIN_AFIO_AF(GPIOF_OSC_OUT, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN7, 0U)) +#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN15, 0U)) + + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* BOARD_H */ diff --git a/keyboards/cannonkeys/instant60/boards/ST_STM32F072B_DISCOVERY/board.mk b/keyboards/cannonkeys/instant60/boards/ST_STM32F072B_DISCOVERY/board.mk new file mode 100644 index 0000000000..b98dcdd26c --- /dev/null +++ b/keyboards/cannonkeys/instant60/boards/ST_STM32F072B_DISCOVERY/board.mk @@ -0,0 +1,5 @@ +# List of all the board related files. +BOARDSRC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY/board.c + +# Required include directories +BOARDINC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY diff --git a/keyboards/cannonkeys/instant60/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg b/keyboards/cannonkeys/instant60/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg new file mode 100644 index 0000000000..9c7cf4fd76 --- /dev/null +++ b/keyboards/cannonkeys/instant60/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg @@ -0,0 +1,703 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- STM32F0xx board Template --> +<board + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="http://www.chibios.org/xml/schema/boards/stm32f0xx_board.xsd"> + <configuration_settings> + <templates_path>resources/gencfg/processors/boards/stm32f0xx/templates</templates_path> + <output_path>..</output_path> + <hal_version>3.0.x</hal_version> + </configuration_settings> + <board_name>ST STM32F072B-Discovery</board_name> + <board_id>ST_STM32F072B_DISCOVERY</board_id> + <board_functions></board_functions> + <subtype>STM32F072xB</subtype> + <clocks HSEFrequency="0" HSEBypass="true" LSEFrequency="0" + LSEBypass="false" LSEDrive="3 High Drive (default)" /> + <ports> + <GPIOA> + <pin0 + ID="BUTTON" + Type="PushPull" + Speed="Minimum" + Resistor="Floating" + Level="High" + Mode="Input" + Alternate="0" /> + <pin1 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin2 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin3 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin4 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin5 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin6 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin7 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin8 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin9 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin10 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin11 + ID="USB_DM" + Type="PushPull" + Speed="Minimum" + Resistor="Floating" + Level="High" + Mode="Input" + Alternate="0" /> + <pin12 + ID="USB_DP" + Type="PushPull" + Speed="Minimum" + Resistor="Floating" + Level="High" + Mode="Input" + Alternate="0" /> + <pin13 + ID="SWDIO" + Type="PushPull" + Speed="Maximum" + Resistor="PullUp" + Level="High" + Mode="Alternate" + Alternate="0" /> + <pin14 + ID="SWCLK" + Type="PushPull" + Speed="Maximum" + Resistor="PullDown" + Level="High" + Mode="Alternate" + Alternate="0" /> + <pin15 + ID="" + Type="PushPull" + Speed="Maximum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + </GPIOA> + <GPIOB> + <pin0 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin1 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin2 + ID="" + Type="PushPull" + Speed="Maximum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin3 + ID="" + Type="PushPull" + Speed="Maximum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin4 + ID="" + Type="PushPull" + Speed="Maximum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin5 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin6 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin7 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin8 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin9 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin10 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin11 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin12 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin13 + ID="SPI2_SCK" + Type="PushPull" + Speed="Minimum" + Resistor="Floating" + Level="High" + Mode="Alternate" + Alternate="0" /> + <pin14 + ID="SPI2_MISO" + Type="PushPull" + Speed="Minimum" + Resistor="Floating" + Level="High" + Mode="Alternate" + Alternate="0" /> + <pin15 + ID="SPI2_MOSI" + Type="PushPull" + Speed="Minimum" + Resistor="Floating" + Level="High" + Mode="Alternate" + Alternate="0" /> + </GPIOB> + <GPIOC> + <pin0 + ID="MEMS_CS" + Type="PushPull" + Speed="Maximum" + Resistor="Floating" + Level="High" + Mode="Output" + Alternate="0" /> + <pin1 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin2 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin3 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin4 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin5 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin6 + ID="LED_RED" + Type="PushPull" + Speed="Maximum" + Resistor="Floating" + Level="Low" + Mode="Output" + Alternate="0" /> + <pin7 + ID="LED_BLUE" + Type="PushPull" + Speed="Maximum" + Resistor="Floating" + Level="Low" + Mode="Output" + Alternate="0" /> + <pin8 + ID="LED_ORANGE" + Type="PushPull" + Speed="Maximum" + Resistor="Floating" + Level="Low" + Mode="Output" + Alternate="0" ></pin8> + <pin9 + ID="LED_GREEN" + Type="PushPull" + Speed="Maximum" + Resistor="Floating" + Level="Low" + Mode="Output" + Alternate="0" /> + <pin10 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin11 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin12 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin13 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin14 + ID="OSC32_IN" + Type="PushPull" + Speed="Maximum" + Resistor="Floating" + Level="High" + Mode="Input" + Alternate="0" /> + <pin15 + ID="OSC32_OUT" + Type="PushPull" + Speed="Maximum" + Resistor="Floating" + Level="High" + Mode="Input" + Alternate="0" /> + </GPIOC> + <GPIOD> + <pin0 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin1 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin2 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin3 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin4 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin5 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin6 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin7 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin8 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin9 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin10 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin11 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin12 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin13 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin14 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin15 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + </GPIOD> + <GPIOE> + <pin0 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" + Level="High" Mode="Input" Alternate="0" /> + <pin1 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" + Level="High" Mode="Input" Alternate="0" /> + <pin2 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" + Level="High" Mode="Input" Alternate="0" /> + <pin3 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" + Level="High" Mode="Input" Alternate="0" /> + <pin4 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" + Level="High" Mode="Input" Alternate="0" /> + <pin5 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" + Level="High" Mode="Input" Alternate="0" /> + <pin6 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" + Level="High" Mode="Input" Alternate="0" /> + <pin7 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" + Level="High" Mode="Input" Alternate="0" /> + <pin8 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" + Level="High" Mode="Input" Alternate="0" /> + <pin9 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" + Level="High" Mode="Input" Alternate="0" /> + <pin10 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" + Level="High" Mode="Input" Alternate="0" /> + <pin11 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" + Level="High" Mode="Input" Alternate="0" /> + <pin12 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" + Level="High" Mode="Input" Alternate="0" /> + <pin13 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" + Level="High" Mode="Input" Alternate="0" /> + <pin14 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" + Level="High" Mode="Input" Alternate="0" /> + <pin15 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" + Level="High" Mode="Input" Alternate="0" /> + </GPIOE> + <GPIOF> + <pin0 + ID="OSC_IN" + Type="PushPull" + Speed="Minimum" + Resistor="Floating" + Level="High" + Mode="Input" + Alternate="0" /> + <pin1 + ID="OSC_OUT" + Type="PushPull" + Speed="Minimum" + Resistor="Floating" + Level="High" + Mode="Input" + Alternate="0" /> + <pin2 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin3 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin4 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin5 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin6 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin7 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin8 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin9 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin10 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin11 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin12 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin13 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin14 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + <pin15 + ID="" + Type="PushPull" + Speed="Minimum" + Resistor="PullUp" + Level="High" + Mode="Input" + Alternate="0" /> + </GPIOF> + </ports> +</board> diff --git a/keyboards/cannonkeys/instant60/bootloader_defs.h b/keyboards/cannonkeys/instant60/bootloader_defs.h new file mode 100644 index 0000000000..02c48c4e6d --- /dev/null +++ b/keyboards/cannonkeys/instant60/bootloader_defs.h @@ -0,0 +1,7 @@ +/* Address for jumping to bootloader on STM32 chips. */ +/* It is chip dependent, the correct number can be looked up here (page 175): + * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf + * This also requires a patch to chibios: + * <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch + */ +#define STM32_BOOTLOADER_ADDRESS 0x1FFFC800 diff --git a/keyboards/cannonkeys/instant60/chconf.h b/keyboards/cannonkeys/instant60/chconf.h new file mode 100644 index 0000000000..99fa8ce398 --- /dev/null +++ b/keyboards/cannonkeys/instant60/chconf.h @@ -0,0 +1,524 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 10000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 2 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 0 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/* Use __WFI in the idle thread for waiting. Does lower the power + * consumption. */ +#define CORTEX_ENABLE_WFI_IDLE TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM FALSE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY FALSE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE FALSE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP FALSE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS FALSE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK FALSE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/cannonkeys/instant60/config.h b/keyboards/cannonkeys/instant60/config.h new file mode 100644 index 0000000000..d7554c172f --- /dev/null +++ b/keyboards/cannonkeys/instant60/config.h @@ -0,0 +1,92 @@ +/* +Copyright 2015 Jun Wako <wakojun@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 + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCA04 +#define PRODUCT_ID 0x1600 +#define DEVICE_VER 0x0001 +/* in python2: list(u"whatever".encode('utf-16-le')) */ +/* at most 32 characters or the ugly hack in usb_main.c borks */ +#define MANUFACTURER CannonKeys +#define PRODUCT Instant60 +#define DESCRIPTION Instant 60 Keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +#define MATRIX_COL_PINS { B2, B10, B11, A9, A15, B3, B4, B5, B6, B7, B8, B9, C13, C14, C15 } +#define MATRIX_ROW_PINS { B1, B0, A7, A5, A4 } +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_LEVELS 6 +#define BACKLIGHT_BREATHING +#define BREATHING_PERIOD 6 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* 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 RGBLIGHT_ANIMATIONS + +#define WS2812_LED_N 14 +#define RGBLED_NUM WS2812_LED_N +#define PORT_WS2812 GPIOB +#define PIN_WS2812 15 +#define WS2812_SPI SPID2 + + +// EEPROM usage +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x01 +#define EEPROM_VERSION_ADDR 34 + +#define EEPROM_CUSTOM_BACKLIGHT 804 + + + +/* + * 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 diff --git a/keyboards/cannonkeys/instant60/halconf.h b/keyboards/cannonkeys/instant60/halconf.h new file mode 100644 index 0000000000..38743e0904 --- /dev/null +++ b/keyboards/cannonkeys/instant60/halconf.h @@ -0,0 +1,354 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC FALSE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C TRUE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM TRUE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI TRUE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 1 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/keyboards/cannonkeys/instant60/instant60.c b/keyboards/cannonkeys/instant60/instant60.c new file mode 100644 index 0000000000..25b7099b0b --- /dev/null +++ b/keyboards/cannonkeys/instant60/instant60.c @@ -0,0 +1 @@ +#include "instant60.h" diff --git a/keyboards/cannonkeys/instant60/instant60.h b/keyboards/cannonkeys/instant60/instant60.h new file mode 100644 index 0000000000..67d5ba98fe --- /dev/null +++ b/keyboards/cannonkeys/instant60/instant60.h @@ -0,0 +1,47 @@ +#pragma once + +#include "quantum.h" + +#define KNO KC_NO + +#define LAYOUT_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2E, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, \ + K40, K41, K42, K45, K49, K4A, K4B, K4E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, KNO}, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, KNO, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KNO, KNO, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KNO, KNO, KNO }, \ + { K40, K41, K42, KNO, KNO, K45, KNO, KNO, KNO, K49, K4A, K4B, KNO, KNO, K4E } \ +} + +#define LAYOUT_tsangan( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2E, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3E,\ + K40, K41, K42, K45, K49, K4B, K4E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E}, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, KNO, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KNO, KNO, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KNO, KNO, K3E }, \ + { K40, K41, K42, KNO, KNO, K45, KNO, KNO, KNO, K49, KNO, K4B, KNO, KNO, K4E } \ +} + +#define LAYOUT_all( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E,\ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2E, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3E,\ + K40, K41, K42, K45, K49, K4A, K4B, K4E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E}, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, KNO, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KNO, KNO, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KNO, KNO, K3E }, \ + { K40, K41, K42, KNO, KNO, K45, KNO, KNO, KNO, K49, K4A, K4B, KNO, KNO, K4E } \ +} diff --git a/keyboards/cannonkeys/instant60/keymaps/default/keymap.c b/keyboards/cannonkeys/instant60/keymaps/default/keymap.c new file mode 100644 index 0000000000..7753181a48 --- /dev/null +++ b/keyboards/cannonkeys/instant60/keymaps/default/keymap.c @@ -0,0 +1,48 @@ +/* +Copyright 2012,2013 Jun Wako <wakojun@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 QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BASE 0 +#define _FN1 1 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_ansi( + KC_GESC, 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_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_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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FN1), KC_RCTL + ), + + [_FN1] = LAYOUT_ansi( + KC_GESC, 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_DEL, \ + RGB_TOG, RGB_MOD, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + BL_BRTG, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + BL_INC, BL_DEC, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_GRV, _______, _______, _______, _______, _______, _______, RESET + ) +}; diff --git a/keyboards/cannonkeys/instant60/keymaps/tsangan/keymap.c b/keyboards/cannonkeys/instant60/keymaps/tsangan/keymap.c new file mode 100644 index 0000000000..e95ac1b693 --- /dev/null +++ b/keyboards/cannonkeys/instant60/keymaps/tsangan/keymap.c @@ -0,0 +1,48 @@ +/* +Copyright 2012,2013 Jun Wako <wakojun@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 QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BASE 0 +#define _FN1 1 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_tsangan( + KC_GESC, 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_DEL, \ + 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_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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FN1),\ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL + ), + + [_FN1] = LAYOUT_tsangan( + KC_GESC, 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_DEL, _______,\ + RGB_TOG, RGB_MOD, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + BL_BRTG, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + BL_INC, BL_DEC, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ + KC_GRV, _______, _______, _______, _______, _______, RESET + ) +}; diff --git a/keyboards/cannonkeys/instant60/mcuconf.h b/keyboards/cannonkeys/instant60/mcuconf.h new file mode 100644 index 0000000000..048eb4df65 --- /dev/null +++ b/keyboards/cannonkeys/instant60/mcuconf.h @@ -0,0 +1,176 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _MCUCONF_H_ +#define _MCUCONF_H_ + +/* + * STM32F0xx drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 3...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +#define STM32F0xx_MCUCONF +// #define STM32F070xB + +/* + * HAL driver system settings. + */ +#define STM32_NO_INIT FALSE +#define STM32_PVD_ENABLE FALSE +#define STM32_PLS STM32_PLS_LEV0 +#define STM32_HSI_ENABLED TRUE +#define STM32_HSI14_ENABLED TRUE +#define STM32_HSI48_ENABLED FALSE +#define STM32_LSI_ENABLED TRUE +#define STM32_HSE_ENABLED FALSE +#define STM32_LSE_ENABLED FALSE +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSI_DIV2 +#define STM32_PREDIV_VALUE 1 +#define STM32_PLLMUL_VALUE 12 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE STM32_PPRE_DIV1 +#define STM32_ADCSW STM32_ADCSW_HSI14 +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_ADCSW STM32_ADCSW_HSI14 +#define STM32_USBSW STM32_USBSW_HSI48 +#define STM32_CECSW STM32_CECSW_HSI +#define STM32_I2C1SW STM32_I2C1SW_HSI +#define STM32_USART1SW STM32_USART1SW_PCLK +#define STM32_RTCSEL STM32_RTCSEL_LSI + +/* + * ADC driver system settings. + */ +#define STM32_ADC_USE_ADC1 FALSE +#define STM32_ADC_ADC1_DMA_PRIORITY 2 +#define STM32_ADC_IRQ_PRIORITY 2 +#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 2 + +/* + * EXT driver system settings. + */ +#define STM32_EXT_EXTI0_1_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI2_3_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI4_15_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI16_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI17_IRQ_PRIORITY 3 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM14 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 2 +#define STM32_GPT_TIM2_IRQ_PRIORITY 2 +#define STM32_GPT_TIM3_IRQ_PRIORITY 2 +#define STM32_GPT_TIM14_IRQ_PRIORITY 2 + +/* + * I2C driver system settings. + */ +#define STM32_I2C_USE_I2C1 TRUE +#define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_BUSY_TIMEOUT 50 +#define STM32_I2C_I2C1_IRQ_PRIORITY 3 +#define STM32_I2C_I2C2_IRQ_PRIORITY 3 +#define STM32_I2C_USE_DMA TRUE +#define STM32_I2C_I2C1_DMA_PRIORITY 1 +#define STM32_I2C_I2C2_DMA_PRIORITY 1 +#define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7) +#define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) +#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 3 +#define STM32_ICU_TIM2_IRQ_PRIORITY 3 +#define STM32_ICU_TIM3_IRQ_PRIORITY 3 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_ADVANCED FALSE +#define STM32_PWM_USE_TIM1 FALSE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 TRUE +#define STM32_PWM_TIM1_IRQ_PRIORITY 3 +#define STM32_PWM_TIM2_IRQ_PRIORITY 3 +#define STM32_PWM_TIM3_IRQ_PRIORITY 3 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 FALSE +#define STM32_SERIAL_USART1_PRIORITY 3 +#define STM32_SERIAL_USART2_PRIORITY 3 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI2 TRUE +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 2 +#define STM32_SPI_SPI2_IRQ_PRIORITY 2 +#define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) +#define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5) +#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") + +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 2 +#define STM32_ST_USE_TIMER 2 + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 3 +#define STM32_UART_USART2_IRQ_PRIORITY 3 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_LP_IRQ_PRIORITY 3 + +#endif /* _MCUCONF_H_ */ diff --git a/keyboards/cannonkeys/instant60/readme.md b/keyboards/cannonkeys/instant60/readme.md new file mode 100644 index 0000000000..9cd91e9516 --- /dev/null +++ b/keyboards/cannonkeys/instant60/readme.md @@ -0,0 +1,12 @@ +# Instant60 + +Instant60 Keyboard + +Keyboard Maintainer: [Andrew Kannan](https://github.com/awkannan1) +Hardware Supported: STM32F072CBT6 + +Make example for this keyboard (after setting up your build environment): + + make cannonkeys/instant60:default + +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/cannonkeys/instant60/rules.mk b/keyboards/cannonkeys/instant60/rules.mk new file mode 100644 index 0000000000..cd366c76aa --- /dev/null +++ b/keyboards/cannonkeys/instant60/rules.mk @@ -0,0 +1,56 @@ +# project specific files +# SRC = ssd1306.c +## chip/board settings +# the next two should match the directories in +# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F0xx +# linker script to use +# it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/ +# or <this_dir>/ld/ +MCU_LDSCRIPT = STM32F072xB +# startup code to use +# is should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f0xx +# it should exist either in <chibios>/os/hal/boards/ +# or <this_dir>/boards +BOARD = ST_STM32F072B_DISCOVERY +# Cortex version +# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 +MCU = cortex-m0 +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 6 +# If you want to be able to jump to bootloader from firmware on STM32 MCUs, +# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in +# ./bootloader_defs.h or in ./boards/<FOO>/bootloader_defs.h (if you have +# a custom board definition that you plan to reuse). +# If you're not setting it here, leave it commented out. +# It is chip dependent, the correct number can be looked up here (page 175): +# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf +# This also requires a patch to chibios: +# <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch +#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800 + +# Build Options +# comment out to disable the options. +# + +# project specific files +VPATH += keyboards/cannonkeys/stm32f072 +SRC = keyboard.c \ + led.c + +#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +CUSTOM_MATRIX = no # Custom matrix file +# BACKLIGHT_ENABLE = yes # This is broken on 072 for some reason +RGBLIGHT_ENABLE = yes + +# RAW_ENABLE = yes +# DYNAMIC_KEYMAP_ENABLE = yes + diff --git a/keyboards/cannonkeys/satisfaction75/config.h b/keyboards/cannonkeys/satisfaction75/config.h index dd2d9bc574..e3d44990ef 100644 --- a/keyboards/cannonkeys/satisfaction75/config.h +++ b/keyboards/cannonkeys/satisfaction75/config.h @@ -23,7 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define DEVICE_VER 0x0001 /* in python2: list(u"whatever".encode('utf-16-le')) */ /* at most 32 characters or the ugly hack in usb_main.c borks */ -#define MANUFACTURER QMK +#define MANUFACTURER CannonKeys #define PRODUCT Satisfaction75 #define DESCRIPTION Satisfaction 75 Keyboard @@ -76,14 +76,27 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. // Bump this every time we change what we store // This will automatically reset the EEPROM with defaults // and avoid loading invalid data from the EEPROM -#define EEPROM_VERSION 0x02 +#define EEPROM_VERSION 0x0F #define EEPROM_VERSION_ADDR 34 // Dynamic keymap starts after EEPROM version #define DYNAMIC_KEYMAP_EEPROM_ADDR 35 -// Dynamic macro starts after dynamic keymaps (35+(4*6*16*2)) = (35+768) -#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 803 -#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 221 + +// Dynamic macro starts after dynamic keymaps (35+(4*6*16*2)) = (35+768) = 803 + +// I'm also putting my custom stuff after that +// 1 for enabled encoder modes +// 1 for custom backlighting controls +// 1 for OLED default mode +// 6 for 3x custom encoder settings, left, right, and press (18 total) + +#define DYNAMIC_KEYMAP_ENABLED_ENCODER_MODES 803 +#define DYNAMIC_KEYMAP_CUSTOM_BACKLIGHT 804 +#define DYNAMIC_KEYMAP_DEFAULT_OLED 805 +#define DYNAMIC_KEYMAP_CUSTOM_ENCODER 806 + +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 824 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 200 #define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/cannonkeys/satisfaction75/i2c_master.c b/keyboards/cannonkeys/satisfaction75/i2c_master.c index a19dbcc9f5..d81eb92d49 100644 --- a/keyboards/cannonkeys/satisfaction75/i2c_master.c +++ b/keyboards/cannonkeys/satisfaction75/i2c_master.c @@ -109,7 +109,7 @@ uint8_t i2c_readReg(uint8_t devaddr, uint8_t* regaddr, uint8_t* data, uint16_t l } // This is usually not needed. It releases the driver to allow pins to become GPIO again. -uint8_t i2c_stop(uint16_t timeout) +uint8_t i2c_stop(void) { i2cStop(&I2C_DRIVER); return 0; diff --git a/keyboards/cannonkeys/satisfaction75/keymaps/tester/keymap.c b/keyboards/cannonkeys/satisfaction75/keymaps/tester/keymap.c new file mode 100644 index 0000000000..3595c107b9 --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/keymaps/tester/keymap.c @@ -0,0 +1,37 @@ +/* +Copyright 2012,2013 Jun Wako <wakojun@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 QMK_KEYBOARD_H + +const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_all( + 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_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_DEL, ENC_PRESS, + 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, + 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_ENTER, KC_PGUP, + KC_LSFT, KC_BSLS, 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, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + [1] = LAYOUT_all( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, OLED_TOGG, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CLOCK_SET, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/cannonkeys/satisfaction75/keymaps/tester/rules.mk b/keyboards/cannonkeys/satisfaction75/keymaps/tester/rules.mk new file mode 100644 index 0000000000..3357eb91c0 --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/keymaps/tester/rules.mk @@ -0,0 +1 @@ +QWIIC_ENABLE = no diff --git a/keyboards/cannonkeys/satisfaction75/prototype/prototype.h b/keyboards/cannonkeys/satisfaction75/prototype/prototype.h new file mode 100644 index 0000000000..42e574f3ea --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/prototype/prototype.h @@ -0,0 +1,19 @@ +#pragma once + +#include "satisfaction75.h" + +#define LAYOUT_default( \ + K000, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K315, \ + K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K413, K415, \ + K500, K501, K502, K505, K509, K510, K511, K512, K513, K515 \ +) { \ + { K000, KC_NO, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, KC_NO, KC_NO }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, KC_NO, K115 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO, K215 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, KC_NO, KC_NO, K315 }, \ + { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, KC_NO, K413, KC_NO, K415 }, \ + { K500, K501, K502, KC_NO, KC_NO, K505, KC_NO, KC_NO, KC_NO, K509, K510, K511, K512, K513, KC_NO, K515 } \ +} diff --git a/keyboards/cannonkeys/satisfaction75/prototype/rules.mk b/keyboards/cannonkeys/satisfaction75/prototype/rules.mk new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/prototype/rules.mk diff --git a/keyboards/cannonkeys/satisfaction75/rev1/rev1.h b/keyboards/cannonkeys/satisfaction75/rev1/rev1.h new file mode 100644 index 0000000000..302b7e43de --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/rev1/rev1.h @@ -0,0 +1,108 @@ +#pragma once + +#include "satisfaction75.h" + +// This layout is the default - it's what's in VIA +// ANSI, bottom row 1.25/1.25/1.25/6.25/1/1/1 +#define LAYOUT_default( \ + K000, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K315, \ + K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K415, \ + K500, K501, K502, K505, K509, K510, K511, K512, K513, K515 \ +) { \ + { K000, KC_NO, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, KC_NO, KC_NO }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, KC_NO, K115 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO, K215 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO, K315 }, \ + { K400, KC_NO, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, KC_NO, K415 }, \ + { K500, K501, K502, KC_NO, KC_NO, K505, KC_NO, KC_NO, KC_NO, K509, K510, K511, K512, K513, KC_NO, K515 } \ +} + +// ISO, bottom row 1.25/1.25/1.25/6.25/1/1/1 +#define LAYOUT_iso( \ + K000, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K315, \ + K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K415, \ + K500, K501, K502, K505, K509, K510, K511, K512, K513, K515 \ +) { \ + { K000, KC_NO, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, KC_NO, KC_NO }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, KC_NO, K115 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO, K215 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, KC_NO, K315 }, \ + { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, KC_NO, K415 }, \ + { K500, K501, K502, KC_NO, KC_NO, K505, KC_NO, KC_NO, KC_NO, K509, K510, K511, K512, K513, KC_NO, K515 } \ +} + +// ANSI, bottom row 1.25/1.25/1.25/6.25/1.5/1.5 +#define LAYOUT_3x2( \ + K000, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K315, \ + K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K415, \ + K500, K501, K502, K505, K509, K511, K512, K513, K515 \ +) { \ + { K000, KC_NO, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, KC_NO, KC_NO }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, KC_NO, K115 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO, K215 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO, K315 }, \ + { K400, KC_NO, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, KC_NO, K415 }, \ + { K500, K501, K502, KC_NO, KC_NO, K505, KC_NO, KC_NO, KC_NO, K509, KC_NO, K511, K512, K513, KC_NO, K515 } \ +} + +// ANSI, WKL bottom row 1.5/1.5/7/1.5/1.5, Split Backspace +#define LAYOUT_2x2( \ + K000, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K315, \ + K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K415, \ + K500, K501, K505, K509, K511, K512, K513, K515 \ +) { \ + { K000, KC_NO, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, KC_NO, KC_NO }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO, K215 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO, K315 }, \ + { K400, KC_NO, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, KC_NO, K415 }, \ + { K500, K501, KC_NO, KC_NO, KC_NO, K505, KC_NO, KC_NO, KC_NO, K509, KC_NO, K511, K512, K513, KC_NO, K515 } \ +} + +// ANSI, bottom row 1.25/1.25/1.25/2.25/1.25/2.75/1/1/1 +// ANSI, bottom row 1.25/1.25/1.25/2.75/1.25/2.25/1/1/1 +#define LAYOUT_split_space( \ + K000, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K315, \ + K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K415, \ + K500, K501, K502, K503, K505, K507, K509, K510, K511, K512, K513, K515 \ +) { \ + { K000, KC_NO, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, KC_NO, KC_NO }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, KC_NO, K115 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO, K215 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO, K315 }, \ + { K400, KC_NO, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, KC_NO, K415 }, \ + { K500, K501, K502, K503, KC_NO, K505, KC_NO, K507, KC_NO, K509, K510, K511, K512, K513, KC_NO, K515 } \ +} + + +// Expose All Keys - Split backspace - ISO Extra keys - Split space bottom row +#define LAYOUT_all( \ + K000, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K315, \ + K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K415, \ + K500, K501, K502, K503, K505, K507, K509, K510, K511, K512, K513, K515 \ +) { \ + { K000, KC_NO, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, KC_NO, KC_NO }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO, K215 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, KC_NO, K315 }, \ + { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, KC_NO, K415 }, \ + { K500, K501, K502, K503, KC_NO, K505, KC_NO, K507, KC_NO, K509, K510, K511, K512, K513, KC_NO, K515 } \ +} diff --git a/keyboards/cannonkeys/satisfaction75/rev1/rules.mk b/keyboards/cannonkeys/satisfaction75/rev1/rules.mk new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/rev1/rules.mk diff --git a/keyboards/cannonkeys/satisfaction75/rules.mk b/keyboards/cannonkeys/satisfaction75/rules.mk index 88ab459204..3e2877200e 100644 --- a/keyboards/cannonkeys/satisfaction75/rules.mk +++ b/keyboards/cannonkeys/satisfaction75/rules.mk @@ -54,4 +54,4 @@ QWIIC_ENABLE += MICRO_OLED # RAW_ENABLE = yes # DYNAMIC_KEYMAP_ENABLE = yes -DEFAULT_FOLDER = cannonkeys/satisfaction75 +DEFAULT_FOLDER = cannonkeys/satisfaction75/rev1 diff --git a/keyboards/cannonkeys/satisfaction75/satisfaction75.c b/keyboards/cannonkeys/satisfaction75/satisfaction75.c index 1423b11b05..0e788b29b7 100644 --- a/keyboards/cannonkeys/satisfaction75/satisfaction75.c +++ b/keyboards/cannonkeys/satisfaction75/satisfaction75.c @@ -5,9 +5,10 @@ #include "ch.h" #include "hal.h" -// #ifdef QWIIC_MICRO_OLED_ENABLE +#ifdef QWIIC_MICRO_OLED_ENABLE #include "micro_oled.h" #include "qwiic.h" +#endif #include "timer.h" @@ -93,21 +94,87 @@ void raw_hid_receive( uint8_t *data, uint8_t length ) } case id_get_keyboard_value: { - if ( command_data[0] == id_uptime ) - { - uint32_t value = timer_read32(); - command_data[1] = (value >> 24 ) & 0xFF; - command_data[2] = (value >> 16 ) & 0xFF; - command_data[3] = (value >> 8 ) & 0xFF; - command_data[4] = value & 0xFF; - } - else - { - *command_id = id_unhandled; - } + switch( command_data[0]) + { + case id_uptime: + { + uint32_t value = timer_read32(); + command_data[1] = (value >> 24 ) & 0xFF; + command_data[2] = (value >> 16 ) & 0xFF; + command_data[3] = (value >> 8 ) & 0xFF; + command_data[4] = value & 0xFF; + break; + } + case id_oled_default_mode: + { + uint8_t default_oled = eeprom_read_byte((uint8_t*)DYNAMIC_KEYMAP_DEFAULT_OLED); + command_data[1] = default_oled; + break; + } + case id_oled_mode: + { + command_data[1] = oled_mode; + break; + + } + case id_encoder_modes: + { + command_data[1] = enabled_encoder_modes; + break; + } + case id_encoder_custom: + { + // uint8_t custom_encoder_idx = command_data[1]; + // command_data[2] = 0x00; + // command_data[3] = 0x00; + // command_data[4] = 0x00; + // command_data[5] = 0x00; + // command_data[6] = 0x00; + // command_data[7] = 0x00; + break; + } + default: + { + *command_id = id_unhandled; + break; + } + } break; - } + } #ifdef DYNAMIC_KEYMAP_ENABLE + case id_set_keyboard_value: + { + switch(command_data[0]){ + case id_oled_default_mode: + { + eeprom_update_byte((uint8_t*)DYNAMIC_KEYMAP_DEFAULT_OLED, command_data[1]); + break; + } + case id_oled_mode: + { + oled_mode = command_data[1]; + draw_ui(); + break; + } + case id_encoder_modes: + { + enabled_encoder_modes = command_data[1]; + eeprom_update_byte((uint8_t*)DYNAMIC_KEYMAP_ENABLED_ENCODER_MODES, enabled_encoder_modes); + break; + } + case id_encoder_custom: + { + // uint8_t custom_encoder_idx = command_data[1]; + break; + } + default: + { + *command_id = id_unhandled; + break; + } + } + break; + } case id_dynamic_keymap_get_keycode: { uint16_t keycode = dynamic_keymap_get_keycode( command_data[0], command_data[1], command_data[2] ); @@ -243,9 +310,11 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { queue_for_send = true; switch (keycode) { case OLED_TOGG: - if (record->event.pressed) { - oled_mode = (oled_mode + 1) % _NUM_OLED_MODES; - draw_ui(); + if(!clock_set_mode){ + if (record->event.pressed) { + oled_mode = (oled_mode + 1) % _NUM_OLED_MODES; + draw_ui(); + } } return false; case CLOCK_SET: @@ -325,12 +394,34 @@ void encoder_update_kb(uint8_t index, bool clockwise) { } } +void dynamic_keymap_custom_reset(void){ + void *p = (void*)(DYNAMIC_KEYMAP_CUSTOM_BACKLIGHT); + void *end = (void*)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR); + while ( p != end ) { + eeprom_update_byte(p, 0); + ++p; + } + eeprom_update_byte((uint8_t*)DYNAMIC_KEYMAP_ENABLED_ENCODER_MODES, 0x1F); +} + +void save_backlight_config_to_eeprom(){ + eeprom_update_byte((uint8_t*)DYNAMIC_KEYMAP_CUSTOM_BACKLIGHT, kb_backlight_config.raw); +} + +void load_custom_config(){ + kb_backlight_config.raw = eeprom_read_byte((uint8_t*)DYNAMIC_KEYMAP_CUSTOM_BACKLIGHT); +#ifdef DYNAMIC_KEYMAP_ENABLE + oled_mode = eeprom_read_byte((uint8_t*)DYNAMIC_KEYMAP_DEFAULT_OLED); + enabled_encoder_modes = eeprom_read_byte((uint8_t*)DYNAMIC_KEYMAP_ENABLED_ENCODER_MODES); +#endif +} + void eeprom_init_kb(void) { // If the EEPROM has the magic, the data is good. // OK to load from EEPROM. if (eeprom_is_valid()) { - //backlight_config_load(); + load_custom_config(); } else { // If the EEPROM has not been saved before, or is out of date, // save the default values to the EEPROM. Default values @@ -341,6 +432,8 @@ void eeprom_init_kb(void) dynamic_keymap_reset(); // This resets the macros in EEPROM to nothing. dynamic_keymap_macro_reset(); + // Reset the custom stuff + dynamic_keymap_custom_reset(); #endif // Save the magic number last, in case saving was interrupted eeprom_set_valid(true); @@ -367,7 +460,7 @@ void matrix_scan_kb(void) { queue_for_send = true; } } - +#ifdef QWIIC_MICRO_OLED_ENABLE if (queue_for_send && oled_mode != OLED_OFF) { oled_sleeping = false; read_host_led_state(); @@ -378,5 +471,6 @@ void matrix_scan_kb(void) { send_command(DISPLAYOFF); /* 0xAE */ oled_sleeping = true; } +#endif } diff --git a/keyboards/cannonkeys/satisfaction75/satisfaction75.h b/keyboards/cannonkeys/satisfaction75/satisfaction75.h index 5f9a1e48ba..dfab68017f 100644 --- a/keyboards/cannonkeys/satisfaction75/satisfaction75.h +++ b/keyboards/cannonkeys/satisfaction75/satisfaction75.h @@ -2,23 +2,11 @@ #include "quantum.h" -// The first section contains all of the arguements -// The second converts the arguments into a two-dimensional array - #define LAYOUT_default( \ - K000, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, \ - K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \ - K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ - K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K315, \ - K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K413, K415, \ - K500, K501, K502, K505, K509, K510, K511, K512, K513, K515 \ -) { \ - { K000, KC_NO, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, KC_NO, KC_NO }, \ - { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, KC_NO, K115 }, \ - { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO, K215 }, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, KC_NO, KC_NO, K315 }, \ - { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, KC_NO, K413, KC_NO, K415 }, \ - { K500, K501, K502, KC_NO, KC_NO, K505, KC_NO, KC_NO, KC_NO, K509, K510, K511, K512, K513, KC_NO, K515 } \ -} +#ifdef KEYBOARD_cannonkeys_satisfaction75_prototype + #include "prototype.h" +#else + #include "rev1.h" +#endif /* screen off after this many milliseconds */ #define ScreenOffInterval 60000 /* milliseconds */ @@ -39,6 +27,13 @@ enum my_keycodes { OLED_TOGG }; +enum s75_keyboard_value_id { + id_encoder_modes = 0x80, + id_oled_default_mode, + id_encoder_custom, + id_oled_mode +}; + enum encoder_modes { ENC_MODE_VOLUME, ENC_MODE_MEDIA, @@ -114,5 +109,5 @@ void backlight_set(uint8_t level); bool is_breathing(void); void breathing_enable(void); void breathing_disable(void); -// void backlight_save_to_eeprom(uint8_t level); -// uint8_t backlight_config_load(); +void load_custom_config(void); +void save_backlight_config_to_eeprom(void); diff --git a/keyboards/cannonkeys/satisfaction75/satisfaction_encoder.c b/keyboards/cannonkeys/satisfaction75/satisfaction_encoder.c index 88996f829d..6776816918 100644 --- a/keyboards/cannonkeys/satisfaction75/satisfaction_encoder.c +++ b/keyboards/cannonkeys/satisfaction75/satisfaction_encoder.c @@ -10,6 +10,8 @@ void pre_encoder_mode_change(){ // timespec.dstflag = last_timespec.dstflag; timespec.millisecond = (hour_config * 60 + minute_config) * 60 * 1000; rtcSetTime(&RTCD1, ×pec); + } else if (encoder_mode == ENC_MODE_BACKLIGHT){ + save_backlight_config_to_eeprom(); } } @@ -26,6 +28,9 @@ void post_encoder_mode_change(){ void change_encoder_mode(bool negative){ pre_encoder_mode_change(); + if(enabled_encoder_modes == 0){ + enabled_encoder_modes = 0x1F; + } do { if(negative){ if (encoder_mode == 0){ @@ -94,12 +99,14 @@ uint16_t handle_encoder_clockwise(){ mapped_code = KC_WH_D; break; case ENC_MODE_BACKLIGHT: - // mapped_code = BL_INC; kb_backlight_config.level = kb_backlight_config.level + 1; if(kb_backlight_config.level > BACKLIGHT_LEVELS){ kb_backlight_config.level = BACKLIGHT_LEVELS; } backlight_set(kb_backlight_config.level); + if (kb_backlight_config.level != 0){ + kb_backlight_config.enable = true; + } break; case ENC_MODE_BRIGHTNESS: mapped_code = KC_BRIGHTNESS_UP; @@ -131,6 +138,9 @@ uint16_t handle_encoder_ccw(){ kb_backlight_config.level = kb_backlight_config.level - 1; } backlight_set(kb_backlight_config.level); + if (kb_backlight_config.level == 0){ + kb_backlight_config.enable = false; + } break; case ENC_MODE_BRIGHTNESS: mapped_code = KC_BRIGHTNESS_DOWN; diff --git a/keyboards/cannonkeys/satisfaction75/satisfaction_oled.c b/keyboards/cannonkeys/satisfaction75/satisfaction_oled.c index a92d61c568..4e22587db8 100644 --- a/keyboards/cannonkeys/satisfaction75/satisfaction_oled.c +++ b/keyboards/cannonkeys/satisfaction75/satisfaction_oled.c @@ -3,6 +3,7 @@ __attribute__ ((weak)) void draw_ui() { +#ifdef QWIIC_MICRO_OLED_ENABLE clear_buffer(); last_flush = timer_read(); send_command(DISPLAYON); @@ -22,6 +23,7 @@ void draw_ui() { send_command(DISPLAYOFF); break; } +#endif } void draw_encoder(int8_t startX, int8_t startY, bool show_legend){ diff --git a/keyboards/cannonkeys/stm32f072/keyboard.c b/keyboards/cannonkeys/stm32f072/keyboard.c new file mode 100644 index 0000000000..f94ecb5fbb --- /dev/null +++ b/keyboards/cannonkeys/stm32f072/keyboard.c @@ -0,0 +1,125 @@ +#include "keyboard.h" +#include "ch.h" +#include "hal.h" +#include "led_custom.h" +#include "util.h" +#include "quantum.h" + +#include "tmk_core/common/eeprom.h" + +#include "ws2812.h" + +backlight_config_t kb_backlight_config = { + .enable = true, + .breathing = true, + .level = BACKLIGHT_LEVELS +}; + +bool eeprom_is_valid(void) +{ + return (eeprom_read_word(((void*)EEPROM_MAGIC_ADDR)) == EEPROM_MAGIC && + eeprom_read_byte(((void*)EEPROM_VERSION_ADDR)) == EEPROM_VERSION); +} + +void eeprom_set_valid(bool valid) +{ + eeprom_update_word(((void*)EEPROM_MAGIC_ADDR), valid ? EEPROM_MAGIC : 0xFFFF); + eeprom_update_byte(((void*)EEPROM_VERSION_ADDR), valid ? EEPROM_VERSION : 0xFF); +} + +void eeprom_reset(void) +{ + eeprom_set_valid(false); + eeconfig_disable(); +} + +void save_backlight_config_to_eeprom(){ + eeprom_update_byte((uint8_t*)EEPROM_CUSTOM_BACKLIGHT, kb_backlight_config.raw); +} + +void load_custom_config(){ + kb_backlight_config.raw = eeprom_read_byte((uint8_t*)EEPROM_CUSTOM_BACKLIGHT); +} + +void eeprom_init_kb(void) +{ + // If the EEPROM has the magic, the data is good. + // OK to load from EEPROM. + if (eeprom_is_valid()) { + load_custom_config(); + } else { + // Save the magic number last, in case saving was interrupted + eeprom_set_valid(true); + save_backlight_config_to_eeprom(); + } +} + +__attribute__ ((weak)) +void matrix_init_board(void); + +void matrix_init_kb(void){ + eeprom_init_kb(); + /* MOSI pin*/ + palSetPadMode(PORT_WS2812, PIN_WS2812, PAL_MODE_ALTERNATE(0)); + wait_ms(500); + +#ifdef RGBLIGHT_ENABLE + leds_init(); +#endif + backlight_init_ports(); + + matrix_init_board(); +} + +void matrix_scan_kb(void) +{ + #ifdef RGBLIGHT_ENABLE + rgblight_task(); + #endif +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case BL_INC: + if (record->event.pressed) { + kb_backlight_config.level = kb_backlight_config.level + 1; + if(kb_backlight_config.level > BACKLIGHT_LEVELS){ + kb_backlight_config.level = BACKLIGHT_LEVELS; + } + backlight_set(kb_backlight_config.level); + save_backlight_config_to_eeprom(); + } + return false; + case BL_TOGG: + if (record->event.pressed) { + kb_backlight_config.enable = !kb_backlight_config.enable; + if(kb_backlight_config.enable){ + backlight_set(kb_backlight_config.level); + } else { + backlight_set(0); + } + save_backlight_config_to_eeprom(); + } + return false; + + case BL_DEC: + if (record->event.pressed) { + if(kb_backlight_config.level <= 1){ + kb_backlight_config.level = 0; + } else { + kb_backlight_config.level = kb_backlight_config.level - 1; + } + backlight_set(kb_backlight_config.level); + save_backlight_config_to_eeprom(); + } + return false; + case BL_BRTG: + if (record->event.pressed) { + kb_backlight_config.breathing = !kb_backlight_config.breathing; + breathing_toggle(); + save_backlight_config_to_eeprom(); + } + return false; + } + return true; +} diff --git a/keyboards/cannonkeys/stm32f072/keyboard.h b/keyboards/cannonkeys/stm32f072/keyboard.h new file mode 100644 index 0000000000..94c973d615 --- /dev/null +++ b/keyboards/cannonkeys/stm32f072/keyboard.h @@ -0,0 +1,23 @@ +#pragma once + +#include "quantum.h" + +typedef union { + uint8_t raw; + struct { + bool enable :1; + bool breathing : 1; + uint8_t level :6; + }; +} backlight_config_t; + +// Backlighting +extern backlight_config_t kb_backlight_config; +extern bool kb_backlight_breathing; +void backlight_init_ports(void); +void backlight_set(uint8_t level); +bool is_breathing(void); +void breathing_enable(void); +void breathing_disable(void); +void load_custom_config(void); +void save_backlight_config_to_eeprom(void); diff --git a/keyboards/cannonkeys/stm32f072/led.c b/keyboards/cannonkeys/stm32f072/led.c new file mode 100644 index 0000000000..d69d946855 --- /dev/null +++ b/keyboards/cannonkeys/stm32f072/led.c @@ -0,0 +1,252 @@ +/* +Copyright 2012 Jun Wako <wakojun@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 "hal.h" +#include "led_custom.h" +#include "keyboard.h" +#include "printf.h" + +static void breathing_callback(PWMDriver *pwmp); + +static PWMConfig pwmCFG = { + 0xFFFF, /* PWM clock frequency */ + 256, /* PWM period (in ticks) 1S (1/10kHz=0.1mS 0.1ms*10000 ticks=1S) */ + NULL, /* No Callback */ + { + {PWM_OUTPUT_ACTIVE_HIGH, NULL}, /* Enable Channel 0 */ + {PWM_OUTPUT_DISABLED, NULL}, + {PWM_OUTPUT_DISABLED, NULL}, + {PWM_OUTPUT_DISABLED, NULL} + }, + 0, /* HW dependent part.*/ + 0 +}; + +static PWMConfig pwmCFG_breathing = { + 0xFFFF, /* 10kHz PWM clock frequency */ + 256, /* PWM period (in ticks) 1S (1/10kHz=0.1mS 0.1ms*10000 ticks=1S) */ + breathing_callback, /* Breathing Callback */ + { + {PWM_OUTPUT_ACTIVE_HIGH, NULL}, /* Enable Channel 0 */ + {PWM_OUTPUT_DISABLED, NULL}, + {PWM_OUTPUT_DISABLED, NULL}, + {PWM_OUTPUT_DISABLED, NULL} + }, + 0, /* HW dependent part.*/ + 0 +}; + +// See http://jared.geek.nz/2013/feb/linear-led-pwm +static uint16_t cie_lightness(uint16_t v) { + if (v <= 5243) // if below 8% of max + return v / 9; // same as dividing by 900% + else { + uint32_t y = (((uint32_t) v + 10486) << 8) / (10486 + 0xFFFFUL); // add 16% of max and compare + // to get a useful result with integer division, we shift left in the expression above + // and revert what we've done again after squaring. + y = y * y * y >> 8; + if (y > 0xFFFFUL) // prevent overflow + return 0xFFFFU; + else + return (uint16_t) y; + } +} + + +uint8_t get_backlight_level(void){ + return kb_backlight_config.level; +} + +void backlight_init_ports(void) { + printf("backlight_init_ports()\n"); + palSetPadMode(GPIOA, 6, PAL_MODE_ALTERNATE(1)); + pwmStart(&PWMD3, &pwmCFG); + // pwmEnableChannel(&PWMD3, 0, PWM_FRACTION_TO_WIDTH(&PWMD3, 0xFFFF,cie_lightness(0xFFFF))); + if(kb_backlight_config.enable){ + if(kb_backlight_config.breathing){ + breathing_enable(); + } else{ + backlight_set(kb_backlight_config.level); + } + } else { + backlight_set(0); + } + +} + +void backlight_set(uint8_t level) { + printf("backlight_set(%d)\n", level); + uint32_t duty = (uint32_t)(cie_lightness(0xFFFF * (uint32_t) level / BACKLIGHT_LEVELS)); + printf("duty: (%d)\n", duty); + if (level == 0) { + // Turn backlight off + pwmDisableChannel(&PWMD3, 0); + } else { + // Turn backlight on + if(!is_breathing()){ + pwmEnableChannel(&PWMD3, 0, PWM_FRACTION_TO_WIDTH(&PWMD3,0xFFFF,duty)); + } + } +} + + +uint8_t backlight_tick = 0; + +void backlight_task(void) { +} + +#define BREATHING_NO_HALT 0 +#define BREATHING_HALT_OFF 1 +#define BREATHING_HALT_ON 2 +#define BREATHING_STEPS 128 + +static uint8_t breathing_period = BREATHING_PERIOD; +static uint8_t breathing_halt = BREATHING_NO_HALT; +static uint16_t breathing_counter = 0; + +bool is_breathing(void) { + return PWMD3.config == &pwmCFG_breathing; +} + +#define breathing_min() do {breathing_counter = 0;} while (0) +#define breathing_max() do {breathing_counter = breathing_period * 256 / 2;} while (0) + + +void breathing_interrupt_enable(void){ + pwmStop(&PWMD3); + pwmStart(&PWMD3, &pwmCFG_breathing); + chSysLockFromISR(); + pwmEnablePeriodicNotification(&PWMD3); + pwmEnableChannelI( + &PWMD3, + 0, + PWM_FRACTION_TO_WIDTH( + &PWMD3, + 0xFFFF, + 0xFFFF + ) + ); + chSysUnlockFromISR(); +} + +void breathing_interrupt_disable(void){ + pwmStop(&PWMD3); + pwmStart(&PWMD3, &pwmCFG); +} + +void breathing_enable(void) +{ + breathing_counter = 0; + breathing_halt = BREATHING_NO_HALT; + breathing_interrupt_enable(); +} + +void breathing_pulse(void) +{ + if (get_backlight_level() == 0) + breathing_min(); + else + breathing_max(); + breathing_halt = BREATHING_HALT_ON; + breathing_interrupt_enable(); +} + +void breathing_disable(void) +{ + printf("breathing_disable()\n"); + breathing_interrupt_disable(); + // Restore backlight level + backlight_set(get_backlight_level()); +} + +void breathing_self_disable(void) +{ + if (get_backlight_level() == 0) + breathing_halt = BREATHING_HALT_OFF; + else + breathing_halt = BREATHING_HALT_ON; +} + +void breathing_toggle(void) { + if (is_breathing()){ + printf("disable breathing\n"); + breathing_disable(); + } else { + printf("enable breathing\n"); + breathing_enable(); + } +} + +void breathing_period_set(uint8_t value) +{ + if (!value) + value = 1; + breathing_period = value; +} + +void breathing_period_default(void) { + breathing_period_set(BREATHING_PERIOD); +} + +void breathing_period_inc(void) +{ + breathing_period_set(breathing_period+1); +} + +void breathing_period_dec(void) +{ + breathing_period_set(breathing_period-1); +} + +/* To generate breathing curve in python: + * from math import sin, pi; [int(sin(x/128.0*pi)**4*255) for x in range(128)] + */ +static const uint8_t breathing_table[BREATHING_STEPS] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 17, 20, 24, 28, 32, 36, 41, 46, 51, 57, 63, 70, 76, 83, 91, 98, 106, 113, 121, 129, 138, 146, 154, 162, 170, 178, 185, 193, 200, 207, 213, 220, 225, 231, 235, 240, 244, 247, 250, 252, 253, 254, 255, 254, 253, 252, 250, 247, 244, 240, 235, 231, 225, 220, 213, 207, 200, 193, 185, 178, 170, 162, 154, 146, 138, 129, 121, 113, 106, 98, 91, 83, 76, 70, 63, 57, 51, 46, 41, 36, 32, 28, 24, 20, 17, 15, 12, 10, 8, 6, 5, 4, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + +// Use this before the cie_lightness function. +static inline uint16_t scale_backlight(uint16_t v) { + return v / BACKLIGHT_LEVELS * get_backlight_level(); +} + +static void breathing_callback(PWMDriver *pwmp) +{ + (void)pwmp; + uint16_t interval = (uint16_t) breathing_period * 256 / BREATHING_STEPS; + // resetting after one period to prevent ugly reset at overflow. + breathing_counter = (breathing_counter + 1) % (breathing_period * 256); + uint8_t index = breathing_counter / interval % BREATHING_STEPS; + + if (((breathing_halt == BREATHING_HALT_ON) && (index == BREATHING_STEPS / 2)) || + ((breathing_halt == BREATHING_HALT_OFF) && (index == BREATHING_STEPS - 1))) + { + breathing_interrupt_disable(); + } + + uint32_t duty = cie_lightness(scale_backlight(breathing_table[index] * 256)); + + chSysLockFromISR(); + pwmEnableChannelI( + &PWMD3, + 0, + PWM_FRACTION_TO_WIDTH( + &PWMD3, + 0xFFFF, + duty + ) + ); + chSysUnlockFromISR(); +} diff --git a/keyboards/cannonkeys/stm32f072/led_custom.h b/keyboards/cannonkeys/stm32f072/led_custom.h new file mode 100644 index 0000000000..28e0f02ed3 --- /dev/null +++ b/keyboards/cannonkeys/stm32f072/led_custom.h @@ -0,0 +1,6 @@ +#pragma once + +void backlight_task(void); +void breathing_interrupt_disable(void); +void breathing_interrupt_enable(void); +void breathing_toggle(void); diff --git a/keyboards/cannonkeys/stm32f072/ws2812.c b/keyboards/cannonkeys/stm32f072/ws2812.c new file mode 100644 index 0000000000..665763931e --- /dev/null +++ b/keyboards/cannonkeys/stm32f072/ws2812.c @@ -0,0 +1,150 @@ +#include "ch.h" +#include "hal.h" + +#include "ws2812.h" + +#define BYTES_FOR_LED_BYTE 4 +#define NB_COLORS 3 +#define BYTES_FOR_LED BYTES_FOR_LED_BYTE*NB_COLORS +#define DATA_SIZE BYTES_FOR_LED*NB_LEDS +#define RESET_SIZE 200 + +// Define the spi your LEDs are plugged to here +#define LEDS_SPI WS2812_SPI +// Define the number of LEDs you wish to control in your LED strip +#define NB_LEDS RGBLED_NUM + +#define LED_SPIRAL 0 + +static uint8_t txbuf[DATA_SIZE + RESET_SIZE]; +static uint8_t get_protocol_eq(uint8_t data, int pos); + +/* + * This lib is meant to be used asynchronously, thus the colors contained in + * the txbuf will be sent in loop, so that the colors are always the ones you + * put in the table (the user thus have less to worry about) + * + * Since the data are sent via DMA, and the call to spiSend is a blocking one, + * the processor ressources are not used to much, if you see your program being + * too slow, simply add a: + * chThdSleepMilliseconds(x); + * after the spiSend, where you increment x untill you are satisfied with your + * program speed, another trick may be to lower this thread priority : your call + */ +static THD_WORKING_AREA(LEDS_THREAD_WA, 128); +static THD_FUNCTION(ledsThread, arg) { + (void) arg; + while(1){ + spiSend(&LEDS_SPI, DATA_SIZE + RESET_SIZE, txbuf); + } +} + +#if LED_SPIRAL +/* + * 'Led spiral' is a simple demo in which we put all the leds to the same + * color, where this color does all the hsv circle in loop. + * If you want to launch the thread that will chage the led colors to the + * appropriate value, simply set LED_SPIRAL to 1. + */ + +static THD_WORKING_AREA(HSVTRANS_WA, 128); +static THD_FUNCTION(hsv_transThread, arg) { + (void) arg; + hsv_color color = {0, 255, 255}; + while(1){ + color.h += 1; + color.h %= 256; + set_leds_color_hsv(color); + chThdSleepMilliseconds(50); + } +} +#endif + +static const SPIConfig spicfg = { + NULL, + GPIOB, + 15, + SPI_CR1_BR_1|SPI_CR1_BR_0 // baudrate : fpclk / 8 => 1tick is 0.32us +}; + +/* + * Function used to initialize the driver. + * + * Starts by shutting off all the LEDs. + * Then gets access on the LED_SPI driver. + * May eventually launch an animation on the LEDs (e.g. a thread setting the + * txbuff values) + */ +void leds_init(void){ + for(int i = 0; i < RESET_SIZE; i++) + txbuf[DATA_SIZE+i] = 0x00; + spiAcquireBus(&LEDS_SPI); /* Acquire ownership of the bus. */ + spiStart(&LEDS_SPI, &spicfg); /* Setup transfer parameters. */ + spiSelect(&LEDS_SPI); /* Slave Select assertion. */ + chThdCreateStatic(LEDS_THREAD_WA, sizeof(LEDS_THREAD_WA),NORMALPRIO, ledsThread, NULL); +#if LED_SPIRAL + chThdCreateStatic(HSVTRANS_WA, sizeof(HSVTRANS_WA), + NORMALPRIO, hsv_transThread, NULL); +#endif +} + +/* + * As the trick here is to use the SPI to send a huge pattern of 0 and 1 to + * the ws2812b protocol, we use this helper function to translate bytes into + * 0s and 1s for the LED (with the appropriate timing). + */ +static uint8_t get_protocol_eq(uint8_t data, int pos){ + uint8_t eq = 0; + if (data & (1 << (2*(3-pos)))) + eq = 0b1110; + else + eq = 0b1000; + if (data & (2 << (2*(3-pos)))) + eq += 0b11100000; + else + eq += 0b10000000; + return eq; +} + +// +///* +// * If you want to set a LED's color in the RGB color space, simply call this +// * function with a hsv_color containing the desired color and the index of the +// * led on the LED strip (starting from 0, the first one being the closest the +// * first plugged to the board) +// * +// * Only set the color of the LEDs through the functions given by this API +// * (unless you really know what you are doing) +// */ +void set_led_color_rgb(LED_TYPE color, int pos){ + for(int j = 0; j < 4; j++) + txbuf[BYTES_FOR_LED*pos + j] = get_protocol_eq(color.g, j); + for(int j = 0; j < 4; j++) + txbuf[BYTES_FOR_LED*pos + BYTES_FOR_LED_BYTE+j] = get_protocol_eq(color.r, j); + for(int j = 0; j < 4; j++) + txbuf[BYTES_FOR_LED*pos + BYTES_FOR_LED_BYTE*2+j] = get_protocol_eq(color.b, j); +} + + +void WS2812_init(void) { + leds_init(); +} + +void ws2812_setleds(LED_TYPE *ledarray, uint16_t number_of_leds) { + uint8_t i = 0; + while (i < number_of_leds) { + set_led_color_rgb(ledarray[i], i); + i++; + } +} + + +void set_leds_color_rgb(LED_TYPE color){ + for(int i = 0; i < NB_LEDS; i++) + set_led_color_rgb(color, i); +} + + +void ws2812_setleds_rgbw(LED_TYPE *ledarray, uint16_t number_of_leds) { + +} diff --git a/keyboards/cannonkeys/stm32f072/ws2812.h b/keyboards/cannonkeys/stm32f072/ws2812.h new file mode 100644 index 0000000000..3b61ddcfa9 --- /dev/null +++ b/keyboards/cannonkeys/stm32f072/ws2812.h @@ -0,0 +1,20 @@ +#pragma once + +#include "hal.h" +#include "rgblight_types.h" + + +void set_leds_color_rgb(LED_TYPE color); +void set_led_color_rgb(LED_TYPE color, int pos); +void leds_init(void); + + + // This is what users will use to interface with this +void ws2812_setleds(LED_TYPE *ledarray, uint16_t number_of_leds); +void ws2812_setleds_rgbw(LED_TYPE *ledarray, uint16_t number_of_leds); + + +void WS2812_init(void); +void WS2812_set_color( uint8_t index, uint8_t red, uint8_t green, uint8_t blue ); +void WS2812_set_color_all( uint8_t red, uint8_t green, uint8_t blue ); +void WS2812_send_colors(void); diff --git a/keyboards/chibios_test/keymaps/default/keymap.c b/keyboards/chibios_test/keymaps/default/keymap.c index 11616cf559..0edc697bf9 100644 --- a/keyboards/chibios_test/keymaps/default/keymap.c +++ b/keyboards/chibios_test/keymaps/default/keymap.c @@ -15,7 +15,7 @@ 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 "chibios_test.h" +#include QMK_KEYBOARD_H const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {{KC_CAPS}}, // test with KC_CAPS, KC_A, RESET diff --git a/keyboards/christmas_tree/keymaps/default/config.h b/keyboards/christmas_tree/keymaps/default/config.h index 4553e621dd..271f48d001 100644 --- a/keyboards/christmas_tree/keymaps/default/config.h +++ b/keyboards/christmas_tree/keymaps/default/config.h @@ -1,6 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "../../config.h" - -#endif
\ No newline at end of file +// place overrides here diff --git a/keyboards/ckeys/obelus/keymaps/default/config.h b/keyboards/ckeys/obelus/keymaps/default/config.h index 04bf9f4a9d..271f48d001 100644 --- a/keyboards/ckeys/obelus/keymaps/default/config.h +++ b/keyboards/ckeys/obelus/keymaps/default/config.h @@ -1,6 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "../../config.h" -// Add overrides here -#endif +// place overrides here diff --git a/keyboards/ckeys/obelus/keymaps/default/keymap.c b/keyboards/ckeys/obelus/keymaps/default/keymap.c index bdad1cacab..f71ac56276 100644 --- a/keyboards/ckeys/obelus/keymaps/default/keymap.c +++ b/keyboards/ckeys/obelus/keymaps/default/keymap.c @@ -1,7 +1,4 @@ #include QMK_KEYBOARD_H -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif extern keymap_config_t keymap_config; diff --git a/keyboards/claw44/claw44.c b/keyboards/claw44/claw44.c new file mode 100644 index 0000000000..f564fb623b --- /dev/null +++ b/keyboards/claw44/claw44.c @@ -0,0 +1,10 @@ +#include "claw44.h" +#include "ssd1306.h" + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { +#ifdef SSD1306OLED + return process_record_gfx(keycode,record) && process_record_user(keycode, record); +#else + return process_record_user(keycode, record); +#endif +} diff --git a/keyboards/claw44/claw44.h b/keyboards/claw44/claw44.h new file mode 100644 index 0000000000..4ca25fcb2b --- /dev/null +++ b/keyboards/claw44/claw44.h @@ -0,0 +1,5 @@ +#pragma once + +#ifdef KEYBOARD_claw44_rev1 + #include "rev1.h" +#endif diff --git a/keyboards/orthodox/config.h b/keyboards/claw44/config.h index 821cd7e29f..fb1cdf3962 100644 --- a/keyboards/orthodox/config.h +++ b/keyboards/claw44/config.h @@ -1,9 +1,6 @@ /* -This is the c configuration file for the keyboard - Copyright 2012 Jun Wako <wakojun@gmail.com> -Copyright 2017 Jack Humbert -Copyright 2017 Art Ortenburger +Copyright 2015 Jack Humbert 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 @@ -19,9 +16,13 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" - -#endif +#include <serial_config.h> + +#define USE_I2C +#define USE_SERIAL + +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION diff --git a/keyboards/orthodox/i2c.c b/keyboards/claw44/i2c.c index 084c890c40..4bee5c6398 100644 --- a/keyboards/orthodox/i2c.c +++ b/keyboards/claw44/i2c.c @@ -34,7 +34,7 @@ void i2c_delay(void) { // _delay_us(100); } -// Setup twi to run at 100kHz +// Setup twi to run at 100kHz or 400kHz (see ./i2c.h SCL_CLOCK) void i2c_master_init(void) { // no prescaler TWSR = 0; diff --git a/keyboards/orthodox/i2c.h b/keyboards/claw44/i2c.h index 2af843ff60..710662c7ab 100644 --- a/keyboards/orthodox/i2c.h +++ b/keyboards/claw44/i2c.h @@ -1,8 +1,6 @@ -#ifndef I2C_H -#define I2C_H +#pragma once #include <stdint.h> -#include "matrix.h" #ifndef F_CPU #define F_CPU 16000000UL @@ -16,8 +14,8 @@ #define SLAVE_BUFFER_SIZE 0x10 -// i2c SCL clock frequency -#define SCL_CLOCK 100000UL +// i2c SCL clock frequency 400kHz +#define SCL_CLOCK 400000L extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; @@ -46,5 +44,3 @@ extern unsigned char i2c_readNak(void); extern unsigned char i2c_read(unsigned char ack); #define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); - -#endif diff --git a/keyboards/claw44/keymaps/default/config.h b/keyboards/claw44/keymaps/default/config.h new file mode 100644 index 0000000000..eff6ad3c7b --- /dev/null +++ b/keyboards/claw44/keymaps/default/config.h @@ -0,0 +1,35 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako <wakojun@gmail.com> +Copyright 2015 Jack Humbert + +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 + +//#define USE_MATRIX_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#define SSD1306OLED + +#define USE_SERIAL_PD2 + +#define TAPPING_TERM 200 diff --git a/keyboards/claw44/keymaps/default/keymap.c b/keyboards/claw44/keymaps/default/keymap.c new file mode 100644 index 0000000000..c346571255 --- /dev/null +++ b/keyboards/claw44/keymaps/default/keymap.c @@ -0,0 +1,169 @@ +#include QMK_KEYBOARD_H +#ifdef PROTOCOL_LUFA + #include "lufa.h" + #include "split_util.h" +#endif +#ifdef SSD1306OLED + #include "ssd1306.h" +#endif + +extern keymap_config_t keymap_config; + +extern uint8_t is_master; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE +}; + +enum macro_keycodes { + KC_SAMPLEMACRO, +}; + +#define KC_ KC_TRNS +#define KC_RST RESET +#define KC_L_SPC LT(_LOWER, KC_SPC) // lower +#define KC_R_ENT LT(_RAISE, KC_ENT) // raise +#define KC_G_JA LGUI_T(KC_LANG1) // cmd or win +#define KC_G_EN LGUI_T(KC_LANG2) // cmd or win +#define KC_C_BS LCTL_T(KC_BSPC) // ctrl +#define KC_A_DEL ALT_T(KC_DEL) // alt + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( \ + //,--------+--------+---------+--------+---------+--------. ,--------+---------+--------+---------+--------+--------. + KC_ESC , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_MINS, + //|--------+--------+---------+--------+---------+--------| |--------+---------+--------+---------+--------+--------| + KC_TAB , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, + //|--------+--------+---------+--------+---------+--------| |--------+---------+--------+---------+--------+--------| + 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_A_DEL, KC_G_EN, KC_L_SPC, KC_C_BS, KC_C_BS, KC_R_ENT, KC_G_JA, KC_A_DEL + // `----------+--------+---------+--------' `--------+---------+--------+---------' + ), + + // \ ^ ! & | @ = + * % - + // ( # $ " ' ~ ← ↓ ↑ → ` ) + // { [ ] } + + [_RAISE] = LAYOUT( \ + //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. + _______, KC_BSLS, KC_CIRC, KC_EXLM, KC_AMPR, KC_PIPE, KC_AT , KC_EQL , KC_PLUS, KC_ASTR, KC_PERC, KC_MINS, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_LPRN, KC_HASH, KC_DLR , KC_DQT , KC_QUOT, KC_TILD, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT, KC_GRV , KC_RPRN, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, KC_LCBR, KC_LBRC, KC_RBRC, KC_RCBR, _______, _______, _______, _______, + //`--------+--------+--------+--------+--------+--------/ \--------+--------+--------+--------+--------+--------' + _______, _______, _______, _______, _______, _______, _______, RESET + // `--------+--------+--------+--------' `--------+--------+--------+--------' + ), + + [_LOWER] = LAYOUT( \ + //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. + KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , _______, KC_EQL , KC_PLUS, KC_ASTR, KC_PERC, KC_MINS, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , _______, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , _______, _______, KC_COMM, KC_DOT , KC_SLSH, _______, + //`--------+--------+--------+--------+--------+--------/ \--------+--------+--------+--------+--------+--------' + RESET , _______, _______, _______, _______, _______, _______, _______ + // `--------+--------+--------+--------' `--------+--------+--------+--------' + ), +}; + +void matrix_init_user(void) { + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + iota_gfx_init(!has_usb()); // turns on the display + #endif +} + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +// When add source files to SRC in rules.mk, you can use functions. +const char *read_layer_state(void); +const char *read_logo(void); +void set_keylog(uint16_t keycode, keyrecord_t *record); +const char *read_keylog(void); +const char *read_keylogs(void); + +// const char *read_mode_icon(bool swap); +// const char *read_host_led_state(void); +// void set_timelog(void); +// const char *read_timelog(void); + +void matrix_scan_user(void) { + iota_gfx_task(); +} + +void matrix_render_user(struct CharacterMatrix *matrix) { + if (is_master) { + // If you want to change the display of OLED, you need to change here + matrix_write_ln(matrix, read_layer_state()); + matrix_write_ln(matrix, read_keylog()); + matrix_write_ln(matrix, read_keylogs()); + //matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui)); + //matrix_write_ln(matrix, read_host_led_state()); + //matrix_write_ln(matrix, read_timelog()); + } else { + matrix_write(matrix, read_logo()); + } +} + +void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +void iota_gfx_task_user(void) { + struct CharacterMatrix matrix; + matrix_clear(&matrix); + matrix_render_user(&matrix); + matrix_update(&display, &matrix); +} +#endif//SSD1306OLED + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { +#ifdef SSD1306OLED + set_keylog(keycode, record); +#endif + // set_timelog(); + } + + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + } else { + layer_off(_LOWER); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + } else { + layer_off(_RAISE); + } + return false; + break; + } + return true; +} diff --git a/keyboards/claw44/keymaps/yfuku/config.h b/keyboards/claw44/keymaps/yfuku/config.h new file mode 100644 index 0000000000..244ffa7096 --- /dev/null +++ b/keyboards/claw44/keymaps/yfuku/config.h @@ -0,0 +1,36 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako <wakojun@gmail.com> +Copyright 2015 Jack Humbert + +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 + +//#define USE_MATRIX_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#define SSD1306OLED + +#define USE_SERIAL_PD2 + +#define TAPPING_TERM 180 +#define IGNORE_MOD_TAP_INTERRUPT diff --git a/keyboards/claw44/keymaps/yfuku/keymap.c b/keyboards/claw44/keymaps/yfuku/keymap.c new file mode 100644 index 0000000000..77d459b928 --- /dev/null +++ b/keyboards/claw44/keymaps/yfuku/keymap.c @@ -0,0 +1,221 @@ +#include QMK_KEYBOARD_H +#ifdef PROTOCOL_LUFA + #include "lufa.h" + #include "split_util.h" +#endif +#ifdef SSD1306OLED + #include "ssd1306.h" +#endif + +extern keymap_config_t keymap_config; + +extern uint8_t is_master; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE +}; + +enum macro_keycodes { + KC_SAMPLEMACRO, +}; + +// common +#define KC_ KC_TRNS +#define KC_XXXX KC_NO +#define KC_RST RESET +#define KC_VD KC__VOLDOWN +#define KC_VU KC__VOLUP + +// layer +#define KC_L_SPC LT(_LOWER, KC_SPC) +#define KC_R_ENT LT(_RAISE, KC_ENT) + +// shift_t +#define KC_S_TAB LSFT_T(KC_TAB) +#define KC_S_ESC LSFT_T(KC_ESC) +#define KC_S_JA LSFT_T(KC_LANG1) +#define KC_S_EN LSFT_T(KC_LANG2) + +// cmd_t +#define KC_M_F LCMD_T(KC_F) +#define KC_M_D LCMD_T(KC_D) +#define KC_M_J LCMD_T(KC_J) +#define KC_M_K LCMD_T(KC_K) + +// ctl_t +#define KC_C_S LCTL_T(KC_S) +#define KC_C_L LCTL_T(KC_L) +#define KC_C_BS LCTL_T(KC_BSPC) + +// alt_t +#define KC_A_D ALT_T(KC_D) +#define KC_A_K ALT_T(KC_K) +#define KC_A_Z ALT_T(KC_Z) +#define KC_A_SL ALT_T(KC_SLSH) +#define KC_A_DEL ALT_T(KC_DEL) + +// cmd+shift_t +#define KC_MS_Q SCMD_T(KC_Q) +#define KC_MS_A SCMD_T(KC_A) +#define KC_MS_S SCMD_T(KC_S) +#define KC_MS_SC SCMD_T(KC_SCLN) +#define KC_MS_ESC SCMD_T(KC_ESC) + +// +#define KC_MR RCMD(KC_R) +#define KC_MF RCMD(KC_F) +#define KC_MW RCMD(KC_W) +#define KC_MX RCMD(KC_X) +#define KC_MC RCMD(KC_C) +#define KC_MV RCMD(KC_V) +#define KC_MTAB RCMD(KC_TAB) +#define KC_MSF RCMD(RSFT(KC_F)) +#define KC_MSR RCMD(RSFT(KC_R)) +#define KC_MST RCMD(RSFT(KC_T)) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + // M_ = LCMD_T( + // A_ = ALT_T( + // C_ = LCTL_T( + // MS_ = SMD_T( + // R_ = LT(_RAISE + // L_ = LT(_LOWER + + [_QWERTY] = LAYOUT_kc( \ + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + ESC , Q , W , E , R , T , Y , U , I , O , P ,MINS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + S_TAB, A ,C_S , D ,M_F , G , H ,M_J , K ,C_L ,SCLN,S_ESC, + //|----+----+----+----+----+----+ |----+----+----+----+----+----| + , Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, , + //`----+----+----+----+----+----/ \----+----+----+----+----+----' + A_DEL,S_EN,L_SPC,C_BS, C_BS,R_ENT,S_JA,A_DEL + // `----+----+----+----' `----+----+----+----' + ), + + // \ ^ ! & | @ = + * % - + // ( # $ " ' ~ ← ↓ ↑ → ` ) + // { [ ] } + + [_RAISE] = LAYOUT_kc( \ + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + ,BSLS,CIRC,EXLM,AMPR,PIPE, AT ,EQL ,PLUS,ASTR,PERC,MINS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LPRN,HASH,DLR ,DQT ,QUOT,TILD, LEFT,DOWN, UP ,RGHT,GRV ,RPRN, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , ,LCBR,LBRC, RBRC,RCBR, , , , , + //`----+----+----+----+----+----/ \----+----+----+----+----+----' + , ,BSPC, , , , ,RST + // `----+----+----+----' `----+----+----+----' + ), + + [_LOWER] = LAYOUT_kc( \ + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + , , ,MSF ,MSR ,MST , ,EQL ,PLUS,ASTR,PERC,MINS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , ,COMM,DOT ,SLSH, , + //`----+----+----+--+-+----+----/ \----+----+----+----+----+----' + RST , , , , ,DEL , , + // `----+----+----+----' `----+----+----+----' + ), +}; + +void matrix_init_user(void) { + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + iota_gfx_init(!has_usb()); // turns on the display + #endif +} + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +// When add source files to SRC in rules.mk, you can use functions. +const char *read_layer_state(void); +const char *read_logo(void); +void set_keylog(uint16_t keycode, keyrecord_t *record); +const char *read_keylog(void); +const char *read_keylogs(void); + +// const char *read_mode_icon(bool swap); +// const char *read_host_led_state(void); +// void set_timelog(void); +// const char *read_timelog(void); + +void matrix_scan_user(void) { + iota_gfx_task(); +} + +void matrix_render_user(struct CharacterMatrix *matrix) { + if (is_master) { + // If you want to change the display of OLED, you need to change here + matrix_write_ln(matrix, read_layer_state()); + matrix_write_ln(matrix, read_keylog()); + matrix_write_ln(matrix, read_keylogs()); + //matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui)); + //matrix_write_ln(matrix, read_host_led_state()); + //matrix_write_ln(matrix, read_timelog()); + } else { + matrix_write(matrix, read_logo()); + } +} + +void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +void iota_gfx_task_user(void) { + struct CharacterMatrix matrix; + matrix_clear(&matrix); + matrix_render_user(&matrix); + matrix_update(&display, &matrix); +} +#endif//SSD1306OLED + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { +#ifdef SSD1306OLED + set_keylog(keycode, record); +#endif + // set_timelog(); + } + + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + } else { + layer_off(_LOWER); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + } else { + layer_off(_RAISE); + } + return false; + break; + } + return true; +} + diff --git a/keyboards/claw44/lib/glcdfont.c b/keyboards/claw44/lib/glcdfont.c new file mode 100644 index 0000000000..91f53d9c24 --- /dev/null +++ b/keyboards/claw44/lib/glcdfont.c @@ -0,0 +1,243 @@ +// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0. +// See gfxfont.h for newer custom bitmap font info. + +#ifndef FONT5X7_H +#define FONT5X7_H + +#ifdef __AVR__ + #include <avr/io.h> + #include <avr/pgmspace.h> +#elif defined(ESP8266) + #include <pgmspace.h> +#else + #define PROGMEM +#endif + +// Standard ASCII 5x7 font +const unsigned char font[] PROGMEM = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, +0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, +0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, +0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, +0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, +0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, +0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, +0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, +0x00, 0x18, 0x24, 0x18, 0x00, 0x00, +0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, +0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, +0x26, 0x29, 0x79, 0x29, 0x26, 0x00, +0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, +0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, +0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, +0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, +0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, +0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, +0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, +0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, +0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, +0x60, 0x60, 0x60, 0x60, 0x60, 0x00, +0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, +0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, +0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, +0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, +0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, +0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, +0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, +0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, +0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, +0x00, 0x07, 0x00, 0x07, 0x00, 0x00, +0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, +0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, +0x23, 0x13, 0x08, 0x64, 0x62, 0x00, +0x36, 0x49, 0x56, 0x20, 0x50, 0x00, +0x00, 0x08, 0x07, 0x03, 0x00, 0x00, +0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, +0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, +0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, +0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, +0x00, 0x80, 0x70, 0x30, 0x00, 0x00, +0x08, 0x08, 0x08, 0x08, 0x08, 0x00, +0x00, 0x00, 0x60, 0x60, 0x00, 0x00, +0x20, 0x10, 0x08, 0x04, 0x02, 0x00, +0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, +0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, +0x72, 0x49, 0x49, 0x49, 0x46, 0x00, +0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, +0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, +0x27, 0x45, 0x45, 0x45, 0x39, 0x00, +0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, +0x41, 0x21, 0x11, 0x09, 0x07, 0x00, +0x36, 0x49, 0x49, 0x49, 0x36, 0x00, +0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, +0x00, 0x00, 0x14, 0x00, 0x00, 0x00, +0x00, 0x40, 0x34, 0x00, 0x00, 0x00, +0x00, 0x08, 0x14, 0x22, 0x41, 0x00, +0x14, 0x14, 0x14, 0x14, 0x14, 0x00, +0x00, 0x41, 0x22, 0x14, 0x08, 0x00, +0x02, 0x01, 0x59, 0x09, 0x06, 0x00, +0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, +0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, +0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, +0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, +0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, +0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, +0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, +0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, +0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, +0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, +0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, +0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, +0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, +0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, +0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, +0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, +0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, +0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, +0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, +0x26, 0x49, 0x49, 0x49, 0x32, 0x00, +0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, +0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, +0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, +0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, +0x63, 0x14, 0x08, 0x14, 0x63, 0x00, +0x03, 0x04, 0x78, 0x04, 0x03, 0x00, +0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, +0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, +0x02, 0x04, 0x08, 0x10, 0x20, 0x00, +0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, +0x04, 0x02, 0x01, 0x02, 0x04, 0x00, +0x40, 0x40, 0x40, 0x40, 0x40, 0x00, +0x00, 0x03, 0x07, 0x08, 0x00, 0x00, +0x20, 0x54, 0x54, 0x78, 0x40, 0x00, +0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, +0x38, 0x44, 0x44, 0x44, 0x28, 0x00, +0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, +0x38, 0x54, 0x54, 0x54, 0x18, 0x00, +0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, +0x18, 0x24, 0x24, 0x1C, 0x78, 0x00, +0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, +0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, +0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, +0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, +0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, +0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, +0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, +0x38, 0x44, 0x44, 0x44, 0x38, 0x00, +0x7C, 0x18, 0x24, 0x24, 0x18, 0x00, +0x18, 0x24, 0x24, 0x18, 0x7C, 0x00, +0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, +0x48, 0x54, 0x54, 0x54, 0x24, 0x00, +0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, +0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, +0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, +0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, +0x44, 0x28, 0x10, 0x28, 0x44, 0x00, +0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, +0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, +0x00, 0x08, 0x36, 0x41, 0x00, 0x00, +0x00, 0x00, 0x77, 0x00, 0x00, 0x00, +0x00, 0x41, 0x36, 0x08, 0x00, 0x00, +0x02, 0x01, 0x02, 0x04, 0x02, 0x00, +0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xFC, 0xFC, 0xFC, 0xFC, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, + 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, + 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0xC0, 0xF0, 0xF8, 0xF8, + 0xF8, 0xF8, 0xF8, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, + 0xE0, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, +0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00, +0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, +0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00, +0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B, +0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00, +0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE, +0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xF8, 0xFC, 0xFE, + 0xFF, 0x1F, 0x07, 0x07, 0x07, 0x07, + 0x1F, 0x1F, 0x1F, 0x1E, 0x18, 0x00, + 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, + 0x00, 0x00, 0x00, 0x9E, 0xDF, 0xDF, + 0xCF, 0xC7, 0xE7, 0xE7, 0xE7, 0xFF, + 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x03, + 0x3F, 0xFF, 0xFF, 0xFE, 0xC0, 0x00, + 0xF0, 0xFF, 0xFF, 0x1F, 0xFF, 0xFF, + 0xF0, 0x00, 0xC0, 0xFC, 0xFF, 0xFF, + 0x3F, 0x03, 0x00, 0xC0, 0xF0, 0xF8, + 0xFE, 0x9F, 0x87, 0x83, 0x80, 0xFF, + 0xFF, 0xFF, 0xFF, 0x80, 0x80, 0x00, + 0x00, 0xE0, 0xF8, 0xFC, 0xBF, 0x8F, + 0x83, 0x81, 0xFF, 0xFF, 0xFF, 0xFF, + 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, +0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, +0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, +0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, +0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, +0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, +0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, +0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x07, 0x1F, 0x3F, + 0x7F, 0x7C, 0x78, 0x70, 0x70, 0x78, + 0x7E, 0x3E, 0x3E, 0x0E, 0x06, 0x00, + 0x00, 0x7F, 0x7F, 0x7F, 0x7F, 0x00, + 0x00, 0x00, 0x1F, 0x3F, 0x7F, 0x7F, + 0x79, 0x71, 0x70, 0x30, 0x38, 0x3F, + 0x7F, 0x7F, 0x7F, 0x60, 0x00, 0x00, + 0x00, 0x01, 0x1F, 0x7F, 0x7F, 0x7E, + 0x7F, 0x1F, 0x01, 0x00, 0x01, 0x3F, + 0x7F, 0x7E, 0x7F, 0x7F, 0x0F, 0x01, + 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x7F, + 0x7F, 0x7F, 0x7F, 0x03, 0x03, 0x00, + 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x7F, 0x7F, 0x7F, 0x7F, + 0x07, 0x03, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; +#endif // FONT5X7_H diff --git a/keyboards/claw44/lib/host_led_state_reader.c b/keyboards/claw44/lib/host_led_state_reader.c new file mode 100644 index 0000000000..980823b318 --- /dev/null +++ b/keyboards/claw44/lib/host_led_state_reader.c @@ -0,0 +1,15 @@ +#include <stdio.h> +#include "claw44.h" + +char host_led_state_str[24]; + +const char *read_host_led_state(void) +{ + uint8_t leds = host_keyboard_leds(); + snprintf(host_led_state_str, sizeof(host_led_state_str), "NL:%s CL:%s SL:%s", + (leds & (1 << USB_LED_NUM_LOCK)) ? "on" : "- ", + (leds & (1 << USB_LED_CAPS_LOCK)) ? "on" : "- ", + (leds & (1 << USB_LED_SCROLL_LOCK)) ? "on" : "- "); + + return host_led_state_str; +} diff --git a/keyboards/claw44/lib/keylogger.c b/keyboards/claw44/lib/keylogger.c new file mode 100644 index 0000000000..092b6929bc --- /dev/null +++ b/keyboards/claw44/lib/keylogger.c @@ -0,0 +1,45 @@ +#include <stdio.h> +#include "claw44.h" + +char keylog_str[24] = {}; +char keylogs_str[21] = {}; +int keylogs_str_idx = 0; + +const char code_to_name[60] = { + ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', + 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', + 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', + '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', + 'R', 'E', 'B', 'T', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ';', '\'', ' ', ',', '.', '/', ' ', ' ', ' '}; + +void set_keylog(uint16_t keycode, keyrecord_t *record) { + char name = ' '; + if (keycode < 60) { + name = code_to_name[keycode]; + } + + // update keylog + snprintf(keylog_str, sizeof(keylog_str), "%dx%d, k%2d : %c", + record->event.key.row, record->event.key.col, + keycode, name); + + // update keylogs + if (keylogs_str_idx == sizeof(keylogs_str) - 1) { + keylogs_str_idx = 0; + for (int i = 0; i < sizeof(keylogs_str) - 1; i++) { + keylogs_str[i] = ' '; + } + } + + keylogs_str[keylogs_str_idx] = name; + keylogs_str_idx++; +} + +const char *read_keylog(void) { + return keylog_str; +} + +const char *read_keylogs(void) { + return keylogs_str; +} diff --git a/keyboards/claw44/lib/layer_state_reader.c b/keyboards/claw44/lib/layer_state_reader.c new file mode 100644 index 0000000000..d92b6df582 --- /dev/null +++ b/keyboards/claw44/lib/layer_state_reader.c @@ -0,0 +1,35 @@ + +#include QMK_KEYBOARD_H +#include <stdio.h> +#include "claw44.h" + +#define L_BASE 0 +#define L_LOWER (1<<_LOWER) +#define L_RAISE (1<<_RAISE) +#define L_ADJUST (1<<_ADJUST) +#define L_ADJUST_TRI (L_ADJUST|L_RAISE|L_LOWER) + +char layer_state_str[24]; + +const char *read_layer_state(void) { + switch (layer_state) + { + case L_BASE: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Default"); + break; + case L_RAISE: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Raise"); + break; + case L_LOWER: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Lower"); + break; + case L_ADJUST: + case L_ADJUST_TRI: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Adjust"); + break; + default: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Undef-%ld", layer_state); + } + + return layer_state_str; +} diff --git a/keyboards/claw44/lib/logo_reader.c b/keyboards/claw44/lib/logo_reader.c new file mode 100644 index 0000000000..b5b437b2b8 --- /dev/null +++ b/keyboards/claw44/lib/logo_reader.c @@ -0,0 +1,11 @@ +#include "claw44.h" + +const char *read_logo(void) { + static char logo[] = { + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, + 0}; + + return logo; +} diff --git a/keyboards/claw44/lib/mode_icon_reader.c b/keyboards/claw44/lib/mode_icon_reader.c new file mode 100644 index 0000000000..a9272bb9a7 --- /dev/null +++ b/keyboards/claw44/lib/mode_icon_reader.c @@ -0,0 +1,15 @@ +#include <stdio.h> +#include "claw44.h" + +char mode_icon[24]; + +const char *read_mode_icon(bool swap) { + static char logo[][2][3] = {{{0x95, 0x96, 0}, {0xb5, 0xb6, 0}}, {{0x97, 0x98, 0}, {0xb7, 0xb8, 0}}}; + if (swap == false) { + snprintf(mode_icon, sizeof(mode_icon), "%s\n%s", logo[0][0], logo[0][1]); + } else { + snprintf(mode_icon, sizeof(mode_icon), "%s\n%s", logo[1][0], logo[1][1]); + } + + return mode_icon; +} diff --git a/keyboards/claw44/lib/rgb_state_reader.c b/keyboards/claw44/lib/rgb_state_reader.c new file mode 100644 index 0000000000..e0efe2e528 --- /dev/null +++ b/keyboards/claw44/lib/rgb_state_reader.c @@ -0,0 +1,15 @@ +#ifdef RGBLIGHT_ENABLE + +#include QMK_KEYBOARD_H +#include <stdio.h> + +extern rgblight_config_t rgblight_config; +char rbf_info_str[24]; +const char *read_rgb_info(void) { + + snprintf(rbf_info_str, sizeof(rbf_info_str), "%s %2d h%3d s%3d v%3d", + rgblight_config.enable ? "on" : "- ", rgblight_config.mode, + rgblight_config.hue, rgblight_config.sat, rgblight_config.val); + return rbf_info_str; +} +#endif diff --git a/keyboards/claw44/lib/timelogger.c b/keyboards/claw44/lib/timelogger.c new file mode 100644 index 0000000000..ecd4ed3ea8 --- /dev/null +++ b/keyboards/claw44/lib/timelogger.c @@ -0,0 +1,16 @@ +#include <stdio.h> +#include "claw44.h" + +char timelog_str[24] = {}; +int last_time = 0; +int elapsed_time = 0; + +void set_timelog(void) { + elapsed_time = timer_elapsed(last_time); + last_time = timer_read(); + snprintf(timelog_str, sizeof(timelog_str), "lt:%5d, et:%5d", last_time, elapsed_time); +} + +const char *read_timelog(void) { + return timelog_str; +} diff --git a/keyboards/claw44/readme.md b/keyboards/claw44/readme.md new file mode 100644 index 0000000000..7e72e08971 --- /dev/null +++ b/keyboards/claw44/readme.md @@ -0,0 +1,15 @@ +# Claw44 + +![Claw44](https://i.imgur.com/5a8iogl.jpg) + +A split keyboard with 3x6 vertically staggered keys and 4 thumb keys. + +Keyboard Maintainer: [@yfuku_](https://twitter.com/yfuku_) +Hardware Supported: Claw44 PCB, ProMicro +Hardware Availability: https://yfuku.booth.pm/ + +Make example for this keyboard (after setting up your build environment): + + make claw44:default + +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/claw44/rev1/config.h b/keyboards/claw44/rev1/config.h new file mode 100644 index 0000000000..ba2ed4559e --- /dev/null +++ b/keyboards/claw44/rev1/config.h @@ -0,0 +1,76 @@ +/* +Copyright 2012 Jun Wako <wakojun@gmail.com> +Copyright 2015 Jack Humbert + +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 + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x3060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER yfuku +#define PRODUCT claw44 +#define DESCRIPTION A split keyboard with 3x6 vertically staggered keys and 4 thumb keys + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 8 +#define MATRIX_COLS 7 +#define MATRIX_ROW_PINS { D4, C6, D7, E6 } + +// wiring of each half +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2 } +// #define MATRIX_COL_PINS { B2, B3, B1, F7, F6, F5, F4 } //uncomment this line and comment line above if you need to reverse left-to-right key order + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +// #define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* 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 + +/* ws2812 RGB LED */ +/* +#define RGB_DI_PIN D3 + +#define RGBLED_NUM 12 // Number of LEDs +*/ + +/* + * 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 diff --git a/keyboards/orthodox/matrix.c b/keyboards/claw44/rev1/matrix.c index 2ca5f4d87a..718cc57448 100644 --- a/keyboards/orthodox/matrix.c +++ b/keyboards/claw44/rev1/matrix.c @@ -20,10 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <stdint.h> #include <stdbool.h> -#ifdef USE_I2C -// provides memcpy for copying TWI slave buffer -// #include <string.h> -#endif +#include <string.h> #include <avr/io.h> #include <avr/wdt.h> #include <avr/interrupt.h> @@ -34,12 +31,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "matrix.h" #include "split_util.h" #include "pro_micro.h" -#include "config.h" -#ifdef USE_I2C +#ifdef USE_MATRIX_I2C # include "i2c.h" #else // USE_SERIAL -# include "serial.h" +# include "split_scomm.h" #endif #ifndef DEBOUNCE @@ -51,6 +47,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. static uint8_t debouncing = DEBOUNCE; static const int ROWS_PER_HAND = MATRIX_ROWS/2; static uint8_t error_count = 0; +uint8_t is_master = 0 ; static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; @@ -63,6 +60,7 @@ static matrix_row_t read_cols(void); static void init_cols(void); static void unselect_rows(void); static void select_row(uint8_t row); +static uint8_t matrix_master_scan(void); __attribute__ ((weak)) @@ -105,6 +103,8 @@ void matrix_init(void) init_cols(); TX_RX_LED_INIT; + TXLED0; + RXLED0; // initialize matrix state: all keys off for (uint8_t i=0; i < MATRIX_ROWS; i++) { @@ -112,12 +112,14 @@ void matrix_init(void) matrix_debouncing[i] = 0; } + is_master = has_usb(); + matrix_init_quantum(); } uint8_t _matrix_scan(void) { - // Right hand is stored after the left in the matrix so, we need to offset it + // Right hand is stored after the left in the matirx so, we need to offset it int offset = isLeftHand ? 0 : (ROWS_PER_HAND); for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { @@ -144,7 +146,7 @@ uint8_t _matrix_scan(void) return 1; } -#ifdef USE_I2C +#ifdef USE_MATRIX_I2C // Get rows from other half over i2c int i2c_transaction(void) { @@ -162,31 +164,14 @@ int i2c_transaction(void) { if (err) goto i2c_error; if (!err) { - /* - // read from TWI byte-by-byte into matrix_row_t memory space - size_t i; - for (i = 0; i < SLAVE_BUFFER_SIZE-1; ++i) { - *((uint8_t*)&matrix[slaveOffset]+i) = i2c_master_read(I2C_ACK); + int i; + for (i = 0; i < ROWS_PER_HAND-1; ++i) { + matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); } - // last byte to be read / end of chunk - *((uint8_t*)&matrix[slaveOffset]+i) = i2c_master_read(I2C_NACK); - */ - - // kludge for column #9: unpack bits for keys (2,9) and (3,9) from (1,7) and (1,8) - // i2c_master_read(I2C_ACK); - matrix[slaveOffset+0] = i2c_master_read(I2C_ACK); - // i2c_master_read(I2C_ACK); - matrix[slaveOffset+1] = (matrix_row_t)i2c_master_read(I2C_ACK)\ - | (matrix[slaveOffset+0]&0x40U)<<2; - // i2c_master_read(I2C_ACK); - matrix[slaveOffset+2] = (matrix_row_t)i2c_master_read(I2C_NACK)\ - | (matrix[slaveOffset+0]&0x80U)<<1; - // clear highest two bits on row 1, where the col9 bits were transported - matrix[slaveOffset+0] &= 0x3F; - + matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); i2c_master_stop(); } else { -i2c_error: // the cable is disconnected, or something else went wrong +i2c_error: // the cable is disconnceted, or something else went wrong i2c_reset_state(); return err; } @@ -196,30 +181,64 @@ i2c_error: // the cable is disconnected, or something else went wrong #else // USE_SERIAL -int serial_transaction(void) { +int serial_transaction(int master_changed) { int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - if (serial_update_buffers()) { +#ifdef SERIAL_USE_MULTI_TRANSACTION + int ret=serial_update_buffers(master_changed); +#else + int ret=serial_update_buffers(); +#endif + if (ret ) { + if(ret==2) RXLED1; return 1; } - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; - } + RXLED0; + memcpy(&matrix[slaveOffset], + (void *)serial_slave_buffer, SERIAL_SLAVE_BUFFER_LENGTH); return 0; } #endif uint8_t matrix_scan(void) { + if (is_master) { + matrix_master_scan(); + }else{ + matrix_slave_scan(); + int offset = (isLeftHand) ? ROWS_PER_HAND : 0; + memcpy(&matrix[offset], + (void *)serial_master_buffer, SERIAL_MASTER_BUFFER_LENGTH); + matrix_scan_quantum(); + } + return 1; +} + + +uint8_t matrix_master_scan(void) { + int ret = _matrix_scan(); + int mchanged = 1; + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; +#ifdef USE_MATRIX_I2C +// for (int i = 0; i < ROWS_PER_HAND; ++i) { + /* i2c_slave_buffer[i] = matrix[offset+i]; */ +// i2c_slave_buffer[i] = matrix[offset+i]; +// } +#else // USE_SERIAL + #ifdef SERIAL_USE_MULTI_TRANSACTION + mchanged = memcmp((void *)serial_master_buffer, + &matrix[offset], SERIAL_MASTER_BUFFER_LENGTH); + #endif + memcpy((void *)serial_master_buffer, + &matrix[offset], SERIAL_MASTER_BUFFER_LENGTH); +#endif -#ifdef USE_I2C +#ifdef USE_MATRIX_I2C if( i2c_transaction() ) { #else // USE_SERIAL - if( serial_transaction() ) { + if( serial_transaction(mchanged) ) { #endif // turn on the indicator led when halves are disconnected TXLED1; @@ -247,29 +266,25 @@ void matrix_slave_scan(void) { int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; -#ifdef USE_I2C - // SLAVE_BUFFER_SIZE is from i2c.h - // (MATRIX_ROWS/2*sizeof(matrix_row_t)) - // memcpy((void*)i2c_slave_buffer, (const void*)&matrix[offset], (ROWS_PER_HAND*sizeof(matrix_row_t))); - - // kludge for column #9: put bits for keys (2,9) and (3,9) into (1,7) and (1,8) - i2c_slave_buffer[0] = (uint8_t)(matrix[offset+0])\ - | (matrix[offset+1]&0x100U)>>2\ - | (matrix[offset+2]&0x100U)>>1; - i2c_slave_buffer[1] = (uint8_t)(matrix[offset+1]); - i2c_slave_buffer[2] = (uint8_t)(matrix[offset+2]); - // note: looks like a possible operator-precedence bug here, in last version? - /* - i2c_slave_buffer[1] = (uint8_t)matrix[offset+0]; - i2c_slave_buffer[2] = (uint8_t)(matrix[offset+1]>>8); - i2c_slave_buffer[3] = (uint8_t)(matrix[offset+1]>>8); - i2c_slave_buffer[4] = (uint8_t)(matrix[offset+2]>>8); - i2c_slave_buffer[5] = (uint8_t)matrix[offset+2]; - */ +#ifdef USE_MATRIX_I2C + for (int i = 0; i < ROWS_PER_HAND; ++i) { + /* i2c_slave_buffer[i] = matrix[offset+i]; */ + i2c_slave_buffer[i] = matrix[offset+i]; + } #else // USE_SERIAL + #ifdef SERIAL_USE_MULTI_TRANSACTION + int change = 0; + #endif for (int i = 0; i < ROWS_PER_HAND; ++i) { + #ifdef SERIAL_USE_MULTI_TRANSACTION + if( serial_slave_buffer[i] != matrix[offset+i] ) + change = 1; + #endif serial_slave_buffer[i] = matrix[offset+i]; } + #ifdef SERIAL_USE_MULTI_TRANSACTION + slave_buffer_change_count += change; + #endif #endif } diff --git a/keyboards/claw44/rev1/rev1.c b/keyboards/claw44/rev1/rev1.c new file mode 100644 index 0000000000..9529636f56 --- /dev/null +++ b/keyboards/claw44/rev1/rev1.c @@ -0,0 +1,8 @@ +#include "claw44.h" + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + //led_set_user(usb_led); +} +#endif diff --git a/keyboards/claw44/rev1/rev1.h b/keyboards/claw44/rev1/rev1.h new file mode 100644 index 0000000000..f7ec2cbfe6 --- /dev/null +++ b/keyboards/claw44/rev1/rev1.h @@ -0,0 +1,57 @@ +#pragma once + +#include "../claw44.h" + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + +#ifdef RGBLIGHT_ENABLE +//rgb led driver +#include "ws2812.h" +#endif + +#ifdef USE_I2C +#include <stddef.h> +#ifdef __AVR__ + #include <avr/io.h> + #include <avr/interrupt.h> +#endif +#endif + +//void promicro_bootloader_jmp(bool program); +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, R30, R31, R32, R33 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { KC_NO, KC_NO, L30, L31, L32, L33 }, \ + { R05, R04, R03, R02, R01, R00 }, \ + { R15, R14, R13, R12, R11, R10 }, \ + { R25, R24, R23, R22, R21, R20 }, \ + { KC_NO, KC_NO, R33, R32, R31, R30 } \ + } + +#define LAYOUT_kc( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, R30, R31, R32, R33 \ + ) \ + LAYOUT( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##R30, KC_##R31, KC_##R32, KC_##R33 \ + ) + +enum layer_number { + _QWERTY = 0, + _LOWER, + _RAISE, + _ADJUST, +}; diff --git a/keyboards/claw44/rev1/rules.mk b/keyboards/claw44/rev1/rules.mk new file mode 100644 index 0000000000..ae95ec4014 --- /dev/null +++ b/keyboards/claw44/rev1/rules.mk @@ -0,0 +1,31 @@ +SRC += rev1/matrix.c +SRC += rev1/split_util.c +SRC += rev1/split_scomm.c + +# Build Options +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = no # Enable one-hand typing + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# If you want to change the display of OLED, you need to change here +SRC += ./lib/glcdfont.c \ + ./lib/layer_state_reader.c \ + ./lib/logo_reader.c \ + ./lib/keylogger.c \ + # ./lib/rgb_state_reader.c \ + # ./lib/mode_icon_reader.c \ + # ./lib/host_led_state_reader.c \ + # ./lib/timelogger.c \ diff --git a/keyboards/claw44/rev1/serial_config.h b/keyboards/claw44/rev1/serial_config.h new file mode 100644 index 0000000000..4fab8e8ddf --- /dev/null +++ b/keyboards/claw44/rev1/serial_config.h @@ -0,0 +1,4 @@ +#ifndef SOFT_SERIAL_PIN +#define SOFT_SERIAL_PIN D2 +#define SERIAL_USE_MULTI_TRANSACTION +#endif diff --git a/keyboards/claw44/rev1/split_scomm.c b/keyboards/claw44/rev1/split_scomm.c new file mode 100644 index 0000000000..a1fe6ba5b8 --- /dev/null +++ b/keyboards/claw44/rev1/split_scomm.c @@ -0,0 +1,91 @@ +#ifdef USE_SERIAL +#ifdef SERIAL_USE_MULTI_TRANSACTION +/* --- USE flexible API (using multi-type transaction function) --- */ + +#include <stdbool.h> +#include <stdint.h> +#include <stddef.h> +#include <split_scomm.h> +#include "serial.h" +#ifdef CONSOLE_ENABLE + #include <print.h> +#endif + +uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; +uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; +uint8_t volatile status_com = 0; +uint8_t volatile status1 = 0; +uint8_t slave_buffer_change_count = 0; +uint8_t s_change_old = 0xff; +uint8_t s_change_new = 0xff; + +SSTD_t transactions[] = { +#define GET_SLAVE_STATUS 0 + /* master buffer not changed, only recive slave_buffer_change_count */ + { (uint8_t *)&status_com, + 0, NULL, + sizeof(slave_buffer_change_count), &slave_buffer_change_count, + }, +#define PUT_MASTER_GET_SLAVE_STATUS 1 + /* master buffer changed need send, and recive slave_buffer_change_count */ + { (uint8_t *)&status_com, + sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer, + sizeof(slave_buffer_change_count), &slave_buffer_change_count, + }, +#define GET_SLAVE_BUFFER 2 + /* recive serial_slave_buffer */ + { (uint8_t *)&status1, + 0, NULL, + sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer + } +}; + +void serial_master_init(void) +{ + soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); +} + +void serial_slave_init(void) +{ + soft_serial_target_init(transactions, TID_LIMIT(transactions)); +} + +// 0 => no error +// 1 => slave did not respond +// 2 => checksum error +int serial_update_buffers(int master_update) +{ + int status, smatstatus; + static int need_retry = 0; + + if( s_change_old != s_change_new ) { + smatstatus = soft_serial_transaction(GET_SLAVE_BUFFER); + if( smatstatus == TRANSACTION_END ) { + s_change_old = s_change_new; +#ifdef CONSOLE_ENABLE + uprintf("slave matrix = %b %b %b %b\n", + serial_slave_buffer[0], serial_slave_buffer[1], + serial_slave_buffer[2], serial_slave_buffer[3]); +#endif + } + } else { + // serial_slave_buffer dosen't change + smatstatus = TRANSACTION_END; // dummy status + } + + if( !master_update && !need_retry) { + status = soft_serial_transaction(GET_SLAVE_STATUS); + } else { + status = soft_serial_transaction(PUT_MASTER_GET_SLAVE_STATUS); + } + if( status == TRANSACTION_END ) { + s_change_new = slave_buffer_change_count; + need_retry = 0; + } else { + need_retry = 1; + } + return smatstatus; +} + +#endif // SERIAL_USE_MULTI_TRANSACTION +#endif /* USE_SERIAL */ diff --git a/keyboards/claw44/rev1/split_scomm.h b/keyboards/claw44/rev1/split_scomm.h new file mode 100644 index 0000000000..873d8939d8 --- /dev/null +++ b/keyboards/claw44/rev1/split_scomm.h @@ -0,0 +1,24 @@ +#ifndef SPLIT_COMM_H +#define SPLIT_COMM_H + +#ifndef SERIAL_USE_MULTI_TRANSACTION +/* --- USE Simple API (OLD API, compatible with let's split serial.c) --- */ +#include "serial.h" + +#else +/* --- USE flexible API (using multi-type transaction function) --- */ +// Buffers for master - slave communication +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 + +extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; +extern uint8_t slave_buffer_change_count; + +void serial_master_init(void); +void serial_slave_init(void); +int serial_update_buffers(int master_changed); + +#endif + +#endif /* SPLIT_COMM_H */ diff --git a/keyboards/orthodox/split_util.c b/keyboards/claw44/rev1/split_util.c index 39639c3b4b..e1ff8b4379 100644 --- a/keyboards/orthodox/split_util.c +++ b/keyboards/claw44/rev1/split_util.c @@ -7,12 +7,11 @@ #include "split_util.h" #include "matrix.h" #include "keyboard.h" -#include "config.h" -#ifdef USE_I2C +#ifdef USE_MATRIX_I2C # include "i2c.h" #else -# include "serial.h" +# include "split_scomm.h" #endif volatile bool isLeftHand = true; @@ -31,18 +30,17 @@ static void setup_handedness(void) { } static void keyboard_master_setup(void) { -#ifdef USE_I2C + +#ifdef USE_MATRIX_I2C i2c_master_init(); -#ifdef SSD1306OLED - matrix_master_OLED_init (); -#endif #else serial_master_init(); #endif } static void keyboard_slave_setup(void) { -#ifdef USE_I2C + +#ifdef USE_MATRIX_I2C i2c_slave_init(SLAVE_I2C_ADDRESS); #else serial_slave_init(); @@ -66,19 +64,7 @@ void split_keyboard_setup(void) { sei(); } -void keyboard_slave_loop(void) { - matrix_init(); - - while (1) { - matrix_slave_scan(); - } -} - // this code runs before the usb and keyboard is initialized void matrix_setup(void) { split_keyboard_setup(); - - if (!has_usb()) { - keyboard_slave_loop(); - } } diff --git a/keyboards/orthodox/split_util.h b/keyboards/claw44/rev1/split_util.h index a0a8dd3bf4..687ca19bd3 100644 --- a/keyboards/orthodox/split_util.h +++ b/keyboards/claw44/rev1/split_util.h @@ -4,7 +4,6 @@ #include <stdbool.h> #include "eeconfig.h" - #define SLAVE_I2C_ADDRESS 0x32 extern volatile bool isLeftHand; @@ -14,7 +13,6 @@ void matrix_slave_scan(void); void split_keyboard_setup(void); bool has_usb(void); -void keyboard_slave_loop(void); void matrix_master_OLED_init (void); diff --git a/keyboards/claw44/rules.mk b/keyboards/claw44/rules.mk new file mode 100644 index 0000000000..907a5c8325 --- /dev/null +++ b/keyboards/claw44/rules.mk @@ -0,0 +1,74 @@ +SRC += i2c.c +SRC += serial.c +SRC += ssd1306.c + +# if firmware size over limit, try this option +# CFLAGS += -flto + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +CUSTOM_MATRIX = yes + +DEFAULT_FOLDER = claw44/rev1 diff --git a/keyboards/claw44/serial.c b/keyboards/claw44/serial.c new file mode 100644 index 0000000000..325c29a3f7 --- /dev/null +++ b/keyboards/claw44/serial.c @@ -0,0 +1,590 @@ +/* + * WARNING: be careful changing this code, it is very timing dependent + * + * 2018-10-28 checked + * avr-gcc 4.9.2 + * avr-gcc 5.4.0 + * avr-gcc 7.3.0 + */ + +#ifndef F_CPU +#define F_CPU 16000000 +#endif + +#include <avr/io.h> +#include <avr/interrupt.h> +#include <util/delay.h> +#include <stddef.h> +#include <stdbool.h> +#include "serial.h" +//#include <pro_micro.h> + +#ifdef SOFT_SERIAL_PIN + +#ifdef __AVR_ATmega32U4__ + // if using ATmega32U4 I2C, can not use PD0 and PD1 in soft serial. + #ifdef USE_I2C + #if SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1 + #error Using ATmega32U4 I2C, so can not use PD0, PD1 + #endif + #endif + + #if SOFT_SERIAL_PIN >= D0 && SOFT_SERIAL_PIN <= D3 + #define SERIAL_PIN_DDR DDRD + #define SERIAL_PIN_PORT PORTD + #define SERIAL_PIN_INPUT PIND + #if SOFT_SERIAL_PIN == D0 + #define SERIAL_PIN_MASK _BV(PD0) + #define EIMSK_BIT _BV(INT0) + #define EICRx_BIT (~(_BV(ISC00) | _BV(ISC01))) + #define SERIAL_PIN_INTERRUPT INT0_vect + #elif SOFT_SERIAL_PIN == D1 + #define SERIAL_PIN_MASK _BV(PD1) + #define EIMSK_BIT _BV(INT1) + #define EICRx_BIT (~(_BV(ISC10) | _BV(ISC11))) + #define SERIAL_PIN_INTERRUPT INT1_vect + #elif SOFT_SERIAL_PIN == D2 + #define SERIAL_PIN_MASK _BV(PD2) + #define EIMSK_BIT _BV(INT2) + #define EICRx_BIT (~(_BV(ISC20) | _BV(ISC21))) + #define SERIAL_PIN_INTERRUPT INT2_vect + #elif SOFT_SERIAL_PIN == D3 + #define SERIAL_PIN_MASK _BV(PD3) + #define EIMSK_BIT _BV(INT3) + #define EICRx_BIT (~(_BV(ISC30) | _BV(ISC31))) + #define SERIAL_PIN_INTERRUPT INT3_vect + #endif + #elif SOFT_SERIAL_PIN == E6 + #define SERIAL_PIN_DDR DDRE + #define SERIAL_PIN_PORT PORTE + #define SERIAL_PIN_INPUT PINE + #define SERIAL_PIN_MASK _BV(PE6) + #define EIMSK_BIT _BV(INT6) + #define EICRx_BIT (~(_BV(ISC60) | _BV(ISC61))) + #define SERIAL_PIN_INTERRUPT INT6_vect + #else + #error invalid SOFT_SERIAL_PIN value + #endif + +#else + #error serial.c now support ATmega32U4 only +#endif + +//////////////// for backward compatibility //////////////////////////////// +#ifndef SERIAL_USE_MULTI_TRANSACTION +/* --- USE Simple API (OLD API, compatible with let's split serial.c) */ + #if SERIAL_SLAVE_BUFFER_LENGTH > 0 + uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; + #endif + #if SERIAL_MASTER_BUFFER_LENGTH > 0 + uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; + #endif + uint8_t volatile status0 = 0; + +SSTD_t transactions[] = { + { (uint8_t *)&status0, + #if SERIAL_MASTER_BUFFER_LENGTH > 0 + sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer, + #else + 0, (uint8_t *)NULL, + #endif + #if SERIAL_SLAVE_BUFFER_LENGTH > 0 + sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer + #else + 0, (uint8_t *)NULL, + #endif + } +}; + +void serial_master_init(void) +{ soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } + +void serial_slave_init(void) +{ soft_serial_target_init(transactions, TID_LIMIT(transactions)); } + +// 0 => no error +// 1 => slave did not respond +// 2 => checksum error +int serial_update_buffers() +{ + int result; + result = soft_serial_transaction(); + return result; +} + +#endif // end of Simple API (OLD API, compatible with let's split serial.c) +//////////////////////////////////////////////////////////////////////////// + +#define ALWAYS_INLINE __attribute__((always_inline)) +#define NO_INLINE __attribute__((noinline)) +#define _delay_sub_us(x) __builtin_avr_delay_cycles(x) + +// parity check +#define ODD_PARITY 1 +#define EVEN_PARITY 0 +#define PARITY EVEN_PARITY + +#ifdef SERIAL_DELAY + // custom setup in config.h + // #define TID_SEND_ADJUST 2 + // #define SERIAL_DELAY 6 // micro sec + // #define READ_WRITE_START_ADJUST 30 // cycles + // #define READ_WRITE_WIDTH_ADJUST 8 // cycles +#else +// ============ Standard setups ============ + +#ifndef SELECT_SOFT_SERIAL_SPEED +#define SELECT_SOFT_SERIAL_SPEED 1 +// 0: about 189kbps +// 1: about 137kbps (default) +// 2: about 75kbps +// 3: about 39kbps +// 4: about 26kbps +// 5: about 20kbps +#endif + +#if __GNUC__ < 6 + #define TID_SEND_ADJUST 14 +#else + #define TID_SEND_ADJUST 2 +#endif + +#if SELECT_SOFT_SERIAL_SPEED == 0 + // Very High speed + #define SERIAL_DELAY 4 // micro sec + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 34 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 1 + // High speed + #define SERIAL_DELAY 6 // micro sec + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 2 + // Middle speed + #define SERIAL_DELAY 12 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 3 + // Low speed + #define SERIAL_DELAY 24 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 4 + // Very Low speed + #define SERIAL_DELAY 36 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 5 + // Ultra Low speed + #define SERIAL_DELAY 48 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#else +#error invalid SELECT_SOFT_SERIAL_SPEED value +#endif /* SELECT_SOFT_SERIAL_SPEED */ +#endif /* SERIAL_DELAY */ + +#define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) +#define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) + +#define SLAVE_INT_WIDTH_US 1 +#ifndef SERIAL_USE_MULTI_TRANSACTION + #define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY +#else + #define SLAVE_INT_ACK_WIDTH_UNIT 2 + #define SLAVE_INT_ACK_WIDTH 4 +#endif + +static SSTD_t *Transaction_table = NULL; +static uint8_t Transaction_table_size = 0; + +inline static void serial_delay(void) ALWAYS_INLINE; +inline static +void serial_delay(void) { + _delay_us(SERIAL_DELAY); +} + +inline static void serial_delay_half1(void) ALWAYS_INLINE; +inline static +void serial_delay_half1(void) { + _delay_us(SERIAL_DELAY_HALF1); +} + +inline static void serial_delay_half2(void) ALWAYS_INLINE; +inline static +void serial_delay_half2(void) { + _delay_us(SERIAL_DELAY_HALF2); +} + +inline static void serial_output(void) ALWAYS_INLINE; +inline static +void serial_output(void) { + SERIAL_PIN_DDR |= SERIAL_PIN_MASK; +} + +// make the serial pin an input with pull-up resistor +inline static void serial_input_with_pullup(void) ALWAYS_INLINE; +inline static +void serial_input_with_pullup(void) { + SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +inline static uint8_t serial_read_pin(void) ALWAYS_INLINE; +inline static +uint8_t serial_read_pin(void) { + return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); +} + +inline static void serial_low(void) ALWAYS_INLINE; +inline static +void serial_low(void) { + SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; +} + +inline static void serial_high(void) ALWAYS_INLINE; +inline static +void serial_high(void) { + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size) +{ + Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; + serial_output(); + serial_high(); +} + +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size) +{ + Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; + serial_input_with_pullup(); + + // Enable INT0-INT3,INT6 + EIMSK |= EIMSK_BIT; +#if SERIAL_PIN_MASK == _BV(PE6) + // Trigger on falling edge of INT6 + EICRB &= EICRx_BIT; +#else + // Trigger on falling edge of INT0-INT3 + EICRA &= EICRx_BIT; +#endif +} + +// Used by the sender to synchronize timing with the reciver. +static void sync_recv(void) NO_INLINE; +static +void sync_recv(void) { + for (uint8_t i = 0; i < SERIAL_DELAY*5 && serial_read_pin(); i++ ) { + } + // This shouldn't hang if the target disconnects because the + // serial line will float to high if the target does disconnect. + while (!serial_read_pin()); +} + +// Used by the reciver to send a synchronization signal to the sender. +static void sync_send(void) NO_INLINE; +static +void sync_send(void) { + serial_low(); + serial_delay(); + serial_high(); +} + +// Reads a byte from the serial line +static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) NO_INLINE; +static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) { + uint8_t byte, i, p, pb; + + _delay_sub_us(READ_WRITE_START_ADJUST); + for( i = 0, byte = 0, p = PARITY; i < bit; i++ ) { + serial_delay_half1(); // read the middle of pulses + if( serial_read_pin() ) { + byte = (byte << 1) | 1; p ^= 1; + } else { + byte = (byte << 1) | 0; p ^= 0; + } + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); + } + /* recive parity bit */ + serial_delay_half1(); // read the middle of pulses + pb = serial_read_pin(); + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); + + *pterrcount += (p != pb)? 1 : 0; + + return byte; +} + +// Sends a byte with MSB ordering +void serial_write_chunk(uint8_t data, uint8_t bit) NO_INLINE; +void serial_write_chunk(uint8_t data, uint8_t bit) { + uint8_t b, p; + for( p = PARITY, b = 1<<(bit-1); b ; b >>= 1) { + if(data & b) { + serial_high(); p ^= 1; + } else { + serial_low(); p ^= 0; + } + serial_delay(); + } + /* send parity bit */ + if(p & 1) { serial_high(); } + else { serial_low(); } + serial_delay(); + + serial_low(); // sync_send() / senc_recv() need raise edge +} + +static void serial_send_packet(uint8_t *buffer, uint8_t size) NO_INLINE; +static +void serial_send_packet(uint8_t *buffer, uint8_t size) { + for (uint8_t i = 0; i < size; ++i) { + uint8_t data; + data = buffer[i]; + sync_send(); + serial_write_chunk(data,8); + } +} + +static uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) NO_INLINE; +static +uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) { + uint8_t pecount = 0; + for (uint8_t i = 0; i < size; ++i) { + uint8_t data; + sync_recv(); + data = serial_read_chunk(&pecount, 8); + buffer[i] = data; + } + return pecount == 0; +} + +inline static +void change_sender2reciver(void) { + sync_send(); //0 + serial_delay_half1(); //1 + serial_low(); //2 + serial_input_with_pullup(); //2 + serial_delay_half1(); //3 +} + +inline static +void change_reciver2sender(void) { + sync_recv(); //0 + serial_delay(); //1 + serial_low(); //3 + serial_output(); //3 + serial_delay_half1(); //4 +} + +static inline uint8_t nibble_bits_count(uint8_t bits) +{ + bits = (bits & 0x5) + (bits >> 1 & 0x5); + bits = (bits & 0x3) + (bits >> 2 & 0x3); + return bits; +} + +// interrupt handle to be used by the target device +ISR(SERIAL_PIN_INTERRUPT) { + +#ifndef SERIAL_USE_MULTI_TRANSACTION + serial_low(); + serial_output(); + SSTD_t *trans = Transaction_table; +#else + // recive transaction table index + uint8_t tid, bits; + uint8_t pecount = 0; + sync_recv(); + bits = serial_read_chunk(&pecount,7); + tid = bits>>3; + bits = (bits&7) != nibble_bits_count(tid); + if( bits || pecount> 0 || tid > Transaction_table_size ) { + return; + } + serial_delay_half1(); + + serial_high(); // response step1 low->high + serial_output(); + _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT*SLAVE_INT_ACK_WIDTH); + SSTD_t *trans = &Transaction_table[tid]; + serial_low(); // response step2 ack high->low +#endif + + // target send phase + if( trans->target2initiator_buffer_size > 0 ) + serial_send_packet((uint8_t *)trans->target2initiator_buffer, + trans->target2initiator_buffer_size); + // target switch to input + change_sender2reciver(); + + // target recive phase + if( trans->initiator2target_buffer_size > 0 ) { + if (serial_recive_packet((uint8_t *)trans->initiator2target_buffer, + trans->initiator2target_buffer_size) ) { + *trans->status = TRANSACTION_ACCEPTED; + } else { + *trans->status = TRANSACTION_DATA_ERROR; + } + } else { + *trans->status = TRANSACTION_ACCEPTED; + } + + sync_recv(); //weit initiator output to high +} + +///////// +// start transaction by initiator +// +// int soft_serial_transaction(int sstd_index) +// +// Returns: +// TRANSACTION_END +// TRANSACTION_NO_RESPONSE +// TRANSACTION_DATA_ERROR +// this code is very time dependent, so we need to disable interrupts +#ifndef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_transaction(void) { + SSTD_t *trans = Transaction_table; +#else +int soft_serial_transaction(int sstd_index) { + if( sstd_index > Transaction_table_size ) + return TRANSACTION_TYPE_ERROR; + SSTD_t *trans = &Transaction_table[sstd_index]; +#endif + cli(); + + // signal to the target that we want to start a transaction + serial_output(); + serial_low(); + _delay_us(SLAVE_INT_WIDTH_US); + +#ifndef SERIAL_USE_MULTI_TRANSACTION + // wait for the target response + serial_input_with_pullup(); + _delay_us(SLAVE_INT_RESPONSE_TIME); + + // check if the target is present + if (serial_read_pin()) { + // target failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; + sei(); + return TRANSACTION_NO_RESPONSE; + } + +#else + // send transaction table index + int tid = (sstd_index<<3) | (7 & nibble_bits_count(sstd_index)); + sync_send(); + _delay_sub_us(TID_SEND_ADJUST); + serial_write_chunk(tid, 7); + serial_delay_half1(); + + // wait for the target response (step1 low->high) + serial_input_with_pullup(); + while( !serial_read_pin() ) { + _delay_sub_us(2); + } + + // check if the target is present (step2 high->low) + for( int i = 0; serial_read_pin(); i++ ) { + if (i > SLAVE_INT_ACK_WIDTH + 1) { + // slave failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; + sei(); + return TRANSACTION_NO_RESPONSE; + } + _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT); + } +#endif + + // initiator recive phase + // if the target is present syncronize with it + if( trans->target2initiator_buffer_size > 0 ) { + if (!serial_recive_packet((uint8_t *)trans->target2initiator_buffer, + trans->target2initiator_buffer_size) ) { + serial_output(); + serial_high(); + *trans->status = TRANSACTION_DATA_ERROR; + sei(); + return TRANSACTION_DATA_ERROR; + } + } + + // initiator switch to output + change_reciver2sender(); + + // initiator send phase + if( trans->initiator2target_buffer_size > 0 ) { + serial_send_packet((uint8_t *)trans->initiator2target_buffer, + trans->initiator2target_buffer_size); + } + + // always, release the line when not in use + sync_send(); + + *trans->status = TRANSACTION_END; + sei(); + return TRANSACTION_END; +} + +#ifdef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_get_and_clean_status(int sstd_index) { + SSTD_t *trans = &Transaction_table[sstd_index]; + cli(); + int retval = *trans->status; + *trans->status = 0;; + sei(); + return retval; +} +#endif + +#endif + +// Helix serial.c history +// 2018-1-29 fork from let's split and add PD2, modify sync_recv() (#2308, bceffdefc) +// 2018-6-28 bug fix master to slave comm and speed up (#3255, 1038bbef4) +// (adjusted with avr-gcc 4.9.2) +// 2018-7-13 remove USE_SERIAL_PD2 macro (#3374, f30d6dd78) +// (adjusted with avr-gcc 4.9.2) +// 2018-8-11 add support multi-type transaction (#3608, feb5e4aae) +// (adjusted with avr-gcc 4.9.2) +// 2018-10-21 fix serial and RGB animation conflict (#4191, 4665e4fff) +// (adjusted with avr-gcc 7.3.0) +// 2018-10-28 re-adjust compiler depend value of delay (#4269, 8517f8a66) +// (adjusted with avr-gcc 5.4.0, 7.3.0) diff --git a/keyboards/claw44/serial.h b/keyboards/claw44/serial.h new file mode 100644 index 0000000000..7e0c0847a4 --- /dev/null +++ b/keyboards/claw44/serial.h @@ -0,0 +1,84 @@ +#ifndef SOFT_SERIAL_H +#define SOFT_SERIAL_H + +#include <stdbool.h> + +// ///////////////////////////////////////////////////////////////// +// Need Soft Serial defines in config.h +// ///////////////////////////////////////////////////////////////// +// ex. +// #define SOFT_SERIAL_PIN ?? // ?? = D0,D1,D2,D3,E6 +// OPTIONAL: #define SELECT_SOFT_SERIAL_SPEED ? // ? = 1,2,3,4,5 +// // 1: about 137kbps (default) +// // 2: about 75kbps +// // 3: about 39kbps +// // 4: about 26kbps +// // 5: about 20kbps +// +// //// USE Simple API (OLD API, compatible with let's split serial.c) +// ex. +// #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +// #define SERIAL_MASTER_BUFFER_LENGTH 1 +// +// //// USE flexible API (using multi-type transaction function) +// #define SERIAL_USE_MULTI_TRANSACTION +// +// ///////////////////////////////////////////////////////////////// + + +#ifndef SERIAL_USE_MULTI_TRANSACTION +/* --- USE Simple API (OLD API, compatible with let's split serial.c) */ +#if SERIAL_SLAVE_BUFFER_LENGTH > 0 +extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +#endif +#if SERIAL_MASTER_BUFFER_LENGTH > 0 +extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; +#endif + +void serial_master_init(void); +void serial_slave_init(void); +int serial_update_buffers(void); + +#endif // USE Simple API + +// Soft Serial Transaction Descriptor +typedef struct _SSTD_t { + uint8_t *status; + uint8_t initiator2target_buffer_size; + uint8_t *initiator2target_buffer; + uint8_t target2initiator_buffer_size; + uint8_t *target2initiator_buffer; +} SSTD_t; +#define TID_LIMIT( table ) (sizeof(table) / sizeof(SSTD_t)) + +// initiator is transaction start side +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size); +// target is interrupt accept side +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size); + +// initiator resullt +#define TRANSACTION_END 0 +#define TRANSACTION_NO_RESPONSE 0x1 +#define TRANSACTION_DATA_ERROR 0x2 +#define TRANSACTION_TYPE_ERROR 0x4 +#ifndef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_transaction(void); +#else +int soft_serial_transaction(int sstd_index); +#endif + +// target status +// *SSTD_t.status has +// initiator: +// TRANSACTION_END +// or TRANSACTION_NO_RESPONSE +// or TRANSACTION_DATA_ERROR +// target: +// TRANSACTION_DATA_ERROR +// or TRANSACTION_ACCEPTED +#define TRANSACTION_ACCEPTED 0x8 +#ifdef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_get_and_clean_status(int sstd_index); +#endif + +#endif /* SOFT_SERIAL_H */ diff --git a/keyboards/claw44/ssd1306.c b/keyboards/claw44/ssd1306.c new file mode 100644 index 0000000000..781c722638 --- /dev/null +++ b/keyboards/claw44/ssd1306.c @@ -0,0 +1,346 @@ +#ifdef SSD1306OLED + +#include "ssd1306.h" +#include "i2c.h" +#include <string.h> +#include "print.h" +#ifdef ADAFRUIT_BLE_ENABLE +#include "adafruit_ble.h" +#endif +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#endif +#include "sendchar.h" +#include "timer.h" + +static const unsigned char font[] PROGMEM; + +// Set this to 1 to help diagnose early startup problems +// when testing power-on with ble. Turn it off otherwise, +// as the latency of printing most of the debug info messes +// with the matrix scan, causing keys to drop. +#define DEBUG_TO_SCREEN 0 + +//static uint16_t last_battery_update; +//static uint32_t vbat; +//#define BatteryUpdateInterval 10000 /* milliseconds */ + +// 'last_flush' is declared as uint16_t, +// so this must be less than 65535 +#define ScreenOffInterval 60000 /* milliseconds */ +#if DEBUG_TO_SCREEN +static uint8_t displaying; +#endif +static uint16_t last_flush; + +static bool force_dirty = true; + +// Write command sequence. +// Returns true on success. +static inline bool _send_cmd1(uint8_t cmd) { + bool res = false; + + if (i2c_start_write(SSD1306_ADDRESS)) { + xprintf("failed to start write to %d\n", SSD1306_ADDRESS); + goto done; + } + + if (i2c_master_write(0x0 /* command byte follows */)) { + print("failed to write control byte\n"); + + goto done; + } + + if (i2c_master_write(cmd)) { + xprintf("failed to write command %d\n", cmd); + goto done; + } + res = true; +done: + i2c_master_stop(); + return res; +} + +// Write 2-byte command sequence. +// Returns true on success +static inline bool _send_cmd2(uint8_t cmd, uint8_t opr) { + if (!_send_cmd1(cmd)) { + return false; + } + return _send_cmd1(opr); +} + +// Write 3-byte command sequence. +// Returns true on success +static inline bool _send_cmd3(uint8_t cmd, uint8_t opr1, uint8_t opr2) { + if (!_send_cmd1(cmd)) { + return false; + } + if (!_send_cmd1(opr1)) { + return false; + } + return _send_cmd1(opr2); +} + +#define send_cmd1(c) if (!_send_cmd1(c)) {goto done;} +#define send_cmd2(c,o) if (!_send_cmd2(c,o)) {goto done;} +#define send_cmd3(c,o1,o2) if (!_send_cmd3(c,o1,o2)) {goto done;} + +static void clear_display(void) { + matrix_clear(&display); + + // Clear all of the display bits (there can be random noise + // in the RAM on startup) + send_cmd3(PageAddr, 0, (DisplayHeight / 8) - 1); + send_cmd3(ColumnAddr, 0, DisplayWidth - 1); + + if (i2c_start_write(SSD1306_ADDRESS)) { + goto done; + } + if (i2c_master_write(0x40)) { + // Data mode + goto done; + } + for (uint8_t row = 0; row < MatrixRows; ++row) { + for (uint8_t col = 0; col < DisplayWidth; ++col) { + i2c_master_write(0); + } + } + + display.dirty = false; + +done: + i2c_master_stop(); +} + +#if DEBUG_TO_SCREEN +#undef sendchar +static int8_t capture_sendchar(uint8_t c) { + sendchar(c); + iota_gfx_write_char(c); + + if (!displaying) { + iota_gfx_flush(); + } + return 0; +} +#endif + +bool iota_gfx_init(bool rotate) { + bool success = false; + + i2c_master_init(); + send_cmd1(DisplayOff); + send_cmd2(SetDisplayClockDiv, 0x80); + send_cmd2(SetMultiPlex, DisplayHeight - 1); + + send_cmd2(SetDisplayOffset, 0); + + + send_cmd1(SetStartLine | 0x0); + send_cmd2(SetChargePump, 0x14 /* Enable */); + send_cmd2(SetMemoryMode, 0 /* horizontal addressing */); + + if(rotate){ + // the following Flip the display orientation 180 degrees + send_cmd1(SegRemap); + send_cmd1(ComScanInc); + }else{ + // Flips the display orientation 0 degrees + send_cmd1(SegRemap | 0x1); + send_cmd1(ComScanDec); + } + + send_cmd2(SetComPins, 0x2); + send_cmd2(SetContrast, 0x8f); + send_cmd2(SetPreCharge, 0xf1); + send_cmd2(SetVComDetect, 0x40); + send_cmd1(DisplayAllOnResume); + send_cmd1(NormalDisplay); + send_cmd1(DeActivateScroll); + send_cmd1(DisplayOn); + + send_cmd2(SetContrast, 0); // Dim + + clear_display(); + + success = true; + + iota_gfx_flush(); + +#if DEBUG_TO_SCREEN + print_set_sendchar(capture_sendchar); +#endif + +done: + return success; +} + +bool iota_gfx_off(void) { + bool success = false; + + send_cmd1(DisplayOff); + success = true; + +done: + return success; +} + +bool iota_gfx_on(void) { + bool success = false; + + send_cmd1(DisplayOn); + success = true; + +done: + return success; +} + +void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c) { + *matrix->cursor = c; + ++matrix->cursor; + + if (matrix->cursor - &matrix->display[0][0] == sizeof(matrix->display)) { + // We went off the end; scroll the display upwards by one line + memmove(&matrix->display[0], &matrix->display[1], + MatrixCols * (MatrixRows - 1)); + matrix->cursor = &matrix->display[MatrixRows - 1][0]; + memset(matrix->cursor, ' ', MatrixCols); + } +} + +void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c) { + matrix->dirty = true; + + if (c == '\n') { + // Clear to end of line from the cursor and then move to the + // start of the next line + uint8_t cursor_col = (matrix->cursor - &matrix->display[0][0]) % MatrixCols; + + while (cursor_col++ < MatrixCols) { + matrix_write_char_inner(matrix, ' '); + } + return; + } + + matrix_write_char_inner(matrix, c); +} + +void iota_gfx_write_char(uint8_t c) { + matrix_write_char(&display, c); +} + +void matrix_write(struct CharacterMatrix *matrix, const char *data) { + const char *end = data + strlen(data); + while (data < end) { + matrix_write_char(matrix, *data); + ++data; + } +} + +void matrix_write_ln(struct CharacterMatrix *matrix, const char *data) { + char data_ln[strlen(data)+2]; + snprintf(data_ln, sizeof(data_ln), "%s\n", data); + matrix_write(matrix, data_ln); +} + +void iota_gfx_write(const char *data) { + matrix_write(&display, data); +} + +void matrix_write_P(struct CharacterMatrix *matrix, const char *data) { + while (true) { + uint8_t c = pgm_read_byte(data); + if (c == 0) { + return; + } + matrix_write_char(matrix, c); + ++data; + } +} + +void iota_gfx_write_P(const char *data) { + matrix_write_P(&display, data); +} + +void matrix_clear(struct CharacterMatrix *matrix) { + memset(matrix->display, ' ', sizeof(matrix->display)); + matrix->cursor = &matrix->display[0][0]; + matrix->dirty = true; +} + +void iota_gfx_clear_screen(void) { + matrix_clear(&display); +} + +void matrix_render(struct CharacterMatrix *matrix) { + last_flush = timer_read(); + iota_gfx_on(); +#if DEBUG_TO_SCREEN + ++displaying; +#endif + + // Move to the home position + send_cmd3(PageAddr, 0, MatrixRows - 1); + send_cmd3(ColumnAddr, 0, (MatrixCols * FontWidth) - 1); + + if (i2c_start_write(SSD1306_ADDRESS)) { + goto done; + } + if (i2c_master_write(0x40)) { + // Data mode + goto done; + } + + for (uint8_t row = 0; row < MatrixRows; ++row) { + for (uint8_t col = 0; col < MatrixCols; ++col) { + const uint8_t *glyph = font + (matrix->display[row][col] * FontWidth); + + for (uint8_t glyphCol = 0; glyphCol < FontWidth; ++glyphCol) { + uint8_t colBits = pgm_read_byte(glyph + glyphCol); + i2c_master_write(colBits); + } + + // 1 column of space between chars (it's not included in the glyph) + //i2c_master_write(0); + } + } + + matrix->dirty = false; + +done: + i2c_master_stop(); +#if DEBUG_TO_SCREEN + --displaying; +#endif +} + +void iota_gfx_flush(void) { + matrix_render(&display); +} + +__attribute__ ((weak)) +void iota_gfx_task_user(void) { +} + +void iota_gfx_task(void) { + iota_gfx_task_user(); + + if (display.dirty|| force_dirty) { + iota_gfx_flush(); + force_dirty = false; + } + + /* + if (timer_elapsed(last_flush) > ScreenOffInterval) { + iota_gfx_off(); + } + */ +} + +bool process_record_gfx(uint16_t keycode, keyrecord_t *record) { + force_dirty = true; + return true; +} + +#endif diff --git a/keyboards/claw44/ssd1306.h b/keyboards/claw44/ssd1306.h new file mode 100644 index 0000000000..ea8c923280 --- /dev/null +++ b/keyboards/claw44/ssd1306.h @@ -0,0 +1,91 @@ +#pragma once + +#include <stdbool.h> +#include <stdio.h> +#include "pincontrol.h" +#include "action.h" + +enum ssd1306_cmds { + DisplayOff = 0xAE, + DisplayOn = 0xAF, + + SetContrast = 0x81, + DisplayAllOnResume = 0xA4, + + DisplayAllOn = 0xA5, + NormalDisplay = 0xA6, + InvertDisplay = 0xA7, + SetDisplayOffset = 0xD3, + SetComPins = 0xda, + SetVComDetect = 0xdb, + SetDisplayClockDiv = 0xD5, + SetPreCharge = 0xd9, + SetMultiPlex = 0xa8, + SetLowColumn = 0x00, + SetHighColumn = 0x10, + SetStartLine = 0x40, + + SetMemoryMode = 0x20, + ColumnAddr = 0x21, + PageAddr = 0x22, + + ComScanInc = 0xc0, + ComScanDec = 0xc8, + SegRemap = 0xa0, + SetChargePump = 0x8d, + ExternalVcc = 0x01, + SwitchCapVcc = 0x02, + + ActivateScroll = 0x2f, + DeActivateScroll = 0x2e, + SetVerticalScrollArea = 0xa3, + RightHorizontalScroll = 0x26, + LeftHorizontalScroll = 0x27, + VerticalAndRightHorizontalScroll = 0x29, + VerticalAndLeftHorizontalScroll = 0x2a, +}; + +// Controls the SSD1306 128x32 OLED display via i2c + +#ifndef SSD1306_ADDRESS +#define SSD1306_ADDRESS 0x3C +#endif + +#define DisplayHeight 32 +#define DisplayWidth 128 + +#define FontHeight 8 +#define FontWidth 6 + +#define MatrixRows (DisplayHeight / FontHeight) +#define MatrixCols (DisplayWidth / FontWidth) + +struct CharacterMatrix { + uint8_t display[MatrixRows][MatrixCols]; + uint8_t *cursor; + bool dirty; +}; + +struct CharacterMatrix display; + +bool iota_gfx_init(bool rotate); +void iota_gfx_task(void); +bool iota_gfx_off(void); +bool iota_gfx_on(void); +void iota_gfx_flush(void); +void iota_gfx_write_char(uint8_t c); +void iota_gfx_write(const char *data); +void iota_gfx_write_P(const char *data); +void iota_gfx_clear_screen(void); + +void iota_gfx_task_user(void); + +void matrix_clear(struct CharacterMatrix *matrix); +void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c); +void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c); +void matrix_write(struct CharacterMatrix *matrix, const char *data); +void matrix_write_ln(struct CharacterMatrix *matrix, const char *data); +void matrix_write_P(struct CharacterMatrix *matrix, const char *data); +void matrix_render(struct CharacterMatrix *matrix); + +bool process_record_gfx(uint16_t keycode, keyrecord_t *record);
\ No newline at end of file diff --git a/keyboards/clueboard/2x1800/keymaps/default/config.h b/keyboards/clueboard/2x1800/keymaps/default/config.h index 152e2f1487..dd48c69e36 100644 --- a/keyboards/clueboard/2x1800/keymaps/default/config.h +++ b/keyboards/clueboard/2x1800/keymaps/default/config.h @@ -16,6 +16,4 @@ #pragma once -#include "config_common.h" - // place overrides here diff --git a/keyboards/clueboard/66_hotswap/gen1/config.h b/keyboards/clueboard/66_hotswap/gen1/config.h index 6b0cfb60b5..795adecd56 100644 --- a/keyboards/clueboard/66_hotswap/gen1/config.h +++ b/keyboards/clueboard/66_hotswap/gen1/config.h @@ -80,11 +80,6 @@ */ //#define FORCE_NKRO -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/comet46/keymaps/default/config.h b/keyboards/comet46/keymaps/default/config.h index 7873cf5a72..ee02a94b7e 100644 --- a/keyboards/comet46/keymaps/default/config.h +++ b/keyboards/comet46/keymaps/default/config.h @@ -18,14 +18,12 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once + +// place overrides here -// #include "../../config.h" /* Use I2C or Serial */ #define USE_I2C #define SSD1306OLED - -#endif diff --git a/keyboards/contra/keymaps/default/config.h b/keyboards/contra/keymaps/default/config.h index a1635f2bab..d61ee2938e 100644 --- a/keyboards/contra/keymaps/default/config.h +++ b/keyboards/contra/keymaps/default/config.h @@ -1,7 +1,5 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "config_common.h" #ifdef AUDIO_ENABLE #define STARTUP_SONG SONG(PLANCK_SOUND) @@ -25,7 +23,7 @@ /* enable basic MIDI features: - MIDI notes can be sent when in Music mode is on */ - + #define MIDI_BASIC /* enable advanced MIDI features: @@ -38,5 +36,3 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 2 - -#endif
\ No newline at end of file diff --git a/keyboards/contra/keymaps/msiu/config.h b/keyboards/contra/keymaps/msiu/config.h new file mode 100644 index 0000000000..8757eb70d4 --- /dev/null +++ b/keyboards/contra/keymaps/msiu/config.h @@ -0,0 +1,37 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 diff --git a/keyboards/contra/keymaps/msiu/keymap.c b/keyboards/contra/keymaps/msiu/keymap.c new file mode 100644 index 0000000000..c68c2c7bbf --- /dev/null +++ b/keyboards/contra/keymaps/msiu/keymap.c @@ -0,0 +1,175 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _DVORAK, + _LOWER, + _RAISE, + _NUMB, + _FUNC, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + DVORAK, + LOWER, + RAISE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,------------------------------------------------------------------------------------------. + * | Tab / Numb | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |-------------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc / Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | + * |-------------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift | Z | X | C | V | B | N | M | , | . | / |Enter | + * |-------------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl |Hyper | Alt | GUI |Lower | Func |Space |Raise | Left | Down | Up |Right | + * `------------------------------------------------------------------------------------------' + */ + [_QWERTY] = LAYOUT_ortho_4x12( + LT(_NUMB, KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + LCTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + KC_LCTL, KC_HYPR, KC_LALT, KC_LGUI, LOWER, MO(_FUNC), KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + + /* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_DVORAK] = LAYOUT_ortho_4x12( + _______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, _______, + _______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + _______, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + /* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_LOWER] = LAYOUT_ortho_4x12( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PGDN, KC_PGUP, KC_HOME, KC_END , KC_MUTE, + _______, _______, _______, _______, _______, _______, KC_MPLY, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT + ), + + /* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_RAISE] = LAYOUT_ortho_4x12( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + _______, KC_4, KC_5, KC_6, KC_PLUS, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_7, KC_8, KC_9, KC_MINS, KC_F11, KC_F12, KC_PGDN, KC_PGUP, KC_HOME, KC_END , KC_MUTE, + _______, _______, _______, _______, _______, _______, KC_MPLY, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT + ), + + /* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_ADJUST] = LAYOUT_ortho_4x12( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, QWERTY, DVORAK, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET + ), + + [_FUNC] = LAYOUT_ortho_4x12( + _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, KC_PSCR, _______, + _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_NUMB] = LAYOUT_ortho_4x12( + _______, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, _______, KC_BSPC, + _______, _______, _______, _______, _______, _______, _______, KC_4, KC_5, KC_6, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_1, KC_2, KC_3, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_0, KC_0, _______, _______, _______ + ) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + // print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/contra/keymaps/msiu/readme.md b/keyboards/contra/keymaps/msiu/readme.md new file mode 100644 index 0000000000..80aba10954 --- /dev/null +++ b/keyboards/contra/keymaps/msiu/readme.md @@ -0,0 +1,2 @@ +# The Default Contra Layout + diff --git a/keyboards/converter/usb_usb/keymaps/default/config.h b/keyboards/converter/usb_usb/keymaps/default/config.h index 7fa3bf328e..271f48d001 100644 --- a/keyboards/converter/usb_usb/keymaps/default/config.h +++ b/keyboards/converter/usb_usb/keymaps/default/config.h @@ -1,6 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "../../config.h" - -#endif +// place overrides here diff --git a/keyboards/cospad/keymaps/default/keymap.c b/keyboards/cospad/keymaps/default/keymap.c index f782349b07..345e969962 100644 --- a/keyboards/cospad/keymaps/default/keymap.c +++ b/keyboards/cospad/keymaps/default/keymap.c @@ -1,10 +1,6 @@ #include QMK_KEYBOARD_H #include "led.h" -#ifdef RGBLIGHT_ENABLE -#include "rgblight.h" -#endif - // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. // Layer names don't all need to be of the same length, obviously, and you can also skip them diff --git a/keyboards/crkbd/keymaps/drashna/keymap.c b/keyboards/crkbd/keymaps/drashna/keymap.c index 0a9ff24ff8..91f0ebfa27 100644 --- a/keyboards/crkbd/keymaps/drashna/keymap.c +++ b/keyboards/crkbd/keymaps/drashna/keymap.c @@ -187,10 +187,10 @@ const char* read_modifier_state(void) { uint8_t one_shot = get_oneshot_mods(); snprintf(modifier_state_str, sizeof(modifier_state_str), "Mods:%s %s %s %s", - (modifiers & MODS_CTRL_MASK || one_shot & MODS_CTRL_MASK) ? "CTL" : " ", - (modifiers & MODS_GUI_MASK || one_shot & MODS_GUI_MASK) ? "GUI" : " ", - (modifiers & MODS_ALT_MASK || one_shot & MODS_ALT_MASK) ? "ALT" : " ", - (modifiers & MODS_SHIFT_MASK || one_shot & MODS_SHIFT_MASK) ? "SFT" : " " + (modifiers & MOD_MASK_CTRL || one_shot & MOD_MASK_CTRL) ? "CTL" : " ", + (modifiers & MOD_MASK_GUI || one_shot & MOD_MASK_GUI) ? "GUI" : " ", + (modifiers & MOD_MASK_ALT || one_shot & MOD_MASK_ALT) ? "ALT" : " ", + (modifiers & MOD_MASK_SHIFT || one_shot & MOD_MASK_SHIFT) ? "SFT" : " " ); return modifier_state_str; @@ -252,7 +252,7 @@ void matrix_render_user(struct CharacterMatrix *matrix) { // matrix_write_ln(matrix, read_keylog()); matrix_write_ln(matrix, read_keylogs()); // matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui)); - matrix_write(matrix, read_host_led_state()); + // matrix_write(matrix, read_host_led_state()); //matrix_write_ln(matrix, read_timelog()); } else { matrix_write(matrix, read_logo()); diff --git a/keyboards/crkbd/keymaps/drashna/rules.mk b/keyboards/crkbd/keymaps/drashna/rules.mk index 4b70f66f7b..540534978c 100644 --- a/keyboards/crkbd/keymaps/drashna/rules.mk +++ b/keyboards/crkbd/keymaps/drashna/rules.mk @@ -24,8 +24,8 @@ BOOTLOADER = qmk-dfu # If you want to change the display of OLED, you need to change here SRC += ./lib/glcdfont.c \ - ./lib/rgb_state_reader.c \ ./lib/logo_reader.c \ + # ./lib/rgb_state_reader.c \ # ./lib/keylogger.c \ # ./lib/host_led_state_reader.c \ # ./lib/mode_icon_reader.c \ diff --git a/keyboards/crkbd/keymaps/jarred/config.h b/keyboards/crkbd/keymaps/jarred/config.h new file mode 100644 index 0000000000..ac4c1cc88f --- /dev/null +++ b/keyboards/crkbd/keymaps/jarred/config.h @@ -0,0 +1,44 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako <wakojun@gmail.com> +Copyright 2015 Jack Humbert + +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 + +//#define USE_MATRIX_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#define SSD1306OLED + +#define USE_SERIAL_PD2 + +//#define TAPPING_FORCE_HOLD +//#define TAPPING_TERM 100 + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 27 +#define RGBLIGHT_LIMIT_VAL 120 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 diff --git a/keyboards/crkbd/keymaps/jarred/keymap.c b/keyboards/crkbd/keymaps/jarred/keymap.c new file mode 100644 index 0000000000..f00a735bfc --- /dev/null +++ b/keyboards/crkbd/keymaps/jarred/keymap.c @@ -0,0 +1,182 @@ +#include QMK_KEYBOARD_H +#include "jarred.h" + +#ifdef PROTOCOL_LUFA + #include "lufa.h" + #include "split_util.h" +#endif +#ifdef SSD1306OLED + #include "ssd1306.h" +#endif + +extern keymap_config_t keymap_config; +extern uint8_t is_master; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +#define LAYOUT_crkbd_base( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K31, K32, K33, K34, K35, K36 \ + ) + +#define LAYOUT_crkbd_wrapper(...) LAYOUT(__VA_ARGS__) + +#define QWERTY_4_CRKBD KC_LCTL, MO(_LW), KC_SPC, KC_ENT, MO(_LW), KC_RALT + +#define BLANK_4_CRKBD KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QW] = LAYOUT_crkbd_wrapper( + QWERTY_1_12, + QWERTY_2_12, + QWERTY_3_12, + QWERTY_4_DOX + ), + + [_LW] = LAYOUT_crkbd_wrapper( + LOWER_1_12, + LOWER_2_12, + LOWER_3_12, + LOWER_4_DOX + ), + + [_NV] = LAYOUT_crkbd_wrapper( + NAV_1_12, + NAV_2_12, + NAV_3_12, + NAV_4_DOX + ), + + [_NP] = LAYOUT_crkbd_wrapper( + NUMPAD_1_12, + NUMPAD_2_12, + NUMPAD_3_12, + NUMPAD_4_DOX + ), + + [_MS] = LAYOUT_crkbd_wrapper( + MOUSE_1_12, + MOUSE_2_12, + MOUSE_3_12, + MOUSE_4_DOX + ) +}; + +void matrix_init_user(void) { + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + iota_gfx_init(!has_usb()); // turns on the display + #endif +} + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +// When add source files to SRC in rules.mk, you can use functions. +const char *read_logo(void); +void set_keylog(uint16_t keycode, keyrecord_t *record); +const char *read_keylog(void); +const char *read_keylogs(void); + +char matrix_line_str[24]; + +const char *read_layer_state(void) { + uint8_t layer = biton32(layer_state); + + strcpy(matrix_line_str, "Layer: "); + + switch (layer) + { + case _QW: + strcat(matrix_line_str, "Default"); + break; + case _LW: + strcat(matrix_line_str, "Lower"); + break; + case _NV: + strcat(matrix_line_str, "Navigation"); + break; + case _NP: + strcat(matrix_line_str, "Adjust"); + break; + case _MS: + strcat(matrix_line_str, "Mouse"); + break; + default: + sprintf(matrix_line_str + strlen(matrix_line_str), "Unknown (%d)", layer); + } + + return matrix_line_str; +} + +const char *read_usb_state(void) { + + strcpy(matrix_line_str, "USB : "); + + switch (USB_DeviceState) { + case DEVICE_STATE_Unattached: + strcat(matrix_line_str, "Unattached"); + break; + case DEVICE_STATE_Suspended: + strcat(matrix_line_str, "Suspended"); + break; + case DEVICE_STATE_Configured: + strcat(matrix_line_str, "Connected"); + break; + case DEVICE_STATE_Powered: + strcat(matrix_line_str, "Powered"); + break; + case DEVICE_STATE_Default: + strcat(matrix_line_str, "Default"); + break; + case DEVICE_STATE_Addressed: + strcat(matrix_line_str, "Addressed"); + break; + default: + strcat(matrix_line_str, "Invalid"); + } + + return matrix_line_str; +} + +void matrix_scan_user(void) { + iota_gfx_task(); +} + +void matrix_render_user(struct CharacterMatrix *matrix) { + if (is_master) { + matrix_write_ln(matrix, read_layer_state()); + matrix_write_ln(matrix, read_usb_state()); + matrix_write_ln(matrix, read_keylogs()); + } else { + matrix_write(matrix, read_logo()); + } +} + +void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +void iota_gfx_task_user(void) { + struct CharacterMatrix matrix; + matrix_clear(&matrix); + matrix_render_user(&matrix); + matrix_update(&display, &matrix); +} +#endif//SSD1306OLED + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + set_keylog(keycode, record); + } + + return true; +} diff --git a/keyboards/crkbd/keymaps/jarred/readme.md b/keyboards/crkbd/keymaps/jarred/readme.md new file mode 100644 index 0000000000..15e355bbca --- /dev/null +++ b/keyboards/crkbd/keymaps/jarred/readme.md @@ -0,0 +1,9 @@ +# Jarred's CRKBD Layout + +Check out [user space readme](../../../../users/jarred/readme.md) for more info + +# Build + +``` +make crkbd:jarred:avrdude +``` diff --git a/keyboards/crkbd/keymaps/jarred/rules.mk b/keyboards/crkbd/keymaps/jarred/rules.mk new file mode 100644 index 0000000000..ab6329f0eb --- /dev/null +++ b/keyboards/crkbd/keymaps/jarred/rules.mk @@ -0,0 +1,31 @@ + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = no # Enable one-hand typing + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# If you want to change the display of OLED, you need to change here +SRC += ./lib/glcdfont.c \ + ./lib/rgb_state_reader.c \ + ./lib/logo_reader.c \ + ./lib/keylogger.c \ + #./lib/layer_state_reader.c \ + # ./lib/mode_icon_reader.c \ + # ./lib/host_led_state_reader.c \ + # ./lib/timelogger.c \ diff --git a/keyboards/cu24/keymaps/default/keymap.c b/keyboards/cu24/keymaps/default/keymap.c index 73427ee8ab..bbec2907ad 100644 --- a/keyboards/cu24/keymaps/default/keymap.c +++ b/keyboards/cu24/keymaps/default/keymap.c @@ -13,7 +13,7 @@ * 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 "cu24.h" +#include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT_grid( /* Base */ diff --git a/keyboards/cu75/keymaps/default/config.h b/keyboards/cu75/keymaps/default/config.h index 8893d122e0..271f48d001 100644 --- a/keyboards/cu75/keymaps/default/config.h +++ b/keyboards/cu75/keymaps/default/config.h @@ -1,8 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/dc01/left/matrix.c b/keyboards/dc01/left/matrix.c index cbe3b3f3d8..a3db220e4f 100644 --- a/keyboards/dc01/left/matrix.c +++ b/keyboards/dc01/left/matrix.c @@ -455,10 +455,10 @@ i2c_status_t i2c_transaction(uint8_t address, uint32_t mask, uint8_t col_offset) matrix[MATRIX_ROWS - 1] |= ((uint32_t)err << (MATRIX_COLS_SCANNED + col_offset)); //add new bits at the end } else { - i2c_stop(10); + i2c_stop(); return 1; } - i2c_stop(10); + i2c_stop(); return 0; }
\ No newline at end of file diff --git a/keyboards/deltasplit75/keymaps/default/config.h b/keyboards/deltasplit75/keymaps/default/config.h index f14678a223..307531da66 100644 --- a/keyboards/deltasplit75/keymaps/default/config.h +++ b/keyboards/deltasplit75/keymaps/default/config.h @@ -16,16 +16,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#pragma once + #define USE_SERIAL #define MASTER_LEFT // #define MASTER_RIGHT // #define EE_HANDS - - -#ifdef SUBPROJECT_v2 - #include "../../v2/config.h" -#endif -#ifdef SUBPROJECT_protosplit - #include "../../protosplit/config.h" -#endif diff --git a/keyboards/dichotomy/keymaps/default/keymap.c b/keyboards/dichotomy/keymaps/default/keymap.c index 3f03417574..b8c7ef4274 100755 --- a/keyboards/dichotomy/keymaps/default/keymap.c +++ b/keyboards/dichotomy/keymaps/default/keymap.c @@ -1,7 +1,7 @@ // this is the style you want to emulate. // This is the canonical layout file for the Quantum project. If you want to add another keyboard, -#include "dichotomy.h" +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. diff --git a/keyboards/diverge3/keymaps/default/config.h b/keyboards/diverge3/keymaps/default/config.h index 87ce06b3b8..fc375f0812 100644 --- a/keyboards/diverge3/keymaps/default/config.h +++ b/keyboards/diverge3/keymaps/default/config.h @@ -14,14 +14,9 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once // place overrides here #define MASTER_RIGHT #define PERMISSIVE_HOLD #define TAPPING_TERM 150 - -#endif diff --git a/keyboards/dk60/dk60.c b/keyboards/dk60/dk60.c index 93aeb33b4a..8b9dc547d4 100644 --- a/keyboards/dk60/dk60.c +++ b/keyboards/dk60/dk60.c @@ -1,5 +1,15 @@ #include "dk60.h" +extern inline void dk60_caps_led_on(void); +extern inline void dk60_esc_led_on(void); + +extern inline void dk60_caps_led_off(void); +extern inline void dk60_esc_led_off(void); + +extern inline void dk60_led_all_on(void); +extern inline void dk60_led_all_off(void); + + void dk60_blink_all_leds(void) { dk60_led_all_off(); diff --git a/keyboards/do60/keymaps/default/keymap.c b/keyboards/do60/keymaps/default/keymap.c index 75afb7a340..f8e4a5e92b 100644 --- a/keyboards/do60/keymaps/default/keymap.c +++ b/keyboards/do60/keymaps/default/keymap.c @@ -1,5 +1,4 @@ #include QMK_KEYBOARD_H -#include "action_layer.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboards/donutcables/budget96/budget96.c b/keyboards/donutcables/budget96/budget96.c new file mode 100644 index 0000000000..7831a91f52 --- /dev/null +++ b/keyboards/donutcables/budget96/budget96.c @@ -0,0 +1,80 @@ +/* Copyright 2019 MechMerlin + * + * 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 "budget96.h" + +#ifdef BACKLIGHT_ENABLE +#include "backlight.h" +#endif +#ifdef RGBLIGHT_ENABLE +#include "rgblight.h" +#endif + +#include <avr/pgmspace.h> + +#include "action_layer.h" +#include "i2c_master.h" +#include "quantum.h" + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +#ifdef RGBLIGHT_ENABLE +extern rgblight_config_t rgblight_config; + +void rgblight_set(void) { + if (!rgblight_config.enable) { + for (uint8_t i = 0; i < RGBLED_NUM; i++) { + led[i].r = 0; + led[i].g = 0; + led[i].b = 0; + } + } + + i2c_init(); + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); +} +#endif + +void backlight_init_ports(void) { + // initialize pins D0, D1, D4 and D6 as output + setPinOutput(D0); + setPinOutput(D1); + setPinOutput(D4); + setPinOutput(D6); + + // turn RGB LEDs on + writePinHigh(D0); + writePinHigh(D1); + writePinHigh(D4); + writePinHigh(D6); +} + + void backlight_set(uint8_t level) { + if (level == 0) { + // turn RGB LEDs off + writePinLow(D0); + writePinLow(D1); + writePinLow(D4); + writePinLow(D6); + } else { + // turn RGB LEDs on + writePinHigh(D0); + writePinHigh(D1); + writePinHigh(D4); + writePinHigh(D6); + } + } diff --git a/keyboards/donutcables/budget96/budget96.h b/keyboards/donutcables/budget96/budget96.h new file mode 100644 index 0000000000..561d0cbfa2 --- /dev/null +++ b/keyboards/donutcables/budget96/budget96.h @@ -0,0 +1,56 @@ +/* Copyright 2019 MechMerlin + * + * 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" + +#define LAYOUT_all( \ + k50, k52, k53, k54, k55, k60, k6A, k7A, k70, k5B, k5C, k5D, k5E, k1D, k2E, k0D, k76, k79, k78, \ + k40, k41, k42, k43, k44, k45, k61, k6B, k7B, k71, k4A, k4B, k4C, k4D, k4E, k46, k47, k48, k49, \ + k30, k31, k32, k33, k34, k35, k62, k6C, k7C, k72, k3A, k3B, k3C, k3D, k36, k37, k38, k39, \ + k20, k21, k22, k23, k24, k25, k63, k6D, k7D, k73, k2A, k2B, k2C, k2D, k26, k27, k28, k29, \ + k10, k03, k11, k12, k13, k14, k15, k64, k6E, k7E, k74, k1A, k1B, k68, k16, k17, k18, k19, \ + k00, k01, k02, k65, k75, k0A, k0B, k66, k67, k69, k06, k08, k09 \ +) \ +{ \ + { k00, k01, k02, k03, KC_NO, KC_NO, k06, KC_NO, k08, k09, k0A, k0B, KC_NO, k0D, KC_NO }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, KC_NO, k1D, KC_NO }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, KC_NO }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E }, \ + { k50, KC_NO, k52, k53, k54, k55, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k5B, k5C, k5D, k5E }, \ + { k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6A, k6B, k6C, k6D, k6E }, \ + { k70, k71, k72, k73, k74, k75, k76, KC_NO, k78, k79, k7A, k7B, k7C, k7D, k7E }, \ +} + +#define LAYOUT_96_ansi( \ + k50, k52, k53, k54, k55, k60, k6A, k7A, k70, k5B, k5C, k5D, k5E, k1D, k2E, k0D, k76, k79, k78, \ + k40, k41, k42, k43, k44, k45, k61, k6B, k7B, k71, k4A, k4B, k4C, k4E, k46, k47, k48, k49, \ + k30, k31, k32, k33, k34, k35, k62, k6C, k7C, k72, k3A, k3B, k3C, k3D, k36, k37, k38, k39, \ + k20, k21, k22, k23, k24, k25, k63, k6D, k7D, k73, k2A, k2B, k2D, k26, k27, k28, k29, \ + k10, k11, k12, k13, k14, k15, k64, k6E, k7E, k74, k1A, k1B, k68, k16, k17, k18, \ + k00, k01, k02, k65, k75, k0B, k66, k67, k69, k06, k08, k09 \ +) \ +{ \ + { k00, k01, k02, KC_NO, KC_NO, KC_NO, k06, KC_NO, k08, k09, KC_NO, k0B, KC_NO, k0D, KC_NO }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, KC_NO, k1A, k1B, KC_NO, k1D, KC_NO }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, KC_NO, k2D, k2E }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, KC_NO }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, KC_NO, k4E }, \ + { k50, KC_NO, k52, k53, k54, k55, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k5B, k5C, k5D, k5E }, \ + { k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6A, k6B, k6C, k6D, k6E }, \ + { k70, k71, k72, k73, k74, k75, k76, KC_NO, k78, k79, k7A, k7B, k7C, k7D, k7E }, \ +} diff --git a/keyboards/donutcables/budget96/config.h b/keyboards/donutcables/budget96/config.h new file mode 100644 index 0000000000..74661d828c --- /dev/null +++ b/keyboards/donutcables/budget96/config.h @@ -0,0 +1,41 @@ +/* +Copyright 2017 Luiz Ribeiro <luizribeiro@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 "config_common.h" + +#define VENDOR_ID 0x20A0 +#define PRODUCT_ID 0x422D +#define MANUFACTURER DonutCables +#define PRODUCT budget96 + +#define RGBLED_NUM 16 + +#define MATRIX_ROWS 8 +#define MATRIX_COLS 15 + +#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2, D7 } +#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, B5, B6, B7 } +#define UNUSED_PINS + +#define DIODE_DIRECTION COL2ROW +#define DEBOUNCING_DELAY 5 + +#define NO_BACKLIGHT_CLOCK +#define BACKLIGHT_LEVELS 1 +#define RGBLIGHT_ANIMATIONS diff --git a/keyboards/donutcables/budget96/info.json b/keyboards/donutcables/budget96/info.json new file mode 100644 index 0000000000..40a942127f --- /dev/null +++ b/keyboards/donutcables/budget96/info.json @@ -0,0 +1,16 @@ +{ + "keyboard_name": "budget96", + "url": "", + "maintainer": "qmk", + "width": 19, + "height": 6, + "layouts": { + "LAYOUT_all": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15, "y":0}, {"x":16, "y":0}, {"x":17, "y":0}, {"x":18, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"x":15, "y":1}, {"x":16, "y":1}, {"x":17, "y":1}, {"x":18, "y":1}, {"x":0, "y":2, "w":1.5}, {"x":1.5, "y":2}, {"x":2.5, "y":2}, {"x":3.5, "y":2}, {"x":4.5, "y":2}, {"x":5.5, "y":2}, {"x":6.5, "y":2}, {"x":7.5, "y":2}, {"x":8.5, "y":2}, {"x":9.5, "y":2}, {"x":10.5, "y":2}, {"x":11.5, "y":2}, {"x":12.5, "y":2}, {"x":13.5, "y":2, "w":1.5}, {"x":15, "y":2}, {"x":16, "y":2}, {"x":17, "y":2}, {"x":18, "y":2}, {"x":0, "y":3, "w":1.75}, {"x":1.75, "y":3}, {"x":2.75, "y":3}, {"x":3.75, "y":3}, {"x":4.75, "y":3}, {"x":5.75, "y":3}, {"x":6.75, "y":3}, {"x":7.75, "y":3}, {"x":8.75, "y":3}, {"x":9.75, "y":3}, {"x":10.75, "y":3}, {"x":11.75, "y":3}, {"x":12.75, "y":3}, {"x":13.75, "y":3, "w":1.25}, {"x":15, "y":3}, {"x":16, "y":3}, {"x":17, "y":3}, {"x":18, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4}, {"x":2.25, "y":4}, {"x":3.25, "y":4}, {"x":4.25, "y":4}, {"x":5.25, "y":4}, {"x":6.25, "y":4}, {"x":7.25, "y":4}, {"x":8.25, "y":4}, {"x":9.25, "y":4}, {"x":10.25, "y":4}, {"x":11.25, "y":4}, {"x":12.25, "y":4, "w":1.75}, {"x":14, "y":4}, {"x":15, "y":4}, {"x":16, "y":4}, {"x":17, "y":4}, {"x":18, "y":4}, {"x":0, "y":5, "w":1.25}, {"x":1.25, "y":5, "w":1.25}, {"x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"x":10, "y":5}, {"x":11, "y":5}, {"x":12, "y":5}, {"x":13, "y":5}, {"x":14, "y":5}, {"x":15, "y":5}, {"x":16, "y":5}, {"x":17, "y":5}, {"x":18, "y":5}] + }, + + "LAYOUT_96_ansi": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15, "y":0}, {"x":16, "y":0}, {"x":17, "y":0}, {"x":18, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":13, "y":1, "w":2}, {"x":15, "y":1}, {"x":16, "y":1}, {"x":17, "y":1}, {"x":18, "y":1}, {"x":0, "y":2, "w":1.5}, {"x":1.5, "y":2}, {"x":2.5, "y":2}, {"x":3.5, "y":2}, {"x":4.5, "y":2}, {"x":5.5, "y":2}, {"x":6.5, "y":2}, {"x":7.5, "y":2}, {"x":8.5, "y":2}, {"x":9.5, "y":2}, {"x":10.5, "y":2}, {"x":11.5, "y":2}, {"x":12.5, "y":2}, {"x":13.5, "y":2, "w":1.5}, {"x":15, "y":2}, {"x":16, "y":2}, {"x":17, "y":2}, {"x":18, "y":2}, {"x":0, "y":3, "w":1.75}, {"x":1.75, "y":3}, {"x":2.75, "y":3}, {"x":3.75, "y":3}, {"x":4.75, "y":3}, {"x":5.75, "y":3}, {"x":6.75, "y":3}, {"x":7.75, "y":3}, {"x":8.75, "y":3}, {"x":9.75, "y":3}, {"x":10.75, "y":3}, {"x":11.75, "y":3}, {"x":12.75, "y":3, "w":2.25}, {"x":15, "y":3}, {"x":16, "y":3}, {"x":17, "y":3}, {"x":18, "y":3}, {"x":0, "y":4, "w":2.25}, {"x":2.25, "y":4}, {"x":3.25, "y":4}, {"x":4.25, "y":4}, {"x":5.25, "y":4}, {"x":6.25, "y":4}, {"x":7.25, "y":4}, {"x":8.25, "y":4}, {"x":9.25, "y":4}, {"x":10.25, "y":4}, {"x":11.25, "y":4}, {"x":12.25, "y":4, "w":1.75}, {"x":14, "y":4}, {"x":15, "y":4}, {"x":16, "y":4}, {"x":17, "y":4}, {"x":0, "y":5, "w":1.25}, {"x":1.25, "y":5, "w":1.25}, {"x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"x":10, "y":5, "w":1.5}, {"x":11.5, "y":5, "w":1.5}, {"x":13, "y":5}, {"x":14, "y":5}, {"x":15, "y":5}, {"x":16, "y":5}, {"x":17, "y":5}, {"x":18, "y":4, "h":2}] + } + } +} diff --git a/keyboards/scrabblepad/keymaps/default/config.h b/keyboards/donutcables/budget96/keymaps/default/config.h index 2c852d1819..a3ed4f762a 100644 --- a/keyboards/scrabblepad/keymaps/default/config.h +++ b/keyboards/donutcables/budget96/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/donutcables/budget96/keymaps/default/keymap.c b/keyboards/donutcables/budget96/keymaps/default/keymap.c new file mode 100644 index 0000000000..dcb79780e0 --- /dev/null +++ b/keyboards/donutcables/budget96/keymaps/default/keymap.c @@ -0,0 +1,35 @@ +/* Copyright 2018 MechMerlin + * + * 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 QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_96_ansi(\ + 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_PSCR, KC_NLCK, KC_INS, KC_HOME, KC_PGUP, KC_PSLS, \ + 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_END, KC_PGDN, KC_PSLS, KC_PAST, \ + 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_P7, KC_P8, KC_P9, KC_PMNS, \ + 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_P4, KC_P5, KC_P6, KC_PPLS, \ + 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_P1, KC_P2, KC_P3, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT, KC_P0, KC_PDOT, KC_PENT), \ + +[1] = LAYOUT_96_ansi(\ + RESET, EEP_RST, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + BL_TOGG, BL_STEP, BL_ON, BL_OFF, BL_INC, BL_DEC, BL_BRTG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), \ +}; + diff --git a/keyboards/donutcables/budget96/keymaps/default/readme.md b/keyboards/donutcables/budget96/keymaps/default/readme.md new file mode 100644 index 0000000000..acbac7b4e0 --- /dev/null +++ b/keyboards/donutcables/budget96/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for budget96 diff --git a/keyboards/donutcables/budget96/readme.md b/keyboards/donutcables/budget96/readme.md new file mode 100644 index 0000000000..70e4d3afba --- /dev/null +++ b/keyboards/donutcables/budget96/readme.md @@ -0,0 +1,44 @@ +# budget96 + +96 key atmega32a keyboard. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: Budget96 PCB +Hardware Availability: [DonutCables](https://donutcables.com/) + +Make example for this keyboard (after setting up your build environment): + + make donutcables/budget96:default + +Flashing + +**Reset Key:** Hold down the key located at `K00`, commonly programmed as left control while plugging in the keyboard. + +ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. + +Windows: +1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). +2. Place your keyboard into reset. +3. Press the `Find Device` button and ensure that your keyboard is found. +4. Press the `Open .hex File` button and locate the `.hex` file you created. +5. Press the `Flash Device` button and wait for the process to complete. + +macOS: +1. Install homebrew by typing the following: + ``` + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + ``` +2. Install `crosspack-avr`. + ``` + brew cask install crosspack-avr + ``` +3. Install the following packages: + ``` + brew install python3 + pip3 install pyusb + brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb + +4. Place your keyboard into reset. +5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. + +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/donutcables/budget96/rules.mk b/keyboards/donutcables/budget96/rules.mk new file mode 100644 index 0000000000..67697ac733 --- /dev/null +++ b/keyboards/donutcables/budget96/rules.mk @@ -0,0 +1,49 @@ +# Copyright 2017 Luiz Ribeiro <luizribeiro@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/>. + +# MCU name +MCU = atmega32a +PROTOCOL = VUSB + +# unsupported features for now +NO_UART = yes +NO_SUSPEND_POWER_DOWN = yes + +# processor frequency +F_CPU = 12000000 + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = bootloadHID + +# build options +BOOTMAGIC_ENABLE = no +MOUSEKEY_ENABLE = yes +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = yes +COMMAND_ENABLE = yes +BACKLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = yes +RGBLIGHT_CUSTOM_DRIVER = yes + +OPT_DEFS = -DDEBUG_LEVEL=0 + +# custom matrix setup +SRC = i2c_master.c + +# programming options +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/donutcables/budget96/usbconfig.h b/keyboards/donutcables/budget96/usbconfig.h new file mode 100644 index 0000000000..223b69bb94 --- /dev/null +++ b/keyboards/donutcables/budget96/usbconfig.h @@ -0,0 +1,394 @@ +/* Name: usbconfig.h + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers + * Author: Christian Starkjohann + * Creation Date: 2005-04-01 + * Tabsize: 4 + * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ + */ + +#pragma once + +#include "config.h" + +/* +General Description: +This file is an example configuration (with inline documentation) for the USB +driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is +also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may +wire the lines to any other port, as long as D+ is also wired to INT0 (or any +other hardware interrupt, as long as it is the highest level interrupt, see +section at the end of this file). +*/ + +/* ---------------------------- Hardware Config ---------------------------- */ + +#define USB_CFG_IOPORTNAME D +/* This is the port where the USB bus is connected. When you configure it to + * "B", the registers PORTB, PINB and DDRB will be used. + */ +#define USB_CFG_DMINUS_BIT 3 +/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. + * This may be any bit in the port. + */ +#define USB_CFG_DPLUS_BIT 2 +/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. + * This may be any bit in the port. Please note that D+ must also be connected + * to interrupt pin INT0! [You can also use other interrupts, see section + * "Optional MCU Description" below, or you can connect D- to the interrupt, as + * it is required if you use the USB_COUNT_SOF feature. If you use D- for the + * interrupt, the USB interrupt will also be triggered at Start-Of-Frame + * markers every millisecond.] + */ +#define USB_CFG_CLOCK_KHZ (F_CPU/1000) +/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, + * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code + * require no crystal, they tolerate +/- 1% deviation from the nominal + * frequency. All other rates require a precision of 2000 ppm and thus a + * crystal! + * Since F_CPU should be defined to your actual clock rate anyway, you should + * not need to modify this setting. + */ +#define USB_CFG_CHECK_CRC 0 +/* Define this to 1 if you want that the driver checks integrity of incoming + * data packets (CRC checks). CRC checks cost quite a bit of code size and are + * currently only available for 18 MHz crystal clock. You must choose + * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. + */ + +/* ----------------------- Optional Hardware Config ------------------------ */ + +/* #define USB_CFG_PULLUP_IOPORTNAME D */ +/* If you connect the 1.5k pullup resistor from D- to a port pin instead of + * V+, you can connect and disconnect the device from firmware by calling + * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). + * This constant defines the port on which the pullup resistor is connected. + */ +/* #define USB_CFG_PULLUP_BIT 4 */ +/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined + * above) where the 1.5k pullup resistor is connected. See description + * above for details. + */ + +/* --------------------------- Functional Range ---------------------------- */ + +#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 +/* Define this to 1 if you want to compile a version with two endpoints: The + * default control endpoint 0 and an interrupt-in endpoint (any other endpoint + * number). + */ +#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 +/* Define this to 1 if you want to compile a version with three endpoints: The + * default control endpoint 0, an interrupt-in endpoint 3 (or the number + * configured below) and a catch-all default interrupt-in endpoint as above. + * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. + */ +#define USB_CFG_EP3_NUMBER 3 +/* If the so-called endpoint 3 is used, it can now be configured to any other + * endpoint number (except 0) with this macro. Default if undefined is 3. + */ +/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ +/* The above macro defines the startup condition for data toggling on the + * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. + * Since the token is toggled BEFORE sending any data, the first packet is + * sent with the oposite value of this configuration! + */ +#define USB_CFG_IMPLEMENT_HALT 0 +/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature + * for endpoint 1 (interrupt endpoint). Although you may not need this feature, + * it is required by the standard. We have made it a config option because it + * bloats the code considerably. + */ +#define USB_CFG_SUPPRESS_INTR_CODE 0 +/* Define this to 1 if you want to declare interrupt-in endpoints, but don't + * want to send any data over them. If this macro is defined to 1, functions + * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if + * you need the interrupt-in endpoints in order to comply to an interface + * (e.g. HID), but never want to send any data. This option saves a couple + * of bytes in flash memory and the transmit buffers in RAM. + */ +#define USB_CFG_INTR_POLL_INTERVAL 1 +/* If you compile a version with endpoint 1 (interrupt-in), this is the poll + * interval. The value is in milliseconds and must not be less than 10 ms for + * low speed devices. + */ +#define USB_CFG_IS_SELF_POWERED 0 +/* Define this to 1 if the device has its own power supply. Set it to 0 if the + * device is powered from the USB bus. + */ +#define USB_CFG_MAX_BUS_POWER 500 +/* Set this variable to the maximum USB bus power consumption of your device. + * The value is in milliamperes. [It will be divided by two since USB + * communicates power requirements in units of 2 mA.] + */ +#define USB_CFG_IMPLEMENT_FN_WRITE 1 +/* Set this to 1 if you want usbFunctionWrite() to be called for control-out + * transfers. Set it to 0 if you don't need it and want to save a couple of + * bytes. + */ +#define USB_CFG_IMPLEMENT_FN_READ 0 +/* Set this to 1 if you need to send control replies which are generated + * "on the fly" when usbFunctionRead() is called. If you only want to send + * data from a static buffer, set it to 0 and return the data from + * usbFunctionSetup(). This saves a couple of bytes. + */ +#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 +/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. + * You must implement the function usbFunctionWriteOut() which receives all + * interrupt/bulk data sent to any endpoint other than 0. The endpoint number + * can be found in 'usbRxToken'. + */ +#define USB_CFG_HAVE_FLOWCONTROL 0 +/* Define this to 1 if you want flowcontrol over USB data. See the definition + * of the macros usbDisableAllRequests() and usbEnableAllRequests() in + * usbdrv.h. + */ +#define USB_CFG_DRIVER_FLASH_PAGE 0 +/* If the device has more than 64 kBytes of flash, define this to the 64 k page + * where the driver's constants (descriptors) are located. Or in other words: + * Define this to 1 for boot loaders on the ATMega128. + */ +#define USB_CFG_LONG_TRANSFERS 0 +/* Define this to 1 if you want to send/receive blocks of more than 254 bytes + * in a single control-in or control-out transfer. Note that the capability + * for long transfers increases the driver size. + */ +/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ +/* This macro is a hook if you want to do unconventional things. If it is + * defined, it's inserted at the beginning of received message processing. + * If you eat the received message and don't want default processing to + * proceed, do a return after doing your things. One possible application + * (besides debugging) is to flash a status LED on each packet. + */ +/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ +/* This macro is a hook if you need to know when an USB RESET occurs. It has + * one parameter which distinguishes between the start of RESET state and its + * end. + */ +/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ +/* This macro (if defined) is executed when a USB SET_ADDRESS request was + * received. + */ +#define USB_COUNT_SOF 1 +/* define this macro to 1 if you need the global variable "usbSofCount" which + * counts SOF packets. This feature requires that the hardware interrupt is + * connected to D- instead of D+. + */ +/* #ifdef __ASSEMBLER__ + * macro myAssemblerMacro + * in YL, TCNT0 + * sts timer0Snapshot, YL + * endm + * #endif + * #define USB_SOF_HOOK myAssemblerMacro + * This macro (if defined) is executed in the assembler module when a + * Start Of Frame condition is detected. It is recommended to define it to + * the name of an assembler macro which is defined here as well so that more + * than one assembler instruction can be used. The macro may use the register + * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages + * immediately after an SOF pulse may be lost and must be retried by the host. + * What can you do with this hook? Since the SOF signal occurs exactly every + * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in + * designs running on the internal RC oscillator. + * Please note that Start Of Frame detection works only if D- is wired to the + * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! + */ +#define USB_CFG_CHECK_DATA_TOGGLING 0 +/* define this macro to 1 if you want to filter out duplicate data packets + * sent by the host. Duplicates occur only as a consequence of communication + * errors, when the host does not receive an ACK. Please note that you need to + * implement the filtering yourself in usbFunctionWriteOut() and + * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable + * for each control- and out-endpoint to check for duplicate packets. + */ +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 +/* define this macro to 1 if you want the function usbMeasureFrameLength() + * compiled in. This function can be used to calibrate the AVR's RC oscillator. + */ +#define USB_USE_FAST_CRC 0 +/* The assembler module has two implementations for the CRC algorithm. One is + * faster, the other is smaller. This CRC routine is only used for transmitted + * messages where timing is not critical. The faster routine needs 31 cycles + * per byte while the smaller one needs 61 to 69 cycles. The faster routine + * may be worth the 32 bytes bigger code size if you transmit lots of data and + * run the AVR close to its limit. + */ + +/* -------------------------- Device Description --------------------------- */ + +#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) +/* USB vendor ID for the device, low byte first. If you have registered your + * own Vendor ID, define it here. Otherwise you may use one of obdev's free + * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) +/* This is the ID of the product, low byte first. It is interpreted in the + * scope of the vendor ID. If you have registered your own VID with usb.org + * or if you have licensed a PID from somebody else, define it here. Otherwise + * you may use one of obdev's free shared VID/PID pairs. See the file + * USB-IDs-for-free.txt for details! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_VERSION 0x00, 0x02 +/* Version number of the device: Minor number first, then major number. + */ +#define USB_CFG_VENDOR_NAME 'D', 'o', 'n', 'u', 't', 'C', 'a', 'b', 'l', 'e', 's' +#define USB_CFG_VENDOR_NAME_LEN 11 +/* These two values define the vendor name returned by the USB device. The name + * must be given as a list of characters under single quotes. The characters + * are interpreted as Unicode (UTF-16) entities. + * If you don't want a vendor name string, undefine these macros. + * ALWAYS define a vendor name containing your Internet domain name if you use + * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for + * details. + */ +#define USB_CFG_DEVICE_NAME 'b', 'u', 'd', 'g', 'e', 't', '9', '6' +#define USB_CFG_DEVICE_NAME_LEN 8 +/* Same as above for the device name. If you don't want a device name, undefine + * the macros. See the file USB-IDs-for-free.txt before you assign a name if + * you use a shared VID/PID. + */ +/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ +/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ +/* Same as above for the serial number. If you don't want a serial number, + * undefine the macros. + * It may be useful to provide the serial number through other means than at + * compile time. See the section about descriptor properties below for how + * to fine tune control over USB descriptors such as the string descriptor + * for the serial number. + */ +#define USB_CFG_DEVICE_CLASS 0 +#define USB_CFG_DEVICE_SUBCLASS 0 +/* See USB specification if you want to conform to an existing device class. + * Class 0xff is "vendor specific". + */ +#define USB_CFG_INTERFACE_CLASS 3 /* HID */ +#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ +#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ +/* See USB specification if you want to conform to an existing device class or + * protocol. The following classes must be set at interface level: + * HID class is 3, no subclass and protocol required (but may be useful!) + * CDC class is 2, use subclass 2 and protocol 1 for ACM + */ +#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 +/* Define this to the length of the HID report descriptor, if you implement + * an HID device. Otherwise don't define it or define it to 0. + * If you use this define, you must add a PROGMEM character array named + * "usbHidReportDescriptor" to your code which contains the report descriptor. + * Don't forget to keep the array and this define in sync! + */ + +/* #define USB_PUBLIC static */ +/* Use the define above if you #include usbdrv.c instead of linking against it. + * This technique saves a couple of bytes in flash memory. + */ + +/* ------------------- Fine Control over USB Descriptors ------------------- */ +/* If you don't want to use the driver's default USB descriptors, you can + * provide our own. These can be provided as (1) fixed length static data in + * flash memory, (2) fixed length static data in RAM or (3) dynamically at + * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more + * information about this function. + * Descriptor handling is configured through the descriptor's properties. If + * no properties are defined or if they are 0, the default descriptor is used. + * Possible properties are: + * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched + * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is + * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if + * you want RAM pointers. + * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found + * in static memory is in RAM, not in flash memory. + * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), + * the driver must know the descriptor's length. The descriptor itself is + * found at the address of a well known identifier (see below). + * List of static descriptor names (must be declared PROGMEM if in flash): + * char usbDescriptorDevice[]; + * char usbDescriptorConfiguration[]; + * char usbDescriptorHidReport[]; + * char usbDescriptorString0[]; + * int usbDescriptorStringVendor[]; + * int usbDescriptorStringDevice[]; + * int usbDescriptorStringSerialNumber[]; + * Other descriptors can't be provided statically, they must be provided + * dynamically at runtime. + * + * Descriptor properties are or-ed or added together, e.g.: + * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) + * + * The following descriptors are defined: + * USB_CFG_DESCR_PROPS_DEVICE + * USB_CFG_DESCR_PROPS_CONFIGURATION + * USB_CFG_DESCR_PROPS_STRINGS + * USB_CFG_DESCR_PROPS_STRING_0 + * USB_CFG_DESCR_PROPS_STRING_VENDOR + * USB_CFG_DESCR_PROPS_STRING_PRODUCT + * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER + * USB_CFG_DESCR_PROPS_HID + * USB_CFG_DESCR_PROPS_HID_REPORT + * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) + * + * Note about string descriptors: String descriptors are not just strings, they + * are Unicode strings prefixed with a 2 byte header. Example: + * int serialNumberDescriptor[] = { + * USB_STRING_DESCRIPTOR_HEADER(6), + * 'S', 'e', 'r', 'i', 'a', 'l' + * }; + */ + +#define USB_CFG_DESCR_PROPS_DEVICE 0 +#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 +#define USB_CFG_DESCR_PROPS_STRINGS 0 +#define USB_CFG_DESCR_PROPS_STRING_0 0 +#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 +#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 +#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 +#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID 0 +#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 +#define USB_CFG_DESCR_PROPS_UNKNOWN 0 + +#define usbMsgPtr_t unsigned short +/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to + * a scalar type here because gcc generates slightly shorter code for scalar + * arithmetics than for pointer arithmetics. Remove this define for backward + * type compatibility or define it to an 8 bit type if you use data in RAM only + * and all RAM is below 256 bytes (tiny memory model in IAR CC). + */ + +/* ----------------------- Optional MCU Description ------------------------ */ + +/* The following configurations have working defaults in usbdrv.h. You + * usually don't need to set them explicitly. Only if you want to run + * the driver on a device which is not yet supported or with a compiler + * which is not fully supported (such as IAR C) or if you use a differnt + * interrupt than INT0, you may have to define some of these. + */ +/* #define USB_INTR_CFG MCUCR */ +/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE GIMSK */ +/* #define USB_INTR_ENABLE_BIT INT0 */ +/* #define USB_INTR_PENDING GIFR */ +/* #define USB_INTR_PENDING_BIT INTF0 */ +/* #define USB_INTR_VECTOR INT0_vect */ + +/* Set INT1 for D- falling edge to count SOF */ +/* #define USB_INTR_CFG EICRA */ +#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE EIMSK */ +#define USB_INTR_ENABLE_BIT INT1 +/* #define USB_INTR_PENDING EIFR */ +#define USB_INTR_PENDING_BIT INTF1 +#define USB_INTR_VECTOR INT1_vect + diff --git a/keyboards/donutcables/readme.md b/keyboards/donutcables/readme.md new file mode 100644 index 0000000000..d68b6a743c --- /dev/null +++ b/keyboards/donutcables/readme.md @@ -0,0 +1,12 @@ +# Donut Cables + +Donut Cables LLC is located in North Carolina, USA. + +Website: https://donutcables.com/ + +**Contact Donut Cables at the following:** + +Email: contact@donutcables.com +Reddit: /u/donutcat_cables +Geekhack/DeskThority: donutcat +Discord: @donutcat on the #mechkeys Discord
\ No newline at end of file diff --git a/keyboards/scrabblepad/config.h b/keyboards/donutcables/scrabblepad/config.h index 8c23ccdabd..bf3d3db72a 100644 --- a/keyboards/scrabblepad/config.h +++ b/keyboards/donutcables/scrabblepad/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -49,7 +48,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. /* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW -// #define BACKLIGHT_PIN +// #define BACKLIGHT_PIN // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 @@ -188,5 +187,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 - -#endif diff --git a/keyboards/scrabblepad/info.json b/keyboards/donutcables/scrabblepad/info.json index 1368abd4b2..1368abd4b2 100644 --- a/keyboards/scrabblepad/info.json +++ b/keyboards/donutcables/scrabblepad/info.json diff --git a/keyboards/donutcables/scrabblepad/keymaps/default/config.h b/keyboards/donutcables/scrabblepad/keymaps/default/config.h new file mode 100644 index 0000000000..a3ed4f762a --- /dev/null +++ b/keyboards/donutcables/scrabblepad/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 MechMerlin + * + * 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 + +// place overrides here diff --git a/keyboards/scrabblepad/keymaps/default/keymap.c b/keyboards/donutcables/scrabblepad/keymaps/default/keymap.c index 8d110dbd5b..6f97d87e1b 100644 --- a/keyboards/scrabblepad/keymaps/default/keymap.c +++ b/keyboards/donutcables/scrabblepad/keymaps/default/keymap.c @@ -13,7 +13,7 @@ * 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 "scrabblepad.h" +#include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( /* Base */ diff --git a/keyboards/scrabblepad/keymaps/default/readme.md b/keyboards/donutcables/scrabblepad/keymaps/default/readme.md index 4123e76671..4123e76671 100644 --- a/keyboards/scrabblepad/keymaps/default/readme.md +++ b/keyboards/donutcables/scrabblepad/keymaps/default/readme.md diff --git a/keyboards/scrabblepad/keymaps/random/keymap.c b/keyboards/donutcables/scrabblepad/keymaps/random/keymap.c index 8e78259661..8e78259661 100644 --- a/keyboards/scrabblepad/keymaps/random/keymap.c +++ b/keyboards/donutcables/scrabblepad/keymaps/random/keymap.c diff --git a/keyboards/scrabblepad/keymaps/random/readme.md b/keyboards/donutcables/scrabblepad/keymaps/random/readme.md index e719adaeb8..e719adaeb8 100644 --- a/keyboards/scrabblepad/keymaps/random/readme.md +++ b/keyboards/donutcables/scrabblepad/keymaps/random/readme.md diff --git a/keyboards/scrabblepad/readme.md b/keyboards/donutcables/scrabblepad/readme.md index 0227b988fa..f0b05cbced 100644 --- a/keyboards/scrabblepad/readme.md +++ b/keyboards/donutcables/scrabblepad/readme.md @@ -12,6 +12,6 @@ Hardware Availability: [Donut Cables](https://donutcables.com/) Make example for this keyboard (after setting up your build environment): - make scrabblepad:default + make donutcables/scrabblepad:default -See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. +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/scrabblepad/rules.mk b/keyboards/donutcables/scrabblepad/rules.mk index 20f532af4d..20f532af4d 100644 --- a/keyboards/scrabblepad/rules.mk +++ b/keyboards/donutcables/scrabblepad/rules.mk diff --git a/keyboards/scrabblepad/scrabblepad.c b/keyboards/donutcables/scrabblepad/scrabblepad.c index e97cbd46c0..e97cbd46c0 100644 --- a/keyboards/scrabblepad/scrabblepad.c +++ b/keyboards/donutcables/scrabblepad/scrabblepad.c diff --git a/keyboards/scrabblepad/scrabblepad.h b/keyboards/donutcables/scrabblepad/scrabblepad.h index fbe0dfc727..b4ac8b2c4f 100644 --- a/keyboards/scrabblepad/scrabblepad.h +++ b/keyboards/donutcables/scrabblepad/scrabblepad.h @@ -13,8 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef SCRABBLEPAD_H -#define SCRABBLEPAD_H +#pragma once #include "quantum.h" @@ -53,5 +52,3 @@ { kD0, kD1, kD2, kD3, kD4, kD5, kD6, kD7, kD8, kD9, kDA, kDB, kDC, kDD, kDE, }, \ { kE0, kE1, kE2, kE3, kE4, kE5, kE6, kE7, kE8, kE9, kEA, kEB, kEC, kED, kEE } \ } - -#endif diff --git a/keyboards/doro67/multi/config.h b/keyboards/doro67/multi/config.h new file mode 100644 index 0000000000..4a15063cc2 --- /dev/null +++ b/keyboards/doro67/multi/config.h @@ -0,0 +1,33 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0xD070 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Backprop Studio +#define PRODUCT Doro67 Multi PCB +#define DESCRIPTION 65% custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * 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 { D0, D1, D2, D3, D5 } +#define MATRIX_COL_PINS { B0, B1, B2, B3, D4, D6, D7, B4, B5, B6, C6, C7, F5, F6, F7 } + +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_LEVELS 7 diff --git a/keyboards/doro67/multi/info.json b/keyboards/doro67/multi/info.json new file mode 100644 index 0000000000..03252140dd --- /dev/null +++ b/keyboards/doro67/multi/info.json @@ -0,0 +1,18 @@ +{ + "keyboard_name": "Doro67 Multi PCB", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT_ansi": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Ins", "x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Del", "x":15, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"PgUp", "x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Up", "x":14, "y":3}, {"label":"PgDn", "x":15, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"MO(1)", "x":11.25, "y":4, "w":1.25}, {"label":"Left", "x":13, "y":4}, {"label":"Down", "x":14, "y":4}, {"label":"Right", "x":15, "y":4}] + }, + "LAYOUT_iso": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"\u00a3", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Ins", "x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Del", "x":15, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"PgUp", "x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Up", "x":14, "y":3}, {"label":"PgDn", "x":15, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"MO(1)", "x":11.25, "y":4, "w":1.25}, {"label":"Left", "x":13, "y":4}, {"label":"Down", "x":14, "y":4}, {"label":"Right", "x":15, "y":4}] + }, + "LAYOUT_multi": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Back", "x":13, "y":0}, {"label":"F2", "x":14, "y":0}, {"label":"Ins", "x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Del", "x":15, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"PgUp", "x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"F1", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Up", "x":14, "y":3}, {"label":"PgDn", "x":15, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.75}, {"x":6.5, "y":4, "w":1.25}, {"x":7.75, "y":4, "w":2.25}, {"label":"Alt", "x":10, "y":4}, {"label":"MO(1)", "x":11, "y":4}, {"label":"Ctrl", "x":12, "y":4}, {"label":"Left", "x":13, "y":4}, {"label":"Down", "x":14, "y":4}, {"label":"Right", "x":15, "y":4}] + } + } +} diff --git a/keyboards/doro67/multi/keymaps/default/keymap.c b/keyboards/doro67/multi/keymaps/default/keymap.c new file mode 100644 index 0000000000..dd40a6c3fa --- /dev/null +++ b/keyboards/doro67/multi/keymaps/default/keymap.c @@ -0,0 +1,36 @@ +/* Copyright 2019 ShadeDream + * + * 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 QMK_KEYBOARD_H + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ansi( + KC_ESC, 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, + 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, + 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, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT + ), + [1] = LAYOUT_ansi( + KC_GRV, 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_TRNS, KC_TRNS, + BL_TOGG, BL_STEP, BL_DEC, BL_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + +}; diff --git a/keyboards/doro67/multi/keymaps/default/readme.md b/keyboards/doro67/multi/keymaps/default/readme.md new file mode 100644 index 0000000000..6e63cde3a1 --- /dev/null +++ b/keyboards/doro67/multi/keymaps/default/readme.md @@ -0,0 +1,36 @@ +# Default Doro67 ANSI layout. + +This is the default ANSI layout that comes flashed on the Doro67 multi PCB with +the exception of adding backtick as it was not mapped. + +Default Layer: + +``` +,---------------------------------------------------------------. +|Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|BackSp |Ins| +|---------------------------------------------------------------| +|Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |Del| +|---------------------------------------------------------------| +|Ctrl | A| S| D| F| G| H| J| K| L| ;| '| Enter |PUp| +|---------------------------------------------------------------| +|Shift | Z| X| C| V| B| N| M| ,| .| /| Shift| Up|PDn| +|---------------------------------------------------------------| +|Ctrl |GUI |Alt | Space |Alt |FN |Lft|Dwn|Rgt| +`---------------------------------------------------------------' +``` + +FN Layer: + +``` +,---------------------------------------------------------------. +|` | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| | | +|---------------------------------------------------------------| +|BLTog|Stp|Dec|Inc| | | | | | | | | | | | +|---------------------------------------------------------------| +| | | | | | | | | | | | | | | +|---------------------------------------------------------------| +| | | | | | | | | | | | | | | +|---------------------------------------------------------------| +| | | | | | | | | | +`---------------------------------------------------------------' +``` diff --git a/keyboards/doro67/multi/keymaps/default_iso/keymap.c b/keyboards/doro67/multi/keymaps/default_iso/keymap.c new file mode 100644 index 0000000000..2e8d839820 --- /dev/null +++ b/keyboards/doro67/multi/keymaps/default_iso/keymap.c @@ -0,0 +1,36 @@ +/* Copyright 2019 ShadeDream + * + * 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 QMK_KEYBOARD_H + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_iso( + KC_ESC, 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, + 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, + 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, + 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_LSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT + ), + [1] = LAYOUT_iso( + KC_GRV, 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_TRNS, KC_TRNS, + BL_TOGG, BL_STEP, BL_DEC, BL_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + +}; diff --git a/keyboards/doro67/multi/keymaps/default_iso/readme.md b/keyboards/doro67/multi/keymaps/default_iso/readme.md new file mode 100644 index 0000000000..d375f0cc5d --- /dev/null +++ b/keyboards/doro67/multi/keymaps/default_iso/readme.md @@ -0,0 +1,36 @@ +# Default Doro67 ISO layout. + +This is the default ISO layout that comes flashed on the Doro67 multi PCB with +the exception of adding backtick and UK ISO specific keycodes as they were not mapped. + +Default Layer: + +``` +,---------------------------------------------------------------. +|Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|BackSp |Ins| +|---------------------------------------------------------------| +|Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| |Del| +|------------------------------------------------------|Entr|---| +|Ctrl | A| S| D| F| G| H| J| K| L| ;| '| #| |PUp| +|---------------------------------------------------------------| +|Shft| \| Z| X| C| V| B| N| M| ,| .| /| Shift| Up|PDn| +|---------------------------------------------------------------| +|Ctrl |GUI |Alt | Space |Alt |FN |Lft|Dwn|Rgt| +`---------------------------------------------------------------' +``` + +FN Layer: + +``` +,---------------------------------------------------------------. +|` | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| | | +|---------------------------------------------------------------| +|BLTog|Stp|Dec|Inc| | | | | | | | | | | | +|------------------------------------------------------| |---| +| | | | | | | | | | | | | | | | +|---------------------------------------------------------------| +| | | | | | | | | | | | | | | | +|---------------------------------------------------------------| +| | | | | | | | | | +`---------------------------------------------------------------' +``` diff --git a/keyboards/doro67/multi/keymaps/default_multi/keymap.c b/keyboards/doro67/multi/keymaps/default_multi/keymap.c new file mode 100644 index 0000000000..e57dce1ea2 --- /dev/null +++ b/keyboards/doro67/multi/keymaps/default_multi/keymap.c @@ -0,0 +1,36 @@ +/* Copyright 2019 ShadeDream + * + * 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 QMK_KEYBOARD_H + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_multi( + KC_ESC, 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_F2, KC_INS, + 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, + 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, + KC_LSFT, KC_F1, 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, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + [1] = LAYOUT_multi( + KC_GRV, 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_TRNS, KC_TRNS, KC_TRNS, + BL_TOGG, BL_STEP, BL_DEC, BL_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + +}; diff --git a/keyboards/doro67/multi/keymaps/default_multi/readme.md b/keyboards/doro67/multi/keymaps/default_multi/readme.md new file mode 100644 index 0000000000..e32f820c28 --- /dev/null +++ b/keyboards/doro67/multi/keymaps/default_multi/readme.md @@ -0,0 +1,39 @@ +# Default Doro67 Multi layout. + +This is the default Multi layout that comes flashed on the Doro67 multi PCB with +the exception of adding backtick as it was not mapped. + +This layout supports both the blocker and non-blocker layouts (2 & 4) with the +difference that the blocker layout lacks the right control key. + +Default Layer: + +``` +,---------------------------------------------------------------. +|Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BS| F2|Ins| +|---------------------------------------------------------------| +|Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |Del| +|---------------------------------------------------------------| +|Ctrl | A| S| D| F| G| H| J| K| L| ;| '| Enter |PUp| +|---------------------------------------------------------------| +|Shft| F1| Z| X| C| V| B| N| M| ,| .| /| Shift| Up|PDn| +|---------------------------------------------------------------| +|Ctrl |GUI |Alt | Space |Space| Space |Alt|MO1|Ctl|Lft|Dwn|Rgt| +`---------------------------------------------------------------' +``` + +FN Layer: + +``` +,---------------------------------------------------------------. +|` | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| | | +|---------------------------------------------------------------| +|BLTog|Stp|Dec|Inc| | | | | | | | | | | | +|---------------------------------------------------------------| +| | | | | | | | | | | | | | | +|---------------------------------------------------------------| +| | | | | | | | | | | | | | | | +|---------------------------------------------------------------| +| | | | | | | | | | | | | +`---------------------------------------------------------------' +``` diff --git a/keyboards/doro67/multi/multi.c b/keyboards/doro67/multi/multi.c new file mode 100644 index 0000000000..477ab245c3 --- /dev/null +++ b/keyboards/doro67/multi/multi.c @@ -0,0 +1,43 @@ +/* Copyright 2019 ShadeDream + * + * 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 "multi.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/doro67/multi/multi.h b/keyboards/doro67/multi/multi.h new file mode 100644 index 0000000000..0b68aed426 --- /dev/null +++ b/keyboards/doro67/multi/multi.h @@ -0,0 +1,59 @@ +/* Copyright 2019 ShadeDream + * 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" + +#define LAYOUT_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K44, K49, K4A, K4C, K4D, K4E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D, K2E }, \ + { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, KC_NO, K44, KC_NO, KC_NO, KC_NO, KC_NO, K49, K4A, KC_NO, K4C, K4D, K4E }, \ +} + +#define LAYOUT_iso( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K44, K49, K4A, K4C, K4D, K4E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, KC_NO, K44, KC_NO, KC_NO, KC_NO, KC_NO, K49, K4A, KC_NO, K4C, K4D, K4E }, \ +} + +#define LAYOUT_multi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K48, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K43, K44, K45, K49, K4A, K4B, K4C, K4D, K4E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, K43, K44, K45, KC_NO, KC_NO, K48, K49, K4A, K4B, K4C, K4D, K4E }, \ +} diff --git a/keyboards/doro67/multi/readme.md b/keyboards/doro67/multi/readme.md new file mode 100644 index 0000000000..ac1484cd74 --- /dev/null +++ b/keyboards/doro67/multi/readme.md @@ -0,0 +1,16 @@ +Doro67 Multi PCB +=== + +A custom 65% keyboard with multiple layout support. + +Do not flash RGB firmware for this board. + +Keyboard Maintainer: [ShadeDream](https://github.com/shadedream) +Hardware Supported: Doro67 Multi PCB +Hardware Availability: [Geekhack GB](https://geekhack.org/index.php?topic=97265.0) + +Make example for this keyboard (after setting up your build environment): + + make doro67/multi:default + +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/doro67/multi/rules.mk b/keyboards/doro67/multi/rules.mk new file mode 100644 index 0000000000..387ce74822 --- /dev/null +++ b/keyboards/doro67/multi/rules.mk @@ -0,0 +1,47 @@ +MCU = atmega32u4 +F_CPU = 16000000 +ARCH = AVR8 +F_USB = $(F_CPU) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/dozen0/config.h b/keyboards/dozen0/config.h index 3c409350d5..6b0f8525a3 100644 --- a/keyboards/dozen0/config.h +++ b/keyboards/dozen0/config.h @@ -112,11 +112,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. * */ -/* key combination for magic key command */ -/*#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -)*/ - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/duck/duck_led/duck_led.c b/keyboards/duck/duck_led/duck_led.c new file mode 100644 index 0000000000..2fa920e4b6 --- /dev/null +++ b/keyboards/duck/duck_led/duck_led.c @@ -0,0 +1,7 @@ +#include <avr/io.h> +#include "duck_led.h" +#include "quantum.h" + +void show(void) { + wait_us((RES / 1000UL) + 1); +} diff --git a/keyboards/duck/duck_led/duck_led.h b/keyboards/duck/duck_led/duck_led.h new file mode 100644 index 0000000000..2546366d0c --- /dev/null +++ b/keyboards/duck/duck_led/duck_led.h @@ -0,0 +1,16 @@ +#pragma once + +#define RES 6000 + +#define NS_PER_SEC (1000000000L) +#define CYCLES_PER_SEC (F_CPU) +#define NS_PER_CYCLE (NS_PER_SEC / CYCLES_PER_SEC) +#define NS_TO_CYCLES(n) ((n) / NS_PER_CYCLE) + +enum Device { + Device_PCBRGB, + Device_STATUSLED +}; + +void show(void); + diff --git a/keyboards/duck/eagle_viper/readme.md b/keyboards/duck/eagle_viper/readme.md index 14fb166698..3fec11bc0a 100644 --- a/keyboards/duck/eagle_viper/readme.md +++ b/keyboards/duck/eagle_viper/readme.md @@ -9,4 +9,3 @@ Newest version is the [Eagle/Viper V2](http://duck0113.tistory.com/127) Make example for this keyboard (after setting up your build environment): make duck/eagle_viper/v2:default - diff --git a/keyboards/duck/eagle_viper/v2/config.h b/keyboards/duck/eagle_viper/v2/config.h index f454b2e0e1..a0ce866cc3 100644 --- a/keyboards/duck/eagle_viper/v2/config.h +++ b/keyboards/duck/eagle_viper/v2/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -44,6 +43,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define RGB_DI_PIN D6 #define RGBLED_NUM 17 +/* Set to top left most key */ +#define BOOTMAGIC_LITE_ROW 4 +#define BOOTMAGIC_LITE_COLUMN 10 + #define TAPPING_TERM 200 -#endif diff --git a/keyboards/duck/eagle_viper/v2/indicator_leds.c b/keyboards/duck/eagle_viper/v2/indicator_leds.c index 03a93197da..fc90ed3fbd 100644 --- a/keyboards/duck/eagle_viper/v2/indicator_leds.c +++ b/keyboards/duck/eagle_viper/v2/indicator_leds.c @@ -19,19 +19,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <stdbool.h> #include <util/delay.h> #include "indicator_leds.h" - -#define RES 6000 +#include "duck_led/duck_led.h" #define LED_T1H 600 #define LED_T1L 650 #define LED_T0H 250 #define LED_T0L 1000 -#define NS_PER_SEC (1000000000L) -#define CYCLES_PER_SEC (F_CPU) -#define NS_PER_CYCLE (NS_PER_SEC / CYCLES_PER_SEC) -#define NS_TO_CYCLES(n) ((n) / NS_PER_CYCLE) - void send_bit_d4(bool bitVal) { if(bitVal) { asm volatile ( @@ -66,14 +60,12 @@ void send_bit_d4(bool bitVal) { } } -void show(void) { - _delay_us((RES / 1000UL) + 1); -} - -void send_value(uint8_t byte) { +void send_value(uint8_t byte, enum Device device) { for(uint8_t b = 0; b < 8; b++) { - send_bit_d4(byte & 0b10000000); - byte <<= 1; + if(device == Device_STATUSLED) { + send_bit_d4(byte & 0b10000000); + byte <<= 1; + } } } @@ -83,7 +75,8 @@ void indicator_leds_set(bool leds[8]) { cli(); for(led_cnt = 0; led_cnt < 8; led_cnt++) - send_value(leds[led_cnt] ? 255 : 0); + send_value(leds[led_cnt] ? 255 : 0, Device_STATUSLED); sei(); show(); } + diff --git a/keyboards/duck/eagle_viper/v2/indicator_leds.h b/keyboards/duck/eagle_viper/v2/indicator_leds.h index c174fa404d..fe66eef6b2 100644 --- a/keyboards/duck/eagle_viper/v2/indicator_leds.h +++ b/keyboards/duck/eagle_viper/v2/indicator_leds.h @@ -1,2 +1 @@ void indicator_leds_set(bool leds[8]); -void show(void); diff --git a/keyboards/duck/eagle_viper/v2/matrix.c b/keyboards/duck/eagle_viper/v2/matrix.c index 7003a7ae00..a6bc563422 100644 --- a/keyboards/duck/eagle_viper/v2/matrix.c +++ b/keyboards/duck/eagle_viper/v2/matrix.c @@ -89,6 +89,9 @@ uint8_t matrix_scan(void) { bool curr_bit = rows & (1<<row); if (prev_bit != curr_bit) { matrix_debouncing[row] ^= ((matrix_row_t)1<<col); + if (debouncing) { + dprint("bounce!: "); dprintf("%02X", debouncing); dprintln(); + } debouncing = DEBOUNCING_DELAY; } } diff --git a/keyboards/duck/eagle_viper/v2/readme.md b/keyboards/duck/eagle_viper/v2/readme.md index 32ad8453ca..31f70b93b9 100644 --- a/keyboards/duck/eagle_viper/v2/readme.md +++ b/keyboards/duck/eagle_viper/v2/readme.md @@ -11,6 +11,8 @@ Make example for this keyboard (after setting up your build environment): make eagle_viper/v2:default +**Reset Key:** To put the Eagle/Viper V2 into reset, hold caps lock key (`K2A`) while plugging in. + See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. ## Hardware Notes diff --git a/keyboards/duck/eagle_viper/v2/rules.mk b/keyboards/duck/eagle_viper/v2/rules.mk index 64d839fcbd..1abd7d9413 100644 --- a/keyboards/duck/eagle_viper/v2/rules.mk +++ b/keyboards/duck/eagle_viper/v2/rules.mk @@ -50,23 +50,23 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= no # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE ?= yes # USB Nkey Rollover -BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE ?= no # MIDI support (+2400 to 4200, depending on config) -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE ?= no # Audio output on port C6 -FAUXCLICKY_ENABLE ?= no # Use buzzer to emulate clicky switches +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches RGBLIGHT_ENABLE = yes CUSTOM_MATRIX = yes SRC += indicator_leds.c \ - matrix.c + matrix.c duck_led/duck_led.c diff --git a/keyboards/duck/eagle_viper/v2/v2.h b/keyboards/duck/eagle_viper/v2/v2.h index d149471ba3..7fefcf770c 100644 --- a/keyboards/duck/eagle_viper/v2/v2.h +++ b/keyboards/duck/eagle_viper/v2/v2.h @@ -13,8 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef V2_H -#define V2_H +#pragma once #include "quantum.h" @@ -78,4 +77,3 @@ #define LAYOUT_eagle LAYOUT_60_ansi -#endif diff --git a/keyboards/duck/jetfire/config.h b/keyboards/duck/jetfire/config.h index 4bc535b192..774e284918 100644 --- a/keyboards/duck/jetfire/config.h +++ b/keyboards/duck/jetfire/config.h @@ -48,6 +48,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ #define DEBOUNCING_DELAY 5 +/* Set to top left most key */ +#define BOOTMAGIC_LITE_ROW 5 +#define BOOTMAGIC_LITE_COLUMN 10 + /* 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). */ diff --git a/keyboards/duck/jetfire/backlight_led.c b/keyboards/duck/jetfire/indicator_leds.c index 7e9dca6e9f..7dbdb1ff79 100644 --- a/keyboards/duck/jetfire/backlight_led.c +++ b/keyboards/duck/jetfire/indicator_leds.c @@ -17,21 +17,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <stdbool.h> #include <util/delay.h> #include <stdint.h> -#include "backlight_led.h" +#include "indicator_leds.h" #include "quantum.h" -// #include "led.h" - -#define T1H 900 -#define T1L 600 -#define T0H 400 -#define T0L 900 -#define RES 6000 - -#define NS_PER_SEC (1000000000L) -#define CYCLES_PER_SEC (F_CPU) -#define NS_PER_CYCLE (NS_PER_SEC / CYCLES_PER_SEC) -#define NS_TO_CYCLES(n) ((n) / NS_PER_CYCLE) +#define LED_T1H 900 +#define LED_T1L 600 +#define LED_T0H 400 +#define LED_T0L 900 void send_bit_d4(bool bitVal) { @@ -48,8 +40,8 @@ void send_bit_d4(bool bitVal) :: [port] "I" (_SFR_IO_ADDR(PORTD)), [bit] "I" (4), - [onCycles] "I" (NS_TO_CYCLES(T1H) - 2), - [offCycles] "I" (NS_TO_CYCLES(T1L) - 2)); + [onCycles] "I" (NS_TO_CYCLES(LED_T1H) - 2), + [offCycles] "I" (NS_TO_CYCLES(LED_T1L) - 2)); } else { asm volatile ( "sbi %[port], %[bit] \n\t" @@ -63,8 +55,8 @@ void send_bit_d4(bool bitVal) :: [port] "I" (_SFR_IO_ADDR(PORTD)), [bit] "I" (4), - [onCycles] "I" (NS_TO_CYCLES(T0H) - 2), - [offCycles] "I" (NS_TO_CYCLES(T0L) - 2)); + [onCycles] "I" (NS_TO_CYCLES(LED_T0H) - 2), + [offCycles] "I" (NS_TO_CYCLES(LED_T0L) - 2)); } } @@ -83,8 +75,8 @@ void send_bit_d6(bool bitVal) :: [port] "I" (_SFR_IO_ADDR(PORTD)), [bit] "I" (6), - [onCycles] "I" (NS_TO_CYCLES(T1H) - 2), - [offCycles] "I" (NS_TO_CYCLES(T1L) - 2)); + [onCycles] "I" (NS_TO_CYCLES(LED_T1H) - 2), + [offCycles] "I" (NS_TO_CYCLES(LED_T1L) - 2)); } else { asm volatile ( "sbi %[port], %[bit] \n\t" @@ -98,20 +90,15 @@ void send_bit_d6(bool bitVal) :: [port] "I" (_SFR_IO_ADDR(PORTD)), [bit] "I" (6), - [onCycles] "I" (NS_TO_CYCLES(T0H) - 2), - [offCycles] "I" (NS_TO_CYCLES(T0L) - 2)); + [onCycles] "I" (NS_TO_CYCLES(LED_T0H) - 2), + [offCycles] "I" (NS_TO_CYCLES(LED_T0L) - 2)); } } -void show(void) -{ - _delay_us((RES / 1000UL) + 1); -} - void send_value(uint8_t byte, enum Device device) { for(uint8_t b = 0; b < 8; b++) { - if(device == Device_STATELED) { + if(device == Device_STATUSLED) { send_bit_d4(byte & 0b10000000); } if(device == Device_PCBRGB) { @@ -123,7 +110,7 @@ void send_value(uint8_t byte, enum Device device) void send_color(uint8_t r, uint8_t g, uint8_t b, enum Device device) { - send_value(g, device); send_value(r, device); + send_value(g, device); send_value(b, device); } diff --git a/keyboards/duck/jetfire/backlight_led.h b/keyboards/duck/jetfire/indicator_leds.h index 36d8d9aa9b..695e1db6d4 100644 --- a/keyboards/duck/jetfire/backlight_led.h +++ b/keyboards/duck/jetfire/indicator_leds.h @@ -1,10 +1,6 @@ -#ifndef BACKLIGHT_LED_H -#define BACKLIGHT_LED_H +#pragma once -enum Device { - Device_PCBRGB, - Device_STATELED -}; +#include "duck_led/duck_led.h" void backlight_init_ports(void); void backlight_set_state(bool cfg[7]); @@ -13,6 +9,3 @@ void backlight_toggle_rgb(bool enabled); void backlight_set_rgb(uint8_t cfg[17][3]); void backlight_set(uint8_t level); void send_color(uint8_t r, uint8_t g, uint8_t b, enum Device device); -void show(void); - -#endif diff --git a/keyboards/duck/jetfire/jetfire.c b/keyboards/duck/jetfire/jetfire.c index 81bdb95ba1..0662489c6f 100644 --- a/keyboards/duck/jetfire/jetfire.c +++ b/keyboards/duck/jetfire/jetfire.c @@ -14,9 +14,9 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "jetfire.h" -#include "backlight_led.h" +#include "indicator_leds.h" -enum backlight_level { +enum BACKLIGHT_AREAS { BACKLIGHT_ALPHA = 0b0000001, BACKLIGHT_MOD = 0b0000010, BACKLIGHT_FROW = 0b0000100, @@ -137,15 +137,15 @@ void backlight_update_state() send_color(backlight_state_led & (1<<STATE_LED_SCROLL_LOCK) ? 255 : 0, backlight_state_led & (1<<STATE_LED_CAPS_LOCK) ? 255 : 0, backlight_state_led & (1<<STATE_LED_NUM_LOCK) ? 255 : 0, - Device_STATELED); + Device_STATUSLED); send_color(backlight_state_led & (1<<STATE_LED_LAYER_1) ? 255 : 0, backlight_state_led & (1<<STATE_LED_LAYER_2) ? 255 : 0, backlight_state_led & (1<<STATE_LED_LAYER_0) ? 255 : 0, - Device_STATELED); + Device_STATUSLED); send_color(backlight_state_led & (1<<STATE_LED_LAYER_4) ? 255 : 0, backlight_state_led & (1<<STATE_LED_LAYER_3) ? 255 : 0, 0, - Device_STATELED); + Device_STATUSLED); sei(); show(); } diff --git a/keyboards/duck/jetfire/jetfire.h b/keyboards/duck/jetfire/jetfire.h index 9ce1406f0a..3c4834bce4 100644 --- a/keyboards/duck/jetfire/jetfire.h +++ b/keyboards/duck/jetfire/jetfire.h @@ -13,8 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef JETFIRE_H -#define JETFIRE_H +#pragma once #include "quantum.h" @@ -57,4 +56,3 @@ { K0A, K0B, K0C, KC_NO,KC_NO,KC_NO,KC_NO,KC_NO, K0I, KC_NO,KC_NO,KC_NO, K0M, K0N, K0O, K0P, K0Q, K0R, K0S, KC_NO } \ } -#endif diff --git a/keyboards/duck/jetfire/readme.md b/keyboards/duck/jetfire/readme.md index 34b351a726..8de2f5ced6 100644 --- a/keyboards/duck/jetfire/readme.md +++ b/keyboards/duck/jetfire/readme.md @@ -9,7 +9,7 @@ Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) Hardware Supported: Duck Jetfire PCB Hardware Availability: [Geekhack GB](https://geekhack.org/index.php?topic=92708.0) -To get into bootloader mode, hold the top top most key above the 2 navigation keys while connecting the USB cable. +**Reset Key:** To put the Jetfire into reset, hold top most key above the 2 navigation keys (`K5P`) while plugging in. Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/duck/jetfire/rules.mk b/keyboards/duck/jetfire/rules.mk index 8e05516df3..c708593293 100644 --- a/keyboards/duck/jetfire/rules.mk +++ b/keyboards/duck/jetfire/rules.mk @@ -51,7 +51,7 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE = no # Mouse keys(+4700) EXTRAKEY_ENABLE = no # Audio control and System control(+450) CONSOLE_ENABLE = yes # Console for debug(+400) @@ -70,5 +70,5 @@ FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) CUSTOM_MATRIX = yes -SRC += backlight_led.c \ - matrix.c +SRC += indicator_leds.c \ + matrix.c duck_led/duck_led.c diff --git a/keyboards/duck/lightsaver/config.h b/keyboards/duck/lightsaver/config.h index 9e3a08fbd1..d302fb3953 100644 --- a/keyboards/duck/lightsaver/config.h +++ b/keyboards/duck/lightsaver/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -44,6 +43,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define RGB_DI_PIN D6 #define RGBLED_NUM 17 +/* Set to top left most key */ +#define BOOTMAGIC_LITE_ROW 5 +#define BOOTMAGIC_LITE_COLUMN 10 + #define TAPPING_TERM 200 -#endif diff --git a/keyboards/duck/lightsaver/indicator_leds.c b/keyboards/duck/lightsaver/indicator_leds.c index 0a54e151e1..5d2e1ad9f6 100644 --- a/keyboards/duck/lightsaver/indicator_leds.c +++ b/keyboards/duck/lightsaver/indicator_leds.c @@ -18,17 +18,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <avr/io.h> #include <stdbool.h> #include <util/delay.h> +#include "duck_led/duck_led.h" -#define T1H 900 -#define T1L 600 -#define T0H 400 -#define T0L 900 -#define RES 6000 - -#define NS_PER_SEC (1000000000L) -#define CYCLES_PER_SEC (F_CPU) -#define NS_PER_CYCLE (NS_PER_SEC / CYCLES_PER_SEC) -#define NS_TO_CYCLES(n) ((n) / NS_PER_CYCLE) +#define LED_T1H 900 +#define LED_T1L 600 +#define LED_T0H 400 +#define LED_T0L 900 void send_bit_d4(bool bitVal) { if(bitVal) { @@ -44,8 +39,8 @@ void send_bit_d4(bool bitVal) { :: [port] "I" (_SFR_IO_ADDR(PORTD)), [bit] "I" (4), - [onCycles] "I" (NS_TO_CYCLES(T1H) - 2), - [offCycles] "I" (NS_TO_CYCLES(T1L) - 2)); + [onCycles] "I" (NS_TO_CYCLES(LED_T1H) - 2), + [offCycles] "I" (NS_TO_CYCLES(LED_T1L) - 2)); } else { asm volatile ( "sbi %[port], %[bit] \n\t" @@ -59,33 +54,31 @@ void send_bit_d4(bool bitVal) { :: [port] "I" (_SFR_IO_ADDR(PORTD)), [bit] "I" (4), - [onCycles] "I" (NS_TO_CYCLES(T0H) - 2), - [offCycles] "I" (NS_TO_CYCLES(T0L) - 2)); + [onCycles] "I" (NS_TO_CYCLES(LED_T0H) - 2), + [offCycles] "I" (NS_TO_CYCLES(LED_T0L) - 2)); } } -void show(void) { - _delay_us((RES / 1000UL) + 1); -} - -void send_value(uint8_t byte) { +void send_value(uint8_t byte, enum Device device) { for(uint8_t b = 0; b < 8; b++) { - send_bit_d4(byte & 0b10000000); - byte <<= 1; + if(device == Device_STATUSLED) { + send_bit_d4(byte & 0b10000000); + byte <<= 1; + } } } -void send_color(uint8_t r, uint8_t g, uint8_t b) { - send_value(g); - send_value(r); - send_value(b); +void send_color(uint8_t r, uint8_t g, uint8_t b, enum Device device) { + send_value(r, device); + send_value(g, device); + send_value(b, device); } void indicator_leds_set(bool leds[8]) { cli(); - send_color(leds[1] ? 255 : 0, leds[2] ? 255 : 0, leds[0] ? 255 : 0); - send_color(leds[4] ? 255 : 0, leds[5] ? 255 : 0, leds[3] ? 255 : 0); - send_color(leds[6] ? 255 : 0, leds[7] ? 255 : 0, 0); + send_color(leds[1] ? 255 : 0, leds[2] ? 255 : 0, leds[0] ? 255 : 0, Device_STATUSLED); + send_color(leds[4] ? 255 : 0, leds[5] ? 255 : 0, leds[3] ? 255 : 0, Device_STATUSLED); + send_color(leds[6] ? 255 : 0, leds[7] ? 255 : 0, 0, Device_STATUSLED); sei(); show(); } diff --git a/keyboards/duck/lightsaver/lightsaver.h b/keyboards/duck/lightsaver/lightsaver.h index 19fcf36bac..1e1185713b 100644 --- a/keyboards/duck/lightsaver/lightsaver.h +++ b/keyboards/duck/lightsaver/lightsaver.h @@ -13,8 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef LIGHTSAVER_H -#define LIGHTSAVER_H +#pragma once #include "quantum.h" @@ -37,4 +36,3 @@ /* 5 */ { K0A, K0B, K0C, NO, NO, NO, NO, NO, K0I, NO, K0K, NO, K0M, K0N, K0O, K0P, K0Q, K0R } \ } -#endif diff --git a/keyboards/duck/lightsaver/matrix.c b/keyboards/duck/lightsaver/matrix.c index a07cdd0d16..543205c0b7 100644 --- a/keyboards/duck/lightsaver/matrix.c +++ b/keyboards/duck/lightsaver/matrix.c @@ -87,6 +87,9 @@ uint8_t matrix_scan(void) { bool curr_bit = rows & (1<<row); if (prev_bit != curr_bit) { matrix_debouncing[row] ^= ((matrix_row_t)1<<col); + if (debouncing) { + dprint("bounce!: "); dprintf("%02X", debouncing); dprintln(); + } debouncing = DEBOUNCING_DELAY; } } diff --git a/keyboards/duck/lightsaver/rules.mk b/keyboards/duck/lightsaver/rules.mk index d95dbd9603..bc7b901b49 100644 --- a/keyboards/duck/lightsaver/rules.mk +++ b/keyboards/duck/lightsaver/rules.mk @@ -50,23 +50,23 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= no # Audio control and System control(+450) -CONSOLE_ENABLE ?= no # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE ?= yes # USB Nkey Rollover -BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE ?= no # MIDI support (+2400 to 4200, depending on config) -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE ?= no # Audio output on port C6 -FAUXCLICKY_ENABLE ?= no # Use buzzer to emulate clicky switches +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches RGBLIGHT_ENABLE = yes CUSTOM_MATRIX = yes SRC += indicator_leds.c \ - matrix.c + matrix.c duck_led/duck_led.c diff --git a/keyboards/duck/octagon/v1/config.h b/keyboards/duck/octagon/v1/config.h index 5400c53ef2..d818cb6223 100644 --- a/keyboards/duck/octagon/v1/config.h +++ b/keyboards/duck/octagon/v1/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -44,6 +43,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define RGB_DI_PIN D6 #define RGBLED_NUM 17 -#define TAPPING_TERM 200 +/* Set to top left most key */ +#define BOOTMAGIC_LITE_ROW 5 +#define BOOTMAGIC_LITE_COLUMN 10 -#endif +#define TAPPING_TERM 200 diff --git a/keyboards/duck/octagon/v1/matrix.c b/keyboards/duck/octagon/v1/matrix.c index 8555349943..233404ed30 100644 --- a/keyboards/duck/octagon/v1/matrix.c +++ b/keyboards/duck/octagon/v1/matrix.c @@ -84,6 +84,9 @@ uint8_t matrix_scan(void) { bool curr_bit = rows & (1<<row); if (prev_bit != curr_bit) { matrix_debouncing[row] ^= ((matrix_row_t)1<<col); + if (debouncing) { + dprint("bounce!: "); dprintf("%02X", debouncing); dprintln(); + } debouncing = DEBOUNCING_DELAY; } } diff --git a/keyboards/duck/octagon/v1/rules.mk b/keyboards/duck/octagon/v1/rules.mk index a08695b504..66d2c8defc 100644 --- a/keyboards/duck/octagon/v1/rules.mk +++ b/keyboards/duck/octagon/v1/rules.mk @@ -50,21 +50,21 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= no # Audio control and System control(+450) -CONSOLE_ENABLE ?= no # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE ?= yes # USB Nkey Rollover -BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE ?= no # MIDI support (+2400 to 4200, depending on config) -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE ?= no # Audio output on port C6 -FAUXCLICKY_ENABLE ?= no # Use buzzer to emulate clicky switches +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches RGBLIGHT_ENABLE = yes CUSTOM_MATRIX = yes diff --git a/keyboards/duck/octagon/v1/v1.h b/keyboards/duck/octagon/v1/v1.h index d89188f22c..471a91a332 100644 --- a/keyboards/duck/octagon/v1/v1.h +++ b/keyboards/duck/octagon/v1/v1.h @@ -13,8 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef V1_H -#define V1_H +#pragma once #include "quantum.h" @@ -49,4 +48,3 @@ { K1A, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1L, KC_NO, K1M, K1N, KC_NO, K1P }, \ { K0A, K0B, K0C, KC_NO, KC_NO, K0G, KC_NO, KC_NO, K0J, K0K, K0L, KC_NO, K0M, K0N, KC_NO, K0P } \ } -#endif diff --git a/keyboards/duck/octagon/v2/config.h b/keyboards/duck/octagon/v2/config.h index 78d18d3bb3..4aab587f66 100644 --- a/keyboards/duck/octagon/v2/config.h +++ b/keyboards/duck/octagon/v2/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -44,6 +43,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define RGB_DI_PIN D6 #define RGBLED_NUM 17 +/* Set to top left most key */ +#define BOOTMAGIC_LITE_ROW 5 +#define BOOTMAGIC_LITE_COLUMN 10 + #define TAPPING_TERM 200 -#endif diff --git a/keyboards/duck/octagon/v2/indicator_leds.c b/keyboards/duck/octagon/v2/indicator_leds.c index c24509f514..116306fb71 100644 --- a/keyboards/duck/octagon/v2/indicator_leds.c +++ b/keyboards/duck/octagon/v2/indicator_leds.c @@ -20,16 +20,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <util/delay.h> #include "indicator_leds.h" -#define T1H 900 -#define T1L 600 -#define T0H 400 -#define T0L 900 -#define RES 6000 - -#define NS_PER_SEC (1000000000L) -#define CYCLES_PER_SEC (F_CPU) -#define NS_PER_CYCLE (NS_PER_SEC / CYCLES_PER_SEC) -#define NS_TO_CYCLES(n) ((n) / NS_PER_CYCLE) +#define LED_T1H 900 +#define LED_T1L 600 +#define LED_T0H 400 +#define LED_T0L 900 void send_bit_d4(bool bitVal) { if(bitVal) { @@ -45,8 +39,8 @@ void send_bit_d4(bool bitVal) { :: [port] "I" (_SFR_IO_ADDR(PORTD)), [bit] "I" (4), - [onCycles] "I" (NS_TO_CYCLES(T1H) - 2), - [offCycles] "I" (NS_TO_CYCLES(T1L) - 2)); + [onCycles] "I" (NS_TO_CYCLES(LED_T1H) - 2), + [offCycles] "I" (NS_TO_CYCLES(LED_T1L) - 2)); } else { asm volatile ( "sbi %[port], %[bit] \n\t" @@ -60,8 +54,8 @@ void send_bit_d4(bool bitVal) { :: [port] "I" (_SFR_IO_ADDR(PORTD)), [bit] "I" (4), - [onCycles] "I" (NS_TO_CYCLES(T0H) - 2), - [offCycles] "I" (NS_TO_CYCLES(T0L) - 2)); + [onCycles] "I" (NS_TO_CYCLES(LED_T0H) - 2), + [offCycles] "I" (NS_TO_CYCLES(LED_T0L) - 2)); } } @@ -80,8 +74,8 @@ void send_bit_d6(bool bitVal) :: [port] "I" (_SFR_IO_ADDR(PORTD)), [bit] "I" (6), - [onCycles] "I" (NS_TO_CYCLES(T1H) - 2), - [offCycles] "I" (NS_TO_CYCLES(T1L) - 2)); + [onCycles] "I" (NS_TO_CYCLES(LED_T1H) - 2), + [offCycles] "I" (NS_TO_CYCLES(LED_T1L) - 2)); } else { asm volatile ( "sbi %[port], %[bit] \n\t" @@ -95,15 +89,11 @@ void send_bit_d6(bool bitVal) :: [port] "I" (_SFR_IO_ADDR(PORTD)), [bit] "I" (6), - [onCycles] "I" (NS_TO_CYCLES(T0H) - 2), - [offCycles] "I" (NS_TO_CYCLES(T0L) - 2)); + [onCycles] "I" (NS_TO_CYCLES(LED_T0H) - 2), + [offCycles] "I" (NS_TO_CYCLES(LED_T0L) - 2)); } } -void show(void) { - _delay_us((RES / 1000UL) + 1); -} - void send_value(uint8_t byte, enum Device device) { for(uint8_t b = 0; b < 8; b++) { if(device == Device_STATUSLED) { @@ -117,8 +107,8 @@ void send_value(uint8_t byte, enum Device device) { } void send_color(uint8_t r, uint8_t g, uint8_t b, enum Device device) { - send_value(g, device); send_value(r, device); + send_value(g, device); send_value(b, device); } diff --git a/keyboards/duck/octagon/v2/indicator_leds.h b/keyboards/duck/octagon/v2/indicator_leds.h index 9bb2c8ced9..ad3ec54f52 100644 --- a/keyboards/duck/octagon/v2/indicator_leds.h +++ b/keyboards/duck/octagon/v2/indicator_leds.h @@ -1,11 +1,7 @@ -enum Device { - Device_PCBRGB, - Device_STATUSLED -}; +#include "duck_led/duck_led.h" void indicator_leds_set(bool leds[8]); void backlight_toggle_rgb(bool enabled); void backlight_set_rgb(uint8_t cfg[17][3]); void backlight_init_ports(void); void send_color(uint8_t r, uint8_t g, uint8_t b, enum Device device); -void show(void);
\ No newline at end of file diff --git a/keyboards/duck/octagon/v2/matrix.c b/keyboards/duck/octagon/v2/matrix.c index a63a37640f..e6e7046b45 100644 --- a/keyboards/duck/octagon/v2/matrix.c +++ b/keyboards/duck/octagon/v2/matrix.c @@ -89,6 +89,9 @@ uint8_t matrix_scan(void) { bool curr_bit = rows & (1<<row); if (prev_bit != curr_bit) { matrix_debouncing[row] ^= ((matrix_row_t)1<<col); + if (debouncing) { + dprint("bounce!: "); dprintf("%02X", debouncing); dprintln(); + } debouncing = DEBOUNCING_DELAY; } } diff --git a/keyboards/duck/octagon/v2/readme.md b/keyboards/duck/octagon/v2/readme.md index b409454fc6..cc9474fc93 100644 --- a/keyboards/duck/octagon/v2/readme.md +++ b/keyboards/duck/octagon/v2/readme.md @@ -11,6 +11,8 @@ Make example for this keyboard (after setting up your build environment): make octagon/v2:default +**Reset Key:** To put the Octagon V2 into reset, hold the top right most key (`K5Q`) while plugging in. + See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. ## Hardware Notes diff --git a/keyboards/duck/octagon/v2/rules.mk b/keyboards/duck/octagon/v2/rules.mk index 37f3938d93..c403247074 100644 --- a/keyboards/duck/octagon/v2/rules.mk +++ b/keyboards/duck/octagon/v2/rules.mk @@ -50,25 +50,25 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= no # Audio control and System control(+450) -CONSOLE_ENABLE ?= no # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE ?= yes # USB Nkey Rollover -BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE ?= no # MIDI support (+2400 to 4200, depending on config) -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE ?= no # Audio output on port C6 -FAUXCLICKY_ENABLE ?= no # Use buzzer to emulate clicky switches +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches RGBLIGHT_ENABLE = yes CUSTOM_MATRIX = yes SRC += indicator_leds.c \ - matrix.c + matrix.c duck_led/duck_led.c LAYOUTS = 75_ansi diff --git a/keyboards/duck/octagon/v2/v2.h b/keyboards/duck/octagon/v2/v2.h index 1487b3640a..d60631009c 100644 --- a/keyboards/duck/octagon/v2/v2.h +++ b/keyboards/duck/octagon/v2/v2.h @@ -13,8 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef V2_H -#define V2_H +#pragma once #include "quantum.h" @@ -49,4 +48,3 @@ { K1A, KC_NO, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, KC_NO, K1M, K1N, K1O, K1P, KC_NO }, \ { K0A, K0B, K0C, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K0J, KC_NO, K0K, K0L, K0M, K0N, K0O, K0P, KC_NO } \ } -#endif diff --git a/keyboards/dztech/dz40rgb/config.h b/keyboards/dztech/dz40rgb/config.h index 2ac7fbdc87..0d6c4ae39a 100644 --- a/keyboards/dztech/dz40rgb/config.h +++ b/keyboards/dztech/dz40rgb/config.h @@ -22,7 +22,6 @@ #define DEBOUNCE 3 #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects #define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended -#define RGB_MATRIX_SKIP_FRAMES 0 #define RGB_MATRIX_KEYPRESSES #define DISABLE_RGB_MATRIX_SPLASH #define DISABLE_RGB_MATRIX_MULTISPLASH @@ -31,4 +30,3 @@ #define DRIVER_ADDR_2 0b1010000 // this is here for compliancy reasons. #define DRIVER_COUNT 2 - diff --git a/keyboards/dztech/dz60rgb/config.h b/keyboards/dztech/dz60rgb/config.h index a1b3a19d9f..f43b39810f 100644 --- a/keyboards/dztech/dz60rgb/config.h +++ b/keyboards/dztech/dz60rgb/config.h @@ -23,8 +23,9 @@ #define DEBOUNCE 3 #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects #define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended -#define RGB_MATRIX_SKIP_FRAMES 0 #define RGB_MATRIX_KEYPRESSES +#define RGB_MATRIX_LED_PROCESS_LIMIT 4 +#define RGB_MATRIX_LED_FLUSH_LIMIT 26 #define DISABLE_RGB_MATRIX_SPLASH #define DISABLE_RGB_MATRIX_MULTISPLASH #define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH diff --git a/keyboards/dztech/dz60rgb/keymaps/default/keymap.c b/keyboards/dztech/dz60rgb/keymaps/default/keymap.c index 2c667ef42e..0eff4ca8a3 100644 --- a/keyboards/dztech/dz60rgb/keymaps/default/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/default/keymap.c @@ -10,7 +10,7 @@ extern bool g_suspend_state; #define _LAYER7 7 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_LAYER0] = LAYOUT( /* Base */ - RESET, RGB_MOD, 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_GESC, 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_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_BSLASH,\ CTL_T(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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RSFT_T(KC_SLSH), KC_UP, LT(2, KC_DEL),\ @@ -60,92 +60,90 @@ void rgb_matrix_indicators_user(void) { if (!g_suspend_state) { switch (biton32(layer_state)) { case _LAYER1: - rgb_matrix_layer_helper(0xFF, 0x00, 0x00, false); break; + rgb_matrix_layer_helper(0xFF, 0x00, 0x00, false); + break; case _LAYER2: - rgb_matrix_layer_helper(0x00, 0xFF, 0x00, false); break; + rgb_matrix_layer_helper(0x00, 0xFF, 0x00, false); + break; + case _LAYER3: + if ( this_led & (1<<USB_LED_NUM_LOCK)) { + rgb_matrix_set_color(13, 0xFF, 0x00, 0x00); + } else { + rgb_matrix_set_color(13, 0x00, 0x00, 0x00); + } + rgb_matrix_set_color(0, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(1, 0x00, 0x00, 0x00); + rgb_matrix_set_color(1, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(2, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(3, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(4, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(5, 0x00, 0x00, 0x00); + rgb_matrix_set_color(6, 0x00, 0x00, 0x00); + rgb_matrix_set_color(7, 0x00, 0x00, 0x00); + rgb_matrix_set_color(8, 0x00, 0x00, 0x00); + rgb_matrix_set_color(9, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(10, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(11, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(12, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(14, 0x00, 0x00, 0xFF); + rgb_matrix_set_color(15, 0x00, 0x00, 0x00); + rgb_matrix_set_color(16, 0x00, 0x00, 0x00); + rgb_matrix_set_color(17, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(18, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(19, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(20, 0x00, 0x00, 0x00); + rgb_matrix_set_color(21, 0x00, 0x00, 0x00); + rgb_matrix_set_color(22, 0x00, 0x00, 0x00); + rgb_matrix_set_color(23, 0x00, 0x00, 0x00); + rgb_matrix_set_color(24, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(25, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(26, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(27, 0x00, 0x00, 0x00); + rgb_matrix_set_color(28, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(29, 0x00, 0x00, 0x00); + rgb_matrix_set_color(30, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(31, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(32, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(33, 0x00, 0x00, 0x00); + rgb_matrix_set_color(34, 0x00, 0x00, 0x00); + rgb_matrix_set_color(35, 0x00, 0x00, 0x00); + rgb_matrix_set_color(36, 0x00, 0x00, 0x00); + rgb_matrix_set_color(37, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(38, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(39, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(40, 0x00, 0x00, 0x00); + rgb_matrix_set_color(41, 0x00, 0x00, 0x00); + rgb_matrix_set_color(42, 0x00, 0x00, 0x00); + rgb_matrix_set_color(43, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(44, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(45, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(46, 0x00, 0x00, 0x00); + rgb_matrix_set_color(47, 0x00, 0x00, 0x00); + rgb_matrix_set_color(48, 0x00, 0x00, 0x00); + rgb_matrix_set_color(49, 0x00, 0x00, 0x00); + rgb_matrix_set_color(50, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(51, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(52, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(53, 0x00, 0x00, 0x00); + rgb_matrix_set_color(54, 0x00, 0x00, 0x00); + rgb_matrix_set_color(55, 0x00, 0x00, 0x00); + rgb_matrix_set_color(56, 0x00, 0x00, 0x00); + rgb_matrix_set_color(57, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(58, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(59, 0xFF, 0x00, 0x00); + rgb_matrix_set_color(60, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(61, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(62, 0x00, 0x00, 0x00); + break; case _LAYER4: - rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, false); break; - } - } - if ( this_led & (1<<USB_LED_CAPS_LOCK)) { - rgb_matrix_set_color(40, 0xFF, 0xFF, 0xFF); - } + rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, false); + break; + } + } + if ( this_led & (1<<USB_LED_CAPS_LOCK)) { + rgb_matrix_set_color(40, 0xFF, 0xFF, 0xFF); + } - switch (biton32(layer_state)) { - case _LAYER3: - if ( this_led & (1<<USB_LED_NUM_LOCK)) - { - rgb_matrix_set_color(13, 0xFF, 0x00, 0x00); - } - else - { - rgb_matrix_set_color(13, 0x00, 0x00, 0x00); - } - rgb_matrix_set_color(0, 0x00, 0xFF, 0x00); - rgb_matrix_set_color(1, 0x00, 0x00, 0x00); - rgb_matrix_set_color(1, 0x00, 0xFF, 0x00); - rgb_matrix_set_color(2, 0x00, 0xFF, 0x00); - rgb_matrix_set_color(3, 0x00, 0xFF, 0x00); - rgb_matrix_set_color(4, 0x00, 0xFF, 0x00); - rgb_matrix_set_color(5, 0x00, 0x00, 0x00); - rgb_matrix_set_color(6, 0x00, 0x00, 0x00); - rgb_matrix_set_color(7, 0x00, 0x00, 0x00); - rgb_matrix_set_color(8, 0x00, 0x00, 0x00); - rgb_matrix_set_color(9, 0xFF, 0xFF, 0x00); - rgb_matrix_set_color(10, 0xFF, 0xFF, 0x00); - rgb_matrix_set_color(11, 0xFF, 0xFF, 0x00); - rgb_matrix_set_color(12, 0xFF, 0xFF, 0x00); - rgb_matrix_set_color(14, 0x00, 0x00, 0xFF); - rgb_matrix_set_color(15, 0x00, 0x00, 0x00); - rgb_matrix_set_color(16, 0x00, 0x00, 0x00); - rgb_matrix_set_color(17, 0x00, 0xFF, 0x00); - rgb_matrix_set_color(18, 0x00, 0xFF, 0x00); - rgb_matrix_set_color(19, 0x00, 0xFF, 0x00); - rgb_matrix_set_color(20, 0x00, 0x00, 0x00); - rgb_matrix_set_color(21, 0x00, 0x00, 0x00); - rgb_matrix_set_color(22, 0x00, 0x00, 0x00); - rgb_matrix_set_color(23, 0x00, 0x00, 0x00); - rgb_matrix_set_color(24, 0xFF, 0xFF, 0x00); - rgb_matrix_set_color(25, 0xFF, 0xFF, 0x00); - rgb_matrix_set_color(26, 0xFF, 0xFF, 0x00); - rgb_matrix_set_color(27, 0x00, 0x00, 0x00); - rgb_matrix_set_color(28, 0x00, 0xFF, 0x00); - rgb_matrix_set_color(29, 0x00, 0x00, 0x00); - rgb_matrix_set_color(30, 0x00, 0xFF, 0x00); - rgb_matrix_set_color(31, 0x00, 0xFF, 0x00); - rgb_matrix_set_color(32, 0x00, 0xFF, 0x00); - rgb_matrix_set_color(33, 0x00, 0x00, 0x00); - rgb_matrix_set_color(34, 0x00, 0x00, 0x00); - rgb_matrix_set_color(35, 0x00, 0x00, 0x00); - rgb_matrix_set_color(36, 0x00, 0x00, 0x00); - rgb_matrix_set_color(37, 0xFF, 0xFF, 0x00); - rgb_matrix_set_color(38, 0xFF, 0xFF, 0x00); - rgb_matrix_set_color(39, 0xFF, 0xFF, 0x00); - rgb_matrix_set_color(40, 0x00, 0x00, 0x00); - rgb_matrix_set_color(41, 0x00, 0x00, 0x00); - rgb_matrix_set_color(42, 0x00, 0x00, 0x00); - rgb_matrix_set_color(43, 0x00, 0xFF, 0x00); - rgb_matrix_set_color(44, 0x00, 0xFF, 0x00); - rgb_matrix_set_color(45, 0x00, 0xFF, 0x00); - rgb_matrix_set_color(46, 0x00, 0x00, 0x00); - rgb_matrix_set_color(47, 0x00, 0x00, 0x00); - rgb_matrix_set_color(48, 0x00, 0x00, 0x00); - rgb_matrix_set_color(49, 0x00, 0x00, 0x00); - rgb_matrix_set_color(50, 0xFF, 0xFF, 0x00); - rgb_matrix_set_color(51, 0xFF, 0xFF, 0x00); - rgb_matrix_set_color(52, 0xFF, 0xFF, 0x00); - rgb_matrix_set_color(53, 0x00, 0x00, 0x00); - rgb_matrix_set_color(54, 0x00, 0x00, 0x00); - rgb_matrix_set_color(55, 0x00, 0x00, 0x00); - rgb_matrix_set_color(56, 0x00, 0x00, 0x00); - rgb_matrix_set_color(57, 0x00, 0xFF, 0x00); - rgb_matrix_set_color(58, 0x00, 0xFF, 0x00); - rgb_matrix_set_color(59, 0xFF, 0x00, 0x00); - rgb_matrix_set_color(60, 0xFF, 0xFF, 0x00); - rgb_matrix_set_color(61, 0xFF, 0xFF, 0x00); - rgb_matrix_set_color(62, 0x00, 0x00, 0x00); - break; - } } diff --git a/keyboards/emptystring/NQG/NQG.c b/keyboards/emptystring/NQG/NQG.c new file mode 100644 index 0000000000..eedf25e881 --- /dev/null +++ b/keyboards/emptystring/NQG/NQG.c @@ -0,0 +1 @@ +#include "NQG.h" diff --git a/keyboards/emptystring/NQG/NQG.h b/keyboards/emptystring/NQG/NQG.h new file mode 100644 index 0000000000..943ea6ab16 --- /dev/null +++ b/keyboards/emptystring/NQG/NQG.h @@ -0,0 +1,15 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, L06, L07, L08, L09, \ + L10, L11, L12, L13, L14, L15, L16, L17, L18, L19, \ + L20, L21, L22, L23, L24, L25, L26, L27, L28, L29, \ + L30, L32, L33, L34, L35, L36, L37 \ + ) { \ + {L00, L01, L02, L03, L04, L05, L06, L07, L08, L09}, \ + {L10, L11, L12, L13, L14, L15, L16, L17, L18, L19}, \ + {L20, L21, L22, L23, L24, L25, L26, L27, L28, L29}, \ + {L30, KC_NO, L32, L33, L34, L35, L36, L37, KC_NO, KC_NO} \ + } diff --git a/keyboards/emptystring/NQG/config.h b/keyboards/emptystring/NQG/config.h new file mode 100644 index 0000000000..3f52ba3ea6 --- /dev/null +++ b/keyboards/emptystring/NQG/config.h @@ -0,0 +1,42 @@ +/* +Copyright 2019 Bernard Shih (twitter: @SA_EndlessGame) + +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 0x0076 +#define PRODUCT_ID 0x0037 +#define DEVICE_VER 0x0100 +#define MANUFACTURER emptystring +#define PRODUCT NQG +#define DESCRIPTION 30% ortholinear keyboard + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 10 + +/* key matrix pins */ +#define MATRIX_ROW_PINS {B6, B2, B3, B1} +#define MATRIX_COL_PINS {F7, F6, B5, B4, E6, D7, C6, D4, D0, D1} + + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +#define TAPPING_TERM 200 diff --git a/keyboards/emptystring/NQG/keymaps/default/keymap.c b/keyboards/emptystring/NQG/keymaps/default/keymap.c new file mode 100644 index 0000000000..cd465519bf --- /dev/null +++ b/keyboards/emptystring/NQG/keymaps/default/keymap.c @@ -0,0 +1,61 @@ +#include QMK_KEYBOARD_H + +#define _BASE 0 +#define _LOWER 1 +#define _RAISE 2 + +enum tapdances{ + TD_SCCL = 0, + TD_ENSL, + TD_N0BS, + TD_RPPI, +}; + +#define KC_SCCL TD(TD_SCCL) +#define KC_ENSL TD(TD_ENSL) +#define KC_N0BS TD(TD_N0BS) +#define KC_RPPI TD(TD_RPPI) + +#define KC_BSCT LCTL_T(KC_BSPC) +#define KC_ALEN LALT(KC_ENT) +#define KC_CTEN LCTL(KC_ENT) +#define KC_STAB LSFT_T(KC_TAB) +#define KC_WLNG LALT(KC_LSFT) +#define KC_LOCK LGUI(KC_L) +#define KC_ULCK LCTL(LALT(KC_DEL)) +#define KC_DSTP LGUI(KC_D) +#define KC_ESLO LT(_LOWER, KC_ESC) + + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_SCCL] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, KC_QUOT), + [TD_ENSL] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_ENT), + [TD_N0BS] = ACTION_TAP_DANCE_DOUBLE(KC_0, KC_BSLS), + [TD_RPPI] = ACTION_TAP_DANCE_DOUBLE(KC_RPRN, KC_PIPE), +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BASE] = LAYOUT( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \ + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCCL, \ + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_ENSL,\ + KC_STAB, KC_ESLO, KC_BSCT, KC_BSCT, KC_SPC, KC_SPC, MO(_RAISE) + ), + + [_LOWER] = LAYOUT( + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPPI, \ + _______, _______, KC_DSTP, _______, KC_WLNG, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, \ + _______, _______, _______, _______, _______, _______, KC_INS, KC_DEL, KC_HOME, KC_END,\ + KC_CTEN, _______, KC_BSCT, KC_BSCT, KC_SPC, KC_SPC, KC_ULCK + ), + + [_RAISE] = LAYOUT( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_N0BS, \ + _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, \ + _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT,\ + KC_ALEN, KC_LOCK, KC_BSCT, KC_BSCT, KC_SPC, KC_SPC, _______ + ), + + +}; diff --git a/keyboards/emptystring/NQG/keymaps/default/rules.mk b/keyboards/emptystring/NQG/keymaps/default/rules.mk new file mode 100644 index 0000000000..e5ddcae8d9 --- /dev/null +++ b/keyboards/emptystring/NQG/keymaps/default/rules.mk @@ -0,0 +1 @@ +TAP_DANCE_ENABLE = yes diff --git a/keyboards/emptystring/NQG/readme.md b/keyboards/emptystring/NQG/readme.md new file mode 100644 index 0000000000..a8c8998634 --- /dev/null +++ b/keyboards/emptystring/NQG/readme.md @@ -0,0 +1,15 @@ +# NQG: Not Quite Gherkin + +![NQG](https://github.com/culturalsnow/NQG/blob/master/images/NQGLayout.jpg) + +NQG (Not Quite Gherkin) is a 30% ortholinear keyboard with a macro key and dedicated row for thumb keys, made by emptystring studio. + +Keyboard Maintainer: [Culturalsnow](http://github.com/culturalsnow) +Hardware Supported: NQG PCB, Pro Micro +Hardware Availability: Kits are available from [SA_EndlessGame](http://twitter.com/SA_EndlessGame) + +Make example for this keyboard (after setting up your build environment): + + make emptystring/NQG:default + +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/emptystring/NQG/rules.mk b/keyboards/emptystring/NQG/rules.mk new file mode 100644 index 0000000000..9a46bb8544 --- /dev/null +++ b/keyboards/emptystring/NQG/rules.mk @@ -0,0 +1,64 @@ +# MCU name + +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. diff --git a/keyboards/ergodash/rev1/keymaps/default/config.h b/keyboards/ergodash/rev1/keymaps/default/config.h index 7e7fe4f69a..dc00328dcb 100644 --- a/keyboards/ergodash/rev1/keymaps/default/config.h +++ b/keyboards/ergodash/rev1/keymaps/default/config.h @@ -18,10 +18,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "../../config.h" +// place overrides here /* Use I2C or Serial, not both */ @@ -34,8 +33,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. // #define MASTER_RIGHT // #define EE_HANDS -#endif - #undef RGBLED_NUM #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 24 diff --git a/keyboards/ergodash/rev1/keymaps/default/keymap.c b/keyboards/ergodash/rev1/keymaps/default/keymap.c index 6f20908bc7..a1bfb22678 100644 --- a/keyboards/ergodash/rev1/keymaps/default/keymap.c +++ b/keyboards/ergodash/rev1/keymaps/default/keymap.c @@ -1,6 +1,4 @@ #include QMK_KEYBOARD_H -#include "action_layer.h" -#include "eeconfig.h" extern keymap_config_t keymap_config; diff --git a/keyboards/ergodash/rev2/keymaps/default/config.h b/keyboards/ergodash/rev2/keymaps/default/config.h index 7e7fe4f69a..90a364811e 100644 --- a/keyboards/ergodash/rev2/keymaps/default/config.h +++ b/keyboards/ergodash/rev2/keymaps/default/config.h @@ -18,10 +18,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "../../config.h" +// place overrides here /* Use I2C or Serial, not both */ @@ -34,7 +33,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. // #define MASTER_RIGHT // #define EE_HANDS -#endif #undef RGBLED_NUM #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/ergodash/rev2/keymaps/default/keymap.c b/keyboards/ergodash/rev2/keymaps/default/keymap.c index b709ab7e98..5412eb0c0c 100644 --- a/keyboards/ergodash/rev2/keymaps/default/keymap.c +++ b/keyboards/ergodash/rev2/keymaps/default/keymap.c @@ -1,6 +1,4 @@ #include QMK_KEYBOARD_H -#include "action_layer.h" -#include "eeconfig.h" extern keymap_config_t keymap_config; diff --git a/keyboards/ergodash/rev2/keymaps/greenshadowmaker/config.h b/keyboards/ergodash/rev2/keymaps/greenshadowmaker/config.h new file mode 100644 index 0000000000..8ace28f240 --- /dev/null +++ b/keyboards/ergodash/rev2/keymaps/greenshadowmaker/config.h @@ -0,0 +1,41 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako <wakojun@gmail.com> +Copyright 2015 Jack Humbert + +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 + + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 24 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 diff --git a/keyboards/ergodash/rev2/keymaps/greenshadowmaker/keyboard-layout-editor.json b/keyboards/ergodash/rev2/keymaps/greenshadowmaker/keyboard-layout-editor.json new file mode 100644 index 0000000000..8f8d308553 --- /dev/null +++ b/keyboards/ergodash/rev2/keymaps/greenshadowmaker/keyboard-layout-editor.json @@ -0,0 +1,460 @@ +[ + { + "name": "gsm-ErgoDash", + "notes": "Front Legend = \"Adust\" layer (both lower and Raise)\n\n\nLayout Positions are an aproximation and not exact" + }, + [ + { + "x": 3, + "t": "#0000ff\n#ff0000" + }, + "\nF3\n\n\n\n\n\n\n\n3 #", + { + "x": 11 + }, + "\nF8\n\n\n\n\n\n\n\n8 *" + ], + [ + { + "y": -0.875, + "x": 2 + }, + "\nF2\n\n\n\n\n\n\n\n2 @", + { + "x": 1 + }, + "\nF4\n\n\n\n\n\n\n\n4 $", + { + "x": 9 + }, + "\nF7\n\n\n\n\n\n\n\n7 &", + { + "x": 1 + }, + "\nF9\n\n\n\n\n\n\n\n9 (" + ], + [ + { + "y": -0.875, + "x": 5 + }, + "\nF5\n\n\n\n\n\n\n\n5 %", + { + "x": 7 + }, + "\nF6\n\n\n\n\n\n\n\n6 &" + ], + [ + { + "y": -0.875, + "t": "#000000", + "a": 3 + }, + "Esc\n\n\n\nreset", + { + "t": "#0000ff\n#ff0000", + "a": 4 + }, + "\nF1\n\n\n\n\n\n\n\n1 !", + { + "x": 15 + }, + "\nF10\n\n\n\n\n\n\n\n0 )", + { + "t": "#000000", + "a": 7, + "fa": [ + 2 + ] + }, + "Bksp" + ], + [ + { + "y": -0.625, + "x": 6, + "f": 3 + }, + "= +", + { + "x": 5, + "f": 3 + }, + "- _" + ], + [ + { + "y": -0.75, + "x": 3, + "f": 3 + }, + "E", + { + "x": 11, + "f": 3 + }, + "I" + ], + [ + { + "y": -0.875, + "x": 2, + "t": "#0000ff\n#ff0000\n\n\n\n\n\n\n\n\n#ff0000", + "a": 4, + "f": 3 + }, + "PgUP\nUP\n\n\n\n\n\n\n\nW", + { + "x": 1, + "t": "#000000", + "a": 3, + "f": 3 + }, + "R\n\n\n\nrgb_tog", + { + "x": 9, + "a": 7, + "f": 3 + }, + "U", + { + "x": 1, + "f": 3 + }, + "O" + ], + [ + { + "y": -0.875, + "x": 5, + "a": 3, + "f": 3 + }, + "T\n\n\n\nbl_tog", + { + "x": 7, + "a": 7, + "f": 3 + }, + "Y" + ], + [ + { + "y": -0.875, + "f": 3 + }, + "Tab", + { + "f": 3 + }, + "Q", + { + "x": 15, + "f": 3 + }, + "P", + { + "f": 3 + }, + "] }" + ], + [ + { + "y": -0.625, + "x": 6 + }, + "", + { + "x": 5, + "f": 3 + }, + "[ {" + ], + [ + { + "y": -0.75, + "x": 3, + "t": "#0000ff\n#ff0000\n\n\n\n\n\n\n\n\n#ff0000", + "a": 0, + "f": 3 + }, + "End\nRIGHT\n\n\nrgb_sai\n\n\n\n\nD", + { + "x": 11, + "t": "#000000", + "a": 7, + "f": 3 + }, + "K" + ], + [ + { + "y": -0.875, + "x": 2, + "t": "#0000ff\n#ff0000\n\n\n\n\n\n\n\n\n#ff0000", + "a": 0, + "f": 3 + }, + "PgDwn\nDOWN\n\n\nrgb_hai\n\n\n\n\nS", + { + "x": 1, + "t": "#000000", + "a": 3, + "f": 3 + }, + "F\n\n\n\nrgb_val", + { + "x": 9, + "a": 7, + "f": 3 + }, + "J", + { + "x": 1, + "f": 3 + }, + "L" + ], + [ + { + "y": -0.875, + "x": 5, + "a": 3, + "f": 3 + }, + "G\n\n\n\nbl_inc", + { + "x": 7, + "a": 7, + "f": 3 + }, + "H" + ], + [ + { + "y": -0.875, + "c": "#0000ff", + "t": "#ffffffff", + "f": 3 + }, + "Raise", + { + "c": "#cccccc", + "t": "#0000ff\n#ff0000\n\n\n\n\n\n\n\n\n#ff0000", + "a": 4, + "f": 3 + }, + "Home\nLEFT\n\n\n\n\n\n\n\nA", + { + "x": 15, + "t": "#000000", + "a": 7, + "f": 3 + }, + ": ;", + { + "f": 3 + }, + "' \"" + ], + [ + { + "y": -0.625, + "x": 6 + }, + "", + { + "x": 5 + }, + "" + ], + [ + { + "y": -0.75, + "x": 3, + "a": 3, + "f": 3 + }, + "C\n\n\n\nrgb_sad", + { + "x": 11, + "a": 7, + "f": 3 + }, + ", <" + ], + [ + { + "y": -0.875, + "x": 2, + "a": 3, + "f": 3 + }, + "X\n\n\n\nrgb_sad", + { + "x": 1, + "f": 3 + }, + "V\n\n\n\nrgb_vad", + { + "x": 9, + "a": 7, + "f": 3 + }, + "M", + { + "x": 1, + "f": 3 + }, + ". >" + ], + [ + { + "y": -0.875, + "x": 5, + "a": 3, + "f": 3 + }, + "B\n\n\n\nbl_dec", + { + "x": 7, + "a": 7, + "f": 3 + }, + "N" + ], + [ + { + "y": -0.875, + "a": 3, + "f": 3 + }, + "Shift\n\n\n\neep_rst", + { + "a": 7, + "f": 3 + }, + "Z", + { + "x": 15, + "f": 3 + }, + "/ ?", + { + "f": 3 + }, + "Shift" + ], + [ + { + "y": -0.25, + "x": 2, + "f": 3 + }, + "Alt", + { + "x": 13, + "f": 3 + }, + "DOWN" + ], + [ + { + "y": -0.9749999999999996, + "x": 3.5, + "f": 3 + }, + "Ctrl", + { + "x": 10.15, + "f": 3 + }, + "LEFT" + ], + [ + { + "y": -0.7750000000000004, + "f": 3 + }, + "`~", + { + "f": 3 + }, + "\\|", + { + "x": 15, + "f": 3 + }, + "UP", + { + "f": 3 + }, + "RIGHT" + ], + [ + { + "r": 30, + "rx": 6.5, + "ry": 4.25, + "y": -0.25, + "x": -0.2999999999999998, + "c": "#eb7c15", + "f": 3, + "h": 2 + }, + "Space", + { + "c": "#cccccc", + "f": 3 + }, + "Del" + ], + [ + { + "x": -1.2999999999999998, + "c": "#ff0000", + "f": 3 + }, + "Lower", + { + "x": 1, + "c": "#cccccc", + "t": "#0000ff\n#ff0000", + "a": 4 + }, + "\nApp\n\n\n\n\n\n\n\nOS" + ], + [ + { + "r": -30, + "rx": 13, + "y": -0.5, + "x": -2, + "t": "#000000", + "a": 7, + "f": 3 + }, + "PrtScr", + { + "c": "#eb7c15", + "f": 3, + "h": 2 + }, + "Space" + ], + [ + { + "x": -2, + "c": "#cccccc", + "f": 3 + }, + "Enter", + { + "x": 1, + "c": "#0000ff", + "t": "#ffffff", + "f": 3 + }, + "Raise" + ] +]
\ No newline at end of file diff --git a/keyboards/ergodash/rev2/keymaps/greenshadowmaker/keymap.c b/keyboards/ergodash/rev2/keymaps/greenshadowmaker/keymap.c new file mode 100644 index 0000000000..7a7985f75f --- /dev/null +++ b/keyboards/ergodash/rev2/keymaps/greenshadowmaker/keymap.c @@ -0,0 +1,136 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,----------------------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | = | | - | 6 | 7 | 8 | 9 | 0 |Backsp| + * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | | [ | Y | U | I | O | P | ] | + * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| + * | Raise| A | S | D | F | G | | | | H | J | K | L | ; | " | + * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B |||||||| Del | | |||||||| N | M | , | . | / | Shift| + * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| + * | ` | \ | ALt | Ctrl |||||||| Lower| Space| LGui|||||||| Enter| Space| Raise|||||||| Left | Down | Up | Right| + * ,----------------------------------------------------------------------------------------------------------------------. + */ + [_QWERTY] = LAYOUT( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EQL, KC_MINS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, XXXXXXX, KC_LBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RBRC, \ + RAISE, KC_A, KC_S, KC_D, KC_F, KC_G, XXXXXXX, XXXXXXX, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_DEL, KC_PSCR, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_GRV,KC_BSLS, KC_LALT, KC_LCTL, LOWER, KC_SPC,KC_LGUI, KC_ENT ,KC_SPC , RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Lower + * ,----------------------------------------------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | | + * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| + * | | | Up | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| + * | Raise| Left | Down | Rght | | | | | | | | | | | | + * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| + * | Shift| | | | | |||||||| | | |||||||| | | | | | Shift| + * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| + * | | | | |||||||| Lower| Space| |||||||| | Space| Raise|||||||| | | | | + * ,----------------------------------------------------------------------------------------------------------------------. + */ + [_LOWER] = LAYOUT( + XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, XXXXXXX, XXXXXXX, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, \ + XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + RAISE, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_RSFT, \ + XXXXXXX, XXXXXXX, XXXXXXX,XXXXXXX, LOWER, KC_SPC ,XXXXXXX, XXXXXXX, KC_SPC , RAISE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ + ), + + /* Raise + * ,----------------------------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| + * | | | PgUp | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| + * | Raise| Home | PgDwn| End | | | | | | | | | | | | + * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| + * | Shift| | | | | |||||||| | | |||||||| | | | | | Shift| + * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| + * | | | | |||||||| Lower| Space| |||||||| |Space | Raise|||||||| | | | | + * ,----------------------------------------------------------------------------------------------------------------------. + */ + [_RAISE] = LAYOUT( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + RAISE, KC_HOME,KC_PGDOWN, KC_END, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_RSFT, \ + XXXXXXX, XXXXXXX, XXXXXXX,XXXXXXX, LOWER, KC_SPC ,XXXXXXX, XXXXXXX, KC_SPC , RAISE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ + ), + + /* Adjust (Both Raise and Lower Together) + * ,----------------------------------------------------------------------------------------------------------------------. + * | Reset| | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| + * | | | | |rgbtog|bl_tog| | | | | | | | | | + * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| + * | Raise| |rgbhui|rgbsai|rgbvai|bl_inc| | | | | | | | | | + * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| + *|EEP_RST| |rgbhud|rgbdec|rgbvad|bl_dec|||||||| | | |||||||| | | | | | Shift| + * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| + * | | | | |||||||| Lower| Space| |||||||| | Space| Raise|||||||| | | | | + * ,----------------------------------------------------------------------------------------------------------------------. + */ + [_ADJUST] = LAYOUT( + RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_TOG, BL_TOGG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + RAISE, XXXXXXX, RGB_HUI, RGB_SAI, RGB_VAI, BL_INC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + EEP_RST, XXXXXXX, RGB_HUD, RGB_SAD, RGB_VAD, BL_DEC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_RSFT, \ + XXXXXXX, XXXXXXX, XXXXXXX,XXXXXXX, LOWER, KC_SPC ,XXXXXXX, XXXXXXX, KC_SPC, RAISE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/ergodash/rev2/keymaps/greenshadowmaker/rules.mk b/keyboards/ergodash/rev2/keymaps/greenshadowmaker/rules.mk new file mode 100644 index 0000000000..11b62b9bff --- /dev/null +++ b/keyboards/ergodash/rev2/keymaps/greenshadowmaker/rules.mk @@ -0,0 +1,3 @@ +BACKLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = yes +AUDIO_ENABLE = no diff --git a/keyboards/ergodone/keymaps/default/keymap.c b/keyboards/ergodone/keymaps/default/keymap.c index 92c140f26a..7f13f3d672 100644 --- a/keyboards/ergodone/keymaps/default/keymap.c +++ b/keyboards/ergodone/keymaps/default/keymap.c @@ -1,6 +1,4 @@ #include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" #include "version.h" #define BASE 0 // default layer diff --git a/keyboards/ergodox_ez/config.h b/keyboards/ergodox_ez/config.h index 096368f7ab..a75edd4154 100644 --- a/keyboards/ergodox_ez/config.h +++ b/keyboards/ergodox_ez/config.h @@ -109,7 +109,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define DRIVER_1_LED_TOTAL 24 #define DRIVER_2_LED_TOTAL 24 #define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL -#define RGB_MATRIX_SKIP_FRAMES 10 // #define RGBLIGHT_COLOR_LAYER_0 0x00, 0x00, 0xFF /* #define RGBLIGHT_COLOR_LAYER_1 0x00, 0x00, 0xFF */ diff --git a/keyboards/ergodox_ez/ergodox_ez.c b/keyboards/ergodox_ez/ergodox_ez.c index 3b2c943506..6f4ae9fed1 100644 --- a/keyboards/ergodox_ez/ergodox_ez.c +++ b/keyboards/ergodox_ez/ergodox_ez.c @@ -128,7 +128,7 @@ uint8_t init_mcp23018(void) { mcp23018_status = i2c_write(IODIRA, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; mcp23018_status = i2c_write(0b00000000, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; mcp23018_status = i2c_write(0b00111111, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; - i2c_stop(ERGODOX_EZ_I2C_TIMEOUT); + i2c_stop(); // set pull-up // - unused : on : 1 @@ -140,7 +140,7 @@ uint8_t init_mcp23018(void) { mcp23018_status = i2c_write(0b00111111, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; out: - i2c_stop(ERGODOX_EZ_I2C_TIMEOUT); + i2c_stop(); #ifdef LEFT_LEDS if (!mcp23018_status) mcp23018_status = ergodox_left_leds_update(); @@ -179,7 +179,7 @@ uint8_t ergodox_left_leds_update(void) { if (mcp23018_status) goto out; out: - i2c_stop(ERGODOX_EZ_I2C_TIMEOUT); + i2c_stop(); return mcp23018_status; } #endif @@ -269,69 +269,68 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { }; -__attribute__ ((weak)) const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { /*{row | col << 4} | {x=0..224, y=0..64} | | modifier | | | */ - {{0|(0<<4)}, {24.9*5, 16*0}, 0}, // LED 1 on right - {{0|(1<<4)}, {24.9*6, 16*0}, 0}, // LED 2 - {{0|(2<<4)}, {24.9*7, 16*0}, 0}, // LED 3 - {{0|(3<<4)}, {24.9*8, 16*0}, 0}, // LED 4 - {{0|(4<<4)}, {24.9*9, 16*0}, 0}, // LED 5 - - {{1|(5<<4)}, {24.9*5, 16*1}, 0}, // LED 6 - {{1|(6<<4)}, {24.9*6, 16*1}, 0}, // LED 7 - {{1|(7<<4)}, {24.9*7, 16*1}, 0}, // LED 8 - {{1|(8<<4)}, {24.9*8, 16*1}, 0}, // LED 9 - {{1|(9<<4)}, {24.9*9, 16*1}, 0}, // LED 10 - - {{2|(5<<4)}, {24.9*5, 16*2}, 0}, // LED 11 - {{2|(6<<4)}, {24.9*6, 16*2}, 0}, // LED 12 - {{2|(7<<4)}, {24.9*7, 16*2}, 0}, // LED 13 - {{2|(8<<4)}, {24.9*8, 16*2}, 0}, // LED 14 - {{2|(9<<4)}, {24.9*9, 16*2}, 0}, // LED 15 - - {{3|(5<<4)}, {24.9*5, 16*2}, 0}, // LED 16 - {{3|(6<<4)}, {24.9*6, 16*2}, 0}, // LED 17 - {{3|(7<<4)}, {24.9*7, 16*2}, 0}, // LED 18 - {{3|(8<<4)}, {24.9*8, 16*2}, 0}, // LED 19 - {{3|(9<<4)}, {24.9*9, 16*2}, 0}, // LED 20 - - {{4|(6<<4)}, {24.9*6, 16*2}, 0}, // LED 21 - {{4|(7<<4)}, {24.9*7, 16*2}, 0}, // LED 22 - {{4|(8<<4)}, {24.9*8, 16*2}, 0}, // LED 23 - {{4|(9<<4)}, {24.9*9, 16*2}, 0}, // LED 24 - - {{0|(0<<4)}, {24.9*4, 16*0}, 0}, // LED 1 on left - {{0|(1<<4)}, {24.9*3, 16*0}, 0}, // LED 2 - {{0|(2<<4)}, {24.9*2, 16*0}, 0}, // LED 3 - {{0|(3<<4)}, {24.9*1, 16*0}, 0}, // LED 4 - {{0|(4<<4)}, {24.9*0, 16*0}, 0}, // LED 5 - - {{1|(5<<4)}, {24.9*4, 16*1}, 0}, // LED 6 - {{1|(6<<4)}, {24.9*3, 16*1}, 0}, // LED 7 - {{1|(7<<4)}, {24.9*2, 16*1}, 0}, // LED 8 - {{1|(8<<4)}, {24.9*1, 16*1}, 0}, // LED 9 - {{1|(9<<4)}, {24.9*0, 16*1}, 0}, // LED 10 - - {{2|(5<<4)}, {24.9*4, 16*2}, 0}, // LED 11 - {{2|(6<<4)}, {24.9*3, 16*2}, 0}, // LED 12 - {{2|(7<<4)}, {24.9*2, 16*2}, 0}, // LED 13 - {{2|(8<<4)}, {24.9*1, 16*2}, 0}, // LED 14 - {{2|(9<<4)}, {24.9*0, 16*2}, 0}, // LED 15 - - {{3|(5<<4)}, {24.9*4, 16*2}, 0}, // LED 16 - {{3|(6<<4)}, {24.9*3, 16*2}, 0}, // LED 17 - {{3|(7<<4)}, {24.9*2, 16*2}, 0}, // LED 18 - {{3|(8<<4)}, {24.9*1, 16*2}, 0}, // LED 19 - {{3|(9<<4)}, {24.9*0, 16*2}, 0}, // LED 20 - - {{4|(6<<4)}, {24.9*3, 16*2}, 0}, // LED 21 - {{4|(7<<4)}, {24.9*2, 16*2}, 0}, // LED 22 - {{4|(8<<4)}, {24.9*1, 16*2}, 0}, // LED 23 - {{4|(9<<4)}, {24.9*0, 16*2}, 0}, // LED 24 + {{ 8|(0<<4)}, {17.2* 8, 12.8*0}, 0}, // LED 1 on right > Key 6 + {{ 9|(0<<4)}, {17.2* 9, 12.8*0}, 0}, // LED 2 > Key 7 + {{10|(0<<4)}, {17.2*10, 12.8*0}, 0}, // LED 3 > Key 8 + {{11|(0<<4)}, {17.2*11, 12.8*0}, 0}, // LED 4 > Key 9 + {{12|(0<<4)}, {17.2*12, 12.8*0}, 0}, // LED 5 > Key 0 + + {{ 8|(1<<4)}, {17.2* 8, 12.8*1}, 0}, // LED 6 + {{ 9|(1<<4)}, {17.2* 9, 12.8*1}, 0}, // LED 7 + {{10|(1<<4)}, {17.2*10, 12.8*1}, 0}, // LED 8 + {{11|(1<<4)}, {17.2*11, 12.8*1}, 0}, // LED 9 + {{12|(1<<4)}, {17.2*12, 12.8*1}, 0}, // LED 10 + + {{ 8|(2<<4)}, {17.2* 8, 12.8*2}, 0}, // LED 11 + {{ 9|(2<<4)}, {17.2* 9, 12.8*2}, 0}, // LED 12 + {{10|(2<<4)}, {17.2*10, 12.8*2}, 0}, // LED 13 + {{11|(2<<4)}, {17.2*11, 12.8*2}, 0}, // LED 14 + {{12|(2<<4)}, {17.2*12, 12.8*2}, 0}, // LED 15 + + {{ 8|(3<<4)}, {17.2* 8, 12.8*3}, 0}, // LED 16 + {{ 9|(3<<4)}, {17.2* 9, 12.8*3}, 0}, // LED 17 + {{10|(3<<4)}, {17.2*10, 12.8*3}, 0}, // LED 18 + {{11|(3<<4)}, {17.2*11, 12.8*3}, 0}, // LED 19 + {{12|(3<<4)}, {17.2*12, 12.8*3}, 0}, // LED 20 + + {{ 9|(4<<4)}, {17.2* 9, 12.8*4}, 1}, // LED 21 + {{10|(4<<4)}, {17.2*10, 12.8*4}, 1}, // LED 22 + {{11|(4<<4)}, {17.2*11, 12.8*4}, 1}, // LED 23 + {{12|(4<<4)}, {17.2*12, 12.8*4}, 1}, // LED 24 + + {{ 5|(0<<4)}, {17.2* 5, 12.8*0}, 0}, // LED 1 on left > Key 5 + {{ 4|(0<<4)}, {17.2* 4, 12.8*0}, 0}, // LED 2 > Key 4 + {{ 3|(0<<4)}, {17.2* 3, 12.8*0}, 0}, // LED 3 > Key 3 + {{ 2|(0<<4)}, {17.2* 2, 12.8*0}, 0}, // LED 4 > Key 2 + {{ 1|(0<<4)}, {17.2* 1, 12.8*0}, 0}, // LED 5 > Key 1 + + {{ 5|(1<<4)}, {17.2* 5, 12.8*1}, 0}, // LED 6 + {{ 4|(1<<4)}, {17.2* 4, 12.8*1}, 0}, // LED 7 + {{ 3|(1<<4)}, {17.2* 3, 12.8*1}, 0}, // LED 8 + {{ 2|(1<<4)}, {17.2* 2, 12.8*1}, 0}, // LED 9 + {{ 1|(1<<4)}, {17.2* 1, 12.8*1}, 0}, // LED 10 + + {{ 5|(2<<4)}, {17.2* 5, 12.8*2}, 0}, // LED 11 + {{ 4|(2<<4)}, {17.2* 4, 12.8*2}, 0}, // LED 12 + {{ 3|(2<<4)}, {17.2* 3, 12.8*2}, 0}, // LED 13 + {{ 2|(2<<4)}, {17.2* 2, 12.8*2}, 0}, // LED 14 + {{ 1|(2<<4)}, {17.2* 1, 12.8*2}, 0}, // LED 15 + + {{ 5|(3<<4)}, {17.2* 5, 12.8*3}, 0}, // LED 16 + {{ 4|(3<<4)}, {17.2* 4, 12.8*3}, 0}, // LED 17 + {{ 3|(3<<4)}, {17.2* 3, 12.8*3}, 0}, // LED 18 + {{ 2|(3<<4)}, {17.2* 2, 12.8*3}, 0}, // LED 19 + {{ 1|(3<<4)}, {17.2* 1, 12.8*3}, 0}, // LED 20 + + {{ 4|(4<<4)}, {17.2* 4, 12.8*4}, 1}, // LED 21 + {{ 3|(4<<4)}, {17.2* 3, 12.8*4}, 1}, // LED 22 + {{ 2|(4<<4)}, {17.2* 2, 12.8*4}, 1}, // LED 23 + {{ 1|(4<<4)}, {17.2* 1, 12.8*4}, 1}, // LED 24 > Key Hack }; #endif diff --git a/keyboards/ergodox_ez/keymaps/dvorak_42_key/keymap.c b/keyboards/ergodox_ez/keymaps/dvorak_42_key/keymap.c index 0d48711ed3..c342b90769 100644 --- a/keyboards/ergodox_ez/keymaps/dvorak_42_key/keymap.c +++ b/keyboards/ergodox_ez/keymaps/dvorak_42_key/keymap.c @@ -55,14 +55,16 @@ enum custom_keycodes { }; -#define BASE 0 // base dvorak layer -#define KEYNAV 1 // arrow navigation (right hand) -#define KEYSEL 2 // arrow navigation + shift (allow text selection) -#define SHELL_NAV 3 // bash shortcuts -#define SHELL_SCREEN 4 // linux screen shortcuts -#define SCREEN_NAV 5 // navigate between linux screen tabs -#define BROWSER_CONTROL 6 // control browser and mouse -#define COMBINED 7 // combined numbers and symbols layer +#define BASE 0 // base dvorak layer +#define BASE_ALTERNATE 1 // base dvorak layer, with different layer toggling +#define KEYNAV 2 // arrow navigation (right hand) +#define KEYSEL 3 // arrow navigation + shift (allow text selection) +#define SHELL_NAV 4 // bash shortcuts +#define SHELL_SCREEN 5 // linux screen shortcuts +#define SCREEN_NAV 6 // navigate between linux screen tabs +#define BROWSER_CONTROL 7 // control browser and mouse +#define COMBINED 8 // combined numbers and symbols layer +#define ANDROID_STUDIO 9 // macros @@ -94,7 +96,17 @@ enum custom_keycodes { #define SCREEN_PASTEREG_3 30 #define DEL_TO_HOME 36 - +// Android Studio shortcuts +#define AS_TABLEFT LALT(KC_LEFT) +#define AS_TABRIGHT LALT(KC_RIGHT) +#define AS_SYMBOL LCTL(LALT(KC_N)) +#define AS_CLASS LCTL(KC_N) +#define AS_FINDUSAGE LALT(KC_F7) +#define AS_BACK LCTL(LALT(KC_LEFT)) +#define AS_GO_DECLARATION LCTL(KC_B) +#define AS_GO_IMPLEMENTATION LCTL(LALT(KC_B)) +#define AS_CLOSETAB LCTL(KC_F4) +#define AS_CLOSETOOLWINDOW LCTL(LSFT(KC_F4)) #define MACRO_SCREEN_NUM(MACRO_NAME,NUM) \ @@ -164,6 +176,32 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { MEH(KC_F5),MEH(KC_F6),MEH(KC_F7),MEH(KC_F8),KC_ENTER,KC_SPACE ), + + // alternate base layout + [BASE_ALTERNATE] = LAYOUT_ergodox( + // left hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + OSL(ANDROID_STUDIO),KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + // bottom row + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + // thumb cluster + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + // bottom row + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + // thumb cluster + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS + ), [KEYNAV] = LAYOUT_ergodox( // left hand @@ -195,7 +233,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS,MEH(KC_L), MEH(KC_M),MEH(KC_N), MEH(KC_O), MEH(KC_P), KC_TRNS,MEH(KC_Q), MEH(KC_R),MEH(KC_S), MEH(KC_T), MEH(KC_U), KC_TRNS, // bottom row - RESET,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + RESET,DF(BASE),DF(BASE_ALTERNATE),KC_TRNS,KC_TRNS, // thumb cluster KC_TRNS,KC_TRNS, KC_TRNS, @@ -294,7 +332,31 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), - + // android studio shortcuts + [ANDROID_STUDIO] = LAYOUT_ergodox( + // left hand + KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + // bottom row + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + // thumb cluster + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, AS_FINDUSAGE, AS_GO_DECLARATION, AS_GO_IMPLEMENTATION, KC_TRNS, + KC_TRNS, AS_TABLEFT, AS_TABRIGHT, AS_SYMBOL, AS_CLASS, AS_BACK, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, AS_CLOSETAB, AS_CLOSETOOLWINDOW, KC_TRNS, + // bottom row + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + // thumb cluster + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS + ), [COMBINED] = LAYOUT_ergodox( diff --git a/keyboards/ergodox_ez/matrix.c b/keyboards/ergodox_ez/matrix.c index 22837d312a..97f764113b 100644 --- a/keyboards/ergodox_ez/matrix.c +++ b/keyboards/ergodox_ez/matrix.c @@ -33,14 +33,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "debug.h" #include "util.h" #include "matrix.h" +#include "debounce.h" #include QMK_KEYBOARD_H #ifdef DEBUG_MATRIX_SCAN_RATE -#include "timer.h" +# include "timer.h" #endif /* - * This constant define not debouncing time in msecs, but amount of matrix - * scan loops which should be made to get stable debounced results. + * This constant define not debouncing time in msecs, assuming eager_pr. * * On Ergodox matrix scan rate is relatively low, because of slow I2C. * Now it's only 317 scans/second, or about 3.15 msec/scan. @@ -52,26 +52,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef DEBOUNCE -# define DEBOUNCE 5 +# define DEBOUNCE 5 #endif /* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -/* - * matrix state(1:on, 0:off) - * contains the raw values without debounce filtering of the last read cycle. - */ -static matrix_row_t raw_matrix[MATRIX_ROWS]; - -// Debouncing: store for each key the number of scans until it's eligible to -// change. When scanning the matrix, ignore any changes in keys that have -// already changed in the last DEBOUNCE scans. -static uint8_t debounce_matrix[MATRIX_ROWS * MATRIX_COLS]; +static matrix_row_t raw_matrix[MATRIX_ROWS]; // raw values +static matrix_row_t matrix[MATRIX_ROWS]; // debounced values static matrix_row_t read_cols(uint8_t row); -static void init_cols(void); -static void unselect_rows(void); -static void select_row(uint8_t row); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); static uint8_t mcp23018_reset_loop; // static uint16_t mcp23018_reset_loop; @@ -81,197 +72,137 @@ uint32_t matrix_timer; uint32_t matrix_scan_count; #endif +__attribute__((weak)) void matrix_init_user(void) {} -__attribute__ ((weak)) -void matrix_init_user(void) {} +__attribute__((weak)) void matrix_scan_user(void) {} -__attribute__ ((weak)) -void matrix_scan_user(void) {} +__attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); } -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} +__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); } -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} +inline uint8_t matrix_rows(void) { return MATRIX_ROWS; } -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} +inline uint8_t matrix_cols(void) { return MATRIX_COLS; } -void matrix_init(void) -{ - // initialize row and col +void matrix_init(void) { + // initialize row and col - mcp23018_status = init_mcp23018(); + mcp23018_status = init_mcp23018(); + unselect_rows(); + init_cols(); - unselect_rows(); - init_cols(); - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - raw_matrix[i] = 0; - for (uint8_t j=0; j < MATRIX_COLS; ++j) { - debounce_matrix[i * MATRIX_COLS + j] = 0; - } - } + // initialize matrix state: all keys off + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + raw_matrix[i] = 0; + } #ifdef DEBUG_MATRIX_SCAN_RATE - matrix_timer = timer_read32(); - matrix_scan_count = 0; + matrix_timer = timer_read32(); + matrix_scan_count = 0; #endif - - matrix_init_quantum(); - + debounce_init(MATRIX_ROWS); + matrix_init_quantum(); } void matrix_power_up(void) { - mcp23018_status = init_mcp23018(); + mcp23018_status = init_mcp23018(); - unselect_rows(); - init_cols(); + unselect_rows(); + init_cols(); - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - } + // initialize matrix state: all keys off + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + } #ifdef DEBUG_MATRIX_SCAN_RATE - matrix_timer = timer_read32(); - matrix_scan_count = 0; + matrix_timer = timer_read32(); + matrix_scan_count = 0; #endif } -// Returns a matrix_row_t whose bits are set if the corresponding key should be -// eligible to change in this scan. -matrix_row_t debounce_mask(matrix_row_t rawcols, uint8_t row) { - matrix_row_t result = 0; - matrix_row_t change = rawcols ^ raw_matrix[row]; - raw_matrix[row] = rawcols; - for (uint8_t i = 0; i < MATRIX_COLS; ++i) { - if (debounce_matrix[row * MATRIX_COLS + i]) { - --debounce_matrix[row * MATRIX_COLS + i]; - } else { - result |= (1 << i); - } - if (change & (1 << i)) { - debounce_matrix[row * MATRIX_COLS + i] = DEBOUNCE; +uint8_t matrix_scan(void) { + if (mcp23018_status) { // if there was an error + if (++mcp23018_reset_loop == 0) { + // if (++mcp23018_reset_loop >= 1300) { + // since mcp23018_reset_loop is 8 bit - we'll try to reset once in 255 matrix scans + // this will be approx bit more frequent than once per second + print("trying to reset mcp23018\n"); + mcp23018_status = init_mcp23018(); + if (mcp23018_status) { + print("left side not responding\n"); + } else { + print("left side attached\n"); + ergodox_blink_all_leds(); + } } } - return result; -} - -matrix_row_t debounce_read_cols(uint8_t row) { - // Read the row without debouncing filtering and store it for later usage. - matrix_row_t cols = read_cols(row); - // Get the Debounce mask. - matrix_row_t mask = debounce_mask(cols, row); - // debounce the row and return the result. - return (cols & mask) | (matrix[row] & ~mask);; -} - -uint8_t matrix_scan(void) -{ - if (mcp23018_status) { // if there was an error - if (++mcp23018_reset_loop == 0) { - // if (++mcp23018_reset_loop >= 1300) { - // since mcp23018_reset_loop is 8 bit - we'll try to reset once in 255 matrix scans - // this will be approx bit more frequent than once per second - print("trying to reset mcp23018\n"); - mcp23018_status = init_mcp23018(); - if (mcp23018_status) { - print("left side not responding\n"); - } else { - print("left side attached\n"); - ergodox_blink_all_leds(); - } - } - } #ifdef DEBUG_MATRIX_SCAN_RATE - matrix_scan_count++; + matrix_scan_count++; - uint32_t timer_now = timer_read32(); - if (TIMER_DIFF_32(timer_now, matrix_timer)>1000) { - print("matrix scan frequency: "); - pdec(matrix_scan_count); - print("\n"); + uint32_t timer_now = timer_read32(); + if (TIMER_DIFF_32(timer_now, matrix_timer) > 1000) { + print("matrix scan frequency: "); + pdec(matrix_scan_count); + print("\n"); - matrix_timer = timer_now; - matrix_scan_count = 0; - } + matrix_timer = timer_now; + matrix_scan_count = 0; + } #endif #ifdef LEFT_LEDS - mcp23018_status = ergodox_left_leds_update(); -#endif // LEFT_LEDS - for (uint8_t i = 0; i < MATRIX_ROWS_PER_SIDE; i++) { - select_row(i); - // and select on left hand - select_row(i + MATRIX_ROWS_PER_SIDE); - // we don't need a 30us delay anymore, because selecting a - // left-hand row requires more than 30us for i2c. - - // grab cols from left hand - matrix[i] = debounce_read_cols(i); - // grab cols from right hand - matrix[i + MATRIX_ROWS_PER_SIDE] = debounce_read_cols(i + MATRIX_ROWS_PER_SIDE); - - unselect_rows(); - } - - matrix_scan_quantum(); + mcp23018_status = ergodox_left_leds_update(); +#endif // LEFT_LEDS + for (uint8_t i = 0; i < MATRIX_ROWS_PER_SIDE; i++) { + // select rows from left and right hands + select_row(i); + select_row(i + MATRIX_ROWS_PER_SIDE); + + // we don't need a 30us delay anymore, because selecting a + // left-hand row requires more than 30us for i2c. + + // grab left + right cols. + raw_matrix[i] = read_cols(i); + raw_matrix[i+MATRIX_ROWS_PER_SIDE] = read_cols(i+MATRIX_ROWS_PER_SIDE); + + unselect_rows(); + } + + debounce(raw_matrix, matrix, MATRIX_ROWS, true); + matrix_scan_quantum(); - return 1; + return 1; } -bool matrix_is_modified(void) // deprecated and evidently not called. +bool matrix_is_modified(void) // deprecated and evidently not called. { - return true; + return true; } -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<<col)); -} +inline bool matrix_is_on(uint8_t row, uint8_t col) { return (matrix[row] & ((matrix_row_t)1 << col)); } -inline -matrix_row_t matrix_get_row(uint8_t row) -{ - return matrix[row]; -} +inline matrix_row_t matrix_get_row(uint8_t row) { return matrix[row]; } -void matrix_print(void) -{ - print("\nr/c 0123456789ABCDEF\n"); - for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - phex(row); print(": "); - pbin_reverse16(matrix_get_row(row)); - print("\n"); - } +void matrix_print(void) { + print("\nr/c 0123456789ABCDEF\n"); + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + phex(row); + print(": "); + pbin_reverse16(matrix_get_row(row)); + print("\n"); + } } -uint8_t matrix_key_count(void) -{ - uint8_t count = 0; - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - count += bitpop16(matrix[i]); - } - return count; +uint8_t matrix_key_count(void) { + uint8_t count = 0; + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + count += bitpop16(matrix[i]); + } + return count; } /* Column pin configuration @@ -284,43 +215,45 @@ uint8_t matrix_key_count(void) * col: 0 1 2 3 4 5 * pin: B5 B4 B3 B2 B1 B0 */ -static void init_cols(void) -{ - // init on mcp23018 - // not needed, already done as part of init_mcp23018() - - // init on teensy - // Input with pull-up(DDR:0, PORT:1) - DDRF &= ~(1<<7 | 1<<6 | 1<<5 | 1<<4 | 1<<1 | 1<<0); - PORTF |= (1<<7 | 1<<6 | 1<<5 | 1<<4 | 1<<1 | 1<<0); +static void init_cols(void) { + // init on mcp23018 + // not needed, already done as part of init_mcp23018() + + // init on teensy + // Input with pull-up(DDR:0, PORT:1) + DDRF &= ~(1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 1 | 1 << 0); + PORTF |= (1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 1 | 1 << 0); } -static matrix_row_t read_cols(uint8_t row) -{ - if (row < 7) { - if (mcp23018_status) { // if there was an error - return 0; - } else { - uint8_t data = 0; - mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(GPIOB, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; - mcp23018_status = i2c_start(I2C_ADDR_READ, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; - mcp23018_status = i2c_read_nack(ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status < 0) goto out; - data = ~((uint8_t)mcp23018_status); - mcp23018_status = I2C_STATUS_SUCCESS; - out: - i2c_stop(ERGODOX_EZ_I2C_TIMEOUT); - return data; - } +static matrix_row_t read_cols(uint8_t row) { + if (row < 7) { + if (mcp23018_status) { // if there was an error + return 0; } else { - /* read from teensy - * bitmask is 0b11110011, but we want those all - * in the lower six bits. - * we'll return 1s for the top two, but that's harmless. - */ - - return ~((PINF & 0x03) | ((PINF & 0xF0) >> 2)); + uint8_t data = 0; + mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT); + if (mcp23018_status) goto out; + mcp23018_status = i2c_write(GPIOB, ERGODOX_EZ_I2C_TIMEOUT); + if (mcp23018_status) goto out; + mcp23018_status = i2c_start(I2C_ADDR_READ, ERGODOX_EZ_I2C_TIMEOUT); + if (mcp23018_status) goto out; + mcp23018_status = i2c_read_nack(ERGODOX_EZ_I2C_TIMEOUT); + if (mcp23018_status < 0) goto out; + data = ~((uint8_t)mcp23018_status); + mcp23018_status = I2C_STATUS_SUCCESS; + out: + i2c_stop(); + return data; } + } else { + /* read from teensy + * bitmask is 0b11110011, but we want those all + * in the lower six bits. + * we'll return 1s for the top two, but that's harmless. + */ + + return ~((PINF & 0x03) | ((PINF & 0xF0) >> 2)); + } } /* Row pin configuration @@ -333,69 +266,70 @@ static matrix_row_t read_cols(uint8_t row) * row: 0 1 2 3 4 5 6 * pin: A0 A1 A2 A3 A4 A5 A6 */ -static void unselect_rows(void) -{ - // no need to unselect on mcp23018, because the select step sets all - // the other row bits high, and it's not changing to a different - // direction - - // unselect on teensy - // Hi-Z(DDR:0, PORT:0) to unselect - DDRB &= ~(1<<0 | 1<<1 | 1<<2 | 1<<3); - PORTB &= ~(1<<0 | 1<<1 | 1<<2 | 1<<3); - DDRD &= ~(1<<2 | 1<<3); - PORTD &= ~(1<<2 | 1<<3); - DDRC &= ~(1<<6); - PORTC &= ~(1<<6); +static void unselect_rows(void) { + // no need to unselect on mcp23018, because the select step sets all + // the other row bits high, and it's not changing to a different + // direction + + // unselect on teensy + // Hi-Z(DDR:0, PORT:0) to unselect + DDRB &= ~(1 << 0 | 1 << 1 | 1 << 2 | 1 << 3); + PORTB &= ~(1 << 0 | 1 << 1 | 1 << 2 | 1 << 3); + DDRD &= ~(1 << 2 | 1 << 3); + PORTD &= ~(1 << 2 | 1 << 3); + DDRC &= ~(1 << 6); + PORTC &= ~(1 << 6); } -static void select_row(uint8_t row) -{ - if (row < 7) { - // select on mcp23018 - if (mcp23018_status) { // if there was an error - // do nothing - } else { - // set active row low : 0 - // set other rows hi-Z : 1 - mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(GPIOA, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(0xFF & ~(1<<row), ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; - out: - i2c_stop(ERGODOX_EZ_I2C_TIMEOUT); - } +static void select_row(uint8_t row) { + if (row < 7) { + // select on mcp23018 + if (mcp23018_status) { // if there was an error + // do nothing } else { - // select on teensy - // Output low(DDR:1, PORT:0) to select - switch (row) { - case 7: - DDRB |= (1<<0); - PORTB &= ~(1<<0); - break; - case 8: - DDRB |= (1<<1); - PORTB &= ~(1<<1); - break; - case 9: - DDRB |= (1<<2); - PORTB &= ~(1<<2); - break; - case 10: - DDRB |= (1<<3); - PORTB &= ~(1<<3); - break; - case 11: - DDRD |= (1<<2); - PORTD &= ~(1<<2); - break; - case 12: - DDRD |= (1<<3); - PORTD &= ~(1<<3); - break; - case 13: - DDRC |= (1<<6); - PORTC &= ~(1<<6); - break; - } + // set active row low : 0 + // set other rows hi-Z : 1 + mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT); + if (mcp23018_status) goto out; + mcp23018_status = i2c_write(GPIOA, ERGODOX_EZ_I2C_TIMEOUT); + if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0xFF & ~(1 << row), ERGODOX_EZ_I2C_TIMEOUT); + if (mcp23018_status) goto out; + out: + i2c_stop(); + } + } else { + // select on teensy + // Output low(DDR:1, PORT:0) to select + switch (row) { + case 7: + DDRB |= (1 << 0); + PORTB &= ~(1 << 0); + break; + case 8: + DDRB |= (1 << 1); + PORTB &= ~(1 << 1); + break; + case 9: + DDRB |= (1 << 2); + PORTB &= ~(1 << 2); + break; + case 10: + DDRB |= (1 << 3); + PORTB &= ~(1 << 3); + break; + case 11: + DDRD |= (1 << 2); + PORTD &= ~(1 << 2); + break; + case 12: + DDRD |= (1 << 3); + PORTD &= ~(1 << 3); + break; + case 13: + DDRC |= (1 << 6); + PORTC &= ~(1 << 6); + break; } + } } diff --git a/keyboards/ergodox_ez/rules.mk b/keyboards/ergodox_ez/rules.mk index 446ba3e21a..e96cd20825 100644 --- a/keyboards/ergodox_ez/rules.mk +++ b/keyboards/ergodox_ez/rules.mk @@ -83,6 +83,7 @@ SLEEP_LED_ENABLE = no API_SYSEX_ENABLE = no RGBLIGHT_ENABLE = yes RGB_MATRIX_ENABLE = no # enable later +DEBOUNCE_TYPE = eager_pr ifeq ($(strip $(RGB_MATRIX_ENABLE)), no) SRC += i2c_master.c diff --git a/keyboards/ergodox_infinity/keymaps/default/keymap.c b/keyboards/ergodox_infinity/keymaps/default/keymap.c index 92c140f26a..7f13f3d672 100644 --- a/keyboards/ergodox_infinity/keymaps/default/keymap.c +++ b/keyboards/ergodox_infinity/keymaps/default/keymap.c @@ -1,6 +1,4 @@ #include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" #include "version.h" #define BASE 0 // default layer diff --git a/keyboards/ergotaco/config.h b/keyboards/ergotaco/config.h new file mode 100644 index 0000000000..4dbe0573b3 --- /dev/null +++ b/keyboards/ergotaco/config.h @@ -0,0 +1,61 @@ +/* +Copyright 2012 Jun Wako <wakojun@gmail.com> +Copyright 2013 Oleg Kostyuk <cub.uanic@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/>. +*/ + +// Copy and worked on with love from the EZ team + +#pragma once +#include "config_common.h" + +#define VERBOSE + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x1337 +#define DEVICE_VER 0x0001 +#define MANUFACTURER g Heavy Industries +#define PRODUCT ErgoTaco +#define DESCRIPTION QMK keyboard firmware for ErgoTaco + +/* key matrix size */ +#define MATRIX_ROWS 12 +#define MATRIX_ROWS_PER_SIDE (MATRIX_ROWS / 2) +#define MATRIX_COLS 1 + +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_MAX_SPEED 7 +#define MOUSEKEY_WHEEL_DELAY 0 +#define TAPPING_TOGGLE 1 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +#define TAPPING_TERM 200 +#define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.) + +/* 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 + +/* key combination for command */ +#define IS_COMMAND() (get_mods() == MOD_MASK_CTRL || get_mods() == MOD_MASK_SHIFT) + +#define DEBOUNCE 5 +#define USB_MAX_POWER_CONSUMPTION 500 diff --git a/keyboards/ergotaco/ergotaco.c b/keyboards/ergotaco/ergotaco.c new file mode 100644 index 0000000000..ecab74b3a2 --- /dev/null +++ b/keyboards/ergotaco/ergotaco.c @@ -0,0 +1,72 @@ +#include QMK_KEYBOARD_H + +bool i2c_initialized = 0; +i2c_status_t mcp23018_status = 0x20; + +void matrix_init_kb(void) { + // (tied to Vcc for hardware convenience) + //DDRB &= ~(1<<4); // set B(4) as input + //PORTB &= ~(1<<4); // set B(4) internal pull-up disabled + + // unused pins + // set as input with internal pull-up enabled + DDRB &= ~(1<<4 | 1<<5 | 1<<6 | 1<<7); + PORTB |= (1<<4 | 1<<5 | 1<<6 | 1<<7); + + DDRC &= ~(1<<7 | 1<<6); + PORTC |= (1<<7 | 1<<6); + + DDRD &= ~(1<<4 | 1<<5 | 1<<6 | 1<<7); + PORTD |= (1<<4 | 1<<5 | 1<<6 | 1<<7); + + DDRE &= ~(1<<6); + PORTE |= (1<<6); + + DDRF &= ~(1<<0 | 1<<1 | 1<<4 | 1<<6 | 1<<7); + PORTF |= (1<<0 | 1<<1 | 1<<4 | 1<<6 | 1<<7); + + matrix_init_user(); +} + + +uint8_t init_mcp23018(void) { + print("starting init"); + mcp23018_status = 0x20; + + // I2C subsystem + + // uint8_t sreg_prev; + // sreg_prev=SREG; + // cli(); + + if (i2c_initialized == 0) { + i2c_init(); // on pins D(1,0) + i2c_initialized = true; + _delay_ms(1000); + } + + // set pin direction + // - unused : input : 1 + // - input : input : 1 + // - driving : output : 0 + mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(IODIRA, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b00000000, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b11111111, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + i2c_stop(); + + // set pull-up + // - unused : on : 1 + // - input : on : 1 + // - driving : off : 0 + mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(GPPUA, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b00000000, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b11111111, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + +out: + i2c_stop(); + // SREG=sreg_prev; + //uprintf("Init %x\n", mcp23018_status); + return mcp23018_status; +} diff --git a/keyboards/ergotaco/ergotaco.h b/keyboards/ergotaco/ergotaco.h new file mode 100644 index 0000000000..6bc5ce36f8 --- /dev/null +++ b/keyboards/ergotaco/ergotaco.h @@ -0,0 +1,50 @@ +#pragma once +#include <util/delay.h> +#include <stdint.h> +#include <stdbool.h> +#include "quantum.h" +#include "i2c_master.h" +#include "matrix.h" + + +extern i2c_status_t mcp23018_status; +#define ERGODOX_EZ_I2C_TIMEOUT 1000 +#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n)) +#define CPU_16MHz 0x00 + +// I2C aliases and register addresses (see "mcp23018.md") +//#define I2C_ADDR 0b0100000 +#define I2C_ADDR 0x20 +#define I2C_ADDR_WRITE ( (I2C_ADDR<<1) | I2C_WRITE ) +#define I2C_ADDR_READ ( (I2C_ADDR<<1) | I2C_READ ) +#define IODIRA 0x00 // i/o direction register +#define IODIRB 0x01 +#define GPPUA 0x0C // GPIO pull-up resistor register +#define GPPUB 0x0D +#define GPIOA 0x12 // general purpose i/o port register (write modifies OLAT) +#define GPIOB 0x13 +#define OLATA 0x14 // output latch register +#define OLATB 0x15 + +void init_ergodox(void); +uint8_t init_mcp23018(void); + +/* ---------- LEFT HAND ----------- ---------- RIGHT HAND ---------- */ +#define LAYOUT( \ + L00,L01,L02,L03,L04,L05, R00,R01,R02,R03,R04,R05) \ + \ + /* matrix positions */ \ + { \ + {R00}, \ + {R01}, \ + {R02}, \ + {R03}, \ + {R04}, \ + {R05}, \ + {L05}, \ + {L04}, \ + {L03}, \ + {L02}, \ + {L01}, \ + {L00}, \ +} diff --git a/keyboards/ergotaco/info.json b/keyboards/ergotaco/info.json new file mode 100644 index 0000000000..cf6b810fec --- /dev/null +++ b/keyboards/ergotaco/info.json @@ -0,0 +1,61 @@ +{ + "keyboard_name": "ErgoTaco", + "url": "http://gboards.ca", + "maintainer": "germ", + "width": 13, + "height": 2.75, + "layouts": { + "LAYOUT": { + "layout": [ + { + "x": 0, + "y": 1.25 + }, + { + "x": 1, + "y": 0.75 + }, + { + "x": 2, + "y": 0.5 + }, + { + "x": 3, + "y": 0.25 + }, + { + "x": 4, + "y": 1 + }, + { + "x": 5, + "y": 1.75 + }, + { + "x": 7, + "y": 1.75 + }, + { + "x": 8, + "y": 1 + }, + { + "x": 9, + "y": 0.25 + }, + { + "x": 10, + "y": 0.5 + }, + { + "x": 11, + "y": 0.75 + }, + { + "x": 12, + "y": 1.25 + } + ] + } + } +} diff --git a/keyboards/ergotaco/keymaps/default/keymap.c b/keyboards/ergotaco/keymaps/default/keymap.c new file mode 100644 index 0000000000..be1267ef06 --- /dev/null +++ b/keyboards/ergotaco/keymaps/default/keymap.c @@ -0,0 +1,42 @@ +/* Good on you for modifying your layout! if you don't have + * time to read the QMK docs, a list of keycodes can be found at + * + * https://github.com/qmk/qmk_firmware/blob/master/docs/keycodes.md + * + * There's also a template for adding new layers at the bottom of this file! + */ + +#include QMK_KEYBOARD_H + +#define FIESTA 0 // default layer +#define TACOTIME 1 // symbols + +// Blank template at the bottom +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap template + * + * ,-------------------------------------------------. ,--------------------------------------------. + * | | | | | | | | | | | | | | | + * `-------+------+------+------+------+-------------' `-------+------+------+------+------+--------' */ +[FIESTA] = LAYOUT( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H +), +}; + +/* Keymap template + * + * ,-------------------------------------------------. ,--------------------------------------------. + * | | | | | | | | | | | | | | | + * `-------+------+------+------+------+-------------' `-------+------+------+------+------+--------' +[FIESTA] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS +), + */ + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { +}; diff --git a/keyboards/ergotaco/keymaps/default/readme.md b/keyboards/ergotaco/keymaps/default/readme.md new file mode 100644 index 0000000000..653f3774ea --- /dev/null +++ b/keyboards/ergotaco/keymaps/default/readme.md @@ -0,0 +1,6 @@ +This is the default keymap for the ErgoTaco, Make it your own! + +## Settings +To edit various settings, enable the 1u trackball and whatnot please modify /keyboards/ergotaco/keymaps/default/rules.mk + +Ideally you should copy this directory and make your changes there. If you come up with a good layout submit a PR! diff --git a/keyboards/ergotaco/keymaps/default/rules.mk b/keyboards/ergotaco/keymaps/default/rules.mk new file mode 100644 index 0000000000..e394fbf1e6 --- /dev/null +++ b/keyboards/ergotaco/keymaps/default/rules.mk @@ -0,0 +1,10 @@ +#---------------------------------------------------------------------------- +# make ergotaco:default:dfu +# Make sure you have dfu-programmer installed! +#---------------------------------------------------------------------------- +# Firmware options + +#Debug options +VERBOSE = yes +DEBUG_MATRIX_SCAN_RATE = no +DEBUG_MATRIX = yes diff --git a/keyboards/ergotaco/matrix.c b/keyboards/ergotaco/matrix.c new file mode 100644 index 0000000000..e4fd6902f9 --- /dev/null +++ b/keyboards/ergotaco/matrix.c @@ -0,0 +1,366 @@ +/* +Note for ErgoDox EZ customizers: Here be dragons! +This is not a file you want to be messing with. +All of the interesting stuff for you is under keymaps/ :) +Love, Erez + +Copyright 2013 Oleg Kostyuk <cub.uanic@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 "matrix.h" +#include <stdint.h> +#include <stdbool.h> +#include <avr/io.h> +#include "wait.h" +#include "action_layer.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include QMK_KEYBOARD_H +#ifdef DEBUG_MATRIX_SCAN_RATE +#include "timer.h" +#endif + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +// ATmega pin defs +#define ROW1 (1<<5) +#define COL6 (1<<0) +#define COL7 (1<<1) +#define COL8 (1<<2) +#define COL9 (1<<3) +#define COL10 (1<<2) +#define COL11 (1<<3) + + +// bit masks +#define BMASK (COL7 | COL8 | COL9 | COL6) +#define DMASK (COL10 | COL11) +#define FMASK (ROW1) + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +/* + * matrix state(1:on, 0:off) + * contains the raw values without debounce filtering of the last read cycle. + */ +static matrix_row_t raw_matrix[MATRIX_ROWS]; + +// Debouncing: store for each key the number of scans until it's eligible to +// change. When scanning the matrix, ignore any changes in keys that have +// already changed in the last DEBOUNCE scans. +static uint8_t debounce_matrix[MATRIX_ROWS * MATRIX_COLS]; + +static matrix_row_t read_cols(uint8_t row); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); + +static uint8_t mcp23018_reset_loop; +// static uint16_t mcp23018_reset_loop; + +#ifdef DEBUG_MATRIX_SCAN_RATE +uint32_t matrix_timer; +uint32_t matrix_scan_count; +#endif + + +__attribute__ ((weak)) +void matrix_init_user(void) {} + +__attribute__ ((weak)) +void matrix_scan_user(void) {} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + + +void matrix_init(void) +{ + // initialize row and col + mcp23018_status = init_mcp23018(); + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + raw_matrix[i] = 0; + for (uint8_t j=0; j < MATRIX_COLS; ++j) { + debounce_matrix[i * MATRIX_COLS + j] = 0; + } + } + +#ifdef DEBUG_MATRIX_SCAN_RATE + matrix_timer = timer_read32(); + matrix_scan_count = 0; +#endif + matrix_init_quantum(); +} + +void matrix_power_up(void) { + mcp23018_status = init_mcp23018(); + + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + } + +#ifdef DEBUG_MATRIX_SCAN_RATE + matrix_timer = timer_read32(); + matrix_scan_count = 0; +#endif + +} + +// Returns a matrix_row_t whose bits are set if the corresponding key should be +// eligible to change in this scan. +matrix_row_t debounce_mask(matrix_row_t rawcols, uint8_t row) { + matrix_row_t result = 0; + matrix_row_t change = rawcols ^ raw_matrix[row]; + raw_matrix[row] = rawcols; + for (uint8_t i = 0; i < MATRIX_COLS; ++i) { + if (debounce_matrix[row * MATRIX_COLS + i]) { + --debounce_matrix[row * MATRIX_COLS + i]; + } else { + result |= (1 << i); + } + if (change & (1 << i)) { + debounce_matrix[row * MATRIX_COLS + i] = DEBOUNCE; + } + } + return result; +} + +matrix_row_t debounce_read_cols(uint8_t row) { + // Read the row without debouncing filtering and store it for later usage. + matrix_row_t cols = read_cols(row); + // Get the Debounce mask. + matrix_row_t mask = debounce_mask(cols, row); + // debounce the row and return the result. + return (cols & mask) | (matrix[row] & ~mask);; +} + +uint8_t matrix_scan(void) +{ + // Then the keyboard + if (mcp23018_status) { // if there was an error + if (++mcp23018_reset_loop == 0) { + // if (++mcp23018_reset_loop >= 1300) { + // since mcp23018_reset_loop is 8 bit - we'll try to reset once in 255 matrix scans + // this will be approx bit more frequent than once per second + print("trying to reset mcp23018\n"); + mcp23018_status = init_mcp23018(); + if (mcp23018_status) { + print("left side not responding\n"); + } else { + print("left side attached\n"); + } + } + } + +#ifdef DEBUG_MATRIX_SCAN_RATE + matrix_scan_count++; + uint32_t timer_now = timer_read32(); + if (TIMER_DIFF_32(timer_now, matrix_timer)>1000) { + print("matrix scan frequency: "); + pdec(matrix_scan_count); + print("\n"); + + matrix_timer = timer_now; + matrix_scan_count = 0; + } +#endif + for (uint8_t i = 0; i < MATRIX_ROWS_PER_SIDE; i++) { + select_row(i); + // and select on left hand + select_row(i + MATRIX_ROWS_PER_SIDE); + // we don't need a 30us delay anymore, because selecting a + // left-hand row requires more than 30us for i2c. + + // grab cols from left hand + matrix[i] = debounce_read_cols(i); + // grab cols from right hand + matrix[i + MATRIX_ROWS_PER_SIDE] = debounce_read_cols(i + MATRIX_ROWS_PER_SIDE); + + unselect_rows(); + } + + matrix_scan_quantum(); + +#ifdef DEBUG_MATRIX + for (uint8_t c = 0; c < MATRIX_COLS; c++) + for (uint8_t r = 0; r < MATRIX_ROWS; r++) + if (matrix_is_on(r, c)) xprintf("r:%d c:%d \n", r, c); +#endif + + return 1; +} + +bool matrix_is_modified(void) // deprecated and evidently not called. +{ + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<<col)); +} + +inline +matrix_row_t matrix_get_row(uint8_t row) +{ + return matrix[row]; +} + +void matrix_print(void) +{ + print("\nr/c 0123456789ABCDEF\n"); + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + phex(row); print(": "); + pbin_reverse16(matrix_get_row(row)); + print("\n"); + } +} + +uint8_t matrix_key_count(void) +{ + uint8_t count = 0; + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + count += bitpop16(matrix[i]); + } + return count; +} + +// Remember this means ROWS +static void init_cols(void) +{ + // init on mcp23018 + // not needed, already done as part of init_mcp23018() + + // Input with pull-up(DDR:0, PORT:1) + DDRF &= ~FMASK; + PORTF |= FMASK; +} + +static matrix_row_t read_cols(uint8_t row) +{ + if (row < 6) { + if (mcp23018_status) { // if there was an error + return 0; + } else { + uint8_t data = 0; + mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(GPIOB, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_start(I2C_ADDR_READ, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_read_nack(ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status < 0) goto out; + data = (~((uint8_t)mcp23018_status) >> 2) & 0x01 ; + mcp23018_status = I2C_STATUS_SUCCESS; + out: + i2c_stop(); + +#ifdef DEBUG_MATRIX + if (data != 0x00) xprintf("I2C: %d\n", data); +#endif + return data; + } + } else { + // Read using bitmask + return ~((((PINF & ROW1) >> 5)) & 0x1); + } +} + +// Row pin configuration +static void unselect_rows(void) +{ + // no need to unselect on mcp23018, because the select step sets all + // the other row bits high, and it's not changing to a different + // direction + // Hi-Z(DDR:0, PORT:0) to unselect + DDRB &= ~BMASK; + PORTB &= ~BMASK; + DDRD &= ~DMASK; + PORTD &= ~DMASK; +} + +static void select_row(uint8_t row) +{ + if (row < 6) { + // select on mcp23018 + if (mcp23018_status) { // do nothing on error + // Read using bitmask + } else { // set active row low : 0 // set other rows hi-Z : 1 + mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(GPIOA, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(~(1<<row), ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + out: + i2c_stop(); + } + } else { + // Output low(DDR:1, PORT:0) to select + switch (row) { + case 6: + DDRB |= COL6; + PORTB &= ~COL6; + break; + case 7: + DDRB |= COL7; + PORTB &= ~COL7; + break; + case 8: + DDRB |= COL8; + PORTB &= ~COL8; + break; + case 9: + DDRB |= COL9; + PORTB &= ~COL9; + break; + case 10: + DDRD |= COL10; + PORTD &= ~COL10; + break; + case 11: + DDRD |= COL11; + PORTD &= ~COL11; + break; + } + } +} diff --git a/keyboards/ergotaco/readme.md b/keyboards/ergotaco/readme.md new file mode 100644 index 0000000000..3021168db4 --- /dev/null +++ b/keyboards/ergotaco/readme.md @@ -0,0 +1,24 @@ +# Gergo + +![ErgoTaco](https://i.redd.it/dbcu5i21m3i21.jpg) + +It's a Taco with a side of HASL. A 12 key fiesta of a board. + +Keyboard Maintainer: [Jeremy Bernhardt](https://github.com/germ) +Hardware Supported: ErgoTaco +Hardware Availability: [gboards.ca](http://gboards.ca) + +## Firmware building +Clone the QMK Repo and install dfu-programmer, flash with: + + make ergotaco:default:dfu + +And reset your keyboard! + +To just test if your build system is sane, try compiling the default keymap using: + + make ergotaco:default + +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). + +## Have an idea? [Reach out to me!](mailto:bernhardtjeremy@gmail.com) diff --git a/keyboards/ergotaco/rules.mk b/keyboards/ergotaco/rules.mk new file mode 100644 index 0000000000..0af3e34740 --- /dev/null +++ b/keyboards/ergotaco/rules.mk @@ -0,0 +1,26 @@ +#---------------------------------------------------------------------------- +# make ergotaco:default:dfu +# Make sure you have dfu-programmer installed! +# Do not edit this file! Make a copy of keymaps/default and modify that! +#---------------------------------------------------------------------------- + +# Hardware info +MCU = atmega32u4 +F_CPU = 16000000 +ARCH = AVR8 +BOOTLOADER = atmel-dfu +F_USB = $(F_CPU) + +CUSTOM_MATRIX = yes +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = yes +COMMAND_ENABLE = yes + +# A bunch of stuff that you shouldn't touch unless you +# know what you're doing. +# +# No touchy, capiche? +SRC += matrix.c i2c_master.c +ifeq ($(strip $(DEBUG_MATRIX)), yes) + OPT_DEFS += -DDEBUG_MATRIX +endif diff --git a/keyboards/panc60/i2c.h b/keyboards/ergotravel/keymaps/jarred/config.h index 7ce50cdb57..d64187b598 100644 --- a/keyboards/panc60/i2c.h +++ b/keyboards/ergotravel/keymaps/jarred/config.h @@ -1,5 +1,5 @@ /* -Copyright 2016 Luiz Ribeiro <luizribeiro@gmail.com> +Copyright 2017 Pierre Constantineau <jpconstantineau@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 @@ -15,13 +15,15 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -// Please do not modify this file +#pragma once -#ifndef __I2C_H__ -#define __I2C_H__ +/* Use I2C or Serial, not both */ -void i2c_init(void); -void i2c_set_bitrate(uint16_t bitrate_khz); -uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length); +// #define USE_SERIAL +#define USE_I2C -#endif +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS diff --git a/keyboards/ergotravel/keymaps/jarred/keymap.c b/keyboards/ergotravel/keymaps/jarred/keymap.c new file mode 100644 index 0000000000..33031f931b --- /dev/null +++ b/keyboards/ergotravel/keymaps/jarred/keymap.c @@ -0,0 +1,50 @@ +/* Copyright 2018 Jarred Steenvoorden + * + * 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 QMK_KEYBOARD_H +#include "jarred.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QW] = LAYOUT_ergotravel_grid_wrapper( + QWERTY_L1, KC_NO, KC_NO, QWERTY_R1, + QWERTY_L2, KC_NO, KC_NO, QWERTY_R2, + QWERTY_L3, KC_NO, KC_NO, QWERTY_R3, + QWERTY_4_12), + + [_LW] = LAYOUT_ergotravel_grid_wrapper( + LOWER_L1, KC_NO, KC_NO, LOWER_R1, + LOWER_L2, KC_NO, KC_NO, LOWER_R2, + LOWER_L3, KC_NO, KC_NO, LOWER_R3, + LOWER_4_12), + + [_NV] = LAYOUT_ergotravel_grid_wrapper( + NAV_L1, KC_NO, KC_NO, NAV_R1, + NAV_L2, KC_NO, KC_NO, NAV_R2, + NAV_L3, KC_NO, KC_NO, NAV_R3, + NAV_4_12), + + [_NP] = LAYOUT_ergotravel_grid_wrapper( + NUMPAD_L1, KC_NO, KC_NO, NUMPAD_R1, + NUMPAD_L2, KC_NO, KC_NO, NUMPAD_R2, + NUMPAD_L3, KC_NO, KC_NO, NUMPAD_R3, + NUMPAD_4_12), + + [_MS] = LAYOUT_ergotravel_grid_wrapper( + MOUSE_L1, KC_NO, KC_NO, MOUSE_R1, + MOUSE_L2, KC_NO, KC_NO, MOUSE_R2, + MOUSE_L3, KC_NO, KC_NO, MOUSE_R3, + MOUSE_4_12) +}; diff --git a/keyboards/exclusive/e6v2/bmc/bmc.c b/keyboards/exclusive/e6v2/bmc/bmc.c new file mode 100644 index 0000000000..257b68b8b4 --- /dev/null +++ b/keyboards/exclusive/e6v2/bmc/bmc.c @@ -0,0 +1,96 @@ +/* Copyright 2019 MechMerlin + * + * 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 "bmc.h" +#include "rgblight.h" +#include "i2c_master.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +#ifdef RGBLIGHT_ENABLE +extern rgblight_config_t rgblight_config; + +void rgblight_set(void) { + if (!rgblight_config.enable) { + for (uint8_t i = 0; i < RGBLED_NUM; i++) { + led[i].r = 0; + led[i].g = 0; + led[i].b = 0; + } + } + + i2c_init(); + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); +} +#endif + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +void backlight_init_ports(void) { + // initialize pins D0, D1, D4 and D6 as output + setPinOutput(D0); + setPinOutput(D1); + setPinOutput(D4); + setPinOutput(D6); + + // turn RGB LEDs on + writePinHigh(D0); + writePinHigh(D1); + writePinHigh(D4); + writePinHigh(D6); +} + +void backlight_set(uint8_t level) { + if (level == 0) { + // turn RGB LEDs off + writePinLow(D0); + writePinLow(D1); + writePinLow(D4); + writePinLow(D6); + } else { + // turn RGB LEDs on + writePinHigh(D0); + writePinHigh(D1); + writePinHigh(D4); + writePinHigh(D6); + } +} diff --git a/keyboards/exclusive/e6v2/bmc/bmc.h b/keyboards/exclusive/e6v2/bmc/bmc.h new file mode 100644 index 0000000000..06d23fbe69 --- /dev/null +++ b/keyboards/exclusive/e6v2/bmc/bmc.h @@ -0,0 +1,101 @@ +/* Copyright 2019 MechMerlin + * + * 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" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ + +// LAYOUT_all ignores the key often coded as ~# to the left of Enter on ISO layouts. +// This is done as it shares the same row AND col as the pipe key. +#define LAYOUT_all( \ + k50, k41, k42, k43, k44, k45, k61, k68, k78, k71, k49, k48, k47, k52, k4A, \ + k30, k31, k32, k33, k34, k35, k62, k67, k77, k72, k39, k38, k37, k36, \ + k20, k21, k22, k23, k24, k25, k63, k66, k76, k73, k29, k28, k26, \ + k10, k53, k11, k12, k13, k14, k15, k64, k6A, k7A, k74, k19, k18, k54, \ + k00, k01, k02, k75, k04, k08, k09, k05 \ +) \ +{ \ + { k00, k01, k02, KC_NO, k04, k05, KC_NO, KC_NO, k08, k09, KC_NO }, \ + { k10, k11, k12, k13, k14, k15, KC_NO, KC_NO, k18, k19, KC_NO }, \ + { k20, k21, k22, k23, k24, k25, k26, KC_NO, k28, k29, KC_NO }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, KC_NO }, \ + { KC_NO, k41, k42, k43, k44, k45, KC_NO, k47, k48, k49, k4A }, \ + { k50, KC_NO, k52, k53, k54, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, k61, k62, k63, k64, KC_NO, k66, k67, k68, KC_NO, k6A }, \ + { KC_NO, k71, k72, k73, k74, k75, k76, k77, k78, KC_NO, k7A }, \ +} + +#define LAYOUT_60_ansi( \ + k50, k41, k42, k43, k44, k45, k61, k68, k78, k71, k49, k48, k47, k4A, \ + k30, k31, k32, k33, k34, k35, k62, k67, k77, k72, k39, k38, k37, k36, \ + k20, k21, k22, k23, k24, k25, k63, k66, k76, k73, k29, k28, k26, \ + k10, k11, k12, k13, k14, k15, k64, k6A, k7A, k74, k19, k18, \ + k00, k01, k02, k75, k04, k08, k09, k05 \ +) \ +{ \ + { k00, k01, k02, KC_NO, k04, k05, KC_NO, KC_NO, k08, k09, KC_NO }, \ + { k10, k11, k12, k13, k14, k15, KC_NO, KC_NO, k18, k19, KC_NO }, \ + { k20, k21, k22, k23, k24, k25, k26, KC_NO, k28, k29, KC_NO }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, KC_NO }, \ + { KC_NO, k41, k42, k43, k44, k45, KC_NO, k47, k48, k49, k4A }, \ + { k50, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, k61, k62, k63, k64, KC_NO, k66, k67, k68, KC_NO, k6A }, \ + { KC_NO, k71, k72, k73, k74, k75, k76, k77, k78, KC_NO, k7A }, \ +} + +#define LAYOUT_60_hhkb( \ + k50, k41, k42, k43, k44, k45, k61, k68, k78, k71, k49, k48, k47, k52, k4A, \ + k30, k31, k32, k33, k34, k35, k62, k67, k77, k72, k39, k38, k37, k36, \ + k20, k21, k22, k23, k24, k25, k63, k66, k76, k73, k29, k28, k26, \ + k10, k11, k12, k13, k14, k15, k64, k6A, k7A, k74, k19, k18, k54, \ + k01, k02, k75, k08, k09 \ +) \ +{ \ + { KC_NO, k01, k02, KC_NO, KC_NO, k05, KC_NO, KC_NO, k08, k09, KC_NO }, \ + { k10, k11, k12, k13, k14, k15, KC_NO, KC_NO, k18, k19, KC_NO }, \ + { k20, k21, k22, k23, k24, k25, k26, KC_NO, k28, k29, KC_NO }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, KC_NO }, \ + { KC_NO, k41, k42, k43, k44, k45, KC_NO, k47, k48, k49, k4A }, \ + { k50, KC_NO, k52, KC_NO, k54, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, k61, k62, k63, k64, KC_NO, k66, k67, k68, KC_NO, k6A }, \ + { KC_NO, k71, k72, k73, k74, k75, k76, k77, k78, KC_NO, k7A }, \ +} + +#define LAYOUT_60_tsangan( \ + k50, k41, k42, k43, k44, k45, k61, k68, k78, k71, k49, k48, k47, k52, k4A, \ + k30, k31, k32, k33, k34, k35, k62, k67, k77, k72, k39, k38, k37, k36, \ + k20, k21, k22, k23, k24, k25, k63, k66, k76, k73, k29, k28, k26, \ + k10, k11, k12, k13, k14, k15, k64, k6A, k7A, k74, k19, k18, k54, \ + k00, k01, k02, k75, k08, k09, k05 \ +) \ +{ \ + { k00, k01, k02, KC_NO, KC_NO, k05, KC_NO, KC_NO, k08, k09, KC_NO }, \ + { k10, k11, k12, k13, k14, k15, KC_NO, KC_NO, k18, k19, KC_NO }, \ + { k20, k21, k22, k23, k24, k25, k26, KC_NO, k28, k29, KC_NO }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, KC_NO }, \ + { KC_NO, k41, k42, k43, k44, k45, KC_NO, k47, k48, k49, k4A }, \ + { k50, KC_NO, k52, KC_NO, k54, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, k61, k62, k63, k64, KC_NO, k66, k67, k68, KC_NO, k6A }, \ + { KC_NO, k71, k72, k73, k74, k75, k76, k77, k78, KC_NO, k7A }, \ +} diff --git a/keyboards/exclusive/e6v2/bmc/config.h b/keyboards/exclusive/e6v2/bmc/config.h new file mode 100644 index 0000000000..7c6fcccdb9 --- /dev/null +++ b/keyboards/exclusive/e6v2/bmc/config.h @@ -0,0 +1,49 @@ +/* +Copyright 2019 MechMerlin + +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 + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER exclusive +#define PRODUCT e6v2 bmc +#define DESCRIPTION A custom 60% keyboard + +/* key matrix size */ +#define MATRIX_ROWS 8 +#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) + * +*/ + +// 0 1 2 3 4 5 6 7 8 9 A +#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, B5, B6, B7 } +#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, C2, C3, C4, C5, D7 } +#define DIODE_DIRECTION COL2ROW + +#define RGBLED_NUM 6 +#define RGBLIGHT_ANIMATIONS diff --git a/keyboards/exclusive/e6v2/bmc/info.json b/keyboards/exclusive/e6v2/bmc/info.json new file mode 100644 index 0000000000..aa6d171ba8 --- /dev/null +++ b/keyboards/exclusive/e6v2/bmc/info.json @@ -0,0 +1,24 @@ +{ + "keyboard_name": "", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_all": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.26}, {"x":10.0, "y":4, "w":1.25}, {"x":11.25, "y":4, "w":1.25}, {"x":12.5, "y":4, "w":1.25}, {"x":13.75, "y":4, "w":1.25}] + }, + + "LAYOUT_60_ansi": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0, "w":2}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":2.75}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4, "w":1.25}, {"x":11.25, "y":4, "w":1.25}, {"x":12.5, "y":4, "w":1.25}, {"x":13.75, "y":4, "w":1.25}] + }, + + "LAYOUT_60_hhkb": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Delete", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Os", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Os", "x":12.5, "y":4}] + }, + + "LAYOUT_60_tsangan": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":0, "y":4, "w":1.5}, {"x":1.5, "y":4}, {"x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"x":11, "y":4, "w":1.5}, {"x":12.5, "y":4}, {"x":13.5, "y":4, "w":1.5}] + } + } +}
\ No newline at end of file diff --git a/keyboards/exclusive/e6v2/bmc/keymaps/default/config.h b/keyboards/exclusive/e6v2/bmc/keymaps/default/config.h new file mode 100644 index 0000000000..26c6d6ade1 --- /dev/null +++ b/keyboards/exclusive/e6v2/bmc/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 MechMerlin + * + * 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 + +// place overrides here diff --git a/keyboards/exclusive/e6v2/bmc/keymaps/default/keymap.c b/keyboards/exclusive/e6v2/bmc/keymaps/default/keymap.c new file mode 100644 index 0000000000..7300419176 --- /dev/null +++ b/keyboards/exclusive/e6v2/bmc/keymaps/default/keymap.c @@ -0,0 +1,74 @@ +/* Copyright 2019 MechMerlin + * + * 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 QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_60_ansi( + KC_GESC, 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_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_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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, MO(1) + ), + +[1] = LAYOUT_60_ansi( + KC_GRV, 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_DEL, \ + BL_TOGG, BL_INC, BL_DEC, BL_STEP, RESET, EEP_RST, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/exclusive/e6v2/bmc/keymaps/default/readme.md b/keyboards/exclusive/e6v2/bmc/keymaps/default/readme.md new file mode 100644 index 0000000000..4a1b6efa62 --- /dev/null +++ b/keyboards/exclusive/e6v2/bmc/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for bmc diff --git a/keyboards/exclusive/e6v2/bmc/readme.md b/keyboards/exclusive/e6v2/bmc/readme.md new file mode 100644 index 0000000000..b69ac792cf --- /dev/null +++ b/keyboards/exclusive/e6v2/bmc/readme.md @@ -0,0 +1,44 @@ +# E6-V2 Bootmapper Client (ps2avrgb) + +These docs are for the BMC version of the E6-V2 PCB which has an atmega32a microcontroller. Please do not flash this `.hex` file on your atmega32u4 equipped E6-V2. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: ps2avrgb E6-V2 with atmega32a microcontroller +Hardware Availability: [geekhack.org/index.php?topic=90787.0](https://geekhack.org/index.php?topic=90787.0) + +Make example for this keyboard (after setting up your build environment): + + make exclusive/e6v2/bmc:default + +Flashing + +ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. + +**Reset Key:** Hold down the key located at `K00`, commonly programmed as left control while plugging in the keyboard. + +Windows: +1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). +2. Place your keyboard into reset. +3. Press the `Find Device` button and ensure that your keyboard is found. +4. Press the `Open .hex File` button and locate the `.hex` file you created. +5. Press the `Flash Device` button and wait for the process to complete. + +macOS: +1. Install homebrew by typing the following: + ``` + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + ``` +2. Install `crosspack-avr`. + ``` + brew cask install crosspack-avr + ``` +3. Install the following packages: + ``` + brew install python3 + pip3 install pyusb + brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb + +4. Place your keyboard into reset. +5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. + +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/exclusive/e6v2/bmc/rules.mk b/keyboards/exclusive/e6v2/bmc/rules.mk new file mode 100644 index 0000000000..885bce2453 --- /dev/null +++ b/keyboards/exclusive/e6v2/bmc/rules.mk @@ -0,0 +1,90 @@ +# MCU name +#MCU = at90usb1286 +MCU = atmega32a +PROTOCOL = VUSB + +NO_UART = yes +NO_SUSPEND_POWER_DOWN = yes + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 12000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +# ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +# F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS = -DDEBUG_LEVEL=0 + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = bootloadHID + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_CUSTOM_DRIVER = yes +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +SRC += i2c_master.c + +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/exclusive/e6v2/bmc/usbconfig.h b/keyboards/exclusive/e6v2/bmc/usbconfig.h new file mode 100644 index 0000000000..f22f2b631d --- /dev/null +++ b/keyboards/exclusive/e6v2/bmc/usbconfig.h @@ -0,0 +1,393 @@ +/* Name: usbconfig.h + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers + * Author: Christian Starkjohann + * Creation Date: 2005-04-01 + * Tabsize: 4 + * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ + */ + +#pragma once + +#include "config.h" + +/* +General Description: +This file is an example configuration (with inline documentation) for the USB +driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is +also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may +wire the lines to any other port, as long as D+ is also wired to INT0 (or any +other hardware interrupt, as long as it is the highest level interrupt, see +section at the end of this file). +*/ + +/* ---------------------------- Hardware Config ---------------------------- */ + +#define USB_CFG_IOPORTNAME D +/* This is the port where the USB bus is connected. When you configure it to + * "B", the registers PORTB, PINB and DDRB will be used. + */ +#define USB_CFG_DMINUS_BIT 3 +/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. + * This may be any bit in the port. + */ +#define USB_CFG_DPLUS_BIT 2 +/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. + * This may be any bit in the port. Please note that D+ must also be connected + * to interrupt pin INT0! [You can also use other interrupts, see section + * "Optional MCU Description" below, or you can connect D- to the interrupt, as + * it is required if you use the USB_COUNT_SOF feature. If you use D- for the + * interrupt, the USB interrupt will also be triggered at Start-Of-Frame + * markers every millisecond.] + */ +#define USB_CFG_CLOCK_KHZ (F_CPU/1000) +/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, + * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code + * require no crystal, they tolerate +/- 1% deviation from the nominal + * frequency. All other rates require a precision of 2000 ppm and thus a + * crystal! + * Since F_CPU should be defined to your actual clock rate anyway, you should + * not need to modify this setting. + */ +#define USB_CFG_CHECK_CRC 0 +/* Define this to 1 if you want that the driver checks integrity of incoming + * data packets (CRC checks). CRC checks cost quite a bit of code size and are + * currently only available for 18 MHz crystal clock. You must choose + * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. + */ + +/* ----------------------- Optional Hardware Config ------------------------ */ + +/* #define USB_CFG_PULLUP_IOPORTNAME D */ +/* If you connect the 1.5k pullup resistor from D- to a port pin instead of + * V+, you can connect and disconnect the device from firmware by calling + * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). + * This constant defines the port on which the pullup resistor is connected. + */ +/* #define USB_CFG_PULLUP_BIT 4 */ +/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined + * above) where the 1.5k pullup resistor is connected. See description + * above for details. + */ + +/* --------------------------- Functional Range ---------------------------- */ + +#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 +/* Define this to 1 if you want to compile a version with two endpoints: The + * default control endpoint 0 and an interrupt-in endpoint (any other endpoint + * number). + */ +#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 +/* Define this to 1 if you want to compile a version with three endpoints: The + * default control endpoint 0, an interrupt-in endpoint 3 (or the number + * configured below) and a catch-all default interrupt-in endpoint as above. + * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. + */ +#define USB_CFG_EP3_NUMBER 3 +/* If the so-called endpoint 3 is used, it can now be configured to any other + * endpoint number (except 0) with this macro. Default if undefined is 3. + */ +/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ +/* The above macro defines the startup condition for data toggling on the + * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. + * Since the token is toggled BEFORE sending any data, the first packet is + * sent with the oposite value of this configuration! + */ +#define USB_CFG_IMPLEMENT_HALT 0 +/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature + * for endpoint 1 (interrupt endpoint). Although you may not need this feature, + * it is required by the standard. We have made it a config option because it + * bloats the code considerably. + */ +#define USB_CFG_SUPPRESS_INTR_CODE 0 +/* Define this to 1 if you want to declare interrupt-in endpoints, but don't + * want to send any data over them. If this macro is defined to 1, functions + * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if + * you need the interrupt-in endpoints in order to comply to an interface + * (e.g. HID), but never want to send any data. This option saves a couple + * of bytes in flash memory and the transmit buffers in RAM. + */ +#define USB_CFG_INTR_POLL_INTERVAL 1 +/* If you compile a version with endpoint 1 (interrupt-in), this is the poll + * interval. The value is in milliseconds and must not be less than 10 ms for + * low speed devices. + */ +#define USB_CFG_IS_SELF_POWERED 0 +/* Define this to 1 if the device has its own power supply. Set it to 0 if the + * device is powered from the USB bus. + */ +#define USB_CFG_MAX_BUS_POWER 500 +/* Set this variable to the maximum USB bus power consumption of your device. + * The value is in milliamperes. [It will be divided by two since USB + * communicates power requirements in units of 2 mA.] + */ +#define USB_CFG_IMPLEMENT_FN_WRITE 1 +/* Set this to 1 if you want usbFunctionWrite() to be called for control-out + * transfers. Set it to 0 if you don't need it and want to save a couple of + * bytes. + */ +#define USB_CFG_IMPLEMENT_FN_READ 0 +/* Set this to 1 if you need to send control replies which are generated + * "on the fly" when usbFunctionRead() is called. If you only want to send + * data from a static buffer, set it to 0 and return the data from + * usbFunctionSetup(). This saves a couple of bytes. + */ +#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 +/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. + * You must implement the function usbFunctionWriteOut() which receives all + * interrupt/bulk data sent to any endpoint other than 0. The endpoint number + * can be found in 'usbRxToken'. + */ +#define USB_CFG_HAVE_FLOWCONTROL 0 +/* Define this to 1 if you want flowcontrol over USB data. See the definition + * of the macros usbDisableAllRequests() and usbEnableAllRequests() in + * usbdrv.h. + */ +#define USB_CFG_DRIVER_FLASH_PAGE 0 +/* If the device has more than 64 kBytes of flash, define this to the 64 k page + * where the driver's constants (descriptors) are located. Or in other words: + * Define this to 1 for boot loaders on the ATMega128. + */ +#define USB_CFG_LONG_TRANSFERS 0 +/* Define this to 1 if you want to send/receive blocks of more than 254 bytes + * in a single control-in or control-out transfer. Note that the capability + * for long transfers increases the driver size. + */ +/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ +/* This macro is a hook if you want to do unconventional things. If it is + * defined, it's inserted at the beginning of received message processing. + * If you eat the received message and don't want default processing to + * proceed, do a return after doing your things. One possible application + * (besides debugging) is to flash a status LED on each packet. + */ +/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ +/* This macro is a hook if you need to know when an USB RESET occurs. It has + * one parameter which distinguishes between the start of RESET state and its + * end. + */ +/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ +/* This macro (if defined) is executed when a USB SET_ADDRESS request was + * received. + */ +#define USB_COUNT_SOF 1 +/* define this macro to 1 if you need the global variable "usbSofCount" which + * counts SOF packets. This feature requires that the hardware interrupt is + * connected to D- instead of D+. + */ +/* #ifdef __ASSEMBLER__ + * macro myAssemblerMacro + * in YL, TCNT0 + * sts timer0Snapshot, YL + * endm + * #endif + * #define USB_SOF_HOOK myAssemblerMacro + * This macro (if defined) is executed in the assembler module when a + * Start Of Frame condition is detected. It is recommended to define it to + * the name of an assembler macro which is defined here as well so that more + * than one assembler instruction can be used. The macro may use the register + * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages + * immediately after an SOF pulse may be lost and must be retried by the host. + * What can you do with this hook? Since the SOF signal occurs exactly every + * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in + * designs running on the internal RC oscillator. + * Please note that Start Of Frame detection works only if D- is wired to the + * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! + */ +#define USB_CFG_CHECK_DATA_TOGGLING 0 +/* define this macro to 1 if you want to filter out duplicate data packets + * sent by the host. Duplicates occur only as a consequence of communication + * errors, when the host does not receive an ACK. Please note that you need to + * implement the filtering yourself in usbFunctionWriteOut() and + * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable + * for each control- and out-endpoint to check for duplicate packets. + */ +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 +/* define this macro to 1 if you want the function usbMeasureFrameLength() + * compiled in. This function can be used to calibrate the AVR's RC oscillator. + */ +#define USB_USE_FAST_CRC 0 +/* The assembler module has two implementations for the CRC algorithm. One is + * faster, the other is smaller. This CRC routine is only used for transmitted + * messages where timing is not critical. The faster routine needs 31 cycles + * per byte while the smaller one needs 61 to 69 cycles. The faster routine + * may be worth the 32 bytes bigger code size if you transmit lots of data and + * run the AVR close to its limit. + */ + +/* -------------------------- Device Description --------------------------- */ + +#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) +/* USB vendor ID for the device, low byte first. If you have registered your + * own Vendor ID, define it here. Otherwise you may use one of obdev's free + * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) +/* This is the ID of the product, low byte first. It is interpreted in the + * scope of the vendor ID. If you have registered your own VID with usb.org + * or if you have licensed a PID from somebody else, define it here. Otherwise + * you may use one of obdev's free shared VID/PID pairs. See the file + * USB-IDs-for-free.txt for details! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_VERSION 0x00, 0x02 +/* Version number of the device: Minor number first, then major number. + */ +#define USB_CFG_VENDOR_NAME 'E', 'x', 'c', 'l', 'u', 's', 'i', 'v', 'e' +#define USB_CFG_VENDOR_NAME_LEN 9 +/* These two values define the vendor name returned by the USB device. The name + * must be given as a list of characters under single quotes. The characters + * are interpreted as Unicode (UTF-16) entities. + * If you don't want a vendor name string, undefine these macros. + * ALWAYS define a vendor name containing your Internet domain name if you use + * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for + * details. + */ +#define USB_CFG_DEVICE_NAME 'E', '6', 'V', '2' +#define USB_CFG_DEVICE_NAME_LEN 4 +/* Same as above for the device name. If you don't want a device name, undefine + * the macros. See the file USB-IDs-for-free.txt before you assign a name if + * you use a shared VID/PID. + */ +/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ +/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ +/* Same as above for the serial number. If you don't want a serial number, + * undefine the macros. + * It may be useful to provide the serial number through other means than at + * compile time. See the section about descriptor properties below for how + * to fine tune control over USB descriptors such as the string descriptor + * for the serial number. + */ +#define USB_CFG_DEVICE_CLASS 0 +#define USB_CFG_DEVICE_SUBCLASS 0 +/* See USB specification if you want to conform to an existing device class. + * Class 0xff is "vendor specific". + */ +#define USB_CFG_INTERFACE_CLASS 3 /* HID */ +#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ +#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ +/* See USB specification if you want to conform to an existing device class or + * protocol. The following classes must be set at interface level: + * HID class is 3, no subclass and protocol required (but may be useful!) + * CDC class is 2, use subclass 2 and protocol 1 for ACM + */ +#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 +/* Define this to the length of the HID report descriptor, if you implement + * an HID device. Otherwise don't define it or define it to 0. + * If you use this define, you must add a PROGMEM character array named + * "usbHidReportDescriptor" to your code which contains the report descriptor. + * Don't forget to keep the array and this define in sync! + */ + +/* #define USB_PUBLIC static */ +/* Use the define above if you #include usbdrv.c instead of linking against it. + * This technique saves a couple of bytes in flash memory. + */ + +/* ------------------- Fine Control over USB Descriptors ------------------- */ +/* If you don't want to use the driver's default USB descriptors, you can + * provide our own. These can be provided as (1) fixed length static data in + * flash memory, (2) fixed length static data in RAM or (3) dynamically at + * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more + * information about this function. + * Descriptor handling is configured through the descriptor's properties. If + * no properties are defined or if they are 0, the default descriptor is used. + * Possible properties are: + * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched + * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is + * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if + * you want RAM pointers. + * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found + * in static memory is in RAM, not in flash memory. + * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), + * the driver must know the descriptor's length. The descriptor itself is + * found at the address of a well known identifier (see below). + * List of static descriptor names (must be declared PROGMEM if in flash): + * char usbDescriptorDevice[]; + * char usbDescriptorConfiguration[]; + * char usbDescriptorHidReport[]; + * char usbDescriptorString0[]; + * int usbDescriptorStringVendor[]; + * int usbDescriptorStringDevice[]; + * int usbDescriptorStringSerialNumber[]; + * Other descriptors can't be provided statically, they must be provided + * dynamically at runtime. + * + * Descriptor properties are or-ed or added together, e.g.: + * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) + * + * The following descriptors are defined: + * USB_CFG_DESCR_PROPS_DEVICE + * USB_CFG_DESCR_PROPS_CONFIGURATION + * USB_CFG_DESCR_PROPS_STRINGS + * USB_CFG_DESCR_PROPS_STRING_0 + * USB_CFG_DESCR_PROPS_STRING_VENDOR + * USB_CFG_DESCR_PROPS_STRING_PRODUCT + * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER + * USB_CFG_DESCR_PROPS_HID + * USB_CFG_DESCR_PROPS_HID_REPORT + * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) + * + * Note about string descriptors: String descriptors are not just strings, they + * are Unicode strings prefixed with a 2 byte header. Example: + * int serialNumberDescriptor[] = { + * USB_STRING_DESCRIPTOR_HEADER(6), + * 'S', 'e', 'r', 'i', 'a', 'l' + * }; + */ + +#define USB_CFG_DESCR_PROPS_DEVICE 0 +#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 +#define USB_CFG_DESCR_PROPS_STRINGS 0 +#define USB_CFG_DESCR_PROPS_STRING_0 0 +#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 +#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 +#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 +#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID 0 +#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 +#define USB_CFG_DESCR_PROPS_UNKNOWN 0 + +#define usbMsgPtr_t unsigned short +/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to + * a scalar type here because gcc generates slightly shorter code for scalar + * arithmetics than for pointer arithmetics. Remove this define for backward + * type compatibility or define it to an 8 bit type if you use data in RAM only + * and all RAM is below 256 bytes (tiny memory model in IAR CC). + */ + +/* ----------------------- Optional MCU Description ------------------------ */ + +/* The following configurations have working defaults in usbdrv.h. You + * usually don't need to set them explicitly. Only if you want to run + * the driver on a device which is not yet supported or with a compiler + * which is not fully supported (such as IAR C) or if you use a differnt + * interrupt than INT0, you may have to define some of these. + */ +/* #define USB_INTR_CFG MCUCR */ +/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE GIMSK */ +/* #define USB_INTR_ENABLE_BIT INT0 */ +/* #define USB_INTR_PENDING GIFR */ +/* #define USB_INTR_PENDING_BIT INTF0 */ +/* #define USB_INTR_VECTOR INT0_vect */ + +/* Set INT1 for D- falling edge to count SOF */ +/* #define USB_INTR_CFG EICRA */ +#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE EIMSK */ +#define USB_INTR_ENABLE_BIT INT1 +/* #define USB_INTR_PENDING EIFR */ +#define USB_INTR_PENDING_BIT INTF1 +#define USB_INTR_VECTOR INT1_vect diff --git a/keyboards/facew/config.h b/keyboards/facew/config.h index c952ca7372..b4fb0d4cdd 100644 --- a/keyboards/facew/config.h +++ b/keyboards/facew/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef FACEW_CONFIG_H -#define FACEW_CONFIG_H +#pragma once #include "config_common.h" @@ -40,7 +39,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define NO_BACKLIGHT_CLOCK #define BACKLIGHT_LEVELS 1 #define RGBLIGHT_ANIMATIONS - -#define NO_UART 1 - -#endif diff --git a/keyboards/facew/facew.c b/keyboards/facew/facew.c index 9c255c68f4..7ec56548b1 100644 --- a/keyboards/facew/facew.c +++ b/keyboards/facew/facew.c @@ -26,7 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <avr/pgmspace.h> #include "action_layer.h" -#include "i2c.h" +#include "i2c_master.h" #include "quantum.h" #ifdef RGBLIGHT_ENABLE @@ -42,7 +42,7 @@ void rgblight_set(void) { } i2c_init(); - i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM); + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); } #endif diff --git a/keyboards/facew/facew.h b/keyboards/facew/facew.h index 7d949de98e..b3356f2628 100644 --- a/keyboards/facew/facew.h +++ b/keyboards/facew/facew.h @@ -15,15 +15,14 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef FACEW_H -#define FACEW_H +#pragma once #include "quantum.h" #define LAYOUT_all( \ K61, K71, K72, K73, K74, K64, K65, K75, K76, K77, K78, K68, K66, K10, K60,\ K11, K01, K02, K03, K04, K14, K15, K05, K06, K07, K08, K18, K16, K20, \ - K12, K21, K22, K23, K24, K34, K35, K25, K26, K27, K28, K38, K40, \ + K12, K21, K22, K23, K24, K34, K35, K25, K26, K27, K28, K38, K48, K40, \ K19, K13, K41, K42, K43, K44, K54, K55, K45, K46, K47, K58, K49, K50,\ K09, K00, K39, K30, K59, K69, K57, K29\ ){ \ @@ -31,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. { KC_NO, K11, K12, K13, K14, K15, K16, KC_NO, K18, K19, K10}, \ { KC_NO, K21, K22, K23, K24, K25, K26, K27, K28, K29, K20}, \ { KC_NO, KC_NO, KC_NO, KC_NO, K34, K35, KC_NO, KC_NO, K38, K39, K30}, \ - { KC_NO, K41, K42, K43, K44, K45, K46, K47, KC_NO, K49, K40}, \ + { KC_NO, K41, K42, K43, K44, K45, K46, K47, K48, K49, K40}, \ { KC_NO, KC_NO, KC_NO, KC_NO, K54, K55, KC_NO, K57, K58, K59, K50}, \ { KC_NO, K61, KC_NO, KC_NO, K64, K65, K66, KC_NO, K68, K69, K60}, \ { KC_NO, K71, K72, K73, K74, K75, K76, K77, K78, KC_NO, KC_NO}, \ @@ -53,5 +52,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. { KC_NO, K61, KC_NO, KC_NO, K64, K65, K66, KC_NO, K68, K69, K60}, \ { KC_NO, K71, K72, K73, K74, K75, K76, K77, K78, KC_NO, KC_NO}, \ } - -#endif diff --git a/keyboards/facew/i2c.c b/keyboards/facew/i2c.c deleted file mode 100644 index a4f9521352..0000000000 --- a/keyboards/facew/i2c.c +++ /dev/null @@ -1,106 +0,0 @@ -/* -Copyright 2016 Luiz Ribeiro <luizribeiro@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/>. -*/ - -// Please do not modify this file - -#include <avr/io.h> -#include <util/twi.h> - -#include "i2c.h" - -void i2c_set_bitrate(uint16_t bitrate_khz) { - uint8_t bitrate_div = ((F_CPU / 1000l) / bitrate_khz); - if (bitrate_div >= 16) { - bitrate_div = (bitrate_div - 16) / 2; - } - TWBR = bitrate_div; -} - -void i2c_init(void) { - // set pull-up resistors on I2C bus pins - PORTC |= 0b11; - - i2c_set_bitrate(400); - - // enable TWI (two-wire interface) - TWCR |= (1 << TWEN); - - // enable TWI interrupt and slave address ACK - TWCR |= (1 << TWIE); - TWCR |= (1 << TWEA); -} - -uint8_t i2c_start(uint8_t address) { - // reset TWI control register - TWCR = 0; - - // begin transmission and wait for it to end - TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN); - while (!(TWCR & (1<<TWINT))); - - // check if the start condition was successfully transmitted - if ((TWSR & 0xF8) != TW_START) { - return 1; - } - - // transmit address and wait - TWDR = address; - TWCR = (1<<TWINT) | (1<<TWEN); - while (!(TWCR & (1<<TWINT))); - - // check if the device has acknowledged the READ / WRITE mode - uint8_t twst = TW_STATUS & 0xF8; - if ((twst != TW_MT_SLA_ACK) && (twst != TW_MR_SLA_ACK)) { - return 1; - } - - return 0; -} - -void i2c_stop(void) { - TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO); -} - -uint8_t i2c_write(uint8_t data) { - TWDR = data; - - // transmit data and wait - TWCR = (1<<TWINT) | (1<<TWEN); - while (!(TWCR & (1<<TWINT))); - - if ((TWSR & 0xF8) != TW_MT_DATA_ACK) { - return 1; - } - - return 0; -} - -uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length) { - if (i2c_start(address)) { - return 1; - } - - for (uint16_t i = 0; i < length; i++) { - if (i2c_write(data[i])) { - return 1; - } - } - - i2c_stop(); - - return 0; -} diff --git a/keyboards/facew/info.json b/keyboards/facew/info.json index 3f94985b2d..b7b6acca78 100644 --- a/keyboards/facew/info.json +++ b/keyboards/facew/info.json @@ -6,7 +6,7 @@ "height": 5, "layouts": { "LAYOUT_all": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":2, "w":1.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] }, "LAYOUT_60_ansi": { diff --git a/keyboards/facew/keymaps/default/keymap.c b/keyboards/facew/keymaps/default/keymap.c index a237f8489e..6e91fba238 100644 --- a/keyboards/facew/keymaps/default/keymap.c +++ b/keyboards/facew/keymaps/default/keymap.c @@ -21,21 +21,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT_all( KC_GESC, 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_BSLS, KC_GRV, 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_BSPC, - MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, KC_ENT, KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_RALT, KC_RGUI, KC_MENU, KC_RCTL ), [1] = LAYOUT_all( KC_GRV, 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_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_END, KC_DEL, - MO(1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, + MO(1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_PGDN, KC_TRNS, KC_TRNS, MO(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), [2] = LAYOUT_all( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - MO(1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + MO(1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), diff --git a/keyboards/facew/keymaps/mechmerlin/keymap.c b/keyboards/facew/keymaps/mechmerlin/keymap.c deleted file mode 100644 index 35b59e6a42..0000000000 --- a/keyboards/facew/keymaps/mechmerlin/keymap.c +++ /dev/null @@ -1,51 +0,0 @@ -/* -Copyright 2017 Luiz Ribeiro <luizribeiro@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 QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_all( - KC_GESC, 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_NO, KC_BSPC, - 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_LCTL, 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_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, TG(2), - KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, MO(1), KC_RALT, KC_RGUI, KC_RCTL - ), - [1] = LAYOUT_all( - KC_GRV, 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_NO, KC_DEL, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - MO(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS - ), - [2] = LAYOUT_all( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT - ), - - [3] = LAYOUT_all( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS - ), -}; - diff --git a/keyboards/facew/keymaps/mechmerlin/readme.md b/keyboards/facew/keymaps/mechmerlin/readme.md deleted file mode 100644 index eeb83b0a16..0000000000 --- a/keyboards/facew/keymaps/mechmerlin/readme.md +++ /dev/null @@ -1,18 +0,0 @@ -MechMerlin's FaceW Sprit Edition Layout -====================== - -This is the preferred 60% layout used by u/merlin36, host of the [MechMerlin YouTube channel](www.youtube.com/mechmerlin). - -## Keyboard Notes -- The FaceW Sprit Edition can be purchased on [mechanicalkeyboards.com](www.mechanicalkeyboards.com) -- Uses ps2avru instead of ps2avrgb -- To put in reset mode hold `q` while inserting the USB cable -- Use flashing instructions from ps2avrgb QMK port - -## Keymap Notes -- Does not support any form of inswitch lighting as Merlin hates them. -- Arrow toggle switch to the right of right shift -- Reset is FN + Left Shift + R - -### Build -To build this keymap, simply run `make facew:mechmerlin` from the qmk_firmware directory. diff --git a/keyboards/facew/matrix.c b/keyboards/facew/matrix.c deleted file mode 100644 index 57aa36b5ff..0000000000 --- a/keyboards/facew/matrix.c +++ /dev/null @@ -1,106 +0,0 @@ -/* -Copyright 2017 Luiz Ribeiro <luizribeiro@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 <avr/io.h> -#include <util/delay.h> - -#include "matrix.h" - -#ifndef DEBOUNCE -#define DEBOUNCE 5 -#endif - -static uint8_t debouncing = DEBOUNCE; - -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -void matrix_init(void) { - // all outputs for rows high - DDRB = 0xFF; - PORTB = 0xFF; - // all inputs for columns - DDRA = 0x00; - DDRC &= ~(0x111111<<2); - DDRD &= ~(1<<PIND7); - // all columns are pulled-up - PORTA = 0xFF; - PORTC |= (0b111111<<2); - PORTD |= (1<<PIND7); - - // initialize matrix state: all keys off - for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - matrix[row] = 0x00; - matrix_debouncing[row] = 0x00; - } -} - -void matrix_set_row_status(uint8_t row) { - DDRB = (1 << row); - PORTB = ~(1 << row); -} - -uint8_t bit_reverse(uint8_t x) { - x = ((x >> 1) & 0x55) | ((x << 1) & 0xaa); - x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc); - x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0); - return x; -} - -uint8_t matrix_scan(void) { - for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - matrix_set_row_status(row); - _delay_us(5); - - matrix_row_t cols = ( - // cols 0..7, PORTA 0 -> 7 - (~PINA) & 0xFF - ) | ( - // cols 8..13, PORTC 7 -> 0 - bit_reverse((~PINC) & 0xFF) << 8 - ) | ( - // col 14, PORTD 7 - ((~PIND) & (1 << PIND7)) << 7 - ); - - if (matrix_debouncing[row] != cols) { - matrix_debouncing[row] = cols; - debouncing = DEBOUNCE; - } - } - - if (debouncing) { - if (--debouncing) { - _delay_ms(1); - } else { - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = matrix_debouncing[i]; - } - } - } - - matrix_scan_user(); - - return 1; -} - -inline matrix_row_t matrix_get_row(uint8_t row) { - return matrix[row]; -} - -void matrix_print(void) { -} diff --git a/keyboards/facew/readme.md b/keyboards/facew/readme.md index 578dcf8888..b749d18d29 100644 --- a/keyboards/facew/readme.md +++ b/keyboards/facew/readme.md @@ -2,20 +2,12 @@ A 60% no frills keyboard. -The FaceW is a special run of the WKL B.Face sourced from Sprit that doesn't have underglow RGB LEDs -but does have in switch LEDs. Also unlike the B.Face, it is based on ps2avru instead of ps2avrGB. It -is designed and manufactured in Korea. It originally uses BootMapperClient for programming but -can now also use QMK. +The FaceW is a special run of the WKL B.Face sourced from Sprit that doesn't have underglow RGB LEDs but does have in switch LEDs. Also unlike the B.Face, it is based on ps2avru instead of ps2avrGB. It is designed and manufactured in Korea. Keyboard Maintainer: [MechMerlin](www.github.com/mechmerlin) Hardware Supported: FaceW Sprit Edition PCB Hardware Availability: https://mechanicalkeyboards.com/shop/index.php?l=product_detail&p=1352 -## Keyboard Notes -- The FaceW Sprit Edition can be purchased on [mechanicalkeyboards.com](www.mechanicalkeyboards.com) -- Uses ps2avru instead of ps2avrgb -- To put in reset mode hold `q` while inserting the USB cable - Make example for this keyboard (after setting up your build environment): make facew:default @@ -24,6 +16,8 @@ Flashing ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. +**Reset Key:** To put the FaceW into reset, hold `q` (`K01`) while plugging in. + Windows: 1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). 2. Place your keyboard into reset. @@ -42,12 +36,12 @@ macOS: ``` 3. Install the following packages: ``` - brew install python - brew install pyusb - brew install --HEAD`https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb + brew install python3 + pip3 install pyusb + brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb 4. Place your keyboard into reset. 5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. -See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. +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/facew/rules.mk b/keyboards/facew/rules.mk index 77d29b3320..b939b0fd24 100644 --- a/keyboards/facew/rules.mk +++ b/keyboards/facew/rules.mk @@ -31,20 +31,19 @@ F_CPU = 12000000 BOOTLOADER = bootloadHID # build options -BOOTMAGIC_ENABLE = yes +BOOTMAGIC_ENABLE = no MOUSEKEY_ENABLE = yes EXTRAKEY_ENABLE = yes CONSOLE_ENABLE = yes COMMAND_ENABLE = yes -BACKLIGHT_ENABLE = no -RGBLIGHT_ENABLE = no +BACKLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = yes RGBLIGHT_CUSTOM_DRIVER = yes OPT_DEFS = -DDEBUG_LEVEL=0 # custom matrix setup -CUSTOM_MATRIX = yes -SRC = matrix.c i2c.c +SRC = i2c_master.c # programming options PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/facew/usbconfig.h b/keyboards/facew/usbconfig.h index d2d848fcdc..f3d663f8a6 100644 --- a/keyboards/facew/usbconfig.h +++ b/keyboards/facew/usbconfig.h @@ -8,8 +8,7 @@ * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ */ -#ifndef __usbconfig_h_included__ -#define __usbconfig_h_included__ +#pragma once #include "config.h" @@ -241,8 +240,8 @@ section at the end of this file). #define USB_CFG_DEVICE_VERSION 0x00, 0x02 /* Version number of the device: Minor number first, then major number. */ -#define USB_CFG_VENDOR_NAME 'w', 'i', 'n', 'k', 'e', 'y', 'l', 'e', 's', 's', '.', 'k', 'r' -#define USB_CFG_VENDOR_NAME_LEN 13 +#define USB_CFG_VENDOR_NAME 'S', 'p', 'r', 'i', 't' +#define USB_CFG_VENDOR_NAME_LEN 5 /* These two values define the vendor name returned by the USB device. The name * must be given as a list of characters under single quotes. The characters * are interpreted as Unicode (UTF-16) entities. @@ -251,8 +250,8 @@ section at the end of this file). * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for * details. */ -#define USB_CFG_DEVICE_NAME 'p', 's', '2', 'a', 'v', 'r', 'G', 'B' -#define USB_CFG_DEVICE_NAME_LEN 8 +#define USB_CFG_DEVICE_NAME 'F', 'a', 'c', 'e', 'W' +#define USB_CFG_DEVICE_NAME_LEN 5 /* Same as above for the device name. If you don't want a device name, undefine * the macros. See the file USB-IDs-for-free.txt before you assign a name if * you use a shared VID/PID. @@ -392,5 +391,3 @@ section at the end of this file). /* #define USB_INTR_PENDING EIFR */ #define USB_INTR_PENDING_BIT INTF1 #define USB_INTR_VECTOR INT1_vect - -#endif /* __usbconfig_h_included__ */ diff --git a/keyboards/fc660c/keymaps/default/config.h b/keyboards/fc660c/keymaps/default/config.h index 596198be10..b89b05009a 100644 --- a/keyboards/fc660c/keymaps/default/config.h +++ b/keyboards/fc660c/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/fc980c/README.md b/keyboards/fc980c/README.md index 768d7d3a3c..61dcf6ee96 100644 --- a/keyboards/fc980c/README.md +++ b/keyboards/fc980c/README.md @@ -155,7 +155,7 @@ Datasheets - AD5258: http://www.analog.com/media/en/technical-documentation/data-sheets/AD5258.pdf - JST S5B-PH-SM4: http://www.jst-mfg.com/product/pdf/eng/ePH.pdf - Hirose UX60SC-MB-5S8: https://www.hirose.com/product/en/products/UX/UX60SC-MB-5S8%2880%29/ -- Tr(E42) for LED?: http://cj-elec.com/txUpfile/2013614923661845.pdf +- Tr(E42) for LED?: http://www.bklighting.com/cimages/specs-758.pdf - TYU TU1252WNR-05S: http://php2.twinner.com.tw/files/goodjob/TY1252series.pdf diff --git a/keyboards/fc980c/keymaps/default/config.h b/keyboards/fc980c/keymaps/default/config.h index 596198be10..20fd511474 100644 --- a/keyboards/fc980c/keymaps/default/config.h +++ b/keyboards/fc980c/keymaps/default/config.h @@ -14,11 +14,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "config_common.h" // place overrides here - -#endif diff --git a/keyboards/fortitude60/keymaps/default/config.h b/keyboards/fortitude60/keymaps/default/config.h index 1748373481..b6c6273d92 100644 --- a/keyboards/fortitude60/keymaps/default/config.h +++ b/keyboards/fortitude60/keymaps/default/config.h @@ -15,10 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once #define USE_SERIAL @@ -34,5 +31,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. /* #define RGBLIGHT_HUE_STEP 8 */ /* #define RGBLIGHT_SAT_STEP 8 */ /* #define RGBLIGHT_VAL_STEP 8 */ - -#endif diff --git a/keyboards/fortitude60/keymaps/default/keymap.c b/keyboards/fortitude60/keymaps/default/keymap.c index 5c3508b3d4..d20ca40fbb 100644 --- a/keyboards/fortitude60/keymaps/default/keymap.c +++ b/keyboards/fortitude60/keymaps/default/keymap.c @@ -1,5 +1,4 @@ #include QMK_KEYBOARD_H -#include "eeconfig.h" extern keymap_config_t keymap_config; diff --git a/keyboards/four_banger/keymaps/default/keymap.c b/keyboards/four_banger/keymaps/default/keymap.c index 3fea0afd4f..fc04e0fb1b 100644 --- a/keyboards/four_banger/keymaps/default/keymap.c +++ b/keyboards/four_banger/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -#include "four_banger.h" +#include QMK_KEYBOARD_H enum custom_keycodes { UP_URL = SAFE_RANGE diff --git a/keyboards/georgi/config.h b/keyboards/georgi/config.h new file mode 100644 index 0000000000..b35762fbcf --- /dev/null +++ b/keyboards/georgi/config.h @@ -0,0 +1,74 @@ +/* +Copyright 2012 Jun Wako <wakojun@gmail.com> +Copyright 2013 Oleg Kostyuk <cub.uanic@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/>. +*/ + +// Copy and worked on with love from the EZ team + +#pragma once +#include "config_common.h" + +/* Defaults */ + +#define VERSION "Alpha 01: Ted " +#define VERBOSE + +#define FORCE_NKRO +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION +#define NO_DEBUG +#define NO_ACTION_ONESHOT +#define NO_ACTION_FUNCTION + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x1337 +#define DEVICE_VER 0x0001 +#define MANUFACTURER g Heavy Industries +#define PRODUCT Georgi +#define DESCRIPTION QMK keyboard firmware for Georgi + +/* key matrix size */ +#define MATRIX_ROWS 14 +#define MATRIX_ROWS_PER_SIDE (MATRIX_ROWS / 2) +#define MATRIX_COLS 4 + +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_MAX_SPEED 7 +#define MOUSEKEY_WHEEL_DELAY 0 +#define TAPPING_TOGGLE 2 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +#define TAPPING_TERM 200 +#define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.) + +/* 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + get_mods() == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \ + get_mods() == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \ +) + +#define DEBOUNCE 5 +#define USB_MAX_POWER_CONSUMPTION 500 diff --git a/keyboards/georgi/georgi.c b/keyboards/georgi/georgi.c new file mode 100644 index 0000000000..8866886ce7 --- /dev/null +++ b/keyboards/georgi/georgi.c @@ -0,0 +1,68 @@ +#include QMK_KEYBOARD_H + +bool i2c_initialized = 0; +i2c_status_t mcp23018_status = 0x20; + +void matrix_init_kb(void) { + steno_set_mode(STENO_MODE_GEMINI); // or STENO_MODE_BOLT + + // (tied to Vcc for hardware convenience) + //DDRB &= ~(1<<4); // set B(4) as input + //PORTB &= ~(1<<4); // set B(4) internal pull-up disabled + + // unused pins - C7, D4, D5, D7, E6 + // set as input with internal pull-up enabled + DDRC &= ~(1<<7); + DDRD &= ~(1<<5 | 1<<4 | 1<<6 | 1<<7); + DDRE &= ~(1<<6); + PORTC |= (1<<7); + PORTD |= (1<<5 | 1<<4 | 1<<6 | 1<<7); + PORTE |= (1<<6); + + matrix_init_user(); +} + + +uint8_t init_mcp23018(void) { + print("starting init"); + mcp23018_status = 0x20; + + // I2C subsystem + + // uint8_t sreg_prev; + // sreg_prev=SREG; + // cli(); + + if (i2c_initialized == 0) { + i2c_init(); // on pins D(1,0) + i2c_initialized = true; + _delay_ms(1000); + } + // i2c_init(); // on pins D(1,0) + // _delay_ms(1000); + + // set pin direction + // - unused : input : 1 + // - input : input : 1 + // - driving : output : 0 + mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(IODIRA, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b10000000, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b11111111, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + i2c_stop(); + + // set pull-up + // - unused : on : 1 + // - input : on : 1 + // - driving : off : 0 + mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(GPPUA, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b10000000, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b11111111, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + +out: + i2c_stop(); + // SREG=sreg_prev; + //uprintf("Init %x\n", mcp23018_status); + return mcp23018_status; +} diff --git a/keyboards/georgi/georgi.h b/keyboards/georgi/georgi.h new file mode 100644 index 0000000000..df6bb6ea9a --- /dev/null +++ b/keyboards/georgi/georgi.h @@ -0,0 +1,82 @@ +#pragma once +#include <util/delay.h> +#include <stdint.h> +#include <stdbool.h> +#include "quantum.h" +#include "i2c_master.h" +#include "matrix.h" + + +extern i2c_status_t mcp23018_status; +#define ERGODOX_EZ_I2C_TIMEOUT 1000 +#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n)) +#define CPU_16MHz 0x00 + +// I2C aliases and register addresses (see "mcp23018.md") +//#define I2C_ADDR 0b0100000 +#define I2C_ADDR 0x20 +#define I2C_ADDR_WRITE ( (I2C_ADDR<<1) | I2C_WRITE ) +#define I2C_ADDR_READ ( (I2C_ADDR<<1) | I2C_READ ) +#define IODIRA 0x00 // i/o direction register +#define IODIRB 0x01 +#define GPPUA 0x0C // GPIO pull-up resistor register +#define GPPUB 0x0D +#define GPIOA 0x12 // general purpose i/o port register (write modifies OLAT) +#define GPIOB 0x13 +#define OLATA 0x14 // output latch register +#define OLATB 0x15 + +void init_ergodox(void); +uint8_t init_mcp23018(void); + +/* ---------- LEFT HAND ----------- ---------- RIGHT HAND ---------- */ +#define LAYOUT_georgi( \ + L00,L01,L02,L03,L04,L05, R00,R01,R02,R03,R04,R05, \ + L10,L11,L12,L13,L14,L15, R10,R11,R12,R13,R14,R15, \ + L20,L21,L22, R20,R21,R22) \ + \ + { \ + { KC_NO, R00, R10, R21}, \ + { KC_NO, R01, R11, R20}, \ + { KC_NO, R02, R12, R22}, \ + { KC_NO, R03, R13, KC_NO}, \ + { KC_NO, R04, R14, KC_NO}, \ + { KC_NO, R05, R15, KC_NO}, \ + { KC_NO, KC_NO, KC_NO, KC_NO}, \ + \ + { KC_NO, L05, L15, L22}, \ + { KC_NO, L04, L14, L21}, \ + { KC_NO, L03, L13, L20}, \ + { KC_NO, L02, L12, KC_NO}, \ + { KC_NO, L01, L11, KC_NO}, \ + { KC_NO, L00, L10, KC_NO}, \ + { KC_NO, KC_NO, KC_NO, KC_NO}, \ + \ +} + +/* ---------- LEFT HAND ----------- ---------- RIGHT HAND ---------- +#define LAYOUT_GERGO( \ + L00,L01,L02,L03,L04,L05, R00,R01,R02,R03,R04,R05, \ + L10,L11,L12,L13,L14,L15,L16, R10,R11,R12,R13,R14,R15,R16, \ + L20,L21,L22,L23,L24,L25,L26, R20,R21,R22,R23,R24,R25,R26, \ + L31,L32, R33,R34, \ + L30, R30, \ + L33,L34, R31,R32) \ + \ + { \ + { KC_NO, L16, L26, L30}, \ + { L05, L15, L25, L34}, \ + { L04, L14, L24, L33}, \ + { L03, L13, L23, L32}, \ + { L02, L12, L22, L31}, \ + { L01, L11, L21, KC_NO}, \ + { L00, L10, L20, KC_NO}, \ + \ + { KC_NO, R10, R20, R30}, \ + { R00, R11, R21, R31}, \ + { R01, R12, R22, R32}, \ + { R02, R13, R23, R33}, \ + { R03, R14, R24, R34}, \ + { R04, R15, R25, KC_NO}, \ + { R05, R16, R26, KC_NO}, \ +} */ diff --git a/keyboards/georgi/info.json b/keyboards/georgi/info.json new file mode 100644 index 0000000000..d0752e2cd3 --- /dev/null +++ b/keyboards/georgi/info.json @@ -0,0 +1,133 @@ +{ + "keyboard_name": "Georgi", + "url": "http://gboards.ca", + "maintainer": "germ", + "width": 13.2, + "height": 3.68, + "layouts": { + "LAYOUT_georgi": { + "layout": [ + { + "x": 0.05, + "y": 0.54 + }, + { + "x": 1.06, + "y": 0.55 + }, + { + "x": 2.06, + "y": 0.29 + }, + { + "x": 3.05, + "y": 0.16 + }, + { + "x": 4.06, + "y": 0.41 + }, + { + "x": 5.06, + "y": 0.54 + }, + { + "x": 7.1899999999999995, + "y": 0.41 + }, + { + "x": 8.2, + "y": 0.3 + }, + { + "x": 9.2, + "y": 0.05 + }, + { + "x": 10.2, + "y": 0.29 + }, + { + "x": 11.2, + "y": 0.43 + }, + { + "x": 12.2, + "y": 0.42 + }, + { + "x": 0.05, + "y": 1.54 + }, + { + "x": 1.06, + "y": 1.54 + }, + { + "x": 2.06, + "y": 1.28 + }, + { + "x": 3.05, + "y": 1.16 + }, + { + "x": 4.06, + "y": 1.4 + }, + { + "x": 5.06, + "y": 1.54 + }, + { + "x": 7.1899999999999995, + "y": 1.4 + }, + { + "x": 8.2, + "y": 1.28 + }, + { + "x": 9.2, + "y": 1.04 + }, + { + "x": 10.2, + "y": 1.28 + }, + { + "x": 11.2, + "y": 1.42 + }, + { + "x": 12.2, + "y": 1.42 + }, + { + "x": 3.05, + "y": 2.67 + }, + { + "x": 4.06, + "y": 2.68 + }, + { + "x": 5.06, + "y": 2.68 + }, + { + "x": 7.19, + "y": 2.67 + }, + { + "x": 8.2, + "y": 2.67 + }, + { + "x": 9.2, + "y": 2.66 + } + ] + } + } +} diff --git a/keyboards/georgi/keymaps/default/keymap.c b/keyboards/georgi/keymaps/default/keymap.c new file mode 100644 index 0000000000..c3d69eb8aa --- /dev/null +++ b/keyboards/georgi/keymaps/default/keymap.c @@ -0,0 +1,229 @@ +/* + * Good on you for modifying your layout, this is the most nonQMK layout you will come across + * There are three modes, Steno (the default), QWERTY (Toggleable) and a Momentary symbol layer + * + * Don't modify the steno layer directly, instead add chords using the keycodes and macros + * from sten.h to the layout you want to modify. + * + * Observe the comment above processQWERTY! + * + * http://docs.gboards.ca + */ + +#include QMK_KEYBOARD_H +#include "sten.h" +#include "keymap_steno.h" +#define IGNORE_MOD_TAP_INTERRUPT + +int getKeymapCount(void); + +// Proper Layers +#define FUNCT (LSD | LK | LP | LH) +#define MEDIA (LSD | LK | LW | LR) +#define MOVE (ST1 | ST2) + +/* Keyboard Layout + * ,---------------------------------. ,------------------------------. + * | FN | LSU | LFT | LP | LH | ST1 | | ST3 | RF | RP | RL | RT | RD | + * |-----+-----+-----+----+----|-----| |-----|----+----+----+----+----| + * | PWR | LSD | LK | LW | LR | ST2 | | ST4 | RR | RG | RB | RS | RZ | + * `---------------------------------' `------------------------------' + * ,---------------, .---------------. + * | NUM | LA | LO | | RE | RU | NUM | + * `---------------' `---------------' + */ + +// YOU MUST ORDER THIS! +// P Will return from processing on the first match it finds. Therefore +// PJ Will run the requested action, remove the matched chord and continue +// +// First any chords that would conflict with PJs need to be checked, then PJs, lastly Ps. +// For all chords should be ordered by length in their section! +// +// http://docs.gboards.ca +bool processQwerty(void) { + // Place P's that would be trashed by PJ's here + P( RT | RS | RD | RZ | NUM, SEND_STRING(VERSION); SEND_STRING(__DATE__)); + P( NUM | LA | LO | RE | RU, SEND(KC_MPLY)); + P( ST1 | ST2 | ST3 | ST4, SEND(KC_BSPC)); + + // Thumb Chords + P( LA | LO | RE | RU, SEND(KC_CAPS)); + P( LA | RU, SEND(KC_ESC)); + PJ( LO | RE, SEND(KC_LCTL)); + PJ( NUM | LA | RU, SEND(KC_LCTL); SEND(KC_LSFT)); + PJ( NUM | LA | RE, SEND(KC_LCTL); SEND(KC_LSFT); SEND(KC_LALT)); + + // Mods + PJ( RT | RD | RS | RZ, SEND(KC_LGUI)); + PJ( RT | RD, SEND(KC_LCTL)); + PJ( RS | RZ, SEND(KC_LALT)); + PJ( LA | NUM, SEND(KC_LCTL)); + PJ( LA | LO, SEND(KC_LALT)); + PJ( LO, SEND(KC_LSFT)); + + // Function Layer + P( FUNCT | RF | RR, SEND(KC_F5)); + P( FUNCT | RP | RB, SEND(KC_F6)); + P( FUNCT | RL | RG, SEND(KC_F7)); + P( FUNCT | RT | RS, SEND(KC_F8)); + P( FUNCT | RF, SEND(KC_F1)); + P( FUNCT | RP, SEND(KC_F2)); + P( FUNCT | RL, SEND(KC_F3)); + P( FUNCT | RT, SEND(KC_F4)); + P( FUNCT | RR, SEND(KC_F9)); + P( FUNCT | RG, SEND(KC_F10)); + P( FUNCT | RB, SEND(KC_F11)); + P( FUNCT | RS, SEND(KC_F12)); + + // Movement Layer + P( MOVE | RF, SEND(KC_LEFT)); + P( MOVE | RP, SEND(KC_DOWN)); + P( MOVE | RL, SEND(KC_UP)); + P( MOVE | RT, SEND(KC_RIGHT)); + P( MOVE | ST3, SEND(KC_PGUP)); + P( MOVE | ST4, SEND(KC_PGDN)); + + // Media Layer + P( MEDIA | RF, SEND(KC_MPRV)); + P( MEDIA | RP, SEND(KC_MPLY)); + P( MEDIA | RL, SEND(KC_MPLY)); + P( MEDIA | RT, SEND(KC_MNXT)); + P( MEDIA | RD, SEND(KC_VOLU)); + P( MEDIA | RZ, SEND(KC_VOLD)); + P( MEDIA | RS, SEND(KC_MUTE)); + + // Mouse Keys + P( LP | LH, clickMouse(KC_MS_BTN1)); + P( LW | LR, clickMouse(KC_MS_BTN2)); + + // Number Row + P( NUM | LSU, SEND(KC_1)); + P( NUM | LFT, SEND(KC_2)); + P( NUM | LP, SEND(KC_3)); + P( NUM | LH, SEND(KC_4)); + P( NUM | ST1, SEND(KC_5)); + P( NUM | ST3, SEND(KC_6)); + P( NUM | RF, SEND(KC_7)); + P( NUM | RP, SEND(KC_8)); + P( NUM | RL, SEND(KC_9)); + P( NUM | RT, SEND(KC_0)); + P( NUM | LA, SEND(KC_5)); + P( NUM | RT, SEND(KC_0)); + + // Specials + P( LA | NUM, SEND(KC_ESC)); + P( RU | NUM, SEND(KC_TAB)); + P( RE | RU, SEND(KC_BSPC)); + P( RD | RZ, SEND(KC_ENT)); + P( RE, SEND(KC_ENT)); + P( RD, SEND(KC_BSPC)); + P( NUM, SEND(KC_BSPC)); + P( LA, SEND(KC_SPC)); + P( RU, SEND(KC_SPC)); + P( RZ, SEND(KC_ESC)); + + // Letters + P( LSU | LSD, SEND(KC_A)); + P( LFT | LK, SEND(KC_S)); + P( LP | LW, SEND(KC_D)); + P( LH | LR, SEND(KC_F)); + P( ST1 | ST2, SEND(KC_G)); + P( ST3 | ST4, SEND(KC_H)); + P( RF | RR, SEND(KC_J)); + P( RT | RS, SEND(KC_SCLN)) + P( RG | RL, SEND(KC_L)); + P( RP | RB, SEND(KC_K)); + P( LSU, SEND(KC_Q)); + P( LSD, SEND(KC_Z)); + P( LFT, SEND(KC_W)); + P( LK, SEND(KC_X)); + P( LP, SEND(KC_E)); + P( LW, SEND(KC_C)); + P( LH, SEND(KC_R)); + P( LR, SEND(KC_V)); + P( ST1, SEND(KC_T)); + P( ST2, SEND(KC_B)); + P( ST3, SEND(KC_Y)); + P( ST4, SEND(KC_N)); + P( RF, SEND(KC_U)); + P( RR, SEND(KC_M)); + P( RP, SEND(KC_I)); + P( RB, SEND(KC_COMM)); + P( RL, SEND(KC_O)); + P( RG, SEND(KC_DOT)); + P( RT, SEND(KC_P)); + P( RS, SEND(KC_SLSH)); + + // Symbols and Numbers + P( PWR | RE | RU, SEND(KC_ENT)); + P( PWR | LA | LO, SEND(KC_SPC)); + P( PWR | LP | LW, SEND(KC_LSFT); SEND(KC_9)); // ( + P( PWR | LH | LR, SEND(KC_LSFT); SEND(KC_0)); // ) + P( PWR | ST1 | ST2, SEND(KC_GRV)); // ` + P( PWR | RD | RZ, SEND(KC_ESC)); + P( PWR | LSU | LSD, SEND(KC_LSFT); SEND(KC_3)); // # + P( PWR | LFT | LK, SEND(KC_LSFT); SEND(KC_4)); // $ + P( PWR | LSU, SEND(KC_LSFT); SEND(KC_1)); // ! + P( PWR | LSD, SEND(KC_LSFT); SEND(KC_5)); // % + P( PWR | LFT, SEND(KC_LSFT); SEND(KC_2)); // @ + P( PWR | LK, SEND(KC_LSFT); SEND(KC_6)); // ^ + P( PWR | LP, SEND(KC_LSFT); SEND(KC_LBRC)); // { + P( PWR | LW, SEND(KC_LBRC)); + P( PWR | LH, SEND(KC_LSFT); SEND(KC_RBRC)); // } + P( PWR | LR, SEND(KC_RBRC)); + P( PWR | ST1, SEND(KC_LSFT); SEND(KC_BSLS)); // | + P( PWR | ST2, SEND(KC_LSFT); SEND(KC_GRV)); // ~ + P( PWR | ST3, SEND(KC_QUOT)); + P( PWR | ST4, SEND(KC_LSFT); SEND(KC_QUOT)); // " + P( PWR | RF, SEND(KC_KP_PLUS)); + P( PWR | RR, SEND(KC_LSFT); SEND(KC_7)); // & + P( PWR | RP, SEND(KC_MINS)); + P( PWR | RB, SEND(KC_EQL)); + P( PWR | RL, SEND(KC_SLSH)); + P( PWR | RG, SEND(KC_COMM)); + P( PWR | RT, SEND(KC_PAST)); + P( PWR | RS, SEND(KC_DOT)); + P( PWR | RD, SEND(KC_TAB)); + P( PWR | LA, SEND(KC_SCLN)); + P( PWR | LO, SEND(KC_SLSH)); + P( PWR | RE, SEND(KC_SCLN)); + P( PWR | RU, SEND(KC_SLSH)); + + + // If we make here, send as a steno chord + // If plover is running we can hook that host side + return false; +} + +#define STENO_LAYER 0 +#define GAMING 1 +#define GAMING_2 2 + +// "Layers" +// Steno layer should be first in your map. +// When PWR | FN | RR | RG | RB | RS is pressed, the layer is increased to the next map. You must return to STENO_LAYER at the end. +// If you have only a single layer, you must set SINGLELAYER = yes in your rules.mk, otherwise you may experince undefined behaviour + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +// Main layer, everything goes through here +[STENO_LAYER] = LAYOUT_georgi( +STN_FN, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, +STN_PWR, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR, + STN_N1, STN_A, STN_O, STN_E, STN_U, STN_N1) +, +// Gaming layer with Numpad, Very limited +[GAMING] = LAYOUT_georgi( +KC_LSFT, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ENT, +KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_DQUO, +KC_LALT, KC_SPC, LT(GAMING_2, KC_ENT), KC_DEL, KC_ASTR, TO(STENO_LAYER)), + +[GAMING_2] = LAYOUT_georgi( +KC_LSFT, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, +KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT, + KC_LALT, KC_SPC, KC_ENT, KC_DEL, KC_ASTR, TO(STENO_LAYER)) +}; + +int getKeymapCount(void) { + return sizeof(keymaps)/sizeof(keymaps[0]); +} diff --git a/keyboards/georgi/keymaps/default/readme.md b/keyboards/georgi/keymaps/default/readme.md new file mode 100644 index 0000000000..f9da34b024 --- /dev/null +++ b/keyboards/georgi/keymaps/default/readme.md @@ -0,0 +1,11 @@ +# Georgi QWERTY/Steno firmware + +This is the default keymap for Georgi, it's based heavily off of the naps62 ErgoDox and the Gergo layout. +It is both a ergonomic and programmer friendly keymap. + +Ideally you should copy this directory and make your changes there. If you come up with a good layout submit a PR! + +## Space issues +If you find yourself running out of space for dictionary entries, disabling mousekeys in rules.mk will save +you about 4k for entries! +Get a free 1k by deleting the Gaming layers from the keymap! diff --git a/keyboards/georgi/keymaps/default/rules.mk b/keyboards/georgi/keymaps/default/rules.mk new file mode 100644 index 0000000000..2973c45918 --- /dev/null +++ b/keyboards/georgi/keymaps/default/rules.mk @@ -0,0 +1,27 @@ +#---------------------------------------------------------------------------- +# make georgi:extrakey:dfu +# Make sure you have dfu-programmer installed! +#---------------------------------------------------------------------------- + +#Debug options +VERBOSE = yes +CONSOLE_ENABLE = yes +DEBUG_MATRIX_SCAN_RATE = no +DEBUG_MATRIX = no +KEYBOARD_SHARED_EP = yes +CUSTOM_MATRIX = yes +MOUSEKEY_ENABLE = yes +SINGLE_LAYER = no + + +# A bunch of stuff that you shouldn't touch unless you +# know what you're doing. +# +# No touchy, capiche? +SRC += matrix.c i2c_master.c +ifeq ($(strip $(DEBUG_MATRIX)), yes) + OPT_DEFS += -DDEBUG_MATRIX +endif +ifeq ($(strip $(SINGLE_LAYER)), yes) + OPT_DEFS += -DSINGLE_LAYER +endif diff --git a/keyboards/georgi/keymaps/template/keymap.c b/keyboards/georgi/keymaps/template/keymap.c new file mode 100644 index 0000000000..b17d7ed9f7 --- /dev/null +++ b/keyboards/georgi/keymaps/template/keymap.c @@ -0,0 +1,216 @@ +/* + * Good on you for modifying your layout, this is the most nonQMK layout you will come across + * There are three modes, Steno (the default), QWERTY (Toggleable) and a Momentary symbol layer + * + * Don't modify the steno layer directly, instead add chords using the keycodes and macros + * from sten.h to the layout you want to modify. + * + * Observe the comment above processQWERTY! + * + * http://docs.gboards.ca + */ + +#include QMK_KEYBOARD_H +#include "sten.h" +#include "keymap_steno.h" +#define IGNORE_MOD_TAP_INTERRUPT + +int getKeymapCount(void); + +// Proper Layers +#define FUNCT (LSD | LK | LP | LH) +#define MEDIA (LSD | LK | LW | LR) +#define MOVE (ST1 | ST2) + +/* Keyboard Layout + * ,---------------------------------. ,------------------------------. + * | FN | LSU | LFT | LP | LH | ST1 | | ST3 | RF | RP | RL | RT | RD | + * |-----+-----+-----+----+----|-----| |-----|----+----+----+----+----| + * | PWR | LSD | LK | LW | LR | ST2 | | ST4 | RR | RG | RB | RS | RZ | + * `---------------------------------' `------------------------------' + * ,---------------, .---------------. + * | NUM | LA | LO | | RE | RU | NUM | + * `---------------' `---------------' + */ + +// YOU MUST ORDER THIS! +// P Will return from processing on the first match it finds. Therefore +// PJ Will run the requested action, remove the matched chord and continue +// +// First any chords that would conflict with PJs need to be checked, then PJs, lastly Ps. +// For all chords should be ordered by length in their section! +// +// http://docs.gboards.ca +bool processQwerty(void) { + // Place P's that would be trashed by PJ's here + P( RT | RS | RD | RZ | NUM, SEND_STRING(VERSION); SEND_STRING(__DATE__)); + P( NUM | LA | LO | RE | RU, SEND(KC_MPLY)); + P( ST1 | ST2 | ST3 | ST4, SEND(KC_BSPC)); + + // Thumb Chords + P( LA | LO | RE | RU, SEND(KC_CAPS)); + P( LA | RU, SEND(KC_ESC)); + PJ( LO | RE, SEND(KC_LCTL)); + PJ( NUM | LA | RU, SEND(KC_LCTL); SEND(KC_LSFT)); + PJ( NUM | LA | RE, SEND(KC_LCTL); SEND(KC_LSFT); SEND(KC_LALT)); + + // Mods + PJ( RT | RD | RS | RZ, SEND(KC_LGUI)); + PJ( RT | RD, SEND(KC_LCTL)); + PJ( RS | RZ, SEND(KC_LALT)); + PJ( LA | NUM, SEND(KC_LCTL)); + PJ( LA | LO, SEND(KC_LALT)); + PJ( LO, SEND(KC_LSFT)); + + // Function Layer + P( FUNCT | RF | RR, SEND(KC_F5)); + P( FUNCT | RP | RB, SEND(KC_F6)); + P( FUNCT | RL | RG, SEND(KC_F7)); + P( FUNCT | RT | RS, SEND(KC_F8)); + P( FUNCT | RF, SEND(KC_F1)); + P( FUNCT | RP, SEND(KC_F2)); + P( FUNCT | RL, SEND(KC_F3)); + P( FUNCT | RT, SEND(KC_F4)); + P( FUNCT | RR, SEND(KC_F9)); + P( FUNCT | RG, SEND(KC_F10)); + P( FUNCT | RB, SEND(KC_F11)); + P( FUNCT | RS, SEND(KC_F12)); + + // Movement Layer + P( MOVE | RF, SEND(KC_LEFT)); + P( MOVE | RP, SEND(KC_DOWN)); + P( MOVE | RL, SEND(KC_UP)); + P( MOVE | RT, SEND(KC_RIGHT)); + P( MOVE | ST3, SEND(KC_PGUP)); + P( MOVE | ST4, SEND(KC_PGDN)); + + // Media Layer + P( MEDIA | RF, SEND(KC_MPRV)); + P( MEDIA | RP, SEND(KC_MPLY)); + P( MEDIA | RL, SEND(KC_MPLY)); + P( MEDIA | RT, SEND(KC_MNXT)); + P( MEDIA | RD, SEND(KC_VOLU)); + P( MEDIA | RZ, SEND(KC_VOLD)); + P( MEDIA | RS, SEND(KC_MUTE)); + + // Mouse Keys + P( LP | LH, clickMouse(KC_MS_BTN1)); + P( LW | LR, clickMouse(KC_MS_BTN2)); + + // Number Row + P( NUM | LSU, SEND(KC_1)); + P( NUM | LFT, SEND(KC_2)); + P( NUM | LP, SEND(KC_3)); + P( NUM | LH, SEND(KC_4)); + P( NUM | ST1, SEND(KC_5)); + P( NUM | ST3, SEND(KC_6)); + P( NUM | RF, SEND(KC_7)); + P( NUM | RP, SEND(KC_8)); + P( NUM | RL, SEND(KC_9)); + P( NUM | RT, SEND(KC_0)); + P( NUM | LA, SEND(KC_5)); + P( NUM | RT, SEND(KC_0)); + + // Specials + P( LA | NUM, SEND(KC_ESC)); + P( RU | NUM, SEND(KC_TAB)); + P( RE | RU, SEND(KC_BSPC)); + P( RD | RZ, SEND(KC_ENT)); + P( RE, SEND(KC_ENT)); + P( RD, SEND(KC_BSPC)); + P( NUM, SEND(KC_BSPC)); + P( LA, SEND(KC_SPC)); + P( RU, SEND(KC_SPC)); + P( RZ, SEND(KC_ESC)); + + // Letters + P( LSU | LSD, SEND(KC_A)); + P( LFT | LK, SEND(KC_S)); + P( LP | LW, SEND(KC_D)); + P( LH | LR, SEND(KC_F)); + P( ST1 | ST2, SEND(KC_G)); + P( ST3 | ST4, SEND(KC_H)); + P( RF | RR, SEND(KC_J)); + P( RT | RS, SEND(KC_SCLN)) + P( RG | RL, SEND(KC_L)); + P( RP | RB, SEND(KC_K)); + P( LSU, SEND(KC_Q)); + P( LSD, SEND(KC_Z)); + P( LFT, SEND(KC_W)); + P( LK, SEND(KC_X)); + P( LP, SEND(KC_E)); + P( LW, SEND(KC_C)); + P( LH, SEND(KC_R)); + P( LR, SEND(KC_V)); + P( ST1, SEND(KC_T)); + P( ST2, SEND(KC_B)); + P( ST3, SEND(KC_Y)); + P( ST4, SEND(KC_N)); + P( RF, SEND(KC_U)); + P( RR, SEND(KC_M)); + P( RP, SEND(KC_I)); + P( RB, SEND(KC_COMM)); + P( RL, SEND(KC_O)); + P( RG, SEND(KC_DOT)); + P( RT, SEND(KC_P)); + P( RS, SEND(KC_SLSH)); + + // Symbols and Numbers + P( PWR | RE | RU, SEND(KC_ENT)); + P( PWR | LA | LO, SEND(KC_SPC)); + P( PWR | LP | LW, SEND(KC_LSFT); SEND(KC_9)); // ( + P( PWR | LH | LR, SEND(KC_LSFT); SEND(KC_0)); // ) + P( PWR | ST1 | ST2, SEND(KC_GRV)); // ` + P( PWR | RD | RZ, SEND(KC_ESC)); + P( PWR | LSU | LSD, SEND(KC_LSFT); SEND(KC_3)); // # + P( PWR | LFT | LK, SEND(KC_LSFT); SEND(KC_4)); // $ + P( PWR | LSU, SEND(KC_LSFT); SEND(KC_1)); // ! + P( PWR | LSD, SEND(KC_LSFT); SEND(KC_5)); // % + P( PWR | LFT, SEND(KC_LSFT); SEND(KC_2)); // @ + P( PWR | LK, SEND(KC_LSFT); SEND(KC_6)); // ^ + P( PWR | LP, SEND(KC_LSFT); SEND(KC_LBRC)); // { + P( PWR | LW, SEND(KC_LBRC)); + P( PWR | LH, SEND(KC_LSFT); SEND(KC_RBRC)); // } + P( PWR | LR, SEND(KC_RBRC)); + P( PWR | ST1, SEND(KC_LSFT); SEND(KC_BSLS)); // | + P( PWR | ST2, SEND(KC_LSFT); SEND(KC_GRV)); // ~ + P( PWR | ST3, SEND(KC_QUOT)); + P( PWR | ST4, SEND(KC_LSFT); SEND(KC_QUOT)); // " + P( PWR | RF, SEND(KC_KP_PLUS)); + P( PWR | RR, SEND(KC_LSFT); SEND(KC_7)); // & + P( PWR | RP, SEND(KC_MINS)); + P( PWR | RB, SEND(KC_EQL)); + P( PWR | RL, SEND(KC_SLSH)); + P( PWR | RG, SEND(KC_COMM)); + P( PWR | RT, SEND(KC_PAST)); + P( PWR | RS, SEND(KC_DOT)); + P( PWR | RD, SEND(KC_TAB)); + P( PWR | LA, SEND(KC_SCLN)); + P( PWR | LO, SEND(KC_SLSH)); + P( PWR | RE, SEND(KC_SCLN)); + P( PWR | RU, SEND(KC_SLSH)); + + + // If we make here, send as a steno chord + // If plover is running we can hook that host side + return false; +} + +#define STENO_LAYER 0 + +// "Layers" +// Steno layer should be first in your map. +// When PWR | FN | RR | RG | RB | RS is pressed, the layer is increased to the next map. You must return to STENO_LAYER at the end. +// If you have only a single layer, you must set SINGLELAYER = yes in your rules.mk, otherwise you may experince undefined behaviour + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +// Main layer, everything goes through here +[STENO_LAYER] = LAYOUT_georgi( +STN_FN, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, +STN_PWR, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR, + STN_N1, STN_A, STN_O, STN_E, STN_U, STN_N1) +}; + +int getKeymapCount(void) { + return sizeof(keymaps)/sizeof(keymaps[0]); +} diff --git a/keyboards/georgi/keymaps/template/readme.md b/keyboards/georgi/keymaps/template/readme.md new file mode 100644 index 0000000000..7c6fc35123 --- /dev/null +++ b/keyboards/georgi/keymaps/template/readme.md @@ -0,0 +1,6 @@ +# Georgi QWERTY/Steno firmware + +This is a blank template configured with 5K of free space for your onboard dictionary! +Read the docs over at [gBoards](http://docs.gboards.ca) + +Ideally you should copy this directory and make your changes there. If you come up with a good layout submit a PR! diff --git a/keyboards/georgi/keymaps/template/rules.mk b/keyboards/georgi/keymaps/template/rules.mk new file mode 100644 index 0000000000..1178fd80db --- /dev/null +++ b/keyboards/georgi/keymaps/template/rules.mk @@ -0,0 +1,27 @@ +#---------------------------------------------------------------------------- +# make georgi:extrakey:dfu +# Make sure you have dfu-programmer installed! +#---------------------------------------------------------------------------- + +#Debug options +VERBOSE = yes +CONSOLE_ENABLE = yes +DEBUG_MATRIX_SCAN_RATE = no +DEBUG_MATRIX = no +KEYBOARD_SHARED_EP = yes +CUSTOM_MATRIX = yes +MOUSEKEY_ENABLE = no +SINGLE_LAYER = no + + +# A bunch of stuff that you shouldn't touch unless you +# know what you're doing. +# +# No touchy, capiche? +SRC += matrix.c i2c_master.c +ifeq ($(strip $(DEBUG_MATRIX)), yes) + OPT_DEFS += -DDEBUG_MATRIX +endif +ifeq ($(strip $(SINGLE_LAYER)), yes) + OPT_DEFS += -DSINGLE_LAYER +endif diff --git a/keyboards/georgi/matrix.c b/keyboards/georgi/matrix.c new file mode 100644 index 0000000000..22079ac61a --- /dev/null +++ b/keyboards/georgi/matrix.c @@ -0,0 +1,402 @@ +/* +Note for ErgoDox EZ customizers: Here be dragons! +This is not a file you want to be messing with. +All of the interesting stuff for you is under keymaps/ :) +Love, Erez + +Copyright 2013 Oleg Kostyuk <cub.uanic@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 "matrix.h" +#include <stdint.h> +#include <stdbool.h> +#include <avr/io.h> +#include "wait.h" +#include "action_layer.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "keymap_steno.h" +#include QMK_KEYBOARD_H +#ifdef DEBUG_MATRIX_SCAN_RATE +#include "timer.h" +#endif + + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +// MCP Pin Defs +#define RROW1 (1<<3) +#define RROW2 (1<<2) +#define RROW3 (1<<1) +#define RROW4 (1<<0) +#define COL0 (1<<0) +#define COL1 (1<<1) +#define COL2 (1<<2) +#define COL3 (1<<3) +#define COL4 (1<<4) +#define COL5 (1<<5) +#define COL6 (1<<6) + +// ATmega pin defs +#define ROW1 (1<<6) +#define ROW2 (1<<5) +#define ROW3 (1<<4) +#define ROW4 (1<<1) +#define COL7 (1<<0) +#define COL8 (1<<1) +#define COL9 (1<<2) +#define COL10 (1<<3) +#define COL11 (1<<2) +#define COL12 (1<<3) +#define COL13 (1<<6) + + +// bit masks +#define BMASK (COL7 | COL8 | COL9 | COL10) +#define CMASK (COL13) +#define DMASK (COL11 | COL12) +#define FMASK (ROW1 | ROW2 | ROW3 | ROW4) +#define RROWMASK (RROW1 | RROW2 | RROW3 | RROW4) +#define MCPMASK (COL0 | COL1 | COL2 | COL3 | COL4 | COL5 | COL6) + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +/* + * matrix state(1:on, 0:off) + * contains the raw values without debounce filtering of the last read cycle. + */ +static matrix_row_t raw_matrix[MATRIX_ROWS]; + +// Debouncing: store for each key the number of scans until it's eligible to +// change. When scanning the matrix, ignore any changes in keys that have +// already changed in the last DEBOUNCE scans. +static uint8_t debounce_matrix[MATRIX_ROWS * MATRIX_COLS]; + +static matrix_row_t read_cols(uint8_t row); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); + +static uint8_t mcp23018_reset_loop; +// static uint16_t mcp23018_reset_loop; + +#ifdef DEBUG_MATRIX_SCAN_RATE +uint32_t matrix_timer; +uint32_t matrix_scan_count; +#endif + + +__attribute__ ((weak)) +void matrix_init_user(void) {} + +__attribute__ ((weak)) +void matrix_scan_user(void) {} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + + +void matrix_init(void) +{ + // initialize row and col + mcp23018_status = init_mcp23018(); + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + raw_matrix[i] = 0; + for (uint8_t j=0; j < MATRIX_COLS; ++j) { + debounce_matrix[i * MATRIX_COLS + j] = 0; + } + } + +#ifdef DEBUG_MATRIX_SCAN_RATE + matrix_timer = timer_read32(); + matrix_scan_count = 0; +#endif + matrix_init_quantum(); +} + +void matrix_power_up(void) { + mcp23018_status = init_mcp23018(); + + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + } + +#ifdef DEBUG_MATRIX_SCAN_RATE + matrix_timer = timer_read32(); + matrix_scan_count = 0; +#endif + +} + +// Returns a matrix_row_t whose bits are set if the corresponding key should be +// eligible to change in this scan. +matrix_row_t debounce_mask(matrix_row_t rawcols, uint8_t row) { + matrix_row_t result = 0; + matrix_row_t change = rawcols ^ raw_matrix[row]; + raw_matrix[row] = rawcols; + for (uint8_t i = 0; i < MATRIX_COLS; ++i) { + if (debounce_matrix[row * MATRIX_COLS + i]) { + --debounce_matrix[row * MATRIX_COLS + i]; + } else { + result |= (1 << i); + } + if (change & (1 << i)) { + debounce_matrix[row * MATRIX_COLS + i] = DEBOUNCE; + } + } + return result; +} + +matrix_row_t debounce_read_cols(uint8_t row) { + // Read the row without debouncing filtering and store it for later usage. + matrix_row_t cols = read_cols(row); + // Get the Debounce mask. + matrix_row_t mask = debounce_mask(cols, row); + // debounce the row and return the result. + return (cols & mask) | (matrix[row] & ~mask);; +} + +uint8_t matrix_scan(void) +{ + // Then the keyboard + if (mcp23018_status) { // if there was an error + if (++mcp23018_reset_loop == 0) { + // if (++mcp23018_reset_loop >= 1300) { + // since mcp23018_reset_loop is 8 bit - we'll try to reset once in 255 matrix scans + // this will be approx bit more frequent than once per second + print("trying to reset mcp23018\n"); + mcp23018_status = init_mcp23018(); + if (mcp23018_status) { + print("left side not responding\n"); + } else { + print("left side attached\n"); + } + } + } + +#ifdef DEBUG_MATRIX_SCAN_RATE + matrix_scan_count++; + uint32_t timer_now = timer_read32(); + if (TIMER_DIFF_32(timer_now, matrix_timer)>1000) { + print("matrix scan frequency: "); + pdec(matrix_scan_count); + print("\n"); + + matrix_timer = timer_now; + matrix_scan_count = 0; + } +#endif + for (uint8_t i = 0; i < MATRIX_ROWS_PER_SIDE; i++) { + select_row(i); + // and select on left hand + select_row(i + MATRIX_ROWS_PER_SIDE); + // we don't need a 30us delay anymore, because selecting a + // left-hand row requires more than 30us for i2c. + + // grab cols from left hand + matrix[i] = debounce_read_cols(i); + // grab cols from right hand + matrix[i + MATRIX_ROWS_PER_SIDE] = debounce_read_cols(i + MATRIX_ROWS_PER_SIDE); + + unselect_rows(); + } + + matrix_scan_quantum(); + +#ifdef DEBUG_MATRIX + for (uint8_t c = 0; c < MATRIX_COLS; c++) + for (uint8_t r = 0; r < MATRIX_ROWS; r++) + if (matrix_is_on(r, c)) xprintf("r:%d c:%d \n", r, c); +#endif + + return 1; +} + +bool matrix_is_modified(void) // deprecated and evidently not called. +{ + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<<col)); +} + +inline +matrix_row_t matrix_get_row(uint8_t row) +{ + return matrix[row]; +} + +void matrix_print(void) +{ + print("\nr/c 0123456789ABCDEF\n"); + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + phex(row); print(": "); + pbin_reverse16(matrix_get_row(row)); + print("\n"); + } +} + +uint8_t matrix_key_count(void) +{ + uint8_t count = 0; + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + count += bitpop16(matrix[i]); + } + return count; +} + +// Remember this means ROWS +static void init_cols(void) +{ + // init on mcp23018 + // not needed, already done as part of init_mcp23018() + + // Input with pull-up(DDR:0, PORT:1) + DDRF &= ~FMASK; + PORTF |= FMASK; +} + +static matrix_row_t read_cols(uint8_t row) +{ + if (row < 7) { + if (mcp23018_status) { // if there was an error + return 0; + } else { + uint8_t data = 0; + mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(GPIOB, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_start(I2C_ADDR_READ, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_read_nack(ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status < 0) goto out; + data = ~((uint8_t)mcp23018_status); + mcp23018_status = I2C_STATUS_SUCCESS; + out: + i2c_stop(); + +#ifdef DEBUG_MATRIX + if (data != 0x00) xprintf("I2C: %d\n", data); +#endif + return data; + } + } else { + /* read from teensy + * bitmask is 0b0111001, but we want the lower four + * we'll return 1s for the top two, but that's harmless. + */ + // So I need to confuckulate all this + //return ~(((PIND & DMASK) >> 1 | ((PINC & CMASK) >> 6) | (PIN))); + //return ~((PINF & 0x03) | ((PINF & 0xF0) >> 2)); + return ~( + (((PINF & ROW4) >> 1) + | ((PINF & (ROW1 | ROW2 | ROW3)) >> 3)) + & 0xF); + } +} + +// Row pin configuration +static void unselect_rows(void) +{ + // no need to unselect on mcp23018, because the select step sets all + // the other row bits high, and it's not changing to a different + // direction + // Hi-Z(DDR:0, PORT:0) to unselect + DDRB &= ~(BMASK); + PORTB &= ~(BMASK); + DDRC &= ~CMASK; + PORTC &= ~CMASK; + DDRD &= ~DMASK; + PORTD &= ~DMASK; +} + +static void select_row(uint8_t row) +{ + if (row < 7) { + // select on mcp23018 + if (mcp23018_status) { // do nothing on error + } else { // set active row low : 0 // set other rows hi-Z : 1 + mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(GPIOA, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0xFF & ~(1<<row), ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + out: + i2c_stop(); + } + } else { + // Output low(DDR:1, PORT:0) to select + switch (row) { + case 7: + DDRB |= COL7; + PORTB &= ~COL7; + break; + case 8: + DDRB |= COL8; + PORTB &= ~COL8; + break; + case 9: + DDRB |= COL9; + PORTB &= ~COL9; + break; + case 10: + DDRB |= COL10; + PORTB &= ~COL10; + break; + case 11: + DDRD |= COL11; + PORTD &= ~COL11; + break; + case 12: + DDRD |= COL12; + PORTD &= ~COL12; + break; + case 13: + DDRC |= COL13; + PORTC &= ~COL13; + break; + } + } +} diff --git a/keyboards/georgi/readme.md b/keyboards/georgi/readme.md new file mode 100644 index 0000000000..03e2e3d83d --- /dev/null +++ b/keyboards/georgi/readme.md @@ -0,0 +1,29 @@ +# Georgi + +![Georgi](https://i.imgur.com/3kUpRrj.jpg) + +A compact 20% (12x2) Split Keyboard for steno and QWERTY. + +[More info on qmk.fm](http://qmk.fm/georgi/) + +Keyboard Maintainer: [Jeremy Bernhardt](https://github.com/germ) +Hardware Supported: Georgi +Hardware Availability: [gboards.ca](http://gboards.ca) + +## Firmware building +After cloning the QMK repo and installing dfu-programmer build and flash with. Be sure to reset your keyboard! + + make georgi:default:dfu + +To just test your build with the default keymap + + make georgi:default + +Build options can be enabled/disabled in keyboards/georgi/keymaps/default/rules.mk . Copy the default directory and make any changes to your layout, if you think they're worth sharing submit a PR! + +# Space +The stock firmware uses nearly all of the flash avalible. For custom dictionary modifications, disable mousekeys in your keymaps rules.mk (4K of space) and remove the Gaming layers. I've done this already in the provided keymap 'template'. + +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). + +## Have an idea? [Reach out to me!](mailto:bernhardtjeremy@gmail.com) diff --git a/keyboards/georgi/rules.mk b/keyboards/georgi/rules.mk new file mode 100644 index 0000000000..0f730f3b73 --- /dev/null +++ b/keyboards/georgi/rules.mk @@ -0,0 +1,22 @@ +#---------------------------------------------------------------------------- +# make georgi:default:dfu +# Make sure you have dfu-programmer installed! +# Do not edit this file! Make a copy of keymaps/default and modify that! +#---------------------------------------------------------------------------- +# Source includes +SRC += matrix.c i2c_master.c + +# Hardware info +MCU = atmega32u4 +F_CPU = 16000000 +ARCH = AVR8 +BOOTLOADER = atmel-dfu +F_USB = $(F_CPU) +EXTRAFLAGS += -flto + +CUSTOM_MATRIX = yes +STENO_ENABLE = yes +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = no +COMMAND_ENABLE = no +NKRO_ENABLE = yes diff --git a/keyboards/georgi/sten.c b/keyboards/georgi/sten.c new file mode 100644 index 0000000000..3b33b11d6e --- /dev/null +++ b/keyboards/georgi/sten.c @@ -0,0 +1,2 @@ +#include "sten.h" + diff --git a/keyboards/georgi/sten.h b/keyboards/georgi/sten.h new file mode 100644 index 0000000000..fee05deca3 --- /dev/null +++ b/keyboards/georgi/sten.h @@ -0,0 +1,290 @@ +// 2019, g Heavy Industries + +#include QMK_KEYBOARD_H +#include "mousekey.h" +#include "keymap.h" +#include "keymap_steno.h" + +// Bitfield representing the current chord +uint32_t cChord = 0; + +// See if a given chord is pressed. +// P will return +// PJ will continue processing, removing the found chord +#define P(chord, act) if (cChord == (chord)) { act; return true; } +#define PJ(chord, act) if ((cChord & (chord)) == (chord)) { cChord ^= chord; act; } + +// All Steno Codes +// Shift to internal representation +#define STN(n) (1L<<n) + +//i.e) S(teno)R(ight)F +enum ORDER { + SFN = 0, SPWR, SST1, SST2, SST3, SST4, SNUM, + SLSU, SLSD, SLT, SLK, SLP, SLW, SLH, SLR, SLA, SLO, + SRE, SRU, SRF, SRR, SRP, SRB, SRL, SRG, SRT, SRS, SRD, SRZ +}; + +// Break it all out +#define FN STN(SFN) +#define PWR STN(SPWR) +#define ST1 STN(SST1) +#define ST2 STN(SST2) +#define ST3 STN(SST3) +#define ST4 STN(SST4) +#define NUM STN(SNUM) // No distinction between left and right + +#define LSU STN(SLSU) +#define LSD STN(SLSD) +#define LFT STN(SLT) // (L)e(F)t (T), preprocessor conflict +#define LK STN(SLK) +#define LP STN(SLP) +#define LW STN(SLW) +#define LH STN(SLH) +#define LR STN(SLR) +#define LA STN(SLA) +#define LO STN(SLO) + +#define RE STN(SRE) +#define RU STN(SRU) +#define RF STN(SRF) +#define RR STN(SRR) +#define RP STN(SRP) +#define RB STN(SRB) +#define RL STN(SRL) +#define RG STN(SRG) +#define RT STN(SRT) +#define RS STN(SRS) +#define RD STN(SRD) +#define RZ STN(SRZ) + +bool processQwerty(void); +bool processFakeSteno(void); +void clickMouse(uint8_t kc); +void SEND(uint8_t kc); +extern int getKeymapCount(void); + +// Mode state +enum MODE { STENO = 0, QWERTY, COMMAND }; +enum MODE cMode = STENO; +enum MODE pMode; +bool QWERSTENO = false; + +// Command State +#define MAX_CMD_BUF 20 +uint8_t CMDBUF[MAX_CMD_BUF]; +uint8_t CMDLEN = 0; + +// Key Repeat state +bool inChord = false; +uint16_t repTimer = 0; +#define REP_DELAY 300 + +// Mousekeys state +bool inMouse = false; +int8_t mousePress; + +// All processing done at chordUp goes through here +bool send_steno_chord_user(steno_mode_t mode, uint8_t chord[6]) { + // Check for mousekeys, this is release +#ifdef MOUSEKEY_ENABLE + if (inMouse) { + inMouse = false; + mousekey_off(mousePress); + mousekey_send(); + } +#endif + + // Toggle Serial/QWERTY steno + if (cChord == (PWR | FN | ST1 | ST2)) { + uprintf("Fallback Toggle\n"); + QWERSTENO = !QWERSTENO; + + goto out; + } + + // handle command mode + if (cChord == (PWR | FN | RD | RZ)) { + uprintf("COMMAND Toggle\n"); + if (cMode != COMMAND) { // Entering Command Mode + CMDLEN = 0; + pMode = cMode; + cMode = COMMAND; + } else { // Exiting Command Mode + cMode = pMode; + + // Press all and release all + for (int i = 0; i < CMDLEN; i++) { + register_code(CMDBUF[i]); + } + clear_keyboard(); + } + + goto out; + } + + // Handle Gaming Toggle, + if (cChord == (PWR | FN | ST2 | ST3) && getKeymapCount() > 1) { + uprintf("Switching to QMK\n"); + layer_on(1); + goto out; + } + + // Lone FN press, toggle QWERTY + if (cChord == FN) { + (cMode == STENO) ? (cMode = QWERTY) : (cMode = STENO); + goto out; + } + + // Check for Plover momentary + if (cMode == QWERTY && (cChord & FN)) { + cChord ^= FN; + goto steno; + } + + // Do QWERTY and Momentary QWERTY + if (cMode == QWERTY || (cMode == COMMAND) || (cChord & (FN | PWR))) { + if (cChord & FN) cChord ^= FN; + processQwerty(); + goto out; + } + + // Fallback NKRO Steno + if (cMode == STENO && QWERSTENO) { + processFakeSteno(); + goto out; + } + +steno: + // Hey that's a steno chord! + inChord = false; + cChord = 0; + return true; + +out: + inChord = false; + clear_keyboard(); + cChord = 0; + return false; +} + +// Update Chord State +bool process_steno_user(uint16_t keycode, keyrecord_t *record) { + // Everything happens in here when steno keys come in. + // Bail on keyup + if (!record->event.pressed) return true; + + // Update key repeat timers + repTimer = timer_read(); + inChord = true; + + // Switch on the press adding to chord + bool pr = record->event.pressed; + switch (keycode) { + // Mods and stuff + case STN_ST1: pr ? (cChord |= (ST1)): (cChord &= ~(ST1)); break; + case STN_ST2: pr ? (cChord |= (ST2)): (cChord &= ~(ST2)); break; + case STN_ST3: pr ? (cChord |= (ST3)): (cChord &= ~(ST3)); break; + case STN_ST4: pr ? (cChord |= (ST4)): (cChord &= ~(ST4)); break; + case STN_FN: pr ? (cChord |= (FN)) : (cChord &= ~(FN)); break; + case STN_PWR: pr ? (cChord |= (PWR)): (cChord &= ~(PWR)); break; + case STN_N1...STN_N6: + case STN_N7...STN_NC: pr ? (cChord |= (NUM)): (cChord &= ~(NUM)); break; + + // All the letter keys + case STN_S1: pr ? (cChord |= (LSU)) : (cChord &= ~(LSU)); break; + case STN_S2: pr ? (cChord |= (LSD)) : (cChord &= ~(LSD)); break; + case STN_TL: pr ? (cChord |= (LFT)) : (cChord &= ~(LFT)); break; + case STN_KL: pr ? (cChord |= (LK)) : (cChord &= ~(LK)); break; + case STN_PL: pr ? (cChord |= (LP)) : (cChord &= ~(LP)); break; + case STN_WL: pr ? (cChord |= (LW)) : (cChord &= ~(LW)); break; + case STN_HL: pr ? (cChord |= (LH)) : (cChord &= ~(LH)); break; + case STN_RL: pr ? (cChord |= (LR)) : (cChord &= ~(LR)); break; + case STN_A: pr ? (cChord |= (LA)) : (cChord &= ~(LA)); break; + case STN_O: pr ? (cChord |= (LO)) : (cChord &= ~(LO)); break; + case STN_E: pr ? (cChord |= (RE)) : (cChord &= ~(RE)); break; + case STN_U: pr ? (cChord |= (RU)) : (cChord &= ~(RU)); break; + case STN_FR: pr ? (cChord |= (RF)) : (cChord &= ~(RF)); break; + case STN_RR: pr ? (cChord |= (RR)) : (cChord &= ~(RR)); break; + case STN_PR: pr ? (cChord |= (RP)) : (cChord &= ~(RP)); break; + case STN_BR: pr ? (cChord |= (RB)) : (cChord &= ~(RB)); break; + case STN_LR: pr ? (cChord |= (RL)) : (cChord &= ~(RL)); break; + case STN_GR: pr ? (cChord |= (RG)) : (cChord &= ~(RG)); break; + case STN_TR: pr ? (cChord |= (RT)) : (cChord &= ~(RT)); break; + case STN_SR: pr ? (cChord |= (RS)) : (cChord &= ~(RS)); break; + case STN_DR: pr ? (cChord |= (RD)) : (cChord &= ~(RD)); break; + case STN_ZR: pr ? (cChord |= (RZ)) : (cChord &= ~(RZ)); break; + } + + // Check for key repeat in QWERTY mode + return true; +} +void matrix_scan_user(void) { + // We abuse this for early sending of key + // Key repeat only on QWER/SYMB layers + if (cMode != QWERTY) return; + + // Check timers + if (timer_elapsed(repTimer) > REP_DELAY) { + // Process Key for report + processQwerty(); + + // Send report to host + send_keyboard_report(); + repTimer = timer_read(); + } +}; + +// Helpers +bool processFakeSteno(void) { + PJ( LSU, SEND(KC_Q);); + PJ( LSD, SEND(KC_A);); + PJ( LFT, SEND(KC_W);); + PJ( LP, SEND(KC_E);); + PJ( LH, SEND(KC_R);); + PJ( LK, SEND(KC_S);); + PJ( LW, SEND(KC_D);); + PJ( LR, SEND(KC_F);); + PJ( ST1, SEND(KC_T);); + PJ( ST2, SEND(KC_G);); + PJ( LA, SEND(KC_C);); + PJ( LO, SEND(KC_V);); + PJ( RE, SEND(KC_N);); + PJ( RU, SEND(KC_M);); + PJ( ST3, SEND(KC_Y);); + PJ( ST4, SEND(KC_H);); + PJ( RF, SEND(KC_U);); + PJ( RP, SEND(KC_I);); + PJ( RL, SEND(KC_O);); + PJ( RT, SEND(KC_P);); + PJ( RD, SEND(KC_LBRC);); + PJ( RR, SEND(KC_J);); + PJ( RB, SEND(KC_K);); + PJ( RG, SEND(KC_L);); + PJ( RS, SEND(KC_SCLN);); + PJ( RZ, SEND(KC_COMM);); + PJ( NUM, SEND(KC_1);); + + return false; +} +void clickMouse(uint8_t kc) { +#ifdef MOUSEKEY_ENABLE + mousekey_on(kc); + mousekey_send(); + + // Store state for later use + inMouse = true; + mousePress = kc; +#endif +} +void SEND(uint8_t kc) { + // Send Keycode, Does not work for Quantum Codes + if (cMode == COMMAND && CMDLEN < MAX_CMD_BUF) { + uprintf("CMD LEN: %d BUF: %d\n", CMDLEN, MAX_CMD_BUF); + CMDBUF[CMDLEN] = kc; + CMDLEN++; + } + + if (cMode != COMMAND) register_code(kc); + return; +} diff --git a/keyboards/gergo/gergo.c b/keyboards/gergo/gergo.c index d32792e2a8..cc0bef391d 100644 --- a/keyboards/gergo/gergo.c +++ b/keyboards/gergo/gergo.c @@ -47,7 +47,7 @@ uint8_t init_mcp23018(void) { mcp23018_status = i2c_write(IODIRA, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; mcp23018_status = i2c_write(0b10000000, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; mcp23018_status = i2c_write(0b11111111, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; - i2c_stop(ERGODOX_EZ_I2C_TIMEOUT); + i2c_stop(); // set pull-up // - unused : on : 1 @@ -59,7 +59,7 @@ uint8_t init_mcp23018(void) { mcp23018_status = i2c_write(0b11111111, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; out: - i2c_stop(ERGODOX_EZ_I2C_TIMEOUT); + i2c_stop(); // SREG=sreg_prev; //uprintf("Init %x\n", mcp23018_status); return mcp23018_status; diff --git a/keyboards/gergo/matrix.c b/keyboards/gergo/matrix.c index 29fe48ccb3..9886ecf153 100644 --- a/keyboards/gergo/matrix.c +++ b/keyboards/gergo/matrix.c @@ -72,14 +72,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. //Trackball pin defs #define TRKUP (1<<4) #define TRKDN (1<<5) -#define TRKLT (1<<6) +#define TRKLT (1<<6) #define TRKRT (1<<7) #define TRKBTN (1<<6) // Multiple for mouse moves #ifndef TRKSTEP -#define TRKSTEP 20 +#define TRKSTEP 20 #endif // multiple for mouse scroll @@ -98,13 +98,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. // Trackball interrupts accumulate over here. Processed on scan // Stores prev state of mouse, high bits store direction -uint8_t trkState = 0; -uint8_t trkBtnState = 0; +uint8_t trkState = 0; +uint8_t trkBtnState = 0; -volatile uint8_t tbUpCnt = 0; -volatile uint8_t tbDnCnt = 0; -volatile uint8_t tbLtCnt = 0; -volatile uint8_t tbRtCnt = 0; +volatile uint8_t tbUpCnt = 0; +volatile uint8_t tbDnCnt = 0; +volatile uint8_t tbLtCnt = 0; +volatile uint8_t tbRtCnt = 0; /* matrix state(1:on, 0:off) */ static matrix_row_t matrix[MATRIX_ROWS]; @@ -240,14 +240,14 @@ uint8_t matrix_scan(void) // First we handle the mouse inputs #ifdef BALLER uint8_t pBtn = PINE & TRKBTN; - + #ifdef DEBUG_BALLER - // Compare to previous, mod report + // Compare to previous, mod report if (tbUpCnt + tbDnCnt + tbLtCnt + tbRtCnt != 0) xprintf("U: %d D: %d L: %d R: %d B: %d\n", tbUpCnt, tbDnCnt, tbLtCnt, tbRtCnt, (trkBtnState >> 6)); #endif - // Modify the report + // Modify the report report_mouse_t pRprt = pointing_device_get_report(); // Scroll by default, move on layer @@ -264,7 +264,7 @@ uint8_t matrix_scan(void) } #ifdef DEBUG_BALLER - if (pRprt.x != 0 || pRprt.y != 0) + if (pRprt.x != 0 || pRprt.y != 0) xprintf("X: %d Y: %d\n", pRprt.x, pRprt.y); #endif @@ -272,7 +272,7 @@ uint8_t matrix_scan(void) if ((pBtn != trkBtnState) && ((pBtn >> 6) == 1)) pRprt.buttons &= ~MOUSE_BTN1; // Save state, push update - if (pRprt.x != 0 || pRprt.y != 0 || pRprt.h != 0 || pRprt.v != 0 || (trkBtnState != pBtn)) + if (pRprt.x != 0 || pRprt.y != 0 || pRprt.h != 0 || pRprt.v != 0 || (trkBtnState != pBtn)) pointing_device_set_report(pRprt); trkBtnState = pBtn; @@ -325,8 +325,8 @@ uint8_t matrix_scan(void) enableInterrupts(); #ifdef DEBUG_MATRIX - for (uint8_t c = 0; c < MATRIX_COLS; c++) - for (uint8_t r = 0; r < MATRIX_ROWS; r++) + for (uint8_t c = 0; c < MATRIX_COLS; c++) + for (uint8_t r = 0; r < MATRIX_ROWS; r++) if (matrix_is_on(r, c)) xprintf("r:%d c:%d \n", r, c); #endif @@ -394,7 +394,7 @@ static matrix_row_t read_cols(uint8_t row) data = ~((uint8_t)mcp23018_status); mcp23018_status = I2C_STATUS_SUCCESS; out: - i2c_stop(ERGODOX_EZ_I2C_TIMEOUT); + i2c_stop(); #ifdef DEBUG_MATRIX if (data != 0x00) xprintf("I2C: %d\n", data); @@ -439,12 +439,12 @@ static void select_row(uint8_t row) if (row < 7) { // select on mcp23018 if (mcp23018_status) { // do nothing on error - } else { // set active row low : 0 // set other rows hi-Z : 1 + } else { // set active row low : 0 // set other rows hi-Z : 1 mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; mcp23018_status = i2c_write(GPIOA, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; mcp23018_status = i2c_write(0xFF & ~(1<<row), ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; out: - i2c_stop(ERGODOX_EZ_I2C_TIMEOUT); + i2c_stop(); } } else { // Output low(DDR:1, PORT:0) to select diff --git a/keyboards/gray_studio/hb85/config.h b/keyboards/gray_studio/hb85/config.h index d68860d202..da230f7e8d 100644 --- a/keyboards/gray_studio/hb85/config.h +++ b/keyboards/gray_studio/hb85/config.h @@ -19,8 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define VENDOR_ID 0x20A0 #define PRODUCT_ID 0x422F -// TODO: share these strings with usbconfig.h -// Edit usbconfig.h to change these. #define MANUFACTURER Gray Studio #define PRODUCT HB85 @@ -34,6 +32,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define RGBLED_NUM 5 #define RGBLIGHT_ANIMATIONS - -#define NO_UART 1 -#define BOOTLOADHID_BOOTLOADER 1 diff --git a/keyboards/gray_studio/hb85/hb85.c b/keyboards/gray_studio/hb85/hb85.c index 1bc0222379..3e42023587 100644 --- a/keyboards/gray_studio/hb85/hb85.c +++ b/keyboards/gray_studio/hb85/hb85.c @@ -1,5 +1,6 @@ /* -Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> +Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>, + 2019 fcoury <felipe.coury@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 @@ -19,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "rgblight.h" -#include "i2c.h" +#include "i2c_master.h" #include "quantum.h" #ifdef RGBLIGHT_ENABLE @@ -35,7 +36,7 @@ void rgblight_set(void) { } i2c_init(); - i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM); + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); } #endif diff --git a/keyboards/gray_studio/hb85/hb85.h b/keyboards/gray_studio/hb85/hb85.h index a505705b47..48808105f4 100644 --- a/keyboards/gray_studio/hb85/hb85.h +++ b/keyboards/gray_studio/hb85/hb85.h @@ -1,5 +1,5 @@ /* -Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> +Copyright 2019 fcoury <felipe.coury@gmail.com>, MechMerlin <mechmerlin@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 @@ -19,30 +19,82 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "quantum.h" -#define LAYOUT( \ - K12, K11, K10, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K13, \ - K28, K27, K26, K25, K24, K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, K77, K76, K75, \ - K43, K42, K41, K40, K39, K29, K30, K31, K32, K33, K34, K35, K36, K37, K38, K74, K73, \ - K57, K56, K55, K54, K53, K44, K45, K46, K47, K48, K49, K50, K51, K52, K88, K87, \ - K72, K71, K70, K69, K68, K58, K59, K60, K61, K62, K63, K66, K64, K65, K67, K90, K89, \ - K86, K85, K78, K79, K80, K81, K82, K83, K84, K91 \ +// Generic layout enabling splits, and all positions available in STT, Basic, and AOP. + +#define LAYOUT_all( \ + K0C, K0B, K0A, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0E, \ + K1E, K1D, K1C, K1B, K1A, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K59, K58, K57, \ + K2E, K2D, K2C, K2B, K2A, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K56, K55, \ + K3E, K3D, K3C, K3B, K3A, K30, K31, K32, K33, K34, K35, K36, K37, K39, K76, K75, \ + K4E, K4D, K4C, K4B, K4A, K40, K41, K42, K43, K44, K45, K48, K46, K47, K49, K78, K77, \ + K6D, K6C, K61, K64, K65, K66, K67, K68, K69, K79 \ ) \ { \ - { K00 , K01 , K02 , K03 , K04 , K05 , K06 , K07 , K08 , K09 , K10 , K11 , K12 , KC_NO, K13 }, \ - { K14 , K15 , K16 , K17 , K18 , K19 , K20 , K21 , K22 , K23 , K24 , K25 , K26 , K27 , K28 }, \ - { K29 , K30 , K31 , K32 , K33 , K34 , K35 , K36 , K37 , K38 , K39 , K40 , K41 , K42 , K43 }, \ - { K44 , K45 , K46 , K47 , K48 , K49 , K50 , K51 , KC_NO, K52 , K53 , K54 , K55 , K56 , K57 }, \ - { K58 , K59 , K60 , K61 , K62 , K63 , K64 , K65 , K66 , K67 , K68 , K69 , K70 , K71 , K72 }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K73 , K74 , K75 , K76 , K77 , KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, K78 , KC_NO, KC_NO, K79 , K80 , K81 , K82 , K83 , K84 , KC_NO, KC_NO, K85 , K86 , KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K87 , K88 , K89 , K90 , K91 , KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, KC_NO, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, KC_NO, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4E }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K55, K56, K57, K58, K59, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, K61, KC_NO, KC_NO, K64, K65, K66, K67, K68, K69, KC_NO, KC_NO, K6C, K6D, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K75, K76, K77, K78, K79, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ } -// F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 F2 F1 ESC FN -// 5 6 7 8 9 0 - = BS BS 4 3 2 1 ~ -// T Y U I O P [ ] | PAD7 R E W Q Tab -// G H J K L ; ' ENTR PAD4 F D S A CAPS -// V B N M , . RSFT UP / PAD1 C X Z EUR2 LSFT -// PAD9 PAD8 PAD- PAD* PAD/ -// SPC RALT RCTL LEFT DOWN RGHT PAD0 LALT LGUI -// PAD6 PAD5 PAD3 PAD2 PAD. +// Layout with blocker + +#define LAYOUT_stt( \ + K0C, K0B, K0A, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0E, \ + K1E, K1D, K1C, K1B, K1A, K10, K11, K12, K13, K14, K15, K16, K17, K18, K59, K58, K57, \ + K2E, K2D, K2C, K2B, K2A, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K56, K55, \ + K3E, K3D, K3C, K3B, K3A, K30, K31, K32, K33, K34, K35, K36, K37, K39, K76, K75, \ + K4E, K4C, K4B, K4A, K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K78, K77, \ + K6D, K6C, K61, K64, K65, K67, K68, K69, K79 \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, KC_NO, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, KC_NO, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, KC_NO, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, KC_NO, K4E }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K55, K56, K57, K58, K59, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, K61, KC_NO, KC_NO, K64, K65, KC_NO, K67, K68, K69, KC_NO, KC_NO, K6C, K6D, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K75, K76, K77, K78, K79, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ +} + +#define LAYOUT_basic( \ + K0C, K0B, K0A, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0E, \ + K1E, K1D, K1C, K1B, K1A, K10, K11, K12, K13, K14, K15, K16, K17, K18, K59, K58, K57, \ + K2E, K2D, K2C, K2B, K2A, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K56, K55, \ + K3E, K3D, K3C, K3B, K3A, K30, K31, K32, K33, K34, K35, K36, K37, K39, K76, K75, \ + K4E, K4C, K4B, K4A, K40, K41, K42, K43, K44, K45, K46, K47, K49, K77, \ + K6D, K6C, K61, K64, K65 \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, KC_NO, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, KC_NO, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, KC_NO, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, KC_NO, K49, K4A, K4B, K4C, KC_NO, K4E }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K55, K56, K57, K58, K59, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, K61, KC_NO, KC_NO, K64, K65, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K6C, K6D, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K75, K76, K77, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ +} + +#define LAYOUT_aop( \ + K0C, K0B, K0A, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0E, \ + K1E, K1D, K1C, K1B, K1A, K10, K11, K12, K13, K14, K15, K16, K17, K18, K59, K58, K57, \ + K2E, K2D, K2C, K2B, K2A, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K56, K55, \ + K3E, K3D, K3C, K3B, K3A, K30, K31, K32, K33, K34, K35, K36, K37, K39, K76, K75, \ + K4E, K4C, K4B, K4A, K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K78, K77, \ + K6D, K6C, K61, K64, K65, K66, K67, K68, K69, K79 \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, KC_NO, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, KC_NO, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, KC_NO, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, KC_NO, K4E }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K55, K56, K57, K58, K59, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, K61, KC_NO, KC_NO, K64, K65, K66, K67, K68, K69, KC_NO, KC_NO, K6C, K6D, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K75, K76, K77, K78, K79, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ +} diff --git a/keyboards/gray_studio/hb85/i2c.c b/keyboards/gray_studio/hb85/i2c.c deleted file mode 100644 index a4f9521352..0000000000 --- a/keyboards/gray_studio/hb85/i2c.c +++ /dev/null @@ -1,106 +0,0 @@ -/* -Copyright 2016 Luiz Ribeiro <luizribeiro@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/>. -*/ - -// Please do not modify this file - -#include <avr/io.h> -#include <util/twi.h> - -#include "i2c.h" - -void i2c_set_bitrate(uint16_t bitrate_khz) { - uint8_t bitrate_div = ((F_CPU / 1000l) / bitrate_khz); - if (bitrate_div >= 16) { - bitrate_div = (bitrate_div - 16) / 2; - } - TWBR = bitrate_div; -} - -void i2c_init(void) { - // set pull-up resistors on I2C bus pins - PORTC |= 0b11; - - i2c_set_bitrate(400); - - // enable TWI (two-wire interface) - TWCR |= (1 << TWEN); - - // enable TWI interrupt and slave address ACK - TWCR |= (1 << TWIE); - TWCR |= (1 << TWEA); -} - -uint8_t i2c_start(uint8_t address) { - // reset TWI control register - TWCR = 0; - - // begin transmission and wait for it to end - TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN); - while (!(TWCR & (1<<TWINT))); - - // check if the start condition was successfully transmitted - if ((TWSR & 0xF8) != TW_START) { - return 1; - } - - // transmit address and wait - TWDR = address; - TWCR = (1<<TWINT) | (1<<TWEN); - while (!(TWCR & (1<<TWINT))); - - // check if the device has acknowledged the READ / WRITE mode - uint8_t twst = TW_STATUS & 0xF8; - if ((twst != TW_MT_SLA_ACK) && (twst != TW_MR_SLA_ACK)) { - return 1; - } - - return 0; -} - -void i2c_stop(void) { - TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO); -} - -uint8_t i2c_write(uint8_t data) { - TWDR = data; - - // transmit data and wait - TWCR = (1<<TWINT) | (1<<TWEN); - while (!(TWCR & (1<<TWINT))); - - if ((TWSR & 0xF8) != TW_MT_DATA_ACK) { - return 1; - } - - return 0; -} - -uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length) { - if (i2c_start(address)) { - return 1; - } - - for (uint16_t i = 0; i < length; i++) { - if (i2c_write(data[i])) { - return 1; - } - } - - i2c_stop(); - - return 0; -} diff --git a/keyboards/gray_studio/hb85/info.json b/keyboards/gray_studio/hb85/info.json new file mode 100644 index 0000000000..3c7ac9c43c --- /dev/null +++ b/keyboards/gray_studio/hb85/info.json @@ -0,0 +1,24 @@ +{ + "keyboard_name": "Gray Studio HB85", + "url": "", + "maintainer": "qmk", + "width": 18, + "height": 6.25, + "layouts": { + "LAYOUT_all": { + "layout": [{"x":1.5, "y":0}, {"x":2.75, "y":0}, {"x":3.75, "y":0}, {"x":4.75, "y":0}, {"x":5.75, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11.25, "y":0}, {"x":12.25, "y":0}, {"x":13.25, "y":0}, {"x":14.25, "y":0}, {"x":15.5, "y":0}, {"x":0, "y":1.25}, {"x":1, "y":1.25}, {"x":2, "y":1.25}, {"x":3, "y":1.25}, {"x":4, "y":1.25}, {"x":5, "y":1.25}, {"x":6, "y":1.25}, {"x":7, "y":1.25}, {"x":8, "y":1.25}, {"x":9, "y":1.25}, {"x":10, "y":1.25}, {"x":11, "y":1.25}, {"x":12, "y":1.25}, {"x":13, "y":1.25}, {"x":14, "y":1.25}, {"x":15, "y":1.25}, {"x":16, "y":1.25}, {"x":17, "y":1.25}, {"x":0, "y":2.25, "w":1.5}, {"x":1.5, "y":2.25}, {"x":2.5, "y":2.25}, {"x":3.5, "y":2.25}, {"x":4.5, "y":2.25}, {"x":5.5, "y":2.25}, {"x":6.5, "y":2.25}, {"x":7.5, "y":2.25}, {"x":8.5, "y":2.25}, {"x":9.5, "y":2.25}, {"x":10.5, "y":2.25}, {"x":11.5, "y":2.25}, {"x":12.5, "y":2.25}, {"x":13.5, "y":2.25, "w":1.5}, {"x":15, "y":2.25}, {"x":16, "y":2.25}, {"x":17, "y":2.25}, {"x":0, "y":3.25, "w":1.75}, {"x":1.75, "y":3.25}, {"x":2.75, "y":3.25}, {"x":3.75, "y":3.25}, {"x":4.75, "y":3.25}, {"x":5.75, "y":3.25}, {"x":6.75, "y":3.25}, {"x":7.75, "y":3.25}, {"x":8.75, "y":3.25}, {"x":9.75, "y":3.25}, {"x":10.75, "y":3.25}, {"x":11.75, "y":3.25}, {"x":12.75, "y":3.25, "w":2.25}, {"x":15, "y":3.25}, {"x":16, "y":3.25}, {"x":17, "y":3.25}, {"x":0, "y":4.25, "w":1.25}, {"x":1.25, "y":4.25}, {"x":2.25, "y":4.25}, {"x":3.25, "y":4.25}, {"x":4.25, "y":4.25}, {"x":5.25, "y":4.25}, {"x":6.25, "y":4.25}, {"x":7.25, "y":4.25}, {"x":8.25, "y":4.25}, {"x":9.25, "y":4.25}, {"x":10.25, "y":4.25}, {"x":11.25, "y":4.25}, {"x":12.25, "y":4.25, "w":1.75}, {"x":14, "y":4.25}, {"x":15, "y":4.25}, {"x":16, "y":4.25}, {"x":17, "y":4.25}, {"x":1.25, "y":5.25, "w":1.25}, {"x":2.5, "y":5.25, "w":1.25}, {"x":3.75, "y":5.25, "w":6.25}, {"x":10, "y":5.25}, {"x":11, "y":5.25}, {"x":12, "y":5.25}, {"x":13, "y":5.25}, {"x":14, "y":5.25}, {"x":15, "y":5.25}, {"x":16, "y":5.25}] + }, + + "LAYOUT_stt": { + "layout": [{"x":1.5, "y":0}, {"x":2.75, "y":0}, {"x":3.75, "y":0}, {"x":4.75, "y":0}, {"x":5.75, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11.25, "y":0}, {"x":12.25, "y":0}, {"x":13.25, "y":0}, {"x":14.25, "y":0}, {"x":15.5, "y":0}, {"x":0, "y":1.25}, {"x":1, "y":1.25}, {"x":2, "y":1.25}, {"x":3, "y":1.25}, {"x":4, "y":1.25}, {"x":5, "y":1.25}, {"x":6, "y":1.25}, {"x":7, "y":1.25}, {"x":8, "y":1.25}, {"x":9, "y":1.25}, {"x":10, "y":1.25}, {"x":11, "y":1.25}, {"x":12, "y":1.25}, {"x":13, "y":1.25, "w":2}, {"x":15, "y":1.25}, {"x":16, "y":1.25}, {"x":17, "y":1.25}, {"x":0, "y":2.25, "w":1.5}, {"x":1.5, "y":2.25}, {"x":2.5, "y":2.25}, {"x":3.5, "y":2.25}, {"x":4.5, "y":2.25}, {"x":5.5, "y":2.25}, {"x":6.5, "y":2.25}, {"x":7.5, "y":2.25}, {"x":8.5, "y":2.25}, {"x":9.5, "y":2.25}, {"x":10.5, "y":2.25}, {"x":11.5, "y":2.25}, {"x":12.5, "y":2.25}, {"x":13.5, "y":2.25, "w":1.5}, {"x":15, "y":2.25}, {"x":16, "y":2.25}, {"x":17, "y":2.25}, {"x":0, "y":3.25, "w":1.75}, {"x":1.75, "y":3.25}, {"x":2.75, "y":3.25}, {"x":3.75, "y":3.25}, {"x":4.75, "y":3.25}, {"x":5.75, "y":3.25}, {"x":6.75, "y":3.25}, {"x":7.75, "y":3.25}, {"x":8.75, "y":3.25}, {"x":9.75, "y":3.25}, {"x":10.75, "y":3.25}, {"x":11.75, "y":3.25}, {"x":12.75, "y":3.25, "w":2.25}, {"x":15, "y":3.25}, {"x":16, "y":3.25}, {"x":17, "y":3.25}, {"x":0, "y":4.25, "w":2.25}, {"x":2.25, "y":4.25}, {"x":3.25, "y":4.25}, {"x":4.25, "y":4.25}, {"x":5.25, "y":4.25}, {"x":6.25, "y":4.25}, {"x":7.25, "y":4.25}, {"x":8.25, "y":4.25}, {"x":9.25, "y":4.25}, {"x":10.25, "y":4.25}, {"x":11.25, "y":4.25}, {"x":12.25, "y":4.25, "w":1.75}, {"x":14, "y":4.25}, {"x":15, "y":4.25}, {"x":16, "y":4.25}, {"x":17, "y":4.25}, {"x":1.25, "y":5.25, "w":1.25}, {"x":2.5, "y":5.25, "w":1.25}, {"x":3.75, "y":5.25, "w":6.25}, {"x":10, "y":5.25, "w":1.25}, {"x":11.25, "y":5.25, "w":1.25}, {"x":13, "y":5.25}, {"x":14, "y":5.25}, {"x":15, "y":5.25}, {"x":16, "y":5.25}] + }, + + "LAYOUT_basic": { + "layout": [{"x":1.5, "y":0}, {"x":2.75, "y":0}, {"x":3.75, "y":0}, {"x":4.75, "y":0}, {"x":5.75, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11.25, "y":0}, {"x":12.25, "y":0}, {"x":13.25, "y":0}, {"x":14.25, "y":0}, {"x":15.5, "y":0}, {"x":0, "y":1.25}, {"x":1, "y":1.25}, {"x":2, "y":1.25}, {"x":3, "y":1.25}, {"x":4, "y":1.25}, {"x":5, "y":1.25}, {"x":6, "y":1.25}, {"x":7, "y":1.25}, {"x":8, "y":1.25}, {"x":9, "y":1.25}, {"x":10, "y":1.25}, {"x":11, "y":1.25}, {"x":12, "y":1.25}, {"x":13, "y":1.25, "w":2}, {"x":15, "y":1.25}, {"x":16, "y":1.25}, {"x":17, "y":1.25}, {"x":0, "y":2.25, "w":1.5}, {"x":1.5, "y":2.25}, {"x":2.5, "y":2.25}, {"x":3.5, "y":2.25}, {"x":4.5, "y":2.25}, {"x":5.5, "y":2.25}, {"x":6.5, "y":2.25}, {"x":7.5, "y":2.25}, {"x":8.5, "y":2.25}, {"x":9.5, "y":2.25}, {"x":10.5, "y":2.25}, {"x":11.5, "y":2.25}, {"x":12.5, "y":2.25}, {"x":13.5, "y":2.25, "w":1.5}, {"x":15, "y":2.25}, {"x":16, "y":2.25}, {"x":17, "y":2.25}, {"x":0, "y":3.25, "w":1.75}, {"x":1.75, "y":3.25}, {"x":2.75, "y":3.25}, {"x":3.75, "y":3.25}, {"x":4.75, "y":3.25}, {"x":5.75, "y":3.25}, {"x":6.75, "y":3.25}, {"x":7.75, "y":3.25}, {"x":8.75, "y":3.25}, {"x":9.75, "y":3.25}, {"x":10.75, "y":3.25}, {"x":11.75, "y":3.25}, {"x":12.75, "y":3.25, "w":2.25}, {"x":15, "y":3.25}, {"x":16, "y":3.25}, {"x":17, "y":3.25}, {"x":0, "y":4.25, "w":2.25}, {"x":2.25, "y":4.25}, {"x":3.25, "y":4.25}, {"x":4.25, "y":4.25}, {"x":5.25, "y":4.25}, {"x":6.25, "y":4.25}, {"x":7.25, "y":4.25}, {"x":8.25, "y":4.25}, {"x":9.25, "y":4.25}, {"x":10.25, "y":4.25}, {"x":11.25, "y":4.25}, {"x":12.25, "y":4.25, "w":2.75}, {"x":15, "y":4.25, "w":2}, {"x":17, "y":4.25}, {"x":1.25, "y":5.25, "w":1.25}, {"x":2.5, "y":5.25, "w":1.25}, {"x":3.75, "y":5.25, "w":6.25}, {"x":10, "y":5.25, "w":1.25}, {"x":11.25, "y":5.25, "w":1.25}] + }, + + "LAYOUT_aop": { + "layout": [{"x":1.5, "y":0}, {"x":2.75, "y":0}, {"x":3.75, "y":0}, {"x":4.75, "y":0}, {"x":5.75, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11.25, "y":0}, {"x":12.25, "y":0}, {"x":13.25, "y":0}, {"x":14.25, "y":0}, {"x":15.5, "y":0}, {"x":0, "y":1.25}, {"x":1, "y":1.25}, {"x":2, "y":1.25}, {"x":3, "y":1.25}, {"x":4, "y":1.25}, {"x":5, "y":1.25}, {"x":6, "y":1.25}, {"x":7, "y":1.25}, {"x":8, "y":1.25}, {"x":9, "y":1.25}, {"x":10, "y":1.25}, {"x":11, "y":1.25}, {"x":12, "y":1.25}, {"x":13, "y":1.25, "w":2}, {"x":15, "y":1.25}, {"x":16, "y":1.25}, {"x":17, "y":1.25}, {"x":0, "y":2.25, "w":1.5}, {"x":1.5, "y":2.25}, {"x":2.5, "y":2.25}, {"x":3.5, "y":2.25}, {"x":4.5, "y":2.25}, {"x":5.5, "y":2.25}, {"x":6.5, "y":2.25}, {"x":7.5, "y":2.25}, {"x":8.5, "y":2.25}, {"x":9.5, "y":2.25}, {"x":10.5, "y":2.25}, {"x":11.5, "y":2.25}, {"x":12.5, "y":2.25}, {"x":13.5, "y":2.25, "w":1.5}, {"x":15, "y":2.25}, {"x":16, "y":2.25}, {"x":17, "y":2.25}, {"x":0, "y":3.25, "w":1.75}, {"x":1.75, "y":3.25}, {"x":2.75, "y":3.25}, {"x":3.75, "y":3.25}, {"x":4.75, "y":3.25}, {"x":5.75, "y":3.25}, {"x":6.75, "y":3.25}, {"x":7.75, "y":3.25}, {"x":8.75, "y":3.25}, {"x":9.75, "y":3.25}, {"x":10.75, "y":3.25}, {"x":11.75, "y":3.25}, {"x":12.75, "y":3.25, "w":2.25}, {"x":15, "y":3.25}, {"x":16, "y":3.25}, {"x":17, "y":3.25}, {"x":0, "y":4.25, "w":2.25}, {"x":2.25, "y":4.25}, {"x":3.25, "y":4.25}, {"x":4.25, "y":4.25}, {"x":5.25, "y":4.25}, {"x":6.25, "y":4.25}, {"x":7.25, "y":4.25}, {"x":8.25, "y":4.25}, {"x":9.25, "y":4.25}, {"x":10.25, "y":4.25}, {"x":11.25, "y":4.25}, {"x":12.25, "y":4.25, "w":1.75}, {"x":14, "y":4.25}, {"x":15, "y":4.25}, {"x":16, "y":4.25}, {"x":17, "y":4.25}, {"x":1.25, "y":5.25, "w":1.25}, {"x":2.5, "y":5.25, "w":1.25}, {"x":3.75, "y":5.25, "w":6.25}, {"x":10, "y":5.25}, {"x":11, "y":5.25}, {"x":12, "y":5.25}, {"x":13, "y":5.25}, {"x":14, "y":5.25}, {"x":15, "y":5.25}, {"x":16, "y":5.25}] + } + } +}
\ No newline at end of file diff --git a/keyboards/gray_studio/hb85/keymaps/default/keymap.c b/keyboards/gray_studio/hb85/keymaps/default/keymap.c index f2409ea137..be89cbbf6a 100644 --- a/keyboards/gray_studio/hb85/keymaps/default/keymap.c +++ b/keyboards/gray_studio/hb85/keymaps/default/keymap.c @@ -1,5 +1,5 @@ /* -Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> +Copyright 2019 Felipe Coury <felipe.coury@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 @@ -26,7 +26,7 @@ enum layers { #define KC_TGCT MO(_CTRL) // Toggles CTRL layer const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BASE] = LAYOUT( + [_BASE] = LAYOUT_all( 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_TGCT, \ 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_BSPC, KC_PSLS, KC_PAST, KC_PMNS, \ 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_P7 , KC_P8 , KC_P9 , \ @@ -35,7 +35,7 @@ KC_LSFT, KC_NO , KC_Z , KC_Z , KC_X , KC_V , KC_B , KC_N , KC_M , KC_LCTL, KC_LALT, KC_SPC , KC_RALT, KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0 , KC_PDOT \ ), - [_CTRL] = LAYOUT( + [_CTRL] = LAYOUT_all( RESET , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, \ diff --git a/keyboards/gray_studio/hb85/keymaps/stt/keymap.c b/keyboards/gray_studio/hb85/keymaps/stt/keymap.c new file mode 100644 index 0000000000..5665e2f0e1 --- /dev/null +++ b/keyboards/gray_studio/hb85/keymaps/stt/keymap.c @@ -0,0 +1,38 @@ +/* +Copyright 2019 MechMerlin <mechmerlin@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 QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_stt( + 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, MO(1), \ + 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_PSLS, KC_PAST, KC_PMNS, \ + 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_P7, KC_P8, KC_P9, \ + 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_P4, KC_P5, KC_P6, \ + 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_P1, KC_P2, KC_P3, \ + KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0 \ + ), + + [1] = LAYOUT_stt( + RESET, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + EEP_RST, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + BL_TOGG, BL_STEP, BL_INC, BL_DEC, BL_BRTG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), +}; diff --git a/keyboards/gray_studio/hb85/readme.md b/keyboards/gray_studio/hb85/readme.md index 4e93607df3..c0c2fdf371 100644 --- a/keyboards/gray_studio/hb85/readme.md +++ b/keyboards/gray_studio/hb85/readme.md @@ -2,59 +2,47 @@ ![Gray Studio HB85](https://i.imgur.com/Sk3cupR.jpg) -A HitBit MSX Computer inspired Keyboard. +A Sony HitBit MSX Computer inspired Keyboard. Keyboard Maintainer: [Felipe Coury](https://github.com/fcoury) Hardware Supported: Gray Studio HB85 -Hardware Availability: Group buy finished +Hardware Availability: [Group buy](https://en.zfrontier.com/products/gray-hb85) finished Make example for this keyboard (after setting up your build environment): - make hb85:default + make gray_studio/hb85:default -See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. +Flashing +ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. -ps2avrGB keyboard firmware -========================== +**Reset Key:** Hold down the key located at `K00`, commonly programmed as F3 while plugging in the keyboard. -This keyboard uses the port of the QMK firmware for boards that are based on the -ps2avrGB firmware. +Windows: +1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). +2. Place your keyboard into reset. +3. Press the `Find Device` button and ensure that your keyboard is found. +4. Press the `Open .hex File` button and locate the `.hex` file you created. +5. Press the `Flash Device` button and wait for the process to complete. -Note that this is a complete replacement for the firmware, so you won't be -using Bootmapper Client to change any keyboard settings, since not all the -USB report options are supported. +macOS: +1. Install homebrew by typing the following: + ``` + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + ``` +2. Install `crosspack-avr`. + ``` + brew cask install crosspack-avr + ``` +3. Install the following packages: + ``` + brew install python3 + pip3 install pyusb + brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb -## Installing +4. Place your keyboard into reset. +5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. -First, install the requirements. These commands are for OSX, but all you -need is the AVR toolchain and `bootloadHID` for flashing: +**Please Note:** You will need to use the `EEP_RST` keycode first, followed by unplugging/replugging the board to get RGB underglow effects to work. -``` -$ brew cask install crosspack-avr -$ brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb -$ pip install pyusb -``` - -Then, with the keyboard plugged in, simply run this command from the -`qmk_firmware` directory: - -``` -$ make hb85 -$ bootloadHID -r hb85_default.hex -``` - -## Setting the board to bootloader mode - -Hold the F3 key while plugging the USB cable. - -## Troubleshooting - -From my experience, it's really hard to brick these boards. But these -tricks have been useful when it got stuck in a weird scenario. - -1. Try plugging the board in while holding the bootloader key. This will force - it to boot only the bootloader without loading the firmware. Once this is - done, just reflash the board with the original firmware. -2. Sometimes USB hubs can act weird, so try connecting the board directly - to your computer or plugging/unplugging the USB hub. +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/gray_studio/hb85/rules.mk b/keyboards/gray_studio/hb85/rules.mk index f906105766..c3e17e4932 100644 --- a/keyboards/gray_studio/hb85/rules.mk +++ b/keyboards/gray_studio/hb85/rules.mk @@ -1,4 +1,4 @@ -# Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> +# Copyright 2019 fcoury <felipe.coury@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 @@ -31,7 +31,7 @@ F_CPU = 12000000 BOOTLOADER = bootloadHID # build options -BOOTMAGIC_ENABLE = full +BOOTMAGIC_ENABLE = no MOUSEKEY_ENABLE = no EXTRAKEY_ENABLE = yes CONSOLE_ENABLE = yes @@ -42,7 +42,7 @@ RGBLIGHT_CUSTOM_DRIVER = yes OPT_DEFS = -DDEBUG_LEVEL=0 -SRC += i2c.c +SRC += i2c_master.c # programming options PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/gray_studio/hb85/usbconfig.h b/keyboards/gray_studio/hb85/usbconfig.h index 3d5aaa7708..c52c90ce8a 100644 --- a/keyboards/gray_studio/hb85/usbconfig.h +++ b/keyboards/gray_studio/hb85/usbconfig.h @@ -8,8 +8,7 @@ * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ */ -#ifndef __usbconfig_h_included__ -#define __usbconfig_h_included__ +#pragma once #include "config.h" @@ -392,5 +391,3 @@ section at the end of this file). /* #define USB_INTR_PENDING EIFR */ #define USB_INTR_PENDING_BIT INTF1 #define USB_INTR_VECTOR INT1_vect - -#endif /* __usbconfig_h_included__ */ diff --git a/keyboards/hadron/ver2/keymaps/default/keymap.c b/keyboards/hadron/ver2/keymaps/default/keymap.c index 9b50abd401..9d96abd8db 100644 --- a/keyboards/hadron/ver2/keymaps/default/keymap.c +++ b/keyboards/hadron/ver2/keymaps/default/keymap.c @@ -1,7 +1,4 @@ #include QMK_KEYBOARD_H -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif #ifdef USE_I2C #include "i2c.h" #endif diff --git a/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/config.h b/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/config.h index 682c7a868b..6b0ddbfe8e 100644 --- a/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/config.h +++ b/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/config.h @@ -20,8 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #pragma once -#include "../../config.h" - /* Use I2C or Serial, not both */ #define USE_SERIAL diff --git a/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/keymap.c b/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/keymap.c index 24c02215ee..2e5cfd7ced 100644 --- a/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/keymap.c +++ b/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/keymap.c @@ -1,6 +1,4 @@ -#include "dactyl_manuform.h" -#include "action_layer.h" -#include "eeconfig.h" +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; @@ -126,4 +124,3 @@ void persistent_default_layer_set(uint16_t default_layer) { eeconfig_update_default_layer(default_layer); default_layer_set(default_layer); } - diff --git a/keyboards/handwired/frenchdev/keymaps/default/keymap.c b/keyboards/handwired/frenchdev/keymaps/default/keymap.c index 3d0f1fbfb8..506383a1bb 100644 --- a/keyboards/handwired/frenchdev/keymaps/default/keymap.c +++ b/keyboards/handwired/frenchdev/keymaps/default/keymap.c @@ -394,5 +394,3 @@ void led_set_user(uint8_t usb_led) { } return ; } - - diff --git a/keyboards/handwired/frenchdev/readme.md b/keyboards/handwired/frenchdev/readme.md index 9d7c59e71f..96825bb799 100644 --- a/keyboards/handwired/frenchdev/readme.md +++ b/keyboards/handwired/frenchdev/readme.md @@ -19,7 +19,6 @@ with the added possibility to connect up to 6 external switches like pedals, ## Laser-cuttable file There is intentionnaly no hole for the TRRS connector, you are supposed to use a drill for it. This way if you don't want to use the pedals you don't have a useless hole. Plus it's cleaner. -http://qmk.fm/frenchdev/frenchdev_v1_lasercut_template.svg ## Side stickers You can find my original file here : http://qmk.fm/frenchdev/example_printable_stickers.svg diff --git a/keyboards/handwired/hacked_motospeed/config.h b/keyboards/handwired/hacked_motospeed/config.h new file mode 100644 index 0000000000..59300e0d27 --- /dev/null +++ b/keyboards/handwired/hacked_motospeed/config.h @@ -0,0 +1,249 @@ +/* +Copyright 2019 Vladislav Opara <Deckweiss75@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 "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0690 +#define DEVICE_VER 0x0001 +#define MANUFACTURER MMO_Corp +#define PRODUCT hacked_motospeed +#define DESCRIPTION Motospeed Numpads wired to Teensy++2.0 + +/* key matrix size */ +#define MATRIX_ROWS 10 +#define MATRIX_COLS 12 + +/* + * 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) + * +*/ + +// WR XR YR ZR VR ZL YL XL WL VL +#define MATRIX_ROW_PINS { B3, B5, F1, B4, B6, D5, D4, D6, D7, C4} + +// ER DR CR BR AR FR FL AL BL CL DL EL +#define MATRIX_COL_PINS { F7, F6, F5, F4, F3, F2, E0, E1, C0, C1, C2, C3 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +//#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +//#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +#define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* 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. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* 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_HELP H +//#define MAGIC_KEY_HELP_ALT 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 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#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 B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#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 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0
\ No newline at end of file diff --git a/keyboards/handwired/hacked_motospeed/hacked_motospeed.c b/keyboards/handwired/hacked_motospeed/hacked_motospeed.c new file mode 100644 index 0000000000..21643895d7 --- /dev/null +++ b/keyboards/handwired/hacked_motospeed/hacked_motospeed.c @@ -0,0 +1,43 @@ +/* Copyright 2019 Vladislav Opara <Deckweiss75@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 "hacked_motospeed.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +}
\ No newline at end of file diff --git a/keyboards/handwired/hacked_motospeed/hacked_motospeed.h b/keyboards/handwired/hacked_motospeed/hacked_motospeed.h new file mode 100644 index 0000000000..1063fd2e62 --- /dev/null +++ b/keyboards/handwired/hacked_motospeed/hacked_motospeed.h @@ -0,0 +1,46 @@ +/* Copyright 2019 Vladislav Opara <Deckweiss75@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" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + EWR, DWR, CWR, BWR, AWR, FXR, FYL, AZL, BZL, CZL, DZL, \ + DXR, CXR, BXR, AXR, FZR, DVL, AYL, BYL, CYL, DYL, EZL, \ + EZR, DYR, CYR, BYR, AYR, DVR, FZL, AXL, BXL, CXL, DXL, \ + DZR, CZR, BZR, AZR, FYR, FXL, AWL, BWL, CWL, DWL, EWL \ +) \ +{ \ + { EWR, DWR, CWR, BWR, AWR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, DXR, CXR, BXR, AXR, FXR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, DYR, CYR, BYR, AYR, FYR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { EZR, DZR, CZR, AZR, BZR, FZR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, DVR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, FZL, BZL, AZL, CZL, DZL, EZL }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, FYL, AYL, BYL, CYL, DYL, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, FXL, AXL, BXL, CXL, DXL, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, AWL, BWL, CWL, DWL, EWL }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, DVL, KC_NO } \ +} diff --git a/keyboards/handwired/hacked_motospeed/info.json b/keyboards/handwired/hacked_motospeed/info.json new file mode 100644 index 0000000000..7ca92785eb --- /dev/null +++ b/keyboards/handwired/hacked_motospeed/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Hacked Motospeed", + "url": "", + "maintainer": "Deckweiss", + "width": 13, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [{"label":"ESC", "x":0, "y":0, "h":2}, {"label":"Q", "x":1, "y":0}, {"label":"W", "x":2, "y":0}, {"label":"E", "x":3, "y":0}, {"label":"R", "x":4, "y":0}, {"label":"T", "x":5, "y":0}, {"label":"Z", "x":7, "y":0}, {"label":"U", "x":8, "y":0}, {"label":"I", "x":9, "y":0}, {"label":"O", "x":10, "y":0}, {"label":"P", "x":11, "y":0, "w":2}, {"label":"A", "x":1, "y":1}, {"label":"S", "x":2, "y":1}, {"label":"D", "x":3, "y":1}, {"label":"F", "x":4, "y":1}, {"label":"G", "x":5, "y":1}, {"label":"H", "x":7, "y":1}, {"label":"J", "x":8, "y":1}, {"label":"K", "x":9, "y":1}, {"label":"L", "x":10, "y":1}, {"label":"(", "x":11, "y":1}, {"label":")", "x":12, "y":1}, {"label":"=", "x":0, "y":2}, {"label":"Y", "x":1, "y":2}, {"label":"X", "x":2, "y":2}, {"label":"C", "x":3, "y":2}, {"label":"V", "x":4, "y":2}, {"label":"B", "x":5, "y":2}, {"label":"N", "x":7, "y":2}, {"label":"M", "x":8, "y":2}, {"label":",", "x":9, "y":2}, {"label":".", "x":10, "y":2}, {"label":"?", "x":11, "y":2}, {"label":"Fn", "x":0, "y":3, "w":2}, {"label":"Num", "x":2, "y":3}, {"label":"Bksp", "x":3, "y":3}, {"label":"Enter", "x":4, "y":3}, {"label":"Spc", "x":5, "y":3}, {"label":"LShift", "x":7, "y":3}, {"label":"LCtrl", "x":8, "y":3}, {"label":"LAlt", "x":9, "y":3}, {"label":"RAlt", "x":10, "y":3}, {"label":"Meta", "x":11, "y":3}, {"label":"Fn", "x":12, "y":2, "h":2}] + } + } +}
\ No newline at end of file diff --git a/keyboards/handwired/hacked_motospeed/keymaps/default/config.h b/keyboards/handwired/hacked_motospeed/keymaps/default/config.h new file mode 100644 index 0000000000..72de214ba7 --- /dev/null +++ b/keyboards/handwired/hacked_motospeed/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 Vladislav Opara <Deckweiss75@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 + +// place overrides here
\ No newline at end of file diff --git a/keyboards/handwired/hacked_motospeed/keymaps/default/keymap.c b/keyboards/handwired/hacked_motospeed/keymaps/default/keymap.c new file mode 100644 index 0000000000..bdec8f2461 --- /dev/null +++ b/keyboards/handwired/hacked_motospeed/keymaps/default/keymap.c @@ -0,0 +1,65 @@ +/* Copyright 2019 Vladislav Opara <Deckweiss75@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 QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \ + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_LPRN, KC_RPRN, \ + KC_PEQL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_QUES, \ + XXXXXXX, XXXXXXX, KC_BSPC, KC_ENT, KC_SPC, KC_LSFT, KC_LCTRL, KC_LALT, KC_ALGR, KC_LWIN, XXXXXXX \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +}
\ No newline at end of file diff --git a/keyboards/handwired/hacked_motospeed/keymaps/default/readme.md b/keyboards/handwired/hacked_motospeed/keymaps/default/readme.md new file mode 100644 index 0000000000..4c740bd9a5 --- /dev/null +++ b/keyboards/handwired/hacked_motospeed/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for hacked_motospeed
\ No newline at end of file diff --git a/keyboards/handwired/hacked_motospeed/readme.md b/keyboards/handwired/hacked_motospeed/readme.md new file mode 100644 index 0000000000..ac2d4afc28 --- /dev/null +++ b/keyboards/handwired/hacked_motospeed/readme.md @@ -0,0 +1,23 @@ +# hacked_motospeed + +This is a + - tiny (44key), + - budget (~50€ total expense), + - portable (HID bluetooth & 5aH battery) + - easy to diy (little wiring & soldering needed), + +mechanical keyboard. +It is made by wiring two Motospeed K22 numpads to a Teensy++ 2.0, while reusing as much of the original PCB as possible. +The numpads come with Outemu red linear switches. +(A detailed guide will be posted and linked later) + + +Keyboard Maintainer: [Deckweiss](https://github.com/Deckweiss) +Hardware Supported: Motospeed K22 numpads wired to Teensy++ 2.0 according to my guide (upcoming). +Hardware Availability: Ebay, AliExpress + +Make example for this keyboard (after setting up your build environment): + + make handwired/hacked_motospeed:default + +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).
\ No newline at end of file diff --git a/keyboards/handwired/hacked_motospeed/rules.mk b/keyboards/handwired/hacked_motospeed/rules.mk new file mode 100644 index 0000000000..1dc955718f --- /dev/null +++ b/keyboards/handwired/hacked_motospeed/rules.mk @@ -0,0 +1,81 @@ +# MCU name +MCU = at90usb1286 +#MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = halfkay + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=1024 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
\ No newline at end of file diff --git a/keyboards/handwired/hexon38/keymaps/default/keymap.c b/keyboards/handwired/hexon38/keymaps/default/keymap.c index c3805991f0..65dfb4ca04 100644 --- a/keyboards/handwired/hexon38/keymaps/default/keymap.c +++ b/keyboards/handwired/hexon38/keymaps/default/keymap.c @@ -1,6 +1,6 @@ // see https://github.com/pepaslabs/hexon38 -#include "hexon38.h" +#include QMK_KEYBOARD_H #define A_ KC_A #define B_ KC_B diff --git a/keyboards/handwired/jot50/config.h b/keyboards/handwired/jot50/config.h new file mode 100644 index 0000000000..2dfcfd2d28 --- /dev/null +++ b/keyboards/handwired/jot50/config.h @@ -0,0 +1,38 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Jotix +#define PRODUCT Jot50 +#define DESCRIPTION A 5x12 compact ortholinear keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 12 + +/* pro_micro pin-out */ +#define MATRIX_ROW_PINS { D7, E6, B4, B6, B2 } +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, D3, D2, D1, D0, D4, C6 } +#define UNUSED_PINS + +/* leds */ +#define BACKLIGHT_LEVELS 3 +#define BACKLIGHT_PIN B5 +#define BACKLIGHT_BREATHING +#define BREATHING_PERIOD 5 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* 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 diff --git a/keyboards/handwired/jot50/jot50.c b/keyboards/handwired/jot50/jot50.c new file mode 100644 index 0000000000..a1d2258a58 --- /dev/null +++ b/keyboards/handwired/jot50/jot50.c @@ -0,0 +1,6 @@ +#include "jot50.h" + +void matrix_init_kb(void) { + + matrix_init_user(); +} diff --git a/keyboards/handwired/jot50/jot50.h b/keyboards/handwired/jot50/jot50.h new file mode 100644 index 0000000000..b7e67ae61f --- /dev/null +++ b/keyboards/handwired/jot50/jot50.h @@ -0,0 +1,19 @@ +#pragma once + +#include "quantum.h" + + +#define LAYOUT_ortho_5x12( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b } \ +} diff --git a/keyboards/handwired/jot50/keymaps/default/keymap.c b/keyboards/handwired/jot50/keymaps/default/keymap.c new file mode 100644 index 0000000000..4ec535c31d --- /dev/null +++ b/keyboards/handwired/jot50/keymaps/default/keymap.c @@ -0,0 +1,84 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 3 + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +/* Funct + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + * | caps | F11 | F12 | | | | | - | = | [ | ] | \ | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + * | | vol- | mute | vol+ | | | | _ | + | { | } | | | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + * | | prev | play | next | | | | | | | | | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + * | | | | | | | | | home | pgdn | pgup | end | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + */ +#define _FUNCT LAYOUT_ortho_5x12 (\ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______,\ + KC_CAPS, KC_F11, KC_F12, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,\ + _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,\ + _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, _______, _______, _______, _______, _______,\ + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END\ +) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + * | esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | bspc | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + * | ` | Q | W | E | R | T | Y | U | I | O | P | del | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + * | tab | A | S | D | F | G | H | J | K | L | ; | ' | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + * | lshift | Z | X | C | V | B | N | M | , | . | / | enter | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + * | lctrl | lgui | lalt | ralt | lower | space | space | raise | left | down | up | right | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + */ +[_QWERTY] = LAYOUT_ortho_5x12 ( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + KC_LCTL, KC_LGUI, KC_LALT, KC_RALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +[_LOWER] = _FUNCT, + +[_RAISE] = _FUNCT, + +[_ADJUST] = LAYOUT_ortho_5x12 ( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RESET, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, BL_STEP, BL_BRTG, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +void matrix_init_user(void) { +} + diff --git a/keyboards/handwired/jot50/readme.md b/keyboards/handwired/jot50/readme.md new file mode 100644 index 0000000000..4c22b953d7 --- /dev/null +++ b/keyboards/handwired/jot50/readme.md @@ -0,0 +1,35 @@ +# Jot50 + +A compact 50% (12x5) ortholinear keyboard kit inspired in the Preonic made by jotix. + +Keyboard Maintainer: [jotix](https://github.com/jotix) +Hardware Supported: Arduino Pro Micro + +### Arduino Pro Micro Pinout + +| Rows | 0 | 1 | 2 | 3 | 4 | +|-------------|----|----|----|----|----| +| Arduino pin | 6 | 7 | 8 | 10 | 16 | +| QMK pin | D7 | E6 | B4 | B6 | B2 | + +| Columns | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | +|-------------|----|----|----|----|----|----|-----|-----|----|----|----|----| +| Arduino pin | A3 | A2 | A1 | A0 | 15 | 14 | TX0 | RXI | 2 | 3 | 4 | 5 | +| QMK pin | F4 | F5 | F6 | F7 | B1 | B3 | D3 | D2 | D1 | D0 | D4 | C6 | + +| | Backlight | +|-------------|-----------| +| Arduino pin | 9 | +| QMK pin | B5 | + +### Compiling the Firmware + +Make example for this keyboard (after setting up your build environment): + + make handwired/jot50:default + +### The Defaukt Keymap + +![Default Keymap](https://i.imgur.com/g85V8K6.png) + +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/handwired/jot50/rules.mk b/keyboards/handwired/jot50/rules.mk new file mode 100644 index 0000000000..36a100c963 --- /dev/null +++ b/keyboards/handwired/jot50/rules.mk @@ -0,0 +1,66 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +API_SYSEX_ENABLE = no + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +LAYOUTS = ortho_5x12 diff --git a/keyboards/handwired/jotanck/config.h b/keyboards/handwired/jotanck/config.h index d7707d48fb..38b77586ec 100644 --- a/keyboards/handwired/jotanck/config.h +++ b/keyboards/handwired/jotanck/config.h @@ -23,6 +23,8 @@ #define QMK_LED B4 #define BACKLIGHT_LEVELS 3 #define BACKLIGHT_PIN B5 +#define BACKLIGHT_BREATHING +#define BREATHING_PERIOD 5 /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW diff --git a/keyboards/handwired/jotanck/jotanck.h b/keyboards/handwired/jotanck/jotanck.h index e8dd93edaf..e253940ddc 100644 --- a/keyboards/handwired/jotanck/jotanck.h +++ b/keyboards/handwired/jotanck/jotanck.h @@ -13,5 +13,5 @@ { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ - { k30, k31, k32, k33, k34, k35, k35, k37, k38, k39, k3a, k3b } \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b } \ } diff --git a/keyboards/handwired/jotanck/keymaps/default/keymap.c b/keyboards/handwired/jotanck/keymaps/default/keymap.c index 77c144890b..2e9f4a39f2 100644 --- a/keyboards/handwired/jotanck/keymaps/default/keymap.c +++ b/keyboards/handwired/jotanck/keymaps/default/keymap.c @@ -15,10 +15,6 @@ extern keymap_config_t keymap_config; #define _RAISE 2 #define _ADJUST 3 -enum planck_keycodes { - BACKLIT = SAFE_RANGE -}; - #define LOWER MO(_LOWER) #define RAISE MO(_RAISE) @@ -32,21 +28,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ * | lshift | Z | X | C | V | B | N | M | , | . | / | enter | * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ - * |backlit | lctrl | lgui | lalt | lower | space | space | raise | left | down | up | right | + * | lctrl | lgui | lalt | ralt | lower | space | space | raise | left | down | up | right | * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ */ [_QWERTY] = LAYOUT_ortho_4x12 ( KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, - BACKLIT, KC_LCTL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + KC_LCTL, KC_LGUI, KC_LALT, KC_RALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT ), /* Lower * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ - * | | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * | caps | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | | | * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ @@ -55,7 +51,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_LOWER] = LAYOUT_ortho_4x12 ( KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), @@ -78,12 +74,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END ), +/* Adjust */ [_ADJUST] = LAYOUT_ortho_4x12 ( - _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RESET, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, BL_STEP, BL_BRTG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -), +), }; uint32_t layer_state_set_user(uint32_t state) { @@ -93,23 +90,3 @@ uint32_t layer_state_set_user(uint32_t state) { void matrix_init_user(void) { } -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - - case BACKLIT: - if (record->event.pressed) { - register_code(KC_RSFT); - #ifdef BACKLIGHT_ENABLE - backlight_step(); - #endif - } else { - unregister_code(KC_RSFT); - } - return false; - break; - - default: - return true; - - } -} diff --git a/keyboards/handwired/jotanck/readme.md b/keyboards/handwired/jotanck/readme.md index e06cce8cf1..28bbab86bd 100644 --- a/keyboards/handwired/jotanck/readme.md +++ b/keyboards/handwired/jotanck/readme.md @@ -33,6 +33,6 @@ Make example for this keyboard (after setting up your build environment): ### The Defaukt Keymap -![Default Keymap](https://i.imgur.com/Fh7g1AQ.jpg) +![Default Keymap](https://i.imgur.com/xh7Dmd7.png) 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/handwired/jotanck/rules.mk b/keyboards/handwired/jotanck/rules.mk index 6c32634461..6b39b7cc1a 100644 --- a/keyboards/handwired/jotanck/rules.mk +++ b/keyboards/handwired/jotanck/rules.mk @@ -48,7 +48,7 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = yes # Console for debug(+400) COMMAND_ENABLE = no # Commands for debug and configuration diff --git a/keyboards/handwired/lovelive9/config.h b/keyboards/handwired/lovelive9/config.h new file mode 100644 index 0000000000..c11a25df60 --- /dev/null +++ b/keyboards/handwired/lovelive9/config.h @@ -0,0 +1,39 @@ + + +#pragma once +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0007 +#define DEVICE_VER 0x0001 +#define MANUFACTURER numazu Keyboards +#define PRODUCT lovelive9 +#define DESCRIPTION lovelive sunshine Keyboards 9Key + +/* key matrix size */ +#define MATRIX_ROWS 1 +#define MATRIX_COLS 9 + +/* default pin-out */ +#define MATRIX_ROW_PINS { NO_PIN } +#define MATRIX_COL_PINS { B4, B6, B2, D7, B1, F7, F6, F5, F4 } + +#define UNUSED_PINS + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 + +#define RGBLED_NUM 9 // Number of LEDs + +#define RGBLIGHT_ANIMATIONS +#define BACKLIGHT_LEVELS 5 +#define RGBLIGHT_EFFECT_SNAKE_LENGTH 4 +#define BREATHING_PERIOD 2 +#define RGBLIGHT_LIMIT_VAL 255 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 +#define USB_MAX_POWER_CONSUMPTION 400 + +#define TAPPING_TERM 200 diff --git a/keyboards/handwired/lovelive9/info.json b/keyboards/handwired/lovelive9/info.json new file mode 100644 index 0000000000..4f81d321d9 --- /dev/null +++ b/keyboards/handwired/lovelive9/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "lovelive9", + "url": "https://github.com/ginjake", + "maintainer": "ginjake", + "width": 9, + "height": 1, + "layouts": { + "LAYOUT": { + "layout": [{"label":"k00", "x":0, "y":0}, {"label":"k01", "x":1, "y":0}, {"label":"k02", "x":2, "y":0}, {"label":"k03", "x":3, "y":0}, {"label":"k04", "x":4, "y":0}, {"label":"k05", "x":5, "y":0}, {"label":"k06", "x":6, "y":0}, {"label":"k07", "x":7, "y":0}, {"label":"k08", "x":8, "y":0}] + } + } +} diff --git a/keyboards/handwired/lovelive9/keymaps/default/keymap.c b/keyboards/handwired/lovelive9/keymaps/default/keymap.c new file mode 100644 index 0000000000..605f722f44 --- /dev/null +++ b/keyboards/handwired/lovelive9/keymaps/default/keymap.c @@ -0,0 +1,338 @@ +#include QMK_KEYBOARD_H + +//#include "v1.h" + +//Following line allows macro to read current RGB settings + +rgblight_config_t RGB_current_config; + +#define KC_KANJI KC_GRV + + +enum Layer +{ + _QWERTY, + _DIA, + _YOU, + _CHIKA, + _ZURA, + _RUBY, + _YOHANE, + _RIKO, + _MARI, + _KANAN, + _RUBY_SUB1, + _RUBY_SUB2, + _RUBY_SUB3, + _SCHOOL_IDOL_FESTIVAL +}; + +#define SEND_DIA 100 +#define SEND_YOU 101 +#define SEND_CHIKA 102 +#define SEND_ZURA 103 +#define SEND_RUBY 104 +#define SEND_YOHANE 105 +#define SEND_RIKO 106 +#define SEND_MARI 107 +#define SEND_KANAN 108 + + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + DIA, + YOU, + CHIKA, + ZURA, + RUBY, + RUBY_SUB1, + RUBY_SUB2, + RUBY_SUB3, + YOHANE, + RIKO, + MARI, + KANAN, + TO_SCHOOL_IDOL_FESTIVAL, + RETURN_SCHOOL_IDOL_FESTIVAL +}; + + +int long_tap_timer; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT( + DIA, YOU, CHIKA, ZURA, RUBY, YOHANE, RIKO, MARI, KANAN + ), + [_DIA] = LAYOUT( + DIA, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_LSFT + ), + + [_YOU] = LAYOUT( + KC_H, YOU, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_LSFT + ), + + [_CHIKA] = LAYOUT( + KC_O, KC_P, CHIKA, KC_Q, KC_R, KC_S, KC_T, KC_U, KC_LSFT + ), + + [_ZURA] = LAYOUT( + KC_V, KC_W, KC_X, ZURA, KC_Y, KC_Z, KC_M, KC_N, KC_LSFT + ), + + //推しをたくさん押せるようにルビーちゃんには複数のレイヤー設定 + [_RUBY] = LAYOUT( + KC_CIRC, KC_LPRN, KC_QUOT, RUBY_SUB1, RUBY, RUBY_SUB2, KC_LCBR, KC_EXLM, KC_LSFT + ), + [_RUBY_SUB1] = LAYOUT( + KC_RCBR, KC_AT, KC_PIPE, RUBY_SUB1, RUBY, RUBY_SUB2, KC_HASH, KC_EQL, KC_LSFT + ), + [_RUBY_SUB2] = LAYOUT( + KC_TILD, KC_DLR, KC_LBRC, RUBY_SUB1, RUBY, RUBY_SUB2, KC_PERC, KC_RBRC, KC_LSFT + ), + [_RUBY_SUB3] = LAYOUT( + TO_SCHOOL_IDOL_FESTIVAL, KC_DLR, KC_LBRC, RUBY_SUB1, RUBY, RUBY_SUB2, KC_PERC, KC_RBRC, RETURN_SCHOOL_IDOL_FESTIVAL + ), + + [_YOHANE] = LAYOUT( + KC_0, KC_1, KC_2, KC_3, KC_4, YOHANE, KC_5, KC_6, KC_LSFT + ), + + [_RIKO] = LAYOUT( + KC_7, KC_8, KC_9, KC_PLUS, KC_MINS, KC_ASTR, RIKO, KC_SLSH, KC_LSFT + ), + + [_MARI] = LAYOUT( + KC_TAB, KC_DEL, KC_COMM, KC_SPC, KC_ENT, KC_BSPC, KC_DOT, MARI, KC_LSFT + ), + + [_KANAN] = LAYOUT( + KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_ENT, KC_BSPC, KC_AMPR, KC_KANJI, KANAN + ), + [_SCHOOL_IDOL_FESTIVAL] = LAYOUT( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9 + ), +}; + +void check_tap_and_send_key(int MEMBER) { + if (long_tap_timer < 500) { + switch (MEMBER) { + case SEND_DIA: + SEND_STRING("KUROSAWA DIA"); + break; + case SEND_YOU: + SEND_STRING("WATANABE YOU"); + break; + case SEND_CHIKA: + SEND_STRING("TAKAMI CHIKA"); + break; + case SEND_ZURA: + SEND_STRING("KUNIKIDA HANAMARU"); + break; + case SEND_RUBY: + SEND_STRING("KUROSAWA RUBY"); + break; + case SEND_YOHANE: + SEND_STRING("TSUSHIMA YOSHIKO"); + break; + case SEND_RIKO: + SEND_STRING("SAKURAUCHI RIKO"); + break; + case SEND_MARI: + SEND_STRING("OHARA MARI"); + break; + case SEND_KANAN: + SEND_STRING("MATSUURA KANAN"); + break; + } + } + long_tap_timer = 0; +} + +int aqours_color_h[] = { 26, 340, 150, 0, 199, 220, 53, 265, 322}; +int aqours_color_s[] = {255, 165, 255, 255, 255, 350, 255, 255, 255}; +int aqours_color_v[] = {255, 255, 255, 255, 255, 255, 200, 255, 255}; + +void LED_default_set(void) { + + sethsv(aqours_color_h[2], aqours_color_s[2], aqours_color_v[2], (LED_TYPE *)&led[0]); + sethsv(aqours_color_h[7], aqours_color_s[7], aqours_color_v[7], (LED_TYPE *)&led[1]); + sethsv(aqours_color_h[1], aqours_color_s[1], aqours_color_v[1], (LED_TYPE *)&led[2]); + sethsv(aqours_color_h[5], aqours_color_s[5], aqours_color_v[5], (LED_TYPE *)&led[3]); + sethsv(aqours_color_h[8], aqours_color_s[8], aqours_color_v[8], (LED_TYPE *)&led[4]); + sethsv(aqours_color_h[6], aqours_color_s[6], aqours_color_v[6], (LED_TYPE *)&led[5]); + sethsv(aqours_color_h[0], aqours_color_s[0], aqours_color_v[0], (LED_TYPE *)&led[6]); + sethsv(aqours_color_h[4], aqours_color_s[4], aqours_color_v[4], (LED_TYPE *)&led[7]); + sethsv(aqours_color_h[3], aqours_color_s[3], aqours_color_v[3], (LED_TYPE *)&led[8]); + + rgblight_set(); + +} + + +void LED_layer_set(int aqours_index) { + for (int c = 0; c < 9; c++) { + sethsv(aqours_color_h[aqours_index], aqours_color_s[aqours_index], aqours_color_v[aqours_index], (LED_TYPE *)&led[c]); + } + rgblight_set(); +} + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + switch (keycode) { + + case DIA: + if (record->event.pressed) { + long_tap_timer = 1; + layer_on(_DIA); + LED_layer_set(3); + } else { + check_tap_and_send_key(SEND_DIA); + layer_off(_DIA); + LED_default_set(); + } + break; + + case YOU: + if (record->event.pressed) { + long_tap_timer = 1; + layer_on(_YOU); + LED_layer_set(4); + } else { + check_tap_and_send_key(SEND_YOU); + layer_off(_YOU); + LED_default_set(); + } + break; + + case CHIKA: + if (record->event.pressed) { + long_tap_timer = 1; + layer_on(_CHIKA); + LED_layer_set(0); + } else { + check_tap_and_send_key(SEND_CHIKA); + layer_off(_CHIKA); + LED_default_set(); + } + break; + + case ZURA: + if (record->event.pressed) { + long_tap_timer = 1; + layer_on(_ZURA); + LED_layer_set(6); + } else { + check_tap_and_send_key(SEND_ZURA); + layer_off(_ZURA); + LED_default_set(); + } + break; + + case RUBY: + if (record->event.pressed) { + long_tap_timer = 1; + layer_on(_RUBY); + LED_layer_set(8); + } else { + check_tap_and_send_key(SEND_RUBY); + layer_off(_RUBY); + LED_default_set(); + } + break; + case RUBY_SUB1: + if (record->event.pressed) { + layer_on(_RUBY_SUB1); + if (IS_LAYER_ON(_RUBY_SUB1) && IS_LAYER_ON(_RUBY_SUB2)) { + layer_on(_RUBY_SUB3); + } else { + layer_off(_RUBY_SUB3); + } + } else { + layer_off(_RUBY_SUB1); + } + break; + case RUBY_SUB2: + if (record->event.pressed) { + layer_on(_RUBY_SUB2); + if (IS_LAYER_ON(_RUBY_SUB1) && IS_LAYER_ON(_RUBY_SUB2)) { + layer_on(_RUBY_SUB3); + } else { + layer_off(_RUBY_SUB3); + } + } else { + layer_off(_RUBY_SUB2); + } + break; + + case YOHANE: + if (record->event.pressed) { + long_tap_timer = 1; + layer_on(_YOHANE); + LED_layer_set(5); + } else { + check_tap_and_send_key(SEND_YOHANE); + layer_off(_YOHANE); + LED_default_set(); + } + break; + + case RIKO: + if (record->event.pressed) { + long_tap_timer = 1; + layer_on(_RIKO); + LED_layer_set(1); + } else { + check_tap_and_send_key(SEND_RIKO); + layer_off(_RIKO); + LED_default_set(); + } + break; + + case MARI: + if (record->event.pressed) { + long_tap_timer = 1; + layer_on(_MARI); + LED_layer_set(7); + } else { + check_tap_and_send_key(SEND_MARI); + layer_off(_MARI); + LED_default_set(); + } + break; + + case KANAN: + if (record->event.pressed) { + long_tap_timer = 1; + layer_on(_KANAN); + LED_layer_set(2); + } else { + check_tap_and_send_key(SEND_KANAN); + layer_off(_KANAN); + LED_default_set(); + } + break; + + case TO_SCHOOL_IDOL_FESTIVAL: + if (record->event.pressed) { + LED_default_set(); + layer_on(_SCHOOL_IDOL_FESTIVAL); + } + break; + case RETURN_SCHOOL_IDOL_FESTIVAL: + if (record->event.pressed) { + layer_off(_SCHOOL_IDOL_FESTIVAL); + } + break; + } + + return true; +} + + +void matrix_scan_user(void) { + + if (long_tap_timer > 0) { + long_tap_timer++; + } +} diff --git a/keyboards/handwired/lovelive9/lovelive9.c b/keyboards/handwired/lovelive9/lovelive9.c new file mode 100644 index 0000000000..1ec8ae0527 --- /dev/null +++ b/keyboards/handwired/lovelive9/lovelive9.c @@ -0,0 +1,7 @@ +#include "lovelive9.h" + + + +void matrix_init_kb(void) { + matrix_init_user(); +} diff --git a/keyboards/handwired/lovelive9/lovelive9.h b/keyboards/handwired/lovelive9/lovelive9.h new file mode 100644 index 0000000000..f6fb1f94cc --- /dev/null +++ b/keyboards/handwired/lovelive9/lovelive9.h @@ -0,0 +1,9 @@ +#pragma once + +#include "quantum.h" +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08 \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08 } \ +} diff --git a/keyboards/handwired/lovelive9/readme.md b/keyboards/handwired/lovelive9/readme.md new file mode 100644 index 0000000000..2046472773 --- /dev/null +++ b/keyboards/handwired/lovelive9/readme.md @@ -0,0 +1,14 @@ +# lovelive9 + +lovelive9 is 9keys keyboard. + +![lovelive9](https://user-images.githubusercontent.com/16838187/53496102-a6fc0700-3ae4-11e9-85e4-1e6cd981b410.jpg) + +Keyboard Maintainer: [ginjake](https://github.com/ginjake) [Twitter:@sirojake](https://twitter.com/sirojake) +Hardware Supported: Pro Micro, handwired (LED used [CherryMXLEDBitBoard](https://github.com/swanmatch/MxLEDBitPCB) with handwired) + +Make example for this keyboard (after setting up your build environment): + + make handwired/lovelive9:default + +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/#/n diff --git a/keyboards/handwired/lovelive9/rules.mk b/keyboards/handwired/lovelive9/rules.mk new file mode 100644 index 0000000000..99a531a638 --- /dev/null +++ b/keyboards/handwired/lovelive9/rules.mk @@ -0,0 +1,67 @@ +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +BOOTLOADER = caterina + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. + + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/handwired/maartenwut/keymaps/default/keymap.c b/keyboards/handwired/maartenwut/keymaps/default/keymap.c index d318b04233..54276d4b20 100755 --- a/keyboards/handwired/maartenwut/keymaps/default/keymap.c +++ b/keyboards/handwired/maartenwut/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -#include "maartenwut.h" +#include QMK_KEYBOARD_H #define _MA 0 #define _NU 1 diff --git a/keyboards/handwired/magicforce61/README.md b/keyboards/handwired/magicforce61/README.md deleted file mode 100644 index cc86732627..0000000000 --- a/keyboards/handwired/magicforce61/README.md +++ /dev/null @@ -1,24 +0,0 @@ -Magicforce "61" Handwired -======================= - -Basically I cut 7 keys off the magicforce68 and handwired everything to a -teensy++ 2.0 to make it a ~60% board. - -## Wiring Layout - -![Wiring Layout](https://imgur.com/gallery/RxYyA) - -## Pinout - -The following pins are used: - - ``` - #define MATRIX_ROW_PINS { D0, D1, D2, D3, D4 } - #define MATRIX_COL_PINS { B5, B4, B3, B2, B1, B0, E7, E6, F0, F1, F2, F3, F4, F5 } - ``` - -## Compiling and loading the firmware - -To build the firmware, run `make handwired/magicforce61`. - -Flash the firmware using the teensy loader or avrdude. diff --git a/keyboards/handwired/magicforce61/config.h b/keyboards/handwired/magicforce61/config.h index c6c689ab6c..3dc74f83e7 100644 --- a/keyboards/handwired/magicforce61/config.h +++ b/keyboards/handwired/magicforce61/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -43,7 +42,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. * */ #define MATRIX_ROW_PINS { D0, D1, D2, D3, D4 } -#define MATRIX_COL_PINS { B5, B4, B3, B2, B1, B0, E7, E6, F0, F1, F2, F3, F4, F5 } +#define MATRIX_COL_PINS { B5, B4, B3, B2, B1, B0, E7, E6, F0, F1, F2, F3, F4, F5 } #define UNUSED_PINS /* COL2ROW or ROW2COL */ @@ -152,5 +151,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/handwired/magicforce61/info.json b/keyboards/handwired/magicforce61/info.json new file mode 100644 index 0000000000..22ffccd3ce --- /dev/null +++ b/keyboards/handwired/magicforce61/info.json @@ -0,0 +1,74 @@ +{ + "keyboard_name": "Magicforce \"61\"", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"`", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0, "w":2}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"[", "x":11.5, "y":1}, + {"label":"]", "x":12.5, "y":1}, + {"label":"\\", "x":13.5, "y":1, "w":1.5}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":";", "x":10.75, "y":2}, + {"label":"'", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":",", "x":9.25, "y":3}, + {"label":".", "x":10.25, "y":3}, + {"label":"/", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":2.75}, + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"GUI", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"label":"Space", "x":3.75, "y":4, "w":6.25}, + {"label":"Alt", "x":10, "y":4, "w":1.25}, + {"label":"GUI", "x":11.25, "y":4, "w":1.25}, + {"label":"Menu", "x":12.5, "y":4, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":4, "w":1.25} + ] + } + } +} diff --git a/keyboards/handwired/magicforce61/keymaps/default/keymap.c b/keyboards/handwired/magicforce61/keymaps/default/keymap.c index 9559be5d21..12252c978a 100644 --- a/keyboards/handwired/magicforce61/keymaps/default/keymap.c +++ b/keyboards/handwired/magicforce61/keymaps/default/keymap.c @@ -1,69 +1,54 @@ -#include "magicforce61.h" +#include QMK_KEYBOARD_H #define _QWERTY 0 #define _FN1 1 #define _FN2 2 -#define KC_ KC_TRNS + #define KC_X0 LT(_FN2, KC_GRV) #define KC_X1 MO(_FN1) -#define KC_NAV_ESC LT(_FN1, KC_ESC) +#define NAV_ESC LT(_FN1, KC_ESC) #define KC_GUI MAGIC_UNNO_GUI const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = KEYMAP( - /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. */ - GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS,EQL , BSPC , - /*|----`----`----`----`----`----`----`----`----`----`----`----`----`--------| */ - TAB , Q , W , E , R , T , Y , U , I , O , P ,LBRC,RBRC, BSLS , - /*|------`----`----`----`----`----`----`----`----`----`----`----`----`------| */ - NAV_ESC , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, ENTER , - /*|-------`----`----`----`----`----`----`----`----`----`----`----`----------| */ - LSPO , Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, RSPC , - /*|---------`----`----`----`----`----`----`----`----`----`----`-------------. */ - LCTL , RGUI ,LALT , SPACE , X1 ,RALT ,RCTL , X1 - /*`-----+-----+-----+------------------------------+------+-----+-----' ANY */ + [_QWERTY] = LAYOUT( + /*,--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------. */ + 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, \ + /*|esc-----`-1------`-2------`-3------`-4------`-5------`-6------`-7------`-8------`-9------`-0------`mnus----`plus----`--bksp--| */ + 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, \ + /*|tab-----`-q------`-w------`-e------`-r------`-t------`-y------`-u------`-i------`-o------`-p------`-{------`-}------`--|-----| */ + NAV_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + /*|caps----`-a------`-s------`-d------`-f------`-g------`-h------`-j------`-k------`-l------`-;------`-'------`-----------enter-| */ + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, \ + /*|shift---`-z------`-x------`-c------`-v------`-b------`-n------`-m------`-,------`-.------`-/------`--------------------shift-| */ + KC_LCTL, KC_RGUI, KC_LALT, KC_SPC, KC_X1, KC_RALT, KC_RCTL, KC_X1 \ + /*`ctrl----`-gui----`-alt----`------------------space---------------------------------------`-fn-----`-alt----`ctrl----' ANY */ ), - [_FN1] = KEYMAP( - /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. */ - GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC , - /*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| */ - , , UP , , , , , ,INS ,PSCR, , , , , - /*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| */ - ,LEFT,DOWN,RGHT, , , , PGDN , PGUP , , , , , - /*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| */ - , , , , , ,VOLD,VOLU,MUTE, , , , - /*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-. */ - , , , , , , , MPLY - /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' ANY */ + [_FN1] = LAYOUT( + /*,--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------. */ + KC_GRV, 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_BSPC, \ + /*|esc-----`-1------`-2------`-3------`-4------`-5------`-6------`-7------`-8------`-9------`-0------`mnus----`plus----`--bksp--| */ + _______, _______, KC_UP, _______, _______, _______, _______, _______, KC_INS, KC_PSCR, _______, _______, _______, _______, \ + /*|tab-----`-q------`-w------`-e------`-r------`-t------`-y------`-u------`-i------`-o------`-p------`-{------`-}------`--|-----| */ + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, KC_PGDN, KC_PGUP, _______, _______, _______, _______, \ + /*|caps----`-a------`-s------`-d------`-f------`-g------`-h------`-j------`-k------`-l------`-;------`-'------`-----------enter-| */ + _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, _______, \ + /*|shift---`-z------`-x------`-c------`-v------`-b------`-n------`-m------`-,------`-.------`-/------`--------------------shift-| */ + _______, _______, _______, _______, _______, _______, _______, KC_MPLY \ + /*`ctrl----`-gui----`-alt----`------------------space---------------------------------------`-fn-----`-alt----`ctrl----' ANY */ ), - [_FN2] = KEYMAP( - /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. */ - GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC , - /*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| */ - , , , , , , , 7 , 8 , 9 , , , , , - /*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| */ - , , , , , , , 4 , 5 , 6 , , , , - /*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| */ - , , , , , , 0 , 1 , 2 , 3 , , , - /*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-. */ - , , , , , , , - /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' ANY */ + [_FN2] = LAYOUT( + /*,--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------. */ + KC_GRV, 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_BSPC, \ + /*|esc-----`-1------`-2------`-3------`-4------`-5------`-6------`-7------`-8------`-9------`-0------`mnus----`plus----`--bksp--| */ + _______, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, _______, _______, _______, _______, \ + /*|tab-----`-q------`-w------`-e------`-r------`-t------`-y------`-u------`-i------`-o------`-p------`-{------`-}------`--|-----| */ + _______, _______, _______, _______, _______, _______, _______, KC_4, KC_5, KC_6, _______, _______, _______, \ + /*|caps----`-a------`-s------`-d------`-f------`-g------`-h------`-j------`-k------`-l------`-;------`-'------`-----------enter-| */ + _______, _______, _______, _______, _______, _______, KC_0, KC_1, KC_2, KC_3, _______, _______, \ + /*|shift---`-z------`-x------`-c------`-v------`-b------`-n------`-m------`-,------`-.------`-/------`--------------------shift-| */ + _______, _______, _______, _______, _______, _______, _______, _______ \ + /*`ctrl----`-gui----`-alt----`------------------space---------------------------------------`-fn-----`-alt----`ctrl----' ANY */ ) }; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; diff --git a/keyboards/handwired/magicforce61/magicforce61.h b/keyboards/handwired/magicforce61/magicforce61.h index 784f2b2c80..37a32ed783 100644 --- a/keyboards/handwired/magicforce61/magicforce61.h +++ b/keyboards/handwired/magicforce61/magicforce61.h @@ -1,20 +1,17 @@ -#ifndef MAGICFORCE61_H -#define MAGICFORCE61_H +#pragma once #include "quantum.h" -#define KEYMAP( \ +#define LAYOUT( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3D, \ K40, K41, K42, K45, K49, K4A, K4C, K4D \ ) { \ - { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_NO, KC_##K2D }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_NO, KC_NO, KC_##K3D }, \ - { KC_##K40, KC_##K41, KC_##K42, KC_NO, KC_NO, KC_##K45, KC_NO, KC_NO, KC_NO, KC_##K49, KC_##K4A, KC_NO, KC_##K4C, KC_##K4D }, \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, KC_NO, KC_NO, K3D }, \ + { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, K49, K4A, KC_NO, K4C, K4D }, \ } - -#endif diff --git a/keyboards/handwired/magicforce61/readme.md b/keyboards/handwired/magicforce61/readme.md new file mode 100644 index 0000000000..081992aa84 --- /dev/null +++ b/keyboards/handwired/magicforce61/readme.md @@ -0,0 +1,31 @@ +# Magicforce "61" Handwired + +Basically I cut 7 keys off the magicforce68 and handwired everything to a teensy++ 2.0 to make it a ~60% board. + +Keyboard Maintainer: [The QMK Community](https://github.com/qmk) +Hardware Supported: magicforce61, teensy++ 2.0 + +Make example for this keyboard (after setting up your build environment): + + make handwired/magicforce61:default + +Flash the firmware using the teensy loader or avrdude. + +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). + +## Wiring Layout / Pinout + +| | B5 | B4 | B3 | B2 | B1 | B0 | E7 | E6 | F0 | F1 | F2 | F3 | F4 | F5 | +| -----: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | +| **D0** | Esc | 1! | 2@ | 3# | 4$ | 5% | 6^ | 7& | 8* | 9( | 0) | -_ | =+ | Bspc | +| **D1** | Tab | Q | W | E | R | T | Y | U | I | O | P | [{ | ]} | \\\| | +| **D2** | Caps | A | S | D | F | G | H | J | K | L | ;: | '" | | Ent | +| **D3** | LSft | Z | X | C | V | B | N | M | , | . | / | | | RSft | +| **D4** | LCtl | LGUI | LAlt | | | Spc | | | | RAlt | RGUI | | App | RCtl | + +The following pins are used: + +``` +#define MATRIX_ROW_PINS { D0, D1, D2, D3, D4 } +#define MATRIX_COL_PINS { B5, B4, B3, B2, B1, B0, E7, E6, F0, F1, F2, F3, F4, F5 } +``` diff --git a/keyboards/handwired/mechboards_micropad/config.h b/keyboards/handwired/mechboards_micropad/config.h new file mode 100644 index 0000000000..01a0bdd909 --- /dev/null +++ b/keyboards/handwired/mechboards_micropad/config.h @@ -0,0 +1,245 @@ +/* +Copyright 2019 Yiancar + +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 0x8968 +#define PRODUCT_ID 0x0001 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Yiancar +#define PRODUCT Mechboards Micropad +#define DESCRIPTION Enjoy your freebie! + +/* key matrix size */ +#define MATRIX_ROWS 1 +#define MATRIX_COLS 4 + +/* + * 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 { B6 } +#define MATRIX_COL_PINS { B2, B3, B1, F7 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +//#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* 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. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* 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_HELP H +//#define MAGIC_KEY_HELP_ALT 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 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#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 B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#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 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/handwired/mechboards_micropad/info.json b/keyboards/handwired/mechboards_micropad/info.json new file mode 100644 index 0000000000..f8908d9fcf --- /dev/null +++ b/keyboards/handwired/mechboards_micropad/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Mechboards Micropad", + "url": "", + "maintainer": "yiancar", + "width": 4, + "height": 1, + "layouts": { + "LAYOUT": { + "layout": [{"label":"1", "x":0, "y":0}, {"label":"2", "x":1, "y":0}, {"label":"3", "x":2, "y":0}, {"label":"4", "x":3, "y":0}] + } + } +}
\ No newline at end of file diff --git a/keyboards/handwired/mechboards_micropad/keymaps/default/keymap.c b/keyboards/handwired/mechboards_micropad/keymaps/default/keymap.c new file mode 100644 index 0000000000..41784c5204 --- /dev/null +++ b/keyboards/handwired/mechboards_micropad/keymaps/default/keymap.c @@ -0,0 +1,84 @@ +/* Copyright 2019 Yiancar + * + * 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 QMK_KEYBOARD_H + +uint8_t led_state = 1; + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + MECHBOARDURL = SAFE_RANGE, + QMKURL, + MKUK, + LEDCHANGE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + MECHBOARDURL, QMKURL, MKUK, LEDCHANGE \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case MECHBOARDURL: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("https://mechboards.co.uk/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + case MKUK: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("MKUK4 was amazing!"); + } else { + // when keycode QMKURL is released + } + break; + case LEDCHANGE: + if (record->event.pressed) { + // when keycode QMKURL is pressed + led_state = !led_state; + writePin(F6, led_state); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + setPinOutput(F6); + writePinLow(F6); +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/handwired/mechboards_micropad/keymaps/default/readme.md b/keyboards/handwired/mechboards_micropad/keymaps/default/readme.md new file mode 100644 index 0000000000..92d37ad8b9 --- /dev/null +++ b/keyboards/handwired/mechboards_micropad/keymaps/default/readme.md @@ -0,0 +1,4 @@ +# The default keymap for mechboards_micropad + +This is a 4 key micropad freebie from Mechboards and Yiancar-Designs. +Press the keys to find out the secrets:)
\ No newline at end of file diff --git a/keyboards/handwired/mechboards_micropad/mechboards_micropad.c b/keyboards/handwired/mechboards_micropad/mechboards_micropad.c new file mode 100644 index 0000000000..d4c8fa9b92 --- /dev/null +++ b/keyboards/handwired/mechboards_micropad/mechboards_micropad.c @@ -0,0 +1,43 @@ +/* Copyright 2019 Yiancar + * + * 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 "mechboards_micropad.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/handwired/mechboards_micropad/mechboards_micropad.h b/keyboards/handwired/mechboards_micropad/mechboards_micropad.h new file mode 100644 index 0000000000..9839084862 --- /dev/null +++ b/keyboards/handwired/mechboards_micropad/mechboards_micropad.h @@ -0,0 +1,33 @@ +/* Copyright 2019 Yiancar + * + * 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" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + k00, k01, k02, k03 \ +) \ +{ \ + { k00, k01, k02, k03 } \ +} diff --git a/keyboards/handwired/mechboards_micropad/readme.md b/keyboards/handwired/mechboards_micropad/readme.md new file mode 100644 index 0000000000..36230b1281 --- /dev/null +++ b/keyboards/handwired/mechboards_micropad/readme.md @@ -0,0 +1,14 @@ +Mechboards Micropad +=================== + +This was a freebie, use me and find out more about me :) + +Keyboard Maintainer: [Yiancar](http://yiancar-designs.com/) and on [github](https://github.com/yiancar) +Hardware Supported: ATMega32u4 +Hardware Availability: Random mechboards.co.uk order and UK meetups! + +Make example for this keyboard (after setting up your build environment): + + make handwired/mechboards_micropad:default + +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/handwired/mechboards_micropad/rules.mk b/keyboards/handwired/mechboards_micropad/rules.mk new file mode 100644 index 0000000000..8ac2297e46 --- /dev/null +++ b/keyboards/handwired/mechboards_micropad/rules.mk @@ -0,0 +1,81 @@ +# MCU name +#MCU = at90usb1286 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/handwired/minorca/keymaps/default/config.h b/keyboards/handwired/minorca/keymaps/default/config.h index bf40376c19..c19ad73724 100644 --- a/keyboards/handwired/minorca/keymaps/default/config.h +++ b/keyboards/handwired/minorca/keymaps/default/config.h @@ -1,12 +1,10 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once + +// place overrides here -#include "../../config.h" /* bootmagic salt key */ #define BOOTMAGIC_KEY_SALT KC_ESC /* skip bootmagic and eeconfig */ #define BOOTMAGIC_KEY_SKIP KC_SPACE - -#endif diff --git a/keyboards/handwired/prime_exl/keymaps/default/keymap.c b/keyboards/handwired/prime_exl/keymaps/default/keymap.c index 815090bd19..1dac7825e4 100644 --- a/keyboards/handwired/prime_exl/keymaps/default/keymap.c +++ b/keyboards/handwired/prime_exl/keymaps/default/keymap.c @@ -113,20 +113,20 @@ void matrix_scan_user(void) { void led_set_user(uint8_t usb_led) { if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { - writePinLow(B6); - } else { writePinHigh(B6); + } else { + writePinLow(B6); } if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { - writePinLow(B5); - } else { writePinHigh(B5); + } else { + writePinLow(B5); } /* if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { - writePinLow(C6); - } else { writePinHigh(C6); + } else { + writePinLow(C6); } */ } @@ -135,9 +135,9 @@ void led_set_user(uint8_t usb_led) { uint32_t layer_state_set_user(uint32_t state) { if (biton32(state) == 2) { - writePinLow(C6); + writePinHigh(C6); } else { - writePinHigh(C6); + writePinLow(C6); } return state; } diff --git a/keyboards/handwired/prime_exl/keymaps/via/keymap.c b/keyboards/handwired/prime_exl/keymaps/via/keymap.c index 4a2631c369..c01c247c89 100644 --- a/keyboards/handwired/prime_exl/keymaps/via/keymap.c +++ b/keyboards/handwired/prime_exl/keymaps/via/keymap.c @@ -71,20 +71,20 @@ void matrix_scan_user(void) { void led_set_user(uint8_t usb_led) { if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { - writePinLow(B6); - } else { writePinHigh(B6); + } else { + writePinLow(B6); } if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { - writePinLow(B5); - } else { writePinHigh(B5); + } else { + writePinLow(B5); } /* if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { - writePinLow(C6); - } else { writePinHigh(C6); + } else { + writePinLow(C6); } */ } @@ -93,9 +93,9 @@ void led_set_user(uint8_t usb_led) { uint32_t layer_state_set_user(uint32_t state) { if (biton32(state) == 2) { - writePinLow(C6); + writePinHigh(C6); } else { - writePinHigh(C6); + writePinLow(C6); } return state; } diff --git a/keyboards/handwired/splittest/config.h b/keyboards/handwired/splittest/config.h new file mode 100644 index 0000000000..9e4fb38ca0 --- /dev/null +++ b/keyboards/handwired/splittest/config.h @@ -0,0 +1,75 @@ +/* +Copyright 2012 Jun Wako <wakojun@gmail.com> +Copyright 2015 Jack Humbert + +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 0xCB10 +#define PRODUCT_ID 0x1111 +#define DEVICE_VER 0x0100 +#define MANUFACTURER Keebio +#define PRODUCT Split Tester +#define DESCRIPTION Split keyboard testing unit + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 2 +#define MATRIX_COLS 1 + +// wiring of each half +#define MATRIX_ROW_PINS { B3 } +#define MATRIX_COL_PINS { B6 } +#define SPLIT_HAND_PIN F6 +#define SOFT_SERIAL_PIN D1 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* 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 + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLED_SPLIT { 6, 6 } + +/* + * 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 diff --git a/keyboards/facew/i2c.h b/keyboards/handwired/splittest/keymaps/default/config.h index 93a69c94da..ecebd36589 100644 --- a/keyboards/facew/i2c.h +++ b/keyboards/handwired/splittest/keymaps/default/config.h @@ -1,5 +1,8 @@ /* -Copyright 2016 Luiz Ribeiro <luizribeiro@gmail.com> +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako <wakojun@gmail.com> +Copyright 2015 Jack Humbert 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 @@ -15,13 +18,6 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -// Please do not modify this file - -#ifndef __I2C_H__ -#define __I2C_H__ - -void i2c_init(void); -void i2c_set_bitrate(uint16_t bitrate_khz); -uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length); +#pragma once -#endif +#define USE_I2C diff --git a/keyboards/handwired/splittest/keymaps/default/keymap.c b/keyboards/handwired/splittest/keymaps/default/keymap.c new file mode 100644 index 0000000000..1c15f6f1df --- /dev/null +++ b/keyboards/handwired/splittest/keymaps/default/keymap.c @@ -0,0 +1,5 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT(RGB_MOD, RESET) +}; diff --git a/keyboards/handwired/splittest/readme.md b/keyboards/handwired/splittest/readme.md new file mode 100644 index 0000000000..3dbff32ed4 --- /dev/null +++ b/keyboards/handwired/splittest/readme.md @@ -0,0 +1,26 @@ +Split Tester +============ + +A two-switch tester built using two Pro Micros, mainly intended to test RGB on split keyboards. Seen here: https://www.instagram.com/p/BvCPNzynwrV/ + +Keyboard Maintainer: [Bakingpy/nooges](https://github.com/nooges) +Hardware Supported: Pro Micro + +Make example for this keyboard (after setting up your build environment): + + make handwired/splittest:default + +Example of flashing this keyboard: + + make handwired/splittest:default:avrdude + +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). + +Wiring +------ +- Add switches to both Pro Micros across B3 and B6 pins +- Add pull-up resistor to left side between VCC and F6 +- Add pull-down resistors to right side between GND and F6 +- Connect the following pins on both sides together: D0, D1, GND, VCC +- Add I2C 4.7kOhm resistors between D0 and VCC, and D1 and VCC +- Wire Di of RGB strip for each half to D2 diff --git a/keyboards/handwired/splittest/rules.mk b/keyboards/handwired/splittest/rules.mk new file mode 100644 index 0000000000..9512c0f648 --- /dev/null +++ b/keyboards/handwired/splittest/rules.mk @@ -0,0 +1,65 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +SPLIT_KEYBOARD = yes diff --git a/keyboards/handwired/splittest/splittest.c b/keyboards/handwired/splittest/splittest.c new file mode 100644 index 0000000000..3c919a565d --- /dev/null +++ b/keyboards/handwired/splittest/splittest.c @@ -0,0 +1 @@ +#include "splittest.h" diff --git a/keyboards/handwired/splittest/splittest.h b/keyboards/handwired/splittest/splittest.h new file mode 100644 index 0000000000..17b7081a02 --- /dev/null +++ b/keyboards/handwired/splittest/splittest.h @@ -0,0 +1,5 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT(L1, R1) {{L1}, {R1}} diff --git a/keyboards/handwired/tennie/config.h b/keyboards/handwired/tennie/config.h new file mode 100644 index 0000000000..b50886cdc8 --- /dev/null +++ b/keyboards/handwired/tennie/config.h @@ -0,0 +1,240 @@ +/* +Copyright 2018 Jack Hildebrandt + +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 0x1EEE +#define PRODUCT_ID 0x1313 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Jsck +#define PRODUCT Tennie +#define DESCRIPTION Ten key macropad + +/* key matrix size */ +#define MATRIX_ROWS 3 +#define MATRIX_COLS 4 + +/* + * 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 { C6, D4, D0} +#define MATRIX_COL_PINS { D7, E6, B4, B5 } +#define UNUSED_PINS { B1, B2, B3, B6, F4, F5, F6, F7 D1} + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +//#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 +#define RGBW +#define RGB_DI_PIN D1 +#ifdef RGB_DI_PIN + #define RGBLED_NUM 1 + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ + #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* 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 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +//#define BOOTMAGIC_LITE_ROW 0 +//#define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/handwired/tennie/info.json b/keyboards/handwired/tennie/info.json new file mode 100644 index 0000000000..c036997929 --- /dev/null +++ b/keyboards/handwired/tennie/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Tennie", + "url": "https://github.com/StoutIEEE/macropad-workshop", + "maintainer": "UW Stout IEEE, Jack Hildebrandt (onemorebyte)", + "width": 4, + "height": 3, + "layouts": { + "LAYOUT": { + "layout": [{"x":0.5, "y":0}, {"x":1.5, "y":0}, {"x":2.5, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":0.5, "y":2}, {"x":1.5, "y":2}, {"x":2.5, "y":2}] + } + } +} diff --git a/keyboards/handwired/tennie/keymaps/default/config.h b/keyboards/handwired/tennie/keymaps/default/config.h new file mode 100644 index 0000000000..4496c59100 --- /dev/null +++ b/keyboards/handwired/tennie/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 REPLACE_WITH_YOUR_NAME + * + * 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 + +// place overrides here diff --git a/keyboards/handwired/tennie/keymaps/default/keymap.c b/keyboards/handwired/tennie/keymaps/default/keymap.c new file mode 100644 index 0000000000..3736841cbb --- /dev/null +++ b/keyboards/handwired/tennie/keymaps/default/keymap.c @@ -0,0 +1,95 @@ +/* Copyright 2018 Jack H. + * + * 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 QMK_KEYBOARD_H + +#define TAPPING_TOGGLE 2 + + +// Layer names +#define base 0 +#define shrek 1 +#define ogre 2 +#define tcp 3 + +// Layer Switches +#define KC_SHRK TT(shrek) +#define KC_OGRE TT(ogre) +#define KC_TCP TT(tcp) + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [base] = LAYOUT( + // ┌────────┬────────┬────────┐ + + KC_DEL, KC_SPC, KC_ENT, + + // ├────────┼────────┼────────┼────────┼ + + KC_LEFT, KC_DOWN, KC_UP , KC_RGHT, + + // ├────────┼────────┼────────┼────────┼ + + KC_SHRK, KC_OGRE, KC_TCP + + // └────────┴────────┴────────┘ + ), + [shrek] = LAYOUT( + // ┌────────┬────────┬────────┐ + + KC_MPRV, KC_MPLY, KC_MNXT, + + // ├────────┼────────┼────────┼────────┼ + + KC_BRID, KC_VOLD, KC_VOLU, KC_BRIU, + + // ├────────┼────────┼────────┼────────┼ + + _______, _______, _______ + + // └────────┴────────┴────────┘ + ), + [ogre] = LAYOUT( + // ┌────────┬────────┬────────┐ + + RGB_MOD, RGB_TOG, RGB_RMOD, + + // ├────────┼────────┼────────┼────────┼ + + KC_F13, KC_F14, KC_F15, KC_F16, + + // ├────────┼────────┼────────┼────────┼ + + _______, _______, _______ + + // └────────┴────────┴────────┘ + ), + [tcp] = LAYOUT( + // ┌────────┬────────┬────────┐ + + KC_WBAK, KC_WREF, KC_WFWD, + + // ├────────┼────────┼────────┼────────┼ + + XXXXXXX, KC_PGDN, KC_PGUP, XXXXXXX, + + // ├────────┼────────┼────────┼────────┼ + + _______, _______, _______ + + // └────────┴────────┴────────┘ + ), +}; diff --git a/keyboards/handwired/tennie/keymaps/default/readme.md b/keyboards/handwired/tennie/keymaps/default/readme.md new file mode 100644 index 0000000000..1fbaa7f463 --- /dev/null +++ b/keyboards/handwired/tennie/keymaps/default/readme.md @@ -0,0 +1,68 @@ +# Default keymap + +This keymap is to serve as an example of how you could make a multi-layer keymap. + +#### keymap + +``` +[base] = LAYOUT_kc( +// ┌────────┬────────┬────────┐ + + DEL , SPC , ENT , + +// ├────────┼────────┼────────┼────────┼ + + LEFT , DOWN , UP , RGHT , + +// ├────────┼────────┼────────┼────────┼ + + SHRK , OGRE , TCP + +// └────────┴────────┴────────┘ +), +[shrek] = LAYOUT_kc( +// ┌────────┬────────┬────────┐ + + MPRV , MPLY , MNXT , + +// ├────────┼────────┼────────┼────────┼ + + BRID , VOLD , VOLU , BRIU , + +// ├────────┼────────┼────────┼────────┼ + + _______, _______, _______ + +// └────────┴────────┴────────┘ +), +[ogre] = LAYOUT_kc( +// ┌────────┬────────┬────────┐ + + RGB_MOD, RGB_TOG, RGB_RMOD + +// ├────────┼────────┼────────┼────────┼ + + F13 , F14 , F15 , F16 , + +// ├────────┼────────┼────────┼────────┼ + + _______, _______, _______ + +// └────────┴────────┴────────┘ +), +[tcp] = LAYOUT_kc( +// ┌────────┬────────┬────────┐ + + WBAK , WREF , WFWD , + +// ├────────┼────────┼────────┼────────┼ + + XXXXXXX , PGDN , PGUP , XXXXXXX , + +// ├────────┼────────┼────────┼────────┼ + + _______, _______, _______ + +// └────────┴────────┴────────┘ +), +``` diff --git a/keyboards/handwired/tennie/keymaps/simple-numbpad/config.h b/keyboards/handwired/tennie/keymaps/simple-numbpad/config.h new file mode 100644 index 0000000000..a3c309bb29 --- /dev/null +++ b/keyboards/handwired/tennie/keymaps/simple-numbpad/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 Jack Hildebrandt + * + * 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 + +// place overrides here diff --git a/keyboards/handwired/tennie/keymaps/simple-numbpad/keymap.c b/keyboards/handwired/tennie/keymaps/simple-numbpad/keymap.c new file mode 100644 index 0000000000..7cf29b1188 --- /dev/null +++ b/keyboards/handwired/tennie/keymaps/simple-numbpad/keymap.c @@ -0,0 +1,37 @@ +/* Copyright 2018 Jack Hildebrandt + * + * 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 QMK_KEYBOARD_H + +// Layer names +#define base 0 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [base] = LAYOUT( + // ┌────────┬────────┬────────┐ + + KC_1 , KC_2 , KC_3 , + + // ├────────┼────────┼────────┼────────┼ + + KC_4 , KC_5 , KC_6 , KC_7 , + + // ├────────┼────────┼────────┼────────┼ + + KC_8 , KC_9 , KC_0 + + // └────────┴────────┴────────┘ + ), +}; diff --git a/keyboards/handwired/tennie/keymaps/simple-numbpad/readme.md b/keyboards/handwired/tennie/keymaps/simple-numbpad/readme.md new file mode 100644 index 0000000000..0b3f307501 --- /dev/null +++ b/keyboards/handwired/tennie/keymaps/simple-numbpad/readme.md @@ -0,0 +1,18 @@ +# Simple numberpad keymap + +This keymap is to test the soldering work of workshop participants. It can also be used as a simple base for a macropad keymap. +``` +// ┌────────┬────────┬────────┐ + + 1 , 2 , 3 , + +// ├────────┼────────┼────────┼────────┼ + + 4 , 5 , 6 , 7 , + +// ├────────┼────────┼────────┼────────┼ + + 8 , 9 , 0 + +// └────────┴────────┴────────┘ +``` diff --git a/keyboards/handwired/tennie/keymaps/soundboard/config.h b/keyboards/handwired/tennie/keymaps/soundboard/config.h new file mode 100644 index 0000000000..5a1cba7b40 --- /dev/null +++ b/keyboards/handwired/tennie/keymaps/soundboard/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 Jacob Hillebrand + * + * 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 + +// place overrides here diff --git a/keyboards/handwired/tennie/keymaps/soundboard/keymap.c b/keyboards/handwired/tennie/keymaps/soundboard/keymap.c new file mode 100644 index 0000000000..3bceb1feac --- /dev/null +++ b/keyboards/handwired/tennie/keymaps/soundboard/keymap.c @@ -0,0 +1,37 @@ +/* Copyright 2018 Jacob Hillebrand + * + * 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 QMK_KEYBOARD_H + +// Layer names +#define base 0 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [base] = LAYOUT( + // ┌────────┬────────┬────────┐ + + KC_F13 , KC_F14 , KC_F15 , + + // ├────────┼────────┼────────┼────────┼ + + KC_F16 , KC_F17 , KC_F18 , KC_F19 , + + // ├────────┼────────┼────────┼────────┼ + + KC_F20, KC_F21 , KC_F22 + + // └────────┴────────┴────────┘ + ), +}; diff --git a/keyboards/handwired/tennie/keymaps/soundboard/readme.md b/keyboards/handwired/tennie/keymaps/soundboard/readme.md new file mode 100644 index 0000000000..d05b7117c1 --- /dev/null +++ b/keyboards/handwired/tennie/keymaps/soundboard/readme.md @@ -0,0 +1,19 @@ +# Soundboard keymap + +This keymap binds all keys to function keys 13-22 for something like a +soundboard (ie:[Resanance](https://www.reddit.com/r/discordapp/comments/44ldc1/soundboard_for_discord/)) +``` +// ┌────────┬────────┬────────┐ + + F13 , F14 , F15 , + +// ├────────┼────────┼────────┼────────┼ + + F16 , F17 , F18 , F19 , + +// ├────────┼────────┼────────┼────────┼ + + F20 , F21 , F22 + +// └────────┴────────┴────────┘ +``` diff --git a/keyboards/handwired/tennie/readme.md b/keyboards/handwired/tennie/readme.md new file mode 100644 index 0000000000..bbdbc2b601 --- /dev/null +++ b/keyboards/handwired/tennie/readme.md @@ -0,0 +1,15 @@ +# Tennie + +![tennie](https://raw.githubusercontent.com/StoutIEEE/macropad-workshop/master/images/macropad.jpg) + +A ten key macropad for a club workshop! More information, and build instructions can be found [here](https://github.com/StoutIEEE/macropad-workshop) + +Keyboard Maintainer: [Jack Hildebrandt](https://github.com/onemorebyte), [UW Stout IEEE](https://github.com/StoutIEEE) + +Hardware Supported: ProMicro + +Make example for this keyboard (after setting up your build environment): + + make handwired/tennie:default + +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/handwired/tennie/rules.mk b/keyboards/handwired/tennie/rules.mk new file mode 100644 index 0000000000..0119dc6fb2 --- /dev/null +++ b/keyboards/handwired/tennie/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/handwired/tennie/tennie.c b/keyboards/handwired/tennie/tennie.c new file mode 100644 index 0000000000..e1ceaf153d --- /dev/null +++ b/keyboards/handwired/tennie/tennie.c @@ -0,0 +1,45 @@ +/* Copyright 2018 Jack Hildebrandt + * + * 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 "tennie.h" + +void matrix_init_kb(void) { + matrix_init_user(); +} + +void matrix_post_init(void) { + rgblight_enable_noeeprom(); + keyboard_post_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +//void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + +// led_set_user(usb_led); +//} diff --git a/keyboards/handwired/tennie/tennie.h b/keyboards/handwired/tennie/tennie.h new file mode 100644 index 0000000000..8ab0d04c52 --- /dev/null +++ b/keyboards/handwired/tennie/tennie.h @@ -0,0 +1,37 @@ +/* Copyright 2018 Jack Hildebrandt + * + * 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" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + K00, K01, K02, \ + K10, K11, K12, K13, \ + K20, K21, K22 \ +) \ +{ \ + { K00, K01, K02, KC_NO }, \ + { K10, K11, K12, K13 }, \ + { K20, K21, K22, KC_NO }, \ +} diff --git a/keyboards/handwired/terminus_mini/keymaps/default/config.h b/keyboards/handwired/terminus_mini/keymaps/default/config.h index 34ef672074..4817be2527 100644 --- a/keyboards/handwired/terminus_mini/keymaps/default/config.h +++ b/keyboards/handwired/terminus_mini/keymaps/default/config.h @@ -14,13 +14,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#define TAPPING_TERM 150 //reduce time required to register a held key - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here -#endif +#define TAPPING_TERM 150 //reduce time required to register a held key diff --git a/keyboards/handwired/traveller/keymaps/default/keymap.c b/keyboards/handwired/traveller/keymaps/default/keymap.c index 1b1038fd79..44f65f4b81 100644 --- a/keyboards/handwired/traveller/keymaps/default/keymap.c +++ b/keyboards/handwired/traveller/keymaps/default/keymap.c @@ -1,6 +1,5 @@ -#include "traveller.h" +#include QMK_KEYBOARD_H #include "mousekey.h" -#include "action_layer.h" // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. @@ -9,7 +8,7 @@ #define _HI 2 #define _NAV 4 #define _CUR 5 -#define _FKEYS 6 +#define _FKEYS 6 #define _TRNS 8 // We do the same trick for functions @@ -20,7 +19,7 @@ #define MDL 4 #define MDR 5 #define MUR 6 -#define MUL 3 +#define MUL 3 @@ -35,9 +34,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+ // +------+------+------+------+------+------| * | Shift| Z | Del | GUI | Low | Bspc |/Enter| Spc | Hi | GUI | Alt | / |Shift | * `------------------------------------------------------------------------------------------' - * + * */ -[_QW] = KEYMAP( +[_QW] = KEYMAP( TG(_NAV), KC_GRV, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_MINS, KC_EQL, KC_TAB, KC_Q, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_P, KC_BSLS, CTL_T(KC_ESC), KC_A, KC_X, KC_C, KC_V, KC_B, KC_RCTL, KC_N, KC_M, KC_COMM, KC_DOT, KC_SCLN, KC_QUOT, @@ -45,7 +44,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), /* LOW - numbers, missing or awkward programming keys - Doubled 1 key allows lazy reach with ring finger. + Doubled 1 key allows lazy reach with ring finger. * ,-----------------------------------------. .-----------------------------------------. * | FKeys| 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 |Ctrl-alt-del| * |------+------+------+------+------+------| +------+------+------+------+------+------| @@ -55,18 +54,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+ // +------+------+------+------+------+------| * | Shift| | | | Low | |/ | | Hi | | | |Shift | * `------------------------------------------------------------------------------------------' - * + * */ -[_LW] = KEYMAP( +[_LW] = KEYMAP( TG(_FKEYS), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, LCTL(LALT(KC_DEL)) , KC_TRNS, KC_1, KC_RBRC, KC_LPRN, KC_RPRN, KC_NO, KC_ASTR, KC_LPRN, KC_RPRN, KC_LBRC, KC_NO, KC_NO, KC_CAPS, KC_LBRC, KC_NO, KC_LCBR, KC_RCBR, KC_TILD, KC_TRNS, KC_HASH, KC_LCBR, KC_RCBR, KC_NO, KC_RBRC, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), -/* HI - Punctuation, shell and -url ://@.com row on bottom, && is opposite || ^$ are in regex order: ^.*$ +/* HI - Punctuation, shell and +url ://@.com row on bottom, && is opposite || ^$ are in regex order: ^.*$ Right hand nav keys work pretty well chorded with the Right hand Hi Key * ,-----------------------------------------. .-----------------------------------------. * |FKEYS | ! | @ | # | $ | % | | ^ | & | * | ( | ) | + | @@ -77,19 +76,19 @@ Right hand nav keys work pretty well chorded with the Right hand Hi Key * |------+------+------+------+------+------+ // +------+------+------+------+------+------| * | | / | | | Low | |/ | | Hi | PgDn | Left| Down | Right | * `------------------------------------------------------------------------------------------' - * + * */ -[_HI] = KEYMAP( +[_HI] = KEYMAP( TG(_FKEYS),KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PLUS, - KC_TRNS, KC_EXLM, KC_AMPR, KC_PIPE, KC_DLR, KC_PERC, KC_VOLU, KC_MUTE, KC_NO, KC_NO, KC_NO, KC_NO, + KC_TRNS, KC_EXLM, KC_AMPR, KC_PIPE, KC_DLR, KC_PERC, KC_VOLU, KC_MUTE, KC_NO, KC_NO, KC_NO, KC_NO, KC_CAPS, KC_CIRC, KC_COLN, KC_DOT, KC_ASTR, KC_MINS, KC_TRNS, KC_VOLD, KC_PPLS, KC_PGUP, KC_HOME, KC_UP, KC_END, - KC_TRNS, KC_SLSH, KC_TRNS, KC_TRNS, TT(_LW), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_LEFT, KC_DOWN, KC_RIGHT -), + KC_TRNS, KC_SLSH, KC_TRNS, KC_TRNS, TT(_LW), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_LEFT, KC_DOWN, KC_RIGHT +), /* NAV - mouse & navigation //gui left and right are line home/end, or fore & back in browser -// Mouse buttons are reversed for comfort - bigger stretch is to the right button. +// Mouse buttons are reversed for comfort - bigger stretch is to the right button. * ,-----------------------------------------. .-----------------------------------------. * | NAV | | | Up | |Gui-> | | MwU | MS_UL| MS_U |MS_UR | |Ms Norm| @@ -102,7 +101,7 @@ Right hand nav keys work pretty well chorded with the Right hand Hi Key * `------------------------------------------------------------------------------------------' */ -[_NAV] = KEYMAP( +[_NAV] = KEYMAP( TG(_NAV), KC_NO, KC_NO, KC_UP, KC_NO, RGUI(KC_RIGHT), KC_WH_U, M(MUL), KC_MS_U, M(MUR), KC_NO, KC_ACL2, KC_TRNS, RGUI(KC_LEFT), KC_LEFT, KC_DOWN, KC_RIGHT, LCTL(KC_E), KC_BTN3, KC_MS_L, KC_MS_U, KC_MS_R, KC_NO, KC_ACL1, KC_TRNS, LCTL(KC_A), LGUI(KC_X),RGUI(KC_C), RGUI(KC_V),KC_NO, KC_ENTER, KC_WH_D, M(MDL), KC_MS_D, M(MDR), KC_UP, KC_ACL0, @@ -111,7 +110,7 @@ Right hand nav keys work pretty well chorded with the Right hand Hi Key /* FKEYS - Funtion keys & mac stuff * ,-----------------------------------------. .-----------------------------------------. - * | FKEYS| F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | Ctrl | + * | FKEYS| F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | Ctrl | * |------+------+------+------+------+------| |------+------+------+------+------+------| * | | | | | | | | F11 | F12 | F13 | F14 | F15 | Alt | * |------+------+------+------+------+------|------+------+------+------+------+------+------| @@ -120,9 +119,9 @@ Right hand nav keys work pretty well chorded with the Right hand Hi Key * | . |RGBTog| . | | LO | Bspc |/ | | HI | | | | | * `------------------------------------------------------------------------------------------' * - */ - -[_FKEYS] = KEYMAP( + */ + +[_FKEYS] = KEYMAP( TG(_FKEYS),KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_RCTL, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_LALT , TO(_QW), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_DEL, @@ -140,7 +139,7 @@ Right hand nav keys work pretty well chorded with the Right hand Hi Key * |------+------+------+------+------+------+ // +------+------+------+------+------+------| * | . | . | . | GUI | LO | . |/ | Spc | HI | GUI | M0 | / |LSFT | * `------------------------------------------------------------------------------------------' - * + * */ [_TRNS] = { @@ -226,12 +225,12 @@ void LayerLEDSet(uint8_t layr) { break; case _LW: // deep purple - rgblight_setrgb(20,0,35); - break; + rgblight_setrgb(20,0,35); + break; case _HI: // light blue - rgblight_setrgb(0,20,20); - break; + rgblight_setrgb(0,20,20); + break; case _NAV: // Yellowy orange rgblight_setrgb(25,20,0); // brighter @@ -239,14 +238,14 @@ void LayerLEDSet(uint8_t layr) { case _FKEYS: // RED rgblight_setrgb(20,0,0); // brighter - break; + break; default: rgblight_setrgb(20,2,20);//error break; } - + return; - + } void matrix_init_user(void) { @@ -271,5 +270,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { void led_set_user(uint8_t usb_led) { } - - diff --git a/keyboards/handwired/woodpad/keymaps/default/config.h b/keyboards/handwired/woodpad/keymaps/default/config.h index f52a97bbc8..a72596783d 100644 --- a/keyboards/handwired/woodpad/keymaps/default/config.h +++ b/keyboards/handwired/woodpad/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/handwired/woodpad/keymaps/default/keymap.c b/keyboards/handwired/woodpad/keymaps/default/keymap.c index 724230e450..838c14ead5 100644 --- a/keyboards/handwired/woodpad/keymaps/default/keymap.c +++ b/keyboards/handwired/woodpad/keymaps/default/keymap.c @@ -13,7 +13,7 @@ * 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 "woodpad.h" +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. @@ -86,7 +86,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { layer_off(_ADJUST); } numlock_down = false; - } + } return false; break; case KC_LALT: diff --git a/keyboards/handwired/xealous/config.h b/keyboards/handwired/xealous/config.h index 7bce502c15..251e85d4c1 100644 --- a/keyboards/handwired/xealous/config.h +++ b/keyboards/handwired/xealous/config.h @@ -20,20 +20,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "config_common.h" /* Use I2C or Serial, not both */ - #define USE_I2C -#define SCL_CLOCK 400000UL - -// #define USE_SERIAL -/* serial.c configuration for split keyboard */ -// #define SOFT_SERIAL_PIN D0 +#define SCL_CLOCK 800000UL /* Select hand configuration */ - #define MASTER_LEFT -// #define MASTER_RIGHT -// #define EE_HANDS - //#define DEBUG_MATRIX_SCAN_RATE //Use this to determine scan-rate. #define FORCE_NKRO @@ -41,6 +32,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define QMK_KEYS_PER_SCAN 4 //if we press four keys simultaneously, lets process them simultaneously... #define DIODE_DIRECTION COL2ROW + #ifdef AUDIO_ENABLE #define C6_AUDIO #define STARTUP_SONG SONG(STARTUP_SOUND) diff --git a/keyboards/handwired/xealous/debounce.c b/keyboards/handwired/xealous/debounce.c deleted file mode 100644 index 65a99f27f2..0000000000 --- a/keyboards/handwired/xealous/debounce.c +++ /dev/null @@ -1,63 +0,0 @@ -#include <string.h> -#include "config.h" -#include "matrix.h" -#include "timer.h" -#include "quantum.h" - -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 -#endif - -//Debouncing counters -typedef uint8_t debounce_counter_t; -#define DEBOUNCE_COUNTER_MODULO 250 -#define DEBOUNCE_COUNTER_INACTIVE 251 - -static debounce_counter_t *debounce_counters; - -void debounce_init(uint8_t num_rows) -{ - debounce_counters = malloc(num_rows*MATRIX_COLS); - memset(debounce_counters, DEBOUNCE_COUNTER_INACTIVE, num_rows*MATRIX_COLS); -} - -void update_debounce_counters(uint8_t num_rows, uint8_t current_time) -{ - for (uint8_t row = 0; row < num_rows; row++) - { - for (uint8_t col = 0; col < MATRIX_COLS; col++) - { - if (debounce_counters[row*MATRIX_COLS + col] != DEBOUNCE_COUNTER_INACTIVE) - { - if (TIMER_DIFF(current_time, debounce_counters[row*MATRIX_COLS + col], DEBOUNCE_COUNTER_MODULO) >= DEBOUNCING_DELAY) { - debounce_counters[row*MATRIX_COLS + col] = DEBOUNCE_COUNTER_INACTIVE; - } - } - } - } -} - -void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, uint8_t current_time) -{ - for (uint8_t row = 0; row < num_rows; row++) - { - matrix_row_t delta = raw[row] ^ cooked[row]; - - for (uint8_t col = 0; col < MATRIX_COLS; col++) - { - if (debounce_counters[row*MATRIX_COLS + col] == DEBOUNCE_COUNTER_INACTIVE && (delta & (1<<col))) - { - debounce_counters[row*MATRIX_COLS + col] = current_time; - cooked[row] ^= (1 << col); - } - } - } -} - -void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) -{ - uint8_t current_time = timer_read() % DEBOUNCE_COUNTER_MODULO; - - update_debounce_counters(num_rows, current_time); - transfer_matrix_values(raw, cooked, num_rows, current_time); -}
\ No newline at end of file diff --git a/keyboards/handwired/xealous/matrix.c b/keyboards/handwired/xealous/matrix.c index 27fad00083..e2d2199391 100644 --- a/keyboards/handwired/xealous/matrix.c +++ b/keyboards/handwired/xealous/matrix.c @@ -34,311 +34,21 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "matrix_scanrate.h" #endif - - -#ifdef USE_I2C -# include "i2c.h" -#else // USE_SERIAL -# error "only i2c supported" -#endif - -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 -#endif - - -#if (MATRIX_COLS <= 8) -# define print_matrix_header() print("\nr/c 01234567\n") -# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop(matrix[i]) -# define ROW_SHIFTER ((uint8_t)1) -#else -# error "Currently only supports 8 COLS" -#endif - -#define ERROR_DISCONNECT_COUNT 5 - -#define ROWS_PER_HAND (MATRIX_ROWS/2) - -static uint8_t error_count = 0; - -static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; -static matrix_row_t* debouncing_matrix_hand_offsetted; //pointer to matrix_debouncing for our hand -static matrix_row_t* matrix_hand_offsetted; // pointer to matrix for our hand - -//Debouncing counters -typedef uint8_t debounce_counter_t; -#define DEBOUNCE_COUNTER_MODULO 250 -#define DEBOUNCE_COUNTER_INACTIVE 251 -static debounce_counter_t debounce_counters[MATRIX_ROWS * MATRIX_COLS]; -static debounce_counter_t *debounce_counters_hand_offsetted; - - -#if (DIODE_DIRECTION == ROW2COL) - error "Only Col2Row supported"; -#endif -static void init_cols(void); -static void unselect_rows(void); -static void select_row(uint8_t row); -static void unselect_row(uint8_t row); -static matrix_row_t optimized_col_reader(void); - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -__attribute__ ((weak)) -void matrix_init_user(void) { -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - -__attribute__ ((weak)) -void matrix_slave_scan_user(void) { -} - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ -#ifdef DISABLE_JTAG - // JTAG disable for PORT F. write JTD bit twice within four cycles. - MCUCR |= (1<<JTD); - MCUCR |= (1<<JTD); -#endif - - debug_enable = true; - debug_matrix = false; - debug_mouse = false; - // initialize row and col - unselect_rows(); - init_cols(); - - TX_RX_LED_INIT; - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } - int my_hand_offset = isLeftHand ? 0 : (ROWS_PER_HAND); - debouncing_matrix_hand_offsetted = matrix_debouncing + my_hand_offset; - matrix_hand_offsetted = matrix + my_hand_offset; - debounce_counters_hand_offsetted = debounce_counters + my_hand_offset; - - for (uint8_t i = 0; i < MATRIX_ROWS * MATRIX_COLS; i++) { - debounce_counters[i] = DEBOUNCE_COUNTER_INACTIVE; - } - - matrix_init_quantum(); - -} - -//#define TIMER_DIFF(a, b, max) ((a) >= (b) ? (a) - (b) : (max) - (b) + (a)) -void update_debounce_counters(uint8_t current_time) -{ - debounce_counter_t *debounce_pointer = debounce_counters_hand_offsetted; - for (uint8_t row = 0; row < ROWS_PER_HAND; row++) - { - for (uint8_t col = 0; col < MATRIX_COLS; col++) - { - if (*debounce_pointer != DEBOUNCE_COUNTER_INACTIVE) - { - if (TIMER_DIFF(current_time, *debounce_pointer, DEBOUNCE_COUNTER_MODULO) >= - DEBOUNCING_DELAY) { - *debounce_pointer = DEBOUNCE_COUNTER_INACTIVE; - } - } - debounce_pointer++; - } - } -} - -void transfer_matrix_values(uint8_t current_time) -{ - //upload from debounce_matrix to final matrix; - debounce_counter_t *debounce_pointer = debounce_counters_hand_offsetted; - for (uint8_t row = 0; row < ROWS_PER_HAND; row++) - { - matrix_row_t row_value = matrix_hand_offsetted[row]; - matrix_row_t debounce_value = debouncing_matrix_hand_offsetted[row]; - - for (uint8_t col = 0; col < MATRIX_COLS; col++) - { - bool final_value = debounce_value & (1 << col); - bool current_value = row_value & (1 << col); - if (*debounce_pointer == DEBOUNCE_COUNTER_INACTIVE - && (current_value != final_value)) - { - *debounce_pointer = current_time; - row_value ^= (1 << col); - } - debounce_pointer++; - } - matrix_hand_offsetted[row] = row_value; - } -} - -uint8_t _matrix_scan(void) -{ - uint8_t current_time = timer_read() % DEBOUNCE_COUNTER_MODULO; - - // Set row, read cols - for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) { - select_row(current_row); - asm volatile ("nop"); asm volatile("nop"); - - debouncing_matrix_hand_offsetted[current_row] = optimized_col_reader(); - // Unselect row - unselect_row(current_row); - } - - update_debounce_counters(current_time); - transfer_matrix_values(current_time); - - return 1; -} - - -// Get rows from other half over i2c -int i2c_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); - if (err) goto i2c_error; - - // start of matrix stored at 0x00 - err = i2c_master_write(I2C_KEYMAP_START); - if (err) goto i2c_error; - - // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); - if (err) goto i2c_error; - - if (!err) { - int i; - for (i = 0; i < ROWS_PER_HAND-1; ++i) { - matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); - } - matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); - i2c_master_stop(); - } else { -i2c_error: // the cable is disconnceted, or something else went wrong - i2c_reset_state(); - return err; - } - - return 0; -} - -uint8_t matrix_scan(void) +void matrix_scan_user(void) { #ifdef DEBUG_MATRIX_SCAN_RATE matrix_check_scan_rate(); matrix_time_between_scans(); #endif - uint8_t ret = _matrix_scan(); - - if( i2c_transaction() ) { - // turn on the indicator led when halves are disconnected - TXLED1; - - error_count++; - - if (error_count > ERROR_DISCONNECT_COUNT) { - // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; - } - } - } else { - // turn off the indicator led on no error - TXLED0; - error_count = 0; - } - matrix_scan_quantum(); - return ret; -} - -void matrix_slave_scan(void) { - _matrix_scan(); - - int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - i2c_slave_buffer[I2C_KEYMAP_START+i] = matrix[offset+i]; - } - - matrix_slave_scan_user(); -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<<col)); -} - - -inline -matrix_row_t matrix_get_row(uint8_t row) -{ - return matrix[row]; -} - -void matrix_print(void) -{ - print("\nr/c 0123456789ABCDEF\n"); - for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - phex(row); print(": "); - pbin_reverse16(matrix_get_row(row)); - print("\n"); - } -} - -uint8_t matrix_key_count(void) -{ - uint8_t count = 0; - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - count += bitpop16(matrix[i]); - } - return count; -} - -static void init_cols(void) -{ - for(uint8_t x = 0; x < MATRIX_COLS; x++) { - uint8_t pin = col_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } + } -inline -static matrix_row_t optimized_col_reader(void) { +// Copy this code to split_common/matrix.c, +// and call it instead of the unoptimized col_reader. Scan-rate jumps from 1200->1920 +// Also remove the sleep_us(30), not necessary for this keyboard. +// In usb_descriptor.c, set .PollingIntervalMS = 0x01 +#define ROW_SHIFTER ((uint8_t)1) +inline static matrix_row_t optimized_col_reader(void) { //MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6, F5, F4 } return (PINB & (1 << 6) ? 0 : (ROW_SHIFTER << 0)) | (PINB & (1 << 2) ? 0 : (ROW_SHIFTER << 1)) | @@ -351,26 +61,3 @@ static matrix_row_t optimized_col_reader(void) { } -static void select_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW -} - -static void unselect_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI -} - -static void unselect_rows(void) -{ - for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - diff --git a/keyboards/handwired/xealous/rules.mk b/keyboards/handwired/xealous/rules.mk index 7d07c9aa5f..ef3357982e 100644 --- a/keyboards/handwired/xealous/rules.mk +++ b/keyboards/handwired/xealous/rules.mk @@ -1,5 +1,4 @@ -#SRC += matrix_scanrate.c matrix.c -SRC += debounce.c +SRC += matrix_scanrate.c matrix.c # MCU name MCU = atmega32u4 @@ -67,8 +66,7 @@ SUBPROJECT_rev1 = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -CUSTOM_MATRIX = no -DEBOUNCE_TYPE = custom +DEBOUNCE_TYPE = eager_pk LAYOUTS = split60 diff --git a/keyboards/hecomi/keymaps/default/keymap.c b/keyboards/hecomi/keymaps/default/keymap.c index 299d9037a8..25bddb7df2 100644 --- a/keyboards/hecomi/keymaps/default/keymap.c +++ b/keyboards/hecomi/keymaps/default/keymap.c @@ -14,7 +14,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include QMK_KEYBOARD_H -#include "hecomi.h" // Defines the keycodes used by our macros in process_record_user enum custom_keycodes { diff --git a/keyboards/helix/pico/keymaps/default/config.h b/keyboards/helix/pico/keymaps/default/config.h index 20dfc9f985..7653185198 100644 --- a/keyboards/helix/pico/keymaps/default/config.h +++ b/keyboards/helix/pico/keymaps/default/config.h @@ -18,8 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once // place overrides here @@ -42,5 +41,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. //#define RGBLIGHT_EFFECT_RGB_TEST //#define RGBLIGHT_EFFECT_ALTERNATING #endif - -#endif /* CONFIG_USER_H */ diff --git a/keyboards/helix/rev1/keymaps/default/config.h b/keyboards/helix/rev1/keymaps/default/config.h index d95925d4e4..0f81f5f7be 100644 --- a/keyboards/helix/rev1/keymaps/default/config.h +++ b/keyboards/helix/rev1/keymaps/default/config.h @@ -18,8 +18,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once + +// place overrides here /* Use I2C or Serial, not both */ @@ -31,5 +32,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define MASTER_LEFT // #define _MASTER_RIGHT // #define EE_HANDS - -#endif diff --git a/keyboards/helix/rev2/keymaps/default/config.h b/keyboards/helix/rev2/keymaps/default/config.h index ed37675794..b8c1041cdc 100644 --- a/keyboards/helix/rev2/keymaps/default/config.h +++ b/keyboards/helix/rev2/keymaps/default/config.h @@ -18,8 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once // place overrides here @@ -37,5 +36,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. //#define RGBLIGHT_EFFECT_RGB_TEST //#define RGBLIGHT_EFFECT_ALTERNATING #endif - -#endif /* CONFIG_USER_H */ diff --git a/keyboards/hid_liber/keymaps/default/keymap.c b/keyboards/hid_liber/keymaps/default/keymap.c index 67d57d0622..8140edc008 100755 --- a/keyboards/hid_liber/keymaps/default/keymap.c +++ b/keyboards/hid_liber/keymaps/default/keymap.c @@ -14,7 +14,7 @@ * 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 "hid_liber.h" +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. diff --git a/keyboards/hifumi/config.h b/keyboards/hifumi/config.h new file mode 100644 index 0000000000..dccb0352df --- /dev/null +++ b/keyboards/hifumi/config.h @@ -0,0 +1,56 @@ +/* +Copyright 2019 zk-phi + +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 0xFEED +#define PRODUCT_ID 0x3060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER riconken +#define PRODUCT hifumi +#define DESCRIPTION A macropad with 6 keys + +/* key matrix size */ +#define MATRIX_ROWS 2 +#define MATRIX_COLS 3 + +/* + * 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 { D4, C6 } +#define MATRIX_COL_PINS { F4, F5, F6 } +#define UNUSED_PINS +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLED_NUM 6 +#define RGBLIGHT_LIMIT_VAL 255 +#define RGBLIGHT_HUE_STEP 5 +#define RGBLIGHT_ANIMATIONS diff --git a/keyboards/hifumi/hifumi.h b/keyboards/hifumi/hifumi.h new file mode 100644 index 0000000000..389ce206e0 --- /dev/null +++ b/keyboards/hifumi/hifumi.h @@ -0,0 +1,31 @@ +/* Copyright 2019 zk-phi + * + * 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" + +// This a shortcut to help you visually see your layout. +// The following is an example using the Planck MIT layout +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array +#define LAYOUT( \ + k00, k01, k02, \ + k10, k11, k12 \ +) \ +{ \ + { k00, k01, k02 }, \ + { k10, k11, k12 } \ +} diff --git a/keyboards/hifumi/info.json b/keyboards/hifumi/info.json new file mode 100644 index 0000000000..2466838a04 --- /dev/null +++ b/keyboards/hifumi/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "hifumi", + "url": "https://github.com/zk-phi/1x2x3-keyboard", + "maintainer": "riconken", + "width": 3, + "height": 2, + "layouts": { + "LAYOUT": { + "layout": [{"label":"F5", "x":0, "y":0}, {"label":"Up", "x":1, "y":0}, {"label":"PrSc", "x":2, "y":0}, {"label":"Left", "x":0, "y":1}, {"label":"Down", "x":1, "y":1}, {"label":"Right", "x":2, "y":1}] + } + } +} diff --git a/keyboards/hifumi/keymaps/default/keymap.c b/keyboards/hifumi/keymaps/default/keymap.c new file mode 100644 index 0000000000..9a4330398f --- /dev/null +++ b/keyboards/hifumi/keymaps/default/keymap.c @@ -0,0 +1,47 @@ +/* Copyright 2019 zk-phi + * + * 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 QMK_KEYBOARD_H + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +enum layers { + DEFAULT, + RAISE, + LOWER, + ADJUST +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [DEFAULT] = LAYOUT( + LT(RAISE, KC_F5), KC_UP, LT(LOWER, KC_PSCR), + KC_LEFT, KC_DOWN, KC_RIGHT + ), + [RAISE] = LAYOUT( + _______, KC_PGUP, MO(ADJUST), + KC_HOME, KC_PGDN, KC_END + ), + [LOWER] = LAYOUT( + MO(ADJUST), _______, _______, + _______, _______, _______ + ), + [ADJUST] = LAYOUT( + _______, RGB_TOG, _______, + RGB_MODE_SNAKE, RGB_MODE_PLAIN, RGB_HUI + ) +}; diff --git a/keyboards/hifumi/keymaps/test/keymap.c b/keyboards/hifumi/keymaps/test/keymap.c new file mode 100644 index 0000000000..7aec009ebf --- /dev/null +++ b/keyboards/hifumi/keymaps/test/keymap.c @@ -0,0 +1,32 @@ +/* Copyright 2019 zk-phi + * + * 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 QMK_KEYBOARD_H + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +enum layers { + DEFAULT +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [DEFAULT] = LAYOUT( + KC_1, KC_2, KC_3, + KC_A, KC_B, KC_C + ) +}; diff --git a/keyboards/hifumi/readme.md b/keyboards/hifumi/readme.md new file mode 100644 index 0000000000..2911c12444 --- /dev/null +++ b/keyboards/hifumi/readme.md @@ -0,0 +1,13 @@ +# hifumi + +A macro pad with 6 keys. + +Keyboard Maintainer: riconken, [zk-phi](https://github.com/zk-phi) +Hardware Supported: hifumi PCB, Pro Micro +Hardware Availability: [PCB & Case Data](https://github.com/zk-phi/1x2x3-keyboard) + +Make example for this keyboard (after setting up your build environment): + + make hifumi:default + +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/hifumi/rules.mk b/keyboards/hifumi/rules.mk new file mode 100644 index 0000000000..98560f0580 --- /dev/null +++ b/keyboards/hifumi/rules.mk @@ -0,0 +1,62 @@ +# MCU name +#MCU = at90usb1286 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = no # Enable one-hand typing diff --git a/keyboards/hotdox/config.h b/keyboards/hotdox/config.h new file mode 100644 index 0000000000..ed15f4bb4a --- /dev/null +++ b/keyboards/hotdox/config.h @@ -0,0 +1,78 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0xE11D + +#define DEVICE_VER 0x0001 +#define MANUFACTURER Z.P.Z.O. +#define PRODUCT HotDox +#define DESCRIPTION QMK keyboard firmware for HotDox + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 14 + +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_MAX_SPEED 7 +#define MOUSEKEY_WHEEL_DELAY 0 + +#define TAPPING_TOGGLE 1 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +#define TAPPING_TERM 200 +#define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.) + +/* 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 + +/* key combination for command */ +#ifndef IS_COMMAND +#define IS_COMMAND() ( \ + get_mods() == MOD_MASK_CTRL || \ + get_mods() == MOD_MASK_SHIFT \ +) +#endif + +#define BACKLIGHT_PIN B7 +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 3 + +#define LED_BRIGHTNESS_LO 15 +#define LED_BRIGHTNESS_HI 255 + +/* fix space cadet rollover issue */ +#define DISABLE_SPACE_CADET_ROLLOVER + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +#define USB_MAX_POWER_CONSUMPTION 500 + +/* + * 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 +//#define DEBUG_MATRIX_SCAN_RATE + diff --git a/keyboards/hotdox/hotdox.c b/keyboards/hotdox/hotdox.c new file mode 100644 index 0000000000..00af9efb1e --- /dev/null +++ b/keyboards/hotdox/hotdox.c @@ -0,0 +1,44 @@ +#include "hotdox.h" +#include "backlight.h" +#include "quantum.h" + +extern inline void ergodox_board_led_on(void); +extern inline void ergodox_right_led_1_on(void); +extern inline void ergodox_right_led_2_on(void); +extern inline void ergodox_right_led_3_on(void); + +extern inline void ergodox_board_led_off(void); +extern inline void ergodox_right_led_1_off(void); +extern inline void ergodox_right_led_2_off(void); +extern inline void ergodox_right_led_3_off(void); + +extern inline void ergodox_led_all_on(void); +extern inline void ergodox_led_all_off(void); + +void ergodox_led_init(void); +void ergodox_blink_all_leds(void); + +void matrix_init_kb(void) { + ergodox_blink_all_leds(); + matrix_init_user(); +} + +void ergodox_blink_all_leds(void) +{ + ergodox_led_all_off(); + ergodox_led_all_set(LED_BRIGHTNESS_HI); + ergodox_right_led_1_on(); + _delay_ms(50); + ergodox_right_led_2_on(); + _delay_ms(50); + ergodox_right_led_3_on(); + _delay_ms(50); + ergodox_right_led_1_off(); + _delay_ms(50); + ergodox_right_led_2_off(); + _delay_ms(50); + ergodox_right_led_3_off(); + ergodox_led_all_on(); + _delay_ms(333); + ergodox_led_all_off(); +} diff --git a/keyboards/hotdox/hotdox.h b/keyboards/hotdox/hotdox.h new file mode 100644 index 0000000000..0eef4ea790 --- /dev/null +++ b/keyboards/hotdox/hotdox.h @@ -0,0 +1,187 @@ +#pragma once + +#include "quantum.h" +#include <stdint.h> +#include <stdbool.h> + +#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n)) +#define CPU_16MHz 0x00 + +void init_ergodox(void); + +inline void ergodox_board_led_on(void) { DDRB |= (1<<PB7); PORTB |= (1<<PB7); } +inline void ergodox_right_led_1_on(void) { DDRB |= (1<<PB5); PORTB &= ~(1<<PB5); } +inline void ergodox_right_led_2_on(void) { DDRB |= (1<<PB6); PORTB &= ~(1<<PB6); } +inline void ergodox_right_led_3_on(void) { DDRB |= (1<<PB4); PORTB &= ~(1<<PB4); } + +inline void ergodox_board_led_off(void) { DDRB |= (1<<PB7); PORTB &= ~(1<<PB7); } +inline void ergodox_right_led_1_off(void) { DDRB |= (1<<PB5); PORTB |= (1<<PB5); } +inline void ergodox_right_led_2_off(void) { DDRB |= (1<<PB6); PORTB |= (1<<PB6); } +inline void ergodox_right_led_3_off(void) { DDRB |= (1<<PB4); PORTB |= (1<<PB4); } + +inline void ergodox_right_led_on(uint8_t l) { + switch (l) { + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + case 3: + ergodox_right_led_3_on(); + break; + default: + break; + } +} + +inline void ergodox_right_led_off(uint8_t l) { + switch (l) { + case 1: + ergodox_right_led_1_off(); + break; + case 2: + ergodox_right_led_2_off(); + break; + case 3: + ergodox_right_led_3_off(); + break; + default: + break; + } +} + +inline void ergodox_led_all_on(void) { + ergodox_board_led_on(); + ergodox_right_led_1_on(); + ergodox_right_led_2_on(); + ergodox_right_led_3_on(); +} + +inline void ergodox_led_all_off(void) { + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); +} + +inline void ergodox_right_led_1_set(uint8_t n) {} +inline void ergodox_right_led_2_set(uint8_t n) {} +inline void ergodox_right_led_3_set(uint8_t n) {} +inline void ergodox_right_led_set(uint8_t l, uint8_t n) {} +inline void ergodox_led_all_set(uint8_t n) {} + +void ergodox_blink_all_leds(void); + +/* + * LEFT HAND: LINES 76-83 + * RIGHT HAND: LINES 85-92 + */ +#define LAYOUT_ergodox( \ + \ + k00,k01,k02,k03,k04,k05,k06, \ + k10,k11,k12,k13,k14,k15,k16, \ + k20,k21,k22,k23,k24,k25, \ + k30,k31,k32,k33,k34,k35,k36, \ + k40,k41,k42,k43,k44, \ + k55,k56, \ + k54, \ + k51,k52,k53, \ + \ + k07,k08,k09,k0A,k0B,k0C,k0D, \ + k17,k18,k19,k1A,k1B,k1C,k1D, \ + k28,k29,k2A,k2B,k2C,k2D, \ + k37,k38,k39,k3A,k3B,k3C,k3D, \ + k49,k4A,k4B,k4C,k4D, \ + k57,k58, \ + k59, \ + k5A,k5B,k5C ) \ + \ + /* matrix positions */ \ + { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D }, \ + { k20, k21, k22, k23, k24, k25, KC_NO, KC_NO, k28, k29, k2A, k2B, k2C, k2D }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D }, \ + { k40, k41, k42, k43, k44, KC_NO, KC_NO, KC_NO, KC_NO, k49, k4A, k4B, k4C, k4D }, \ + { KC_NO, k51, k52, k53, k54, k55, k56, k57, k58, k59, k5A, k5B, k5C, KC_NO } \ + } + +/* + * LEFT HAND: LINES 110-117 + * RIGHT HAND: LINES 119-126 + */ +#define LAYOUT_ergodox_80( \ + \ + k00,k01,k02,k03,k04,k05,k06, \ + k10,k11,k12,k13,k14,k15,k16, \ + k20,k21,k22,k23,k24,k25, \ + k30,k31,k32,k33,k34,k35,k36, \ + k40,k41,k42,k43,k44, \ + k55,k56, \ + k45,k46,k54, \ + k53,k52,k51, \ + \ + k07,k08,k09,k0A,k0B,k0C,k0D, \ + k17,k18,k19,k1A,k1B,k1C,k1D, \ + k28,k29,k2A,k2B,k2C,k2D, \ + k37,k38,k39,k3A,k3B,k3C,k3D, \ + k49,k4A,k4B,k4C,k4D, \ + k57,k58, \ + k59,k47,k48, \ + k5A,k5B,k5C ) \ + \ + /* matrix positions */ \ + { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D }, \ + { k20, k21, k22, k23, k24, k25, KC_NO, KC_NO, k28, k29, k2A, k2B, k2C, k2D }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D }, \ + { k40, k41, k42, k43, k44, k45, k45, k47, k48, k49, k4A, k4B, k4C, k4D }, \ + { KC_NO, k51, k52, k53, k54, k55, k56, k57, k58, k59, k5A, k5B, k5C, KC_NO } \ + } + +/* ---------- LEFT HAND ----------- ---------- RIGHT HAND ---------- */ +#define LAYOUT_ergodox_pretty( \ + \ + L00,L01,L02,L03,L04,L05,L06, R00,R01,R02,R03,R04,R05,R06, \ + L10,L11,L12,L13,L14,L15,L16, R10,R11,R12,R13,R14,R15,R16, \ + L20,L21,L22,L23,L24,L25, R21,R22,R23,R24,R25,R26, \ + L30,L31,L32,L33,L34,L35,L36, R30,R31,R32,R33,R34,R35,R36, \ + L40,L41,L42,L43,L44, R42,R43,R44,R45,R46, \ + L55,L56, R50,R51, \ + L54, R52, \ + L51,L52,L53, R53,R54,R55 ) \ + \ + /* matrix positions */ \ + { \ + { L00,L01,L02,L03,L04,L05,L06, R00,R01,R02,R03,R04,R05,R06 }, \ + { L10,L11,L12,L13,L14,L15,L16, R10,R11,R12,R13,R14,R15,R16 }, \ + { L20,L21,L22,L23,L24,L25,KC_NO, KC_NO,R21,R22,R23,R24,R25,R26 }, \ + { L30,L31,L32,L33,L34,L35,L36, R30,R31,R32,R33,R34,R35,R36 }, \ + { L40,L41,L42,L43,L44,KC_NO,KC_NO, KC_NO,KC_NO,R42,R43,R44,R45,R46 }, \ + { KC_NO,L51,L52,L53,L54,L55,L56, R50,R51,R52,R53,R54,R55,KC_NO } \ + } + +/* ---------- LEFT HAND ----------- ---------- RIGHT HAND ---------- */ +#define LAYOUT_ergodox_pretty_80( \ + \ + L00,L01,L02,L03,L04,L05,L06, R00,R01,R02,R03,R04,R05,R06, \ + L10,L11,L12,L13,L14,L15,L16, R10,R11,R12,R13,R14,R15,R16, \ + L20,L21,L22,L23,L24,L25, R21,R22,R23,R24,R25,R26, \ + L30,L31,L32,L33,L34,L35,L36, R30,R31,R32,R33,R34,R35,R36, \ + L40,L41,L42,L43,L44, R42,R43,R44,R45,R46, \ + L55,L56, R50,R51, \ + L45,L46,L54, R52,R40,R41, \ + L51,L52,L53, R53,R54,R55 ) \ + \ + /* matrix positions */ \ + { \ + { L00,L01,L02,L03,L04,L05,L06, R00,R01,R02,R03,R04,R05,R06 }, \ + { L10,L11,L12,L13,L14,L15,L16, R10,R11,R12,R13,R14,R15,R16 }, \ + { L20,L21,L22,L23,L24,L25,KC_NO, KC_NO,R21,R22,R23,R24,R25,R26 }, \ + { L30,L31,L32,L33,L34,L35,L36, R30,R31,R32,R33,R34,R35,R36 }, \ + { L40,L41,L42,L43,L44,L45,L46, R40,R41,R42,R43,R44,R45,R46 }, \ + { KC_NO,L51,L52,L53,L54,L55,L56, R50,R51,R52,R53,R54,R55,KC_NO } \ + } + diff --git a/keyboards/hotdox/info.json b/keyboards/hotdox/info.json new file mode 100644 index 0000000000..cdfcd990c6 --- /dev/null +++ b/keyboards/hotdox/info.json @@ -0,0 +1,107 @@ +{ + "keyboard_name": "HotDox", + "maintainer": "layne001365", + "width": 19.5, + "height": 9.375, + + "layouts": { + "LAYOUT_ergodox": { + + "layout": [ + {"x":0, "y":0.375, "w":1.5}, {"x":1.5, "y":0.375}, {"x":2.5, "y":0.125}, {"x":3.5, "y":0}, {"x":4.5, "y":0.125}, {"x":5.5, "y":0.25}, {"x":6.5, "y":0.25}, + {"x":0, "y":1.375, "w":1.5}, {"x":1.5, "y":1.375}, {"x":2.5, "y":1.125}, {"x":3.5, "y":1}, {"x":4.5, "y":1.125}, {"x":5.5, "y":1.25}, {"x":6.5, "y":1.25, "h":1.5}, + {"x":0, "y":2.375, "w":1.5}, {"x":1.5, "y":2.375}, {"x":2.5, "y":2.125}, {"x":3.5, "y":2}, {"x":4.5, "y":2.125}, {"x":5.5, "y":2.25}, + {"x":0, "y":3.375, "w":1.5}, {"x":1.5, "y":3.375}, {"x":2.5, "y":3.125}, {"x":3.5, "y":3}, {"x":4.5, "y":3.125}, {"x":5.5, "y":3.25}, {"x":6.5, "y":2.75, "h":1.5}, + {"x":0.5, "y":4.375}, {"x":1.5, "y":4.375}, {"x":2.5, "y":4.125}, {"x":3.5, "y":4}, {"x":4.5, "y":4.125}, + + {"x":6, "y":5}, {"x":7, "y":5}, + {"x":7, "y":6}, + {"x":5, "y":6, "h":2}, {"x":6, "y":6, "h":2}, {"x":7, "y":7}, + + + {"x":9.5, "y":0.25}, {"x":10.5, "y":0.25}, {"x":11.5, "y":0.125}, {"x":12.5, "y":0}, {"x":13.5, "y":0.125}, {"x":14.5, "y":0.375}, {"x":15.5, "y":0.375, "w":1.5}, + {"x":9.5, "y":1.25, "h":1.5}, {"x":10.5, "y":1.25}, {"x":11.5, "y":1.125}, {"x":12.5, "y":1}, {"x":13.5, "y":1.125}, {"x":14.5, "y":1.375}, {"x":15.5, "y":1.375, "w":1.5}, + {"x":10.5, "y":2.25}, {"x":11.5, "y":2.125}, {"x":12.5, "y":2}, {"x":13.5, "y":2.125}, {"x":14.5, "y":2.375}, {"x":15.5, "y":2.375, "w":1.5}, + {"x":9.5, "y":2.75, "h":1.5}, {"x":10.5, "y":3.25}, {"x":11.5, "y":3.125}, {"x":12.5, "y":3}, {"x":13.5, "y":3.125}, {"x":14.5, "y":3.375}, {"x":15.5, "y":3.375, "w":1.5}, + {"x":11.5, "y":4.125}, {"x":12.5, "y":4}, {"x":13.5, "y":4.125}, {"x":14.5, "y":4.375}, {"x":15.5, "y":4.375}, + + + {"x":9, "y":5}, {"x":10, "y":5}, + {"x":9, "y":6}, + {"x":9, "y":7}, {"x":10, "y":6, "h":2}, {"x":11, "y":6, "h":2} + ] + }, + "LAYOUT_ergodox_pretty": { + "layout": [ + {"x":0, "y":0.375, "w":1.5}, {"x":1.5, "y":0.375}, {"x":2.5, "y":0.125}, {"x":3.5, "y":0}, {"x":4.5, "y":0.125}, {"x":5.5, "y":0.25}, {"x":6.5, "y":0.25}, + {"x":9.5, "y":0.25}, {"x":10.5, "y":0.25}, {"x":11.5, "y":0.125}, {"x":12.5, "y":0}, {"x":13.5, "y":0.125}, {"x":14.5, "y":0.375}, {"x":15.5, "y":0.375, "w":1.5}, + + {"x":0, "y":1.375, "w":1.5}, {"x":1.5, "y":1.375}, {"x":2.5, "y":1.125}, {"x":3.5, "y":1}, {"x":4.5, "y":1.125}, {"x":5.5, "y":1.25}, {"x":6.5, "y":1.25, "h":1.5}, + {"x":9.5, "y":1.25, "h":1.5}, {"x":10.5, "y":1.25}, {"x":11.5, "y":1.125}, {"x":12.5, "y":1}, {"x":13.5, "y":1.125}, {"x":14.5, "y":1.375}, {"x":15.5, "y":1.375, "w":1.5}, + + {"x":0, "y":2.375, "w":1.5}, {"x":1.5, "y":2.375}, {"x":2.5, "y":2.125}, {"x":3.5, "y":2}, {"x":4.5, "y":2.125}, {"x":5.5, "y":2.25}, + {"x":10.5, "y":2.25}, {"x":11.5, "y":2.125}, {"x":12.5, "y":2}, {"x":13.5, "y":2.125}, {"x":14.5, "y":2.375}, {"x":15.5, "y":2.375, "w":1.5}, + + {"x":0, "y":3.375, "w":1.5}, {"x":1.5, "y":3.375}, {"x":2.5, "y":3.125}, {"x":3.5, "y":3}, {"x":4.5, "y":3.125}, {"x":5.5, "y":3.25}, {"x":6.5, "y":2.75, "h":1.5}, + {"x":9.5, "y":2.75, "h":1.5}, {"x":10.5, "y":3.25}, {"x":11.5, "y":3.125}, {"x":12.5, "y":3}, {"x":13.5, "y":3.125}, {"x":14.5, "y":3.375}, {"x":15.5, "y":3.375, "w":1.5}, + + {"x":0.5, "y":4.375}, {"x":1.5, "y":4.375}, {"x":2.5, "y":4.125}, {"x":3.5, "y":4}, {"x":4.5, "y":4.125}, + {"x":11.5, "y":4.125}, {"x":12.5, "y":4}, {"x":13.5, "y":4.125}, {"x":14.5, "y":4.375}, {"x":15.5, "y":4.375}, + + {"x":6, "y":5}, {"x":7, "y":5}, {"x":9, "y":5}, {"x":10, "y":5}, + {"x":7, "y":6}, {"x":9, "y":6}, + {"x":5, "y":6, "h":2}, {"x":6, "y":6, "h":2}, {"x":7, "y":7}, {"x":9, "y":7}, {"x":10, "y":6, "h":2}, {"x":11, "y":6, "h":2} + ] + }, + "LAYOUT_ergodox_80": { + + "layout": [ + {"x":0, "y":0.375, "w":1.5}, {"x":1.5, "y":0.375}, {"x":2.5, "y":0.125}, {"x":3.5, "y":0}, {"x":4.5, "y":0.125}, {"x":5.5, "y":0.25}, {"x":6.5, "y":0.25}, + {"x":0, "y":1.375, "w":1.5}, {"x":1.5, "y":1.375}, {"x":2.5, "y":1.125}, {"x":3.5, "y":1}, {"x":4.5, "y":1.125}, {"x":5.5, "y":1.25}, {"x":6.5, "y":1.25, "h":1.5}, + {"x":0, "y":2.375, "w":1.5}, {"x":1.5, "y":2.375}, {"x":2.5, "y":2.125}, {"x":3.5, "y":2}, {"x":4.5, "y":2.125}, {"x":5.5, "y":2.25}, + {"x":0, "y":3.375, "w":1.5}, {"x":1.5, "y":3.375}, {"x":2.5, "y":3.125}, {"x":3.5, "y":3}, {"x":4.5, "y":3.125}, {"x":5.5, "y":3.25}, {"x":6.5, "y":2.75, "h":1.5}, + {"x":0.5, "y":4.375}, {"x":1.5, "y":4.375}, {"x":2.5, "y":4.125}, {"x":3.5, "y":4}, {"x":4.5, "y":4.125}, + + {"x":6, "y":5}, {"x":7, "y":5}, + + {"x":5, "y":6}, {"x":6, "y":6}, {"x":7, "y":6}, + {"x":5, "y":7}, {"x":6, "y":7}, {"x":7, "y":7}, + + + {"x":9.5, "y":0.25}, {"x":10.5, "y":0.25}, {"x":11.5, "y":0.125}, {"x":12.5, "y":0}, {"x":13.5, "y":0.125}, {"x":14.5, "y":0.375}, {"x":15.5, "y":0.375, "w":1.5}, + {"x":9.5, "y":1.25, "h":1.5}, {"x":10.5, "y":1.25}, {"x":11.5, "y":1.125}, {"x":12.5, "y":1}, {"x":13.5, "y":1.125}, {"x":14.5, "y":1.375}, {"x":15.5, "y":1.375, "w":1.5}, + {"x":10.5, "y":2.25}, {"x":11.5, "y":2.125}, {"x":12.5, "y":2}, {"x":13.5, "y":2.125}, {"x":14.5, "y":2.375}, {"x":15.5, "y":2.375, "w":1.5}, + {"x":9.5, "y":2.75, "h":1.5}, {"x":10.5, "y":3.25}, {"x":11.5, "y":3.125}, {"x":12.5, "y":3}, {"x":13.5, "y":3.125}, {"x":14.5, "y":3.375}, {"x":15.5, "y":3.375, "w":1.5}, + {"x":11.5, "y":4.125}, {"x":12.5, "y":4}, {"x":13.5, "y":4.125}, {"x":14.5, "y":4.375}, {"x":15.5, "y":4.375}, + + + {"x":9, "y":5}, {"x":10, "y":5}, + {"x":9, "y":6}, {"x":10, "y":6}, {"x":11, "y":6}, + {"x":9, "y":7}, {"x":10, "y":7}, {"x":11, "y":7} + ] + }, + "LAYOUT_ergodox_pretty_80": { + + "layout": [ + {"x":0, "y":0.375, "w":1.5}, {"x":1.5, "y":0.375}, {"x":2.5, "y":0.125}, {"x":3.5, "y":0}, {"x":4.5, "y":0.125}, {"x":5.5, "y":0.25}, {"x":6.5, "y":0.25}, + {"x":9.5, "y":0.25}, {"x":10.5, "y":0.25}, {"x":11.5, "y":0.125}, {"x":12.5, "y":0}, {"x":13.5, "y":0.125}, {"x":14.5, "y":0.375}, {"x":15.5, "y":0.375, "w":1.5}, + + {"x":0, "y":1.375, "w":1.5}, {"x":1.5, "y":1.375}, {"x":2.5, "y":1.125}, {"x":3.5, "y":1}, {"x":4.5, "y":1.125}, {"x":5.5, "y":1.25}, {"x":6.5, "y":1.25, "h":1.5}, + {"x":9.5, "y":1.25, "h":1.5}, {"x":10.5, "y":1.25}, {"x":11.5, "y":1.125}, {"x":12.5, "y":1}, {"x":13.5, "y":1.125}, {"x":14.5, "y":1.375}, {"x":15.5, "y":1.375, "w":1.5}, + + {"x":0, "y":2.375, "w":1.5}, {"x":1.5, "y":2.375}, {"x":2.5, "y":2.125}, {"x":3.5, "y":2}, {"x":4.5, "y":2.125}, {"x":5.5, "y":2.25}, + {"x":10.5, "y":2.25}, {"x":11.5, "y":2.125}, {"x":12.5, "y":2}, {"x":13.5, "y":2.125}, {"x":14.5, "y":2.375}, {"x":15.5, "y":2.375, "w":1.5}, + + {"x":0, "y":3.375, "w":1.5}, {"x":1.5, "y":3.375}, {"x":2.5, "y":3.125}, {"x":3.5, "y":3}, {"x":4.5, "y":3.125}, {"x":5.5, "y":3.25}, {"x":6.5, "y":2.75, "h":1.5}, + {"x":9.5, "y":2.75, "h":1.5}, {"x":10.5, "y":3.25}, {"x":11.5, "y":3.125}, {"x":12.5, "y":3}, {"x":13.5, "y":3.125}, {"x":14.5, "y":3.375}, {"x":15.5, "y":3.375, "w":1.5}, + + {"x":0.5, "y":4.375}, {"x":1.5, "y":4.375}, {"x":2.5, "y":4.125}, {"x":3.5, "y":4}, {"x":4.5, "y":4.125}, + {"x":11.5, "y":4.125}, {"x":12.5, "y":4}, {"x":13.5, "y":4.125}, {"x":14.5, "y":4.375}, {"x":15.5, "y":4.375}, + + {"x":6, "y":5}, {"x":7, "y":5}, {"x":9, "y":5}, {"x":10, "y":5}, + {"x":5, "y":6}, {"x":6, "y":6}, {"x":7, "y":6}, {"x":9, "y":6}, {"x":10, "y":6}, {"x":11, "y":6}, + {"x":5, "y":7}, {"x":6, "y":7}, {"x":7, "y":7}, {"x":9, "y":7}, {"x":10, "y":7}, {"x":11, "y":7} + ] + } + } +} diff --git a/keyboards/hotdox/keymaps/default/keymap.c b/keyboards/hotdox/keymaps/default/keymap.c new file mode 100644 index 0000000000..0ec7b352c1 --- /dev/null +++ b/keyboards/hotdox/keymaps/default/keymap.c @@ -0,0 +1,189 @@ +#include QMK_KEYBOARD_H +#include "version.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +enum custom_keycodes { + VRSN = SAFE_RANGE, + RGB_SLD +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Del | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | BkSp | A | S | D | F | G |------| |------| H | J | K | L |; / L2|' / Cmd | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | App | LGui | | Alt |Ctrl/Esc| + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|Backsp|------| |------| Tab |Enter | + * | |ace | End | | PgDn | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = LAYOUT_ergodox( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), + KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), + LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, + ALT_T(KC_APP), KC_LGUI, + KC_HOME, + KC_SPC,KC_BSPC,KC_END, + // right hand + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), + MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_LALT, CTL_T(KC_ESC), + KC_PGUP, + KC_PGDN,KC_TAB,KC_ENT + ), +/* Keymap 1: Symbol Layer + * + * ,---------------------------------------------------. ,--------------------------------------------------. + * |Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | EEP_RST | | | | | | | . | 0 | = | | + * `-----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * |Animat| | |Toggle|Solid | + * ,------|------|------| |------+------+------. + * |Bright|Bright| | | |Hue- |Hue+ | + * |ness- |ness+ |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = LAYOUT_ergodox( + // left hand + VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + EEP_RST,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + RGB_MOD,KC_TRNS, + KC_TRNS, + RGB_VAD,RGB_VAI,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + RGB_TOG, RGB_SLD, + KC_TRNS, + KC_TRNS, RGB_HUD, RGB_HUI +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = LAYOUT_ergodox( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + // dynamically generate these. + case VRSN: + if (record->event.pressed) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + return false; + break; + case RGB_SLD: + if (record->event.pressed) { + #ifdef RGBLIGHT_ENABLE + rgblight_mode(1); + #endif + } + return false; + break; + } + return true; +} + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } +}; diff --git a/keyboards/hotdox/keymaps/eozaki/keymap.c b/keyboards/hotdox/keymaps/eozaki/keymap.c new file mode 100644 index 0000000000..dc80e7a34e --- /dev/null +++ b/keyboards/hotdox/keymaps/eozaki/keymap.c @@ -0,0 +1,192 @@ +#include QMK_KEYBOARD_H +#include "version.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +enum custom_keycodes { + PLACEHOLDER = SAFE_RANGE, // can always be here + VRSN, + RGB_SLD +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | ~ | | ' | 6 | 7 | 8 | 9 | 0 | = | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Del | Q | W | E | R | T | ~ | | " | Y | U | I | O | P | - | + * |--------+------+------+------+------+------| ` | | |------+------+------+------+------+--------| + * | Ctrl | A | S | D | F | G |------| |------| H | J | K | L | ; | \ | + * |--------+------+------+------+------+------| { | | } |------+------+------+------+------+--------| + * | LAlt | Z | X | C | V | B | [ | | ] | N | M | , | . | / | LShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | LT-1 | F4 | F5 | F6 | F11 | | Left | Down | Up | Right| RAlt | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | L1 | Prev | | Vol+ | L2 | + * ,------|------|------| |------+--------+------. + * | | | Play | | Vol- | | | + * | Space|Backsp|------| |------| Tab |Enter | + * | |ace | Next | | Mute | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = LAYOUT_ergodox( // layer 0 : default + // left hand + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, LSFT(KC_GRV), + KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_GRV, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LALT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, + LT(SYMB, KC_F2), KC_F4, KC_F5, KC_F6, KC_F11, + TG(SYMB), KC_MPRV, + KC_MPLY, + KC_SPC,KC_BSPC,KC_MNXT, + // right hand + KC_QUOT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, + LSFT(KC_QUOT), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_BSLS, + KC_RBRC, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_LSFT, + KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,KC_RALT, + KC_VOLU, TG(MDIA), + KC_VOLD, + KC_MUTE,KC_TAB, KC_ENT + ), +/* Keymap 1: Symbol Layer + * + * ,---------------------------------------------------. ,--------------------------------------------------. + * |Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | EEP_RST | | | | | | | . | 0 | = | | + * `-----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * |Animat| | |Toggle|Solid | + * ,------|------|------| |------+------+------. + * |Bright|Bright| | | |Hue- |Hue+ | + * |ness- |ness+ |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = LAYOUT_ergodox( + // left hand + VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + EEP_RST,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + RGB_MOD,KC_TRNS, + KC_TRNS, + RGB_VAD,RGB_VAI,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + RGB_TOG, RGB_SLD, + KC_TRNS, + KC_TRNS, RGB_HUD, RGB_HUI +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = LAYOUT_ergodox( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + // dynamically generate these. + case VRSN: + if (record->event.pressed) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + return false; + break; + case RGB_SLD: + if (record->event.pressed) { + #ifdef RGBLIGHT_ENABLE + rgblight_mode(1); + #endif + } + return false; + break; + } + return true; +} + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/hotdox/keymaps/kloki/keymap.c b/keyboards/hotdox/keymaps/kloki/keymap.c new file mode 100644 index 0000000000..f858effd54 --- /dev/null +++ b/keyboards/hotdox/keymaps/kloki/keymap.c @@ -0,0 +1,210 @@ +#include QMK_KEYBOARD_H +#include "version.h" + +#define BASE 0 // default layer +#define QW 1 // qwerty +#define SYMB 2 // symbols +#define NUM 3 // media keys + +enum custom_keycodes { + PLACEHOLDER = SAFE_RANGE, // can always be here + VRSN, + RGB_SLD +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | SHIFT| | SYM | 6 | 7 | 8 | 9 | 0 | Bck | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | D | R | W | B | `~ | | "' | J | F | U | P | : | \ | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Ctr/Es | A | S | H | T | G |------| |------| Y | N | E | O | I | Enter | + * |--------+------+------+------+------+------| = + | | -_ |------+------+------+------+------+--------| + * | LShift | Z | X | M | C | V | | | | K | L | , | . | / | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |MEH | Gui |AltShf| Left | Right| | DOWN | UP | [ | ] | ~SYM | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | ESC |Home | | PgUp | QW | + * ,------|------|------| |------+--------+------. + * | | ENT | End | | PgDn | | | + * | Space| WIN |------| |------| Tab |Back | + * | SYM | | SCTR | | SALT | SYM | | + * `--------------------' `----------------------' + */ + +[BASE] = LAYOUT_ergodox( // layer 0 : default + // left hand + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LSFT, + KC_TAB, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_GRV, + CTL_T(KC_ESC), KC_A, KC_S, KC_H, KC_T, KC_G, + KC_LSFT, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_EQL, + KC_MEH, KC_LGUI, KC_LALT, KC_LEFT,KC_RGHT, + KC_ESC, KC_HOME, + KC_END, + LT(SYMB, KC_SPC), LGUI_T(KC_ENT), S(KC_LGUI), + // right hand + TG(NUM), KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_QUOT, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_BSLS, + KC_Y, KC_N, KC_E, KC_O, KC_I , KC_ENT, + KC_MINS, KC_K, KC_L, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, + KC_DOWN,KC_UP, KC_LBRC,KC_RBRC, MO(SYMB), + KC_PGUP, TG(QW), + KC_PGDN, + S(KC_LALT),LT(SYMB, KC_TAB), KC_BSPC + ), + +[QW] = LAYOUT_ergodox( + _______, _______, _______, _______, _______, _______, _______, + _______, KC_Q, KC_W, KC_E, KC_R, KC_T, _______, + _______, KC_A, KC_S, KC_D, KC_F, KC_G, + _______, KC_Z, KC_X, KC_C, KC_V, KC_B, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______, + // right hand + _______, _______, _______, _______, _______, _______, _______, + _______, KC_Y, KC_U, KC_I , KC_O, KC_P, _______, + KC_H, KC_J, KC_K , KC_L, KC_SCLN, _______, + _______, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______ +), +/* Keymap 1: Symbol Layer + * + * ,---------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | DEL | + * |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | * | | | | < | H | U | PU | * | | + * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| > | L | D | R | + | | + * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | E | D | PD | \ | | + * `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `-----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = LAYOUT_ergodox( + // left hand + _______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, + _______,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_ASTR,_______, + _______,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + _______,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,_______, + _______,_______,_______,_______,_______, + _______,_______, + _______, + _______,_______,_______, + // right hand + _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, + _______, KC_LABK, KC_HOME, KC_UP, KC_PGUP, KC_ASTR, _______, + KC_RABK, KC_LEFT, KC_DOWN, KC_RIGHT, KC_PLUS, _______, + _______, KC_AMPR, KC_END, KC_DOWN, KC_PGDN, KC_BSLS, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______ +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | L | MsUp | R | | | | | | 4 | 5 | 6 | | TAB | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | 1 | 2 | 3 | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | 0 | 0 | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +[NUM] = LAYOUT_ergodox( + _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_BTN1, KC_MS_U, KC_BTN2, _______, _______, + _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______, + // right hand + _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_4, KC_5 , KC_6, _______, KC_TAB, + _______, KC_1, KC_2 , KC_3, _______, _______, + _______, _______, _______, KC_0, KC_0, _______, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______ +), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + // dynamically generate these. + case VRSN: + if (record->event.pressed) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + return false; + break; + case RGB_SLD: + if (record->event.pressed) { + #ifdef RGBLIGHT_ENABLE + rgblight_mode(1); + #endif + } + return false; + break; + } + return true; +} + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + case 1: + ergodox_board_led_on(); + break; + case 3: + ergodox_board_led_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/hotdox/left.c b/keyboards/hotdox/left.c new file mode 100644 index 0000000000..970d36f1b5 --- /dev/null +++ b/keyboards/hotdox/left.c @@ -0,0 +1,130 @@ +#include "action.h" +#include "left.h" +#include "wait.h" + +bool i2c_initialized = false; + +void left_config(void); +uint8_t left_write(uint8_t reg, uint8_t data); +uint8_t left_read(uint8_t reg, uint8_t *data); + +uint8_t init_mcp23017(void) +{ + i2c_initialized = false; + + if (i2c_initialized == 0) + { + i2c_init(); // on pins D(1,0) + _delay_ms(1000); + } + + return 0; +} +void left_init(void) +{ + init_mcp23017(); + left_scan(); +#if 0 + while (1) + { + print("wait\n"); + wait_us(1000000); + } +#endif +} + +void left_scan(void) +{ + uint8_t ret = i2c_start(I2C_ADDR_WRITE, HOTDOX_I2C_TIMEOUT); + + if (ret == 0) + { + i2c_stop(); + + if (!i2c_initialized) + { + i2c_initialized = true; + left_config(); + clear_keyboard(); + print("mcp23017 attached!!!\n"); + } + } + else + { + if (i2c_initialized) + { + i2c_initialized = false; + clear_keyboard(); + print("mcp23017 deattached!!!\n"); + } + } + + return; +} + +uint8_t left_read_cols(void) +{ + uint8_t data = 0; + + left_read(MCP23017_B0_GPIOA, &data); + + return data; +} + +void left_unselect_rows(void) +{ + left_write(MCP23017_B0_IODIRB, 0x3F); +} + +void left_select_row(uint8_t row) +{ + left_write(MCP23017_B0_IODIRB, ~(1 << row)); +} + +void left_config(void) +{ + left_write(MCP23017_B0_IODIRA, 0x7F); + left_write(MCP23017_B0_IPOLA, 0x7F); + left_write(MCP23017_B0_GPPUA, 0x7F); + + left_write(MCP23017_B0_IODIRB, 0xFF); + left_write(MCP23017_B0_GPIOB, 0xC0); +} + +uint8_t left_write(uint8_t reg, uint8_t data) +{ + if (!i2c_initialized) + { + return 0; + } + + uint8_t ret; + + ret = i2c_start(I2C_ADDR_WRITE, HOTDOX_I2C_TIMEOUT); if (ret) goto out; + ret = i2c_write(reg, HOTDOX_I2C_TIMEOUT); if (ret) goto out; + ret = i2c_write(data, HOTDOX_I2C_TIMEOUT); + +out: + i2c_stop(); + return ret; +} + +uint8_t left_read(uint8_t reg, uint8_t *data) +{ + if (!i2c_initialized) + { + return 0; + } + + uint8_t ret = 0; + + ret = i2c_start(I2C_ADDR_WRITE, HOTDOX_I2C_TIMEOUT); if (ret) goto out; + ret = i2c_write(reg, HOTDOX_I2C_TIMEOUT); if (ret) goto out; + ret = i2c_start(I2C_ADDR_READ, HOTDOX_I2C_TIMEOUT); if (ret) goto out; + + *data = i2c_read_nack(HOTDOX_I2C_TIMEOUT); + +out: + i2c_stop(); + return ret; +} diff --git a/keyboards/hotdox/left.h b/keyboards/hotdox/left.h new file mode 100644 index 0000000000..3d8b5a6ead --- /dev/null +++ b/keyboards/hotdox/left.h @@ -0,0 +1,57 @@ +#pragma once + +#include "quantum.h" +#include <stdint.h> +#include "i2c_master.h" +#include <util/delay.h> + +#define MCP23017 +#define MCP23017_A0 0 +#define MCP23017_A1 0 +#define MCP23017_A2 0 + +#define I2C_ADDR (0x20) +#define I2C_ADDR_WRITE ((I2C_ADDR << 1) | I2C_WRITE) +#define I2C_ADDR_READ ((I2C_ADDR << 1) | I2C_READ) + + +#define MCP23017_B0_IODIRA 0x00 +#define MCP23017_B0_IODIRB 0x01 +#define MCP23017_B0_IPOLA 0x02 +#define MCP23017_B0_IPOLB 0x03 +#define MCP23017_B0_GPINTENA 0x04 +#define MCP23017_B0_GPINTENB 0x05 +#define MCP23017_B0_DEFVALA 0x06 +#define MCP23017_B0_DEFVALB 0x07 +#define MCP23017_B0_INTCONA 0x08 +#define MCP23017_B0_INTCONB 0x09 +#define MCP23017_B0_IOCONA 0x0A +#define MCP23017_B0_IOCONB 0x0B +#define MCP23017_B0_GPPUA 0x0C +#define MCP23017_B0_GPPUB 0x0D +#define MCP23017_B0_INTFA 0x0E +#define MCP23017_B0_INTFB 0x0F +#define MCP23017_B0_INTCAPA 0x10 +#define MCP23017_B0_INTCAPB 0x11 +#define MCP23017_B0_GPIOA 0x12 +#define MCP23017_B0_GPIOB 0x13 +#define MCP23017_B0_OLATA 0x14 +#define MCP23017_B0_OLATB 0x15 + +#define HOTDOX_I2C_TIMEOUT 100 + +typedef int16_t i2c_status_t; + +void left_init(void); +void left_scan(void); + +uint8_t left_read_cols(void); +uint8_t left_get_col(uint8_t col); + +matrix_row_t left_read_row(void); + +void left_unselect_rows(void); +void left_select_row(uint8_t row); + +uint8_t init_mcp23017(void); + diff --git a/keyboards/hotdox/matrix.c b/keyboards/hotdox/matrix.c new file mode 100644 index 0000000000..9d3a98db21 --- /dev/null +++ b/keyboards/hotdox/matrix.c @@ -0,0 +1,283 @@ +#include <stdint.h> +#include <stdbool.h> +#include <avr/io.h> +#include "wait.h" +#include "action_layer.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "hotdox.h" +#include "left.h" +#ifdef DEBUG_MATRIX_SCAN_RATE +#include "timer.h" +#endif + +/* + * This constant define not debouncing time in msecs, but amount of matrix + * scan loops which should be made to get stable debounced results. + * + * On Ergodox matrix scan rate is relatively low, because of slow I2C. + * Now it's only 317 scans/second, or about 3.15 msec/scan. + * According to Cherry specs, debouncing time is 5 msec. + * + * And so, there is no sense to have DEBOUNCE higher than 2. + */ + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; + +// Debouncing: store for each key the number of scans until it's eligible to +// change. When scanning the matrix, ignore any changes in keys that have +// already changed in the last DEBOUNCE scans. +static uint8_t debounce_matrix[MATRIX_ROWS * MATRIX_COLS]; + +static matrix_row_t read_cols(uint8_t row); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); + +#ifdef DEBUG_MATRIX_SCAN_RATE +uint32_t matrix_timer; +uint32_t matrix_scan_count; +#endif + + +__attribute__ ((weak)) +void matrix_init_user(void) {} + +__attribute__ ((weak)) +void matrix_scan_user(void) {} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + // disable JTAG + MCUCR = (1<<JTD); + MCUCR = (1<<JTD); + + unselect_rows(); + init_cols(); + + //eeprom_update_word(EECONFIG_MAGIC, 0x0000); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + for (uint8_t j=0; j < MATRIX_COLS; ++j) { + debounce_matrix[i * MATRIX_COLS + j] = 0; + } + } + +#ifdef DEBUG_MATRIX_SCAN_RATE + matrix_timer = timer_read32(); + matrix_scan_count = 0; +#endif + + matrix_init_quantum(); + +} + +void matrix_power_up(void) { + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + } + +#ifdef DEBUG_MATRIX_SCAN_RATE + matrix_timer = timer_read32(); + matrix_scan_count = 0; +#endif +} + +// Returns a matrix_row_t whose bits are set if the corresponding key should be +// eligible to change in this scan. +matrix_row_t debounce_mask(uint8_t row) { + matrix_row_t result = 0; + for (uint8_t j=0; j < MATRIX_COLS; ++j) { + if (debounce_matrix[row * MATRIX_COLS + j]) { + --debounce_matrix[row * MATRIX_COLS + j]; + } else { + result |= (1 << j); + } + } + return result; +} + +// Report changed keys in the given row. Resets the debounce countdowns +// corresponding to each set bit in 'change' to DEBOUNCE. +void debounce_report(matrix_row_t change, uint8_t row) { + for (uint8_t i = 0; i < MATRIX_COLS; ++i) { + if (change & (1 << i)) { + debounce_matrix[row * MATRIX_COLS + i] = DEBOUNCE; + } + } +} + +uint8_t matrix_scan(void) +{ + left_scan(); + +#ifdef DEBUG_MATRIX_SCAN_RATE + matrix_scan_count++; + + uint32_t timer_now = timer_read32(); + if (TIMER_DIFF_32(timer_now, matrix_timer)>1000) { + print("matrix scan frequency: "); + pdec(matrix_scan_count); + print("\n"); + matrix_print(); + + matrix_timer = timer_now; + matrix_scan_count = 0; + } +#endif + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + select_row(i); + wait_us(30); // without this wait read unstable value. + matrix_row_t mask = debounce_mask(i); + matrix_row_t cols = (read_cols(i) & mask) | (matrix[i] & ~mask); + debounce_report(cols ^ matrix[i], i); + matrix[i] = cols; + + unselect_rows(); + } + + matrix_scan_quantum(); + + return 1; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<<col)); +} + +inline +matrix_row_t matrix_get_row(uint8_t row) +{ + return matrix[row]; +} + +void matrix_print(void) +{ + print("\nr/c 0123456789ABCDEF\n"); + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + phex(row); print(": "); + pbin_reverse16(matrix_get_row(row)); + print("\n"); + } +} + +uint8_t matrix_key_count(void) +{ + uint8_t count = 0; + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + count += bitpop16(matrix[i]); + } + return count; +} + +static void init_cols(void) +{ + // Pro Micro + DDRB &= ~(1<<PB0 | 1<<PB1 | 1<<PB2 | 1<<PB3); + PORTB |= (1<<PB0 | 1<<PB1 | 1<<PB2 | 1<<PB3); + + DDRD &= ~(1<<PD2 | 1<<PD3); + PORTD |= (1<<PD2 | 1<<PD3); + + DDRC &= ~(1<<PC6); + PORTC |= (1<<PC6); + + left_init(); +} + +static matrix_row_t read_cols(uint8_t row) +{ + matrix_row_t cols0 = 0x00, cols1 = 0x00; + + cols0 = left_read_cols(); + + cols1 = (PINC&(1<<PC6) ? 0 : (1<<(0+7))) | + (PIND&(1<<PD3) ? 0 : (1<<(1+7))) | + (PIND&(1<<PD2) ? 0 : (1<<(2+7))) | + (PINB&(1<<PB3) ? 0 : (1<<(3+7))) | + (PINB&(1<<PB2) ? 0 : (1<<(4+7))) | + (PINB&(1<<PB1) ? 0 : (1<<(5+7))) | + (PINB&(1<<PB0) ? 0 : (1<<(6+7))) ; + + return (cols0 | cols1); +} + +static void unselect_rows(void) +{ + // Pro Micro + DDRF &= ~(1<<PF7 | 1<< PF6 | 1<<PF5 | 1<<PF4 | 1<<PF1 | 1<<PF0); + PORTF &= ~(1<<PF7 | 1<< PF6 | 1<<PF5 | 1<<PF4 | 1<<PF1 | 1<<PF0); + + left_unselect_rows(); +} + +static void select_row(uint8_t row) +{ + // Pro Micro + switch (row) { + case 5: + DDRF |= (1<<PF0); + PORTF &= ~(1<<PF0); + break; + case 4: + DDRF |= (1<<PF1); + PORTF &= ~(1<<PF1); + break; + case 3: + DDRF |= (1<<PF4); + PORTF &= ~(1<<PF4); + break; + case 2: + DDRF |= (1<<PF5); + PORTF &= ~(1<<PF5); + break; + case 1: + DDRF |= (1<<PF6); + PORTF &= ~(1<<PF6); + break; + case 0: + DDRF |= (1<<PF7); + PORTF &= ~(1<<PF7); + break; + } + + left_select_row(row); +} + diff --git a/keyboards/hotdox/readme.md b/keyboards/hotdox/readme.md new file mode 100644 index 0000000000..c8062b038a --- /dev/null +++ b/keyboards/hotdox/readme.md @@ -0,0 +1,23 @@ +HotDox +======== + +![HotDox](https://cdn.shopify.com/s/files/1/1994/3097/products/Sunset_Ergodox.jpg?v=1540495379) + +The HotDox is a modified version of the ErgoDox & ErgoDone(made by K.T.E.C.). + + +- Keyboard maintainer: [Layne](https://github.com/layne001365/qmk_firmware) + +# Building the firmware + +[Install the build tools.](https://docs.qmk.fm/#/getting_started_build_tools) + +In the root directory of the repository, build the firmware with a command like: + + make hotdox:default + +For more information on the layout option and other ones, see the [`make` guide](https://docs.qmk.fm/#/getting_started_make_guide). + +# Flashing the firmware onto the keyboard + https://docs.qmk.fm/#/newbs_flashing + diff --git a/keyboards/hotdox/rules.mk b/keyboards/hotdox/rules.mk new file mode 100644 index 0000000000..f785cdd060 --- /dev/null +++ b/keyboards/hotdox/rules.mk @@ -0,0 +1,82 @@ +#---------------------------------------------------------------------------- +# On command line: +# +# make = Make software. +# +# make clean = Clean out built project files. +# +# That's pretty much all you need. To compile, always go make clean, +# followed by make. +# +# For advanced users only: +# make teensy = Download the hex file to the device, using teensy_loader_cli. +# (must have teensy_loader_cli installed). +# +#---------------------------------------------------------------------------- + +# # project specific files +SRC = matrix.c \ + i2c_master.c \ + left.c + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Boot Section +BOOTLOADER = atmel-dfu + +# Build Options +# comment out to disable the options. +# +CUSTOM_MATRIX = yes # Custom matrix file for the ErgoDone +UNICODE_ENABLE = yes # Unicode +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA +USB_6KRO_ENABLE = no # USB 6key Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +KEYMAP_SECTION_ENABLE = no # Fixed address keymap for keymap editor +SWAP_HANDS_ENABLE = no # Disable Onehand +RGBLIGHT_ENABLE = no +MIDI_ENABLE = no + +LAYOUTS = ergodox diff --git a/keyboards/hs60/v1/config.h b/keyboards/hs60/v1/config.h index 7581e54b61..528f08bb99 100644 --- a/keyboards/hs60/v1/config.h +++ b/keyboards/hs60/v1/config.h @@ -120,7 +120,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects #define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended -#define RGB_MATRIX_SKIP_FRAMES 0 #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 215 #define DRIVER_ADDR_1 0b1110100 diff --git a/keyboards/hs60/v2/config.h b/keyboards/hs60/v2/config.h index b0c56adf89..05255d1331 100644 --- a/keyboards/hs60/v2/config.h +++ b/keyboards/hs60/v2/config.h @@ -102,9 +102,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. // disable backlight after timeout in minutes, 0 = no timeout #define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0 +// the default brightness +#define RGB_BACKLIGHT_BRIGHTNESS 255 + // the default effect (RGB test) #define RGB_BACKLIGHT_EFFECT 255 +// the default effect speed (0-3) +#define RGB_BACKLIGHT_EFFECT_SPEED 0 + +// the default color1 and color2 +#define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 } +#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 } + #define DRIVER_COUNT 2 #define DRIVER_LED_TOTAL 64 @@ -119,6 +129,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0010000000000001 #define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0011110000000111 +#define RGB_BACKLIGHT_CAPS_LOCK_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_1_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_2_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_3_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } + // TODO: refactor with new user EEPROM code (coming soon) #define EEPROM_MAGIC 0x451F #define EEPROM_MAGIC_ADDR 32 diff --git a/keyboards/hs60/v2/keymaps/goatmaster/config.h b/keyboards/hs60/v2/keymaps/goatmaster/config.h new file mode 100644 index 0000000000..f63c903556 --- /dev/null +++ b/keyboards/hs60/v2/keymaps/goatmaster/config.h @@ -0,0 +1,37 @@ +/* +Copyright 2018 Yiancar + +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 overwrites for specific keymap */ + +#define HS60_HHKB +#undef PRODUCT_ID +#define PRODUCT_ID 0x4855 + +#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 +#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 +#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 +#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 +#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b0000000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0000000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0011000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0011000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0011100000000111 + +#undef RGB_BACKLIGHT_CAPS_LOCK_INDICATOR +#define RGB_BACKLIGHT_CAPS_LOCK_INDICATOR { .color = { .h = 0, .s = 255 }, .index = 3-1 } //red diff --git a/keyboards/hs60/v2/keymaps/goatmaster/keymap.c b/keyboards/hs60/v2/keymaps/goatmaster/keymap.c new file mode 100644 index 0000000000..6273dbc646 --- /dev/null +++ b/keyboards/hs60/v2/keymaps/goatmaster/keymap.c @@ -0,0 +1,71 @@ +/* Copyright 2018 Yiancar + * + * 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 QMK_KEYBOARD_H + +//This is the HHKB version of the PCB + +enum macro_keys { + KC_EML = SAFE_RANGE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_60_hhkb( /* Base */ + KC_ESC, 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_GRV, KC_BSLS,\ + 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_BSPC,\ + KC_LCTL, 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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1),\ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL ), + +[1] = LAYOUT_60_hhkb( /* FN */ + RESET, 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_TRNS, KC_TRNS,\ + KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, BR_DEC, BR_INC, ES_DEC, ES_INC, KC_UP, KC_TRNS, KC_DEL, \ + KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, \ + KC_TRNS, KC_TRNS, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), + +[2] = LAYOUT_60_hhkb( /* Empty for dynamic keymaps */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), + +[3] = LAYOUT_60_hhkb( /* Empty for dynamic keymaps */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), +}; + +void matrix_init_user(void) { + //user initialization +} + +void matrix_scan_user(void) { + //user matrix +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_EML: //use "KC_EML" as keycode in layers above to call macro + if (!record->event.pressed) { + send_string_with_delay_P(PSTR("example@email.com"), 10); //change email value here + } + break; + } + return true; +} diff --git a/keyboards/hs60/v2/keymaps/goatmaster/readme.md b/keyboards/hs60/v2/keymaps/goatmaster/readme.md new file mode 100644 index 0000000000..ea9803cc0b --- /dev/null +++ b/keyboards/hs60/v2/keymaps/goatmaster/readme.md @@ -0,0 +1,6 @@ +The default keymap for HHKB HS60 V2. VIA support enabled. +========================================================= + +![Layout image](https://imgur.com/usbrQWL.png) + +Default layer is normal HHKB with 7U space. Fn layer is used for RGB functions, Volume control and arrow cluster
\ No newline at end of file diff --git a/keyboards/hs60/v2/keymaps/goatmaster/rules.mk b/keyboards/hs60/v2/keymaps/goatmaster/rules.mk new file mode 100644 index 0000000000..a2850a8305 --- /dev/null +++ b/keyboards/hs60/v2/keymaps/goatmaster/rules.mk @@ -0,0 +1,66 @@ +# project specific files +SRC = keyboards/zeal60/zeal60.c \ + keyboards/zeal60/rgb_backlight.c \ + drivers/issi/is31fl3733.c \ + quantum/color.c \ + drivers/arm/i2c_master.c + +## chip/board settings +# the next two should match the directories in +# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F3xx + +# Linker script to use +# it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/ +# or <this_dir>/ld/ +MCU_LDSCRIPT = STM32F303xC + +# Startup code to use +# - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f3xx + +# Board: it should exist either in <chibios>/os/hal/boards/ +# or <this_dir>/boards +BOARD = GENERIC_STM32_F303XC + +# Cortex version +MCU = cortex-m4 + +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 + +USE_FPU = yes + +# Vector table for application +# 0x00000000-0x00001000 area is occupied by bootlaoder.*/ +# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB +# OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000 +OPT_DEFS = + +# Do not put the microcontroller into power saving mode +# when we get USB suspend event. We want it to keep updating +# backlight effects. +OPT_DEFS += -DNO_SUSPEND_POWER_DOWN + +# Options to pass to dfu-util when flashing +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave + +# Build Options +# comment out to disable the options. +# +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +AUDIO_ENABLE = no # Audio output on port C6 +NO_USB_STARTUP_CHECK = no # Disable initialization only when usb is plugged in +#SERIAL_LINK_ENABLE = yes + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes +CIE1931_CURVE = yes diff --git a/keyboards/hs60/v2/keymaps/stanrc85/config.h b/keyboards/hs60/v2/keymaps/stanrc85/config.h index 4576211f10..5aab3098c7 100644 --- a/keyboards/hs60/v2/keymaps/stanrc85/config.h +++ b/keyboards/hs60/v2/keymaps/stanrc85/config.h @@ -20,3 +20,22 @@ #define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0011000000000001 //Setting \ key to "MOD" instead of "ALPHA" for lighting #define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0010000000000001 #define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0011110000000111 + +#undef RGB_BACKLIGHT_CAPS_LOCK_INDICATOR +#undef RGB_BACKLIGHT_LAYER_1_INDICATOR +#undef RGB_BACKLIGHT_LAYER_2_INDICATOR +#undef RGB_BACKLIGHT_LAYER_3_INDICATOR + +#define RGB_BACKLIGHT_CAPS_LOCK_INDICATOR { .color = { .h = 200, .s = 255 }, .index = 3-1 } //purple +#define RGB_BACKLIGHT_LAYER_1_INDICATOR { .color = { .h = 100, .s = 255 }, .index = 60-1 } //green +#define RGB_BACKLIGHT_LAYER_2_INDICATOR { .color = { .h = 150, .s = 255 }, .index = 60-1 } //blue +#define RGB_BACKLIGHT_LAYER_3_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 60-1 } //white + +#undef RGB_BACKLIGHT_BRIGHTNESS +#define RGB_BACKLIGHT_BRIGHTNESS 175 + +#undef RGB_BACKLIGHT_COLOR_1 +#undef RGB_BACKLIGHT_COLOR_2 + +#define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 } +#define RGB_BACKLIGHT_COLOR_2 { .h = 150, .s = 255 } diff --git a/keyboards/hs60/v2/keymaps/stanrc85/keymap.c b/keyboards/hs60/v2/keymaps/stanrc85/keymap.c index 276adfe297..2fa3f44533 100644 --- a/keyboards/hs60/v2/keymaps/stanrc85/keymap.c +++ b/keyboards/hs60/v2/keymaps/stanrc85/keymap.c @@ -16,24 +16,13 @@ #include QMK_KEYBOARD_H #include "stanrc85.h" -//Tap Dance Declarations -enum { - TD_WIN = 0, - TD_ESC -}; - -qk_tap_dance_action_t tap_dance_actions[] = { - [TD_WIN] = ACTION_TAP_DANCE_DOUBLE(KC_CAD, KC_LOCK), - [TD_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_GRV) -}; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT_60_ansi( TD_TESC, 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_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_CTLE, 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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_LCTL, KC_LGUI, KC_LALT, LT_SPCF, KC_RALT, TD_TWIN, MO(3), KC_RCTL), + KC_LCTL, KC_LGUI, KC_LALT, LT_SPCF, KC_RALT, TD_TWIN, MO(3), TD_TCTL), [1] = LAYOUT_60_ansi( KC_GESC, 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, @@ -46,7 +35,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TILD, 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_DEL, _______, _______, CA_QUOT, KC_VOLU, CA_SCLN, _______, _______, KC_HOME, KC_UP, KC_END, _______, _______, _______, KC_INS, KC_CAPS, _______, KC_MUTE, KC_VOLD, KC_MPLY, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_RDP, _______, _______, _______, _______, _______, _______, KC_WBAK, KC_WFWD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), [3] = LAYOUT_60_ansi( diff --git a/keyboards/hs60/v2/keymaps/stanrc85/readme.md b/keyboards/hs60/v2/keymaps/stanrc85/readme.md index 4e978e7710..430d363f37 100644 --- a/keyboards/hs60/v2/keymaps/stanrc85/readme.md +++ b/keyboards/hs60/v2/keymaps/stanrc85/readme.md @@ -42,7 +42,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.--> - Layer 3 is Backlight control and RESET - `Fn2+CAPS` used to toggle Default QWERTY layer on and off -![RGB and RESET Layer](https://imgur.com/1ScpRE4.png) +![RGB and RESET Layer](https://imgur.com/mMHoJPa.png) ### Build To build the firmware file associated with this keymap, simply run `make your_keyboard:stanrc85`. diff --git a/keyboards/hs60/v2/keymaps/stanrc85/rules.mk b/keyboards/hs60/v2/keymaps/stanrc85/rules.mk index a2850a8305..c46a6b9528 100644 --- a/keyboards/hs60/v2/keymaps/stanrc85/rules.mk +++ b/keyboards/hs60/v2/keymaps/stanrc85/rules.mk @@ -1,6 +1,6 @@ # project specific files SRC = keyboards/zeal60/zeal60.c \ - keyboards/zeal60/rgb_backlight.c \ + keyboards/zeal60/rgb_backlight.c \ drivers/issi/is31fl3733.c \ quantum/color.c \ drivers/arm/i2c_master.c diff --git a/keyboards/idobo/keymaps/greenshadowmaker/keyboard-layout-editor-gsm-idobo.json b/keyboards/idobo/keymaps/greenshadowmaker/keyboard-layout-editor-gsm-idobo.json new file mode 100644 index 0000000000..95122075bd --- /dev/null +++ b/keyboards/idobo/keymaps/greenshadowmaker/keyboard-layout-editor-gsm-idobo.json @@ -0,0 +1,190 @@ +[ + { + "name": "gsm-idobo", + "notes": "Massdrop xd75\n\nFront Legend = \"Adust\" layer (both lower and Raise)" + }, + [ + { + "a": 3 + }, + "Esc\n\n\n\nreset", + { + "t": "#0000ff\n#ff0000", + "a": 4 + }, + "\nF1\n\n\n\n\n\n\n\n1 !", + "\nF2\n\n\n\n\n\n\n\n2 @", + "\nF3\n\n\n\n\n\n\n\n3 #", + "\nF4\n\n\n\n\n\n\n\n4 $", + "\nF5\n\n\n\n\n\n\n\n5 %", + { + "t": "#000000", + "a": 7 + }, + "= +", + "", + "- _", + { + "t": "#0000ff\n#ff0000", + "a": 0 + }, + "\nF6\n\n\nrgbplain\n\n\n\n\n6 ^", + "\nF7\n\n\nrgbtest\n\n\n\n\n7 &", + "\nF8\n\n\nrgbmode\n\n\n\n\n8 *", + { + "a": 4 + }, + "\nF9\n\n\n\n\n\n\n\n9 (", + "\nF10\n\n\n\n\n\n\n\n0 )", + { + "t": "#000000", + "a": 7 + }, + "Bksp" + ], + [ + "Tab", + "Q", + { + "t": "#0000ff\n#ff0000", + "a": 4 + }, + "PgUp\nUP\n\n\n\n\n\n\n\nW", + { + "t": "#000000", + "a": 7 + }, + "E", + { + "a": 3 + }, + "R\n\n\n\nrgb_tog", + "T\n\n\n\nbl_tog", + { + "a": 7 + }, + "", + "", + "[ {", + "T", + "Y", + "I", + "O", + "P", + "]" + ], + [ + { + "c": "#0000ff", + "t": "#ffffff" + }, + "Raise", + { + "c": "#cccccc", + "t": "#0000ff\n#ff0000", + "a": 4 + }, + "Home\nLEFT\n\n\n\n\n\n\n\nA", + { + "a": 0 + }, + "PgDwn\nDOWN\n\n\nrgb_hai\n\n\n\n\nS", + "End\nRIGHT\n\n\nrgb_sai\n\n\n\n\nD", + { + "t": "#000000", + "a": 3 + }, + "F\n\n\n\nrgb_vai", + "G\n\n\n\nbl_inc", + { + "a": 7 + }, + "", + "UP", + "", + "H", + "J", + "K", + "L", + "; :", + "' \"" + ], + [ + { + "a": 3 + }, + "Shift\n\n\n\neep_rst", + { + "a": 7 + }, + "Z", + { + "a": 3 + }, + "X\n\n\n\nrgb_hud", + "C\n\n\n\nrgb_sad", + "V\n\n\n\nrgb_vad", + "B\n\n\n\nbl_dec", + { + "a": 7 + }, + "LEFT", + "DOWN", + "RIGHT", + "N", + "M", + ", <", + ". >", + "/ ?", + { + "a": 6 + }, + "Shift" + ], + [ + { + "a": 7 + }, + "` ~", + "\\ |", + "Alt", + "Ctrl", + { + "c": "#ff0000" + }, + "Lower", + { + "c": "#eb7c15" + }, + "Space", + { + "c": "#cccccc", + "t": "#0000ff\n#ff0000", + "a": 4 + }, + "\nApp\n\n\n\n\n\n\n\nOS", + { + "t": "#000000", + "a": 7 + }, + "Del", + "Enter", + { + "c": "#eb7c15" + }, + "Space", + { + "c": "#0000ff", + "t": "#ffffff" + }, + "Raise", + { + "c": "#cccccc", + "t": "#000000" + }, + "", + "", + "", + "PrtScr" + ] +]
\ No newline at end of file diff --git a/keyboards/idobo/keymaps/greenshadowmaker/keymap.c b/keyboards/idobo/keymaps/greenshadowmaker/keymap.c new file mode 100644 index 0000000000..e96459da54 --- /dev/null +++ b/keyboards/idobo/keymaps/greenshadowmaker/keymap.c @@ -0,0 +1,152 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* QWERTY + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | - | | = | 6 | 7 | 8 | 9 | 0 | BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | Q | W | E | R | T | | | [ | Y | U | I | O | P | ] | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | RAISE | A | S | D | F | G | | UP | | H | J | K | L | ; | ' | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | LSHIFT | Z | X | C | V | B | LEFT | DOWN | RIGHT | N | M | , | . | / | RSHIFT | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| + * | ` | \ | LALT | LCTRL | LOWER | SPACE | LGUI | DEL | ENTER | SPACE | RAISE | | | | PrtScr | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_5x15( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, XXXXXXX, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, XXXXXXX, XXXXXXX, KC_LBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RBRC, \ + RAISE, KC_A, KC_S, KC_D, KC_F, KC_G, XXXXXXX, KC_UP, XXXXXXX, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LEFT, KC_DOWN, KC_RGHT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_GRAVE, KC_GRAVE, KC_LALT, KC_LCTL, LOWER, KC_SPC, KC_LGUI, KC_DEL, KC_ENT, KC_SPC, RAISE, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSCR \ +), + + +/* LOWER + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | UP | | | | | | | | | | PR SCR | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | RAISE | LEFT | DOWN | RIGHT | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | LOWER | | APP | | | | RAISE | | | | | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_5x15( \ + XXXXXXX, KC_F1, KC_F2, KC_F3, XXXXXXX, KC_F5, XXXXXXX, XXXXXXX, XXXXXXX, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, \ + XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + RAISE, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, LOWER, XXXXXXX, KC_APP, XXXXXXX, XXXXXXX, XXXXXXX, RAISE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ +), + + /* RAISE + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | pgup | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | RAISE | home | pgdn | end | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | LOWER | | | | | | RAISE | | | | | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_5x15( \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + RAISE, KC_HOME, KC_PGDN, KC_END, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, LOWER, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RAISE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ +), + + + /* ADJUST + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | RESET | | | | | | | | |rgbplain|rgbtest | rgbmode| | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | |rgb tog | bl_tog | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | RAISE | | rgb hi | rgb sai|rgb vai | bl inc | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | EEP Rst| | rgb hd | rgb sad|rgb vad | bl dec | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | LOWER | | | | | | RAISE | | | | | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_5x15( \ + RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_M_P, RGB_M_T, RGB_MOD, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_TOG, BL_TOGG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + RAISE, XXXXXXX, RGB_HUI, RGB_SAI, RGB_VAI, BL_INC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + EEP_RST, XXXXXXX, RGB_HUD, RGB_SAD, RGB_VAD, BL_DEC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, LOWER, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RAISE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ +), + + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/idobo/keymaps/greenshadowmaker/readme.md b/keyboards/idobo/keymaps/greenshadowmaker/readme.md new file mode 100644 index 0000000000..bdd28d4ffe --- /dev/null +++ b/keyboards/idobo/keymaps/greenshadowmaker/readme.md @@ -0,0 +1,3 @@ +# GreenShadowMaker keymap for idobo + +Note: keyboard-layout-editor-gsm-idobo.json shoudl be the matching layout for http://www.keyboard-layout-editor.com diff --git a/keyboards/idobo/keymaps/greenshadowmaker/rules.mk b/keyboards/idobo/keymaps/greenshadowmaker/rules.mk new file mode 100644 index 0000000000..f6587a835e --- /dev/null +++ b/keyboards/idobo/keymaps/greenshadowmaker/rules.mk @@ -0,0 +1,3 @@ +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +COMMAND_ENABLE = no # Commands for debug and configuration +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow diff --git a/keyboards/jc65/v32u4/keymaps/default/config.h b/keyboards/jc65/v32u4/keymaps/default/config.h index a5568e400d..271f48d001 100644 --- a/keyboards/jc65/v32u4/keymaps/default/config.h +++ b/keyboards/jc65/v32u4/keymaps/default/config.h @@ -1 +1,3 @@ -#include "../../config.h" +#pragma once + +// place overrides here diff --git a/keyboards/jj40/README.md b/keyboards/jj40/README.md index ed1ea90fe7..7d3612554b 100644 --- a/keyboards/jj40/README.md +++ b/keyboards/jj40/README.md @@ -36,7 +36,7 @@ $ make $ sudo cp bootloadHID /usr/bin ``` -In order to use the `./program` script, which can reboot the board into +In order to use the `././util/atmega32a_program.py` script, which can reboot the board into the bootloader, you'll need Python 2 with PyUSB installed: ``` diff --git a/keyboards/jj4x4/README.md b/keyboards/jj4x4/README.md index 09684bd825..29dc2605de 100644 --- a/keyboards/jj4x4/README.md +++ b/keyboards/jj4x4/README.md @@ -36,7 +36,7 @@ $ make $ sudo cp bootloadHID /usr/bin ``` -In order to use the `./program` script, which can reboot the board into +In order to use the `./util/atmega32a_program.py` script, which can reboot the board into the bootloader, you'll need Python 2 with PyUSB installed: ``` diff --git a/keyboards/jj50/README.md b/keyboards/jj50/README.md index 397889535e..f7b8acc641 100644 --- a/keyboards/jj50/README.md +++ b/keyboards/jj50/README.md @@ -37,7 +37,7 @@ $ brew cask install crosspack-avr $ brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb ``` -In order to use the `./program` script, which can reboot the board into +In order to use the `././util/atmega32a_program.py` script, which can reboot the board into the bootloader, you'll need Python 2 with PyUSB installed: ``` diff --git a/keyboards/jj50/keymaps/abstractkb/keymap.c b/keyboards/jj50/keymaps/abstractkb/keymap.c new file mode 100644 index 0000000000..456adeee4b --- /dev/null +++ b/keyboards/jj50/keymaps/abstractkb/keymap.c @@ -0,0 +1,135 @@ +/* +Base Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> +Modified 2017 Andrew Novak <ndrw.nvk@gmail.com> +Modified 2018 Wayne Jones (WarmCatUK) <waynekjones@gmail.com> +Modified 2019 AbstractKB + +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 LicensezZZ +along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#include QMK_KEYBOARD_H + +enum layers { + _DEFLT, + _RAISE, + _LOWER, + _FN +}; + +enum custom_keycodes { + MYRGB_TG = SAFE_RANGE +}; + +bool rgbinit = true; +bool rgbon = true; + +const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[] PROGMEM = {1,5,5}; //only using the first one + +void keyboard_post_init_user(void) { + rgblight_enable_noeeprom(); + led_set_user(host_keyboard_leds()); +} + +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case _RAISE: + rgblight_sethsv_noeeprom(240,255,255); + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + break; + case _LOWER: + rgblight_sethsv_noeeprom(0,255,255); + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + break; + case _FN: + rgblight_sethsv_noeeprom(0,255,255); + rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_SWIRL); + break; + default: //_DEFLT + rgblight_sethsv_noeeprom(0,0,255); + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + break; + } + + return state; +} + +void led_set_user(uint8_t usb_led) { + if (usb_led & (1<<USB_LED_CAPS_LOCK)) { + rgblight_mode_noeeprom(RGBLIGHT_MODE_ALTERNATING); + } else { + layer_state_set_user(layer_state); + } +} + +void myrgb_toggle(void) { + if (rgbon) { + rgblight_disable_noeeprom(); + rgbon = false; + } else { + rgblight_enable_noeeprom(); + layer_state_set_user(layer_state); + led_set_user(host_keyboard_leds()); + rgbon = true; + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { + case MYRGB_TG: + if (record->event.pressed) { + myrgb_toggle(); + } + return false; + default: + return true; + } +} + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_DEFLT] = LAYOUT( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ENT, \ + KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + MO(_FN), KC_LCTL, KC_LGUI, KC_LALT, MO(_LOWER),KC_SPC,KC_SPC,MO(_RAISE),KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + + [_RAISE] = LAYOUT( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, LCTL(LGUI(KC_LEFT)), LGUI(KC_L), LCTL(LGUI(KC_RGHT)), _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_CAPS, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + + [_LOWER] = LAYOUT( \ + 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_GRV, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_BSLS, _______, \ + _______, _______, _______, KC_LBRC, KC_RBRC, S(KC_9),S(KC_0),S(KC_LBRC),S(KC_RBRC),_______,_______,_______, \ + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + + + [_FN] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, MYRGB_TG \ + ) +}; diff --git a/keyboards/jj50/keymaps/abstractkb/readme.md b/keyboards/jj50/keymaps/abstractkb/readme.md new file mode 100644 index 0000000000..7ff7e0268a --- /dev/null +++ b/keyboards/jj50/keymaps/abstractkb/readme.md @@ -0,0 +1,6 @@ +# My personal layout for the JJ50 + +It is an approximation of a 60% layout with the alternate layers set up for programming, +with brackets and parenthesis on the homerow +Other things I changed were swapping around delete, backspace, and capslock around +It also uses layer based rgb underglow, and the underglow flashes when capslock is enabled
\ No newline at end of file diff --git a/keyboards/jj50/keymaps/archetype/README.md b/keyboards/jj50/keymaps/archetype/README.md new file mode 100644 index 0000000000..a2ae4e9123 --- /dev/null +++ b/keyboards/jj50/keymaps/archetype/README.md @@ -0,0 +1,22 @@ +# archetype keymap for jj50 keyboards +A keymap that can be used with the jj50 ortholinear keyboard. + +## Features + +- `QWERTY` layout (Default) +- `COLEMAK` layout +- `FN` layout (various keys that are rarely needed) +- `FX` layout (Control lighting and audio) +- Use `Left Ctrl` and `Left Alt` to output `()`, `[]` and `{}` by tapping once, twice or thrice respectively. Hold them down for the regular keycode (LCtrl or LAlt) +- `Right Shift` when held or Enter when tapped +- Auto-Shift enabled (long press on alphas and numeric keys outputs shifted character) +- Full arrow keys available + + +## Feedback + +I made this keymap based on the existing default one. If you happen to use this keymap [drop me a line](mailto://idimitrakopoulos@gmail.com) about what could be improved etc + +Enjoy! + +Iason Dimitrakopoulos diff --git a/keyboards/jj50/keymaps/archetype/config.h b/keyboards/jj50/keymaps/archetype/config.h new file mode 100644 index 0000000000..7955796eaf --- /dev/null +++ b/keyboards/jj50/keymaps/archetype/config.h @@ -0,0 +1,8 @@ +#pragma once + +#undef AUTO_SHIFT_TIMEOUT +#undef TAPPING_TERM + +#define AUTO_SHIFT_TIMEOUT 150 +#define TAPPING_TERM 150 +//#define BOOTMAGIC_KEY_SALT KC_LCTL diff --git a/keyboards/jj50/keymaps/archetype/keymap.c b/keyboards/jj50/keymaps/archetype/keymap.c new file mode 100644 index 0000000000..0704943e08 --- /dev/null +++ b/keyboards/jj50/keymaps/archetype/keymap.c @@ -0,0 +1,215 @@ +/* +Base Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> +Modified 2017 Andrew Novak <ndrw.nvk@gmail.com> +Modified 2018 Wayne Jones (WarmCatUK) <waynekjones@gmail.com> +Modified 2019 Iason Dimitrakopoulos (idimitrakopoulos) <idimitrakopoulos@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 LicensezZZ +along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#include QMK_KEYBOARD_H +#include "action_layer.h" +#include "rgblight.h" +#include "quantum.h" + +#define _QWERTY 0 +#define _COLEMAK 1 +#define _FN 2 +#define _FX 3 + +enum { + TD_BSPC_DEL = 0, + TD_LCTL_LBRC = 1, + TD_LALT_RBRC = 2, +}; + + +void left_brackets(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + if (state->interrupted || !state->pressed) { + register_mods(MOD_LSFT); + register_code(KC_9); + } else { + register_mods(MOD_LCTL); + } + } else if (state->count == 2) { + register_code(KC_LBRC); + } else if (state->count == 3) { + register_mods(MOD_LSFT); + register_code(KC_LBRC); + } +} + +void left_brackets_reset(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + if (state->interrupted || !state->pressed) { + unregister_mods(MOD_LSFT); + unregister_code(KC_9); + } else { + unregister_mods(MOD_LCTL); + } + } else if (state->count == 2) { + unregister_code(KC_LBRC); + } else if (state->count == 3) { + unregister_mods(MOD_LSFT); + unregister_code(KC_LBRC); + } +} + +void right_brackets(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + if (state->interrupted || !state->pressed) { + register_mods(MOD_LSFT); + register_code(KC_0); + } else { + register_mods(MOD_LALT); + } + } else if (state->count == 2) { + register_code(KC_RBRC); + } else if (state->count == 3) { + register_mods(MOD_LSFT); + register_code(KC_RBRC); + } +} + +void right_brackets_reset(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + if (state->interrupted || !state->pressed) { + unregister_mods(MOD_LSFT); + unregister_code(KC_0); + } else { + unregister_mods(MOD_LALT); + } + } else if (state->count == 2) { + unregister_code(KC_RBRC); + } else if (state->count == 3) { + unregister_mods(MOD_LSFT); + unregister_code(KC_RBRC); + } +} + +qk_tap_dance_action_t tap_dance_actions[] = { + // Single tap = Backspace | Double tap = Delete + [TD_BSPC_DEL] = ACTION_TAP_DANCE_DOUBLE(KC_BSPC, KC_DEL), + // Single tap = ( | Double tap = [ | Triple tap = { | Single hold = KC_LCTL + [TD_LCTL_LBRC] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, left_brackets, left_brackets_reset), + // Single tap = ) | Double tap = ] | Triple tap = } | Single hold = KC_LALT + [TD_LALT_RBRC] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, right_brackets, right_brackets_reset), +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( \ + + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+. + //| | | | | | | | | | | | | + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+| + //| | | | | | | | | | | | | + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+| + //| | | | | | | | | | | | | + 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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_DOT, KC_SLSH, KC_UP, SFT_T(KC_ENT), \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+| + //| | | | | | | | | | | | | + TD(TD_LCTL_LBRC), KC_LGUI, TD(TD_LALT_RBRC), _______, _______, LT(_FN, KC_SPC), LT(_FN, KC_SPC), _______, KC_COMM, KC_LEFT, KC_DOWN, KC_RGHT \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+' + ), + + [_COLEMAK] = LAYOUT( \ + + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+. + //| | | | | | | | | | | | | + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+| + //| | | | | | | | | | | | | + _______, _______, _______, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, _______, \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+| + //| | | | | | | | | | | | | + _______, _______, KC_R, KC_S, KC_T, KC_D, _______, KC_N, KC_E, KC_I, KC_O, _______, \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+| + //| | | | | | | | | | | | | + _______, _______, _______, _______, _______, _______, KC_K, _______, _______, _______, _______, _______, \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+| + //| | | | | | | | | | | | | + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+' + ), + + [_FN] = LAYOUT( \ + + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+. + //| | | | | | | | | | | | | + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+| + //| | | | | | | | | | | | | + KC_PSCR, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_EQUAL, \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+| + //| | | | | | | | | | | | | + KC_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MINUS, \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+| + //| | | | | | | | | | | | | + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+| + //| | | | | | | | | | | | | + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+' + ), + + [_FX] = LAYOUT( \ + + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+. + //| | | | | | | | | | | | | + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+| + //| | | | | | | | | | | | | + _______, BL_ON, BL_INC, RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+| + //| | | | | | | | | | | | | + _______, BL_OFF, BL_DEC, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, _______, _______, _______, _______, _______, \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+| + //| | | | | | | | | | | | | + _______, RGB_TOG, BL_STEP, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, _______, _______, _______, _______, _______, \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+| + //| | | | | | | | | | | | | + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+' + ), + + +}; diff --git a/keyboards/jj50/keymaps/archetype/rules.mk b/keyboards/jj50/keymaps/archetype/rules.mk new file mode 100644 index 0000000000..e32e8ce741 --- /dev/null +++ b/keyboards/jj50/keymaps/archetype/rules.mk @@ -0,0 +1,65 @@ +# Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> +# Modified 2018 Wayne Jones (WarmCatUK) <waynekjones@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/>. + +# MCU name +MCU = atmega32a +PROTOCOL = VUSB + +# unsupported features for now +NO_UART = yes +NO_SUSPEND_POWER_DOWN = yes + +# processor frequency +F_CPU = 12000000 + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = bootloadHID + +# build options +BOOTMAGIC_ENABLE = lite +MOUSEKEY_ENABLE = no +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = no +COMMAND_ENABLE = yes +BACKLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = yes +RGBLIGHT_CUSTOM_DRIVER = yes +NKRO_ENABLE = no +# Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +TAP_DANCE_ENABLE = yes +AUTO_SHIFT_ENABLE = yes + + +DISABLE_WS2812 = no + +KEY_LOCK_ENABLE = yes +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + + +#OPT_DEFS = -DDEBUG_LEVEL=0 + +# custom matrix setup +CUSTOM_MATRIX = yes +SRC = matrix.c i2c.c backlight.c + +# programming options +PROGRAM_CMD = ./keyboards/ps2avrGB/program $(TARGET).hex + +LAYOUTS = ortho_5x12 diff --git a/keyboards/jj50/keymaps/default/keymap.c b/keyboards/jj50/keymaps/default/keymap.c index 9d753eb8e6..d5334d4956 100644 --- a/keyboards/jj50/keymaps/default/keymap.c +++ b/keyboards/jj50/keymaps/default/keymap.c @@ -18,8 +18,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include QMK_KEYBOARD_H -#include "action_layer.h" -#include "rgblight.h" #define ______ KC_TRNS #define _DEFLT 0 @@ -113,7 +111,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______,S(KC_NUHS),S(KC_NUBS),KC_HOME, KC_END, _______, \ BL_STEP, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ ), - + /* Fn * ,-----------------------------------------------------------------------------------. * | | | £ | | | | | | | | | | diff --git a/keyboards/jj50/program b/keyboards/jj50/program deleted file mode 100644 index a88d9cd9b0..0000000000 --- a/keyboards/jj50/program +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env python -# Copyright 2017 Luiz Ribeiro <luizribeiro@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/>. - -from __future__ import print_function - -import os -import sys -import time -import usb - -if len(sys.argv) < 2: - print('Usage: %s <firmware.hex>' % sys.argv[0]) - sys.exit(1) - -print('Searching for ps2avrGB... ', end='') - -dev = usb.core.find(idVendor=0x20A0, idProduct=0x422D) -if dev is None: - raise ValueError('Device not found') - -print('Found', end='\n\n') - -print('Device Information:') -print(' idVendor: %d (0x%04x)' % (dev.idVendor, dev.idVendor)) -print(' idProduct: %d (0x%04x)' % (dev.idProduct, dev.idProduct)) -print('Manufacturer: %s' % (dev.iManufacturer)) -print('Serial: %s' % (dev.iSerialNumber)) -print('Product: %s' % (dev.iProduct), end='\n\n') - -print('Transferring control to bootloader... ', end='') - -dev.set_configuration() - -request_type = usb.util.build_request_type( - usb.util.CTRL_OUT, - usb.util.CTRL_TYPE_CLASS, - usb.util.CTRL_RECIPIENT_DEVICE) - -USBRQ_HID_SET_REPORT = 0x09 -HID_REPORT_OPTION = 0x0301 - - -try: - dev.ctrl_transfer( - request_type, - USBRQ_HID_SET_REPORT, - HID_REPORT_OPTION, - 0, - [0, 0, 0xFF] + [0] * 5 - ) -except usb.core.USBError: - # for some reason I keep getting USBError, but it works! - pass - -# wait a bit until bootloader starts up -time.sleep(2) - -print('OK') -print('Programming...') -if os.system('bootloadHID -r "%s"' % sys.argv[1]) == 0: - print('\nDone!') diff --git a/keyboards/jj50/rules.mk b/keyboards/jj50/rules.mk index 1a18ec4fe4..4ee5719185 100644 --- a/keyboards/jj50/rules.mk +++ b/keyboards/jj50/rules.mk @@ -58,6 +58,6 @@ CUSTOM_MATRIX = yes SRC = matrix.c i2c.c backlight.c # programming options -PROGRAM_CMD = ./keyboards/ps2avrGB/program $(TARGET).hex +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex LAYOUTS = ortho_5x12 diff --git a/keyboards/k_type/keymaps/default/keymap.c b/keyboards/k_type/keymaps/default/keymap.c index 29d93c1072..331d331552 100644 --- a/keyboards/k_type/keymaps/default/keymap.c +++ b/keyboards/k_type/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -#include "k_type.h" +#include QMK_KEYBOARD_H const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = KEYMAP( diff --git a/keyboards/katana60/keymaps/default/config.h b/keyboards/katana60/keymaps/default/config.h index 08c51f6cb5..c4bea7eb03 100644 --- a/keyboards/katana60/keymaps/default/config.h +++ b/keyboards/katana60/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/katana60/keymaps/msiu/config.h b/keyboards/katana60/keymaps/msiu/config.h new file mode 100644 index 0000000000..b57cc482ec --- /dev/null +++ b/keyboards/katana60/keymaps/msiu/config.h @@ -0,0 +1,21 @@ +/* Copyright 2017 Baris Tosun + * + * 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 + + +// place overrides here + diff --git a/keyboards/katana60/keymaps/msiu/keymap.c b/keyboards/katana60/keymaps/msiu/keymap.c new file mode 100644 index 0000000000..72b795baa5 --- /dev/null +++ b/keyboards/katana60/keymaps/msiu/keymap.c @@ -0,0 +1,70 @@ +#include QMK_KEYBOARD_H + +// Mod-Tap keys for cleaner code +#define ESC_CTL LCTL_T(KC_ESC) +#define SPC_LW LT(2, KC_SPC) +#define ENT_FN LT(4, KC_ENT) + +#define _QW 0 +#define _DV 1 +#define _LW 2 +#define _RS 3 +#define _FN 4 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[_QW] = LAYOUT( /* Base */ + KC_ESC, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, TG(1), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_PLUS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + ESC_CTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HOME, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END, KC_DEL, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + KC_LCTL, KC_HYPR, KC_LALT, KC_LGUI, SPC_LW, ENT_FN, KC_SPC, MO(3), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT + ), +[_DV] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, _______, _______, KC_F, KC_G, KC_C, KC_R, KC_L, _______, + _______, KC_A, KC_O, KC_E, KC_U, KC_I, _______, _______, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + _______, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, _______, _______, _______, KC_B, KC_M, KC_W, KC_V, KC_Z, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +[_LW] = LAYOUT( + _______, _______, 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_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, KC_PGDN, KC_PGUP, KC_HOME, KC_END , KC_MUTE, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +[_RS] = LAYOUT( + _______, _______, 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_1, KC_2, KC_3, KC_4, KC_5, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, KC_PGDN, KC_PGUP, KC_HOME, KC_END , KC_MUTE, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT + ), +[_FN] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, KC_PSCR, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + + + + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/katana60/keymaps/msiu/readme.md b/keyboards/katana60/keymaps/msiu/readme.md new file mode 100644 index 0000000000..e4f0ebdb6e --- /dev/null +++ b/keyboards/katana60/keymaps/msiu/readme.md @@ -0,0 +1,3 @@ +# msiu's keymap for katana: standard QWERTY layout with planck like layers + +This layout take a standard QWERTY default layer, with raise and lower layers similar to planck. It is for me to easily transition between keyboards. I put a few nav keys in the 'tree' middle, but I have come to realise I rarely use them as I am used to the planck layering. Top of the tree is a toggle for Dvorak layer. diff --git a/keyboards/kbdfans/kbd19x/info.json b/keyboards/kbdfans/kbd19x/info.json index 31f2f9cf57..c24ed9caa5 100644 --- a/keyboards/kbdfans/kbd19x/info.json +++ b/keyboards/kbdfans/kbd19x/info.json @@ -1,218 +1,221 @@ { "keyboard_name": "KBD19x", - "url": "https://github.com/qmk/qmk_firmware/tree/master/keyboards/kbd19x", + "url": "https://github.com/qmk/qmk_firmware/tree/master/keyboards/kbdfans/kbd19x", "maintainer": "qmk", "width": 19.5, "height": 6.75, "layouts": { "LAYOUT_ansi": { - "key_count": 99, - "layout": [{"label":"Esc", "x":0, "y":0}, - {"label":"F1", "x":1.25, "y":0}, - {"label":"F2", "x":2.25, "y":0}, - {"label":"F3", "x":3.25, "y":0}, - {"label":"F4", "x":4.25, "y":0}, - {"label":"F5", "x":5.5, "y":0}, - {"label":"F6", "x":6.5, "y":0}, - {"label":"F7", "x":7.5, "y":0}, - {"label":"F8", "x":8.5, "y":0}, - {"label":"F9", "x":9.75, "y":0}, - {"label":"F10", "x":10.75, "y":0}, - {"label":"F11", "x":11.75, "y":0}, - {"label":"F12", "x":12.75, "y":0}, - {"label":"BkLgt Step", "x":14, "y":0}, - {"label":"Print Screen", "x":15.5, "y":0}, - {"label":"Scroll Lock", "x":16.5, "y":0}, - {"label":"Pause Break", "x":17.5, "y":0}, - {"label":"PgDn", "x":18.5, "y":0}, - {"label":"~", "x":0, "y":1.5}, - {"label":"!", "x":1, "y":1.5}, - {"label":"@", "x":2, "y":1.5}, - {"label":"#", "x":3, "y":1.5}, - {"label":"$", "x":4, "y":1.5}, - {"label":"%", "x":5, "y":1.5}, - {"label":"^", "x":6, "y":1.5}, - {"label":"&", "x":7, "y":1.5}, - {"label":"*", "x":8, "y":1.5}, - {"label":"(", "x":9, "y":1.5}, - {"label":")", "x":10, "y":1.5}, - {"label":"_", "x":11, "y":1.5}, - {"label":"+", "x":12, "y":1.5}, - {"label":"Backspace", "x":13, "y":1.5, "w":2}, - {"label":"Num Lock", "x":15.5, "y":1.5}, - {"label":"/", "x":16.5, "y":1.5}, - {"label":"*", "x":17.5, "y":1.5}, - {"label":"-", "x":18.5, "y":1.5}, - {"label":"Tab", "x":0, "y":2.5, "w":1.5}, - {"label":"Q", "x":1.5, "y":2.5}, - {"label":"W", "x":2.5, "y":2.5}, - {"label":"E", "x":3.5, "y":2.5}, - {"label":"R", "x":4.5, "y":2.5}, - {"label":"T", "x":5.5, "y":2.5}, - {"label":"Y", "x":6.5, "y":2.5}, - {"label":"U", "x":7.5, "y":2.5}, - {"label":"I", "x":8.5, "y":2.5}, - {"label":"O", "x":9.5, "y":2.5}, - {"label":"P", "x":10.5, "y":2.5}, - {"label":"{", "x":11.5, "y":2.5}, - {"label":"}", "x":12.5, "y":2.5}, - {"label":"|", "x":13.5, "y":2.5, "w":1.5}, - {"label":"7", "x":15.5, "y":2.5}, - {"label":"8", "x":16.5, "y":2.5}, - {"label":"9", "x":17.5, "y":2.5}, - {"label":"+", "x":18.5, "y":2.5, "h":2}, - {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, - {"label":"A", "x":1.75, "y":3.5}, - {"label":"S", "x":2.75, "y":3.5}, - {"label":"D", "x":3.75, "y":3.5}, - {"label":"F", "x":4.75, "y":3.5}, - {"label":"G", "x":5.75, "y":3.5}, - {"label":"H", "x":6.75, "y":3.5}, - {"label":"J", "x":7.75, "y":3.5}, - {"label":"K", "x":8.75, "y":3.5}, - {"label":"L", "x":9.75, "y":3.5}, - {"label":":", "x":10.75, "y":3.5}, - {"label":"\"", "x":11.75, "y":3.5}, - {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, - {"label":"4", "x":15.5, "y":3.5}, - {"label":"5", "x":16.5, "y":3.5}, - {"label":"6", "x":17.5, "y":3.5}, - {"label":"Shift", "x":0, "y":4.5, "w":2.25}, - {"label":"Z", "x":2.25, "y":4.5}, - {"label":"X", "x":3.25, "y":4.5}, - {"label":"C", "x":4.25, "y":4.5}, - {"label":"V", "x":5.25, "y":4.5}, - {"label":"B", "x":6.25, "y":4.5}, - {"label":"N", "x":7.25, "y":4.5}, - {"label":"M", "x":8.25, "y":4.5}, - {"label":"<", "x":9.25, "y":4.5}, - {"label":">", "x":10.25, "y":4.5}, - {"label":"?", "x":11.25, "y":4.5}, - {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, - {"label":"1", "x":15.5, "y":4.5}, - {"label":"2", "x":16.5, "y":4.5}, - {"label":"3", "x":17.5, "y":4.5}, - {"label":"Enter", "x":18.5, "y":4.5, "h":2}, - {"label":"\u2191", "x":14.25, "y":4.75}, - {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, - {"label":"Win", "x":1.25, "y":5.5}, - {"label":"Alt", "x":2.25, "y":5.5, "w":1.25}, - {"x":3.5, "y":5.5, "w":6.25}, - {"label":"Alt", "x":9.75, "y":5.5}, - {"label":"MO(1)", "x":10.75, "y":5.5}, - {"label":"Ctrl", "x":11.75, "y":5.5, "w":1.25}, - {"label":"0", "x":16.5, "y":5.5}, - {"label":".", "x":17.5, "y":5.5}, - {"label":"\u2190", "x":13.25, "y":5.75}, - {"label":"\u2193", "x":14.25, "y":5.75}, - {"label":"\u2192", "x":15.25, "y":5.75}] + "key_count": 99, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":1.25, "y":0}, + {"label":"F2", "x":2.25, "y":0}, + {"label":"F3", "x":3.25, "y":0}, + {"label":"F4", "x":4.25, "y":0}, + {"label":"F5", "x":5.5, "y":0}, + {"label":"F6", "x":6.5, "y":0}, + {"label":"F7", "x":7.5, "y":0}, + {"label":"F8", "x":8.5, "y":0}, + {"label":"F9", "x":9.75, "y":0}, + {"label":"F10", "x":10.75, "y":0}, + {"label":"F11", "x":11.75, "y":0}, + {"label":"F12", "x":12.75, "y":0}, + {"label":"Extra Esc", "x":14, "y":0}, + {"label":"PrtSc", "x":15.5, "y":0}, + {"label":"Pause", "x":16.5, "y":0}, + {"label":"Insert", "x":17.5, "y":0}, + {"label":"Home", "x":18.5, "y":0}, + {"label":"`~", "x":0, "y":1.5}, + {"label":"1!", "x":1, "y":1.5}, + {"label":"2@", "x":2, "y":1.5}, + {"label":"3#", "x":3, "y":1.5}, + {"label":"4$", "x":4, "y":1.5}, + {"label":"5%", "x":5, "y":1.5}, + {"label":"6^", "x":6, "y":1.5}, + {"label":"7&", "x":7, "y":1.5}, + {"label":"8*", "x":8, "y":1.5}, + {"label":"9(", "x":9, "y":1.5}, + {"label":"0)", "x":10, "y":1.5}, + {"label":"-_", "x":11, "y":1.5}, + {"label":"=+", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Num Lock", "x":15.5, "y":1.5}, + {"label":"/", "x":16.5, "y":1.5}, + {"label":"*", "x":17.5, "y":1.5}, + {"label":"-", "x":18.5, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"[{", "x":11.5, "y":2.5}, + {"label":"]}", "x":12.5, "y":2.5}, + {"label":"\\|", "x":13.5, "y":2.5, "w":1.5}, + {"label":"7", "x":15.5, "y":2.5}, + {"label":"8", "x":16.5, "y":2.5}, + {"label":"9", "x":17.5, "y":2.5}, + {"label":"+", "x":18.5, "y":2.5, "h":2}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":";:", "x":10.75, "y":3.5}, + {"label":"'\"", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + {"label":"4", "x":15.5, "y":3.5}, + {"label":"5", "x":16.5, "y":3.5}, + {"label":"6", "x":17.5, "y":3.5}, + {"label":"Shift", "x":0, "y":4.5, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":",<", "x":9.25, "y":4.5}, + {"label":".>", "x":10.25, "y":4.5}, + {"label":"/?", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, + {"label":"Up", "x":14.25, "y":4.75}, + {"label":"1", "x":15.5, "y":4.5}, + {"label":"2", "x":16.5, "y":4.5}, + {"label":"3", "x":17.5, "y":4.5}, + {"label":"Enter", "x":18.5, "y":4.5, "h":2}, + {"label":"Control", "x":0, "y":5.5, "w":1.25}, + {"label":"GUI", "x":1.25, "y":5.5}, + {"label":"Alt", "x":2.25, "y":5.5, "w":1.25}, + {"label":"Space", "x":3.5, "y":5.5, "w":6.25}, + {"label":"Alt", "x":9.75, "y":5.5}, + {"label":"Fn", "x":10.75, "y":5.5}, + {"label":"Control", "x":11.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":13.25, "y":5.75}, + {"label":"Right", "x":14.25, "y":5.75}, + {"label":"Down", "x":15.25, "y":5.75}, + {"label":"0", "x":16.5, "y":5.5}, + {"label":".", "x":17.5, "y":5.5} + ] }, "LAYOUT_all": { - "key_count": 103, - "layout": [{"label":"Esc", "x":0, "y":0}, - {"label":"F1", "x":1.25, "y":0}, - {"label":"F2", "x":2.25, "y":0}, - {"label":"F3", "x":3.25, "y":0}, - {"label":"F4", "x":4.25, "y":0}, - {"label":"F5", "x":5.5, "y":0}, - {"label":"F6", "x":6.5, "y":0}, - {"label":"F7", "x":7.5, "y":0}, - {"label":"F8", "x":8.5, "y":0}, - {"label":"F9", "x":9.75, "y":0}, - {"label":"F10", "x":10.75, "y":0}, - {"label":"F11", "x":11.75, "y":0}, - {"label":"F12", "x":12.75, "y":0}, - {"label":"BkLgt Step", "x":14, "y":0}, - {"label":"Print Screen", "x":15.5, "y":0}, - {"label":"Scroll Lock", "x":16.5, "y":0}, - {"label":"Pause Break", "x":17.5, "y":0}, - {"label":"PgDn", "x":18.5, "y":0}, - {"label":"~", "x":0, "y":1.5}, - {"label":"!", "x":1, "y":1.5}, - {"label":"@", "x":2, "y":1.5}, - {"label":"#", "x":3, "y":1.5}, - {"label":"$", "x":4, "y":1.5}, - {"label":"%", "x":5, "y":1.5}, - {"label":"^", "x":6, "y":1.5}, - {"label":"&", "x":7, "y":1.5}, - {"label":"*", "x":8, "y":1.5}, - {"label":"(", "x":9, "y":1.5}, - {"label":")", "x":10, "y":1.5}, - {"label":"_", "x":11, "y":1.5}, - {"label":"+", "x":12, "y":1.5}, - {"x":13, "y":1.5}, - {"label":"BS", "x":14, "y":1.5}, - {"label":"Num Lock", "x":15.5, "y":1.5}, - {"label":"/", "x":16.5, "y":1.5}, - {"label":"*", "x":17.5, "y":1.5}, - {"label":"-", "x":18.5, "y":1.5}, - {"label":"Tab", "x":0, "y":2.5, "w":1.5}, - {"label":"Q", "x":1.5, "y":2.5}, - {"label":"W", "x":2.5, "y":2.5}, - {"label":"E", "x":3.5, "y":2.5}, - {"label":"R", "x":4.5, "y":2.5}, - {"label":"T", "x":5.5, "y":2.5}, - {"label":"Y", "x":6.5, "y":2.5}, - {"label":"U", "x":7.5, "y":2.5}, - {"label":"I", "x":8.5, "y":2.5}, - {"label":"O", "x":9.5, "y":2.5}, - {"label":"P", "x":10.5, "y":2.5}, - {"label":"{", "x":11.5, "y":2.5}, - {"label":"}", "x":12.5, "y":2.5}, - {"label":"|", "x":13.5, "y":2.5, "w":1.5}, - {"label":"7", "x":15.5, "y":2.5}, - {"label":"8", "x":16.5, "y":2.5}, - {"label":"9", "x":17.5, "y":2.5}, - {"label":"+", "x":18.5, "y":2.5}, - {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, - {"label":"A", "x":1.75, "y":3.5}, - {"label":"S", "x":2.75, "y":3.5}, - {"label":"D", "x":3.75, "y":3.5}, - {"label":"F", "x":4.75, "y":3.5}, - {"label":"G", "x":5.75, "y":3.5}, - {"label":"H", "x":6.75, "y":3.5}, - {"label":"J", "x":7.75, "y":3.5}, - {"label":"K", "x":8.75, "y":3.5}, - {"label":"L", "x":9.75, "y":3.5}, - {"label":":", "x":10.75, "y":3.5}, - {"label":"\"", "x":11.75, "y":3.5}, - {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, - {"label":"4", "x":15.5, "y":3.5}, - {"label":"5", "x":16.5, "y":3.5}, - {"label":"6", "x":17.5, "y":3.5}, - {"x":18.5, "y":3.5}, - {"label":"Shift", "x":0, "y":4.5, "w":1.25}, - {"x":1.25, "y":4.5}, - {"label":"Z", "x":2.25, "y":4.5}, - {"label":"X", "x":3.25, "y":4.5}, - {"label":"C", "x":4.25, "y":4.5}, - {"label":"V", "x":5.25, "y":4.5}, - {"label":"B", "x":6.25, "y":4.5}, - {"label":"N", "x":7.25, "y":4.5}, - {"label":"M", "x":8.25, "y":4.5}, - {"label":"<", "x":9.25, "y":4.5}, - {"label":">", "x":10.25, "y":4.5}, - {"label":"?", "x":11.25, "y":4.5}, - {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, - {"label":"1", "x":15.5, "y":4.5}, - {"label":"2", "x":16.5, "y":4.5}, - {"label":"3", "x":17.5, "y":4.5}, - {"label":"Enter", "x":18.5, "y":4.5}, - {"label":"\u2191", "x":14.25, "y":4.75}, - {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, - {"label":"Win", "x":1.25, "y":5.5}, - {"label":"Alt", "x":2.25, "y":5.5, "w":1.25}, - {"x":3.5, "y":5.5, "w":6.25}, - {"label":"Alt", "x":9.75, "y":5.5}, - {"label":"Menu", "x":10.75, "y":5.5}, - {"label":"Ctrl", "x":11.75, "y":5.5, "w":1.25}, - {"label":"0", "x":16.5, "y":5.5}, - {"label":".", "x":17.5, "y":5.5}, - {"x":18.5, "y":5.5}, - {"label":"\u2190", "x":13.25, "y":5.75}, - {"label":"\u2193", "x":14.25, "y":5.75}, - {"label":"\u2192", "x":15.25, "y":5.75}] + "key_count": 103, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":1.25, "y":0}, + {"label":"F2", "x":2.25, "y":0}, + {"label":"F3", "x":3.25, "y":0}, + {"label":"F4", "x":4.25, "y":0}, + {"label":"F5", "x":5.5, "y":0}, + {"label":"F6", "x":6.5, "y":0}, + {"label":"F7", "x":7.5, "y":0}, + {"label":"F8", "x":8.5, "y":0}, + {"label":"F9", "x":9.75, "y":0}, + {"label":"F10", "x":10.75, "y":0}, + {"label":"F11", "x":11.75, "y":0}, + {"label":"F12", "x":12.75, "y":0}, + {"label":"Extra Esc", "x":14, "y":0}, + {"label":"PrtSc", "x":15.5, "y":0}, + {"label":"Pause", "x":16.5, "y":0}, + {"label":"Insert", "x":17.5, "y":0}, + {"label":"Home", "x":18.5, "y":0}, + {"label":"`~", "x":0, "y":1.5}, + {"label":"1!", "x":1, "y":1.5}, + {"label":"2@", "x":2, "y":1.5}, + {"label":"3#", "x":3, "y":1.5}, + {"label":"4$", "x":4, "y":1.5}, + {"label":"5%", "x":5, "y":1.5}, + {"label":"6^", "x":6, "y":1.5}, + {"label":"7&", "x":7, "y":1.5}, + {"label":"8*", "x":8, "y":1.5}, + {"label":"9(", "x":9, "y":1.5}, + {"label":"0)", "x":10, "y":1.5}, + {"label":"-_", "x":11, "y":1.5}, + {"label":"=+", "x":12, "y":1.5}, + {"label":"Split Backspace (Left)", "x":13, "y":1.5}, + {"label":"Split Backspace (Right)", "x":14, "y":1.5}, + {"label":"Num Lock", "x":15.5, "y":1.5}, + {"label":"/", "x":16.5, "y":1.5}, + {"label":"*", "x":17.5, "y":1.5}, + {"label":"-", "x":18.5, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"[{", "x":11.5, "y":2.5}, + {"label":"]}", "x":12.5, "y":2.5}, + {"label":"\\|", "x":13.5, "y":2.5, "w":1.5}, + {"label":"7", "x":15.5, "y":2.5}, + {"label":"8", "x":16.5, "y":2.5}, + {"label":"9", "x":17.5, "y":2.5}, + {"label":"Split + (Top)", "x":18.5, "y":2.5}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":";:", "x":10.75, "y":3.5}, + {"label":"'\"", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + {"label":"4", "x":15.5, "y":3.5}, + {"label":"5", "x":16.5, "y":3.5}, + {"label":"6", "x":17.5, "y":3.5}, + {"label":"Split + (Bottom)", "x":18.5, "y":3.5}, + {"label":"Shift", "x":0, "y":4.5, "w":1.25}, + {"label":"ISO Backslash", "x":1.25, "y":4.5}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":",<", "x":9.25, "y":4.5}, + {"label":".>", "x":10.25, "y":4.5}, + {"label":"/?", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, + {"label":"Up", "x":14.25, "y":4.75}, + {"label":"1", "x":15.5, "y":4.5}, + {"label":"2", "x":16.5, "y":4.5}, + {"label":"3", "x":17.5, "y":4.5}, + {"label":"Split Enter (Top)", "x":18.5, "y":4.5}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"GUI", "x":1.25, "y":5.5}, + {"label":"Alt", "x":2.25, "y":5.5, "w":1.25}, + {"label":"Space", "x":3.5, "y":5.5, "w":6.25}, + {"label":"Alt", "x":9.75, "y":5.5}, + {"label":"Fn", "x":10.75, "y":5.5}, + {"label":"Ctrl", "x":11.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":13.25, "y":5.75}, + {"label":"Down", "x":14.25, "y":5.75}, + {"label":"Right", "x":15.25, "y":5.75}, + {"label":"0", "x":16.5, "y":5.5}, + {"label":".", "x":17.5, "y":5.5}, + {"label":"Split Enter (Bottom)", "x":18.5, "y":5.5} + ] } } } - diff --git a/keyboards/kbdfans/kbd66/keymaps/default/config.h b/keyboards/kbdfans/kbd66/keymaps/default/config.h index c7b3d6ecc3..6d42fc568a 100644 --- a/keyboards/kbdfans/kbd66/keymaps/default/config.h +++ b/keyboards/kbdfans/kbd66/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/kbdfans/kbd66/keymaps/maartenwut/config.h b/keyboards/kbdfans/kbd66/keymaps/maartenwut/config.h index c7b3d6ecc3..c7b3d6ecc3 100755..100644 --- a/keyboards/kbdfans/kbd66/keymaps/maartenwut/config.h +++ b/keyboards/kbdfans/kbd66/keymaps/maartenwut/config.h diff --git a/keyboards/kbdfans/kbd67/readme.md b/keyboards/kbdfans/kbd67/readme.md index 7ee3c6adbb..6d5f774e6a 100644 --- a/keyboards/kbdfans/kbd67/readme.md +++ b/keyboards/kbdfans/kbd67/readme.md @@ -1,7 +1,9 @@ # KBD67 -A 65% keyboard sold in two variants. Rev1 was a typical keyboard that had to be soldered together, supporting multiple layouts. -Months later, a new version with hotswap was sold. **Firmware files from one, will not work on the other.** Please use the `.hex` appropriate for your board. +A 65% keyboard sold in two variants. Rev1 was a typical keyboard that had to be soldered together, supporting multiple layouts. +Months later, a new version with hotswap was sold. **Firmware files from one, will not work on the other.** Please use the `.hex` appropriate for your board. + +The rev1 PCB for the KBD67 is sold under the name "KBD65." Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) Hardware Supported: KBD67 diff --git a/keyboards/kbdfans/kbd67/rev1/keymaps/koba/config.h b/keyboards/kbdfans/kbd67/rev1/keymaps/koba/config.h new file mode 100644 index 0000000000..f4d7de06e5 --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev1/keymaps/koba/config.h @@ -0,0 +1,17 @@ +/* Copyright 2019 Daisuke Kobayashi + * + * 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 diff --git a/keyboards/kbdfans/kbd67/rev1/keymaps/koba/keymap.c b/keyboards/kbdfans/kbd67/rev1/keymaps/koba/keymap.c new file mode 100644 index 0000000000..b00805e9e7 --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev1/keymaps/koba/keymap.c @@ -0,0 +1,61 @@ +/* Copyright 2019 Daisuke Kobayashi + * + * 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 QMK_KEYBOARD_H +#include "keymap_jp.h" + +#define RGB_RMO RGB_RMOD + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap (Base Layer) Default Layer + * ,----------------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| ^| \|BS |Del | + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| @| [| Ent |PgUp| + * |------------------------------------------------------. |----| + * |H/Z | A| S| D| F| G| H| J| K| L| ;| :| ]| |PgDn| + * |----------------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Up |PScr| + * |----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Fn | Space |Alt |Ctrl| |Lef|Dow|Rig | + * `------------------------------------------------' `------------' + */ +[0] = LAYOUT_all( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, JP_CIRC, KC_JYEN, KC_BSPC, KC_DELT, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, JP_AT, JP_LBRC, JP_RBRC, KC_PGUP, \ + KC_ZKHK, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, JP_COLN, KC_ENT, KC_PGDN, \ + KC_LSFT, XXXXXXX, 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_PSCR, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_SPC, KC_RALT, KC_RCTL, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT), + + /* Keymap Fn Layer + * ,----------------------------------------------------------------. + * |Rst| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| | |Ins | + * |----------------------------------------------------------------| + * | |M- |M+ |RGB|H- |H+ | | |Prt|SLk|Pau| | | | | + * |------------------------------------------------------. |----| + * |Caps |Vo-|Vo+|Mut|S- |S+ | *| /|Hom|PUp| | | | | | + * |----------------------------------------------------------------| + * | |BL-|BL+|BL |V- |V+ | +| -|End|PDn| _| |PUp| | + * |----------------------------------------------------------------| + * | | | | Muhenkan | | Henkan |Kana|Menu| |Hom|PDn|End | + * `------------------------------------------------' `------------' + */ +[1] = LAYOUT_all( + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX,_______,KC_INS, \ + _______, RGB_RMO,RGB_MOD,RGB_TOG,RGB_HUD,RGB_HUI,XXXXXXX,XXXXXXX,KC_PSCR,KC_SLCK,KC_PAUS,XXXXXXX,XXXXXXX,XXXXXXX, _______, \ + KC_CAPS, KC_VOLD,KC_VOLU,KC_MUTE,RGB_SAD,RGB_SAI,KC_PAST,KC_PSLS,KC_HOME,KC_PGUP,XXXXXXX,XXXXXXX, KC_PENT, _______, \ + _______,_______,BL_DEC, BL_INC, BL_TOGG,RGB_VAD,RGB_VAI,KC_PPLS,KC_PMNS,KC_END, KC_PGDN,JP_UNDS,_______, KC_PGUP,_______, \ + _______,_______,_______, KC_MHEN, _______, KC_HENK, KC_KANA,KC_APP, _______,KC_HOME,KC_PGDN,KC_END), +}; diff --git a/keyboards/kbdfans/kbd67/rev1/keymaps/koba/readme.md b/keyboards/kbdfans/kbd67/rev1/keymaps/koba/readme.md new file mode 100644 index 0000000000..b432436d40 --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev1/keymaps/koba/readme.md @@ -0,0 +1,7 @@ +# Koba's keymap for KBD67 + +![keyboard-layout](https://user-images.githubusercontent.com/1042121/54736578-244ffe80-4bef-11e9-9882-37611b4efdf4.png) + +- JIS layout. +- Fn layer is arranged like HHKB. +- 3 splitted space bar. (Space-Fn-Space) diff --git a/keyboards/kbdfans/kbd67/rev1/readme.md b/keyboards/kbdfans/kbd67/rev1/readme.md index ab5209646f..9074557cbb 100644 --- a/keyboards/kbdfans/kbd67/rev1/readme.md +++ b/keyboards/kbdfans/kbd67/rev1/readme.md @@ -3,8 +3,8 @@ 65% keyboard with blocker. Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) -Hardware Supported: KBD67 PCB -Hardware Availability: [KBDFans](https://kbdfans.cn/products/coming-soon-kbd67-mechanical-keyboard-diy-kit) +Hardware Supported: KBD67 PCB (Sometimes sold under the name "KBD65") +Hardware Availability: KBDFans [Keyboard Kit](https://kbdfans.cn/products/coming-soon-kbd67-mechanical-keyboard-diy-kit), [PCB](https://kbdfans.cn/collections/65/products/kbd65-65-custom-mechanical-keyboard-pcb) Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/kc60/keymaps/noroadsleft/keymap.c b/keyboards/kc60/keymaps/noroadsleft/keymap.c index ee1f69e914..98d7353568 100644 --- a/keyboards/kc60/keymaps/noroadsleft/keymap.c +++ b/keyboards/kc60/keymaps/noroadsleft/keymap.c @@ -9,24 +9,24 @@ ** LAYER DEFINITIONS ** **********************/ enum layers_keymap { - // BASE LAYERS - _QWERTY = 0, - _DVORAK, - _COLEMAK, - _MAC, - _QUAKE2, - _QUAKE2_DVORAK, - _QUAKE2_CONSOLE, - - // FUNCTION LAYERS - _FUNCWIN, - _FUNCMAC, - _FUNCQ2, - - // OTHER LAYERS - _NUMPAD, - _MACROS, - _SYSTEM + // BASE LAYERS + _QWERTY = 0, + _DVORAK, + _COLEMAK, + _MAC, + _QUAKE2, + _QUAKE2_DVORAK, + _QUAKE2_CONSOLE, + + // FUNCTION LAYERS + _FUNCWIN, + _FUNCMAC, + _FUNCQ2, + + // OTHER LAYERS + _NUMPAD, + _MACROS, + _SYSTEM }; // LAYER SHORT CODES @@ -70,24 +70,24 @@ enum layers_keymap { // MACRO DEFINITIONS enum custom_keycodes { - F_CAPS = SAFE_RANGE, - T_L3DED, - G_PUSH, - G_FTCH, - G_COMM, - G_RST, - G_C10R, - G_BRCH, - SIGNA, - GO_Q2, - Q2_ON, - Q2_OFF, - Q2_ESC, - Q2_GRV, - MC_UNDO, - MC_PSTE, - NUBS_Z, - VRSN + F_CAPS = SAFE_RANGE, + T_L3DED, + G_PUSH, + G_FTCH, + G_COMM, + G_RST, + G_C10R, + G_BRCH, + SIGNA, + GO_Q2, + Q2_ON, + Q2_OFF, + Q2_ESC, + Q2_GRV, + MC_UNDO, + MC_PSTE, + NUBS_Z, + VRSN }; @@ -98,293 +98,314 @@ enum custom_keycodes { bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch(keycode) { - // these are our macros! - case F_CAPS: - /* - Objective: write a macro that checks the current layers that are - enabled, and activates the appropriate function layer. - */ - if ( biton32(layer_state) == _MAC ) { - if (record->event.pressed) { - layer_on(_FUNCMAC); - } else { - layer_off(_FUNCMAC); - } - } else { - if (record->event.pressed) { - layer_on(_FUNCWIN); - } else { - layer_off(_FUNCWIN); - } - }; - return false; - case T_L3DED: - if (record->event.pressed) { - SEND_STRING("lavak3DED "); - }; - return false; - case G_PUSH: - if (record->event.pressed) { - SEND_STRING("git push origin "); - }; - return false; - case G_FTCH: - if (record->event.pressed) { - if ( get_mods() & MOD_MASK_SHIFT ) { - clear_mods(); - SEND_STRING("git pull upstream "); - } else { - SEND_STRING("git fetch upstream "); - } - }; - return false; - case G_COMM: - if (record->event.pressed) { - SEND_STRING("git commit -m \"\"" SS_TAP(X_LEFT)); - layer_off(_MACROS); - }; - return false; - case G_BRCH: - if (record->event.pressed) { - if ( get_mods() & MOD_MASK_SHIFT ) { - clear_mods(); - SEND_STRING("master"); - } else { - SEND_STRING("$(git branch-name)"); - } - layer_off(_MACROS); - }; - return false; - case SIGNA: - if (record->event.pressed) { - SEND_STRING("\\- @noroadsleft" SS_TAP(X_ENTER)); - layer_off(_MACROS); - }; - return false; - case GO_Q2: - if (record->event.pressed) { - //default_layer_set(_QWERTY); - layer_move(_QWERTY); // TO(_QWERTY); - layer_on(_QUAKE2); - //layer_off(_SYSTEM); - }; - return false; - case Q2_ON: - if (record->event.pressed) { - SEND_STRING(SS_TAP(X_ENTER)); - layer_on(_DVORAK); - layer_on(_QUAKE2_DVORAK); - }; - return false; - case Q2_OFF: - if (record->event.pressed) { - SEND_STRING(SS_TAP(X_ENTER)); - layer_move(_QWERTY); // TO(_QWERTY); - layer_on(_QUAKE2); - }; - return false; - case Q2_ESC: - if (record->event.pressed) { - SEND_STRING(SS_TAP(X_ESCAPE)); - layer_move(_QWERTY); // TO(_QWERTY); - layer_on(_QUAKE2); - }; - return false; - case Q2_GRV: - if (record->event.pressed) { - SEND_STRING(SS_TAP(X_GRAVE)); - layer_on(_DVORAK); - layer_on(_QUAKE2_DVORAK); - layer_on(_QUAKE2_CONSOLE); - }; - return false; - case MC_UNDO: - if (record->event.pressed) { - if ( get_mods() & MOD_MASK_SHIFT ) { - SEND_STRING( SS_DOWN(X_LSHIFT) SS_DOWN(X_LGUI) SS_TAP(X_Z) SS_UP(X_LGUI) SS_UP(X_LSHIFT) ); - } else { - SEND_STRING( SS_DOWN(X_LGUI) SS_TAP(X_Z) SS_UP(X_LGUI) ); - } - }; - return false; - case MC_PSTE: - if (record->event.pressed) { - if ( get_mods() & MOD_MASK_SHIFT ) { - SEND_STRING( SS_DOWN(X_LSHIFT) SS_DOWN(X_LGUI) SS_DOWN(X_LALT) SS_TAP(X_V) SS_UP(X_LALT) SS_UP(X_LGUI) SS_UP(X_LSHIFT) ); - } else { - SEND_STRING( SS_DOWN(X_LGUI) SS_TAP(X_V) SS_UP(X_LGUI) ); - } - }; - return false; - case NUBS_Z: - if (record->event.pressed) { - if ( get_mods() & MOD_MASK_RALT ) { - SEND_STRING( SS_TAP(X_NONUS_BSLASH) ); - } else { - SEND_STRING( SS_TAP(X_Z) ); - } - }; - return false; - case VRSN: - if (record->event.pressed) { - SEND_STRING( QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ); - } - return false; - } // switch() - return true; + switch(keycode) { + // these are our macros! + case F_CAPS: + /* + * Objective: write a macro that checks the current layers that are + * enabled, and activates the appropriate function layer. + */ + if ( biton32(layer_state) == _MAC ) { + if (record->event.pressed) { + layer_on(_FUNCMAC); + } else { + layer_off(_FUNCMAC); + } + } else { + if (record->event.pressed) { + layer_on(_FUNCWIN); + } else { + layer_off(_FUNCWIN); + } + }; + return false; + case T_L3DED: + if (record->event.pressed) { + SEND_STRING("lavak3DED "); + }; + return false; + case G_PUSH: + if (record->event.pressed) { + SEND_STRING("git push origin "); + }; + return false; + case G_FTCH: + if (record->event.pressed) { + if ( get_mods() & MOD_MASK_SHIFT ) { + clear_mods(); + SEND_STRING("git pull upstream "); + } else { + SEND_STRING("git fetch upstream "); + } + }; + return false; + case G_COMM: + if (record->event.pressed) { + SEND_STRING("git commit -m \"\"" SS_TAP(X_LEFT)); + layer_off(_MACROS); + }; + return false; + case G_BRCH: + if (record->event.pressed) { + if ( get_mods() & MOD_MASK_SHIFT ) { + clear_mods(); + SEND_STRING("master"); + } else { + SEND_STRING("$(git branch-name)"); + } + layer_off(_MACROS); + }; + return false; + case SIGNA: + if (record->event.pressed) { + SEND_STRING("\\- @noroadsleft" SS_TAP(X_ENTER)); + layer_off(_MACROS); + }; + return false; + case GO_Q2: + if (record->event.pressed) { + //default_layer_set(_QWERTY); + layer_move(_QWERTY); // TO(_QWERTY); + layer_on(_QUAKE2); + //layer_off(_SYSTEM); + }; + return false; + case Q2_ON: + if (record->event.pressed) { + SEND_STRING(SS_TAP(X_ENTER)); + layer_on(_DVORAK); + layer_on(_QUAKE2_DVORAK); + }; + return false; + case Q2_OFF: + if (record->event.pressed) { + SEND_STRING(SS_TAP(X_ENTER)); + layer_move(_QWERTY); // TO(_QWERTY); + layer_on(_QUAKE2); + }; + return false; + case Q2_ESC: + if (record->event.pressed) { + SEND_STRING(SS_TAP(X_ESCAPE)); + layer_move(_QWERTY); // TO(_QWERTY); + layer_on(_QUAKE2); + }; + return false; + case Q2_GRV: + if (record->event.pressed) { + SEND_STRING(SS_TAP(X_GRAVE)); + layer_on(_DVORAK); + layer_on(_QUAKE2_DVORAK); + layer_on(_QUAKE2_CONSOLE); + }; + return false; + case MC_UNDO: + if (record->event.pressed) { + if ( get_mods() & MOD_MASK_SHIFT ) { + SEND_STRING( SS_DOWN(X_LSHIFT) SS_DOWN(X_LGUI) SS_TAP(X_Z) SS_UP(X_LGUI) SS_UP(X_LSHIFT) ); + } else { + SEND_STRING( SS_DOWN(X_LGUI) SS_TAP(X_Z) SS_UP(X_LGUI) ); + } + }; + return false; + case MC_PSTE: + if (record->event.pressed) { + if ( get_mods() & MOD_MASK_SHIFT ) { + SEND_STRING( SS_DOWN(X_LSHIFT) SS_DOWN(X_LGUI) SS_DOWN(X_LALT) SS_TAP(X_V) SS_UP(X_LALT) SS_UP(X_LGUI) SS_UP(X_LSHIFT) ); + } else { + SEND_STRING( SS_DOWN(X_LGUI) SS_TAP(X_V) SS_UP(X_LGUI) ); + } + }; + return false; + case NUBS_Z: + if (record->event.pressed) { + if ( get_mods() & MOD_MASK_RALT ) { + SEND_STRING( SS_DOWN(X_NONUS_BSLASH) ); + } else { + SEND_STRING( SS_DOWN(X_Z) ); + } + } else { + if ( get_mods() & MOD_MASK_RALT ) { + SEND_STRING( SS_UP(X_NONUS_BSLASH) ); + } else { + SEND_STRING( SS_UP(X_Z) ); + } + }; + return false; + case VRSN: + if (record->event.pressed) { + SEND_STRING( QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ); + } + return false; + case KC_1 ... KC_0: + if (record->event.pressed) { + if ( get_mods() & MOD_MASK_RALT ) { + register_code( keycode + 0x3b ); + } else { + register_code( keycode ); + } + } else { + if ( get_mods() & MOD_MASK_RALT ) { + unregister_code( keycode + 0x3b ); + } else { + unregister_code( keycode ); + } + } + return false; + } // switch() + return true; }; // KEYMAPS const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /**************** - ** BASE LAYERS ** - ****************/ - - /* QWERTY */ - [_QWERTY] = LAYOUT_60_ansi( - // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - KC_GESC, 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_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, \ - FW_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_LSFT, NUBS_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FW), KC_RCTL \ - ), - - /* Dvorak */ - [_DVORAK] = LAYOUT_60_ansi( - // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSPC, \ - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, \ - FW_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FW), KC_RCTL \ - ), - - /* Colemak */ - [_COLEMAK] = LAYOUT_60_ansi( - // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - KC_GESC, 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_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, \ - FW_CAPS, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FW), KC_RCTL \ - ), - - /**************** - ** OS OVERLAYS ** - ****************/ - - /* Mac */ - [_MAC] = LAYOUT_60_ansi( - // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - FM_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, MO(_FM), _______ \ - ), - - /********************* - ** QUAKE 2 OVERLAYS ** - *********************/ - - /* Quake 2 */ - [_QUAKE2] = LAYOUT_60_ansi( - // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - Q2_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, Q2_ON, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, MO(_FQ), _______ \ - ), - - [_QUAKE2_DVORAK] = LAYOUT_60_ansi( - // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - Q2_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - Q2_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, Q2_OFF, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, MO(_FQ), _______ \ - ), - - [_QUAKE2_CONSOLE] = LAYOUT_60_ansi( - // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - Q2_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - Q2_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_ENT, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, MO(_FQ), _______ \ - ), - - /******************** - ** FUNCTION LAYERS ** - ********************/ - - /* Windows Fn layer */ - [_FUNCWIN] = LAYOUT_60_ansi( - // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - KC_GRV, 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_DEL, \ - _______, KC_CALC, KC_APP, _______, _______, _______, KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_PSCR, KC_SLCK, KC_PAUS, \ - NO_CHNG, WN_SALL, _______, _______, _______, _______, KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, KC_PENT, \ - _______, WN_UNDO, WN_CUT, WN_COPY, WN_PSTE, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, TG(_SY), _______, \ - _______, _______, _______, TG(_NP), _______, TG(_MA), NO_CHNG, _______ \ - ), - - /* MacOS Fn layer */ - [_FUNCMAC] = LAYOUT_60_ansi( - // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - KC_GRV, 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_DEL, \ - _______, _______, _______, _______, _______, _______, KC_INS, MC_HOME, KC_UP, MC_END, KC_PGUP, MC_PSCR, _______, _______, \ - NO_CHNG, MC_SALL, _______, _______, _______, _______, KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, _______, \ - _______, MC_UNDO, MC_CUT, MC_COPY, MC_PSTE, _______, _______, _______, _______, _______, TG(_SY), _______, \ - _______, _______, _______, TG(_NP), _______, _______, NO_CHNG, _______ \ - ), - - /* Quake 2 Fn layer */ - [_FUNCQ2] = LAYOUT_60_ansi( - // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - Q2_GRV, 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_DEL, \ - _______, _______, _______, _______, _______, _______, KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_PSCR, KC_SLCK, KC_PAUS, \ - NO_CHNG, _______, _______, _______, _______, _______, KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, KC_ENT, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, TG(_SY), _______, \ - _______, _______, _______, _______, _______, _______, NO_CHNG, _______ \ - ), - - /***************** - ** OTHER LAYERS ** - *****************/ - - /* Numpad layer */ - [_NUMPAD] = LAYOUT_60_ansi( - // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, _______, _______, _______, _______, \ - _______, _______, _______, _______, KC_E, KC_F, _______, KC_P4, KC_P5, KC_P6, KC_PAST, KC_PSLS, KC_PEQL, _______, \ - _______, _______, _______, _______, KC_C, KC_D, _______, KC_P1, KC_P2, KC_P3, KC_PPLS, KC_PMNS, KC_PENT, \ - _______, _______, _______, _______, KC_A, KC_B, _______, KC_P0, _______, KC_PDOT, _______, _______, \ - _______, _______, _______, TG(_NP), _______, _______, NO_CHNG, _______ \ - ), - - /* Macro layer */ - [_MACROS] = LAYOUT_60_ansi( - // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - TG(_MA), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, G_PUSH, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, G_FTCH, G_COMM, _______, _______, _______, _______, T_L3DED, _______, _______, _______, \ - _______, _______, _______, _______, _______, G_BRCH, SIGNA, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, NO_CHNG, _______ \ - ), - - /* System layer */ - [_SYSTEM] = LAYOUT_60_ansi( - // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - TG(_SY), TO(_QW), TO(_DV), TO(_CM), GO_Q2, XXXXXXX, XXXXXXX, XXXXXXX, RESET, XXXXXXX, DEBUG, XXXXXXX, VRSN, XXXXXXX, \ - XXXXXXX, XXXXXXX, TG(_MC), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_TOGG, BL_INC, BL_BRTG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, NO_CHNG, XXXXXXX \ - ), + /**************** + ** BASE LAYERS ** + ****************/ + + /* QWERTY */ + [_QWERTY] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + KC_GESC, 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_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, \ + FW_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_LSFT, NUBS_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FW), KC_RCTL \ + ), + + /* Dvorak */ + [_DVORAK] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSPC, \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, \ + FW_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FW), KC_RCTL \ + ), + + /* Colemak */ + [_COLEMAK] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + KC_GESC, 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_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, \ + FW_CAPS, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FW), KC_RCTL \ + ), + + /**************** + ** OS OVERLAYS ** + ****************/ + + /* Mac */ + [_MAC] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + FM_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, MO(_FM), _______ \ + ), + + /********************* + ** QUAKE 2 OVERLAYS ** + *********************/ + + /* Quake 2 */ + [_QUAKE2] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + Q2_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, Q2_ON, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, MO(_FQ), _______ \ + ), + + [_QUAKE2_DVORAK] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + Q2_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + Q2_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, Q2_OFF, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, MO(_FQ), _______ \ + ), + + [_QUAKE2_CONSOLE] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + Q2_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + Q2_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_ENT, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, MO(_FQ), _______ \ + ), + + /******************** + ** FUNCTION LAYERS ** + ********************/ + + /* Windows Fn layer */ + [_FUNCWIN] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + KC_GRV, 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_DEL, \ + _______, KC_CALC, KC_APP, _______, _______, _______, KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_PSCR, KC_SLCK, KC_PAUS, \ + NO_CHNG, WN_SALL, _______, _______, _______, _______, KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, KC_PENT, \ + _______, WN_UNDO, WN_CUT, WN_COPY, WN_PSTE, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, TG(_SY), _______, \ + _______, _______, _______, TG(_NP), _______, TG(_MA), NO_CHNG, _______ \ + ), + + /* MacOS Fn layer */ + [_FUNCMAC] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + KC_GRV, 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_DEL, \ + _______, _______, _______, _______, _______, _______, KC_INS, MC_HOME, KC_UP, MC_END, KC_PGUP, MC_PSCR, _______, _______, \ + NO_CHNG, MC_SALL, _______, _______, _______, _______, KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, _______, \ + _______, MC_UNDO, MC_CUT, MC_COPY, MC_PSTE, _______, _______, _______, _______, _______, TG(_SY), _______, \ + _______, _______, _______, TG(_NP), _______, _______, NO_CHNG, _______ \ + ), + + /* Quake 2 Fn layer */ + [_FUNCQ2] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + Q2_GRV, 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_DEL, \ + _______, _______, _______, _______, _______, _______, KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_PSCR, KC_SLCK, KC_PAUS, \ + NO_CHNG, _______, _______, _______, _______, _______, KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, KC_ENT, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, TG(_SY), _______, \ + _______, _______, _______, _______, _______, _______, NO_CHNG, _______ \ + ), + + /***************** + ** OTHER LAYERS ** + *****************/ + + /* Numpad layer */ + [_NUMPAD] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, _______, _______, _______, _______, \ + _______, _______, _______, _______, KC_E, KC_F, _______, KC_P4, KC_P5, KC_P6, KC_PAST, KC_PSLS, KC_PEQL, _______, \ + _______, _______, _______, _______, KC_C, KC_D, _______, KC_P1, KC_P2, KC_P3, KC_PPLS, KC_PMNS, KC_PENT, \ + _______, _______, _______, _______, KC_A, KC_B, _______, KC_P0, _______, KC_PDOT, _______, _______, \ + _______, _______, _______, TG(_NP), _______, _______, NO_CHNG, _______ \ + ), + + /* Macro layer */ + [_MACROS] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + TG(_MA), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, G_PUSH, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, G_FTCH, G_COMM, _______, _______, _______, _______, T_L3DED, _______, _______, _______, \ + _______, _______, _______, _______, _______, G_BRCH, SIGNA, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, NO_CHNG, _______ \ + ), + + /* System layer */ + [_SYSTEM] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + TG(_SY), TO(_QW), TO(_DV), TO(_CM), GO_Q2, XXXXXXX, XXXXXXX, XXXXXXX, RESET, XXXXXXX, DEBUG, XXXXXXX, VRSN, XXXXXXX, \ + XXXXXXX, XXXXXXX, TG(_MC), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_TOGG, BL_INC, BL_BRTG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, NO_CHNG, XXXXXXX \ + ), }; diff --git a/keyboards/kc60/keymaps/noroadsleft/readme.md b/keyboards/kc60/keymaps/noroadsleft/readme.md index 59fbfd246a..c9db4f8de2 100644 --- a/keyboards/kc60/keymaps/noroadsleft/readme.md +++ b/keyboards/kc60/keymaps/noroadsleft/readme.md @@ -1,6 +1,6 @@ # @noroadsleft's KC60 keymap -### Last updated: February 14, 2019, 3:50 AM UTC-0800 +### Last updated: April 7, 2019, 2:26 AM UTC-0700 ![](https://i.imgur.com/tzhXQYI.jpg) diff --git a/keyboards/kc60/keymaps/noroadsleft/readme_ch3.md b/keyboards/kc60/keymaps/noroadsleft/readme_ch3.md index ebcb3cca86..b9dc556e4e 100644 --- a/keyboards/kc60/keymaps/noroadsleft/readme_ch3.md +++ b/keyboards/kc60/keymaps/noroadsleft/readme_ch3.md @@ -16,7 +16,7 @@ These layers were born out of the confusion I have had trying to use the in-game chat and the console in [Quake 2](https://en.wikipedia.org/wiki/Quake_II). When Quake 2 came out, alternate keyboard layouts weren't really a thing. As a result, all in-game text input is hard-locked to US QWERTY, regardless of what the operating system is using for its input method. -I'm attempting to solve this by some creative use of QMK's macro feature. The keycode in the System layer that enables these layers, [`GO_Q2`](./keymap.c#L383), is a [macro](./keymap.c#L165-172) that sets the default layer to the QWERTY layer, then turns the Quake 2 layer `_Q2` on. The result is a partially-overwritten QWERTY layer, that has some keycodes with some creative layer switching. +I'm attempting to solve this by some creative use of QMK's macro feature. The keycode in the System layer that enables these layers, [`GO_Q2`](./keymap.c#L404), is a [macro](./keymap.c#L165-L172) that sets the default layer to the QWERTY layer, then turns the Quake 2 layer `_Q2` on. The result is a partially-overwritten QWERTY layer, that has some keycodes with some creative layer switching. When I hit the `Enter` key (bound in-game to text chat), the [macro keycode](./keymap.c#L173-L179) I've created sends the keycode for `Enter`, then follows with enabling the Hardware Dvorak layer and its corresponding overlay. Now the game is in text chat mode, and my keyboard is in Dvorak. When I hit `Enter` again, another `Enter` [keycode macro](./keymap.c#L180-L186) is sent, which sends the message, then the macro brings me back to the standard QWERTY+Quake 2 setup. Hitting `Escape` instead runs a [macro](./keymap.c#L187-L193) that cancels the sending of the message, and undoes the layers. diff --git a/keyboards/kc60/keymaps/noroadsleft/readme_ch5.md b/keyboards/kc60/keymaps/noroadsleft/readme_ch5.md index e5ee7cbdeb..a65b3acbeb 100644 --- a/keyboards/kc60/keymaps/noroadsleft/readme_ch5.md +++ b/keyboards/kc60/keymaps/noroadsleft/readme_ch5.md @@ -60,7 +60,7 @@ Output: `git commit -m ""` <kbd>Left</kbd> Readies a `git commit` command, moves the cursor between the quotation marks, then disables the Macro layer. -#### [G_BRCH](./keymap.c#L148-158) +#### [G_BRCH](./keymap.c#L148-L158) | Condition | Output | | :-------- | :----- | @@ -93,7 +93,7 @@ An Undo shortcut that turns to Redo if <kbd>Shift</kbd> is being held. I'm not s The program I use this in uses <kbd>Shift</kbd> + <kbd>Command</kbd> + <kbd>Option</kbd> + <kbd>V</kbd> to paste while maintaining formatting (typeface, text size, etc.). Sometimes I want this and sometimes I don't. Using <kbd>Shift</kbd> changes the behavior. -#### [NUBS_Z](./keymap.c#L220-L228) +#### [NUBS_Z](./keymap.c#L220-L234) | Condition | Output | | :-------- | :----- | @@ -102,11 +102,15 @@ The program I use this in uses <kbd>Shift</kbd> + <kbd>Command</kbd> + <kbd>Opti Sometimes I type in languages from countries that use ISO layout, but my keyboard is ANSI, so I have one key fewer. This macro simulates the Non-US Backslash key if I use Right Alt + Z. -#### [VRSN](./keymap.c#L229-L233) +#### [VRSN](./keymap.c#L235-L239) Outputs a string that tells me the Git commit from which my flashed firmware was built. Looks something like: - kc60/noroadsleft @ 0.6.240-20-ge91549-dirty + kc60/noroadsleft @ 0.6.326-6-gae6d7b-dirty + +#### [Emulated Numeric Keypad](./keymap.c#L240-L254) + +If I hold the Right Alt key, the number row (`KC_1` through `KC_0`) will output numpad keycodes instead of number row keycodes, enabling quicker access to characters like ™ and °. ---- diff --git a/keyboards/kc60/keymaps/stanleylai/readme.md b/keyboards/kc60/keymaps/stanleylai/readme.md index 815649d987..6f5953ded7 100644 --- a/keyboards/kc60/keymaps/stanleylai/readme.md +++ b/keyboards/kc60/keymaps/stanleylai/readme.md @@ -1,8 +1,6 @@ Stanley Lai's Split Right Shift with Dedicated Arrow Keys ====================== -![Image of KC60 with RGB Underglow](../ws2812/ws2812_example.jpg) - ## Quantum MK Firmware For the full Quantum feature list, see [the parent readme.md](/readme.md). @@ -20,7 +18,7 @@ For the full Quantum feature list, see [the parent readme.md](/readme.md). ![RGB Layer](http://imgur.com/ZWIfuPM) ## WS2812 Support -By default, it is now setup for 16 LEDs on the PF5 breakout pin. See [included image](../ws2812/ws2812_wiring.jpg) for wiring reference. +By default, it is now setup for 16 LEDs on the PF5 breakout pin. ### Build To build this keymap, simply run `make KEYMAP=stanleylai`. diff --git a/keyboards/kc60/readme.md b/keyboards/kc60/readme.md index da84f6159a..e152824ccf 100644 --- a/keyboards/kc60/readme.md +++ b/keyboards/kc60/readme.md @@ -24,7 +24,6 @@ $ make [default|jack|<name>] Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder. ## WS2812 Support -![Image of KC60 with RGB Underglow](keymaps/ws2812/ws2812_example.jpg) Build with WS2812 Support by running `make ws2812`. diff --git a/keyboards/kc60se/keymaps/default/config.h b/keyboards/kc60se/keymaps/default/config.h index 0f75635051..4496c59100 100644 --- a/keyboards/kc60se/keymaps/default/config.h +++ b/keyboards/kc60se/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/keebio/bfo9000/keymaps/abstractkb/config.h b/keyboards/keebio/bfo9000/keymaps/abstractkb/config.h new file mode 100644 index 0000000000..67c64fd8e8 --- /dev/null +++ b/keyboards/keebio/bfo9000/keymaps/abstractkb/config.h @@ -0,0 +1,37 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako <wakojun@gmail.com> +Copyright 2015 Jack Humbert +(Modified) Copyright 2019 AbstractKB + +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 + +//my block------------ +#define RGBLIGHT_ANIMATIONS +#define RGBLIGHT_SLEEP + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS diff --git a/keyboards/keebio/bfo9000/keymaps/abstractkb/keymap.c b/keyboards/keebio/bfo9000/keymaps/abstractkb/keymap.c new file mode 100644 index 0000000000..a8348ecfb5 --- /dev/null +++ b/keyboards/keebio/bfo9000/keymaps/abstractkb/keymap.c @@ -0,0 +1,92 @@ +#include QMK_KEYBOARD_H + +enum layers { + _BASE, + _LIST +}; + +enum my_keycodes { + MYRGB_TG = SAFE_RANGE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_BASE] = LAYOUT( \ + KC_MPLY, KC_PSLS, KC_PAST, 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, MYRGB_TG, KC_PGUP, \ + KC_MUTE, KC_PPLS, KC_PMNS, 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_DEL, KC_PGDN, \ + KC_P7, KC_P8, KC_P9, 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_HOME, \ + KC_P4, KC_P5, KC_P6, KC_BSPACE, 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_CAPS, KC_PSCR, \ + KC_P1, KC_P2, KC_P3, 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, XXXXXXX, KC_INS, \ + KC_P0, KC_PDOT, KC_PENT, TO(_LIST), KC_LCTL, KC_LGUI, KC_LALT, XXXXXXX, KC_SPC, KC_SPC, XXXXXXX, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX \ +), + +[_LIST] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, TO(_BASE), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +bool rgbinit = true; +bool rgbon = true; + +const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[] PROGMEM = {1,5,5}; //only using the first one + +void matrix_post_init_user(void) { + rgblight_enable_noeeprom(); + led_set_user(host_keyboard_leds()); +} + +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case _LIST: + rgblight_sethsv_noeeprom(0,255,255); + rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_SWIRL); + break; + default: //_BASE + rgblight_sethsv_noeeprom(0,0,255); + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + break; + } + + return state; +} + +void led_set_user(uint8_t usb_led) { + if (usb_led & (1<<USB_LED_CAPS_LOCK)) { + rgblight_mode_noeeprom(RGBLIGHT_MODE_ALTERNATING); + } else { + layer_state_set_user(layer_state); + } +} + +void myrgb_toggle(void) { + if (rgbon) { + rgblight_disable_noeeprom(); + rgbon = false; + } else { + rgblight_enable_noeeprom(); + layer_state_set_user(layer_state); + led_set_user(host_keyboard_leds()); + rgbon = true; + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { + case MYRGB_TG: + if (record->event.pressed) { + myrgb_toggle(); + } + return false; + default: + return true; + } +} + + + diff --git a/keyboards/keebio/bfo9000/keymaps/abstractkb/readme.md b/keyboards/keebio/bfo9000/keymaps/abstractkb/readme.md new file mode 100644 index 0000000000..3ba56571fe --- /dev/null +++ b/keyboards/keebio/bfo9000/keymaps/abstractkb/readme.md @@ -0,0 +1,5 @@ +# My personal layout for the BFO-9000 + +It is an approximation of a 96% layout with a left-hand number pad +Other things I changed were swapping around delete, backspace, and capslock +It also uses layer based rgb underglow, and the underglow flashes when capslock is enabled
\ No newline at end of file diff --git a/keyboards/keebio/bfo9000/keymaps/abstractkb/rules.mk b/keyboards/keebio/bfo9000/keymaps/abstractkb/rules.mk new file mode 100644 index 0000000000..7ad666d1a3 --- /dev/null +++ b/keyboards/keebio/bfo9000/keymaps/abstractkb/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = yes
\ No newline at end of file diff --git a/keyboards/keebio/chocopad/keymaps/default/config.h b/keyboards/keebio/chocopad/keymaps/default/config.h index 7fa3bf328e..271f48d001 100644 --- a/keyboards/keebio/chocopad/keymaps/default/config.h +++ b/keyboards/keebio/chocopad/keymaps/default/config.h @@ -1,6 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "../../config.h" - -#endif +// place overrides here diff --git a/keyboards/keebio/iris/keymaps/davidrambo/config.h b/keyboards/keebio/iris/keymaps/davidrambo/config.h index 2cdff4213b..0c4bf8c8f4 100644 --- a/keyboards/keebio/iris/keymaps/davidrambo/config.h +++ b/keyboards/keebio/iris/keymaps/davidrambo/config.h @@ -15,10 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once /* Use I2C or Serial, not both */ @@ -39,6 +36,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define RGBLIGHT_VAL_STEP 8 */ #define TAPPING_TERM 200 -#include "../../config.h" -#endif + diff --git a/keyboards/keebio/iris/keymaps/davidrambo/keymap.c b/keyboards/keebio/iris/keymaps/davidrambo/keymap.c index 40f0d01454..4d76d745d8 100644 --- a/keyboards/keebio/iris/keymaps/davidrambo/keymap.c +++ b/keyboards/keebio/iris/keymaps/davidrambo/keymap.c @@ -1,6 +1,4 @@ -#include "iris.h" -#include "action_layer.h" -#include "eeconfig.h" +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; @@ -85,13 +83,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_GAME] = LAYOUT_kc( ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , - ___ , T , Q , W , E , R , ___ , ___ , ___ , ___ , ___ , ___ , + B , T , Q , W , E , R , ___ , ___ , ___ , ___ , ___ , ___ , TAB , LSFT, A , S , D , F , ___ , ___ , ___ , ___ , ___ , ___ , - I , LCTL, Z , X , C , V , M, P , ___, ___ , ___ , ___ , ___ , ___ , + LALT, LCTL, Z , X , C , V , M, P , ___, ___ , ___ , ___ , ___ , ___ , - LALT , LALT , SPC, BSPC, MAC, ___ + G , I , SPC, BSPC, MAC, ___ ), [_SYMBOL] = LAYOUT_kc( diff --git a/keyboards/keebio/iris/keymaps/davidrambo/readme.md b/keyboards/keebio/iris/keymaps/davidrambo/readme.md index 4d21f37c09..181ff97f36 100644 --- a/keyboards/keebio/iris/keymaps/davidrambo/readme.md +++ b/keyboards/keebio/iris/keymaps/davidrambo/readme.md @@ -1,3 +1,5 @@ -# Colemak layout for Iris rev2.1 with Mac and Windows layers and a Gaming Layer. -# Symbol layer is based on my Planck layout, so it provides numbers, symbols, and volume controls. -# Two Navigation layers, for Mac and Windows Colemak layers respectively.
\ No newline at end of file +# Iris + +This is a simple Colemak layout for Iris rev2.1 with Mac and Windows layers and a Gaming Layer. +The Symbol layer is based on my Planck layout. It provides numbers, symbols, and volume controls. +There are two Navigation layers, for the Mac and Windows Colemak layers respectively.
\ No newline at end of file diff --git a/keyboards/keebio/iris/keymaps/default/config.h b/keyboards/keebio/iris/keymaps/default/config.h index 7986b50416..01bb31a6e1 100644 --- a/keyboards/keebio/iris/keymaps/default/config.h +++ b/keyboards/keebio/iris/keymaps/default/config.h @@ -17,16 +17,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #pragma once -/* Use I2C or Serial, not both */ - -#define USE_SERIAL // #define USE_I2C - -/* Select hand configuration */ - -#define MASTER_LEFT -// #define MASTER_RIGHT -// #define EE_HANDS +#define EE_HANDS #undef RGBLED_NUM #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/keebio/iris/keymaps/default/keymap.c b/keyboards/keebio/iris/keymaps/default/keymap.c index 4644c3d9b5..f0e4d6f15b 100644 --- a/keyboards/keebio/iris/keymaps/default/keymap.c +++ b/keyboards/keebio/iris/keymaps/default/keymap.c @@ -5,7 +5,7 @@ extern keymap_config_t keymap_config; #define _QWERTY 0 #define _LOWER 1 #define _RAISE 2 -#define _ADJUST 16 +#define _ADJUST 3 enum custom_keycodes { QWERTY = SAFE_RANGE, @@ -20,25 +20,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_HOME, KC_END, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_GRV, KC_DEL, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ - KC_LGUI, LOWER, KC_ENT, KC_SPC, RAISE, KC_LALT + KC_LGUI, LOWER, KC_ENT, KC_SPC, RAISE, KC_RALT // └────────┴────────┴────────┘ └────────┴────────┴────────┘ ), [_LOWER] = LAYOUT( //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PGUP, //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - RESET, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + RESET, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PGDN, //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - KC_DEL, _______, KC_LEFT, KC_RGHT, KC_UP, KC_LBRC, KC_RBRC, KC_P4, KC_P5, KC_P6, KC_PLUS, KC_PIPE, + KC_DEL, _______, KC_LEFT, KC_RGHT, KC_UP, KC_LBRC, KC_RBRC, KC_P4, KC_P5, KC_P6, KC_PLUS, KC_HOME, //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - BL_STEP, _______, _______, _______, KC_DOWN, KC_LCBR, KC_LPRN, KC_RPRN, KC_RCBR, KC_P1, KC_P2, KC_P3, KC_MINS, _______, + BL_STEP, _______, _______, _______, KC_DOWN, KC_LCBR, KC_LPRN, KC_RPRN, KC_RCBR, KC_P1, KC_P2, KC_P3, KC_MINS, KC_END, //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ _______, _______, KC_DEL, KC_DEL, _______, KC_P0 // └────────┴────────┴────────┘ └────────┴────────┴────────┘ @@ -50,7 +50,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ RGB_TOG, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - RGB_MOD, KC_MPRV, KC_MNXT, KC_VOLU, KC_PGUP, KC_UNDS, KC_EQL, KC_HOME, RGB_HUI, RGB_SAI, RGB_VAI, KC_BSLS, + RGB_MOD, KC_MPRV, KC_MNXT, KC_VOLU, KC_PGUP, KC_UNDS, KC_EQL, KC_HOME, RGB_HUI, RGB_SAI, RGB_VAI, _______, //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ KC_MUTE, KC_MSTP, KC_MPLY, KC_VOLD, KC_PGDN, KC_MINS, KC_LPRN, _______, KC_PLUS, KC_END, RGB_HUD, RGB_SAD, RGB_VAD, _______, //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ diff --git a/keyboards/keebio/iris/keymaps/moonfall/config.h b/keyboards/keebio/iris/keymaps/moonfall/config.h new file mode 100644 index 0000000000..7986b50416 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/moonfall/config.h @@ -0,0 +1,36 @@ +/* +Copyright 2017 Danny Nguyen <danny@keeb.io> + +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 + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/keebio/iris/keymaps/moonfall/keymap.c b/keyboards/keebio/iris/keymaps/moonfall/keymap.c new file mode 100644 index 0000000000..0b6cde45e8 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/moonfall/keymap.c @@ -0,0 +1,114 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 3 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + RAISE, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_DEL, KC_ENT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + LOWER, KC_LALT, KC_BSPC, KC_SPC, KC_LGUI, KC_LCTL + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_LOWER] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_EQL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_EQL, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, KC_UP, _______, _______, _______, _______, KC_PLUS, KC_EQL, KC_TILD, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_UP, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, KC_GRV, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_GRV, _______, _______, _______, _______, KC_HOME, KC_PGUP, _______, KC_LCBR, KC_RCBR, KC_LBRC, KC_RBRC, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, KC_END, KC_PGDN, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_RAISE] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_EQL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_EQL, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, KC_UP, _______, _______, _______, _______, KC_PLUS, KC_EQL, KC_TILD, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_UP, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, KC_GRV, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_GRV, _______, _______, _______, _______, KC_HOME, KC_PGUP, _______, KC_LCBR, KC_RCBR, KC_LBRC, KC_RBRC, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, KC_END, KC_PGDN, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_ADJUST] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/keebio/iris/keymaps/moonfall/rules.mk b/keyboards/keebio/iris/keymaps/moonfall/rules.mk new file mode 100644 index 0000000000..db925dd2b6 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/moonfall/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = no diff --git a/keyboards/keebio/iris/rev3/config.h b/keyboards/keebio/iris/rev3/config.h index 70e5d6e2a5..ff0d28c73c 100644 --- a/keyboards/keebio/iris/rev3/config.h +++ b/keyboards/keebio/iris/rev3/config.h @@ -71,6 +71,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. /* ws2812 RGB LED */ #define RGB_DI_PIN F7 #define RGBLED_NUM 12 // Number of LEDs +#define RGBLED_SPLIT { 6, 6 } #define DYNAMIC_KEYMAP_LAYER_COUNT 4 diff --git a/keyboards/keebio/nyquist/rev3/config.h b/keyboards/keebio/nyquist/rev3/config.h index 18b40ecec7..3c7822def0 100644 --- a/keyboards/keebio/nyquist/rev3/config.h +++ b/keyboards/keebio/nyquist/rev3/config.h @@ -56,6 +56,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define RGB_DI_PIN B4 #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 12 +#define RGBLED_SPLIT { 6, 6 } /* Backlight LEDs */ #define BACKLIGHT_PIN B5 diff --git a/keyboards/keebio/quefrency/info.json b/keyboards/keebio/quefrency/info.json index 160e7896bb..1b50ccbe50 100644 --- a/keyboards/keebio/quefrency/info.json +++ b/keyboards/keebio/quefrency/info.json @@ -169,6 +169,201 @@ {"label":"Down", "x":15, "y":4}, {"label":"Right", "x":16, "y":4} ] + }, + "LAYOUT_60_with_macro": { + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"F6", "x":1, "y":0}, + + {"label":"Esc", "x":2.25, "y":0}, + {"label":"1", "x":3.25, "y":0}, + {"label":"2", "x":4.25, "y":0}, + {"label":"3", "x":5.25, "y":0}, + {"label":"4", "x":6.25, "y":0}, + {"label":"5", "x":7.25, "y":0}, + {"label":"6", "x":8.25, "y":0}, + + {"label":"7", "x":10.25, "y":0}, + {"label":"8", "x":11.25, "y":0}, + {"label":"9", "x":12.25, "y":0}, + {"label":"0", "x":13.25, "y":0}, + {"label":"-", "x":14.25, "y":0}, + {"label":"=", "x":15.25, "y":0}, + {"label":"Del", "x":16.25, "y":0}, + {"label":"Bksp", "x":17.25, "y":0}, + + {"label":"F2", "x":0, "y":1}, + {"label":"F7", "x":1, "y":1}, + + {"label":"Tab", "x":2.25, "y":1, "w":1.5}, + {"label":"Q", "x":3.75, "y":1}, + {"label":"W", "x":4.75, "y":1}, + {"label":"E", "x":5.75, "y":1}, + {"label":"R", "x":6.75, "y":1}, + {"label":"T", "x":7.75, "y":1}, + + {"label":"Y", "x":9.75, "y":1}, + {"label":"U", "x":10.75, "y":1}, + {"label":"I", "x":11.75, "y":1}, + {"label":"O", "x":12.75, "y":1}, + {"label":"P", "x":13.75, "y":1}, + {"label":"{", "x":14.75, "y":1}, + {"label":"}", "x":15.75, "y":1}, + {"label":"Backslash", "x":16.75, "y":1, "w":1.5}, + + {"label":"F3", "x":0, "y":2}, + {"label":"F8", "x":1, "y":2}, + + {"label":"Caps Lock", "x":2.25, "y":2, "w":1.75}, + {"label":"A", "x":4, "y":2}, + {"label":"S", "x":5, "y":2}, + {"label":"D", "x":6, "y":2}, + {"label":"F", "x":7, "y":2}, + {"label":"G", "x":8, "y":2}, + + {"label":"H", "x":10, "y":2}, + {"label":"J", "x":11, "y":2}, + {"label":"K", "x":12, "y":2}, + {"label":"L", "x":13, "y":2}, + {"label":":", "x":14, "y":2}, + {"label":"\"", "x":15, "y":2}, + {"label":"Enter", "x":16, "y":2, "w":2.25}, + + {"label":"F4", "x":0, "y":3}, + {"label":"F9", "x":1, "y":3}, + + {"label":"Shift", "x":2.25, "y":3, "w":2.25}, + {"label":"Z", "x":4.5, "y":3}, + {"label":"X", "x":5.5, "y":3}, + {"label":"C", "x":6.5, "y":3}, + {"label":"V", "x":7.5, "y":3}, + {"label":"B", "x":8.5, "y":3}, + + {"label":"N", "x":10.5, "y":3}, + {"label":"M", "x":11.5, "y":3}, + {"label":",", "x":12.5, "y":3}, + {"label":".", "x":13.5, "y":3}, + {"label":"/", "x":14.5, "y":3}, + {"label":"Shift", "x":15.5, "y":3, "w":1.75}, + {"label":"Fn", "x":17.25, "y":3}, + + {"label":"F5", "x":0, "y":4}, + {"label":"F10", "x":1, "y":4}, + + {"label":"Ctrl", "x":2.25, "y":4, "w":1.25}, + {"label":"Win", "x":3.5, "y":4, "w":1.25}, + {"label":"Alt", "x":4.75, "y":4, "w":1.25}, + {"label":"Fn", "x":6, "y":4, "w":1.25}, + {"label":"Space", "x":7.25, "y":4, "w":2.25}, + + {"label":"Fn", "x":10.5, "y":4, "w":1.25}, + {"label":"Space", "x":11.75, "y":4, "w":1.5}, + {"label":"Alt", "x":13.25, "y":4}, + {"label":"Ctrl", "x":14.25, "y":4}, + {"label":"Left", "x":15.25, "y":4}, + {"label":"Down", "x":16.25, "y":4}, + {"label":"Right", "x":17.25, "y":4} + ] + }, + "LAYOUT_65_with_macro": { + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"F6", "x":1, "y":0}, + + {"label":"Esc", "x":2.25, "y":0}, + {"label":"1", "x":3.25, "y":0}, + {"label":"2", "x":4.25, "y":0}, + {"label":"3", "x":5.25, "y":0}, + {"label":"4", "x":6.25, "y":0}, + {"label":"5", "x":7.25, "y":0}, + {"label":"6", "x":8.25, "y":0}, + + {"label":"7", "x":10.25, "y":0}, + {"label":"8", "x":11.25, "y":0}, + {"label":"9", "x":12.25, "y":0}, + {"label":"0", "x":13.25, "y":0}, + {"label":"-", "x":14.25, "y":0}, + {"label":"=", "x":15.25, "y":0}, + {"label":"=", "x":16.25, "y":0}, + {"label":"Bksp", "x":17.25, "y":0}, + {"label":"Home", "x":18.25, "y":0}, + + {"label":"F2", "x":0, "y":1}, + {"label":"F7", "x":1, "y":1}, + + {"label":"Tab", "x":2.25, "y":1, "w":1.5}, + {"label":"Q", "x":3.75, "y":1}, + {"label":"W", "x":4.75, "y":1}, + {"label":"E", "x":5.75, "y":1}, + {"label":"R", "x":6.75, "y":1}, + {"label":"T", "x":7.75, "y":1}, + + {"label":"Y", "x":9.75, "y":1}, + {"label":"U", "x":10.75, "y":1}, + {"label":"I", "x":11.75, "y":1}, + {"label":"O", "x":12.75, "y":1}, + {"label":"P", "x":13.75, "y":1}, + {"label":"{", "x":14.75, "y":1}, + {"label":"}", "x":15.75, "y":1}, + {"label":"|", "x":16.75, "y":1, "w":1.5}, + {"label":"PgUp", "x":18.25, "y":1}, + + {"label":"F3", "x":0, "y":2}, + {"label":"F8", "x":1, "y":2}, + + {"label":"Caps Lock", "x":2.25, "y":2, "w":1.75}, + {"label":"A", "x":4, "y":2}, + {"label":"S", "x":5, "y":2}, + {"label":"D", "x":6, "y":2}, + {"label":"F", "x":7, "y":2}, + {"label":"G", "x":8, "y":2}, + + {"label":"H", "x":10, "y":2}, + {"label":"J", "x":11, "y":2}, + {"label":"K", "x":12, "y":2}, + {"label":"L", "x":13, "y":2}, + {"label":":", "x":14, "y":2}, + {"label":"\"", "x":15, "y":2}, + {"label":"Enter", "x":16, "y":2, "w":2.25}, + {"label":"PgDn", "x":18.25, "y":2}, + + {"label":"F4", "x":0, "y":3}, + {"label":"F9", "x":1, "y":3}, + + {"label":"Shift", "x":2.25, "y":3, "w":2.25}, + {"label":"Z", "x":4.5, "y":3}, + {"label":"X", "x":5.5, "y":3}, + {"label":"C", "x":6.5, "y":3}, + {"label":"V", "x":7.5, "y":3}, + {"label":"B", "x":8.5, "y":3}, + + {"label":"N", "x":10.5, "y":3}, + {"label":"M", "x":11.5, "y":3}, + {"label":",", "x":12.5, "y":3}, + {"label":".", "x":13.5, "y":3}, + {"label":"/", "x":14.5, "y":3}, + {"label":"Shift", "x":15.5, "y":3, "w":1.75}, + {"label":"Up", "x":17.25, "y":3}, + {"label":"End", "x":18.25, "y":3}, + + {"label":"F5", "x":0, "y":4}, + {"label":"F10", "x":1, "y":4}, + + {"label":"Ctrl", "x":2.25, "y":4, "w":1.25}, + {"label":"Win", "x":3.5, "y":4, "w":1.25}, + {"label":"Alt", "x":4.75, "y":4, "w":1.25}, + {"label":"Fn", "x":6, "y":4, "w":1.25}, + {"label":"Space", "x":7.25, "y":4, "w":2.25}, + + {"label":"Fn", "x":10.5, "y":4, "w":1.25}, + {"label":"Space", "x":11.75, "y":4, "w":1.5}, + {"label":"Alt", "x":13.25, "y":4}, + {"label":"Ctrl", "x":14.25, "y":4}, + {"label":"Win", "x":15.25, "y":4}, + {"label":"Left", "x":16.25, "y":4}, + {"label":"Down", "x":17.25, "y":4}, + {"label":"Right", "x":18.25, "y":4} + ] + } } - } } diff --git a/keyboards/kinesis/keymaps/default/config.h b/keyboards/kinesis/keymaps/default/config.h index 8893d122e0..271f48d001 100644 --- a/keyboards/kinesis/keymaps/default/config.h +++ b/keyboards/kinesis/keymaps/default/config.h @@ -1,8 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/kira75/keymaps/default/config.h b/keyboards/kira75/keymaps/default/config.h index 2c852d1819..a3ed4f762a 100644 --- a/keyboards/kira75/keymaps/default/config.h +++ b/keyboards/kira75/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/kmac/keymaps/default/config.h b/keyboards/kmac/keymaps/default/config.h index a3828f7d5d..09b8f1bc73 100644 --- a/keyboards/kmac/keymaps/default/config.h +++ b/keyboards/kmac/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/kmac/readme.md b/keyboards/kmac/readme.md index ec36c0a5c9..cd181a5f68 100644 --- a/keyboards/kmac/readme.md +++ b/keyboards/kmac/readme.md @@ -20,7 +20,7 @@ For the full Quantum feature list, see the [documentation](https://docs.qmk.fm). The KMAC are available with two different PCB layouts, a winkey version and a winkeyless version. A default keymap are provided for each versions of the PCB. -Depending on which PCB and keymap you would like to use, you will have to compile the firmware slightly differently. All of the commands should be run in the [keyboards/kmac](/keyboards/kmac) folder. +Depending on which PCB and keymap you would like to use, you will have to compile the firmware slightly differently. All of the commands should be run in the [qmk root](https://github.com/qmk/qmk_firmware/) folder. ### Winkey keymap diff --git a/keyboards/knops/mini/keymaps/default/config.h b/keyboards/knops/mini/keymaps/default/config.h index 999d8876c2..6775ba671e 100644 --- a/keyboards/knops/mini/keymaps/default/config.h +++ b/keyboards/knops/mini/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/knops/readme.md b/keyboards/knops/readme.md index 563099b6d3..115e4d7c64 100644 --- a/keyboards/knops/readme.md +++ b/keyboards/knops/readme.md @@ -7,4 +7,4 @@ * Maintainer: [Pawnerd](https://github.com/pawnerd) * Hardware Supported: * [`Mini`](mini/): Knops Mini -* Hardware Availability: [knops.io](https://www.knops.io/)
\ No newline at end of file +* Hardware Availability: [knops.io](http://www.knops.io/)
\ No newline at end of file diff --git a/keyboards/kona_classic/keymaps/default/config.h b/keyboards/kona_classic/keymaps/default/config.h index a3828f7d5d..09b8f1bc73 100644 --- a/keyboards/kona_classic/keymaps/default/config.h +++ b/keyboards/kona_classic/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/launchpad/keymaps/default/keymap.c b/keyboards/launchpad/keymaps/default/keymap.c index da2ff292a7..c793349a5d 100644 --- a/keyboards/launchpad/keymaps/default/keymap.c +++ b/keyboards/launchpad/keymaps/default/keymap.c @@ -1,7 +1,5 @@ // Below layout is based upon /u/That-Canadian's planck layout -#include "launchpad.h" -#include "action_layer.h" -#include "eeconfig.h" +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; @@ -21,9 +19,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty * ,-------------. - * | 1 | 2 | + * | 1 | 2 | * |------+------| - * | 3 | 4 | + * | 3 | 4 | * |------+------| * | 5 | 6 | * |------+------| @@ -39,9 +37,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Function * ,-------------. - * | Q |CALDEL| + * | Q |CALDEL| * |------+------| - * | A |TSKMGR| + * | A |TSKMGR| * |------+------| * | Z | X | * |------+------| @@ -58,5 +56,5 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; void matrix_init_user(void) { - + } diff --git a/keyboards/launchpad/keymaps/default_rgb/config.h b/keyboards/launchpad/keymaps/default_rgb/config.h new file mode 100644 index 0000000000..cae1450c15 --- /dev/null +++ b/keyboards/launchpad/keymaps/default_rgb/config.h @@ -0,0 +1,9 @@ +#pragma once + +/* Underlight Configuration */ +#define RGB_DI_PIN F4 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 2 // Number of LEDs +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17
\ No newline at end of file diff --git a/keyboards/launchpad/keymaps/default_rgb/keymap.c b/keyboards/launchpad/keymaps/default_rgb/keymap.c new file mode 100644 index 0000000000..50fef532c0 --- /dev/null +++ b/keyboards/launchpad/keymaps/default_rgb/keymap.c @@ -0,0 +1,76 @@ +// Below layout is based upon /u/That-Canadian's planck layout +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _RGB 1 +#define _FUNC 15 + +// Defines for task manager and such +#define CALTDEL LCTL(LALT(KC_DEL)) +#define TSKMGR LCTL(LSFT(KC_ESC)) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-------------. + * | 1 | 2 | + * |------+------| + * | 3 | 4 | + * |------+------| + * | 5 | 6 | + * |------+------| + * | FUNC | RGB | + * `-------------' + */ + [_QWERTY] = LAYOUT( \ + KC_1, KC_2, \ + KC_3, KC_4, \ + KC_5, KC_6, \ + MO(_FUNC), TG(_RGB) \ + ), + + /* RGB + * ,-------------. + * | Mode-| Mode+| + * |------+------| + * | HUE- | HUE+ | + * |------+------| + * | SAT- | SAT+ | + * |------+------| + * |RGBTOG| | + * `-------------' + */ + [_RGB] = LAYOUT( \ + RGB_RMOD, RGB_MOD, \ + RGB_HUD, RGB_HUI, \ + RGB_SAD, RGB_SAI, \ + RGB_TOG, KC_TRNS \ + ), + + /* Function + * ,-------------. + * | Q |CALDEL| + * |------+------| + * | A |TSKMGR| + * |------+------| + * | Z | X | + * |------+------| + * | | C | + * `-------------' + */ + [_FUNC] = LAYOUT( \ + KC_Q, CALTDEL, \ + KC_A, TSKMGR, \ + KC_Z, KC_X, \ + _______, KC_C \ + ) + +}; + +void matrix_init_user(void) {} diff --git a/keyboards/launchpad/keymaps/default_rgb/readme.md b/keyboards/launchpad/keymaps/default_rgb/readme.md new file mode 100644 index 0000000000..3f15ff9bc3 --- /dev/null +++ b/keyboards/launchpad/keymaps/default_rgb/readme.md @@ -0,0 +1,41 @@ +# Launch Pad + +![Launch Pad](https://i.imgur.com/WVTe0Ku.png) + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + +A budget-minded, 4-8 key macro-pad with built in legs, plate & case. + +Supports MX & Alps switches. 2x 1u or 1x 2u supported for each row. + +Supports 2u PCB-Mount stabilizers. + +Runs off of 1x Pro Micro & 8x diodes (1n4148). + +Optional "Reset" switch can be used on the PCB. + +A fantastic project for beginners to learn to solder, veteran's of the hobby who want to add an easy macro-pad to their collection, and everyone in between. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + +Make example for this keyboard (after setting up your build environment): + + make launchpad/rev1:default + +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. + +# Under Glow + +![Underglow](https://i.imgur.com/3zFIOmu.jpg) + +SpaceCat now provides an underglow add-on kit. Please refer to the picture above for wiring. + +Make example for this keyboard (after setting up your build environment): + + make launchpad/rev1:default_rgb + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + +Due to PCB tolerance issues outside of our control, the snap-apart legs included on the PCB may need extra padding to prevent a small amount of wobbling once placed properly. We have included small, clear, and semi-permanent "glue dots" in each order (PCB Only -and- Full Kit) to help with this. You may also use plastic wrap, tape, Elmer's glue, hot glue, rubber cement, etc. We advise against using anything more "permanent" in case you wish to make changes to your Launch Pad in the future. It is also best to attach legs after all of your soldering and building is finished, to get the most accurate feel for your Launch Pad. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/keyboards/launchpad/keymaps/default_rgb/rules.mk b/keyboards/launchpad/keymaps/default_rgb/rules.mk new file mode 100644 index 0000000000..164232f339 --- /dev/null +++ b/keyboards/launchpad/keymaps/default_rgb/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
\ No newline at end of file diff --git a/keyboards/lazydesigners/the60/config.h b/keyboards/lazydesigners/the60/config.h new file mode 100644 index 0000000000..a767d1dc8a --- /dev/null +++ b/keyboards/lazydesigners/the60/config.h @@ -0,0 +1,38 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER LazyDesigners +#define PRODUCT THE60 +#define DESCRIPTION A 60% keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4 } +#define MATRIX_COL_PINS { B5, D0, D1, D2, D3, D4, D5, D6, D7, C6, C7, F4, F5, F6, F7 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ +#define BACKLIGHT_PIN B6 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 6 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* 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 diff --git a/keyboards/lazydesigners/the60/info.json b/keyboards/lazydesigners/the60/info.json new file mode 100644 index 0000000000..4fef5a098c --- /dev/null +++ b/keyboards/lazydesigners/the60/info.json @@ -0,0 +1,79 @@ +{ + "keyboard_name": "THE60", + "url": "http://lazydesigners.cn", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_split_spc_split_bspc": { + "key_count": 66, + "layout": [ + {"label":"~", "x":0, "y":0}, + {"label":"!", "x":1, "y":0}, + {"label":"@", "x":2, "y":0}, + {"label":"#", "x":3, "y":0}, + {"label":"$", "x":4, "y":0}, + {"label":"%", "x":5, "y":0}, + {"label":"^", "x":6, "y":0}, + {"label":"&", "x":7, "y":0}, + {"label":"*", "x":8, "y":0}, + {"label":"(", "x":9, "y":0}, + {"label":")", "x":10, "y":0}, + {"label":"_", "x":11, "y":0}, + {"label":"+", "x":12, "y":0}, + {"label":"Home", "x":13, "y":0}, + {"label":"Del", "x":14, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"|", "x":11.5, "y":1, "w":1.5}, + {"label":"}", "x":13, "y":1}, + {"label":"{", "x":14, "y":1}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":"Enter", "x":10.75, "y":2, "w":2.25}, + {"label":":", "x":13, "y":2}, + {"label":"\"", "x":14, "y":2}, + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":"<", "x":9.25, "y":3}, + {"label":">", "x":10.25, "y":3}, + {"label":"Shift", "x":11.25, "y":3, "w":1.75}, + {"label":"Up", "x":13, "y":3}, + {"label":"/", "x":14, "y":3}, + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"Win", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"x":3.75, "y":4, "w":2.25}, + {"x":6, "y":4, "w":2.75}, + {"label":"Alt", "x":8.75, "y":4, "w":1.25}, + {"label":"Menu", "x":10, "y":4}, + {"label":"Fn", "x":11, "y":4}, + {"label":"Left", "x":12, "y":4}, + {"label":"Down", "x":13, "y":4}, + {"label":"Right", "x":14, "y":4}] + } + } +} diff --git a/keyboards/lazydesigners/the60/keymaps/default/keymap.c b/keyboards/lazydesigners/the60/keymaps/default/keymap.c new file mode 100644 index 0000000000..8a95b44748 --- /dev/null +++ b/keyboards/lazydesigners/the60/keymaps/default/keymap.c @@ -0,0 +1,54 @@ +#include QMK_KEYBOARD_H + +enum custom_layers { + _QWERTY, + _FN +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,--------------------------------------------------------------------------. + * |Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Home|Del | + * |--------------------------------------------------------------------------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | BsPc | [ | ] | + * |--------------------------------------------------------------------------| + * |CapsLock | A | S | D | F | G | H | J | K | L | Enter | ; | ' | + * |--------------------------------------------------------------------------| + * | Shift | Z | X | C | V | B | N | M | , | . | Shift | Up | / | + * |--------------------------------------------------------------------------| + * | Ctrl | Gui | Alt | Space | Space | Alt |Menu| Fn |Left|Down|Rght| + * `--------------------------------------------------------------------------' + */ + +[_QWERTY] = LAYOUT_split_spc_split_bspc( +KC_GESC, 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_HOME, KC_DEL, +KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_LBRC, KC_RBRC, +KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, KC_SCLN, KC_QUOT, +KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, KC_UP, KC_SLSH, +KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_SPACE, KC_RALT, KC_APP, MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT +), + +/* FN + * ,--------------------------------------------------------------------------. + * |RST | | | | | | | | | | | | |End |Ins | + * |--------------------------------------------------------------------------| + * | | | | | | | | | | | | |PgUp|PgDn| + * |--------------------------------------------------------------------------| + * | | |Prev|Play|Next| |VolD|Mute|VolU| | | | | + * |--------------------------------------------------------------------------| + * | | | | | | | | | | | | | | + * |--------------------------------------------------------------------------| + * |EEPRST| | | | | | | | | | | + * `--------------------------------------------------------------------------' + */ + +[_FN] = LAYOUT_split_spc_split_bspc( +RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_END, KC_INS, +XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGUP, KC_PGDN, +XXXXXXX, XXXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, KC_VOLD, KC_MUTE, KC_VOLU, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, +XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, +EEP_RST, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX +) +}; + diff --git a/keyboards/lazydesigners/the60/keymaps/default/readme.md b/keyboards/lazydesigners/the60/keymaps/default/readme.md new file mode 100644 index 0000000000..7a5a10a34a --- /dev/null +++ b/keyboards/lazydesigners/the60/keymaps/default/readme.md @@ -0,0 +1,32 @@ +# Default keymap for THE60 + + +## QWERTY (Normal) Layer +``` + ,--------------------------------------------------------------------------. + |Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Home|Del | + |--------------------------------------------------------------------------| + | Tab | Q | W | E | R | T | Y | U | I | O | P | BsPc | [ | ] | + |--------------------------------------------------------------------------| + |CapsLock | A | S | D | F | G | H | J | K | L | Enter | ; | ' | + |--------------------------------------------------------------------------| + | Shift | Z | X | C | V | B | N | M | , | . | Shift | Up | / | + |--------------------------------------------------------------------------| + | Ctrl | Gui | Alt | Space | Space | Alt |Menu| Fn |Left|Down|Rght| + `--------------------------------------------------------------------------' +``` + +## FN layer +``` + ,--------------------------------------------------------------------------. + |RST | | | | | | | | | | | | |End |Ins | + |--------------------------------------------------------------------------| + | | | | | | | | | | | | |PgUp|PgDn| + |--------------------------------------------------------------------------| + | | |Prev|Play|Next| |VolD|Mute|VolU| | | | | + |--------------------------------------------------------------------------| + | | | | | | | | | | | | | | + |--------------------------------------------------------------------------| + |EEPRST| | | | | | | | | | | + `--------------------------------------------------------------------------' +``` diff --git a/keyboards/lazydesigners/the60/readme.md b/keyboards/lazydesigners/the60/readme.md new file mode 100644 index 0000000000..bf7cc771af --- /dev/null +++ b/keyboards/lazydesigners/the60/readme.md @@ -0,0 +1,18 @@ +# THE60 + +![THE60](https://cdn.discordapp.com/attachments/536190211240099840/549506683064287243/image0.jpg) + +A 60% custom PCB and case designed and produced by [LazyDesigners](http://lazydesigners.cn). +The PCB allows one to test a 40% layout in a 60% case. + +Keyboard Maintainer: QMK Community +Hardware Supported: THE60 PCB +Hardware Availability: Check for GBs on [Geekhack](https://geekhack.org) and on [LazyDesigner's homepage.](http://lazydesigners.cn) + +Make example for this keyboard (after setting up your build environment): + + make lazydesigners/the60:default:dfu + +To enter the bootloader, either short the pins on the PCB, use the RESET button on the FN layer or hold the Esc key while plugging in your keyboard. + +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/lazydesigners/the60/rules.mk b/keyboards/lazydesigners/the60/rules.mk new file mode 100644 index 0000000000..76fb44b2c8 --- /dev/null +++ b/keyboards/lazydesigners/the60/rules.mk @@ -0,0 +1,51 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +BOOTLOADER = atmel-dfu + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality diff --git a/keyboards/lazydesigners/the60/the60.c b/keyboards/lazydesigners/the60/the60.c new file mode 100644 index 0000000000..09eeb63cf0 --- /dev/null +++ b/keyboards/lazydesigners/the60/the60.c @@ -0,0 +1,2 @@ +#include "the60.h" + diff --git a/keyboards/lazydesigners/the60/the60.h b/keyboards/lazydesigners/the60/the60.h new file mode 100644 index 0000000000..e3708461c4 --- /dev/null +++ b/keyboards/lazydesigners/the60/the60.h @@ -0,0 +1,32 @@ +#pragma once + +#include "quantum.h" + +/* + * ,--------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | + * |--------------------------------------------------------------------------| + * | | | | | | | | | | | | | | + * |--------------------------------------------------------------------------| + * | | | | | | | | | | | | | | + * |--------------------------------------------------------------------------| + * | | | | | | | | | | | | + * `--------------------------------------------------------------------------' + */ + +#define LAYOUT_split_spc_split_bspc( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, \ + K400, K402, K403, K404, K407, K409, K410, K411, K412, K413, K414 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, KC_NO }, \ + { K400, KC_NO, K402, K403, K404, KC_NO, KC_NO, K407, KC_NO, K409, K410, K411, K412, K413, K414 } \ +} + diff --git a/keyboards/lets_split/keymaps/piemod/README.md b/keyboards/lets_split/keymaps/piemod/README.md index f2a051da14..6bae7e76d9 100644 --- a/keyboards/lets_split/keymaps/piemod/README.md +++ b/keyboards/lets_split/keymaps/piemod/README.md @@ -17,9 +17,6 @@ A keymap for users that need: Still a work-in-progress. Suggestions welcome @ https://github.com/dwrz/piemod. -### Keymap - -![PieMod Keymap](./keymap.png) ### TODO diff --git a/keyboards/lets_split/keymaps/vim-mode/config.h b/keyboards/lets_split/keymaps/vim-mode/config.h new file mode 100644 index 0000000000..25512a5c97 --- /dev/null +++ b/keyboards/lets_split/keymaps/vim-mode/config.h @@ -0,0 +1,39 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako <wakojun@gmail.com> +Copyright 2015 Jack Humbert + +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 + +// comment the following lines if sounds are not desired +#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + diff --git a/keyboards/lets_split/keymaps/vim-mode/keymap.c b/keyboards/lets_split/keymaps/vim-mode/keymap.c new file mode 100644 index 0000000000..4b25aa5dc7 --- /dev/null +++ b/keyboards/lets_split/keymaps/vim-mode/keymap.c @@ -0,0 +1,196 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_names { + _QWERTY = 0, + _COLEMAK = 1, + _DVORAK = 2, + _LOWER = 3, + _RAISE = 4, + _ADJUST = 16 +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + ADJUST, +}; + +// Fillers to make layering more clear + +// keys in multiple locations: +// - parenteses in both raise and lower +// - asterix in raise and twice on lower (normal and numpad) +// - minus/plus twice on lower (normal and numpad) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| PrtSc| GUI | Alt |Lower | Tab |Space |Raise | VolDn| VolUp| Pl/Ps| Next | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_4x12 ( \ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_LCTRL,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_PSCR, KC_LGUI, KC_LALT, LOWER, KC_TAB, KC_SPC, RAISE, KC_VOLD, KC_VOLU, KC_MPLY, KC_MNXT \ +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Ctrl | A | R | S | T | D | H | N | E | I | O | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| PrtSc| GUI | Alt |Lower | Tab |Space |Raise | VolDn| VolUp| Pl/Ps| Next | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_ortho_4x12( \ + KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_PSCR, KC_LGUI, KC_LALT, LOWER, KC_TAB, KC_SPC, RAISE, KC_VOLD, KC_VOLU, KC_MPLY, KC_MNXT \ +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Esc | ' | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Ctrl | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| PrtSc| GUI | Alt |Lower | Tab |Space |Raise | VolDn| VolUp| Pl/Ps| Next | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_ortho_4x12( \ + KC_ESC, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ + KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + ADJUST, KC_PSCR, KC_LGUI, KC_LALT, LOWER, KC_TAB, KC_SPC, RAISE, KC_VOLD, KC_VOLU, KC_MPLY, KC_MNXT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ` | | * | ( | ) | | | 7 | 8 | 9 | * | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | _ | + | { | } | | | 4 | 5 | 6 | - | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | - | = | [ | ] | | | 1 | 2 | 3 | + | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | Alt | | | | 0 | . | Enter| | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_4x12( \ + KC_GRAVE,_______, KC_ASTR, KC_LPRN, KC_RPRN, _______, _______, KC_7, KC_8, KC_9, KC_ASTR, _______, \ + KC_DEL, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______, _______, KC_4, KC_5, KC_6, KC_MINS, KC_BSLS, \ + KC_NLCK, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, _______, KC_1, KC_2, KC_3, KC_PLUS, _______, \ + _______, _______, _______, KC_LALT, _______, _______, _______, _______, KC_0, KC_DOT, KC_ENT, _______ \ +), + +/* Raise: featuring vim-style hjkl arrow keys + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | Left | Down | Up |Right | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F6 | F7 | F8 | F9 | F10 | Home | PgDn | PgUp | End | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F11 | F12 | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_4x12( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, KC_PIPE, \ + _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, \ + _______, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), + + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| |QWERTY|Colemk|Dvorak| | Prev | Pl/Ps| Next | | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Mute | VolDn| VolUp| | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_4x12( \ + _______, RESET, _______, QWERTY, COLEMAK, DVORAK, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, KC_DEL, \ + _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/lets_split/keymaps/vim-mode/readme.md b/keyboards/lets_split/keymaps/vim-mode/readme.md new file mode 100644 index 0000000000..9bb6131b1c --- /dev/null +++ b/keyboards/lets_split/keymaps/vim-mode/readme.md @@ -0,0 +1,22 @@ +# Vim-mode Keymap + +This layout is designed with the vim philosophy in mind: You should be able to do your work without lifting your hands off the keyboard. Some movement keys (like the arrow keys) have been directly borrowed from vim, and other keys (like the numpad) have been placed in easy-to-reach areas, following the vim philosophy. + +Based on the default keymap. + +## Features: + +* Vim-like `hjkl` arrow keys in raise layer. +* Right-hand numpad in lower layer. +* All brackets and the most frequently used operators are intuitively handled in the lower layer for easy access. +* Ctrl is just to the left of the left-hand pinky. +* The raise layer provides the symbol bar on the first row that you're used to. +* Media keys available in adjust layer (complete) and in the bottom-right corner of the default layer (frequently used). +* The two keys that are traditionally the keys for `space` behave differently. The right-hand key inserts a space. The left-hand key inserts a tab. This is intuitive: Both keys that would normally make up the spacebar are increasing the space, but in different manners. + + +## Some things to look out for: + +* Page up, page down, home, and end have been placed directly under the `hjkl` arrow keys, and each key moves the same direction as the key above it. (for instance, `h` moves left. Home has therefore been placed on `n`). You may ask why this was done instead of placing page down on `f` and page up on `b`. Here's why: + * In short, `f` and `b` are in prime locations for other types of keys, and using those keys for page down and page up would interrupt the space available for other keys. Using vim-style `f` and `b` would require either divide up the list of function keys with unrelated keys, which is unintuitive, or move all the function keys to another later, requiring restructuring that does not lend itself to an intuitive layout. +* Audio is not tested. If it doesn't work, please open an issue. diff --git a/keyboards/lets_split/keymaps/vim-mode/rules.mk b/keyboards/lets_split/keymaps/vim-mode/rules.mk new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/keyboards/lets_split/keymaps/vim-mode/rules.mk diff --git a/keyboards/gray_studio/hb85/i2c.h b/keyboards/lets_split_eh/keymaps/msiu/config.h index 93a69c94da..526c0837c7 100644 --- a/keyboards/gray_studio/hb85/i2c.h +++ b/keyboards/lets_split_eh/keymaps/msiu/config.h @@ -1,5 +1,8 @@ /* -Copyright 2016 Luiz Ribeiro <luizribeiro@gmail.com> +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako <wakojun@gmail.com> +Copyright 2015 Jack Humbert 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 @@ -15,13 +18,4 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -// Please do not modify this file - -#ifndef __I2C_H__ -#define __I2C_H__ - -void i2c_init(void); -void i2c_set_bitrate(uint16_t bitrate_khz); -uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length); - -#endif +#pragma once diff --git a/keyboards/lets_split_eh/keymaps/msiu/keymap.c b/keyboards/lets_split_eh/keymaps/msiu/keymap.c new file mode 100644 index 0000000000..af5c98241a --- /dev/null +++ b/keyboards/lets_split_eh/keymaps/msiu/keymap.c @@ -0,0 +1,195 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _DVORAK 1 + +#define _LOWER 3 +#define _RAISE 4 + +#define _NUMB 14 +#define _FUNC 15 +#define _ADJUST 16 + + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + DVORAK, + LOWER, + RAISE, + ADJUST +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl |Hyper | Alt | GUI |Lower | Func |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT( \ + LT(_NUMB, KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + LCTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + KC_LCTL, KC_HYPR, KC_LALT, KC_LGUI, LOWER, MO(_FUNC), KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +// Dvorak +[_DVORAK] = LAYOUT( \ + _______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, _______, \ + _______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + _______, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, _______ , \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), + + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | Esc | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } |Enter | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | Mute | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | |Lower | Bksp | Bksp |Raise | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PGDN, KC_PGUP, KC_HOME, KC_END , KC_MUTE, \ + _______, _______, _______, _______, _______, _______, KC_MPLY, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | 4 | 5 | 6 | + | F5 | F6 | - | = | [ | ] |Enter | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |Enter | 7 | 8 | 9 | - | F11 | F12 |ISO # |ISO / | Mute | | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | , | 0 | . |Lower | Bksp | Bksp |Raise | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + _______, KC_4, KC_5, KC_6, KC_PLUS, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_7, KC_8, KC_9, KC_MINS, KC_F11, KC_F12, KC_PGDN, KC_PGUP, KC_HOME, KC_END , KC_MUTE, \ + _______, _______, _______, _______, _______, _______, KC_MPLY, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * |Taskmg| | | | | | | |RGBVAI|RGBSAI|RGBHUI|caltde| + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | |Qwerty|RGBVAD|RGBSAD|RGBHUD|RGBTOG| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | |BLSTEP| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | RESET| + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT( \ + RGB_TOG, RGB_VAI, RGB_SAI, RGB_HUI, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_MOD, RGB_VAD, RGB_SAD, RGB_HUD, _______, _______, _______, QWERTY, DVORAK, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET \ +), + +/* FUNC + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | Up | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | Left | Down |Right | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Caps | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_FUNC] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, KC_PSCR, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), + +// Numpad +[_NUMB] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, _______, KC_BSPC, \ + _______, _______, _______, _______, _______, _______, _______, KC_4, KC_5, KC_6, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_1, KC_2, KC_3, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_0, KC_0, _______, _______, _______ \ +) + +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + // case QWERTY: + // if (record->event.pressed) { + // persistent_default_layer_set(1UL<<_QWERTY); + // } + // return false; + // break; + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/lfkeyboards/lfk87/keymaps/default/config.h b/keyboards/lfkeyboards/lfk87/keymaps/default/config.h index 8893d122e0..271f48d001 100644 --- a/keyboards/lfkeyboards/lfk87/keymaps/default/config.h +++ b/keyboards/lfkeyboards/lfk87/keymaps/default/config.h @@ -1,8 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/lfkeyboards/lfkpad/keymaps/default/config.h b/keyboards/lfkeyboards/lfkpad/keymaps/default/config.h index 8893d122e0..271f48d001 100644 --- a/keyboards/lfkeyboards/lfkpad/keymaps/default/config.h +++ b/keyboards/lfkeyboards/lfkpad/keymaps/default/config.h @@ -1,8 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/lfkeyboards/mini1800/keymaps/default/config.h b/keyboards/lfkeyboards/mini1800/keymaps/default/config.h index 8893d122e0..271f48d001 100644 --- a/keyboards/lfkeyboards/mini1800/keymaps/default/config.h +++ b/keyboards/lfkeyboards/mini1800/keymaps/default/config.h @@ -1,8 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/lfkeyboards/smk65/keymaps/default/config.h b/keyboards/lfkeyboards/smk65/keymaps/default/config.h index 8893d122e0..271f48d001 100644 --- a/keyboards/lfkeyboards/smk65/keymaps/default/config.h +++ b/keyboards/lfkeyboards/smk65/keymaps/default/config.h @@ -1,8 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/lily58/config.h b/keyboards/lily58/config.h index b88ec06bf4..fb1cdf3962 100644 --- a/keyboards/lily58/config.h +++ b/keyboards/lily58/config.h @@ -24,11 +24,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define USE_I2C #define USE_SERIAL -#ifdef USE_Link_Time_Optimization - // LTO has issues with macros (action_get_macro) and "functions" (fn_actions), - // so just disable them - #define NO_ACTION_MACRO - #define NO_ACTION_FUNCTION - - #define DISABLE_LEADER -#endif // USE_Link_Time_Optimization
\ No newline at end of file +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION diff --git a/keyboards/lily58/keymaps/default/keymap.c b/keyboards/lily58/keymaps/default/keymap.c index 5ff5dc3182..b8dda17d53 100644 --- a/keyboards/lily58/keymaps/default/keymap.c +++ b/keyboards/lily58/keymaps/default/keymap.c @@ -21,7 +21,7 @@ extern uint8_t is_master; #define _QWERTY 0 #define _LOWER 1 #define _RAISE 2 -#define _ADJUST 16 +#define _ADJUST 3 enum custom_keycodes { QWERTY = SAFE_RANGE, @@ -111,7 +111,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE |BackSP| RGUI | * | | | |/ / \ \ | | | | * `----------------------------' '------''--------------------' - */ + */ [_ADJUST] = LAYOUT( \ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ @@ -235,4 +235,4 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; } return true; -}
\ No newline at end of file +} diff --git a/keyboards/lily58/rev1/info.json b/keyboards/lily58/rev1/info.json new file mode 100644 index 0000000000..4a3568c3e2 --- /dev/null +++ b/keyboards/lily58/rev1/info.json @@ -0,0 +1,18 @@ +{ + "keyboard_name": "Lily58", + "url": "", + "maintainer": "F_YUUCHI", + "width": 16.5, + "height": 5.25, + "layouts": { + "LAYOUT": { + "layout": [ + {"x":0, "y":0.5}, {"x":1, "y":0.375}, {"x":2, "y":0.125}, {"x":3, "y":0}, {"x":4, "y":0.125}, {"x":5, "y":0.25}, {"x":10.5, "y":0.25}, {"x":11.5, "y":0.125}, {"x":12.5, "y":0}, {"x":13.5, "y":0.125}, {"x":14.5, "y":0.375}, {"x":15.5, "y":0.5}, + {"x":0, "y":1.5}, {"x":1, "y":1.375}, {"x":2, "y":1.125}, {"x":3, "y":1}, {"x":4, "y":1.125}, {"x":5, "y":1.25}, {"x":10.5, "y":1.25}, {"x":11.5, "y":1.125}, {"x":12.5, "y":1}, {"x":13.5, "y":1.125}, {"x":14.5, "y":1.375}, {"x":15.5, "y":1.5}, + {"x":0, "y":2.5}, {"x":1, "y":2.375}, {"x":2, "y":2.125}, {"x":3, "y":2}, {"x":4, "y":2.125}, {"x":5, "y":2.25}, {"x":10.5, "y":2.25}, {"x":11.5, "y":2.125}, {"x":12.5, "y":2}, {"x":13.5, "y":2.125}, {"x":14.5, "y":2.375}, {"x":15.5, "y":2.5}, + {"x":0, "y":3.5}, {"x":1, "y":3.375}, {"x":2, "y":3.125}, {"x":3, "y":3}, {"x":4, "y":3.125}, {"x":5, "y":3.25}, {"x":6, "y":2.75}, {"x":9.5, "y":2.75}, {"x":10.5, "y":3.25}, {"x":11.5, "y":3.125}, {"x":12.5, "y":3}, {"x":13.5, "y":3.125}, {"x":14.5, "y":3.375}, {"x":15.5, "y":3.5}, + {"x":2.5, "y":4.125}, {"x":3.5, "y":4.15}, {"x":4.5, "y":4.25}, {"x":6, "y":4.25, "h":1.5}, {"x":9.5, "y":4.25, "h":1.5}, {"x":11, "y":4.25}, {"x":12, "y":4.15}, {"x":13, "y":4.15} + ] + } + } +} diff --git a/keyboards/lily58/rules.mk b/keyboards/lily58/rules.mk index f6b922eeac..f2947c81cc 100644 --- a/keyboards/lily58/rules.mk +++ b/keyboards/lily58/rules.mk @@ -65,9 +65,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -SUBPROJECT_rev1 = no -USE_I2C = yes +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/m10a/keymaps/default/keymap.c b/keyboards/m10a/keymaps/default/keymap.c index 0c2fb62b04..2322396099 100644 --- a/keyboards/m10a/keymaps/default/keymap.c +++ b/keyboards/m10a/keymaps/default/keymap.c @@ -1,7 +1,4 @@ - -#include "m10a.h" -#include "action_layer.h" -#include "eeconfig.h" +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; diff --git a/keyboards/massdrop/alt/config.h b/keyboards/massdrop/alt/config.h index d2f73a6a8e..f63c38bf6f 100644 --- a/keyboards/massdrop/alt/config.h +++ b/keyboards/massdrop/alt/config.h @@ -119,3 +119,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION + +#define RGB_MATRIX_KEYPRESSES +#define RGB_MATRIX_LED_PROCESS_LIMIT 15 +#define RGB_MATRIX_LED_FLUSH_LIMIT 10 +#define RGB_MATRIX_EXTRA_TOG + +#include "config_led.h" diff --git a/keyboards/massdrop/alt/config_led.c b/keyboards/massdrop/alt/config_led.c new file mode 100644 index 0000000000..7d98e47c90 --- /dev/null +++ b/keyboards/massdrop/alt/config_led.c @@ -0,0 +1,148 @@ +#ifdef RGB_MATRIX_ENABLE +#include "alt.h" + +#include "led_matrix.h" +#include "rgb_matrix.h" +#include "config_led.h" + +// This table can be almost-automatically derived from ISSI3733_LED_MAP that is +// defined in config_led.h + +// You can calculate the (0-244, 0-64) x/y values from the x/y values defined in +// ISSI3733_LED_MAP with the following formula: +// uint8_t rgb_x = ((ISSI3733_LED_MAP[i].x - MIN_X) / (MAX_X - MIN_X)) * 224; +// uint8_t rgb_y = ((ISSI3733_LED_MAP[i].y - MIN_Y) / (MAX_Y - MIN_Y)) * 64; +// Where the min/max vars are the minimum and maximum "bounds" of x/y values +// present in ISSI3733_LED_MAP +// +// The row/col values need to be manually tweaked though, compensating for the +// "empty" cells that are a product of larger keys +// +// There is a quick-and-dirty implementation of this under ledvis.html + +const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { + /* 0 */ { { (0)|(0 << 4) }, { 8, 56 }, 0 }, // KC_ESC + /* 1 */ { { (0)|(1 << 4) }, { 22, 56 }, 0 }, // KC_1 + /* 2 */ { { (0)|(2 << 4) }, { 35, 56 }, 0 }, // KC_2 + /* 3 */ { { (0)|(3 << 4) }, { 49, 56 }, 0 }, // KC_3 + /* 4 */ { { (0)|(4 << 4) }, { 63, 56 }, 0 }, // KC_4 + /* 5 */ { { (0)|(5 << 4) }, { 77, 56 }, 0 }, // KC_5 + /* 6 */ { { (0)|(6 << 4) }, { 91, 56 }, 0 }, // KC_6 + /* 7 */ { { (0)|(7 << 4) }, { 105, 56 }, 0 }, // KC_7 + /* 8 */ { { (0)|(8 << 4) }, { 118, 56 }, 0 }, // KC_8 + /* 9 */ { { (0)|(9 << 4) }, { 132, 56 }, 0 }, // KC_9 + /* 10 */ { { (0)|(10 << 4) }, { 146, 56 }, 0 }, // KC_0 + /* 11 */ { { (0)|(11 << 4) }, { 160, 56 }, 0 }, // KC_MINS + /* 12 */ { { (0)|(12 << 4) }, { 174, 56 }, 0 }, // KC_EQL + /* 13 */ { { (0)|(13 << 4) }, { 195, 56 }, 0 }, // KC_BSPC + /* 14 */ { { (0)|(14 << 4) }, { 215, 56 }, 0 }, // KC_DEL + /* 15 */ { { (1)|(0 << 4) }, { 11, 44 }, 0 }, // KC_TAB + /* 16 */ { { (1)|(1 << 4) }, { 28, 44 }, 0 }, // KC_Q + /* 17 */ { { (1)|(2 << 4) }, { 42, 44 }, 0 }, // KC_W + /* 18 */ { { (1)|(3 << 4) }, { 56, 44 }, 0 }, // KC_E + /* 19 */ { { (1)|(4 << 4) }, { 70, 44 }, 0 }, // KC_R + /* 20 */ { { (1)|(5 << 4) }, { 84, 44 }, 0 }, // KC_T + /* 21 */ { { (1)|(6 << 4) }, { 98, 44 }, 0 }, // KC_Y + /* 22 */ { { (1)|(7 << 4) }, { 112, 44 }, 0 }, // KC_U + /* 23 */ { { (1)|(8 << 4) }, { 125, 44 }, 0 }, // KC_I + /* 24 */ { { (1)|(9 << 4) }, { 139, 44 }, 0 }, // KC_O + /* 25 */ { { (1)|(10 << 4) }, { 153, 44 }, 0 }, // KC_P + /* 26 */ { { (1)|(11 << 4) }, { 167, 44 }, 0 }, // KC_LBRC + /* 27 */ { { (1)|(12 << 4) }, { 181, 44 }, 0 }, // KC_RBRC + /* 28 */ { { (1)|(13 << 4) }, { 198, 44 }, 0 }, // KC_BSLS + /* 29 */ { { (1)|(14 << 4) }, { 215, 44 }, 0 }, // KC_HOME + /* 30 */ { { (2)|(0 << 4) }, { 13, 32 }, 1 }, // KC_CAPS + /* 31 */ { { (2)|(1 << 4) }, { 32, 32 }, 0 }, // KC_A + /* 32 */ { { (2)|(2 << 4) }, { 46, 32 }, 0 }, // KC_S + /* 33 */ { { (2)|(3 << 4) }, { 60, 32 }, 0 }, // KC_D + /* 34 */ { { (2)|(4 << 4) }, { 73, 32 }, 0 }, // KC_F + /* 35 */ { { (2)|(5 << 4) }, { 87, 32 }, 0 }, // KC_G + /* 36 */ { { (2)|(6 << 4) }, { 101, 32 }, 0 }, // KC_H + /* 37 */ { { (2)|(7 << 4) }, { 115, 32 }, 0 }, // KC_J + /* 38 */ { { (2)|(8 << 4) }, { 129, 32 }, 0 }, // KC_K + /* 39 */ { { (2)|(9 << 4) }, { 143, 32 }, 0 }, // KC_L + /* 40 */ { { (2)|(10 << 4) }, { 156, 32 }, 0 }, // KC_SCLN + /* 41 */ { { (2)|(11 << 4) }, { 170, 32 }, 0 }, // KC_QUOT + /* _________________________________________ */ // ____ + /* 42 */ { { (2)|(13 << 4) }, { 193, 32 }, 0 }, // KC_ENT + /* 43 */ { { (2)|(14 << 4) }, { 215, 32 }, 0 }, // KC_PGUP + /* 44 */ { { (3)|(0 << 4) }, { 16, 19 }, 0 }, // KC_LSFT + /* 45 */ { { (3)|(2 << 4) }, { 39, 19 }, 0 }, // KC_Z + /* 46 */ { { (3)|(3 << 4) }, { 53, 19 }, 0 }, // KC_X + /* 47 */ { { (3)|(4 << 4) }, { 67, 19 }, 0 }, // KC_C + /* 48 */ { { (3)|(5 << 4) }, { 80, 19 }, 0 }, // KC_V + /* 49 */ { { (3)|(6 << 4) }, { 94, 19 }, 0 }, // KC_B + /* 50 */ { { (3)|(7 << 4) }, { 108, 19 }, 0 }, // KC_N + /* 51 */ { { (3)|(8 << 4) }, { 122, 19 }, 0 }, // KC_M + /* 52 */ { { (3)|(9 << 4) }, { 136, 19 }, 0 }, // KC_COMM + /* 53 */ { { (3)|(10 << 4) }, { 150, 19 }, 0 }, // KC_DOT + /* 54 */ { { (3)|(11 << 4) }, { 163, 19 }, 0 }, // KC_SLSH + /* 55 */ { { (3)|(12 << 4) }, { 182, 19 }, 0 }, // KC_RSFT + /* _________________________________________ */ // ____ + /* 56 */ { { (3)|(13 << 4) }, { 201, 19 }, 0 }, // KC_UP + /* 57 */ { { (3)|(14 << 4) }, { 215, 19 }, 0 }, // KC_PGDN + /* 58 */ { { (4)|(0 << 4) }, { 9, 7 }, 0 }, // KC_LCTL + /* 59 */ { { (4)|(1 << 4) }, { 27, 7 }, 0 }, // KC_LGUI + /* 60 */ { { (4)|(2 << 4) }, { 44, 7 }, 0 }, // KC_LALT + /* _________________________________________ */ // ____ + /* _________________________________________ */ // ____ + /* _________________________________________ */ // ____ + /* 61 */ { { (4)|(6 << 4) }, { 96, 7 }, 0 }, // KC_SPC + /* _________________________________________ */ // ____ + /* _________________________________________ */ // ____ + /* _________________________________________ */ // ____ + /* 62 */ { { (4)|(10 << 4) }, { 148, 7 }, 0 }, // KC_RALT + /* 63 */ { { (4)|(11 << 4) }, { 165, 7 }, 0 }, // MO(1) + /* 64 */ { { (4)|(12 << 4) }, { 188, 7 }, 0 }, // KC_LEFT + /* 65 */ { { (4)|(13 << 4) }, { 201, 7 }, 0 }, // KC_DOWN + /* 66 */ { { (4)|(14 << 4) }, { 215, 7 }, 0 }, // KC_RGHT + + // Underglow LEDs + { { 255 }, { 1, 1 }, 0 }, + { { 255 }, { 15, 0 }, 0 }, + { { 255 }, { 31, 0 }, 0 }, + { { 255 }, { 47, 0 }, 0 }, + { { 255 }, { 63, 0 }, 0 }, + { { 255 }, { 79, 0 }, 0 }, + { { 255 }, { 95, 0 }, 0 }, + { { 255 }, { 112, 0 }, 0 }, + { { 255 }, { 128, 0 }, 0 }, + { { 255 }, { 144, 0 }, 0 }, + { { 255 }, { 160, 0 }, 0 }, + { { 255 }, { 176, 0 }, 0 }, + { { 255 }, { 192, 0 }, 0 }, + { { 255 }, { 208, 0 }, 0 }, + { { 255 }, { 222, 1 }, 0 }, + { { 255 }, { 224, 13 }, 0 }, + { { 255 }, { 224, 25 }, 0 }, + { { 255 }, { 224, 38 }, 0 }, + { { 255 }, { 224, 50 }, 0 }, + { { 255 }, { 222, 62 }, 0 }, + { { 255 }, { 191, 64 }, 0 }, + { { 255 }, { 179, 64 }, 0 }, + { { 255 }, { 167, 64 }, 0 }, + { { 255 }, { 153, 64 }, 0 }, + { { 255 }, { 139, 64 }, 0 }, + { { 255 }, { 125, 64 }, 0 }, + { { 255 }, { 112, 64 }, 0 }, + { { 255 }, { 98, 64 }, 0 }, + { { 255 }, { 84, 64 }, 0 }, + { { 255 }, { 70, 64 }, 0 }, + { { 255 }, { 56, 64 }, 0 }, + { { 255 }, { 42, 64 }, 0 }, + { { 255 }, { 28, 64 }, 0 }, + { { 255 }, { 1, 62 }, 0 }, + { { 255 }, { 0, 50 }, 0 }, + { { 255 }, { 0, 38 }, 0 }, + { { 255 }, { 0, 25 }, 0 }, + { { 255 }, { 0, 13 }, 0 }, +}; + +#ifdef USB_LED_INDICATOR_ENABLE +void rgb_matrix_indicators_kb(void) +{ + led_matrix_indicators(); +} +#endif // USB_LED_INDICATOR_ENABLE + +#endif diff --git a/keyboards/massdrop/alt/config_led.h b/keyboards/massdrop/alt/config_led.h index a049e38179..82117b3327 100644 --- a/keyboards/massdrop/alt/config_led.h +++ b/keyboards/massdrop/alt/config_led.h @@ -15,11 +15,11 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef _config_led_h_ -#define _config_led_h_ +#pragma once //Define number of ISSI3733 drivers being used (1...16) #define ISSI3733_DRIVER_COUNT 2 +#define DRIVER_LED_TOTAL ISSI3733_LED_COUNT //Hardware address of each driver (Refer to ISSI3733 pdf "Table 1 Slave Address" and keyboard schematic) #define ISSI3773_DRIVER_ADDRESSES { 0xA0, 0xBE } @@ -30,21 +30,24 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. //Count of LED bodies #define ISSI3733_LED_COUNT 105 -//Default Global Current Register value (Default brightness 0 - 255) -#define ISSI3733_GCR_DEFAULT 128 - #define LED_GCR_MAX 165 //Max GCR value (0 - 255) WARNING: Raising this value may overload the LED drivers and USB bus #define LED_GCR_STEP 10 //GCR increment/decrement value -//Automatic power rollback and recovery -#define V5_HIGH 2540 //5V high level (After low power detect, point at which LEDs are allowed to use more power ) -#define V5_LOW 2480 //5V low level (LED power rolled back to stay above this limit) -#define V5_CAT 2200 //5V catastrophic level (Host USB port potential to shut down) - +#ifdef USE_MASSDROP_CONFIGURATOR #define ANIMATION_SPEED_STEP 1 +#define BREATHE_STEP 1 #define BREATHE_MIN_STEP 0 #define BREATHE_MAX_STEP 255 +#endif + +//Default Global Current Register value (Default brightness 0 - 255) +#define ISSI3733_GCR_DEFAULT LED_GCR_MAX + +//Automatic power rollback and recovery +#define V5_HIGH 2540 //5V high level (After low power detect, point at which LEDs are allowed to use more power ) +#define V5_LOW 2480 //5V low level (LED power rolled back to stay above this limit) +#define V5_CAT 2200 //5V catastrophic level (Host USB port potential to shut down) //LED Mapping - More practically generated from a spreadsheet program //id: ID of the LED (Sync with PCB callouts) @@ -174,5 +177,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define USB_LED_COMPOSE_SCANCODE 255 #define USB_LED_KANA_SCANCODE 255 #endif //USB_LED_INDICATOR_ENABLE - -#endif //_config_led_h_ diff --git a/keyboards/massdrop/alt/keymaps/abishalom/keymap.c b/keyboards/massdrop/alt/keymaps/abishalom/keymap.c index 10bc62c1f0..a4519d4049 100644 --- a/keyboards/massdrop/alt/keymaps/abishalom/keymap.c +++ b/keyboards/massdrop/alt/keymaps/abishalom/keymap.c @@ -1,25 +1,13 @@ #include QMK_KEYBOARD_H enum alt_keycodes { - L_BRI = SAFE_RANGE, //LED Brightness Increase - L_BRD, //LED Brightness Decrease - L_PTN, //LED Pattern Select Next - L_PTP, //LED Pattern Select Previous - L_PSI, //LED Pattern Speed Increase - L_PSD, //LED Pattern Speed Decrease - L_T_MD, //LED Toggle Mode - L_T_ONF, //LED Toggle On / Off - L_ON, //LED On - L_OFF, //LED Off - L_T_BR, //LED Toggle Breath Effect - L_T_PTD, //LED Toggle Scrolling Pattern Direction - U_T_AUTO, //USB Extra Port Toggle Auto Detect / Always Active - U_T_AGCR, //USB Toggle Automatic GCR control - DBG_TOG, //DEBUG Toggle On / Off - DBG_MTRX, //DEBUG Toggle Matrix Prints - DBG_KBD, //DEBUG Toggle Keyboard Prints - DBG_MOU, //DEBUG Toggle Mouse Prints - MD_BOOT, //Restart into bootloader after hold timeout + U_T_AUTO = SAFE_RANGE, //USB Extra Port Toggle Auto Detect / Always Active + U_T_AGCR, //USB Toggle Automatic GCR control + DBG_TOG, //DEBUG Toggle On / Off + DBG_MTRX, //DEBUG Toggle Matrix Prints + DBG_KBD, //DEBUG Toggle Keyboard Prints + DBG_MOU, //DEBUG Toggle Mouse Prints + MD_BOOT, //Restart into bootloader after hold timeout }; #define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode @@ -35,19 +23,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT \ ), [1] = LAYOUT( - KC_GRV, 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_TRNS, KC_MUTE, \ - L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_END, \ - L_T_PTD, L_PTP, L_BRD, L_PTN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, \ - KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, MD_BOOT, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_VOLD, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END \ + KC_GRV, 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_MUTE, \ + _______, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, U_T_AUTO,U_T_AGCR,_______, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_END, \ + _______, RGB_RMOD,RGB_VAD, RGB_MOD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, \ + _______, RGB_TOG, _______, _______, _______, MD_BOOT, TG_NKRO, DBG_TOG, _______, _______, _______, _______, KC_PGUP, KC_VOLD, \ + _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \ ), /* [X] = LAYOUT( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), */ }; @@ -68,82 +56,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { static uint32_t key_timer; switch (keycode) { - case L_BRI: - if (record->event.pressed) { - if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX; - else gcr_desired += LED_GCR_STEP; - if (led_animation_breathing) gcr_breathe = gcr_desired; - } - return false; - case L_BRD: - if (record->event.pressed) { - if (LED_GCR_STEP > gcr_desired) gcr_desired = 0; - else gcr_desired -= LED_GCR_STEP; - if (led_animation_breathing) gcr_breathe = gcr_desired; - } - return false; - case L_PTN: - if (record->event.pressed) { - if (led_animation_id == led_setups_count - 1) led_animation_id = 0; - else led_animation_id++; - } - return false; - case L_PTP: - if (record->event.pressed) { - if (led_animation_id == 0) led_animation_id = led_setups_count - 1; - else led_animation_id--; - } - return false; - case L_PSI: - if (record->event.pressed) { - led_animation_speed += ANIMATION_SPEED_STEP; - } - return false; - case L_PSD: - if (record->event.pressed) { - led_animation_speed -= ANIMATION_SPEED_STEP; - if (led_animation_speed < 0) led_animation_speed = 0; - } - return false; - case L_T_MD: - if (record->event.pressed) { - led_lighting_mode++; - if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL; - } - return false; - case L_T_ONF: - if (record->event.pressed) { - led_enabled = !led_enabled; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_ON: - if (record->event.pressed) { - led_enabled = 1; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_OFF: - if (record->event.pressed) { - led_enabled = 0; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_T_BR: - if (record->event.pressed) { - led_animation_breathing = !led_animation_breathing; - if (led_animation_breathing) { - gcr_breathe = gcr_desired; - led_animation_breathe_cur = BREATHE_MIN_STEP; - breathe_dir = 1; - } - } - return false; - case L_T_PTD: - if (record->event.pressed) { - led_animation_direction = !led_animation_direction; - } - return false; case U_T_AUTO: if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode"); diff --git a/keyboards/massdrop/alt/keymaps/default/keymap.c b/keyboards/massdrop/alt/keymaps/default/keymap.c index 10bc62c1f0..a4519d4049 100644 --- a/keyboards/massdrop/alt/keymaps/default/keymap.c +++ b/keyboards/massdrop/alt/keymaps/default/keymap.c @@ -1,25 +1,13 @@ #include QMK_KEYBOARD_H enum alt_keycodes { - L_BRI = SAFE_RANGE, //LED Brightness Increase - L_BRD, //LED Brightness Decrease - L_PTN, //LED Pattern Select Next - L_PTP, //LED Pattern Select Previous - L_PSI, //LED Pattern Speed Increase - L_PSD, //LED Pattern Speed Decrease - L_T_MD, //LED Toggle Mode - L_T_ONF, //LED Toggle On / Off - L_ON, //LED On - L_OFF, //LED Off - L_T_BR, //LED Toggle Breath Effect - L_T_PTD, //LED Toggle Scrolling Pattern Direction - U_T_AUTO, //USB Extra Port Toggle Auto Detect / Always Active - U_T_AGCR, //USB Toggle Automatic GCR control - DBG_TOG, //DEBUG Toggle On / Off - DBG_MTRX, //DEBUG Toggle Matrix Prints - DBG_KBD, //DEBUG Toggle Keyboard Prints - DBG_MOU, //DEBUG Toggle Mouse Prints - MD_BOOT, //Restart into bootloader after hold timeout + U_T_AUTO = SAFE_RANGE, //USB Extra Port Toggle Auto Detect / Always Active + U_T_AGCR, //USB Toggle Automatic GCR control + DBG_TOG, //DEBUG Toggle On / Off + DBG_MTRX, //DEBUG Toggle Matrix Prints + DBG_KBD, //DEBUG Toggle Keyboard Prints + DBG_MOU, //DEBUG Toggle Mouse Prints + MD_BOOT, //Restart into bootloader after hold timeout }; #define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode @@ -35,19 +23,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT \ ), [1] = LAYOUT( - KC_GRV, 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_TRNS, KC_MUTE, \ - L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_END, \ - L_T_PTD, L_PTP, L_BRD, L_PTN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, \ - KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, MD_BOOT, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_VOLD, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END \ + KC_GRV, 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_MUTE, \ + _______, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, U_T_AUTO,U_T_AGCR,_______, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_END, \ + _______, RGB_RMOD,RGB_VAD, RGB_MOD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, \ + _______, RGB_TOG, _______, _______, _______, MD_BOOT, TG_NKRO, DBG_TOG, _______, _______, _______, _______, KC_PGUP, KC_VOLD, \ + _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \ ), /* [X] = LAYOUT( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), */ }; @@ -68,82 +56,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { static uint32_t key_timer; switch (keycode) { - case L_BRI: - if (record->event.pressed) { - if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX; - else gcr_desired += LED_GCR_STEP; - if (led_animation_breathing) gcr_breathe = gcr_desired; - } - return false; - case L_BRD: - if (record->event.pressed) { - if (LED_GCR_STEP > gcr_desired) gcr_desired = 0; - else gcr_desired -= LED_GCR_STEP; - if (led_animation_breathing) gcr_breathe = gcr_desired; - } - return false; - case L_PTN: - if (record->event.pressed) { - if (led_animation_id == led_setups_count - 1) led_animation_id = 0; - else led_animation_id++; - } - return false; - case L_PTP: - if (record->event.pressed) { - if (led_animation_id == 0) led_animation_id = led_setups_count - 1; - else led_animation_id--; - } - return false; - case L_PSI: - if (record->event.pressed) { - led_animation_speed += ANIMATION_SPEED_STEP; - } - return false; - case L_PSD: - if (record->event.pressed) { - led_animation_speed -= ANIMATION_SPEED_STEP; - if (led_animation_speed < 0) led_animation_speed = 0; - } - return false; - case L_T_MD: - if (record->event.pressed) { - led_lighting_mode++; - if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL; - } - return false; - case L_T_ONF: - if (record->event.pressed) { - led_enabled = !led_enabled; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_ON: - if (record->event.pressed) { - led_enabled = 1; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_OFF: - if (record->event.pressed) { - led_enabled = 0; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_T_BR: - if (record->event.pressed) { - led_animation_breathing = !led_animation_breathing; - if (led_animation_breathing) { - gcr_breathe = gcr_desired; - led_animation_breathe_cur = BREATHE_MIN_STEP; - breathe_dir = 1; - } - } - return false; - case L_T_PTD: - if (record->event.pressed) { - led_animation_direction = !led_animation_direction; - } - return false; case U_T_AUTO: if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode"); diff --git a/keyboards/massdrop/alt/keymaps/default_md/keymap.c b/keyboards/massdrop/alt/keymaps/default_md/keymap.c new file mode 100644 index 0000000000..7969583df4 --- /dev/null +++ b/keyboards/massdrop/alt/keymaps/default_md/keymap.c @@ -0,0 +1,223 @@ +#include QMK_KEYBOARD_H + +enum alt_keycodes { + L_BRI = SAFE_RANGE, //LED Brightness Increase //Working + L_BRD, //LED Brightness Decrease //Working + L_PTN, //LED Pattern Select Next //Working + L_PTP, //LED Pattern Select Previous //Working + L_PSI, //LED Pattern Speed Increase //Working + L_PSD, //LED Pattern Speed Decrease //Working + L_T_MD, //LED Toggle Mode //Working + L_T_ONF, //LED Toggle On / Off //Broken + L_ON, //LED On //Broken + L_OFF, //LED Off //Broken + L_T_BR, //LED Toggle Breath Effect //Working + L_T_PTD, //LED Toggle Scrolling Pattern Direction //Working + U_T_AGCR, //USB Toggle Automatic GCR control //Working + DBG_TOG, //DEBUG Toggle On / Off // + DBG_MTRX, //DEBUG Toggle Matrix Prints // + DBG_KBD, //DEBUG Toggle Keyboard Prints // + DBG_MOU, //DEBUG Toggle Mouse Prints // + MD_BOOT //Restart into bootloader after hold timeout //Working +}; + +#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode + +keymap_config_t keymap_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, 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_DEL, \ + 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_HOME, \ + 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, \ + 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, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [1] = LAYOUT( + KC_GRV, 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_MUTE, \ + L_T_BR, L_PSD, L_BRI, L_PSI, _______, _______, _______, _______, U_T_AGCR,_______, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_END, \ + L_T_PTD, L_PTP, L_BRD, L_PTN, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, \ + _______, L_T_MD, L_T_ONF, _______, _______, MD_BOOT, TG_NKRO, _______, _______, _______, _______, _______, KC_PGUP, KC_VOLD, \ + _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \ + ), + /* + [X] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + */ +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { +}; + +#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL)) +#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT)) + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static uint32_t key_timer; + + switch (keycode) { + case L_BRI: + if (record->event.pressed) { + if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX; + else gcr_desired += LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_BRD: + if (record->event.pressed) { + if (LED_GCR_STEP > gcr_desired) gcr_desired = 0; + else gcr_desired -= LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_PTN: + if (record->event.pressed) { + if (led_animation_id == led_setups_count - 1) led_animation_id = 0; + else led_animation_id++; + } + return false; + case L_PTP: + if (record->event.pressed) { + if (led_animation_id == 0) led_animation_id = led_setups_count - 1; + else led_animation_id--; + } + return false; + case L_PSI: + if (record->event.pressed) { + led_animation_speed += ANIMATION_SPEED_STEP; + } + return false; + case L_PSD: + if (record->event.pressed) { + led_animation_speed -= ANIMATION_SPEED_STEP; + if (led_animation_speed < 0) led_animation_speed = 0; + } + return false; + case L_T_MD: + if (record->event.pressed) { + led_lighting_mode++; + if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL; + } + return false; + case L_T_ONF: + if (record->event.pressed) { + led_enabled = !led_enabled; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_ON: + if (record->event.pressed) { + led_enabled = 1; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_OFF: + if (record->event.pressed) { + led_enabled = 0; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_T_BR: + if (record->event.pressed) { + led_animation_breathing = !led_animation_breathing; + if (led_animation_breathing) { + gcr_breathe = gcr_desired; + led_animation_breathe_cur = BREATHE_MIN_STEP; + breathe_dir = 1; + } + } + return false; + case L_T_PTD: + if (record->event.pressed) { + led_animation_direction = !led_animation_direction; + } + return false; + case U_T_AGCR: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode"); + } + return false; + case DBG_TOG: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode"); + } + return false; + case DBG_MTRX: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_matrix, "Debug matrix"); + } + return false; + case DBG_KBD: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_keyboard, "Debug keyboard"); + } + return false; + case DBG_MOU: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_mouse, "Debug mouse"); + } + return false; + case MD_BOOT: + if (record->event.pressed) { + key_timer = timer_read32(); + } else { + if (timer_elapsed32(key_timer) >= 500) { + reset_keyboard(); + } + } + return false; + default: + return true; //Process all other keycodes normally + } +} + +led_instruction_t led_instructions[] = { + //LEDs are normally inactive, no processing is performed on them + //Flags are used in matching criteria for an LED to be active and indicate how to color it + //Flags can be found in tmk_core/protocol/arm_atsam/led_matrix.h (prefixed with LED_FLAG_) + //LED IDs can be found in config_led.h in the keyboard's directory + //Examples are below + + //All LEDs use the user's selected pattern (this is the factory default) + { .flags = LED_FLAG_USE_ROTATE_PATTERN }, + + //Specific LEDs use the user's selected pattern while all others are off + // { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_ROTATE_PATTERN, .id0 = 0xFFFFFFFF, .id1 = 0xAAAAAAAA, .id2 = 0x55555555, .id3 = 0x11111111 }, + + //Specific LEDs use specified RGB values while all others are off + // { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_RGB, .id0 = 0xFF, .id1 = 0x00FF, .id2 = 0x0000FF00, .id3 = 0xFF000000, .r = 75, .g = 150, .b = 225 }, + + //All LEDs use the user's selected pattern + //On layer 1, all key LEDs (except the top row which keeps active pattern) are red while all edge LEDs are green + //When layer 1 is active, key LEDs use red (id0 32 - 16: 1111 1111 1111 1111 1000 0000 0000 0000 = 0xFFFF8000) (except top row 15 - 1) + //When layer 1 is active, key LEDs use red (id1 64 - 33: 1111 1111 1111 1111 1111 1111 1111 1111 = 0xFFFFFFFF) + //When layer 1 is active, key LEDs use red (id2 67 - 65: 0000 0000 0000 0000 0000 0000 0000 0111 = 0x00000007) + //When layer 1 is active, edge LEDs use green (id2 95 - 68: 1111 1111 1111 1111 1111 1111 1111 1000 = 0xFFFFFFF8) + //When layer 1 is active, edge LEDs use green (id3 105 - 96: 0000 0000 0000 0000 0000 0011 1111 1111 = 0x000003FF) + // { .flags = LED_FLAG_USE_ROTATE_PATTERN }, + // { .flags = LED_FLAG_MATCH_ID | LED_FLAG_MATCH_LAYER | LED_FLAG_USE_RGB, .id0 = 0xFFFF8000, .id1 = 0xFFFFFFFF, .id2 = 0x00000007, .r = 255, .layer = 1 }, + // { .flags = LED_FLAG_MATCH_ID | LED_FLAG_MATCH_LAYER | LED_FLAG_USE_RGB, .id2 = 0xFFFFFFF8, .id3 = 0x000003FF, .g = 127, .layer = 1 }, + + //All key LEDs use red while edge LEDs use the active pattern + //All key LEDs use red (id0 32 - 1: 1111 1111 1111 1111 1111 1111 1111 1111 = 0xFFFFFFFF) + //All key LEDs use red (id1 64 - 33: 1111 1111 1111 1111 1111 1111 1111 1111 = 0xFFFFFFFF) + //All key LEDs use red (id2 67 - 65: 0000 0000 0000 0000 0000 0000 0000 0111 = 0x00000007) + //Edge uses active pattern (id2 95 - 68: 1111 1111 1111 1111 1111 1111 1111 1000 = 0xFFFFFFF8) + //Edge uses active pattern (id3 105 - 96: 0000 0000 0000 0000 0000 0011 1111 1111 = 0x000003FF) + // { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_RGB, .id0 = 0xFFFFFFFF, .id1 = 0xFFFFFFFF, .id2 = 0x00000007, .r = 255 }, + // { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_ROTATE_PATTERN , .id2 = 0xFFFFFFF8, .id3 = 0x000003FF }, + + //end must be set to 1 to indicate end of instruction set + { .end = 1 } +}; diff --git a/keyboards/massdrop/alt/keymaps/default_md/rules.mk b/keyboards/massdrop/alt/keymaps/default_md/rules.mk new file mode 100644 index 0000000000..064a6f54c1 --- /dev/null +++ b/keyboards/massdrop/alt/keymaps/default_md/rules.mk @@ -0,0 +1,2 @@ +# This keymap requires Massdrop Configurator support +OPT_DEFS += -DUSE_MASSDROP_CONFIGURATOR diff --git a/keyboards/massdrop/alt/keymaps/mac/keymap.c b/keyboards/massdrop/alt/keymaps/mac/keymap.c index 639eb2da75..26a1c6d014 100644 --- a/keyboards/massdrop/alt/keymaps/mac/keymap.c +++ b/keyboards/massdrop/alt/keymaps/mac/keymap.c @@ -1,25 +1,13 @@ #include QMK_KEYBOARD_H enum alt_keycodes { - L_BRI = SAFE_RANGE, //LED Brightness Increase - L_BRD, //LED Brightness Decrease - L_PTN, //LED Pattern Select Next - L_PTP, //LED Pattern Select Previous - L_PSI, //LED Pattern Speed Increase - L_PSD, //LED Pattern Speed Decrease - L_T_MD, //LED Toggle Mode - L_T_ONF, //LED Toggle On / Off - L_ON, //LED On - L_OFF, //LED Off - L_T_BR, //LED Toggle Breath Effect - L_T_PTD, //LED Toggle Scrolling Pattern Direction - U_T_AUTO, //USB Extra Port Toggle Auto Detect / Always Active - U_T_AGCR, //USB Toggle Automatic GCR control - DBG_TOG, //DEBUG Toggle On / Off - DBG_MTRX, //DEBUG Toggle Matrix Prints - DBG_KBD, //DEBUG Toggle Keyboard Prints - DBG_MOU, //DEBUG Toggle Mouse Prints - MD_BOOT, //Restart into bootloader after hold timeout + U_T_AUTO = SAFE_RANGE, //USB Extra Port Toggle Auto Detect / Always Active + U_T_AGCR, //USB Toggle Automatic GCR control + DBG_TOG, //DEBUG Toggle On / Off + DBG_MTRX, //DEBUG Toggle Matrix Prints + DBG_KBD, //DEBUG Toggle Keyboard Prints + DBG_MOU, //DEBUG Toggle Mouse Prints + MD_BOOT, //Restart into bootloader after hold timeout }; #define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode @@ -35,19 +23,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(1), KC_LEFT, KC_DOWN, KC_RGHT \ ), [1] = LAYOUT( - KC_GRV, 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_TRNS, KC_MUTE, \ - L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_END, \ - L_T_PTD, L_PTP, L_BRD, L_PTN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, \ - KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, MD_BOOT, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_VOLD, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END \ + KC_GRV, 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_MUTE, \ + _______, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, U_T_AUTO,U_T_AGCR,_______, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_END, \ + _______, RGB_RMOD,RGB_VAD, RGB_MOD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, \ + _______, RGB_TOG, _______, _______, _______, MD_BOOT, TG_NKRO, DBG_TOG, _______, _______, _______, _______, KC_PGUP, KC_VOLD, \ + _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \ ), /* [X] = LAYOUT( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), */ }; @@ -68,82 +56,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { static uint32_t key_timer; switch (keycode) { - case L_BRI: - if (record->event.pressed) { - if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX; - else gcr_desired += LED_GCR_STEP; - if (led_animation_breathing) gcr_breathe = gcr_desired; - } - return false; - case L_BRD: - if (record->event.pressed) { - if (LED_GCR_STEP > gcr_desired) gcr_desired = 0; - else gcr_desired -= LED_GCR_STEP; - if (led_animation_breathing) gcr_breathe = gcr_desired; - } - return false; - case L_PTN: - if (record->event.pressed) { - if (led_animation_id == led_setups_count - 1) led_animation_id = 0; - else led_animation_id++; - } - return false; - case L_PTP: - if (record->event.pressed) { - if (led_animation_id == 0) led_animation_id = led_setups_count - 1; - else led_animation_id--; - } - return false; - case L_PSI: - if (record->event.pressed) { - led_animation_speed += ANIMATION_SPEED_STEP; - } - return false; - case L_PSD: - if (record->event.pressed) { - led_animation_speed -= ANIMATION_SPEED_STEP; - if (led_animation_speed < 0) led_animation_speed = 0; - } - return false; - case L_T_MD: - if (record->event.pressed) { - led_lighting_mode++; - if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL; - } - return false; - case L_T_ONF: - if (record->event.pressed) { - led_enabled = !led_enabled; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_ON: - if (record->event.pressed) { - led_enabled = 1; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_OFF: - if (record->event.pressed) { - led_enabled = 0; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_T_BR: - if (record->event.pressed) { - led_animation_breathing = !led_animation_breathing; - if (led_animation_breathing) { - gcr_breathe = gcr_desired; - led_animation_breathe_cur = BREATHE_MIN_STEP; - breathe_dir = 1; - } - } - return false; - case L_T_PTD: - if (record->event.pressed) { - led_animation_direction = !led_animation_direction; - } - return false; case U_T_AUTO: if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode"); diff --git a/keyboards/massdrop/alt/keymaps/mac_md/keymap.c b/keyboards/massdrop/alt/keymaps/mac_md/keymap.c new file mode 100644 index 0000000000..8a052cc250 --- /dev/null +++ b/keyboards/massdrop/alt/keymaps/mac_md/keymap.c @@ -0,0 +1,193 @@ +#include QMK_KEYBOARD_H + +enum alt_keycodes { + L_BRI = SAFE_RANGE, //LED Brightness Increase //Working + L_BRD, //LED Brightness Decrease //Working + L_PTN, //LED Pattern Select Next //Working + L_PTP, //LED Pattern Select Previous //Working + L_PSI, //LED Pattern Speed Increase //Working + L_PSD, //LED Pattern Speed Decrease //Working + L_T_MD, //LED Toggle Mode //Working + L_T_ONF, //LED Toggle On / Off //Broken + L_ON, //LED On //Broken + L_OFF, //LED Off //Broken + L_T_BR, //LED Toggle Breath Effect //Working + L_T_PTD, //LED Toggle Scrolling Pattern Direction //Working + U_T_AGCR, //USB Toggle Automatic GCR control //Working + DBG_TOG, //DEBUG Toggle On / Off // + DBG_MTRX, //DEBUG Toggle Matrix Prints // + DBG_KBD, //DEBUG Toggle Keyboard Prints // + DBG_MOU, //DEBUG Toggle Mouse Prints // + MD_BOOT //Restart into bootloader after hold timeout //Working +}; + +#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode + +keymap_config_t keymap_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, 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_DEL, \ + 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_HOME, \ + 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, \ + 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, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(1), KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [1] = LAYOUT( + KC_GRV, 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_MUTE, \ + L_T_BR, L_PSD, L_BRI, L_PSI, _______, _______, _______, _______, U_T_AGCR,_______, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_END, \ + L_T_PTD, L_PTP, L_BRD, L_PTN, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, \ + _______, L_T_MD, L_T_ONF, _______, _______, MD_BOOT, TG_NKRO, _______, _______, _______, _______, _______, KC_PGUP, KC_VOLD, \ + _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \ + ), + /* + [X] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + */ +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { +}; + +#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL)) +#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT)) + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static uint32_t key_timer; + + switch (keycode) { + case L_BRI: + if (record->event.pressed) { + if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX; + else gcr_desired += LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_BRD: + if (record->event.pressed) { + if (LED_GCR_STEP > gcr_desired) gcr_desired = 0; + else gcr_desired -= LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_PTN: + if (record->event.pressed) { + if (led_animation_id == led_setups_count - 1) led_animation_id = 0; + else led_animation_id++; + } + return false; + case L_PTP: + if (record->event.pressed) { + if (led_animation_id == 0) led_animation_id = led_setups_count - 1; + else led_animation_id--; + } + return false; + case L_PSI: + if (record->event.pressed) { + led_animation_speed += ANIMATION_SPEED_STEP; + } + return false; + case L_PSD: + if (record->event.pressed) { + led_animation_speed -= ANIMATION_SPEED_STEP; + if (led_animation_speed < 0) led_animation_speed = 0; + } + return false; + case L_T_MD: + if (record->event.pressed) { + led_lighting_mode++; + if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL; + } + return false; + case L_T_ONF: + if (record->event.pressed) { + led_enabled = !led_enabled; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_ON: + if (record->event.pressed) { + led_enabled = 1; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_OFF: + if (record->event.pressed) { + led_enabled = 0; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_T_BR: + if (record->event.pressed) { + led_animation_breathing = !led_animation_breathing; + if (led_animation_breathing) { + gcr_breathe = gcr_desired; + led_animation_breathe_cur = BREATHE_MIN_STEP; + breathe_dir = 1; + } + } + return false; + case L_T_PTD: + if (record->event.pressed) { + led_animation_direction = !led_animation_direction; + } + return false; + case U_T_AGCR: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode"); + } + return false; + case DBG_TOG: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode"); + } + return false; + case DBG_MTRX: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_matrix, "Debug matrix"); + } + return false; + case DBG_KBD: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_keyboard, "Debug keyboard"); + } + return false; + case DBG_MOU: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_mouse, "Debug mouse"); + } + return false; + case MD_BOOT: + if (record->event.pressed) { + key_timer = timer_read32(); + } else { + if (timer_elapsed32(key_timer) >= 500) { + reset_keyboard(); + } + } + return false; + default: + return true; //Process all other keycodes normally + } +} + +led_instruction_t led_instructions[] = { + //Please see ../default_md/keymap.c for examples + + //All LEDs use the user's selected pattern (this is the factory default) + { .flags = LED_FLAG_USE_ROTATE_PATTERN }, + + //end must be set to 1 to indicate end of instruction set + { .end = 1 } +}; diff --git a/keyboards/massdrop/alt/keymaps/mac_md/rules.mk b/keyboards/massdrop/alt/keymaps/mac_md/rules.mk new file mode 100644 index 0000000000..064a6f54c1 --- /dev/null +++ b/keyboards/massdrop/alt/keymaps/mac_md/rules.mk @@ -0,0 +1,2 @@ +# This keymap requires Massdrop Configurator support +OPT_DEFS += -DUSE_MASSDROP_CONFIGURATOR diff --git a/keyboards/massdrop/alt/keymaps/reywood/README.md b/keyboards/massdrop/alt/keymaps/reywood/README.md new file mode 100644 index 0000000000..5ee630dfb8 --- /dev/null +++ b/keyboards/massdrop/alt/keymaps/reywood/README.md @@ -0,0 +1,5 @@ +# THIS KEYMAP IS BROKEN + +The CTRL and ALT have both been switched to using the QMK RGB Matrix system, +rendering any custom effects that used the old, custom Massdrop lighting system, +BROKEN. diff --git a/keyboards/massdrop/alt/keymaps/reywood/rules.mk b/keyboards/massdrop/alt/keymaps/reywood/rules.mk index b5b961a0f3..956d1c700c 100644 --- a/keyboards/massdrop/alt/keymaps/reywood/rules.mk +++ b/keyboards/massdrop/alt/keymaps/reywood/rules.mk @@ -1,6 +1,4 @@ # project specific files -SRC = led_programs.c -SRC += matrix.c SRC += rgb_matrix_user.c #For platform and packs @@ -32,3 +30,6 @@ HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) VIRTSER_ENABLE = no # USB Serial Driver RAW_ENABLE = no # Raw device AUTO_SHIFT_ENABLE = no # Auto Shift + +# This keymap requires Massdrop Configurator support +OPT_DEFS += -DUSE_MASSDROP_CONFIGURATOR diff --git a/keyboards/massdrop/alt/led_programs.c b/keyboards/massdrop/alt/led_programs.c deleted file mode 100644 index b3b7a7e90e..0000000000 --- a/keyboards/massdrop/alt/led_programs.c +++ /dev/null @@ -1,120 +0,0 @@ -/* -Copyright 2018 Massdrop Inc. - -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 "alt.h" -#include "led_matrix.h" - -//Teal <-> Salmon -led_setup_t leds_teal_salmon[] = { - { .hs = 0, .he = 33, .rs = 24, .re = 24, .gs = 215, .ge = 215, .bs = 204, .be = 204, .ef = EF_NONE }, - { .hs = 33, .he = 66, .rs = 24, .re = 255, .gs = 215, .ge = 114, .bs = 204, .be = 118, .ef = EF_NONE }, - { .hs = 66, .he = 100, .rs = 255, .re = 255, .gs = 114, .ge = 114, .bs = 118, .be = 118, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Yellow -led_setup_t leds_yellow[] = { - { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Off -led_setup_t leds_off[] = { - { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Red -led_setup_t leds_red[] = { - { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Green -led_setup_t leds_green[] = { - { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Blue -led_setup_t leds_blue[] = { - { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_NONE }, - { .end = 1 }, -}; - -//White -led_setup_t leds_white[] = { - { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 255, .be = 255, .ef = EF_NONE }, - { .end = 1 }, -}; - -//White with moving red stripe -led_setup_t leds_white_with_red_stripe[] = { - { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 255, .be = 255, .ef = EF_NONE }, - { .hs = 0, .he = 15, .rs = 0, .re = 0, .gs = 0, .ge = 255, .bs = 0, .be = 255, .ef = EF_SCR_R | EF_SUBTRACT }, - { .hs = 15, .he = 30, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 0, .ef = EF_SCR_R | EF_SUBTRACT }, - { .end = 1 }, -}; - -//Black with moving red stripe -led_setup_t leds_black_with_red_stripe[] = { - { .hs = 0, .he = 15, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_SCR_R }, - { .hs = 15, .he = 30, .rs = 255, .re = 0, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_SCR_R }, - { .end = 1 }, -}; - -//Rainbow no scrolling -led_setup_t leds_rainbow_ns[] = { - { .hs = 0, .he = 16.67, .rs = 255, .re = 255, .gs = 0, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER }, - { .hs = 16.67, .he = 33.33, .rs = 255, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER }, - { .hs = 33.33, .he = 50, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 255, .ef = EF_OVER }, - { .hs = 50, .he = 66.67, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER }, - { .hs = 66.67, .he = 83.33, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER }, - { .hs = 83.33, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 0, .ef = EF_OVER }, - { .end = 1 }, -}; - -//Rainbow scrolling -led_setup_t leds_rainbow_s[] = { - { .hs = 0, .he = 16.67, .rs = 255, .re = 255, .gs = 0, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER | EF_SCR_R }, - { .hs = 16.67, .he = 33.33, .rs = 255, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER | EF_SCR_R }, - { .hs = 33.33, .he = 50, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 255, .ef = EF_OVER | EF_SCR_R }, - { .hs = 50, .he = 66.67, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER | EF_SCR_R }, - { .hs = 66.67, .he = 83.33, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER | EF_SCR_R }, - { .hs = 83.33, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 0, .ef = EF_OVER | EF_SCR_R }, - { .end = 1 }, -}; - -//Add new LED animations here using one from above as example -//The last entry must be { .end = 1 } -//Add the new animation name to the list below following its format - -void *led_setups[] = { - leds_rainbow_s, - leds_rainbow_ns, - leds_teal_salmon, - leds_yellow, - leds_red, - leds_green, - leds_blue, - leds_white, - leds_white_with_red_stripe, - leds_black_with_red_stripe, - leds_off -}; - -const uint8_t led_setups_count = sizeof(led_setups) / sizeof(led_setups[0]); diff --git a/keyboards/massdrop/alt/rules.mk b/keyboards/massdrop/alt/rules.mk index c5539158f5..aa45c68056 100644 --- a/keyboards/massdrop/alt/rules.mk +++ b/keyboards/massdrop/alt/rules.mk @@ -1,6 +1,6 @@ # project specific files -SRC = led_programs.c -SRC += matrix.c +SRC = matrix.c +SRC += config_led.c #For platform and packs ARM_ATSAM = SAMD51J18A @@ -31,3 +31,6 @@ HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) VIRTSER_ENABLE = no # USB Serial Driver RAW_ENABLE = no # Raw device AUTO_SHIFT_ENABLE = no # Auto Shift + +# Custom RGB matrix handling +RGB_MATRIX_ENABLE = custom diff --git a/keyboards/massdrop/ctrl/config.h b/keyboards/massdrop/ctrl/config.h index 71ccac0f39..df2e509216 100644 --- a/keyboards/massdrop/ctrl/config.h +++ b/keyboards/massdrop/ctrl/config.h @@ -119,3 +119,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION + +#define RGB_MATRIX_KEYPRESSES +#define RGB_MATRIX_LED_PROCESS_LIMIT 15 +#define RGB_MATRIX_LED_FLUSH_LIMIT 10 +#define RGB_MATRIX_EXTRA_TOG + +#include "config_led.h" diff --git a/keyboards/massdrop/ctrl/config_led.c b/keyboards/massdrop/ctrl/config_led.c new file mode 100644 index 0000000000..afdbf3a222 --- /dev/null +++ b/keyboards/massdrop/ctrl/config_led.c @@ -0,0 +1,144 @@ +#ifdef RGB_MATRIX_ENABLE +#include "ctrl.h" + +#include "led_matrix.h" +#include "rgb_matrix.h" +#include "config_led.h" + +const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { + // 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_PSCR, KC_SLCK, KC_PAUS + { { 0|(0<<4) }, { 7, 5 }, 0 }, + { { 0|(1<<4) }, { 31, 5 }, 0 }, + { { 0|(2<<4) }, { 43, 5 }, 0 }, + { { 0|(3<<4) }, { 55, 5 }, 0 }, + { { 0|(4<<4) }, { 67, 5 }, 0 }, + { { 0|(5<<4) }, { 85, 5 }, 0 }, + { { 0|(6<<4) }, { 97, 5 }, 0 }, + { { 0|(7<<4) }, { 109, 5 }, 0 }, + { { 6|(0<<4) }, { 121, 5 }, 0 }, + { { 6|(1<<4) }, { 139, 5 }, 0 }, + { { 6|(2<<4) }, { 151, 5 }, 0 }, + { { 6|(3<<4) }, { 163, 5 }, 0 }, + { { 6|(4<<4) }, { 175, 5 }, 0 }, + { { 6|(5<<4) }, { 193, 5 }, 0 }, + { { 6|(6<<4) }, { 205, 5 }, 1 }, + { { 6|(7<<4) }, { 217, 5 }, 0 }, + // 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, KC_HOME, KC_PGUP + { { 1|(0<<4) }, { 7, 20 }, 0 }, + { { 1|(1<<4) }, { 19, 20 }, 0 }, + { { 1|(2<<4) }, { 31, 20 }, 0 }, + { { 1|(3<<4) }, { 43, 20 }, 0 }, + { { 1|(4<<4) }, { 55, 20 }, 0 }, + { { 1|(5<<4) }, { 67, 20 }, 0 }, + { { 1|(6<<4) }, { 79, 20 }, 0 }, + { { 1|(7<<4) }, { 91, 20 }, 0 }, + { { 7|(0<<4) }, { 103, 20 }, 0 }, + { { 7|(1<<4) }, { 115, 20 }, 0 }, + { { 7|(2<<4) }, { 127, 20 }, 0 }, + { { 7|(3<<4) }, { 139, 20 }, 0 }, + { { 7|(4<<4) }, { 151, 20 }, 0 }, + { { 7|(5<<4) }, { 169, 20 }, 0 }, + { { 7|(6<<4) }, { 193, 20 }, 0 }, + { { 7|(7<<4) }, { 205, 20 }, 0 }, + { { 9|(7<<4) }, { 217, 20 }, 0 }, + // 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, KC_END, KC_PGDN + { { 2|(0<<4) }, { 10, 30 }, 0 }, + { { 2|(1<<4) }, { 25, 30 }, 0 }, + { { 2|(2<<4) }, { 37, 30 }, 0 }, + { { 2|(3<<4) }, { 49, 30 }, 0 }, + { { 2|(4<<4) }, { 61, 30 }, 0 }, + { { 2|(5<<4) }, { 73, 30 }, 0 }, + { { 2|(6<<4) }, { 85, 30 }, 0 }, + { { 2|(7<<4) }, { 97, 30 }, 0 }, + { { 8|(0<<4) }, { 109, 30 }, 0 }, + { { 8|(1<<4) }, { 121, 30 }, 0 }, + { { 8|(2<<4) }, { 133, 30 }, 0 }, + { { 8|(3<<4) }, { 145, 30 }, 0 }, + { { 8|(4<<4) }, { 157, 30 }, 0 }, + { { 8|(5<<4) }, { 172, 30 }, 0 }, + { { 8|(6<<4) }, { 193, 30 }, 0 }, + { { 8|(7<<4) }, { 205, 30 }, 0 }, + { { 9|(6<<4) }, { 217, 30 }, 0 }, + // 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 + { { 3|(0<<4) }, { 11, 39 }, 1 }, + { { 3|(1<<4) }, { 28, 39 }, 0 }, + { { 3|(2<<4) }, { 40, 39 }, 0 }, + { { 3|(3<<4) }, { 52, 39 }, 0 }, + { { 3|(4<<4) }, { 64, 39 }, 0 }, + { { 3|(5<<4) }, { 76, 39 }, 0 }, + { { 3|(6<<4) }, { 88, 39 }, 0 }, + { { 3|(7<<4) }, { 100, 39 }, 0 }, + { { 9|(0<<4) }, { 112, 39 }, 0 }, + { { 9|(1<<4) }, { 124, 39 }, 0 }, + { { 9|(2<<4) }, { 136, 39 }, 0 }, + { { 9|(3<<4) }, { 148, 39 }, 0 }, + { { 9|(4<<4) }, { 168, 39 }, 0 }, + // 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 + { { 4|(0<<4) }, { 14, 49 }, 0 }, + { { 4|(1<<4) }, { 34, 49 }, 0 }, + { { 4|(2<<4) }, { 46, 49 }, 0 }, + { { 4|(3<<4) }, { 58, 49 }, 0 }, + { { 4|(4<<4) }, { 70, 49 }, 0 }, + { { 4|(5<<4) }, { 82, 49 }, 0 }, + { { 4|(6<<4) }, { 94, 49 }, 0 }, + { { 4|(7<<4) }, { 106, 49 }, 0 }, + { { 10|(0<<4) }, { 118, 49 }, 0 }, + { { 10|(1<<4) }, { 130, 49 }, 0 }, + { { 10|(2<<4) }, { 142, 49 }, 0 }, + { { 10|(3<<4) }, { 165, 49 }, 0 }, + { { 9|(5<<4) }, { 205, 49 }, 0 }, + // KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + { { 5|(0<<4) }, { 8, 59 }, 0 }, + { { 5|(1<<4) }, { 23, 59 }, 0 }, + { { 5|(2<<4) }, { 38, 59 }, 0 }, + { { 5|(3<<4) }, { 83, 59 }, 0 }, + { { 5|(4<<4) }, { 129, 59 }, 0 }, + { { 5|(5<<4) }, { 144, 59 }, 0 }, + { { 5|(6<<4) }, { 159, 59 }, 0 }, + { { 5|(7<<4) }, { 174, 59 }, 0 }, + { { 10|(4<<4) }, { 193, 59 }, 0 }, + { { 10|(5<<4) }, { 205, 59 }, 0 }, + { { 10|(6<<4) }, { 217, 59 }, 0 }, + // Underglow / Border + { { 0xFF }, { 222, 64 }, 0 }, + { { 0xFF }, { 204, 64 }, 0 }, + { { 0xFF }, { 186, 64 }, 0 }, + { { 0xFF }, { 167, 64 }, 0 }, + { { 0xFF }, { 149, 64 }, 0 }, + { { 0xFF }, { 130, 64 }, 0 }, + { { 0xFF }, { 112, 64 }, 0 }, + { { 0xFF }, { 94, 64 }, 0 }, + { { 0xFF }, { 75, 64 }, 0 }, + { { 0xFF }, { 57, 64 }, 0 }, + { { 0xFF }, { 38, 64 }, 0 }, + { { 0xFF }, { 20, 64 }, 0 }, + { { 0xFF }, { 0, 64 }, 0 }, + { { 0xFF }, { 0, 47 }, 0 }, + { { 0xFF }, { 0, 32 }, 0 }, + { { 0xFF }, { 0, 17 }, 0 }, + { { 0xFF }, { 0, 0 }, 0 }, + { { 0xFF }, { 20, 0 }, 0 }, + { { 0xFF }, { 38, 0 }, 0 }, + { { 0xFF }, { 57, 0 }, 0 }, + { { 0xFF }, { 75, 0 }, 0 }, + { { 0xFF }, { 94, 0 }, 0 }, + { { 0xFF }, { 112, 0 }, 0 }, + { { 0xFF }, { 130, 0 }, 0 }, + { { 0xFF }, { 149, 0 }, 0 }, + { { 0xFF }, { 167, 0 }, 0 }, + { { 0xFF }, { 186, 0 }, 0 }, + { { 0xFF }, { 204, 0 }, 0 }, + { { 0xFF }, { 222, 1 }, 0 }, + { { 0xFF }, { 224, 17 }, 0 }, + { { 0xFF }, { 224, 32 }, 0 }, + { { 0xFF }, { 224, 47 }, 0 }, +}; + +#ifdef USB_LED_INDICATOR_ENABLE +void rgb_matrix_indicators_kb(void) +{ + led_matrix_indicators(); +} +#endif // USB_LED_INDICATOR_ENABLE + +#endif diff --git a/keyboards/massdrop/ctrl/config_led.h b/keyboards/massdrop/ctrl/config_led.h index 471ab7007d..0c91a0c80b 100644 --- a/keyboards/massdrop/ctrl/config_led.h +++ b/keyboards/massdrop/ctrl/config_led.h @@ -15,11 +15,11 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef _config_led_h_ -#define _config_led_h_ +#pragma once //Define number of ISSI3733 drivers being used (1...16) #define ISSI3733_DRIVER_COUNT 2 +#define DRIVER_LED_TOTAL ISSI3733_LED_COUNT //Hardware address of each driver (Refer to ISSI3733 pdf "Table 1 Slave Address" and keyboard schematic) #define ISSI3773_DRIVER_ADDRESSES { 0xA0, 0xBE } @@ -30,21 +30,24 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. //Count of LED bodies #define ISSI3733_LED_COUNT 119 -//Default Global Current Register value (Default brightness 0 - 255) -#define ISSI3733_GCR_DEFAULT 128 - #define LED_GCR_MAX 165 //Max GCR value (0 - 255) WARNING: Raising this value may overload the LED drivers and USB bus #define LED_GCR_STEP 10 //GCR increment/decrement value -//Automatic power rollback and recovery -#define V5_HIGH 2540 //5V high level (After low power detect, point at which LEDs are allowed to use more power ) -#define V5_LOW 2480 //5V low level (LED power rolled back to stay above this limit) -#define V5_CAT 2200 //5V catastrophic level (Host USB port potential to shut down) - +#ifdef USE_MASSDROP_CONFIGURATOR #define ANIMATION_SPEED_STEP 1 +#define BREATHE_STEP 1 #define BREATHE_MIN_STEP 0 #define BREATHE_MAX_STEP 255 +#endif + +//Default Global Current Register value (Default brightness 0 - 255) +#define ISSI3733_GCR_DEFAULT LED_GCR_MAX + +//Automatic power rollback and recovery +#define V5_HIGH 2540 //5V high level (After low power detect, point at which LEDs are allowed to use more power ) +#define V5_LOW 2480 //5V low level (LED power rolled back to stay above this limit) +#define V5_CAT 2200 //5V catastrophic level (Host USB port potential to shut down) //LED Mapping - More practically generated from a spreadsheet program //id: ID of the LED (Sync with PCB callouts) @@ -187,5 +190,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define USB_LED_COMPOSE_SCANCODE 255 #define USB_LED_KANA_SCANCODE 255 #endif //USB_LED_INDICATOR_ENABLE - -#endif //_config_led_h_ diff --git a/keyboards/massdrop/ctrl/keymaps/default/keymap.c b/keyboards/massdrop/ctrl/keymaps/default/keymap.c index cdb627f9c4..182abbbad4 100644 --- a/keyboards/massdrop/ctrl/keymaps/default/keymap.c +++ b/keyboards/massdrop/ctrl/keymaps/default/keymap.c @@ -1,25 +1,13 @@ #include QMK_KEYBOARD_H enum ctrl_keycodes { - L_BRI = SAFE_RANGE, //LED Brightness Increase - L_BRD, //LED Brightness Decrease - L_PTN, //LED Pattern Select Next - L_PTP, //LED Pattern Select Previous - L_PSI, //LED Pattern Speed Increase - L_PSD, //LED Pattern Speed Decrease - L_T_MD, //LED Toggle Mode - L_T_ONF, //LED Toggle On / Off - L_ON, //LED On - L_OFF, //LED Off - L_T_BR, //LED Toggle Breath Effect - L_T_PTD, //LED Toggle Scrolling Pattern Direction - U_T_AUTO, //USB Extra Port Toggle Auto Detect / Always Active - U_T_AGCR, //USB Toggle Automatic GCR control - DBG_TOG, //DEBUG Toggle On / Off - DBG_MTRX, //DEBUG Toggle Matrix Prints - DBG_KBD, //DEBUG Toggle Keyboard Prints - DBG_MOU, //DEBUG Toggle Mouse Prints - MD_BOOT, //Restart into bootloader after hold timeout + U_T_AUTO = SAFE_RANGE, //USB Extra Port Toggle Auto Detect / Always Active + U_T_AGCR, //USB Toggle Automatic GCR control + DBG_TOG, //DEBUG Toggle On / Off + DBG_MTRX, //DEBUG Toggle Matrix Prints + DBG_KBD, //DEBUG Toggle Keyboard Prints + DBG_MOU, //DEBUG Toggle Mouse Prints + MD_BOOT, //Restart into bootloader after hold timeout }; #define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode @@ -36,21 +24,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ ), [1] = LAYOUT( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MSTP, KC_VOLU, \ - L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_VOLD, \ - L_T_PTD, L_PTP, L_BRD, L_PTN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, MD_BOOT, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MSTP, KC_VOLU, \ + _______, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, U_T_AUTO,U_T_AGCR,_______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, \ + _______, RGB_RMOD,RGB_VAD, RGB_MOD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, \ + _______, RGB_TOG, _______, _______, _______, MD_BOOT, TG_NKRO, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), /* [X] = LAYOUT( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, TG_NKRO, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), */ }; @@ -71,82 +59,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { static uint32_t key_timer; switch (keycode) { - case L_BRI: - if (record->event.pressed) { - if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX; - else gcr_desired += LED_GCR_STEP; - if (led_animation_breathing) gcr_breathe = gcr_desired; - } - return false; - case L_BRD: - if (record->event.pressed) { - if (LED_GCR_STEP > gcr_desired) gcr_desired = 0; - else gcr_desired -= LED_GCR_STEP; - if (led_animation_breathing) gcr_breathe = gcr_desired; - } - return false; - case L_PTN: - if (record->event.pressed) { - if (led_animation_id == led_setups_count - 1) led_animation_id = 0; - else led_animation_id++; - } - return false; - case L_PTP: - if (record->event.pressed) { - if (led_animation_id == 0) led_animation_id = led_setups_count - 1; - else led_animation_id--; - } - return false; - case L_PSI: - if (record->event.pressed) { - led_animation_speed += ANIMATION_SPEED_STEP; - } - return false; - case L_PSD: - if (record->event.pressed) { - led_animation_speed -= ANIMATION_SPEED_STEP; - if (led_animation_speed < 0) led_animation_speed = 0; - } - return false; - case L_T_MD: - if (record->event.pressed) { - led_lighting_mode++; - if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL; - } - return false; - case L_T_ONF: - if (record->event.pressed) { - led_enabled = !led_enabled; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_ON: - if (record->event.pressed) { - led_enabled = 1; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_OFF: - if (record->event.pressed) { - led_enabled = 0; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_T_BR: - if (record->event.pressed) { - led_animation_breathing = !led_animation_breathing; - if (led_animation_breathing) { - gcr_breathe = gcr_desired; - led_animation_breathe_cur = BREATHE_MIN_STEP; - breathe_dir = 1; - } - } - return false; - case L_T_PTD: - if (record->event.pressed) { - led_animation_direction = !led_animation_direction; - } - return false; case U_T_AUTO: if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode"); diff --git a/keyboards/massdrop/ctrl/keymaps/default_md/keymap.c b/keyboards/massdrop/ctrl/keymaps/default_md/keymap.c new file mode 100644 index 0000000000..16f88ffe1d --- /dev/null +++ b/keyboards/massdrop/ctrl/keymaps/default_md/keymap.c @@ -0,0 +1,226 @@ +#include QMK_KEYBOARD_H + +enum ctrl_keycodes { + L_BRI = SAFE_RANGE, //LED Brightness Increase //Working + L_BRD, //LED Brightness Decrease //Working + L_PTN, //LED Pattern Select Next //Working + L_PTP, //LED Pattern Select Previous //Working + L_PSI, //LED Pattern Speed Increase //Working + L_PSD, //LED Pattern Speed Decrease //Working + L_T_MD, //LED Toggle Mode //Working + L_T_ONF, //LED Toggle On / Off //Broken + L_ON, //LED On //Broken + L_OFF, //LED Off //Broken + L_T_BR, //LED Toggle Breath Effect //Working + L_T_PTD, //LED Toggle Scrolling Pattern Direction //Working + U_T_AGCR, //USB Toggle Automatic GCR control //Working + DBG_TOG, //DEBUG Toggle On / Off // + DBG_MTRX, //DEBUG Toggle Matrix Prints // + DBG_KBD, //DEBUG Toggle Keyboard Prints // + DBG_MOU, //DEBUG Toggle Mouse Prints // + MD_BOOT //Restart into bootloader after hold timeout //Working +}; + +#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode + +keymap_config_t keymap_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + 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_PSCR, KC_SLCK, KC_PAUS, \ + 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, KC_HOME, KC_PGUP, \ + 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, KC_END, KC_PGDN, \ + 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_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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [1] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MSTP, KC_VOLU, \ + L_T_BR, L_PSD, L_BRI, L_PSI, _______, _______, _______, _______, U_T_AGCR,_______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, \ + L_T_PTD, L_PTP, L_BRD, L_PTN, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, L_T_MD, L_T_ONF, _______, _______, MD_BOOT, TG_NKRO, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + /* + [X] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, TG_NKRO, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + */ +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { +}; + +#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL)) +#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT)) + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static uint32_t key_timer; + + switch (keycode) { + case L_BRI: + if (record->event.pressed) { + if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX; + else gcr_desired += LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_BRD: + if (record->event.pressed) { + if (LED_GCR_STEP > gcr_desired) gcr_desired = 0; + else gcr_desired -= LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_PTN: + if (record->event.pressed) { + if (led_animation_id == led_setups_count - 1) led_animation_id = 0; + else led_animation_id++; + } + return false; + case L_PTP: + if (record->event.pressed) { + if (led_animation_id == 0) led_animation_id = led_setups_count - 1; + else led_animation_id--; + } + return false; + case L_PSI: + if (record->event.pressed) { + led_animation_speed += ANIMATION_SPEED_STEP; + } + return false; + case L_PSD: + if (record->event.pressed) { + led_animation_speed -= ANIMATION_SPEED_STEP; + if (led_animation_speed < 0) led_animation_speed = 0; + } + return false; + case L_T_MD: + if (record->event.pressed) { + led_lighting_mode++; + if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL; + } + return false; + case L_T_ONF: + if (record->event.pressed) { + led_enabled = !led_enabled; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_ON: + if (record->event.pressed) { + led_enabled = 1; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_OFF: + if (record->event.pressed) { + led_enabled = 0; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_T_BR: + if (record->event.pressed) { + led_animation_breathing = !led_animation_breathing; + if (led_animation_breathing) { + gcr_breathe = gcr_desired; + led_animation_breathe_cur = BREATHE_MIN_STEP; + breathe_dir = 1; + } + } + return false; + case L_T_PTD: + if (record->event.pressed) { + led_animation_direction = !led_animation_direction; + } + return false; + case U_T_AGCR: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode"); + } + return false; + case DBG_TOG: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode"); + } + return false; + case DBG_MTRX: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_matrix, "Debug matrix"); + } + return false; + case DBG_KBD: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_keyboard, "Debug keyboard"); + } + return false; + case DBG_MOU: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_mouse, "Debug mouse"); + } + return false; + case MD_BOOT: + if (record->event.pressed) { + key_timer = timer_read32(); + } else { + if (timer_elapsed32(key_timer) >= 500) { + reset_keyboard(); + } + } + return false; + default: + return true; //Process all other keycodes normally + } +} + +led_instruction_t led_instructions[] = { + //LEDs are normally inactive, no processing is performed on them + //Flags are used in matching criteria for an LED to be active and indicate how to color it + //Flags can be found in tmk_core/protocol/arm_atsam/led_matrix.h (prefixed with LED_FLAG_) + //LED IDs can be found in config_led.h in the keyboard's directory + //Examples are below + + //All LEDs use the user's selected pattern (this is the factory default) + { .flags = LED_FLAG_USE_ROTATE_PATTERN }, + + //Specific LEDs use the user's selected pattern while all others are off + // { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_ROTATE_PATTERN, .id0 = 0xFFFFFFFF, .id1 = 0xAAAAAAAA, .id2 = 0x55555555, .id3 = 0x11111111 }, + + //Specific LEDs use specified RGB values while all others are off + // { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_RGB, .id0 = 0xFF, .id1 = 0x00FF, .id2 = 0x0000FF00, .id3 = 0xFF000000, .r = 75, .g = 150, .b = 225 }, + + //All LEDs use the user's selected pattern + //On layer 1, all key LEDs (except the top row which keeps active pattern) are red while all edge LEDs are green + //When layer 1 is active, key LEDs use red (id0 32 - 17: 1111 1111 1111 1111 0000 0000 0000 0000 = 0xFFFF0000) (except top row 16 - 1) + //When layer 1 is active, key LEDs use red (id1 64 - 33: 1111 1111 1111 1111 1111 1111 1111 1111 = 0xFFFFFFFF) + //When layer 1 is active, key LEDs use red (id2 87 - 65: 0000 0000 0111 1111 1111 1111 1111 1111 = 0x007FFFFF) + //When layer 1 is active, edge LEDs use green (id2 95 - 88: 1111 1111 1000 0000 0000 0000 0000 0000 = 0xFF800000) + //When layer 1 is active, edge LEDs use green (id3 119 - 96: 0000 0000 1111 1111 1111 1111 1111 1111 = 0x00FFFFFF) + // { .flags = LED_FLAG_USE_ROTATE_PATTERN }, + // { .flags = LED_FLAG_MATCH_ID | LED_FLAG_MATCH_LAYER | LED_FLAG_USE_RGB, .id0 = 0xFFFF0000, .id1 = 0xFFFFFFFF, .id2 = 0x007FFFFF, .r = 255, .layer = 1 }, + // { .flags = LED_FLAG_MATCH_ID | LED_FLAG_MATCH_LAYER | LED_FLAG_USE_RGB, .id2 = 0xFF800000, .id3 = 0x00FFFFFF, .g = 127, .layer = 1 }, + + //All key LEDs use red while edge LEDs use the active pattern + //All key LEDs use red (id0 32 - 1: 1111 1111 1111 1111 1111 1111 1111 1111 = 0xFFFFFFFF) + //All key LEDs use red (id1 64 - 33: 1111 1111 1111 1111 1111 1111 1111 1111 = 0xFFFFFFFF) + //All key LEDs use red (id2 87 - 65: 0000 0000 0111 1111 1111 1111 1111 1111 = 0x007FFFFF) + //Edge uses active pattern (id2 95 - 88: 1111 1111 1000 0000 0000 0000 0000 0000 = 0xFF800000) + //Edge uses active pattern (id3 119 - 96: 0000 0000 1111 1111 1111 1111 1111 1111 = 0x00FFFFFF) + // { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_RGB, .id0 = 0xFFFFFFFF, .id1 = 0xFFFFFFFF, .id2 = 0x007FFFFF, .r = 255 }, + // { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_ROTATE_PATTERN , .id2 = 0xFF800000, .id3 = 0x00FFFFFF }, + + //end must be set to 1 to indicate end of instruction set + { .end = 1 } +}; diff --git a/keyboards/massdrop/ctrl/keymaps/default_md/rules.mk b/keyboards/massdrop/ctrl/keymaps/default_md/rules.mk new file mode 100644 index 0000000000..064a6f54c1 --- /dev/null +++ b/keyboards/massdrop/ctrl/keymaps/default_md/rules.mk @@ -0,0 +1,2 @@ +# This keymap requires Massdrop Configurator support +OPT_DEFS += -DUSE_MASSDROP_CONFIGURATOR diff --git a/keyboards/massdrop/ctrl/keymaps/mac/keymap.c b/keyboards/massdrop/ctrl/keymaps/mac/keymap.c index e41b5eba20..41cf827572 100644 --- a/keyboards/massdrop/ctrl/keymaps/mac/keymap.c +++ b/keyboards/massdrop/ctrl/keymaps/mac/keymap.c @@ -1,25 +1,13 @@ #include QMK_KEYBOARD_H enum ctrl_keycodes { - L_BRI = SAFE_RANGE, //LED Brightness Increase - L_BRD, //LED Brightness Decrease - L_PTN, //LED Pattern Select Next - L_PTP, //LED Pattern Select Previous - L_PSI, //LED Pattern Speed Increase - L_PSD, //LED Pattern Speed Decrease - L_T_MD, //LED Toggle Mode - L_T_ONF, //LED Toggle On / Off - L_ON, //LED On - L_OFF, //LED Off - L_T_BR, //LED Toggle Breath Effect - L_T_PTD, //LED Toggle Scrolling Pattern Direction - U_T_AUTO, //USB Extra Port Toggle Auto Detect / Always Active - U_T_AGCR, //USB Toggle Automatic GCR control - DBG_TOG, //DEBUG Toggle On / Off - DBG_MTRX, //DEBUG Toggle Matrix Prints - DBG_KBD, //DEBUG Toggle Keyboard Prints - DBG_MOU, //DEBUG Toggle Mouse Prints - MD_BOOT, //Restart into bootloader after hold timeout + U_T_AUTO = SAFE_RANGE, //USB Extra Port Toggle Auto Detect / Always Active + U_T_AGCR, //USB Toggle Automatic GCR control + DBG_TOG, //DEBUG Toggle On / Off + DBG_MTRX, //DEBUG Toggle Matrix Prints + DBG_KBD, //DEBUG Toggle Keyboard Prints + DBG_MOU, //DEBUG Toggle Mouse Prints + MD_BOOT, //Restart into bootloader after hold timeout }; #define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode @@ -36,21 +24,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ ), [1] = LAYOUT( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MSTP, KC_VOLU, \ - L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_VOLD, \ - L_T_PTD, L_PTP, L_BRD, L_PTN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, MD_BOOT, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MSTP, KC_VOLU, \ + _______, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, U_T_AUTO,U_T_AGCR,_______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, \ + _______, RGB_RMOD,RGB_VAD, RGB_MOD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, \ + _______, RGB_TOG, _______, _______, _______, MD_BOOT, TG_NKRO, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), /* [X] = LAYOUT( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, TG_NKRO, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), */ }; @@ -71,82 +59,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { static uint32_t key_timer; switch (keycode) { - case L_BRI: - if (record->event.pressed) { - if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX; - else gcr_desired += LED_GCR_STEP; - if (led_animation_breathing) gcr_breathe = gcr_desired; - } - return false; - case L_BRD: - if (record->event.pressed) { - if (LED_GCR_STEP > gcr_desired) gcr_desired = 0; - else gcr_desired -= LED_GCR_STEP; - if (led_animation_breathing) gcr_breathe = gcr_desired; - } - return false; - case L_PTN: - if (record->event.pressed) { - if (led_animation_id == led_setups_count - 1) led_animation_id = 0; - else led_animation_id++; - } - return false; - case L_PTP: - if (record->event.pressed) { - if (led_animation_id == 0) led_animation_id = led_setups_count - 1; - else led_animation_id--; - } - return false; - case L_PSI: - if (record->event.pressed) { - led_animation_speed += ANIMATION_SPEED_STEP; - } - return false; - case L_PSD: - if (record->event.pressed) { - led_animation_speed -= ANIMATION_SPEED_STEP; - if (led_animation_speed < 0) led_animation_speed = 0; - } - return false; - case L_T_MD: - if (record->event.pressed) { - led_lighting_mode++; - if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL; - } - return false; - case L_T_ONF: - if (record->event.pressed) { - led_enabled = !led_enabled; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_ON: - if (record->event.pressed) { - led_enabled = 1; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_OFF: - if (record->event.pressed) { - led_enabled = 0; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_T_BR: - if (record->event.pressed) { - led_animation_breathing = !led_animation_breathing; - if (led_animation_breathing) { - gcr_breathe = gcr_desired; - led_animation_breathe_cur = BREATHE_MIN_STEP; - breathe_dir = 1; - } - } - return false; - case L_T_PTD: - if (record->event.pressed) { - led_animation_direction = !led_animation_direction; - } - return false; case U_T_AUTO: if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode"); diff --git a/keyboards/massdrop/ctrl/keymaps/mac_md/keymap.c b/keyboards/massdrop/ctrl/keymaps/mac_md/keymap.c new file mode 100644 index 0000000000..6dfc213786 --- /dev/null +++ b/keyboards/massdrop/ctrl/keymaps/mac_md/keymap.c @@ -0,0 +1,196 @@ +#include QMK_KEYBOARD_H + +enum ctrl_keycodes { + L_BRI = SAFE_RANGE, //LED Brightness Increase //Working + L_BRD, //LED Brightness Decrease //Working + L_PTN, //LED Pattern Select Next //Working + L_PTP, //LED Pattern Select Previous //Working + L_PSI, //LED Pattern Speed Increase //Working + L_PSD, //LED Pattern Speed Decrease //Working + L_T_MD, //LED Toggle Mode //Working + L_T_ONF, //LED Toggle On / Off //Broken + L_ON, //LED On //Broken + L_OFF, //LED Off //Broken + L_T_BR, //LED Toggle Breath Effect //Working + L_T_PTD, //LED Toggle Scrolling Pattern Direction //Working + U_T_AGCR, //USB Toggle Automatic GCR control //Working + DBG_TOG, //DEBUG Toggle On / Off // + DBG_MTRX, //DEBUG Toggle Matrix Prints // + DBG_KBD, //DEBUG Toggle Keyboard Prints // + DBG_MOU, //DEBUG Toggle Mouse Prints // + MD_BOOT //Restart into bootloader after hold timeout //Working +}; + +#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode + +keymap_config_t keymap_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + 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_PSCR, KC_SLCK, KC_PAUS, \ + 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, KC_HOME, KC_PGUP, \ + 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, KC_END, KC_PGDN, \ + 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_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_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [1] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MSTP, KC_VOLU, \ + L_T_BR, L_PSD, L_BRI, L_PSI, _______, _______, _______, _______, U_T_AGCR,_______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, \ + L_T_PTD, L_PTP, L_BRD, L_PTN, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, L_T_MD, L_T_ONF, _______, _______, MD_BOOT, TG_NKRO, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + /* + [X] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, TG_NKRO, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + */ +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { +}; + +#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL)) +#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT)) + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static uint32_t key_timer; + + switch (keycode) { + case L_BRI: + if (record->event.pressed) { + if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX; + else gcr_desired += LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_BRD: + if (record->event.pressed) { + if (LED_GCR_STEP > gcr_desired) gcr_desired = 0; + else gcr_desired -= LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_PTN: + if (record->event.pressed) { + if (led_animation_id == led_setups_count - 1) led_animation_id = 0; + else led_animation_id++; + } + return false; + case L_PTP: + if (record->event.pressed) { + if (led_animation_id == 0) led_animation_id = led_setups_count - 1; + else led_animation_id--; + } + return false; + case L_PSI: + if (record->event.pressed) { + led_animation_speed += ANIMATION_SPEED_STEP; + } + return false; + case L_PSD: + if (record->event.pressed) { + led_animation_speed -= ANIMATION_SPEED_STEP; + if (led_animation_speed < 0) led_animation_speed = 0; + } + return false; + case L_T_MD: + if (record->event.pressed) { + led_lighting_mode++; + if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL; + } + return false; + case L_T_ONF: + if (record->event.pressed) { + led_enabled = !led_enabled; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_ON: + if (record->event.pressed) { + led_enabled = 1; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_OFF: + if (record->event.pressed) { + led_enabled = 0; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_T_BR: + if (record->event.pressed) { + led_animation_breathing = !led_animation_breathing; + if (led_animation_breathing) { + gcr_breathe = gcr_desired; + led_animation_breathe_cur = BREATHE_MIN_STEP; + breathe_dir = 1; + } + } + return false; + case L_T_PTD: + if (record->event.pressed) { + led_animation_direction = !led_animation_direction; + } + return false; + case U_T_AGCR: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode"); + } + return false; + case DBG_TOG: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode"); + } + return false; + case DBG_MTRX: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_matrix, "Debug matrix"); + } + return false; + case DBG_KBD: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_keyboard, "Debug keyboard"); + } + return false; + case DBG_MOU: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_mouse, "Debug mouse"); + } + return false; + case MD_BOOT: + if (record->event.pressed) { + key_timer = timer_read32(); + } else { + if (timer_elapsed32(key_timer) >= 500) { + reset_keyboard(); + } + } + return false; + default: + return true; //Process all other keycodes normally + } +} + +led_instruction_t led_instructions[] = { + //Please see ../default_md/keymap.c for examples + + //All LEDs use the user's selected pattern (this is the factory default) + { .flags = LED_FLAG_USE_ROTATE_PATTERN }, + + //end must be set to 1 to indicate end of instruction set + { .end = 1 } +}; diff --git a/keyboards/massdrop/ctrl/keymaps/mac_md/rules.mk b/keyboards/massdrop/ctrl/keymaps/mac_md/rules.mk new file mode 100644 index 0000000000..064a6f54c1 --- /dev/null +++ b/keyboards/massdrop/ctrl/keymaps/mac_md/rules.mk @@ -0,0 +1,2 @@ +# This keymap requires Massdrop Configurator support +OPT_DEFS += -DUSE_MASSDROP_CONFIGURATOR diff --git a/keyboards/massdrop/ctrl/keymaps/responsive_pattern/README.md b/keyboards/massdrop/ctrl/keymaps/responsive_pattern/README.md new file mode 100644 index 0000000000..5ee630dfb8 --- /dev/null +++ b/keyboards/massdrop/ctrl/keymaps/responsive_pattern/README.md @@ -0,0 +1,5 @@ +# THIS KEYMAP IS BROKEN + +The CTRL and ALT have both been switched to using the QMK RGB Matrix system, +rendering any custom effects that used the old, custom Massdrop lighting system, +BROKEN. diff --git a/keyboards/massdrop/ctrl/keymaps/responsive_pattern/keymap.c b/keyboards/massdrop/ctrl/keymaps/responsive_pattern/keymap.c index 0bdc152140..58911aa757 100644 --- a/keyboards/massdrop/ctrl/keymaps/responsive_pattern/keymap.c +++ b/keyboards/massdrop/ctrl/keymaps/responsive_pattern/keymap.c @@ -15,7 +15,6 @@ extern issi3733_led_t *lede; extern issi3733_led_t led_map[]; -extern led_disp_t disp; enum ctrl_keycodes { L_BRI = SAFE_RANGE, //LED Brightness Increase @@ -238,8 +237,6 @@ void led_matrix_run(void) { led_cur = led_map; - disp.frame += 1; - breathe_mult = 1; if (led_animation_breathing) @@ -314,7 +311,7 @@ void led_matrix_run(void) } float pomod; - pomod = (float)(disp.frame % (uint32_t)(1000.0f / led_animation_speed)) / 10.0f * led_animation_speed; + pomod = (float)(g_tick % (uint32_t)(1000.0f / led_animation_speed)) / 10.0f * led_animation_speed; //Add in any moving effects if ((!led_animation_direction && f[fcur].ef & EF_SCR_R) || (led_animation_direction && (f[fcur].ef & EF_SCR_L))) diff --git a/keyboards/massdrop/ctrl/keymaps/responsive_pattern/rules.mk b/keyboards/massdrop/ctrl/keymaps/responsive_pattern/rules.mk new file mode 100644 index 0000000000..064a6f54c1 --- /dev/null +++ b/keyboards/massdrop/ctrl/keymaps/responsive_pattern/rules.mk @@ -0,0 +1,2 @@ +# This keymap requires Massdrop Configurator support +OPT_DEFS += -DUSE_MASSDROP_CONFIGURATOR diff --git a/keyboards/massdrop/ctrl/led_programs.c b/keyboards/massdrop/ctrl/led_programs.c deleted file mode 100644 index ca27016454..0000000000 --- a/keyboards/massdrop/ctrl/led_programs.c +++ /dev/null @@ -1,120 +0,0 @@ -/* -Copyright 2018 Massdrop Inc. - -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 "ctrl.h" -#include "led_matrix.h" - -//Teal <-> Salmon -led_setup_t leds_teal_salmon[] = { - { .hs = 0, .he = 33, .rs = 24, .re = 24, .gs = 215, .ge = 215, .bs = 204, .be = 204, .ef = EF_NONE }, - { .hs = 33, .he = 66, .rs = 24, .re = 255, .gs = 215, .ge = 114, .bs = 204, .be = 118, .ef = EF_NONE }, - { .hs = 66, .he = 100, .rs = 255, .re = 255, .gs = 114, .ge = 114, .bs = 118, .be = 118, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Yellow -led_setup_t leds_yellow[] = { - { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Off -led_setup_t leds_off[] = { - { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Red -led_setup_t leds_red[] = { - { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Green -led_setup_t leds_green[] = { - { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Blue -led_setup_t leds_blue[] = { - { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_NONE }, - { .end = 1 }, -}; - -//White -led_setup_t leds_white[] = { - { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 255, .be = 255, .ef = EF_NONE }, - { .end = 1 }, -}; - -//White with moving red stripe -led_setup_t leds_white_with_red_stripe[] = { - { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 255, .be = 255, .ef = EF_NONE }, - { .hs = 0, .he = 15, .rs = 0, .re = 0, .gs = 0, .ge = 255, .bs = 0, .be = 255, .ef = EF_SCR_R | EF_SUBTRACT }, - { .hs = 15, .he = 30, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 0, .ef = EF_SCR_R | EF_SUBTRACT }, - { .end = 1 }, -}; - -//Black with moving red stripe -led_setup_t leds_black_with_red_stripe[] = { - { .hs = 0, .he = 15, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_SCR_R }, - { .hs = 15, .he = 30, .rs = 255, .re = 0, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_SCR_R }, - { .end = 1 }, -}; - -//Rainbow no scrolling -led_setup_t leds_rainbow_ns[] = { - { .hs = 0, .he = 16.67, .rs = 255, .re = 255, .gs = 0, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER }, - { .hs = 16.67, .he = 33.33, .rs = 255, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER }, - { .hs = 33.33, .he = 50, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 255, .ef = EF_OVER }, - { .hs = 50, .he = 66.67, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER }, - { .hs = 66.67, .he = 83.33, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER }, - { .hs = 83.33, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 0, .ef = EF_OVER }, - { .end = 1 }, -}; - -//Rainbow scrolling -led_setup_t leds_rainbow_s[] = { - { .hs = 0, .he = 16.67, .rs = 255, .re = 255, .gs = 0, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER | EF_SCR_R }, - { .hs = 16.67, .he = 33.33, .rs = 255, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER | EF_SCR_R }, - { .hs = 33.33, .he = 50, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 255, .ef = EF_OVER | EF_SCR_R }, - { .hs = 50, .he = 66.67, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER | EF_SCR_R }, - { .hs = 66.67, .he = 83.33, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER | EF_SCR_R }, - { .hs = 83.33, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 0, .ef = EF_OVER | EF_SCR_R }, - { .end = 1 }, -}; - -//Add new LED animations here using one from above as example -//The last entry must be { .end = 1 } -//Add the new animation name to the list below following its format - -void *led_setups[] = { - leds_rainbow_s, - leds_rainbow_ns, - leds_teal_salmon, - leds_yellow, - leds_red, - leds_green, - leds_blue, - leds_white, - leds_white_with_red_stripe, - leds_black_with_red_stripe, - leds_off -}; - -const uint8_t led_setups_count = sizeof(led_setups) / sizeof(led_setups[0]); diff --git a/keyboards/massdrop/ctrl/rules.mk b/keyboards/massdrop/ctrl/rules.mk index c5539158f5..aa45c68056 100644 --- a/keyboards/massdrop/ctrl/rules.mk +++ b/keyboards/massdrop/ctrl/rules.mk @@ -1,6 +1,6 @@ # project specific files -SRC = led_programs.c -SRC += matrix.c +SRC = matrix.c +SRC += config_led.c #For platform and packs ARM_ATSAM = SAMD51J18A @@ -31,3 +31,6 @@ HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) VIRTSER_ENABLE = no # USB Serial Driver RAW_ENABLE = no # Raw device AUTO_SHIFT_ENABLE = no # Auto Shift + +# Custom RGB matrix handling +RGB_MATRIX_ENABLE = custom diff --git a/keyboards/mechmini/v1/README.md b/keyboards/mechmini/v1/README.md index b4a1924c4f..315349803a 100644 --- a/keyboards/mechmini/v1/README.md +++ b/keyboards/mechmini/v1/README.md @@ -29,7 +29,7 @@ $ brew cask install crosspack-avr $ brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb ``` -In order to use the `./program` script, which can reboot the board into +In order to use the `./util/atmega32a_program.py` script, which can reboot the board into the bootloader, you'll need Python 2 with PyUSB installed: ``` diff --git a/keyboards/mechmini/v1/keymaps/default/keymap.c b/keyboards/mechmini/v1/keymaps/default/keymap.c index 4a0a4dc0a6..f9e446064a 100644 --- a/keyboards/mechmini/v1/keymaps/default/keymap.c +++ b/keyboards/mechmini/v1/keymaps/default/keymap.c @@ -13,8 +13,7 @@ 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 "mechmini.h" -#include "quantum.h" +#include QMK_KEYBOARD_H #define _BL 0 // base layer #define _FN1 1 // function layer 1 diff --git a/keyboards/mechmini/v2/keymaps/arkag/keymap.c b/keyboards/mechmini/v2/keymaps/arkag/keymap.c index 29e125394b..4f4cbda3f3 100644 --- a/keyboards/mechmini/v2/keymaps/arkag/keymap.c +++ b/keyboards/mechmini/v2/keymaps/arkag/keymap.c @@ -7,33 +7,47 @@ */ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_2u_space_ortho( - KC_LEAD, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, QUOTE, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT, - M_PMOD, LRALT, M_SMOD, LOWER, RAISE, KC_SPC, KC_SLSH, KC_BSLS, KC_LEFT, KC_DOWN, KC_RGHT), + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + M_PMOD, LRALT, M_SMOD, LOWER, RAISE, KC_SPC, MEDIA, FUNCT, XXXXXXX, GAME , KC_LEAD), [_RAISE] = LAYOUT_2u_space_ortho( - GRAVE, KC_1, KC_2, THREE, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + GRAVE, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, _______, _______, _______, OBRACK, CBRACK, KC_EQL, HYPHEN, _______, _______, KC_4, KC_5, KC_6, _______, KC_NLCK, - _______, _______, _______, CEDILLA, _______, KC_COMM, KC_PDOT, KC_1, KC_2, KC_3, KC_PPLS, KC_PENT, - _______, _______, _______, KEEB, _______, _______, _______, M_OS, KC_PSLS, KC_PMNS, KC_PAST), + _______, _______, _______, CEDILLA, _______, KC_COMM, KC_PDOT, KC_1, KC_2, KC_3, KC_BSLS, KC_PENT, + _______, _______, _______, KEEB, _______, _______, KC_0, KC_PSLS, KC_PMNS, KC_PPLS, KC_PAST), [_LOWER] = LAYOUT_2u_space_ortho( - KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, M_P_B, M_C_A_D, + _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - KC_CAPS, KC_DEL, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END), + _______, LRALT, _______, _______, _______, _______, _______, _______, _______, _______, _______), - [_KEEB] = LAYOUT_2u_space_ortho( + [_MEDIA] = LAYOUT_2u_space_ortho( + _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, _______, _______, KC_MUTE, + _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, KC_MPLY, _______, _______, _______, _______, _______), + + [_FUNCT] = LAYOUT_2u_space_ortho( 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_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, M_SFT, M_SPC, M_OS ), + + [_KEEB] = LAYOUT_2u_space_ortho( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_TOGG, BL_STEP, BL_INC, BL_DEC, BL_BRTG, _______, _______, _______, _______, _______, _______, RGB_M_P, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), - [_LAZY] = LAYOUT_2u_space_ortho( - _______, _______, _______, _______, _______, M_TM, _______, M_SNIPT, M_SHRUG, _______, _______, KC_MUTE, - _______, _______, _______, _______, _______, M_GGT, _______, M_UF, M_LOD, M_REPO, _______, _______, - _______, _______, _______, _______, _______, _______, _______, M_TF, M_LENNY, _______, KC_VOLU, KC_MPLY, - _______, _______, _______, _______, _______, _______, M_CALC, _______, KC_MPRV, KC_VOLD, KC_MNXT), + [_GAMING] = LAYOUT_2u_space_ortho( + KC_ESC, KC_F13, KC_1, KC_2, KC_3, KC_4, KC_5, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_TAB, KC_F14, KC_Q, KC_W, KC_E, KC_R, KC_T, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_LSFT, KC_F15, KC_A, KC_S, KC_D, KC_F, KC_G, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_LCTL, KC_F16, KC_Z, KC_X, KC_C, KC_SPC, XXXXXXX, XXXXXXX, XXXXXXX, GAME, XXXXXXX), + }; diff --git a/keyboards/mechmini/v2/keymaps/arkag/rules.mk b/keyboards/mechmini/v2/keymaps/arkag/rules.mk index c1d5afa1eb..64f65f7062 100644 --- a/keyboards/mechmini/v2/keymaps/arkag/rules.mk +++ b/keyboards/mechmini/v2/keymaps/arkag/rules.mk @@ -1,4 +1,4 @@ -BOOTMAGIC_ENABLE = no +BOOTMAGIC_ENABLE = lite MOUSEKEY_ENABLE = no STENO_ENABLE = no EXTRAKEY_ENABLE = yes @@ -6,7 +6,7 @@ CONSOLE_ENABLE = no COMMAND_ENABLE = no SLEEP_LED_ENABLE = no NKRO_ENABLE = yes -BACKLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = no AUDIO_ENABLE = no RGBLIGHT_ENABLE = yes TAP_DANCE_ENABLE = yes diff --git a/keyboards/mehkee96/program b/keyboards/mehkee96/program deleted file mode 100644 index b777b91106..0000000000 --- a/keyboards/mehkee96/program +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/env python -# Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>, Sebastian Kaim <sebb@sebb767.de> -# -# 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/>. - -from __future__ import print_function - -import os -import sys -import time -import usb - - -def checkForKeyboardInNormalMode(): - """Returns a device if a ps2avrGB device in normal made (that is in keyboard mode) or None if it is not found.""" - return usb.core.find(idVendor=0x20A0, idProduct=0x422D) - -def checkForKeyboardInBootloaderMode(): - """Returns True if a ps2avrGB device in bootloader (flashable) mode is found and False otherwise.""" - return (usb.core.find(idVendor=0x16c0, idProduct=0x05df) is not None) - -def flashKeyboard(firmware_file): - """Calls bootloadHID to flash the given file to the device.""" - print('Flashing firmware to device ...') - if os.system('bootloadHID -r "%s"' % firmware_file) == 0: - print('\nDone!') - else: - print('\nbootloadHID returned an error.') - -def printDeviceInfo(dev): - """Prints all infos for a given USB device""" - print('Device Information:') - print(' idVendor: %d (0x%04x)' % (dev.idVendor, dev.idVendor)) - print(' idProduct: %d (0x%04x)' % (dev.idProduct, dev.idProduct)) - print('Manufacturer: %s' % (dev.iManufacturer)) - print('Serial: %s' % (dev.iSerialNumber)) - print('Product: %s' % (dev.iProduct), end='\n\n') - -def sendDeviceToBootloaderMode(dev): - """Tries to send a given ps2avrGB keyboard to bootloader mode to allow flashing.""" - try: - dev.set_configuration() - - request_type = usb.util.build_request_type( - usb.util.CTRL_OUT, - usb.util.CTRL_TYPE_CLASS, - usb.util.CTRL_RECIPIENT_DEVICE) - - USBRQ_HID_SET_REPORT = 0x09 - HID_REPORT_OPTION = 0x0301 - - dev.ctrl_transfer(request_type, USBRQ_HID_SET_REPORT, HID_REPORT_OPTION, 0, [0, 0, 0xFF] + [0] * 5) - except usb.core.USBError: - # for some reason I keep getting USBError, but it works! - pass - - -if len(sys.argv) < 2: - print('Usage: %s <firmware.hex>' % sys.argv[0]) - sys.exit(1) - -kb = checkForKeyboardInNormalMode() - -if kb is not None: - print('Found a keyboard in normal mode. Attempting to send it to bootloader mode ...', end='') - sendDeviceToBootloaderMode(kb) - print(' done.') - print("Hint: If your keyboard can't be set to bootloader mode automatically, plug it in while pressing the bootloader key to do so manually.") - print(" You can find more infos about this here: https://github.com/qmk/qmk_firmware/tree/master/keyboards/ps2avrGB#setting-the-board-to-bootloader-mode") - -attempts = 12 # 60 seconds -found = False -for attempt in range(1, attempts + 1): - print("Searching for keyboard in bootloader mode (%i/%i) ... " % (attempt, attempts), end='') - - if checkForKeyboardInBootloaderMode(): - print('Found', end='\n\n') - flashKeyboard(sys.argv[1]) - found = True - break - else: - print('Nothing.', end='') - - if attempt != attempts: # no need to wait on the last attempt - print(' Sleeping 5 seconds.', end='') - time.sleep(5) - - # print a newline - print() - -if not found: - print("Couldn't find a flashable keyboard. Aborting.") - sys.exit(2) - diff --git a/keyboards/mehkee96/rules.mk b/keyboards/mehkee96/rules.mk index e6e7d4a588..f7fb397e25 100644 --- a/keyboards/mehkee96/rules.mk +++ b/keyboards/mehkee96/rules.mk @@ -32,4 +32,4 @@ CUSTOM_MATRIX = yes SRC = matrix.c i2c.c # programming options -PROGRAM_CMD = ./keyboards/mehkee96/program $(TARGET).hex +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/meira/keymaps/default/config.h b/keyboards/meira/keymaps/default/config.h index 5f5844a70a..e3776d2eff 100644 --- a/keyboards/meira/keymaps/default/config.h +++ b/keyboards/meira/keymaps/default/config.h @@ -14,10 +14,9 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "../../config.h" +// place overrides here // place overrides here #define MUSIC_MASK (keycode != KC_NO) @@ -30,5 +29,3 @@ SONG(DVORAK_SOUND) \ } #endif - -#endif diff --git a/keyboards/meira/keymaps/default/keymap.c b/keyboards/meira/keymaps/default/keymap.c index b25d789192..5703999a04 100644 --- a/keyboards/meira/keymaps/default/keymap.c +++ b/keyboards/meira/keymaps/default/keymap.c @@ -13,7 +13,7 @@ * 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 "meira.h" +#include QMK_KEYBOARD_H #include "lighting.h" #ifdef RGBLIGHT_ENABLE diff --git a/keyboards/meishi/keymaps/default/keymap.c b/keyboards/meishi/keymaps/default/keymap.c index 88f08ee565..528beb168b 100644 --- a/keyboards/meishi/keymaps/default/keymap.c +++ b/keyboards/meishi/keymaps/default/keymap.c @@ -13,7 +13,7 @@ * 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 "meishi.h" +#include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( /* Base */ diff --git a/keyboards/meme/keymaps/default/config.h b/keyboards/meme/keymaps/default/config.h index 2c852d1819..a3ed4f762a 100644 --- a/keyboards/meme/keymaps/default/config.h +++ b/keyboards/meme/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/miuni32/keymaps/default/config.h b/keyboards/miuni32/keymaps/default/config.h index df06a26206..271f48d001 100644 --- a/keyboards/miuni32/keymaps/default/config.h +++ b/keyboards/miuni32/keymaps/default/config.h @@ -1,8 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif
\ No newline at end of file diff --git a/keyboards/mt40/keymaps/default/config.h b/keyboards/mt40/keymaps/default/config.h index 9f9a9fc107..6c3e30ef7b 100644 --- a/keyboards/mt40/keymaps/default/config.h +++ b/keyboards/mt40/keymaps/default/config.h @@ -1,5 +1,6 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once + +// place overrides here #define TAPPING_TERM 200 @@ -7,5 +8,3 @@ #define RGBLIGHT_HUE_STEP 12 #define RGBLIGHT_SAT_STEP 15 #define RGBLIGHT_VAL_STEP 18 - -#endif diff --git a/keyboards/mt980/config.h b/keyboards/mt980/config.h new file mode 100644 index 0000000000..88c25a5870 --- /dev/null +++ b/keyboards/mt980/config.h @@ -0,0 +1,52 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Wheat Field Peripherals +#define PRODUCT MT980 +#define DESCRIPTION Keyboard + +/* key matrix size */ +#define MATRIX_ROWS 12 +#define MATRIX_COLS 9 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { B7, B3, B2, B1, B0, E6, F0, F1, F4, F5, F6, F7 } +#define MATRIX_COL_PINS { D0, D1, D2, D3, D5, D4, D6, D7, B4 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION ROW2COL + +/* number of backlight levels */ +#define BACKLIGHT_PIN B6 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 3 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* 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 E2 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 24 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#define RGBLIGHT_LIMIT_VAL 185 +#endif + +/* Place bootmagic key on Esc */ +#define BOOTMAGIC_LITE_ROW 5 +#define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/mt980/info.json b/keyboards/mt980/info.json new file mode 100644 index 0000000000..f71d022856 --- /dev/null +++ b/keyboards/mt980/info.json @@ -0,0 +1,117 @@ +{ + "keyboard_name": "mt980", + "url": "https://shop110310565.taobao.com", + "maintainer": "walkerstop", + "width": 19.5, + "height": 6.75, + "layouts": { + "LAYOUT": { + "key_count": 103, + "layout": [ + {"label":"K50", "x":0, "y":0}, + {"label":"K52", "x":1.25, "y":0}, + {"label":"K53", "x":2.25, "y":0}, + {"label":"K54", "x":3.25, "y":0}, + {"label":"K55", "x":4.25, "y":0}, + {"label":"K57", "x":5.5, "y":0}, + {"label":"K58", "x":6.5, "y":0}, + {"label":"KB8", "x":7.5, "y":0}, + {"label":"KB7", "x":8.5, "y":0}, + {"label":"KB5", "x":9.75, "y":0}, + {"label":"KB4", "x":10.75, "y":0}, + {"label":"KB3", "x":11.75, "y":0}, + {"label":"KB6", "x":12.75, "y":0}, + {"label":"K51", "x":14, "y":0}, + {"label":"KB2", "x":15.5, "y":0}, + {"label":"KB1", "x":16.5, "y":0}, + {"label":"KB0", "x":17.5, "y":0}, + {"label":"K63", "x":18.5, "y":0}, + {"label":"K40", "x":0, "y":1.5}, + {"label":"K41", "x":1, "y":1.5}, + {"label":"K42", "x":2, "y":1.5}, + {"label":"K43", "x":3, "y":1.5}, + {"label":"K44", "x":4, "y":1.5}, + {"label":"K45", "x":5, "y":1.5}, + {"label":"K46", "x":6, "y":1.5}, + {"label":"K47", "x":7, "y":1.5}, + {"label":"K48", "x":8, "y":1.5}, + {"label":"KA8", "x":9, "y":1.5}, + {"label":"KA7", "x":10, "y":1.5}, + {"label":"KA5", "x":11, "y":1.5}, + {"label":"KA4", "x":12, "y":1.5}, + {"label":"KA3", "x":13, "y":1.5}, + {"label":"KA6", "x":14, "y":1.5}, + {"label":"KA2", "x":15.5, "y":1.5}, + {"label":"KA1", "x":16.5, "y":1.5}, + {"label":"KA0", "x":17.5, "y":1.5}, + {"label":"K64", "x":18.5, "y":1.5}, + {"label":"K30", "x":0, "y":2.5, "w":1.5}, + {"label":"K31", "x":1.5, "y":2.5}, + {"label":"K32", "x":2.5, "y":2.5}, + {"label":"K33", "x":3.5, "y":2.5}, + {"label":"K34", "x":4.5, "y":2.5}, + {"label":"K35", "x":5.5, "y":2.5}, + {"label":"K36", "x":6.5, "y":2.5}, + {"label":"K37", "x":7.5, "y":2.5}, + {"label":"K38", "x":8.5, "y":2.5}, + {"label":"K98", "x":9.5, "y":2.5}, + {"label":"K97", "x":10.5, "y":2.5}, + {"label":"K95", "x":11.5, "y":2.5}, + {"label":"K94", "x":12.5, "y":2.5}, + {"label":"K84", "x":13.5, "y":2.5, "w":1.5}, + {"label":"K96", "x":15.5, "y":2.5}, + {"label":"K92", "x":16.5, "y":2.5}, + {"label":"K91", "x":17.5, "y":2.5}, + {"label":"K90", "x":18.5, "y":2.5}, + {"label":"K20", "x":0, "y":3.5, "w":1.75}, + {"label":"K21", "x":1.75, "y":3.5}, + {"label":"K22", "x":2.75, "y":3.5}, + {"label":"K23", "x":3.75, "y":3.5}, + {"label":"K24", "x":4.75, "y":3.5}, + {"label":"K25", "x":5.75, "y":3.5}, + {"label":"K26", "x":6.75, "y":3.5}, + {"label":"K27", "x":7.75, "y":3.5}, + {"label":"K28", "x":8.75, "y":3.5}, + {"label":"K88", "x":9.75, "y":3.5}, + {"label":"K87", "x":10.75, "y":3.5}, + {"label":"K85", "x":11.75, "y":3.5}, + {"label":"K93", "x":12.75, "y":3.5, "w":2.25}, + {"label":"K86", "x":15.5, "y":3.5}, + {"label":"K82", "x":16.5, "y":3.5}, + {"label":"K81", "x":17.5, "y":3.5}, + {"label":"K80", "x":18.5, "y":3.5}, + {"label":"K10", "x":0, "y":4.5, "w":1.25}, + {"label":"K11", "x":1.25, "y":4.5}, + {"label":"K12", "x":2.25, "y":4.5}, + {"label":"K13", "x":3.25, "y":4.5}, + {"label":"K14", "x":4.25, "y":4.5}, + {"label":"K15", "x":5.25, "y":4.5}, + {"label":"K16", "x":6.25, "y":4.5}, + {"label":"K17", "x":7.25, "y":4.5}, + {"label":"K18", "x":8.25, "y":4.5}, + {"label":"K78", "x":9.25, "y":4.5}, + {"label":"K77", "x":10.25, "y":4.5}, + {"label":"K75", "x":11.25, "y":4.5}, + {"label":"K74", "x":12.25, "y":4.5, "w":1.75}, + {"label":"K73", "x":14.25, "y":4.75}, + {"label":"K76", "x":15.5, "y":4.5}, + {"label":"K72", "x":16.5, "y":4.5}, + {"label":"K71", "x":17.5, "y":4.5}, + {"label":"K70", "x":18.5, "y":4.5}, + {"label":"K00", "x":0, "y":5.5, "w":1.25}, + {"label":"K01", "x":1.25, "y":5.5}, + {"label":"K02", "x":2.25, "y":5.5, "w":1.25}, + {"label":"K06", "x":3.5, "y":5.5, "w":6.25}, + {"label":"K08", "x":9.75, "y":5.5}, + {"label":"K07", "x":10.75, "y":5.5}, + {"label":"K05", "x":11.75, "y":5.5, "w":1.25}, + {"label":"K04", "x":13.25, "y":5.75}, + {"label":"K03", "x":14.25, "y":5.75}, + {"label":"K66", "x":15.25, "y":5.75}, + {"label":"K62", "x":16.5, "y":5.5}, + {"label":"K61", "x":17.5, "y":5.5}, + {"label":"K60", "x":18.5, "y":5.5} + ] + } + } +} diff --git a/keyboards/mt980/keymaps/default/keymap.c b/keyboards/mt980/keymaps/default/keymap.c new file mode 100644 index 0000000000..504233a983 --- /dev/null +++ b/keyboards/mt980/keymaps/default/keymap.c @@ -0,0 +1,21 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT( + 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_NO, KC_INS, KC_PSCR, KC_PGUP, KC_PGDN, + 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_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + 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_P7, KC_P8, KC_P9, KC_PPLS, + 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_P4, KC_P5, KC_P6, KC_PPLS, + KC_LSFT, 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_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT), + + [1] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PAUSE, KC_SLCK, KC_HOME, KC_END, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, RGB_RMOD, RGB_VAD, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS) + +}; diff --git a/keyboards/mt980/keymaps/walker/config.h b/keyboards/mt980/keymaps/walker/config.h new file mode 100644 index 0000000000..0bd3959938 --- /dev/null +++ b/keyboards/mt980/keymaps/walker/config.h @@ -0,0 +1,5 @@ +#pragma once + +#define TAPPING_TERM 200 +#define ONESHOT_TAP_TOGGLE 5 +#define ONESHOT_TIMEOUT 5000 diff --git a/keyboards/mt980/keymaps/walker/keymap.c b/keyboards/mt980/keymaps/walker/keymap.c new file mode 100644 index 0000000000..83a3fb8167 --- /dev/null +++ b/keyboards/mt980/keymaps/walker/keymap.c @@ -0,0 +1,168 @@ +#include "mt980.h" + +bool numlock_on = true; + +typedef struct { + bool is_press_action; + int state; +} tap; + +enum { + SINGLE_TAP = 1, + SINGLE_HOLD = 2, + DOUBLE_TAP = 3, + DOUBLE_HOLD = 4, + TRIPLE_TAP = 5, + TRIPLE_HOLD = 6 +}; + +enum { + ALT_L1 = 0 +}; + +int cur_dance (qk_tap_dance_state_t *state); +void alt_finished (qk_tap_dance_state_t *state, void *user_data); +void alt_reset (qk_tap_dance_state_t *state, void *user_data); + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT( + 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_NO, KC_INS, KC_PSCR, KC_PGUP, KC_PGDN, + 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_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + 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_P7, KC_P8, KC_P9, KC_PPLS, + 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_P4, KC_P5, KC_P6, KC_PPLS, + KC_LSFT, 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_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LGUI, TD(ALT_L1), KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT), + + [1] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PAUSE, KC_SLCK, KC_HOME, KC_END, + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, RGB_TOG, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, RGB_RMOD, RGB_VAD, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS) + +}; + +int cur_dance (qk_tap_dance_state_t *state) { + if (state->count == 1) { + if (state->pressed) return SINGLE_HOLD; + else return SINGLE_TAP; + } + else if (state->count == 2) { + if (state->pressed) return DOUBLE_HOLD; + else return DOUBLE_TAP; + } + else if (state->count == 3) { + if (state->interrupted || !state->pressed) return TRIPLE_TAP; + else return TRIPLE_HOLD; + } + else return 8; +} + +static tap alttap_state = { + .is_press_action = true, + .state = 0 +}; + +void alt_finished (qk_tap_dance_state_t *state, void *user_data) { + alttap_state.state = cur_dance(state); + switch (alttap_state.state) { + case SINGLE_TAP: set_oneshot_layer(1, ONESHOT_START); clear_oneshot_layer_state(ONESHOT_PRESSED); break; + case SINGLE_HOLD: register_code(KC_LALT); break; + case DOUBLE_TAP: set_oneshot_layer(1, ONESHOT_START); set_oneshot_layer(1, ONESHOT_PRESSED); break; + case DOUBLE_HOLD: register_code(KC_LALT); layer_on(1); break; + } +} + +void alt_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (alttap_state.state) { + case SINGLE_TAP: break; + case SINGLE_HOLD: unregister_code(KC_LALT); break; + case DOUBLE_TAP: break; + case DOUBLE_HOLD: layer_off(1); unregister_code(KC_LALT); break; + } + alttap_state.state = 0; +} + +qk_tap_dance_action_t tap_dance_actions[] = { + [ALT_L1] = ACTION_TAP_DANCE_FN_ADVANCED(NULL,alt_finished, alt_reset) +}; + +void led_set_keymap(uint8_t usb_led) { + if (usb_led & (1<<USB_LED_NUM_LOCK)) { + numlock_on = true; + } + else { + numlock_on = false; + } +} + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + + switch (keycode) { + case KC_TRNS: + case KC_NO: + /* Always cancel one-shot layer when another key gets pressed */ + if (record->event.pressed && is_oneshot_layer_active()) + clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); + return true; + case RESET: + /* Don't allow reset from oneshot layer state */ + if (record->event.pressed && is_oneshot_layer_active()) { + clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); + return false; + } + return true; + case KC_PPLS: + if (!numlock_on) { + if (is_oneshot_layer_active() || layer_state & 0x2) { + if (record->event.pressed) + register_code(KC_HOME); + else + unregister_code(KC_HOME); + clear_oneshot_layer_state(ONESHOT_START); + } + else { + if (record->event.pressed) + register_code(KC_PGUP); + else + unregister_code(KC_PGUP); + } + return false; + } + return true; + case KC_PENT: + if (!numlock_on) { + if (is_oneshot_layer_active() || layer_state & 0x2) { + if (record->event.pressed) + register_code(KC_END); + else + unregister_code(KC_END); + clear_oneshot_layer_state(ONESHOT_START); + } + else { + if (record->event.pressed) + register_code(KC_PGDN); + else + unregister_code(KC_PGDN); + } + return false; + } + return true; + case KC_NLCK: + /* Shift + NumLock will be treated as shift-Insert */ + if ((keyboard_report->mods & MOD_BIT (KC_LSFT)) || (keyboard_report->mods & MOD_BIT (KC_RSFT))) { + if (record->event.pressed) { + register_code(KC_INS); + unregister_code(KC_INS); + } + return false; + } + else + return true; + default: + return true; + } + return true; +} diff --git a/keyboards/mt980/keymaps/walker/rules.mk b/keyboards/mt980/keymaps/walker/rules.mk new file mode 100644 index 0000000000..e5ddcae8d9 --- /dev/null +++ b/keyboards/mt980/keymaps/walker/rules.mk @@ -0,0 +1 @@ +TAP_DANCE_ENABLE = yes diff --git a/keyboards/mt980/mt980.c b/keyboards/mt980/mt980.c new file mode 100644 index 0000000000..5461a3b21f --- /dev/null +++ b/keyboards/mt980/mt980.c @@ -0,0 +1,65 @@ +#include "mt980.h" + +__attribute__ ((weak)) +void matrix_init_keymap(void) {} + +__attribute__ ((weak)) +void matrix_scan_keymap(void) {} + +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} +__attribute__ ((weak)) +uint32_t layer_state_set_keymap (uint32_t state) { + return state; +} +__attribute__ ((weak)) +void led_set_keymap(uint8_t usb_led) {} + +void matrix_init_user(void) { + matrix_init_keymap(); +} + +void matrix_scan_user(void) { + matrix_scan_keymap(); +} + +void keyboard_pre_init_user(void) { + /* Set NUMLOCK indicator pin as output */ + setPinOutput(C6); + /* Set CAPSLOCK indicator pin as output */ + setPinOutput(C7); + /* Set SCROLLOCK indicator pin as output */ + setPinOutput(B5); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return process_record_keymap(keycode, record); +} + +void led_set_user(uint8_t usb_led) { + + if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { + writePinLow(C6); + } + else { + writePinHigh(C6); + } + + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(C7); + } + else { + writePinHigh(C7); + } + + if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { + writePinLow(B5); + } + else { + writePinHigh(B5); + } + + led_set_keymap(usb_led); +} diff --git a/keyboards/mt980/mt980.h b/keyboards/mt980/mt980.h new file mode 100644 index 0000000000..d9804b3392 --- /dev/null +++ b/keyboards/mt980/mt980.h @@ -0,0 +1,25 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + K050, K052, K053, K054, K055, K057, K058, K118, K117, K115, K114, K113, K116, K051, K112, K111, K110, K063, \ + K040, K041, K042, K043, K044, K045, K046, K047, K048, K108, K107, K105, K104, K103, K106, K102, K101, K100, K064, \ + K030, K031, K032, K033, K034, K035, K036, K037, K038, K098, K097, K095, K094, K084, K096, K092, K091, K090, \ + K020, K021, K022, K023, K024, K025, K026, K027, K028, K088, K087, K085, K093, K086, K082, K081, K080, \ + K010, K011, K012, K013, K014, K015, K016, K017, K018, K078, K077, K075, K074, K073, K076, K072, K071, K070, \ + K000, K001, K002, K006, K008, K007, K005, K004, K003, K066, K062, K061, K060 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008 }, \ + { K010, K011, K012, K013, K014, K015, K016, K017, K018 }, \ + { K020, K021, K022, K023, K024, K025, K026, K027, K028 }, \ + { K030, K031, K032, K033, K034, K035, K036, K037, K038 }, \ + { K040, K041, K042, K043, K044, K045, K046, K047, K048 }, \ + { K050, K051, K052, K053, K054, K055, KC_NO, K057, K058 }, \ + { K060, K061, K062, K063, K064, KC_NO, K066, KC_NO, KC_NO}, \ + { K070, K071, K072, K073, K074, K075, K076, K077, K078 }, \ + { K080, K081, K082, KC_NO, K084, K085, K086, K087, K088 }, \ + { K090, K091, K092, K093, K094, K095, K096, K097, K098 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108 }, \ + { K110, K111, K112, K113, K114, K115, K116, K117, K118 } \ +} diff --git a/keyboards/mt980/readme.md b/keyboards/mt980/readme.md new file mode 100644 index 0000000000..7bc27c93a5 --- /dev/null +++ b/keyboards/mt980/readme.md @@ -0,0 +1,14 @@ +# mt980 + +A mechanical keyboard PCB in the same layout as the Leopold FC980M, sold by Wheat Field Peripherals on Taobao. This PCB requires soldering, except for the arrow cluster and the Escape key switches, which use Kailh hot swap sockets. + +Keyboard Maintainer: [walkerstop](https://github.com/walkerstop) +Hardware Supported: mt980 +Hardware Availability: Taobao store https://shop110310565.taobao.com + +Make example for this keyboard (after setting up your build environment): + + make mt980:default + +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/mt980/rules.mk b/keyboards/mt980/rules.mk new file mode 100644 index 0000000000..9a7718aadb --- /dev/null +++ b/keyboards/mt980/rules.mk @@ -0,0 +1,55 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +BOOTLOADER = atmel-dfu + +# Build Options +# comment out to disable the options. +# + +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes +KEY_LOCK_ENABLE = no diff --git a/keyboards/mxss/keymaps/default/config.h b/keyboards/mxss/keymaps/default/config.h index 9f86225799..bfbdb62297 100644 --- a/keyboards/mxss/keymaps/default/config.h +++ b/keyboards/mxss/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/mxss/rgblight.h b/keyboards/mxss/rgblight.h new file mode 100644 index 0000000000..5205974f9f --- /dev/null +++ b/keyboards/mxss/rgblight.h @@ -0,0 +1,166 @@ +/* Copyright 2017 Yang Liu + * + * 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/>. + */ +#ifndef RGBLIGHT_H +#define RGBLIGHT_H + +#ifdef RGBLIGHT_ANIMATIONS + #define RGBLIGHT_MODES 35 +#else + #define RGBLIGHT_MODES 1 +#endif + +#ifndef RGBLIGHT_EFFECT_BREATHE_CENTER +#define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1-2.7 +#endif + +#ifndef RGBLIGHT_EFFECT_BREATHE_MAX +#define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0-255 +#endif + +#ifndef RGBLIGHT_EFFECT_SNAKE_LENGTH +#define RGBLIGHT_EFFECT_SNAKE_LENGTH 4 +#endif + +#ifndef RGBLIGHT_EFFECT_KNIGHT_LENGTH +#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 3 +#endif + +#ifndef RGBLIGHT_EFFECT_KNIGHT_OFFSET +#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 0 +#endif + +#ifndef RGBLIGHT_EFFECT_KNIGHT_LED_NUM +#define RGBLIGHT_EFFECT_KNIGHT_LED_NUM RGBLED_NUM +#endif + +#ifndef RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL +#define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 1000 +#endif + +#ifndef RGBLIGHT_EFFECT_CHRISTMAS_STEP +#define RGBLIGHT_EFFECT_CHRISTMAS_STEP 2 +#endif + +#ifndef RGBLIGHT_HUE_STEP +#define RGBLIGHT_HUE_STEP 10 +#endif +#ifndef RGBLIGHT_SAT_STEP +#define RGBLIGHT_SAT_STEP 17 +#endif +#ifndef RGBLIGHT_VAL_STEP +#define RGBLIGHT_VAL_STEP 17 +#endif + +#define RGBLED_TIMER_TOP F_CPU/(256*64) +// #define RGBLED_TIMER_TOP 0xFF10 + +#include <stdint.h> +#include <stdbool.h> +#include "eeconfig.h" +#ifndef RGBLIGHT_CUSTOM_DRIVER +#include "ws2812.h" +#endif +#include "rgblight_types.h" +#include "rgblight_list.h" + +extern LED_TYPE led[RGBLED_NUM]; + +extern const uint8_t RGBLED_BREATHING_INTERVALS[4] PROGMEM; +extern const uint8_t RGBLED_RAINBOW_MOOD_INTERVALS[3] PROGMEM; +extern const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[3] PROGMEM; +extern const uint8_t RGBLED_SNAKE_INTERVALS[3] PROGMEM; +extern const uint8_t RGBLED_KNIGHT_INTERVALS[3] PROGMEM; +extern const uint16_t RGBLED_RGBTEST_INTERVALS[1] PROGMEM; + +typedef union { + uint32_t raw; + struct { + bool enable :1; + uint8_t mode :6; + uint16_t hue :9; + uint8_t sat :8; + uint8_t val :8; + uint8_t speed :8;//EECONFIG needs to be increased to support this + }; +} rgblight_config_t; + +void rgblight_init(void); +void rgblight_increase(void); +void rgblight_decrease(void); +void rgblight_toggle(void); +void rgblight_enable(void); +void rgblight_disable(void); +void rgblight_step(void); +void rgblight_step_reverse(void); +uint8_t rgblight_get_mode(void); +void rgblight_mode(uint8_t mode); +void rgblight_set(void); +void rgblight_update_dword(uint32_t dword); +void rgblight_increase_hue(void); +void rgblight_decrease_hue(void); +void rgblight_increase_sat(void); +void rgblight_decrease_sat(void); +void rgblight_increase_val(void); +void rgblight_decrease_val(void); +void rgblight_increase_speed(void); +void rgblight_decrease_speed(void); +void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val); +uint16_t rgblight_get_hue(void); +uint8_t rgblight_get_sat(void); +uint8_t rgblight_get_val(void); +void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b); +void rgblight_setrgb_at(uint8_t r, uint8_t g, uint8_t b, uint8_t index); +void rgblight_sethsv_at(uint16_t hue, uint8_t sat, uint8_t val, uint8_t index); + +uint32_t eeconfig_read_rgblight(void); +void eeconfig_update_rgblight(uint32_t val); +void eeconfig_update_rgblight_default(void); +void eeconfig_debug_rgblight(void); + +void rgb_matrix_increase(void); +void rgb_matrix_decrease(void); + +void sethsv(uint16_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1); +void setrgb(uint8_t r, uint8_t g, uint8_t b, LED_TYPE *led1); + +void rgblight_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val); +void rgblight_mode_noeeprom(uint8_t mode); +void rgblight_toggle_noeeprom(void); +void rgblight_enable_noeeprom(void); +void rgblight_disable_noeeprom(void); + +void rgblight_sethsv_eeprom_helper(uint16_t hue, uint8_t sat, uint8_t val, bool write_to_eeprom); +void rgblight_mode_eeprom_helper(uint8_t mode, bool write_to_eeprom); + + +#define EZ_RGB(val) rgblight_show_solid_color((val >> 16) & 0xFF, (val >> 8) & 0xFF, val & 0xFF) +void rgblight_show_solid_color(uint8_t r, uint8_t g, uint8_t b); + +void rgblight_task(void); + +void rgblight_timer_init(void); +void rgblight_timer_enable(void); +void rgblight_timer_disable(void); +void rgblight_timer_toggle(void); +void rgblight_effect_breathing(uint8_t interval); +void rgblight_effect_rainbow_mood(uint8_t interval); +void rgblight_effect_rainbow_swirl(uint8_t interval); +void rgblight_effect_snake(uint8_t interval); +void rgblight_effect_knight(uint8_t interval); +void rgblight_effect_christmas(void); +void rgblight_effect_rgbtest(void); + +#endif diff --git a/keyboards/org60/keymaps/default/keymap.c b/keyboards/org60/keymaps/default/keymap.c index a158004977..bf5438657a 100644 --- a/keyboards/org60/keymaps/default/keymap.c +++ b/keyboards/org60/keymaps/default/keymap.c @@ -1,5 +1,4 @@ #include QMK_KEYBOARD_H -#include "action_layer.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboards/org60/keymaps/jarred/keymap.c b/keyboards/org60/keymaps/jarred/keymap.c new file mode 100644 index 0000000000..3397a1909c --- /dev/null +++ b/keyboards/org60/keymaps/jarred/keymap.c @@ -0,0 +1,25 @@ +#include QMK_KEYBOARD_H + +#define _QW 0 +#define _NV 1 + +// HHKB Layout +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QW] = LAYOUT( + KC_ESC, 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_BSLS, KC_GRV, \ + 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_BSPC, \ + MO(_NV), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXXX, KC_ENT, \ + KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, XXXXXXX, KC_RSFT, KC_ENT, \ + XXXXXXX, KC_LCTL, KC_LGUI, KC_SPC, XXXXXXX, KC_RALT, XXXXXXX, KC_RCTL, XXXXXXX), + + [_NV] = LAYOUT( + KC_GRV , 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_DEL ,KC_BSPC,_______,KC_HOME,KC_UP ,KC_END , KC_INS , _______, _______, _______, \ + _______, _______, _______, KC_LSFT,KC_LCTL, KC_ENT, _______,KC_LEFT,KC_DOWN,KC_RGHT, KC_DEL , KC_DEL , _______, _______, \ + _______, _______, _______, _______, _______,_______,_______,_______,KC_PGUP,KC_PGDN, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, RESET, _______), + +}; + + diff --git a/keyboards/orthodox/keymaps/default/config.h b/keyboards/orthodox/keymaps/default/config.h index 3df957b84c..ce4538b08a 100644 --- a/keyboards/orthodox/keymaps/default/config.h +++ b/keyboards/orthodox/keymaps/default/config.h @@ -19,10 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once /* Use I2C or Serial, not both */ @@ -44,6 +41,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. SONG(DVORAK_SOUND) \ } #endif - - -#endif diff --git a/keyboards/orthodox/orthodox.h b/keyboards/orthodox/orthodox.h index 51c5245527..6f8dad60ac 100644 --- a/keyboards/orthodox/orthodox.h +++ b/keyboards/orthodox/orthodox.h @@ -1,5 +1,6 @@ -#ifndef ORTHODOX_H -#define ORTHODOX_H +#pragma once + +#include "quantum.h" #ifdef KEYBOARD_orthodox_rev1 #include "rev1.h" @@ -25,7 +26,3 @@ { KC_##LR18, KC_##LR17, KC_##LR16, KC_##LR15, KC_##LR14, KC_##LR13, KC_##LR12, KC_NO, KC_##LR10 }, \ { KC_##LR28, KC_##LR27, KC_##LR26, KC_##LR25, KC_##LR24, KC_##LR23, KC_##LR22, KC_##LR21, KC_##LR20 } \ } - -#include "quantum.h" - -#endif diff --git a/keyboards/orthodox/rev1/config.h b/keyboards/orthodox/rev1/config.h index f7497c09c5..198fff5aca 100644 --- a/keyboards/orthodox/rev1/config.h +++ b/keyboards/orthodox/rev1/config.h @@ -19,8 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef REV1_CONFIG_H -#define REV1_CONFIG_H +#pragma once #include "config_common.h" @@ -49,6 +48,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW +#define SOFT_SERIAL_PIN D0 + /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST @@ -89,5 +90,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/orthodox/rev1/rev1.h b/keyboards/orthodox/rev1/rev1.h index e73263fb68..783dfb34b9 100644 --- a/keyboards/orthodox/rev1/rev1.h +++ b/keyboards/orthodox/rev1/rev1.h @@ -19,8 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef REV1_H -#define REV1_H +#pragma once #include "orthodox.h" @@ -42,7 +41,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. { R18, R17, R16, R15, R14, R13, R12, KC_NO, R10 }, \ { R28, R27, R26, R25, R24, R23, R22, R21, R20 } \ } - -#endif - - diff --git a/keyboards/orthodox/rev3/config.h b/keyboards/orthodox/rev3/config.h index d727ae674b..53e5b15ae8 100644 --- a/keyboards/orthodox/rev3/config.h +++ b/keyboards/orthodox/rev3/config.h @@ -19,8 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef REV3_CONFIG_H -#define REV3_CONFIG_H +#pragma once #include "config_common.h" @@ -54,6 +53,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW +#define SOFT_SERIAL_PIN D0 + /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST @@ -95,5 +96,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/orthodox/rev3/rev3.h b/keyboards/orthodox/rev3/rev3.h index 2be9b9605c..783dfb34b9 100644 --- a/keyboards/orthodox/rev3/rev3.h +++ b/keyboards/orthodox/rev3/rev3.h @@ -19,8 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef REV3_H -#define REV3_H +#pragma once #include "orthodox.h" @@ -42,6 +41,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. { R18, R17, R16, R15, R14, R13, R12, KC_NO, R10 }, \ { R28, R27, R26, R25, R24, R23, R22, R21, R20 } \ } - -#endif - diff --git a/keyboards/orthodox/rev3_teensy/config.h b/keyboards/orthodox/rev3_teensy/config.h index 591827fb97..54cbb823ec 100644 --- a/keyboards/orthodox/rev3_teensy/config.h +++ b/keyboards/orthodox/rev3_teensy/config.h @@ -19,8 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef REV3_TEENSY_CONFIG_H -#define REV3_TEENSY_CONFIG_H +#pragma once #include "config_common.h" @@ -46,6 +45,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW +#define SOFT_SERIAL_PIN D0 + /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST @@ -87,5 +88,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/orthodox/rev3_teensy/rev3_teensy.h b/keyboards/orthodox/rev3_teensy/rev3_teensy.h index 0081a0df01..783dfb34b9 100644 --- a/keyboards/orthodox/rev3_teensy/rev3_teensy.h +++ b/keyboards/orthodox/rev3_teensy/rev3_teensy.h @@ -19,8 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef REV3_TEENSY_H -#define REV3_TEENSY_H +#pragma once #include "orthodox.h" @@ -42,6 +41,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. { R18, R17, R16, R15, R14, R13, R12, KC_NO, R10 }, \ { R28, R27, R26, R25, R24, R23, R22, R21, R20 } \ } - -#endif - diff --git a/keyboards/orthodox/rules.mk b/keyboards/orthodox/rules.mk index 715f25c3a0..61878ea83c 100644 --- a/keyboards/orthodox/rules.mk +++ b/keyboards/orthodox/rules.mk @@ -1,8 +1,3 @@ -SRC += matrix.c \ - i2c.c \ - split_util.c \ - serial.c - # MCU name MCU = atmega32u4 @@ -40,7 +35,7 @@ F_USB = $(F_CPU) # Bootloader # This definition is optional, and if your keyboard supports multiple bootloaders of -# different sizes, comment this out, and the correct address will be loaded +# different sizes, comment this out, and the correct address will be loaded # automatically (+60). See bootloader.mk for all options. # Interrupt driven control endpoint task(+60) @@ -61,12 +56,10 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -SUBPROJECT_rev1 = yes -USE_I2C = yes +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -CUSTOM_MATRIX = yes +SPLIT_KEYBOARD = yes DEFAULT_FOLDER = orthodox/rev3 diff --git a/keyboards/orthodox/serial.c b/keyboards/orthodox/serial.c deleted file mode 100644 index fea57b6510..0000000000 --- a/keyboards/orthodox/serial.c +++ /dev/null @@ -1,230 +0,0 @@ -/* - * WARNING: be careful changing this code, it is very timing dependent - */ - -#ifndef F_CPU -#define F_CPU 16000000 -#endif - -#include <avr/io.h> -#include <avr/interrupt.h> -#include <util/delay.h> -#include <stdbool.h> -#include "serial.h" - -#ifndef USE_I2C - -// Serial pulse period in microseconds. Its probably a bad idea to lower this -// value. -#define SERIAL_DELAY 24 - -matrix_row_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; -matrix_row_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; - -#define ROW_MASK (((matrix_row_t)0-1)>>(8*sizeof(matrix_row_t)-MATRIX_COLS)) - -#define SLAVE_DATA_CORRUPT (1<<0) -volatile uint8_t status = 0; - -inline static -void serial_delay(void) { - _delay_us(SERIAL_DELAY); -} - -inline static -void serial_output(void) { - SERIAL_PIN_DDR |= SERIAL_PIN_MASK; -} - -// make the serial pin an input with pull-up resistor -inline static -void serial_input(void) { - SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -inline static -matrix_row_t serial_read_pin(void) { - return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); -} - -inline static -void serial_low(void) { - SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; -} - -inline static -void serial_high(void) { - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -void serial_master_init(void) { - serial_output(); - serial_high(); -} - -void serial_slave_init(void) { - serial_input(); - - // Enable INT0 - EIMSK |= _BV(INT0); - // Trigger on falling edge of INT0 - EICRA &= ~(_BV(ISC00) | _BV(ISC01)); -} - -// Used by the master to synchronize timing with the slave. -static -void sync_recv(void) { - serial_input(); - // This shouldn't hang if the slave disconnects because the - // serial line will float to high if the slave does disconnect. - while (!serial_read_pin()); - serial_delay(); -} - -// Used by the slave to send a synchronization signal to the master. -static -void sync_send(void) { - serial_output(); - - serial_low(); - serial_delay(); - - serial_high(); -} - -// Reads a byte from the serial line -static -matrix_row_t serial_read_byte(void) { - matrix_row_t byte = 0; - serial_input(); - for ( uint8_t i = 0; i < MATRIX_COLS; ++i) { - byte = (byte << 1) | serial_read_pin(); - serial_delay(); - _delay_us(1); - } - - return byte; -} - -// Sends a byte with MSB ordering -static -void serial_write_byte(matrix_row_t data) { - matrix_row_t b = MATRIX_COLS; - serial_output(); - while( b-- ) { - if(data & (1UL << b)) { - serial_high(); - } else { - serial_low(); - } - serial_delay(); - } -} - -// interrupt handle to be used by the slave device -ISR(SERIAL_PIN_INTERRUPT) { - sync_send(); - - matrix_row_t checksum = 0; - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_slave_buffer[i]); - sync_send(); - checksum += ROW_MASK & serial_slave_buffer[i]; - } - serial_write_byte(checksum); - sync_send(); - - // wait for the sync to finish sending - serial_delay(); - - // read the middle of pulses - _delay_us(SERIAL_DELAY/2); - - matrix_row_t checksum_computed = 0; - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_master_buffer[i] = serial_read_byte(); - sync_send(); - checksum_computed += ROW_MASK & serial_master_buffer[i]; - } - matrix_row_t checksum_received = serial_read_byte(); - sync_send(); - - serial_input(); // end transaction - - if ( checksum_computed != checksum_received ) { - status |= SLAVE_DATA_CORRUPT; - } else { - status &= ~SLAVE_DATA_CORRUPT; - } -} - -inline -bool serial_slave_DATA_CORRUPT(void) { - return status & SLAVE_DATA_CORRUPT; -} - -// Copies the serial_slave_buffer to the master and sends the -// serial_master_buffer to the slave. -// -// Returns: -// 0 => no error -// 1 => slave did not respond -int serial_update_buffers(void) { - // this code is very time dependent, so we need to disable interrupts - cli(); - - // signal to the slave that we want to start a transaction - serial_output(); - serial_low(); - _delay_us(1); - - // wait for the slaves response - serial_input(); - serial_high(); - _delay_us(SERIAL_DELAY); - - // check if the slave is present - if (serial_read_pin()) { - // slave failed to pull the line low, assume not present - sei(); - return 1; - } - - // if the slave is present syncronize with it - sync_recv(); - - matrix_row_t checksum_computed = 0; - // receive data from the slave - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_slave_buffer[i] = serial_read_byte(); - sync_recv(); - checksum_computed += ROW_MASK & serial_slave_buffer[i]; - } - matrix_row_t checksum_received = serial_read_byte(); - sync_recv(); - - if (checksum_computed != checksum_received) { - sei(); - return 1; - } - - matrix_row_t checksum = 0; - // send data to the slave - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_master_buffer[i]); - sync_recv(); - checksum += ROW_MASK & serial_master_buffer[i]; - } - serial_write_byte(checksum); - sync_recv(); - - // always, release the line when not in use - serial_output(); - serial_high(); - - sei(); - return 0; -} - -#endif diff --git a/keyboards/orthodox/serial.h b/keyboards/orthodox/serial.h deleted file mode 100644 index a46a98c947..0000000000 --- a/keyboards/orthodox/serial.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef MY_SERIAL_H -#define MY_SERIAL_H - -#include "config.h" -#include <stdbool.h> -#include "matrix.h" - -/* TODO: some defines for interrupt setup */ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND -#define SERIAL_PIN_MASK _BV(PD0) -#define SERIAL_PIN_INTERRUPT INT0_vect - -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -#define SERIAL_MASTER_BUFFER_LENGTH 1 - -// Buffers for master - slave communication -extern volatile matrix_row_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; -extern volatile matrix_row_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; - -void serial_master_init(void); -void serial_slave_init(void); -int serial_update_buffers(void); -bool serial_slave_data_corrupt(void); - -#endif diff --git a/keyboards/panc60/config.h b/keyboards/panc60/config.h index 00bdbc60f1..edb25ad274 100644 --- a/keyboards/panc60/config.h +++ b/keyboards/panc60/config.h @@ -39,5 +39,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define NO_BACKLIGHT_CLOCK #define BACKLIGHT_LEVELS 1 #define RGBLIGHT_ANIMATIONS - -#define NO_UART 1 diff --git a/keyboards/panc60/i2c.c b/keyboards/panc60/i2c.c deleted file mode 100644 index e8c4455ad1..0000000000 --- a/keyboards/panc60/i2c.c +++ /dev/null @@ -1,106 +0,0 @@ -/* -Copyright 2016 Luiz Ribeiro <luizribeiro@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/>. -*/ - -// Please do not modify this file - -#include <avr/io.h> -#include <util/twi.h> - -#include "i2c.h" - -void i2c_set_bitrate(uint16_t bitrate_khz) { - uint8_t bitrate_div = ((F_CPU / 1000l) / bitrate_khz); - if (bitrate_div >= 16) { - bitrate_div = (bitrate_div - 16) / 2; - } - TWBR = bitrate_div; -} - -void i2c_init(void) { - // set pull-up resistors on I2C bus pins - PORTC |= 0b11; - - i2c_set_bitrate(400); - - // enable TWI (two-wire interface) - TWCR |= (1 << TWEN); - - // enable TWI interrupt and slave address ACK - TWCR |= (1 << TWIE); - TWCR |= (1 << TWEA); -} - -uint8_t i2c_start(uint8_t address) { - // reset TWI control register - TWCR = 0; - - // begin transmission and wait for it to end - TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN); - while (!(TWCR & (1<<TWINT))); - - // check if the start condition was successfully transmitted - if ((TWSR & 0xF8) != TW_START) { - return 1; - } - - // transmit address and wait - TWDR = address; - TWCR = (1<<TWINT) | (1<<TWEN); - while (!(TWCR & (1<<TWINT))); - - // check if the device has acknowledged the READ / WRITE mode - uint8_t twst = TW_STATUS & 0xF8; - if ((twst != TW_MT_SLA_ACK) && (twst != TW_MR_SLA_ACK)) { - return 1; - } - - return 0; -} - -void i2c_stop(void) { - TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO); -} - -uint8_t i2c_write(uint8_t data) { - TWDR = data; - - // transmit data and wait - TWCR = (1<<TWINT) | (1<<TWEN); - while (!(TWCR & (1<<TWINT))); - - if ((TWSR & 0xF8) != TW_MT_DATA_ACK) { - return 1; - } - - return 0; -} - -uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length) { - if (i2c_start(address)) { - return 1; - } - - for (uint16_t i = 0; i < length; i++) { - if (i2c_write(data[i])) { - return 1; - } - } - - i2c_stop(); - - return 0; -} diff --git a/keyboards/panc60/matrix.c b/keyboards/panc60/matrix.c deleted file mode 100644 index cf0f63837b..0000000000 --- a/keyboards/panc60/matrix.c +++ /dev/null @@ -1,145 +0,0 @@ -/* -Copyright 2018 Jack Humbert <jack.humb@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 <avr/io.h> -#include <util/delay.h> -#include <string.h> -#include "matrix.h" - -#ifndef DEBOUNCE -# define DEBOUNCE 5 -#endif - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -__attribute__ ((weak)) -void matrix_init_user(void) { } - -__attribute__ ((weak)) -void matrix_scan_user(void) { } - -// #define MATRIX_ROW_PINS { B3, B4, B5, B6, B7 } -// #define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2, D7 } - -static uint8_t debouncing = DEBOUNCE; - -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -void matrix_init(void) { - - // disables JTAG so we can use them as columns - MCUCSR = (1<<JTD); - MCUCSR = (1<<JTD); - - // rows (output) - DDRB |= ((1 << 3) | (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7)); - PORTB |= ((1 << 3) | (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7)); - - // cols (input) - DDRA &= ~((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7)); - DDRC &= ~((1 << 7) | (1 << 6) | (1 << 5) | (1 << 4) | (1 << 3) | (1 << 2)); - DDRD &= ~((1 << 7)); - - // pull-up cols - PORTA |= ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7)); - PORTC |= ((1 << 7) | (1 << 6) | (1 << 5) | (1 << 4) | (1 << 3) | (1 << 2)); - PORTD |= ((1 << 7)); - - // initialize matrix state: all keys off - for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - matrix[row] = 0x00; - matrix_debouncing[row] = 0x00; - } - - matrix_init_quantum(); -} - -uint8_t matrix_scan(void) { - - // actual matrix scan - for (uint8_t c = 0; c < MATRIX_ROWS; c++) { - switch (c) { - case 0: PORTB &= ~(1 << 3); break; - case 1: PORTB &= ~(1 << 4); break; - case 2: PORTB &= ~(1 << 5); break; - case 3: PORTB &= ~(1 << 6); break; - case 4: PORTB &= ~(1 << 7); break; - } - _delay_us(5); - - matrix_row_t current_row = ( - (((PINA & (1 << 0)) ? 0 : 1 ) << 0) | - (((PINA & (1 << 1)) ? 0 : 1 ) << 1) | - (((PINA & (1 << 2)) ? 0 : 1 ) << 2) | - (((PINA & (1 << 3)) ? 0 : 1 ) << 3) | - (((PINA & (1 << 4)) ? 0 : 1 ) << 4) | - (((PINA & (1 << 5)) ? 0 : 1 ) << 5) | - (((PINA & (1 << 6)) ? 0 : 1 ) << 6) | - (((PINA & (1 << 7)) ? 0 : 1 ) << 7) | - (((PINC & (1 << 7)) ? 0 : 1 ) << 8) | - (((PINC & (1 << 6)) ? 0 : 1 ) << 9) | - (((PINC & (1 << 5)) ? 0 : 1 ) << 10) | - (((PINC & (1 << 4)) ? 0 : 1 ) << 11) | - (((PINC & (1 << 3)) ? 0 : 1 ) << 12) | - (((PINC & (1 << 2)) ? 0 : 1 ) << 13) | - (((PIND & (1 << 7)) ? 0 : 1 ) << 14) - ); - - switch (c) { - case 0: PORTB |= (1 << 3); break; - case 1: PORTB |= (1 << 4); break; - case 2: PORTB |= (1 << 5); break; - case 3: PORTB |= (1 << 6); break; - case 4: PORTB |= (1 << 7); break; - } - - if (matrix_debouncing[c] != current_row) { - matrix_debouncing[c] = current_row; - debouncing = DEBOUNCE; - } - } - - if (debouncing) { - if (--debouncing) { - _delay_ms(1); - } else { - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = matrix_debouncing[i]; - } - } - } - - matrix_scan_quantum(); - - return 1; -} - -inline matrix_row_t matrix_get_row(uint8_t row) { - return matrix[row]; -} - -void matrix_print(void) { -} diff --git a/keyboards/panc60/panc60.c b/keyboards/panc60/panc60.c index 9ac087dbf2..16674d30d2 100644 --- a/keyboards/panc60/panc60.c +++ b/keyboards/panc60/panc60.c @@ -24,7 +24,7 @@ #include <avr/pgmspace.h> #include "action_layer.h" -#include "i2c.h" +#include "i2c_master.h" #include "quantum.h" __attribute__ ((weak)) @@ -44,7 +44,7 @@ void rgblight_set(void) { } i2c_init(); - i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM); + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); } #endif diff --git a/keyboards/panc60/panc60.h b/keyboards/panc60/panc60.h index 95dcb1f90b..ee4569c615 100644 --- a/keyboards/panc60/panc60.h +++ b/keyboards/panc60/panc60.h @@ -13,8 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef PANC60_H -#define PANC60_H +#pragma once #include "quantum.h" @@ -67,5 +66,3 @@ { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, K3E }, \ { KC_NO, K41, K42, KC_NO, KC_NO, KC_NO, KC_NO, K47, KC_NO, KC_NO, K4A, KC_NO, K4C, KC_NO, KC_NO } \ } - -#endif diff --git a/keyboards/panc60/readme.md b/keyboards/panc60/readme.md index 05ac3d72be..737f238f6c 100644 --- a/keyboards/panc60/readme.md +++ b/keyboards/panc60/readme.md @@ -14,6 +14,8 @@ Make example for this keyboard (after setting up your build environment): Flashing +**Reset Key:** Hold down the key located at `K40`, commonly programmed as left control while plugging in the keyboard. You may also hold down the key located at `K00`, commonly programmed as the `Esc` key. + ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. To put the panc60 into reset, hold left control while plugging in. @@ -36,9 +38,9 @@ macOS: ``` 3. Install the following packages: ``` - brew install python - brew install pyusb - brew install --HEAD`https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb + brew install python3 + pip3 install pyusb + brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb 4. Place your keyboard into reset. 5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. diff --git a/keyboards/panc60/rules.mk b/keyboards/panc60/rules.mk index 588562a95b..8438751822 100644 --- a/keyboards/panc60/rules.mk +++ b/keyboards/panc60/rules.mk @@ -31,7 +31,7 @@ F_CPU = 12000000 BOOTLOADER = bootloadHID # build options -BOOTMAGIC_ENABLE = yes +BOOTMAGIC_ENABLE = lite MOUSEKEY_ENABLE = yes EXTRAKEY_ENABLE = yes CONSOLE_ENABLE = yes @@ -43,8 +43,7 @@ RGBLIGHT_CUSTOM_DRIVER = yes OPT_DEFS = -DDEBUG_LEVEL=0 # custom matrix setup -CUSTOM_MATRIX = yes -SRC = matrix.c i2c.c +SRC = i2c_master.c # programming options PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/panc60/usbconfig.h b/keyboards/panc60/usbconfig.h index d2d848fcdc..54a7d20f14 100644 --- a/keyboards/panc60/usbconfig.h +++ b/keyboards/panc60/usbconfig.h @@ -8,8 +8,7 @@ * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ */ -#ifndef __usbconfig_h_included__ -#define __usbconfig_h_included__ +#pragma once #include "config.h" @@ -392,5 +391,3 @@ section at the end of this file). /* #define USB_INTR_PENDING EIFR */ #define USB_INTR_PENDING_BIT INTF1 #define USB_INTR_VECTOR INT1_vect - -#endif /* __usbconfig_h_included__ */ diff --git a/keyboards/phantom/keymaps/default/config.h b/keyboards/phantom/keymaps/default/config.h index a3828f7d5d..09b8f1bc73 100644 --- a/keyboards/phantom/keymaps/default/config.h +++ b/keyboards/phantom/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/plaid/config.h b/keyboards/plaid/config.h new file mode 100644 index 0000000000..efef3ca18b --- /dev/null +++ b/keyboards/plaid/config.h @@ -0,0 +1,248 @@ +/* +Copyright 2019 Takuya Urakawa (dm9records.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 "config_common.h" + +/* USB Device descriptor parameter */ +/* VID & PID from vusb project, see tmk_core/protocol/vusb/USB-IDs-for-free.txt"*/ +#define VENDOR_ID 0x16c0 +#define PRODUCT_ID 0x27db +#define DEVICE_VER 0x0002 +#define MANUFACTURER dm9records +#define PRODUCT plaid +#define DESCRIPTION 12x4 ortholinear keyboard with through hole components + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* + * 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 { B4, B5, B3, D4 } +#define MATRIX_COL_PINS { B0, D7, D6, D5, B2, B1, C0, C1, C2, C3, D1, D0 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +#define NO_UART 1 + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +// #define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* 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. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* 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_HELP H +//#define MAGIC_KEY_HELP_ALT 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 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#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 B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#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 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/plaid/info.json b/keyboards/plaid/info.json new file mode 100644 index 0000000000..13bd05c149 --- /dev/null +++ b/keyboards/plaid/info.json @@ -0,0 +1,113 @@ +{ + "keyboard_name": "Plaid // Through Hole", + "keyboard_folder": "planid", + "url": "https://github.com/hsgw/plaid", + "maintainer": "hsgw", + "width": 12, + "height": 4, + "layouts": { + "LAYOUT_plaid_mit": { + "key_count": 47, + "layout": [ + { "w": 1, "x": 0, "y": 0 }, + { "w": 1, "x": 1, "y": 0 }, + { "w": 1, "x": 2, "y": 0 }, + { "w": 1, "x": 3, "y": 0 }, + { "w": 1, "x": 4, "y": 0 }, + { "w": 1, "x": 5, "y": 0 }, + { "w": 1, "x": 6, "y": 0 }, + { "w": 1, "x": 7, "y": 0 }, + { "w": 1, "x": 8, "y": 0 }, + { "w": 1, "x": 9, "y": 0 }, + { "w": 1, "x": 10, "y": 0 }, + { "w": 1, "x": 11, "y": 0 }, + { "w": 1, "x": 0, "y": 1 }, + { "w": 1, "x": 1, "y": 1 }, + { "w": 1, "x": 2, "y": 1 }, + { "w": 1, "x": 3, "y": 1 }, + { "w": 1, "x": 4, "y": 1 }, + { "w": 1, "x": 5, "y": 1 }, + { "w": 1, "x": 6, "y": 1 }, + { "w": 1, "x": 7, "y": 1 }, + { "w": 1, "x": 8, "y": 1 }, + { "w": 1, "x": 9, "y": 1 }, + { "w": 1, "x": 10, "y": 1 }, + { "w": 1, "x": 11, "y": 1 }, + { "w": 1, "x": 0, "y": 2 }, + { "w": 1, "x": 1, "y": 2 }, + { "w": 1, "x": 2, "y": 2 }, + { "w": 1, "x": 3, "y": 2 }, + { "w": 1, "x": 4, "y": 2 }, + { "w": 1, "x": 5, "y": 2 }, + { "w": 1, "x": 6, "y": 2 }, + { "w": 1, "x": 7, "y": 2 }, + { "w": 1, "x": 8, "y": 2 }, + { "w": 1, "x": 9, "y": 2 }, + { "w": 1, "x": 10, "y": 2 }, + { "w": 1, "x": 11, "y": 2 }, + { "w": 1, "x": 0, "y": 3 }, + { "w": 1, "x": 1, "y": 3 }, + { "w": 1, "x": 2, "y": 3 }, + { "w": 1, "x": 3, "y": 3 }, + { "w": 1, "x": 4, "y": 3 }, + { "w": 2, "x": 5, "y": 3 }, + { "w": 1, "x": 7, "y": 3 }, + { "w": 1, "x": 8, "y": 3 }, + { "w": 1, "x": 9, "y": 3 }, + { "w": 1, "x": 10, "y": 3 }, + { "w": 1, "x": 11, "y": 3 } ] + }, + "LAYOUT_plaid_grid": { + "key_count": 48, + "layout": [ + { "w": 1, "x": 0, "y": 0 }, + { "w": 1, "x": 1, "y": 0 }, + { "w": 1, "x": 2, "y": 0 }, + { "w": 1, "x": 3, "y": 0 }, + { "w": 1, "x": 4, "y": 0 }, + { "w": 1, "x": 5, "y": 0 }, + { "w": 1, "x": 6, "y": 0 }, + { "w": 1, "x": 7, "y": 0 }, + { "w": 1, "x": 8, "y": 0 }, + { "w": 1, "x": 9, "y": 0 }, + { "w": 1, "x": 10, "y": 0 }, + { "w": 1, "x": 11, "y": 0 }, + { "w": 1, "x": 0, "y": 1 }, + { "w": 1, "x": 1, "y": 1 }, + { "w": 1, "x": 2, "y": 1 }, + { "w": 1, "x": 3, "y": 1 }, + { "w": 1, "x": 4, "y": 1 }, + { "w": 1, "x": 5, "y": 1 }, + { "w": 1, "x": 6, "y": 1 }, + { "w": 1, "x": 7, "y": 1 }, + { "w": 1, "x": 8, "y": 1 }, + { "w": 1, "x": 9, "y": 1 }, + { "w": 1, "x": 10, "y": 1 }, + { "w": 1, "x": 11, "y": 1 }, + { "w": 1, "x": 0, "y": 2 }, + { "w": 1, "x": 1, "y": 2 }, + { "w": 1, "x": 2, "y": 2 }, + { "w": 1, "x": 3, "y": 2 }, + { "w": 1, "x": 4, "y": 2 }, + { "w": 1, "x": 5, "y": 2 }, + { "w": 1, "x": 6, "y": 2 }, + { "w": 1, "x": 7, "y": 2 }, + { "w": 1, "x": 8, "y": 2 }, + { "w": 1, "x": 9, "y": 2 }, + { "w": 1, "x": 10, "y": 2 }, + { "w": 1, "x": 11, "y": 2 }, + { "w": 1, "x": 0, "y": 3 }, + { "w": 1, "x": 1, "y": 3 }, + { "w": 1, "x": 2, "y": 3 }, + { "w": 1, "x": 3, "y": 3 }, + { "w": 1, "x": 4, "y": 3 }, + { "w": 1, "x": 5, "y": 3 }, + { "w": 1, "x": 6, "y": 3 }, + { "w": 1, "x": 7, "y": 3 }, + { "w": 1, "x": 8, "y": 3 }, + { "w": 1, "x": 9, "y": 3 }, + { "w": 1, "x": 10, "y": 3 }, + { "w": 1, "x": 11, "y": 3 } ] + } + } +} diff --git a/keyboards/plaid/keymaps/default/config.h b/keyboards/plaid/keymaps/default/config.h new file mode 100644 index 0000000000..5733b9e4b0 --- /dev/null +++ b/keyboards/plaid/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 Takuya Urakawa (dm9records.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 + +// place overrides here diff --git a/keyboards/plaid/keymaps/default/keymap.c b/keyboards/plaid/keymaps/default/keymap.c new file mode 100644 index 0000000000..f27abb0aa5 --- /dev/null +++ b/keyboards/plaid/keymaps/default/keymap.c @@ -0,0 +1,222 @@ +/* Copyright 2019 Takuya Urakawa (dm9records.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 QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum plaid_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST +}; + +enum plaid_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + EXT_PLV +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | RAlt | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_plaid_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + KC_LCTL, KC_RALT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | RAlt | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_plaid_grid( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + KC_LCTL, KC_RALT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | RAlt | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_plaid_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + KC_LCTL, KC_RALT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_plaid_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_plaid_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = LAYOUT_plaid_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_plaid_grid( + _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} diff --git a/keyboards/plaid/keymaps/default/readme.md b/keyboards/plaid/keymaps/default/readme.md new file mode 100644 index 0000000000..6f68e46af4 --- /dev/null +++ b/keyboards/plaid/keymaps/default/readme.md @@ -0,0 +1,2 @@ +# The default keymap for plaid +folk from planck diff --git a/keyboards/plaid/plaid.c b/keyboards/plaid/plaid.c new file mode 100644 index 0000000000..28f56d7f93 --- /dev/null +++ b/keyboards/plaid/plaid.c @@ -0,0 +1,43 @@ +/* Copyright 2019 Takuya Urakawa (dm9records.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 "plaid.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/plaid/plaid.h b/keyboards/plaid/plaid.h new file mode 100644 index 0000000000..4ebdcea11f --- /dev/null +++ b/keyboards/plaid/plaid.h @@ -0,0 +1,63 @@ +/* Copyright 2019 Takuya Urakawa (dm9records.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" + +#define LAYOUT_plaid_mit( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k35, k37, k38, k39, k3a, k3b } \ +} + +#define LAYOUT_plaid_grid( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b } \ +} + +// Used to create a keymap using only KC_ prefixed keys +#define KC_KEYMAP( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ + ) \ + LAYOUT_plaid_grid( \ + KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b, \ + KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b, \ + KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b, \ + KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b \ + ) + +#define KEYMAP LAYOUT_plaid_grid +#define LAYOUT_ortho_4x12 LAYOUT_plaid_grid +#define KC_LAYOUT_ortho_4x12 KC_KEYMAP diff --git a/keyboards/plaid/readme.md b/keyboards/plaid/readme.md new file mode 100644 index 0000000000..dd49ecbdf5 --- /dev/null +++ b/keyboards/plaid/readme.md @@ -0,0 +1,23 @@ +# plaid // Through Hole + +![plaid](https://i.imgur.com/tTi9yR9h.jpg) + +12x4 ortholinear keyboard with only through hole components. + +Keyboard Maintainer: [hsgw](https://github.com/hsgw) +Hardware Supported: ATMEGA328p with vusb [PCB](https://github.com/hsgw/plaid) +Hardware Availability: Group buy in r/mk + +Make example for this keyboard (after setting up your build environment): + make plaid:default + +Flash firmware: + // In bootloader mode + make plaid:default:program + +## Bootloader +use usbasploader in my repository. +https://github.com/hsgw/USBaspLoader/tree/plaid + + +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/plaid/rules.mk b/keyboards/plaid/rules.mk new file mode 100644 index 0000000000..3d66334b30 --- /dev/null +++ b/keyboards/plaid/rules.mk @@ -0,0 +1,101 @@ +# MCU name +#MCU = at90usb1286 +MCU = atmega328p +PROTOCOL = VUSB + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +# +# This uses usbaspbootloader +# BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 +OPT_DEFS += -DBOOTLOADER_SIZE=2048 + +# Flash program via avrdude, but default command is not suitable. +# You can use plaid:default:program +PROGRAM_CMD = avrdude -c usbasp -p m328p -U flash:w:$(BUILD_DIR)/$(TARGET).hex + + +# disable debug code +OPT_DEFS = -DDEBUG_LEVEL=0 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +# unsupported features for now +NO_UART = yes +NO_SUSPEND_POWER_DOWN = yes + + +LAYOUTS = ortho_4x12 planck_mit planck_grid +LAYOUTS_HAS_RGB = no diff --git a/keyboards/plaid/usbconfig.h b/keyboards/plaid/usbconfig.h new file mode 100644 index 0000000000..ea9fdd8ea6 --- /dev/null +++ b/keyboards/plaid/usbconfig.h @@ -0,0 +1,397 @@ +/* Name: usbconfig.h + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers + * Author: Christian Starkjohann + * Creation Date: 2005-04-01 + * Tabsize: 4 + * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ + */ + +#ifndef __usbconfig_h_included__ +#define __usbconfig_h_included__ + +#include "config.h" + +/* +General Description: +This file is an example configuration (with inline documentation) for the USB +driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is +also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may +wire the lines to any other port, as long as D+ is also wired to INT0 (or any +other hardware interrupt, as long as it is the highest level interrupt, see +section at the end of this file). +*/ + +/* ---------------------------- Hardware Config ---------------------------- */ + +#define USB_CFG_IOPORTNAME D +/* This is the port where the USB bus is connected. When you configure it to + * "B", the registers PORTB, PINB and DDRB will be used. + */ +#define USB_CFG_DMINUS_BIT 3 +/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. + * This may be any bit in the port. + */ +#define USB_CFG_DPLUS_BIT 2 +/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. + * This may be any bit in the port. Please note that D+ must also be connected + * to interrupt pin INT0! [You can also use other interrupts, see section + * "Optional MCU Description" below, or you can connect D- to the interrupt, as + * it is required if you use the USB_COUNT_SOF feature. If you use D- for the + * interrupt, the USB interrupt will also be triggered at Start-Of-Frame + * markers every millisecond.] + */ +#define USB_CFG_CLOCK_KHZ (F_CPU/1000) +/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, + * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code + * require no crystal, they tolerate +/- 1% deviation from the nominal + * frequency. All other rates require a precision of 2000 ppm and thus a + * crystal! + * Since F_CPU should be defined to your actual clock rate anyway, you should + * not need to modify this setting. + */ +#define USB_CFG_CHECK_CRC 0 +/* Define this to 1 if you want that the driver checks integrity of incoming + * data packets (CRC checks). CRC checks cost quite a bit of code size and are + * currently only available for 18 MHz crystal clock. You must choose + * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. + */ + +/* ----------------------- Optional Hardware Config ------------------------ */ + +/* #define USB_CFG_PULLUP_IOPORTNAME D */ +/* If you connect the 1.5k pullup resistor from D- to a port pin instead of + * V+, you can connect and disconnect the device from firmware by calling + * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). + * This constant defines the port on which the pullup resistor is connected. + */ +/* #define USB_CFG_PULLUP_BIT 4 */ +/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined + * above) where the 1.5k pullup resistor is connected. See description + * above for details. + */ + +/* --------------------------- Functional Range ---------------------------- */ + +#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 +/* Define this to 1 if you want to compile a version with two endpoints: The + * default control endpoint 0 and an interrupt-in endpoint (any other endpoint + * number). + */ +#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 +/* Define this to 1 if you want to compile a version with three endpoints: The + * default control endpoint 0, an interrupt-in endpoint 3 (or the number + * configured below) and a catch-all default interrupt-in endpoint as above. + * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. + */ +#define USB_CFG_EP3_NUMBER 3 +/* If the so-called endpoint 3 is used, it can now be configured to any other + * endpoint number (except 0) with this macro. Default if undefined is 3. + */ +/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ +/* The above macro defines the startup condition for data toggling on the + * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. + * Since the token is toggled BEFORE sending any data, the first packet is + * sent with the oposite value of this configuration! + */ +#define USB_CFG_IMPLEMENT_HALT 0 +/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature + * for endpoint 1 (interrupt endpoint). Although you may not need this feature, + * it is required by the standard. We have made it a config option because it + * bloats the code considerably. + */ +#define USB_CFG_SUPPRESS_INTR_CODE 0 +/* Define this to 1 if you want to declare interrupt-in endpoints, but don't + * want to send any data over them. If this macro is defined to 1, functions + * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if + * you need the interrupt-in endpoints in order to comply to an interface + * (e.g. HID), but never want to send any data. This option saves a couple + * of bytes in flash memory and the transmit buffers in RAM. + */ +#define USB_CFG_INTR_POLL_INTERVAL 1 +/* If you compile a version with endpoint 1 (interrupt-in), this is the poll + * interval. The value is in milliseconds and must not be less than 10 ms for + * low speed devices. + */ +#define USB_CFG_IS_SELF_POWERED 0 +/* Define this to 1 if the device has its own power supply. Set it to 0 if the + * device is powered from the USB bus. + */ +// max power draw with maxed white underglow measured at 120 mA (peaks) +#define USB_CFG_MAX_BUS_POWER 100 +/* Set this variable to the maximum USB bus power consumption of your device. + * The value is in milliamperes. [It will be divided by two since USB + * communicates power requirements in units of 2 mA.] + */ +#define USB_CFG_IMPLEMENT_FN_WRITE 1 +/* Set this to 1 if you want usbFunctionWrite() to be called for control-out + * transfers. Set it to 0 if you don't need it and want to save a couple of + * bytes. + */ +#define USB_CFG_IMPLEMENT_FN_READ 0 +/* Set this to 1 if you need to send control replies which are generated + * "on the fly" when usbFunctionRead() is called. If you only want to send + * data from a static buffer, set it to 0 and return the data from + * usbFunctionSetup(). This saves a couple of bytes. + */ +#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 +/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. + * You must implement the function usbFunctionWriteOut() which receives all + * interrupt/bulk data sent to any endpoint other than 0. The endpoint number + * can be found in 'usbRxToken'. + */ +#define USB_CFG_HAVE_FLOWCONTROL 0 +/* Define this to 1 if you want flowcontrol over USB data. See the definition + * of the macros usbDisableAllRequests() and usbEnableAllRequests() in + * usbdrv.h. + */ +#define USB_CFG_DRIVER_FLASH_PAGE 0 +/* If the device has more than 64 kBytes of flash, define this to the 64 k page + * where the driver's constants (descriptors) are located. Or in other words: + * Define this to 1 for boot loaders on the ATMega128. + */ +#define USB_CFG_LONG_TRANSFERS 0 +/* Define this to 1 if you want to send/receive blocks of more than 254 bytes + * in a single control-in or control-out transfer. Note that the capability + * for long transfers increases the driver size. + */ +/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ +/* This macro is a hook if you want to do unconventional things. If it is + * defined, it's inserted at the beginning of received message processing. + * If you eat the received message and don't want default processing to + * proceed, do a return after doing your things. One possible application + * (besides debugging) is to flash a status LED on each packet. + */ +/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ +/* This macro is a hook if you need to know when an USB RESET occurs. It has + * one parameter which distinguishes between the start of RESET state and its + * end. + */ +/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ +/* This macro (if defined) is executed when a USB SET_ADDRESS request was + * received. + */ +#define USB_COUNT_SOF 0 +/* define this macro to 1 if you need the global variable "usbSofCount" which + * counts SOF packets. This feature requires that the hardware interrupt is + * connected to D- instead of D+. + */ +/* #ifdef __ASSEMBLER__ + * macro myAssemblerMacro + * in YL, TCNT0 + * sts timer0Snapshot, YL + * endm + * #endif + * #define USB_SOF_HOOK myAssemblerMacro + * This macro (if defined) is executed in the assembler module when a + * Start Of Frame condition is detected. It is recommended to define it to + * the name of an assembler macro which is defined here as well so that more + * than one assembler instruction can be used. The macro may use the register + * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages + * immediately after an SOF pulse may be lost and must be retried by the host. + * What can you do with this hook? Since the SOF signal occurs exactly every + * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in + * designs running on the internal RC oscillator. + * Please note that Start Of Frame detection works only if D- is wired to the + * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! + */ +#define USB_CFG_CHECK_DATA_TOGGLING 0 +/* define this macro to 1 if you want to filter out duplicate data packets + * sent by the host. Duplicates occur only as a consequence of communication + * errors, when the host does not receive an ACK. Please note that you need to + * implement the filtering yourself in usbFunctionWriteOut() and + * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable + * for each control- and out-endpoint to check for duplicate packets. + */ +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 +/* define this macro to 1 if you want the function usbMeasureFrameLength() + * compiled in. This function can be used to calibrate the AVR's RC oscillator. + */ +#define USB_USE_FAST_CRC 0 +/* The assembler module has two implementations for the CRC algorithm. One is + * faster, the other is smaller. This CRC routine is only used for transmitted + * messages where timing is not critical. The faster routine needs 31 cycles + * per byte while the smaller one needs 61 to 69 cycles. The faster routine + * may be worth the 32 bytes bigger code size if you transmit lots of data and + * run the AVR close to its limit. + */ + +/* -------------------------- Device Description --------------------------- */ + +#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) +/* USB vendor ID for the device, low byte first. If you have registered your + * own Vendor ID, define it here. Otherwise you may use one of obdev's free + * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) +/* This is the ID of the product, low byte first. It is interpreted in the + * scope of the vendor ID. If you have registered your own VID with usb.org + * or if you have licensed a PID from somebody else, define it here. Otherwise + * you may use one of obdev's free shared VID/PID pairs. See the file + * USB-IDs-for-free.txt for details! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_VERSION 0x00, 0x01 +/* Version number of the device: Minor number first, then major number. + */ +#define USB_CFG_VENDOR_NAME 'd','m','9','r','e','c','o','r','d','s' +#define USB_CFG_VENDOR_NAME_LEN 10 +/* These two values define the vendor name returned by the USB device. The name + * must be given as a list of characters under single quotes. The characters + * are interpreted as Unicode (UTF-16) entities. + * If you don't want a vendor name string, undefine these macros. + * ALWAYS define a vendor name containing your Internet domain name if you use + * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for + * details. + */ +#define USB_CFG_DEVICE_NAME 'P', 'l', 'a', 'i', 'd' +#define USB_CFG_DEVICE_NAME_LEN 5 +/* Same as above for the device name. If you don't want a device name, undefine + * the macros. See the file USB-IDs-for-free.txt before you assign a name if + * you use a shared VID/PID. + */ +#define USB_CFG_SERIAL_NUMBER 'd','m','9','r','e','c','o','r','d','s','.','c','o','m',':','p','1' +#define USB_CFG_SERIAL_NUMBER_LEN 17 +/* Same as above for the serial number. If you don't want a serial number, + * undefine the macros. + * It may be useful to provide the serial number through other means than at + * compile time. See the section about descriptor properties below for how + * to fine tune control over USB descriptors such as the string descriptor + * for the serial number. + */ +#define USB_CFG_DEVICE_CLASS 0 +#define USB_CFG_DEVICE_SUBCLASS 0 +/* See USB specification if you want to conform to an existing device class. + * Class 0xff is "vendor specific". + */ +#define USB_CFG_INTERFACE_CLASS 3 /* HID */ +#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ +#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ +/* See USB specification if you want to conform to an existing device class or + * protocol. The following classes must be set at interface level: + * HID class is 3, no subclass and protocol required (but may be useful!) + * CDC class is 2, use subclass 2 and protocol 1 for ACM + */ +#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 +/* Define this to the length of the HID report descriptor, if you implement + * an HID device. Otherwise don't define it or define it to 0. + * If you use this define, you must add a PROGMEM character array named + * "usbHidReportDescriptor" to your code which contains the report descriptor. + * Don't forget to keep the array and this define in sync! + */ + +/* #define USB_PUBLIC static */ +/* Use the define above if you #include usbdrv.c instead of linking against it. + * This technique saves a couple of bytes in flash memory. + */ + +/* ------------------- Fine Control over USB Descriptors ------------------- */ +/* If you don't want to use the driver's default USB descriptors, you can + * provide our own. These can be provided as (1) fixed length static data in + * flash memory, (2) fixed length static data in RAM or (3) dynamically at + * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more + * information about this function. + * Descriptor handling is configured through the descriptor's properties. If + * no properties are defined or if they are 0, the default descriptor is used. + * Possible properties are: + * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched + * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is + * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if + * you want RAM pointers. + * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found + * in static memory is in RAM, not in flash memory. + * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), + * the driver must know the descriptor's length. The descriptor itself is + * found at the address of a well known identifier (see below). + * List of static descriptor names (must be declared PROGMEM if in flash): + * char usbDescriptorDevice[]; + * char usbDescriptorConfiguration[]; + * char usbDescriptorHidReport[]; + * char usbDescriptorString0[]; + * int usbDescriptorStringVendor[]; + * int usbDescriptorStringDevice[]; + * int usbDescriptorStringSerialNumber[]; + * Other descriptors can't be provided statically, they must be provided + * dynamically at runtime. + * + * Descriptor properties are or-ed or added together, e.g.: + * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) + * + * The following descriptors are defined: + * USB_CFG_DESCR_PROPS_DEVICE + * USB_CFG_DESCR_PROPS_CONFIGURATION + * USB_CFG_DESCR_PROPS_STRINGS + * USB_CFG_DESCR_PROPS_STRING_0 + * USB_CFG_DESCR_PROPS_STRING_VENDOR + * USB_CFG_DESCR_PROPS_STRING_PRODUCT + * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER + * USB_CFG_DESCR_PROPS_HID + * USB_CFG_DESCR_PROPS_HID_REPORT + * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) + * + * Note about string descriptors: String descriptors are not just strings, they + * are Unicode strings prefixed with a 2 byte header. Example: + * int serialNumberDescriptor[] = { + * USB_STRING_DESCRIPTOR_HEADER(6), + * 'S', 'e', 'r', 'i', 'a', 'l' + * }; + */ + +#define USB_CFG_DESCR_PROPS_DEVICE 0 +#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 +#define USB_CFG_DESCR_PROPS_STRINGS 0 +#define USB_CFG_DESCR_PROPS_STRING_0 0 +#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 +#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 +#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 +#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID 0 +#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 +#define USB_CFG_DESCR_PROPS_UNKNOWN 0 + +#define usbMsgPtr_t unsigned short +/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to + * a scalar type here because gcc generates slightly shorter code for scalar + * arithmetics than for pointer arithmetics. Remove this define for backward + * type compatibility or define it to an 8 bit type if you use data in RAM only + * and all RAM is below 256 bytes (tiny memory model in IAR CC). + */ + +/* ----------------------- Optional MCU Description ------------------------ */ + +/* The following configurations have working defaults in usbdrv.h. You + * usually don't need to set them explicitly. Only if you want to run + * the driver on a device which is not yet supported or with a compiler + * which is not fully supported (such as IAR C) or if you use a differnt + * interrupt than INT0, you may have to define some of these. + */ +/* #define USB_INTR_CFG MCUCR */ +/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE GIMSK */ +/* #define USB_INTR_ENABLE_BIT INT0 */ +/* #define USB_INTR_PENDING GIFR */ +/* #define USB_INTR_PENDING_BIT INTF0 */ +/* #define USB_INTR_VECTOR INT0_vect */ + +/* Set INT1 for D- falling edge to count SOF */ +/* #define USB_INTR_CFG EICRA */ +// #define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) +// /* #define USB_INTR_CFG_CLR 0 */ +// /* #define USB_INTR_ENABLE EIMSK */ +// #define USB_INTR_ENABLE_BIT INT1 +// /* #define USB_INTR_PENDING EIFR */ +// #define USB_INTR_PENDING_BIT INTF1 +// #define USB_INTR_VECTOR INT1_vect + +#endif /* __usbconfig_h_included__ */ diff --git a/keyboards/planck/keymaps/callum/config.h b/keyboards/planck/keymaps/callum/config.h new file mode 100644 index 0000000000..49f61dee55 --- /dev/null +++ b/keyboards/planck/keymaps/callum/config.h @@ -0,0 +1,7 @@ +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_INTERVAL 16 +#define MOUSEKEY_MAX_SPEED 10 +#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_WHEEL_DELAY 0 +#define MOUSEKEY_WHEEL_MAX_SPEED 8 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 60 diff --git a/keyboards/planck/keymaps/callum/keymap.c b/keyboards/planck/keymaps/callum/keymap.c index eca83d8320..02456aa7d8 100644 --- a/keyboards/planck/keymaps/callum/keymap.c +++ b/keyboards/planck/keymaps/callum/keymap.c @@ -13,6 +13,7 @@ enum planck_layers { _SYMB, _MOVE, _FUNC, + _MOUSE, }; enum planck_keycodes { @@ -21,6 +22,7 @@ enum planck_keycodes { SYMB, MOVE, FUNC, + MOUSE, }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -101,7 +103,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| * | | ~ | ` | + | = | | | \ | [ | ] | { | } | | * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | | | | | | | | | | | | + * | | | | | | | |Mouse| | | | | * `-----------------------------------------------------------------------' */ [_SYMB] = { @@ -122,41 +124,41 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }, { _______, _______, _______, _______, - _______, _______, _______, _______, + _______, _______, _______, MOUSE, _______, _______, _______, _______ } }, /* MOVE * ,-----------------------------------------------------------------------. - * | | | | | | | |Home | Up | End | | Esc | + * | | | | | | |CtrUp|Home | Up | End |Caps | Esc | * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | | | | | | |Left |Down |Right|Caps | Del | + * | | | | | | |SpaL |Left |Down |Right|SpaR | Del | * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | | | | | | |PgDn |PgUp |TabL |TabR | | + * | | | | | | |CtrDn|PgDn |PgUp |TabL |TabR | | * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | | | | | | | | | | | | + * | | | | |Mouse| | | | | | | | * `-----------------------------------------------------------------------' */ [_MOVE] = { { AC(KC_A), AC(KC_B), AC(KC_C), AC(KC_D), - AC(KC_E), AC(KC_F), XXXXXXX, KC_HOME, - KC_UP, KC_END, XXXXXXX, KC_ESC + AC(KC_E), AC(KC_F), C(KC_UP), KC_HOME, + KC_UP, KC_END, KC_CAPS, KC_ESC }, { AC(KC_G), AC(KC_H), AC(KC_I), AC(KC_J), - AC(KC_K), AC(KC_L), XXXXXXX, KC_LEFT, - KC_DOWN, KC_RGHT, KC_CAPS, KC_DEL + AC(KC_K), AC(KC_L), C(KC_LEFT), KC_LEFT, + KC_DOWN, KC_RGHT, C(KC_RIGHT), KC_DEL }, { _______, AC(KC_M), AC(KC_N), AC(KC_O), - AC(KC_P), AC(KC_Q), XXXXXXX, KC_PGDN, + AC(KC_P), AC(KC_Q), C(KC_DOWN), KC_PGDN, KC_PGUP, SC(KC_TAB), C(KC_TAB), _______ }, { _______, _______, _______, _______, - _______, _______, _______, _______, + MOUSE, _______, _______, _______, _______, _______, _______, _______ } }, @@ -167,7 +169,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| * |Power| F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 |VolDn| * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | | |TabL |TabR | | | | |Clmak|Qwrty| | + * | | |Home |TabL |TabR |End | | | |Clmak|Qwrty| | * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| * | | | | |Prev |Mute |Play |Next | | | | | * `-----------------------------------------------------------------------' @@ -184,8 +186,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_F18, KC_F19, KC_F20, KC_VOLD }, { - _______, XXXXXXX, XXXXXXX, SC(KC_TAB), - C(KC_TAB), XXXXXXX, XXXXXXX, XXXXXXX, + _______, XXXXXXX, KC_HOME, SC(KC_TAB), + C(KC_TAB), KC_END, XXXXXXX, XXXXXXX, XXXXXXX, COLEMAK, QWERTY, _______ }, { @@ -193,6 +195,40 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_MPRV, KC_MUTE, KC_MPLY, KC_MNXT, _______, _______, _______, _______ } + }, + + /* MOUSE + * ,-----------------------------------------------------------------------. + * | | | | | | | | ScL |Up | ScR | | | + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + * | | B4 | B3 | B2 | B1 | | |Left |Down |Right| | | + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + * | | | Ac0 | Ac1 | Ac2 | | | ScD | ScU | | | | + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------' + */ + [_MOUSE] = { + { + _______, _______, C(KC_LEFT), C(KC_UP), + C(KC_RIGHT), _______, _______, KC_WH_L, + KC_MS_U, KC_WH_R, _______, _______ + }, + { + _______, KC_BTN4, KC_BTN3, KC_BTN2, + KC_BTN1, _______, _______, KC_MS_L, + KC_MS_D, KC_MS_R, _______, _______ + }, + { + _______, _______, KC_ACL0, KC_ACL1, + KC_ACL2, _______, _______, KC_WH_D, + KC_WH_U, _______, _______, _______ + }, + { + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______ + } } }; @@ -250,6 +286,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { layer_off(_FUNC); } return false; + case MOUSE: + if (record->event.pressed) { + layer_on(_MOUSE); + } else { + layer_off(_MOUSE); + } + return false; // Override the defualt auto shifted symbols to use SEND_STRING // See https://github.com/qmk/qmk_firmware/issues/4072 diff --git a/keyboards/planck/keymaps/callum/readme.md b/keyboards/planck/keymaps/callum/readme.md index 176211cd4b..99b6dfbeff 100644 --- a/keyboards/planck/keymaps/callum/readme.md +++ b/keyboards/planck/keymaps/callum/readme.md @@ -17,68 +17,7 @@ This is a layout for the grid planck, built with a few ideals in mind: - There should be two of every modifier (one on each side), otherwise certain long key combinations become hard to make. -Keys are arranged as follows. Blank keys below may actually contain -undocumented shortcuts specific to my workflow. The base layer can be set to -colemak or qwerty (from the function layer). +A layout graphic can be found [here][keyboard-layout-editor] (excludes window +management keys). -``` -/* COLEMAK - * ,-----------------------------------------------------------------------. - * |Tab | Q | W | F | P | G | J | L | U | Y | ; | - | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * |Bksp | A | R | S | T | D | H | N | E | I | O | ' | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * |Shift| Z | X | C | V | B | K | M | , | . | / |Shift| - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * |FUNC |Super| Alt |Ctrl |SYMB |Enter|Space|MOVE |Ctrl | Alt |Super|FUNC | - * `-----------------------------------------------------------------------' - */ - -/* QWERTY - * ,-----------------------------------------------------------------------. - * |Tab | Q | W | E | R | T | Y | U | I | O | P | - | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * |Bksp | A | S | D | F | G | H | J | K | L | ; | ' | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * |Shift| Z | X | C | V | B | N | M | , | . | / |Shift| - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * |FUNC |Super| Alt |Ctrl |SYMB |Enter|Space|MOVE |Ctrl | Alt |Super|FUNC | - * `-----------------------------------------------------------------------' - */ - -/* SYMB - * ,-----------------------------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | ~ | ` | + | = | | | \ | [ | ] | { | } | | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | | | | | | | | | | | | - * `-----------------------------------------------------------------------' - */ - -/* MOVE - * ,-----------------------------------------------------------------------. - * | | | | | | | |Home | Up | End | | Esc | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | | | | | | |Left |Down |Right|Caps | Del | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | | | | | | |PgDn |PgUp | | | | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | | | | | | | | | | | | - * `-----------------------------------------------------------------------' - */ - -/* FUNC - * ,-----------------------------------------------------------------------. - * |Reset| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 |VolUp| - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * |Power| F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 |VolDn| - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | F21 | F22 | F23 | F24 | | | | |COLMK|QWRTY| | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | | | |Prev |Mute |Play |Next | | | | | - * `-----------------------------------------------------------------------' - */ - ``` +[keyboard-layout-editor]: http://www.keyboard-layout-editor.com/#/gists/ade5ec1f814bf83046489a4b632575ff diff --git a/keyboards/planck/keymaps/callum/rules.mk b/keyboards/planck/keymaps/callum/rules.mk index 25d398f080..4774c2c417 100644 --- a/keyboards/planck/keymaps/callum/rules.mk +++ b/keyboards/planck/keymaps/callum/rules.mk @@ -3,7 +3,7 @@ # the appropriate keymap folder that will get included automatically # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = yes # Commands for debug and configuration diff --git a/keyboards/planck/keymaps/davidrambo/config.h b/keyboards/planck/keymaps/davidrambo/config.h index 2decb3dc8d..ccb18de3dd 100644 --- a/keyboards/planck/keymaps/davidrambo/config.h +++ b/keyboards/planck/keymaps/davidrambo/config.h @@ -1,8 +1,6 @@ -#ifndef CONFIG_USER_H +#pragma once -#define CONFIG_USER_H #define TAPPING_TERM 200 -#include "../../config.h" #define PERMISSIVE_HOLD -#endif + diff --git a/keyboards/planck/keymaps/davidrambo/keymap.c b/keyboards/planck/keymaps/davidrambo/keymap.c index 2bf13f24ab..b827911944 100644 --- a/keyboards/planck/keymaps/davidrambo/keymap.c +++ b/keyboards/planck/keymaps/davidrambo/keymap.c @@ -1,5 +1,4 @@ -#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" -#include "planck.h" +#include QMK_KEYBOARD_H #define A_BSPC LALT(KC_BSPC) #define A_LEFT LALT(KC_LEFT) @@ -8,7 +7,7 @@ #define GSL LGUI(S(KC_LEFT)) #define GSR LGUI(S(KC_RGHT)) #define G_TAB LGUI(KC_TAB) -#define G_GRV LGUI(KC_GRV) // MAC: switch between windows within an application +#define G_GRV LGUI(KC_GRV) #define SftEnt SFT_T(KC_ENT) #define NAV LT(2, KC_TAB) @@ -21,8 +20,7 @@ enum { SFT_LCK }; -//alias for tapdance -#define SftLck TD(SFT_LCK) +#define SftLck TD(SFT_LCK) /* alias for tapdance */ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -38,12 +36,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ -[_COLEMAK] = { - {KC_GESC, KC_Q , KC_W , KC_F , KC_P , KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, - {NAV , KC_A , KC_R , KC_S , KC_T , KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, - {SftLck , KC_Z , KC_X , KC_C , KC_V , KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SftEnt }, - {KC_DEL , KC_LGUI, KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} - }, +[_COLEMAK] = LAYOUT_planck_grid( + KC_GESC, KC_Q , KC_W , KC_F , KC_P , KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + NAV , KC_A , KC_R , KC_S , KC_T , KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + SftLck , KC_Z , KC_X , KC_C , KC_V , KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SftEnt , + KC_DEL , KC_LGUI, KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), /* Symbol * ,-----------------------------------------------------------------------------------. @@ -51,26 +49,26 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+-------------+------+------+------+------+------| * | \| | ! | @ | # | $ | % | ^ | & | * | ( | ) | =+ | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | Home | End | ScUp | ScDn | F1 | F2 | -_ |Pg Up | | / | | + * | | Home | End | ScUp | ScDn | BRMD | BRMU | -_ |Pg Up | | / | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | `~ | | | |Alt(Bk)| | |Pg Dn | Vol- | Vol+ | | * `-----------------------------------------------------------------------------------' */ -[_SYMBOL] = { - {KC_LBRC, KC_1, KC_2, KC_3, KC_4 , KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_RBRC}, - {KC_BSLS, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_EQL }, - {_______, KC_HOME, KC_END, KC_WH_U, KC_WH_D,KC_F1 , KC_F2 , KC_MINS, KC_PGUP, _______, _______, _______}, - {KC_GRV, _______, _______, _______, A_BSPC, _______, _______, _______, KC_PGDN, KC_VOLD, KC_VOLU, KC_MUTE} - }, +[_SYMBOL] = LAYOUT_planck_grid( + KC_LBRC, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_RBRC, + KC_BSLS, KC_EXLM, KC_AT , KC_HASH, KC_DLR , KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_EQL , + _______, KC_HOME, KC_END , _______, _______, KC_BRMD, KC_BRMU, KC_MINS, KC_PGUP, _______, _______, _______, + KC_GRV, _______, _______, _______, A_BSPC , _______, _______, _______, KC_PGDN, KC_VOLD, KC_VOLU, KC_MUTE + ), /* Navigation*/ -[_NAVIGATION] = { - {_______, _______, _______, _______, _______, _______, C_TAB , A_LEFT, KC_UP, A_RGHT , KC_DEL , _______}, - {_______, _______, _______, _______, _______, _______, GSL , KC_LEFT, KC_DOWN, KC_RGHT, GSR , _______}, - {_______, _______, _______, _______, _______, _______, G_TAB , KC_HOME, _______, KC_END, G_GRV , _______}, - {RESET , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} -} +[_NAVIGATION] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, C_TAB , A_LEFT, KC_UP, A_RGHT , KC_DEL , _______, + _______, _______, _______, _______, _______, _______, GSL , KC_LEFT, KC_DOWN, KC_RGHT, GSR , _______, + _______, _______, _______, _______, _______, _______, G_TAB , KC_HOME, _______, KC_END, G_GRV , _______, + RESET , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) }; // Shift vs capslock function. From bbaserdem's Planck keymap. diff --git a/keyboards/planck/keymaps/davidrambo/rules.mk b/keyboards/planck/keymaps/davidrambo/rules.mk index 5e5ab38458..4272493950 100644 --- a/keyboards/planck/keymaps/davidrambo/rules.mk +++ b/keyboards/planck/keymaps/davidrambo/rules.mk @@ -1,3 +1,3 @@ TAP_DANCE_ENABLE = yes -MOUSEKEY_ENABLE = yes + diff --git a/keyboards/planck/keymaps/dsanchezseco/config.h b/keyboards/planck/keymaps/dsanchezseco/config.h new file mode 100644 index 0000000000..6fa31cc8a7 --- /dev/null +++ b/keyboards/planck/keymaps/dsanchezseco/config.h @@ -0,0 +1,39 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + diff --git a/keyboards/planck/keymaps/dsanchezseco/keymap.c b/keyboards/planck/keymaps/dsanchezseco/keymap.c new file mode 100644 index 0000000000..311cc110bf --- /dev/null +++ b/keyboards/planck/keymaps/dsanchezseco/keymap.c @@ -0,0 +1,116 @@ +/* Copyright 2015-2017 Jack Humbert + * + * 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 QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _DVORAK, + _LOWER, + _RAISE, + _ADJUST +}; + +enum planck_keycodes { + DVORAK, +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | / | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | - | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt | GUI |Lower | Space | Bksp |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINUS, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, + KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, KC_BSPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | AltGr| | | | Del | | Play | Vol- | Vol+ | Next | + * `-----------------------------------------------------------------------------------' + * ^-- sticky + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, KC_ENT, + _______, OSM(MOD_RALT), _______, _______, _______, _______, KC_DEL, _______, KC_MPLY, KC_VOLD, KC_VOLU, KC_MNXT +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | AltGr| | | | Del | | Play | Vol- | Vol+ | Next | + * `-----------------------------------------------------------------------------------' + * ^-- sticky + */ +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, KC_ENT, + _______, OSM(MOD_RALT), _______, _______, _______, _______, KC_DEL, _______, KC_MPLY, KC_VOLD, KC_VOLU, KC_MNXT +), + +/* Adjust (Lower + Raise) + * ,----------------------------------------------------------------------------------- + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap| | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} diff --git a/keyboards/planck/keymaps/dsanchezseco/readme.md b/keyboards/planck/keymaps/dsanchezseco/readme.md new file mode 100644 index 0000000000..de9680b498 --- /dev/null +++ b/keyboards/planck/keymaps/dsanchezseco/readme.md @@ -0,0 +1,2 @@ +# The Default Planck Layout + diff --git a/keyboards/planck/keymaps/dsanchezseco/rules.mk b/keyboards/planck/keymaps/dsanchezseco/rules.mk new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/keyboards/planck/keymaps/dsanchezseco/rules.mk @@ -0,0 +1 @@ + diff --git a/keyboards/planck/keymaps/msiu/config.h b/keyboards/planck/keymaps/msiu/config.h new file mode 100644 index 0000000000..40e399a675 --- /dev/null +++ b/keyboards/planck/keymaps/msiu/config.h @@ -0,0 +1,40 @@ +#pragma once + + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + diff --git a/keyboards/planck/keymaps/msiu/keymap.c b/keyboards/planck/keymaps/msiu/keymap.c new file mode 100644 index 0000000000..aea59e8d77 --- /dev/null +++ b/keyboards/planck/keymaps/msiu/keymap.c @@ -0,0 +1,208 @@ +#include QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _DVORAK, + _LOWER, + _RAISE, + _NUMB, + _FUNC, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + DVORAK, + BACKLIT, + EXT_PLV +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_QWERTY] = LAYOUT_planck_grid( + LT(_NUMB, KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + LCTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + KC_LCTL, KC_HYPR, KC_LALT, KC_LGUI, LOWER, MO(_FUNC), KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +[_DVORAK] = LAYOUT_planck_grid( + _______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, _______, + _______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + _______, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PGDN, KC_PGUP, KC_HOME, KC_END , KC_MUTE, + _______, _______, _______, _______, _______, _______, KC_MPLY, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT +), + +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + _______, KC_4, KC_5, KC_6, KC_PLUS, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_7, KC_8, KC_9, KC_MINS, KC_F11, KC_F12, KC_PGDN, KC_PGUP, KC_HOME, KC_END , KC_MUTE, + _______, _______, _______, _______, _______, _______, KC_MPLY, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT +), + +[_ADJUST] = LAYOUT_planck_grid( + _______, _______, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, DVORAK, _______, _______, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF,_______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET +), + +[_FUNC] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, KC_PSCR, _______, + _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_NUMB] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, _______, KC_BSPC, + _______, _______, _______, _______, _______, _______, _______, KC_4, KC_5, KC_6, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_1, KC_2, KC_3, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_0, KC_0, _______, _______, _______ +) + + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + PORTE &= ~(1<<6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + PORTE |= (1<<6); + #endif + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void encoder_update(bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + register_code(KC_PGDN); + unregister_code(KC_PGDN); + } else { + register_code(KC_PGUP); + unregister_code(KC_PGUP); + } + } +} + +void dip_update(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); + #endif + layer_on(_ADJUST); + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/msiu/readme.md b/keyboards/planck/keymaps/msiu/readme.md new file mode 100644 index 0000000000..de9680b498 --- /dev/null +++ b/keyboards/planck/keymaps/msiu/readme.md @@ -0,0 +1,2 @@ +# The Default Planck Layout + diff --git a/keyboards/planck/keymaps/msiu/rules.mk b/keyboards/planck/keymaps/msiu/rules.mk new file mode 100644 index 0000000000..dcf16bef39 --- /dev/null +++ b/keyboards/planck/keymaps/msiu/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/keymaps/piemod/README.md b/keyboards/planck/keymaps/piemod/README.md index f2a051da14..9c29e75db3 100644 --- a/keyboards/planck/keymaps/piemod/README.md +++ b/keyboards/planck/keymaps/piemod/README.md @@ -17,10 +17,6 @@ A keymap for users that need: Still a work-in-progress. Suggestions welcome @ https://github.com/dwrz/piemod. -### Keymap - -![PieMod Keymap](./keymap.png) - ### TODO - [ ] Add Emacs layer. diff --git a/keyboards/planck/keymaps/rjhilgefort/config.h b/keyboards/planck/keymaps/rjhilgefort/config.h new file mode 100644 index 0000000000..672c5d570f --- /dev/null +++ b/keyboards/planck/keymaps/rjhilgefort/config.h @@ -0,0 +1,35 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 diff --git a/keyboards/planck/keymaps/rjhilgefort/keymap.c b/keyboards/planck/keymaps/rjhilgefort/keymap.c new file mode 100644 index 0000000000..455aa5a364 --- /dev/null +++ b/keyboards/planck/keymaps/rjhilgefort/keymap.c @@ -0,0 +1,153 @@ +/* Copyright 2015-2017 Jack Humbert + * + * 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 QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +enum planck_keycodes { + // QWERTY = SAFE_RANGE, + BACKLIT, + EXT_PLV +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +#define CTRL_ESC MT(MOD_LCTL, KC_ESC) +#define HYPER LCTL(LALT(QK_LGUI)) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty +* ,-------------------------------------------------------------------------------------------------------. +* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | +* |--------+--------+--------+--------+--------+-------+-------+------+--------+--------+--------+--------| +* | Ct/Esc | A | S | D | F | G | H | J | K | L | ; | " | +* |--------+--------+--------+--------+--------+-------+-------+------+--------+--------+--------+--------| +* | Shift | Z | X | C | V | B | N | M | , | . | / | Enter | +* |--------+--------+--------+--------+--------+-------+-------+------+--------+--------+--------+--------| +* | | Ctrl | Raise | Alt | GUI | Space | Lowr | Hyper | | | Raise | +* `-------------------------------------------------------------------------------------------------------' +*/ +[_QWERTY] = LAYOUT_planck_grid( + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {CTRL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {_______, KC_LCTL, RAISE, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, LOWER, HYPER, _______, _______, RAISE } +), + +/* Lower +* ,-----------------------------------------------------------------------------------------------------------. +* | | \ | / | [ | ] | ~ | | | = | + | - | _ | | +* |-------+--------+--------+--------+--------+--------+--------+--------+--------+---------+--------+--------| +* | | { | } | ( | ) | ` | ← | ↓ | ↑ | → | Alt | | +* |-------+--------+--------+--------+--------+--------+--------+--------+--------+---------+--------+--------| +* | | ! | @ | # | $ | % | ^ | & | * | ( | ) | | +* |-------+--------+--------+--------+--------+--------+--------+--------+--------+---------+--------+--------| +* | | | | | | | | | | | | +* `-----------------------------------------------------------------------------------------------------------' +*/ +[_LOWER] = LAYOUT_planck_grid( + {_______, KC_BSLS, KC_SLSH, KC_LBRC, KC_RBRC, KC_TILD, KC_PIPE, KC_EQL, KC_PLUS, KC_MINS, KC_UNDS, _______}, + {_______, KC_LCBR, KC_RCBR, KC_LPRN, KC_RPRN, KC_GRV, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_LALT, _______}, + {_______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +), + +/* Raise +* ,----------------------------------------------------------------------------------------------------------. +* | | | | | | | | 7 | 8 | 9 | | | +* |-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| +* | | VolMte | Vol - | Vol + | Ply/Pse| | | 4 | 5 | 6 | | | +* |-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| +* | | Trak ← | Trak → | Scrn - | Scrn + | | | 1 | 2 | 3 | | | +* |-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| +* | | | | | | | | 0 | . | | | +* `----------------------------------------------------------------------------------------------------------' +*/ +[_RAISE] = LAYOUT_planck_grid( + {_______, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, _______, _______}, + {_______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY, _______, _______, KC_4, KC_5, KC_6, _______, _______}, + {_______, KC_MRWD, KC_MFFD, KC_SLCK, KC_PAUS, _______, _______, KC_1, KC_2, KC_3, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, KC_0, KC_0, KC_DOT, _______, _______} +), + +/* Adjust (Lower + Raise) + * ,----------------------------------------------------------------------------------------------------------. + * | | Reset | | | | | | | | | | Del | + * |-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | MuMod | AudOn | AudOff | | | Qwerty | | | | | + * |-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | Voice- | Voice+ | MusOn | Musoff | MIDIon | MIDIof | TermOn | TermOff| | | | + * |-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | | + * `----------------------------------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL }, + {_______, _______, MU_MOD, AU_ON, AU_OFF, _______, _______, QWERTY, _______, _______, _______, _______}, + {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} + +/* +* Example +* ,----------------------------------------------------------------------------------------------------------. +* | | | | | | | | | | | | | +* |-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| +* | | | | | | | | | | | | | +* |-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| +* | | | | | | | | | | | | | +* |-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| +* | | | | | | | | | | | | +* `----------------------------------------------------------------------------------------------------------' +* +[_EXAMPLE] = LAYOUT_planck_grid( + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +), +*/ diff --git a/keyboards/planck/keymaps/rjhilgefort/readme.md b/keyboards/planck/keymaps/rjhilgefort/readme.md new file mode 100644 index 0000000000..f446a76194 --- /dev/null +++ b/keyboards/planck/keymaps/rjhilgefort/readme.md @@ -0,0 +1,63 @@ +# [🐦 @rjhilgefort](https://twitter.com/rjhilgefort) Planck Layout + +A simple and practical layout featuring: + +- Hyper Key === CTRL + ALT + GUI +- Ctrl/Esc key that is CTRL when held and ESC when tapped +- Symbols layer that focuses on coding +- Numpad + media layer + +![Imgur](https://i.imgur.com/elygxAb.jpg) + + +## Main +``` +,-------------------------------------------------------------------------------------------------------. +| Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | +|--------|--------|--------|--------|--------|-------|-------|------|--------|--------|--------|--------| +| Ct/Esc | A | S | D | F | G | H | J | K | L | ; | " | +|--------|--------|--------|--------|--------|-------|-------|------|--------|--------|--------|--------| +| Shift | Z | X | C | V | B | N | M | , | . | / | Enter | +|--------|--------|--------|--------|--------|-------|-------|------|--------|--------|--------|--------| +| | Ctrl | Raise | Alt | GUI | Space | Lowr | Hyper | | | Raise | +`-------------------------------------------------------------------------------------------------------' +``` + +## Lower +``` +,-----------------------------------------------------------------------------------------------------------. +| | \ | / | [ | ] | ~ | | | = | + | - | _ | | +|-------|--------|--------|--------|--------|--------|--------|--------|--------|---------|--------|--------| +| | { | } | ( | ) | ` | ← | ↓ | ↑ | → | Alt | | +|-------|--------|--------|--------|--------|--------|--------|--------|--------|---------|--------|--------| +| | ! | @ | # | $ | % | ^ | & | * | ( | ) | | +|-------|--------|--------|--------|--------|--------|--------|--------|--------|---------|--------|--------| +| | | | | | | | | | | | +`-----------------------------------------------------------------------------------------------------------' +``` + +## Raise +``` +,----------------------------------------------------------------------------------------------------------. +| | | | | | | | 7 | 8 | 9 | | | +|-------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------| +| | VolMte | Vol - | Vol + | Ply/Pse| | | 4 | 5 | 6 | | | +|-------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------| +| | Trak ← | Trak → | Scrn - | Scrn + | | | 1 | 2 | 3 | | | +|-------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------| +| | | | | | | | 0 | . | | | +`----------------------------------------------------------------------------------------------------------' +``` + +## Adjust (Lower + Raise) +``` +,----------------------------------------------------------------------------------------------------------. +| | Reset | | | | | | | | | | Del | +|-------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------| +| | | MuMod | AudOn | AudOff | | | Qwerty | | | | | +|-------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------| +| | Voice- | Voice+ | MusOn | Musoff | MIDIon | MIDIof | TermOn | TermOff| | | | +|-------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------| +| | | | | | | | | | | | +`----------------------------------------------------------------------------------------------------------' +``` diff --git a/keyboards/planck/keymaps/rjhilgefort/rules.mk b/keyboards/planck/keymaps/rjhilgefort/rules.mk new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/keyboards/planck/keymaps/rjhilgefort/rules.mk diff --git a/keyboards/planck/keymaps/samuel/README.org b/keyboards/planck/keymaps/samuel/README.org index d0750ee03a..3c0f08a9d9 100644 --- a/keyboards/planck/keymaps/samuel/README.org +++ b/keyboards/planck/keymaps/samuel/README.org @@ -5,7 +5,7 @@ This is my qmk firmware for my keyboard. I grew tired of organizing the keycode array in plain text so I made it a literate .org file. I've never done this before, so bear with me. -* Keymap +* Layers #+BEGIN_COMMENT #+NAME: empty-layer @@ -19,7 +19,7 @@ before, so bear with me. #+END_COMMENT This is my "pretty" org mode organized table for my main dvorak layer. If you -don't use org mode, it won't be that exiting, but if you enjoy working in org +don't use org mode, it won't be that exciting, but if you enjoy working in org mode, you can edit this table directly, and this file is tangled to the actual keymap. No more organizing spaces or converting to and from comments. @@ -31,23 +31,45 @@ keymap. No more organizing spaces or converting to and from comments. | T_LGUI | T_LALT | UP | DOWN | BSPC | TAB | ENT | SPC | LEFT | RIGHT | T_RALT | T_RGUI | |--------+--------+------+------+------+-----+-----+-----+------+-------+--------+--------| +This qwerty layout is just so normal people can try out the board. Tap keys +would need to be customized I think, more on that later. I also put another +dvorak key here because I have nightmares of getting trapped in this forsaken +layout. + +#+NAME: qwerty-layer +|--------+--------+----+------+------+-----+-----+-----+------+-------+--------+--------| +| T_LRSE | Q | W | E | R | T | Y | U | I | O | P | T_RRSE | +| T_LSFT | A | S | D | F | G | H | J | K | L | SCLN | T_RSFT | +| T_LCTL | Z | X | C | V | B | N | M | COMM | DOT | QUOT | T_RCTL | +| T_LGUI | T_LALT | UP | DOWN | BSPC | TAB | ENT | SPC | LEFT | RIGHT | T_RALT | DVORAK | +|--------+--------+----+------+------+-----+-----+-----+------+-------+--------+--------| + I tried to keep my layout bare bones, just what would be available on a normal -keyboard, minus some keys I never used. The bottom left copies a normal +keyboard, minus some keys I never used. This one secondary layer should cover a +majority of the keys not found on the home layer. The bottom left copies a normal keyboards symbols from shifted numbers, and the rest is placed where convenient, with some considerations for one handed use, hence the shortcuts in the top left. -#+TODO: qwerty layer for ma friends - #+NAME: secondary-layer -|----+--------+--------+--------+--------+------+------+----+--------+--------+-----+----| -| -- | EZUNDO | EZCOPY | EZCUT | EZPSTE | INS | EQL | 7 | 8 | 9 | F11 | -- | -| -- | ESC | CAPS | PGUP | PGDN | F4 | ASTR | 4 | 5 | 6 | 0 | -- | -| -- | EXLM | AT | HASH | DLR | PERC | CIRC | 1 | 2 | 3 | F12 | -- | -| -- | -- | EZUP | EZDOWN | -- | AMPR | PIPE | -- | EZLEFT | EZRGHT | -- | -- | -|----+--------+--------+--------+--------+------+------+----+--------+--------+-----+----| - -But wait, we are missing several important keys!? yes, well, the modifier keys +|--------+--------+--------+--------+--------+------+------+-----+--------+--------+-------+--------| +| -- | EZUNDO | EZCOPY | EZCUT | EZPSTE | INS | EQL | 7 | 8 | 9 | -- | -- | +| EZSHFT | ESC | CAPS | PGUP | PGDN | HOME | ASTR | 4 | 5 | 6 | 0 | EZSHFT | +| EZCTRL | EXLM | AT | HASH | DLR | PERC | CIRC | 1 | 2 | 3 | COM | EZCTRL | +| EZGUI | EZALT | EZUP | EZDOWN | SPC | AMPR | PIPE | END | EZLEFT | EZRGHT | EZALT | EZGUI | +|--------+--------+--------+--------+--------+------+------+-----+--------+--------+-------+--------| + +Basic command layer for one-shot macros and function keys. + +#+NAME: command-layer +|----+-----+-----+-----+-----+--------+--------+------+-------+------+-----+----| +| -- | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | -- | +| -- | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | -- | +| -- | F21 | F22 | F23 | F24 | QWERTY | DVORAK | USER | EMAIL | NAME | -- | -- | +| -- | -- | -- | -- | -- | -- | -- | DIR | -- | -- | -- | -- | +|----+-----+-----+-----+-----+--------+--------+------+-------+------+-----+----| + +But wait, we are missing several important keys? well, yes, but the modifier keys all do other keys when tapped. More about that in the keymap section. * Keymap Conversion in Python @@ -55,7 +77,7 @@ all do other keys when tapped. More about that in the keymap section. This python can convert that table into the array needed for the keymap file. It simply prepends every key with "KC_". I used to use a dictionary to convert some keys from the table into qmk keycodes, but the double convertion was -unneccessary so I simply prepended all my macros with KC and moved all the +unneccessary so I just prepended all my macros with KC and moved all the implementation to the `process-user-input` function. #+NAME:layer-to-array @@ -84,55 +106,69 @@ return results * keymap.c -Now that we have done all the hard work, lets layout our keymap file then define -our macros. - -** Headers And Layer Declaration +Now that we laid out our layout, lets lay out our kemap file. #+BEGIN_SRC C :noweb yes #include QMK_KEYBOARD_H extern keymap_config_t keymap_config; -static uint16_t tap_timers[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - -char last_mod = -1; +#+END_SRC -enum planck_layers { - _DVORAK, - _RISE -}; +** Keycodes +#+BEGIN_SRC C :noweb yes // where the 'T_' communicates how the key does something different when tapped. enum planck_keycodes { - DVORAK = SAFE_RANGE, - KC_T_LALT, - KC_T_RALT, - KC_T_LGUI, - KC_T_RGUI, - KC_T_LCTL, - KC_T_RCTL, - KC_T_LSFT, - KC_T_RSFT, - KC_T_LRSE, - KC_T_RRSE, - KC_EZRGHT, - KC_EZLEFT, - KC_EZUP, - KC_EZDOWN, - KC_EZUNDO, - KC_EZCOPY, - KC_EZCUT, - KC_EZPSTE +//DVORAK = SAFE_RANGE, +KC_T_LALT = SAFE_RANGE, +KC_T_RALT, +KC_T_LGUI, +KC_T_RGUI, +KC_T_LCTL, +KC_T_RCTL, +KC_T_LSFT, +KC_T_RSFT, +KC_T_LRSE, +KC_T_RRSE, +KC_EZRGHT, +KC_EZLEFT, +KC_EZUP, +KC_EZDOWN, +KC_EZUNDO, +KC_EZCOPY, +KC_EZCUT, +KC_EZPSTE, +KC_EZSHFT, +KC_EZCTRL, +KC_EZGUI, +KC_EZALT, +KC_DVORAK, +KC_QWERTY, +KC_USER, +KC_EMAIL, +KC_NAME, +KC_DIR, +KC_COM }; -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - #+END_SRC ** Import Key table #+BEGIN_SRC C :noweb yes +enum planck_layers { +_DVORAK, +_QWERTY, +_RISE, +_COMMAND +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +#+END_SRC + +#+BEGIN_SRC C :noweb yes [_DVORAK] = #+END_SRC @@ -143,6 +179,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { #+END_SRC #+BEGIN_SRC C :noweb yes +[_QWERTY] = + +#+END_SRC + +#+BEGIN_SRC C :noweb yes +<<layer-to-array(qwerty-layer)>> + +#+END_SRC + +#+BEGIN_SRC C :noweb yes [_RISE] = #+END_SRC @@ -152,50 +198,96 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { #+END_SRC -** Process User Input -*** Tap Key Functionality +#+BEGIN_SRC C :noweb yes +[_COMMAND] = -These methods define how I implemented the tap mechanic. Basically, I believe -that /pressing/ any other key should be grounds for the hold functionality to be -assumed. My natuaral typing style experiences no delays from my method. +#+END_SRC + +#+BEGIN_SRC C :noweb yes +<<layer-to-array(command-layer)>> + +#+END_SRC #+BEGIN_SRC C :noweb yes }; -void mod_press(uint16_t hold_code, int id) { - tap_timers[id] = timer_read(); - last_mod = id; - register_code(hold_code); +#+END_SRC + +** Tap Keys + +I don't like tap keys coming out on release. When modified, I often let go of +the modifier too early because the tap button doesn't come out untill release. I +guess you could save the state of the board on press and then apply it after the +timer, but what I really want is the keys to come out on press when they can and +when it is most useful. For me, that is when they are modified a single time. So +I kind "locked" the board into only doing single modifiers, making them faster. +Disadvantages are double modified keys must be done with one shot keys (its +actually not that bad, it feels like emacs!) and triple modified keys are +impossible at the moment. + +#+BEGIN_SRC C :noweb yes + +static uint16_t tap_timer = 0; +char last_mod = 10; + +void mod_press(uint16_t tap_code, uint16_t hold_code, int id) { + // this first if body makes double modified keys impossible, but stops the + // delay when modifying a tap key which would result in the tap key not + // getting modified. + if (last_mod != id && last_mod != 10) { + tap_code16(tap_code); + last_mod = 10; + } else { + tap_timer = timer_read(); + last_mod = id; + register_code(hold_code); + } } void mod_lift(uint16_t tap_code, uint16_t hold_code, int id) { unregister_code(hold_code); - if (last_mod == id && timer_elapsed(tap_timers[id]) < TAPPING_TERM) { - tap_code16(tap_code); - last_mod = -1; + if (last_mod == id && timer_elapsed(tap_timer) < TAPPING_TERM) { + tap_code16(tap_code); + last_mod = 10; } } #+END_SRC -*** Set DVORAK layout - -The function that filter's user inputs and applies macros, the begginning is -pretty basic, setting our main layer and configuring our secondary layer. +** Process User Input #+BEGIN_SRC C :noweb yes bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case DVORAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_DVORAK); - } - return false; - break; + switch (keycode) { +#+END_SRC + +** Layouts + +Set Dvorak layout + +#+BEGIN_SRC C :noweb yes +case KC_DVORAK: +if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); +} +return true; +break; + +#+END_SRC + +Set Qwerty layout. + +#+BEGIN_SRC C :noweb yes +case KC_QWERTY: +if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); +} +return true; +break; #+END_SRC -*** Alt and () +** Alt and () Left and right alt are ( and ) when tapped. I put them on alt instead of a more conveniant key like control because parentheses do not need to be shift modified @@ -204,24 +296,24 @@ ever, unlike some other tap keys seen in the next sections. #+BEGIN_SRC C :noweb yes case KC_T_LALT: if (record->event.pressed) { - mod_press(KC_LALT, 0); - } else { - mod_lift(S(KC_9), KC_LALT, 0); - } + mod_press(S(KC_9), KC_LALT, 0); +} else { + mod_lift(S(KC_9), KC_LALT, 0); +} return false; break; case KC_T_RALT: if (record->event.pressed) { - mod_press(KC_RALT, 1); - } else { - mod_lift(S(KC_0), KC_RALT, 1); - } + mod_press(S(KC_0), KC_RALT, 1); +} else { + mod_lift(S(KC_0), KC_RALT, 1); +} return false; break; #+END_SRC -*** Gui and `\ +** Gui and `\ I place gui in the bottom corner because I believe it is the hardest key to reach, so gui seemed like a good fit for a dedicated key that I never want to @@ -231,24 +323,24 @@ number pad or shifted number keys. #+BEGIN_SRC C :noweb yes case KC_T_LGUI: if (record->event.pressed) { - mod_press(KC_LGUI, 2); - } else { - mod_lift(KC_GRAVE, KC_LGUI, 2); - } + mod_press(KC_GRAVE, KC_LGUI, 2); +} else { + mod_lift(KC_GRAVE, KC_LGUI, 2); +} return false; break; case KC_T_RGUI: if (record->event.pressed) { - mod_press(KC_RGUI, 3); - } else { - mod_lift(KC_BSLASH, KC_RGUI, 3); - } + mod_press(KC_BSLASH, KC_RGUI, 3); +} else { + mod_lift(KC_BSLASH, KC_RGUI, 3); +} return false; break; #+END_SRC -*** Ctrl and [] +** Ctrl and [] Left and right control are [] respectively when they are tapped, making { and } also very convenient. @@ -256,24 +348,24 @@ also very convenient. #+BEGIN_SRC C :noweb yes case KC_T_LCTL: if (record->event.pressed) { - mod_press(KC_LCTL, 4); - } else { - mod_lift(KC_LBRACKET, KC_LCTL, 4); - } + mod_press(KC_LBRACKET, KC_LCTL, 4); +} else { + mod_lift(KC_LBRACKET, KC_LCTL, 4); +} return false; break; case KC_T_RCTL: if (record->event.pressed) { - mod_press(KC_RCTL, 5); - } else { - mod_lift(KC_RBRACKET, KC_RCTL, 5); - } + mod_press(KC_RBRACKET, KC_RCTL, 5); +} else { + mod_lift(KC_RBRACKET, KC_RCTL, 5); +} return false; break; #+END_SRC -*** Shft and =- +** Shft and =- I place shift on the home row, so having '-' right of my pinkie is standard, and it only felt natural to put its opposite, '=/+' on the other side. I put an @@ -282,24 +374,24 @@ extra one on the right side in the secondary layer for the num pad. #+BEGIN_SRC C :noweb yes case KC_T_LSFT: if (record->event.pressed) { - mod_press(KC_LSFT, 6); - } else { - mod_lift(KC_EQUAL, KC_LSFT, 6); - } + mod_press(KC_EQUAL, KC_LSFT, 6); +} else { + mod_lift(KC_EQUAL, KC_LSFT, 6); +} return false; break; case KC_T_RSFT: if (record->event.pressed) { - mod_press(KC_RSFT, 7); - } else { - mod_lift(KC_MINUS, KC_RSFT, 7); - } + mod_press(KC_MINUS, KC_RSFT, 7); +} else { + mod_lift(KC_MINUS, KC_RSFT, 7); +} return false; break; #+END_SRC -*** Rise, DEL, and / +** Rise, DEL, and / I use the top corners as rise because I decided that I do not like using layers with my thumbs. It feels uncomfortable to hold keys down with the side of my @@ -315,36 +407,78 @@ corner again mimicing a standard dvorak keyboard. #+BEGIN_SRC C :noweb yes case KC_T_LRSE: if (record->event.pressed) { - tap_timers[8] = timer_read(); - last_mod = 8; - layer_on(_RISE); - } else { - layer_off(_RISE); - if (last_mod == 8 && timer_elapsed(tap_timers[8]) < TAPPING_TERM) { - tap_code16(KC_DELETE); - last_mod = -1; - } - } + tap_timer = timer_read(); + last_mod = 8; + layer_on(_RISE); +} else { + layer_off(_RISE); + if (last_mod == 8 && timer_elapsed(tap_timer) < TAPPING_TERM) { + tap_code16(KC_DELETE); + last_mod = 10; + } +} return false; break; case KC_T_RRSE: if (record->event.pressed) { - tap_timers[9] = timer_read(); - last_mod = 9; - layer_on(_RISE); - } else { - layer_off(_RISE); - if (last_mod == 9 && timer_elapsed(tap_timers[9]) < TAPPING_TERM) { - tap_code16(KC_SLASH); - last_mod = -1; - } - } + tap_timer = timer_read(); + last_mod = 9; + layer_on(_RISE); +} else { + layer_off(_RISE); + if (last_mod == 9 && timer_elapsed(tap_timer) < TAPPING_TERM) { + tap_code16(KC_SLASH); + last_mod = 10; + } +} return false; break; #+END_SRC -*** EZ keys +** EZ Keys + +EZ or "easy" keys do things that can already be done on the board, but I want an +easier way of doing them. + +*** One Shot Keys + +Since I made modified tap keys occur on press instead of release, I need one +shot keys to press any key with more than one modifier. + +#+BEGIN_SRC C :noweb yes +case KC_EZSHFT: +if (record->event.pressed) { + set_oneshot_mods(MOD_LSFT); + last_mod = 10; +} +return false; +break; +case KC_EZCTRL: +if (record->event.pressed) { + set_oneshot_mods(MOD_LCTL); + last_mod = 10; +} +return false; +break; +case KC_EZALT: +if (record->event.pressed) { + set_oneshot_mods(MOD_LALT); + last_mod = 10; +} +return false; +break; +case KC_EZGUI: +if (record->event.pressed) { + set_oneshot_mods(MOD_LGUI); + last_mod = 10; +} +return false; +break; + +#+END_SRC + +*** Arrows I use ctrl+shift+arrows keys a lot, so when the layer key is pressed they became lazy versions of themselves with control and shift already pressed. @@ -355,77 +489,134 @@ left hand like on a qwerty or colemek keyboard. #+BEGIN_SRC C :noweb yes case KC_EZRGHT: if (record->event.pressed) { - register_code(KC_LCTL); - tap_code16(S(KC_RGHT)); - unregister_code(KC_LCTL); - last_mod = -1; - } + register_code(KC_LCTL); + tap_code16(S(KC_RGHT)); + unregister_code(KC_LCTL); + last_mod = 10; +} return false; break; case KC_EZLEFT: if (record->event.pressed) { - register_code(KC_LCTL); - tap_code16(S(KC_LEFT)); - unregister_code(KC_LCTL); - last_mod = -1; - } + register_code(KC_LCTL); + tap_code16(S(KC_LEFT)); + unregister_code(KC_LCTL); + last_mod = 10; +} return false; break; case KC_EZDOWN: if (record->event.pressed) { - register_code(KC_LCTL); - tap_code16(S(KC_DOWN)); - unregister_code(KC_LCTL); - last_mod = -1; - } + register_code(KC_LCTL); + tap_code16(S(KC_DOWN)); + unregister_code(KC_LCTL); + last_mod = 10; +} return false; break; case KC_EZUP: if (record->event.pressed) { - register_code(KC_LCTL); - tap_code16(S(KC_UP)); - unregister_code(KC_LCTL); - last_mod = -1; - } + register_code(KC_LCTL); + tap_code16(S(KC_UP)); + unregister_code(KC_LCTL); + last_mod = 10; +} return false; break; +#+END_SRC + +*** Undo, Copy, Cut, Paste + +#+BEGIN_SRC C :noweb yes case KC_EZUNDO: if (record->event.pressed) { - tap_code16(C(KC_Z)); - last_mod = -1; + tap_code16(C(KC_Z)); + last_mod = 10; } return false; break; case KC_EZCOPY: if (record->event.pressed) { - tap_code16(C(KC_C)); - last_mod = -1; + tap_code16(C(KC_C)); + last_mod = 10; } return false; break; case KC_EZCUT: if (record->event.pressed) { - tap_code16(C(KC_X)); - last_mod = -1; + tap_code16(C(KC_X)); + last_mod = 10; } return false; break; case KC_EZPSTE: if (record->event.pressed) { - tap_code16(C(KC_P)); - last_mod = -1; + tap_code16(C(KC_V)); + last_mod = 10; +} +return false; +break; +#+END_SRC + +** Commands + +Start command layer one shot + +#+BEGIN_SRC C :noweb yes +case KC_COM: +if (record->event.pressed) { + layer_on(_COMMAND); + set_oneshot_layer(_COMMAND, ONESHOT_START); + last_mod = 10; +} else { + clear_oneshot_layer_state (ONESHOT_PRESSED); } return false; break; #+END_SRC -*** Standard inputs interupt tap +Just some strings I notice that I type a lot. + +#+BEGIN_SRC C :noweb yes +case KC_USER: +if (record->event.pressed) { + send_string("mhostley"); + last_mod = 10; +} +return true; +break; +case KC_EMAIL: +if (record->event.pressed) { + send_string("mhostley@gmail.com"); + last_mod = 10; +} +return true; +break; +case KC_NAME: +if (record->event.pressed) { + send_string("Samuel Jahnke"); + last_mod = 10; +} +return true; +break; +case KC_DIR: +if (record->event.pressed) { + send_string("home/mhostley/"); + last_mod = 10; +} +return true; +break; + +#+END_SRC + +** Standard inputs interupt tap Finally, if just a standard key is tapped, set the interupted flag. +Keep this last. #+BEGIN_SRC C :noweb yes - } - last_mod = -1; - return true; +} +last_mod = 10; +return true; } #+END_SRC diff --git a/keyboards/planck/keymaps/samuel/keymap.c b/keyboards/planck/keymaps/samuel/keymap.c index 53760da767..ff1424489f 100644 --- a/keyboards/planck/keymaps/samuel/keymap.c +++ b/keyboards/planck/keymaps/samuel/keymap.c @@ -2,36 +2,45 @@ extern keymap_config_t keymap_config; -static uint16_t tap_timers[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - -char last_mod = -1; - -enum planck_layers { - _DVORAK, - _RISE -}; - // where the 'T_' communicates how the key does something different when tapped. enum planck_keycodes { - DVORAK = SAFE_RANGE, - KC_T_LALT, - KC_T_RALT, - KC_T_LGUI, - KC_T_RGUI, - KC_T_LCTL, - KC_T_RCTL, - KC_T_LSFT, - KC_T_RSFT, - KC_T_LRSE, - KC_T_RRSE, - KC_EZRGHT, - KC_EZLEFT, - KC_EZUP, - KC_EZDOWN, - KC_EZUNDO, - KC_EZCOPY, - KC_EZCUT, - KC_EZPSTE +//DVORAK = SAFE_RANGE, +KC_T_LALT = SAFE_RANGE, +KC_T_RALT, +KC_T_LGUI, +KC_T_RGUI, +KC_T_LCTL, +KC_T_RCTL, +KC_T_LSFT, +KC_T_RSFT, +KC_T_LRSE, +KC_T_RRSE, +KC_EZRGHT, +KC_EZLEFT, +KC_EZUP, +KC_EZDOWN, +KC_EZUNDO, +KC_EZCOPY, +KC_EZCUT, +KC_EZPSTE, +KC_EZSHFT, +KC_EZCTRL, +KC_EZGUI, +KC_EZALT, +KC_DVORAK, +KC_QWERTY, +KC_USER, +KC_EMAIL, +KC_NAME, +KC_DIR, +KC_COM +}; + +enum planck_layers { +_DVORAK, +_QWERTY, +_RISE, +_COMMAND }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -44,202 +53,307 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { { KC_T_LGUI, KC_T_LALT, KC_UP, KC_DOWN, KC_BSPC, KC_TAB, KC_ENT, KC_SPC, KC_LEFT, KC_RIGHT, KC_T_RALT, KC_T_RGUI} }, +[_QWERTY] = + +{{ KC_T_LRSE, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_T_RRSE}, +{ KC_T_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_T_RSFT}, +{ KC_T_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_QUOT, KC_T_RCTL}, +{ KC_T_LGUI, KC_T_LALT, KC_UP, KC_DOWN, KC_BSPC, KC_TAB, KC_ENT, KC_SPC, KC_LEFT, KC_RIGHT, KC_T_RALT, KC_DVORAK} +}, + [_RISE] = -{{ KC_TRANSPARENT, KC_EZUNDO, KC_EZCOPY, KC_EZCUT, KC_EZPSTE, KC_INS, KC_EQL, KC_7, KC_8, KC_9, KC_F11, KC_TRANSPARENT}, -{ KC_TRANSPARENT, KC_ESC, KC_CAPS, KC_PGUP, KC_PGDN, KC_F4, KC_ASTR, KC_4, KC_5, KC_6, KC_0, KC_TRANSPARENT}, -{ KC_TRANSPARENT, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_1, KC_2, KC_3, KC_F12, KC_TRANSPARENT}, -{ KC_TRANSPARENT, KC_TRANSPARENT, KC_EZUP, KC_EZDOWN, KC_TRANSPARENT, KC_AMPR, KC_PIPE, KC_TRANSPARENT, KC_EZLEFT, KC_EZRGHT, KC_TRANSPARENT, KC_TRANSPARENT} +{{ KC_TRANSPARENT, KC_EZUNDO, KC_EZCOPY, KC_EZCUT, KC_EZPSTE, KC_INS, KC_EQL, KC_7, KC_8, KC_9, KC_TRANSPARENT, KC_TRANSPARENT}, +{ KC_EZSHFT, KC_ESC, KC_CAPS, KC_PGUP, KC_PGDN, KC_HOME, KC_ASTR, KC_4, KC_5, KC_6, KC_0, KC_EZSHFT}, +{ KC_EZCTRL, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_1, KC_2, KC_3, KC_COM, KC_EZCTRL}, +{ KC_EZGUI, KC_EZALT, KC_EZUP, KC_EZDOWN, KC_SPC, KC_AMPR, KC_PIPE, KC_END, KC_EZLEFT, KC_EZRGHT, KC_EZALT, KC_EZGUI} +}, + +[_COMMAND] = + +{{ KC_TRANSPARENT, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRANSPARENT}, +{ KC_TRANSPARENT, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_TRANSPARENT}, +{ KC_TRANSPARENT, KC_F21, KC_F22, KC_F23, KC_F24, KC_QWERTY, KC_DVORAK, KC_USER, KC_EMAIL, KC_NAME, KC_TRANSPARENT, KC_TRANSPARENT}, +{ KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_DIR, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT} }, }; -void mod_press(uint16_t hold_code, int id) { - tap_timers[id] = timer_read(); - last_mod = id; - register_code(hold_code); +static uint16_t tap_timer = 0; +char last_mod = 10; + +void mod_press(uint16_t tap_code, uint16_t hold_code, int id) { + // this first if body makes double modified keys impossible, but stops the + // delay when modifying a tap key which would result in the tap key not + // getting modified. + if (last_mod != id && last_mod != 10) { + tap_code16(tap_code); + last_mod = 10; + } else { + tap_timer = timer_read(); + last_mod = id; + register_code(hold_code); + } } void mod_lift(uint16_t tap_code, uint16_t hold_code, int id) { unregister_code(hold_code); - if (last_mod == id && timer_elapsed(tap_timers[id]) < TAPPING_TERM) { - tap_code16(tap_code); - last_mod = -1; + if (last_mod == id && timer_elapsed(tap_timer) < TAPPING_TERM) { + tap_code16(tap_code); + last_mod = 10; } } bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case DVORAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_DVORAK); - } - return false; - break; + switch (keycode) { + +case KC_DVORAK: +if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); +} +return true; +break; + +case KC_QWERTY: +if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); +} +return true; +break; case KC_T_LALT: if (record->event.pressed) { - mod_press(KC_LALT, 0); - } else { - mod_lift(S(KC_9), KC_LALT, 0); - } + mod_press(S(KC_9), KC_LALT, 0); +} else { + mod_lift(S(KC_9), KC_LALT, 0); +} return false; break; case KC_T_RALT: if (record->event.pressed) { - mod_press(KC_RALT, 1); - } else { - mod_lift(S(KC_0), KC_RALT, 1); - } + mod_press(S(KC_0), KC_RALT, 1); +} else { + mod_lift(S(KC_0), KC_RALT, 1); +} return false; break; case KC_T_LGUI: if (record->event.pressed) { - mod_press(KC_LGUI, 2); - } else { - mod_lift(KC_GRAVE, KC_LGUI, 2); - } + mod_press(KC_GRAVE, KC_LGUI, 2); +} else { + mod_lift(KC_GRAVE, KC_LGUI, 2); +} return false; break; case KC_T_RGUI: if (record->event.pressed) { - mod_press(KC_RGUI, 3); - } else { - mod_lift(KC_BSLASH, KC_RGUI, 3); - } + mod_press(KC_BSLASH, KC_RGUI, 3); +} else { + mod_lift(KC_BSLASH, KC_RGUI, 3); +} return false; break; case KC_T_LCTL: if (record->event.pressed) { - mod_press(KC_LCTL, 4); - } else { - mod_lift(KC_LBRACKET, KC_LCTL, 4); - } + mod_press(KC_LBRACKET, KC_LCTL, 4); +} else { + mod_lift(KC_LBRACKET, KC_LCTL, 4); +} return false; break; case KC_T_RCTL: if (record->event.pressed) { - mod_press(KC_RCTL, 5); - } else { - mod_lift(KC_RBRACKET, KC_RCTL, 5); - } + mod_press(KC_RBRACKET, KC_RCTL, 5); +} else { + mod_lift(KC_RBRACKET, KC_RCTL, 5); +} return false; break; case KC_T_LSFT: if (record->event.pressed) { - mod_press(KC_LSFT, 6); - } else { - mod_lift(KC_EQUAL, KC_LSFT, 6); - } + mod_press(KC_EQUAL, KC_LSFT, 6); +} else { + mod_lift(KC_EQUAL, KC_LSFT, 6); +} return false; break; case KC_T_RSFT: if (record->event.pressed) { - mod_press(KC_RSFT, 7); - } else { - mod_lift(KC_MINUS, KC_RSFT, 7); - } + mod_press(KC_MINUS, KC_RSFT, 7); +} else { + mod_lift(KC_MINUS, KC_RSFT, 7); +} return false; break; case KC_T_LRSE: if (record->event.pressed) { - tap_timers[8] = timer_read(); - last_mod = 8; - layer_on(_RISE); - } else { - layer_off(_RISE); - if (last_mod == 8 && timer_elapsed(tap_timers[8]) < TAPPING_TERM) { - tap_code16(KC_DELETE); - last_mod = -1; - } - } + tap_timer = timer_read(); + last_mod = 8; + layer_on(_RISE); +} else { + layer_off(_RISE); + if (last_mod == 8 && timer_elapsed(tap_timer) < TAPPING_TERM) { + tap_code16(KC_DELETE); + last_mod = 10; + } +} return false; break; case KC_T_RRSE: if (record->event.pressed) { - tap_timers[9] = timer_read(); - last_mod = 9; - layer_on(_RISE); - } else { - layer_off(_RISE); - if (last_mod == 9 && timer_elapsed(tap_timers[9]) < TAPPING_TERM) { - tap_code16(KC_SLASH); - last_mod = -1; - } - } + tap_timer = timer_read(); + last_mod = 9; + layer_on(_RISE); +} else { + layer_off(_RISE); + if (last_mod == 9 && timer_elapsed(tap_timer) < TAPPING_TERM) { + tap_code16(KC_SLASH); + last_mod = 10; + } +} +return false; +break; + +case KC_EZSHFT: +if (record->event.pressed) { + set_oneshot_mods(MOD_LSFT); + last_mod = 10; +} +return false; +break; +case KC_EZCTRL: +if (record->event.pressed) { + set_oneshot_mods(MOD_LCTL); + last_mod = 10; +} +return false; +break; +case KC_EZALT: +if (record->event.pressed) { + set_oneshot_mods(MOD_LALT); + last_mod = 10; +} +return false; +break; +case KC_EZGUI: +if (record->event.pressed) { + set_oneshot_mods(MOD_LGUI); + last_mod = 10; +} return false; break; case KC_EZRGHT: if (record->event.pressed) { - register_code(KC_LCTL); - tap_code16(S(KC_RGHT)); - unregister_code(KC_LCTL); - last_mod = -1; - } + register_code(KC_LCTL); + tap_code16(S(KC_RGHT)); + unregister_code(KC_LCTL); + last_mod = 10; +} return false; break; case KC_EZLEFT: if (record->event.pressed) { - register_code(KC_LCTL); - tap_code16(S(KC_LEFT)); - unregister_code(KC_LCTL); - last_mod = -1; - } + register_code(KC_LCTL); + tap_code16(S(KC_LEFT)); + unregister_code(KC_LCTL); + last_mod = 10; +} return false; break; case KC_EZDOWN: if (record->event.pressed) { - register_code(KC_LCTL); - tap_code16(S(KC_DOWN)); - unregister_code(KC_LCTL); - last_mod = -1; - } + register_code(KC_LCTL); + tap_code16(S(KC_DOWN)); + unregister_code(KC_LCTL); + last_mod = 10; +} return false; break; case KC_EZUP: if (record->event.pressed) { - register_code(KC_LCTL); - tap_code16(S(KC_UP)); - unregister_code(KC_LCTL); - last_mod = -1; - } + register_code(KC_LCTL); + tap_code16(S(KC_UP)); + unregister_code(KC_LCTL); + last_mod = 10; +} return false; break; + case KC_EZUNDO: if (record->event.pressed) { - tap_code16(C(KC_Z)); - last_mod = -1; + tap_code16(C(KC_Z)); + last_mod = 10; } return false; break; case KC_EZCOPY: if (record->event.pressed) { - tap_code16(C(KC_C)); - last_mod = -1; + tap_code16(C(KC_C)); + last_mod = 10; } return false; break; case KC_EZCUT: if (record->event.pressed) { - tap_code16(C(KC_X)); - last_mod = -1; + tap_code16(C(KC_X)); + last_mod = 10; } return false; break; case KC_EZPSTE: if (record->event.pressed) { - tap_code16(C(KC_P)); - last_mod = -1; + tap_code16(C(KC_V)); + last_mod = 10; } return false; break; - } - last_mod = -1; - return true; +case KC_COM: +if (record->event.pressed) { + layer_on(_COMMAND); + set_oneshot_layer(_COMMAND, ONESHOT_START); + last_mod = 10; +} else { + clear_oneshot_layer_state (ONESHOT_PRESSED); +} +return false; +break; + +case KC_USER: +if (record->event.pressed) { + send_string("mhostley"); + last_mod = 10; +} +return true; +break; +case KC_EMAIL: +if (record->event.pressed) { + send_string("mhostley@gmail.com"); + last_mod = 10; +} +return true; +break; +case KC_NAME: +if (record->event.pressed) { + send_string("Samuel Jahnke"); + last_mod = 10; +} +return true; +break; +case KC_DIR: +if (record->event.pressed) { + send_string("home/mhostley/"); + last_mod = 10; +} +return true; +break; + +} +last_mod = 10; +return true; } diff --git a/keyboards/planck/keymaps/tom/config.h b/keyboards/planck/keymaps/tom/config.h new file mode 100644 index 0000000000..6fa31cc8a7 --- /dev/null +++ b/keyboards/planck/keymaps/tom/config.h @@ -0,0 +1,39 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + diff --git a/keyboards/planck/keymaps/tom/keymap.c b/keyboards/planck/keymaps/tom/keymap.c new file mode 100644 index 0000000000..6e3b08938f --- /dev/null +++ b/keyboards/planck/keymaps/tom/keymap.c @@ -0,0 +1,264 @@ +/* Copyright 2015-2017 Jack Humbert + * + * 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 QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + BACKLIT +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; |Enter | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | Up |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | / | Left | Down |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_RSFT, + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT +), + + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Vol- | Vol+ |Brite-|Brite+| + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_QUOT, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, KC_BRMD, KC_BRMU +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Vol- | Vol+ |Brite-|Brite+| + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_QUOT, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, KC_BRMD, KC_BRMU +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + C(G(S(KC_4))), RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL, + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void encoder_update(bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); + #else + tap_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); + #else + tap_code(KC_PGUP); + #endif + } + } +} + +void dip_update(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); + #endif + layer_on(_ADJUST); + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} + +void rgb_matrix_indicators_user(void) { + #ifdef RGB_MATRIX_ENABLE + rgb_led led; + switch (biton32(layer_state)) { + case _RAISE: + for (int i = 0; i < DRIVER_LED_TOTAL; i++) { + led = g_rgb_leds[i]; + if ( led.modifier ) { + rgb_matrix_set_color(i, 0x6B, 0x00, 0x80); + } else { + rgb_matrix_set_color(i, 0x00, 0xFF, 0x00); + } + } + break; + + case _LOWER: + for (int i = 0; i < DRIVER_LED_TOTAL; i++) { + led = g_rgb_leds[i]; + if ( led.modifier ) { + rgb_matrix_set_color(i, 0xFF, 0xA5, 0x00); + } else { + rgb_matrix_set_color(i, 0x00, 0x67, 0xC7); + } + } + break; + + case _ADJUST: + for (int i = 0; i < DRIVER_LED_TOTAL; i++) { + rgb_matrix_set_color(i, 0xFF, 0x99, 0x00); + } + rgb_matrix_set_color(1, 0xFF, 0x00, 0x00); + break; + + default: + break; + } + #endif +} diff --git a/keyboards/planck/keymaps/tom/readme.md b/keyboards/planck/keymaps/tom/readme.md new file mode 100644 index 0000000000..8326cc13d8 --- /dev/null +++ b/keyboards/planck/keymaps/tom/readme.md @@ -0,0 +1,35 @@ +# tomholford's layout + +This layout is data-driven: I installed [WhatPulse](https://whatpulse.org/) a few months ago and generated a heatmap of the most frequently used keys. I also optimized for my most-used programming languages, and muscle memory. + +## Changes from Default + +### QWERTY + +- swap escape and tab +- rearrange arrows in original layout +- swap rshift and Enter +- map / to original location of left arrow key + +### RAISE + +- move backslash to backspace +- map quote to original location from qwerty layer +- map brightness up / down to original location of left and up arrows +- map volume up / down to original location of down and right arrows + +### LOWER + +- move pipe to backspace +- map quote to original location from qwerty layer +- map brightness up / down to original location of left and up arrows +- map volume up / down to original location of down and right arrows + +### ADJUST + +- map to esc key: screenshot region to clipboard - an alias for ctrl + cmd + shift + 4 + + +## RGB LED + +- Illuminate when pressing RAISE, LOWER, or ADJUST ([source](https://www.reddit.com/r/olkb/comments/8wvk8s/custom_rgb_configuration_by_keycodelayer/)) diff --git a/keyboards/planck/keymaps/tom/rules.mk b/keyboards/planck/keymaps/tom/rules.mk new file mode 100644 index 0000000000..dcf16bef39 --- /dev/null +++ b/keyboards/planck/keymaps/tom/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/preonic/keymaps/default/config.h b/keyboards/preonic/keymaps/default/config.h index 2053512582..40a9524b46 100644 --- a/keyboards/preonic/keymaps/default/config.h +++ b/keyboards/preonic/keymaps/default/config.h @@ -1,7 +1,4 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once #ifdef AUDIO_ENABLE #define STARTUP_SONG SONG(PREONIC_SOUND) @@ -38,5 +35,3 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 2 - -#endif
\ No newline at end of file diff --git a/keyboards/primekb/prime_e/keymaps/default/keymap.c b/keyboards/primekb/prime_e/keymaps/default/keymap.c index 47692c5413..0aab745cd5 100644 --- a/keyboards/primekb/prime_e/keymaps/default/keymap.c +++ b/keyboards/primekb/prime_e/keymaps/default/keymap.c @@ -44,20 +44,20 @@ void matrix_scan_user(void) { void led_set_user(uint8_t usb_led) { if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { - writePinLow(B2); - } else { writePinHigh(B2); + } else { + writePinLow(B2); } if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { - writePinLow(B1); - } else { writePinHigh(B1); + } else { + writePinLow(B1); } /* if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { - writePinLow(B3); - } else { writePinHigh(B3); + } else { + writePinLow(B3); }*/ } @@ -66,9 +66,9 @@ void led_set_user(uint8_t usb_led) { uint32_t layer_state_set_user(uint32_t state) { if (biton32(state) == 1) { - writePinLow(B3); + writePinHigh(B3); } else { - writePinHigh(B3); + writePinLow(B3); } return state; } diff --git a/keyboards/primekb/prime_e/keymaps/via/keymap.c b/keyboards/primekb/prime_e/keymaps/via/keymap.c index 9cc3e2f3d7..8b5b13866a 100644 --- a/keyboards/primekb/prime_e/keymaps/via/keymap.c +++ b/keyboards/primekb/prime_e/keymaps/via/keymap.c @@ -43,20 +43,20 @@ void matrix_scan_user(void) { void led_set_user(uint8_t usb_led) { if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { - writePinLow(B2); - } else { writePinHigh(B2); + } else { + writePinLow(B2); } if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { - writePinLow(B1); - } else { writePinHigh(B1); + } else { + writePinLow(B1); } /* if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { - writePinLow(B3); - } else { writePinHigh(B3); + } else { + writePinLow(B3); }*/ } @@ -65,9 +65,9 @@ void led_set_user(uint8_t usb_led) { uint32_t layer_state_set_user(uint32_t state) { if (biton32(state) == 1) { - writePinLow(B3); + writePinHigh(B3); } else { - writePinHigh(B3); + writePinLow(B3); } return state; } diff --git a/keyboards/primekb/prime_r/keymaps/default/config.h b/keyboards/primekb/prime_r/keymaps/default/config.h index e7ffd3aa20..a70a6b3726 100644 --- a/keyboards/primekb/prime_r/keymaps/default/config.h +++ b/keyboards/primekb/prime_r/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/ps2avrGB/README.md b/keyboards/ps2avrGB/README.md index 8399dff029..8a558b1586 100644 --- a/keyboards/ps2avrGB/README.md +++ b/keyboards/ps2avrGB/README.md @@ -30,7 +30,7 @@ $ brew cask install crosspack-avr $ brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb ``` -In order to use the `./program` script, which can reboot the board into +In order to use the `./util/atmega32a_program.py` script, which can reboot the board into the bootloader, you'll need Python 2 with PyUSB installed: ``` diff --git a/keyboards/ps2avrGB/keymaps/default/keymap.c b/keyboards/ps2avrGB/keymaps/default/keymap.c index 5c52e1d9b6..6b3403ed7c 100644 --- a/keyboards/ps2avrGB/keymaps/default/keymap.c +++ b/keyboards/ps2avrGB/keymaps/default/keymap.c @@ -15,7 +15,7 @@ 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 "bmini.h" +#include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = KEYMAP( diff --git a/keyboards/ps2avrGB/program b/keyboards/ps2avrGB/program deleted file mode 100755 index b777b91106..0000000000 --- a/keyboards/ps2avrGB/program +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/env python -# Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>, Sebastian Kaim <sebb@sebb767.de> -# -# 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/>. - -from __future__ import print_function - -import os -import sys -import time -import usb - - -def checkForKeyboardInNormalMode(): - """Returns a device if a ps2avrGB device in normal made (that is in keyboard mode) or None if it is not found.""" - return usb.core.find(idVendor=0x20A0, idProduct=0x422D) - -def checkForKeyboardInBootloaderMode(): - """Returns True if a ps2avrGB device in bootloader (flashable) mode is found and False otherwise.""" - return (usb.core.find(idVendor=0x16c0, idProduct=0x05df) is not None) - -def flashKeyboard(firmware_file): - """Calls bootloadHID to flash the given file to the device.""" - print('Flashing firmware to device ...') - if os.system('bootloadHID -r "%s"' % firmware_file) == 0: - print('\nDone!') - else: - print('\nbootloadHID returned an error.') - -def printDeviceInfo(dev): - """Prints all infos for a given USB device""" - print('Device Information:') - print(' idVendor: %d (0x%04x)' % (dev.idVendor, dev.idVendor)) - print(' idProduct: %d (0x%04x)' % (dev.idProduct, dev.idProduct)) - print('Manufacturer: %s' % (dev.iManufacturer)) - print('Serial: %s' % (dev.iSerialNumber)) - print('Product: %s' % (dev.iProduct), end='\n\n') - -def sendDeviceToBootloaderMode(dev): - """Tries to send a given ps2avrGB keyboard to bootloader mode to allow flashing.""" - try: - dev.set_configuration() - - request_type = usb.util.build_request_type( - usb.util.CTRL_OUT, - usb.util.CTRL_TYPE_CLASS, - usb.util.CTRL_RECIPIENT_DEVICE) - - USBRQ_HID_SET_REPORT = 0x09 - HID_REPORT_OPTION = 0x0301 - - dev.ctrl_transfer(request_type, USBRQ_HID_SET_REPORT, HID_REPORT_OPTION, 0, [0, 0, 0xFF] + [0] * 5) - except usb.core.USBError: - # for some reason I keep getting USBError, but it works! - pass - - -if len(sys.argv) < 2: - print('Usage: %s <firmware.hex>' % sys.argv[0]) - sys.exit(1) - -kb = checkForKeyboardInNormalMode() - -if kb is not None: - print('Found a keyboard in normal mode. Attempting to send it to bootloader mode ...', end='') - sendDeviceToBootloaderMode(kb) - print(' done.') - print("Hint: If your keyboard can't be set to bootloader mode automatically, plug it in while pressing the bootloader key to do so manually.") - print(" You can find more infos about this here: https://github.com/qmk/qmk_firmware/tree/master/keyboards/ps2avrGB#setting-the-board-to-bootloader-mode") - -attempts = 12 # 60 seconds -found = False -for attempt in range(1, attempts + 1): - print("Searching for keyboard in bootloader mode (%i/%i) ... " % (attempt, attempts), end='') - - if checkForKeyboardInBootloaderMode(): - print('Found', end='\n\n') - flashKeyboard(sys.argv[1]) - found = True - break - else: - print('Nothing.', end='') - - if attempt != attempts: # no need to wait on the last attempt - print(' Sleeping 5 seconds.', end='') - time.sleep(5) - - # print a newline - print() - -if not found: - print("Couldn't find a flashable keyboard. Aborting.") - sys.exit(2) - diff --git a/keyboards/ps2avrGB/ps2avrGB.h b/keyboards/ps2avrGB/ps2avrGB.h index e83861e1f2..bf4998f0c2 100644 --- a/keyboards/ps2avrGB/ps2avrGB.h +++ b/keyboards/ps2avrGB/ps2avrGB.h @@ -19,13 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define KEYMAP_COMMON_H #include "quantum.h" - -#ifdef KEYBOARD_ps2avrGB_bfake - #include "bfake.h" -#endif - -#ifdef KEYBOARD_ps2avrGB_bmini_x2 - #include "bmini_x2.h" -#endif +#include "bmini.h" #endif diff --git a/keyboards/ps2avrGB/rules.mk b/keyboards/ps2avrGB/rules.mk index 1be9edc24f..95d287f7f4 100644 --- a/keyboards/ps2avrGB/rules.mk +++ b/keyboards/ps2avrGB/rules.mk @@ -47,4 +47,4 @@ CUSTOM_MATRIX = yes SRC = matrix.c i2c.c # programming options -PROGRAM_CMD = ./keyboards/ps2avrGB/program $(TARGET).hex +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/quantrik/kyuu/config.h b/keyboards/quantrik/kyuu/config.h new file mode 100644 index 0000000000..655314985d --- /dev/null +++ b/keyboards/quantrik/kyuu/config.h @@ -0,0 +1,245 @@ +/* +Copyright 2019 mechmerlin + +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 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Quantrik +#define PRODUCT Kyuu +#define DESCRIPTION A 65% keyboard with blocker + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * 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 { B6, B5, B4, D7, D6 } +#define MATRIX_COL_PINS { F1, F4, F5, F6, F7, C7, C6, F0, B7, D0, D5, D3, D2, D1, B3 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +// #define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* 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. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* 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_HELP H +//#define MAGIC_KEY_HELP_ALT 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 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#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 B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#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 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/quantrik/kyuu/info.json b/keyboards/quantrik/kyuu/info.json new file mode 100644 index 0000000000..05c1b40b95 --- /dev/null +++ b/keyboards/quantrik/kyuu/info.json @@ -0,0 +1,82 @@ +{ + "keyboard_name": "Kyuu", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT": { + "key_count": 67, + "layout": [ + {"label":"K00 (B6,F1)", "x":0, "y":0}, + {"label":"K01 (B6,F4)", "x":1, "y":0}, + {"label":"K02 (B6,F5)", "x":2, "y":0}, + {"label":"K03 (B6,F6)", "x":3, "y":0}, + {"label":"K04 (B6,F7)", "x":4, "y":0}, + {"label":"K05 (B6,C7)", "x":5, "y":0}, + {"label":"K06 (B6,C6)", "x":6, "y":0}, + {"label":"K07 (B6,F0)", "x":7, "y":0}, + {"label":"K08 (B6,B7)", "x":8, "y":0}, + {"label":"K09 (B6,D0)", "x":9, "y":0}, + {"label":"K0A (B6,D5)", "x":10, "y":0}, + {"label":"K0B (B6,D3)", "x":11, "y":0}, + {"label":"K0C (B6,D2)", "x":12, "y":0}, + {"label":"K0D (B6,D1)", "x":13, "y":0}, + {"label":"K0E (B6,B3)", "x":14, "y":0}, + {"label":"K2E (B4,B3)", "x":15, "y":0}, + {"label":"K10 (B5,F1)", "x":0, "y":1, "w":1.5}, + {"label":"K11 (B5,F4)", "x":1.5, "y":1}, + {"label":"K12 (B5,F5)", "x":2.5, "y":1}, + {"label":"K13 (B5,F6)", "x":3.5, "y":1}, + {"label":"K14 (B5,F7)", "x":4.5, "y":1}, + {"label":"K15 (B5,C7)", "x":5.5, "y":1}, + {"label":"K16 (B5,C6)", "x":6.5, "y":1}, + {"label":"K17 (B5,F0)", "x":7.5, "y":1}, + {"label":"K18 (B5,B7)", "x":8.5, "y":1}, + {"label":"K19 (B5,D0)", "x":9.5, "y":1}, + {"label":"K1A (B5,D5)", "x":10.5, "y":1}, + {"label":"K1B (B5,D3)", "x":11.5, "y":1}, + {"label":"K1C (B5,D2)", "x":12.5, "y":1}, + {"label":"K1D (B5,D1)", "x":13.5, "y":1, "w":1.5}, + {"label":"K1E (B5,B3)", "x":15, "y":1}, + {"label":"K20 (B4,F1)", "x":0, "y":2, "w":1.75}, + {"label":"K21 (B4,F4)", "x":1.75, "y":2}, + {"label":"K22 (B4,F5)", "x":2.75, "y":2}, + {"label":"K23 (B4,F6)", "x":3.75, "y":2}, + {"label":"K24 (B4,F7)", "x":4.75, "y":2}, + {"label":"K25 (B4,C7)", "x":5.75, "y":2}, + {"label":"K26 (B4,C6)", "x":6.75, "y":2}, + {"label":"K27 (B4,F0)", "x":7.75, "y":2}, + {"label":"K28 (B4,B7)", "x":8.75, "y":2}, + {"label":"K29 (B4,D0)", "x":9.75, "y":2}, + {"label":"K2A (B4,D5)", "x":10.75, "y":2}, + {"label":"K2B (B4,D3)", "x":11.75, "y":2}, + {"label":"K2C (B4,D2)", "x":12.75, "y":2, "w":2.25}, + {"label":"K2D (B4,D1)", "x":15, "y":2}, + {"label":"K30 (D7,F1)", "x":0, "y":3, "w":2.25}, + {"label":"K31 (D7,F4)", "x":2.25, "y":3}, + {"label":"K32 (D7,F5)", "x":3.25, "y":3}, + {"label":"K33 (D7,F6)", "x":4.25, "y":3}, + {"label":"K34 (D7,F7)", "x":5.25, "y":3}, + {"label":"K35 (D7,C7)", "x":6.25, "y":3}, + {"label":"K36 (D7,C6)", "x":7.25, "y":3}, + {"label":"K37 (D7,F0)", "x":8.25, "y":3}, + {"label":"K38 (D7,B7)", "x":9.25, "y":3}, + {"label":"K39 (D7,D0)", "x":10.25, "y":3}, + {"label":"K3A (D7,D5)", "x":11.25, "y":3}, + {"label":"K3B (D7,D3)", "x":12.25, "y":3, "w":1.75}, + {"label":"K3C (D7,D2)", "x":14, "y":3}, + {"label":"K3D (D7,D1)", "x":15, "y":3}, + {"label":"K40 (D6,F1)", "x":0, "y":4, "w":1.5}, + {"label":"K41 (D6,F4)", "x":1.5, "y":4}, + {"label":"K42 (D6,F5)", "x":2.5, "y":4, "w":1.5}, + {"label":"K46 (D6,C6)", "x":4, "y":4, "w":7}, + {"label":"K4A (D6,D5)", "x":11, "y":4, "w":1.5}, + {"label":"K4B (D6,D3)", "x":13, "y":4}, + {"label":"K4C (D6,D2)", "x":14, "y":4}, + {"label":"K4D (D6,D1)", "x":15, "y":4} + ] + } + } + } +
\ No newline at end of file diff --git a/keyboards/quantrik/kyuu/keymaps/default/config.h b/keyboards/quantrik/kyuu/keymaps/default/config.h new file mode 100644 index 0000000000..60dd02a9d0 --- /dev/null +++ b/keyboards/quantrik/kyuu/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 mechmerlin + * + * 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 + +// place overrides here diff --git a/keyboards/quantrik/kyuu/keymaps/default/keymap.c b/keyboards/quantrik/kyuu/keymaps/default/keymap.c new file mode 100644 index 0000000000..077d7ac5a6 --- /dev/null +++ b/keyboards/quantrik/kyuu/keymaps/default/keymap.c @@ -0,0 +1,74 @@ +/* Copyright 2019 mechmerlin + * + * 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 QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( \ + KC_ESC, 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_BSLS, KC_GRV, KC_HOME, \ + 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_BSPC, KC_PGUP, \ + 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_PGDN, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_UP, KC_END, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [1] = LAYOUT( \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, QMKBEST, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/quantrik/kyuu/keymaps/default/readme.md b/keyboards/quantrik/kyuu/keymaps/default/readme.md new file mode 100644 index 0000000000..f87ce36e38 --- /dev/null +++ b/keyboards/quantrik/kyuu/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for Kyuu diff --git a/keyboards/quantrik/kyuu/kyuu.c b/keyboards/quantrik/kyuu/kyuu.c new file mode 100644 index 0000000000..e9a72a5749 --- /dev/null +++ b/keyboards/quantrik/kyuu/kyuu.c @@ -0,0 +1,43 @@ +/* Copyright 2019 mechmerlin + * + * 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 "kyuu.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/quantrik/kyuu/kyuu.h b/keyboards/quantrik/kyuu/kyuu.h new file mode 100644 index 0000000000..82c024f2e7 --- /dev/null +++ b/keyboards/quantrik/kyuu/kyuu.h @@ -0,0 +1,42 @@ +/* Copyright 2019 mechmerlin + * + * 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" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k2E, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, \ + k40, k41, k42, k46, k47, k4A, k4B, k4C, k4D \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, KC_NO, k2E }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, KC_NO }, \ + { k40, k41, k42, KC_NO, KC_NO, KC_NO, k46, k47, KC_NO, KC_NO, k4A, k4B, k4C, k4D, KC_NO }, \ +} + diff --git a/keyboards/quantrik/kyuu/readme.md b/keyboards/quantrik/kyuu/readme.md new file mode 100644 index 0000000000..2b33140980 --- /dev/null +++ b/keyboards/quantrik/kyuu/readme.md @@ -0,0 +1,13 @@ +# kyuu + +Kyuu is a 65% keyboard inspired by the TGR 910's top right blocker. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: Quantrik 65% PCB +Hardware Availability: [Geekhack Group Buy](https://geekhack.org/index.php?topic=97810.0), [quantrik.com](https://www.quantrik.com/collections/frontpage/products/kyuu-keyboard) + +Make example for this keyboard (after setting up your build environment): + + make quantrik/kyuu:default + +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/quantrik/kyuu/rules.mk b/keyboards/quantrik/kyuu/rules.mk new file mode 100644 index 0000000000..3229957d9c --- /dev/null +++ b/keyboards/quantrik/kyuu/rules.mk @@ -0,0 +1,81 @@ +# MCU name +#MCU = at90usb1286 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/rama/koyu/config.h b/keyboards/rama/koyu/config.h new file mode 100644 index 0000000000..12dc3d02b5 --- /dev/null +++ b/keyboards/rama/koyu/config.h @@ -0,0 +1,127 @@ +/* Copyright 2017 Jason Williams (Wilba) + * + * 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 0x5241 // "RW" +#define PRODUCT_ID 0x4B59 // "KY" +#define DEVICE_VER 0x0001 +#define MANUFACTURER RAMA.WORKS +#define PRODUCT RAMA KOYU +#define DESCRIPTION RAMA KOYU Keyboard + + + +// key matrix size +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +// KOYU PCB pin-out +#define MATRIX_ROW_PINS { F0, F1, F4, F6, F7 } +#define MATRIX_COL_PINS { F5, D5, B1, B2, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6, D4 } +#define UNUSED_PINS + +// IS31FL3731 driver +#define DRIVER_COUNT 2 +#define DRIVER_LED_TOTAL 72 + +// COL2ROW or ROW2COL +#define DIODE_DIRECTION COL2ROW + +// Set 0 if debouncing isn't needed +#define DEBOUNCING_DELAY 5 + +// 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 + + +/* + * 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 + +#define RGB_BACKLIGHT_ENABLED 1 + +// This conditionally compiles the backlight code for KOYU specifics +#define RGB_BACKLIGHT_KOYU + +// enable/disable LEDs based on layout +// they aren't really used if RGB_BACKLIGHT_M60_A defined +#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 1 +#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0 +#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 1 +#define RGB_BACKLIGHT_USE_7U_SPACEBAR 1 +#define RGB_BACKLIGHT_USE_ISO_ENTER 0 +#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 1 + +// disable backlight when USB suspended (PC sleep/hibernate/shutdown) +#define RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0 + +// disable backlight after timeout in minutes, 0 = no timeout +#define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0 + +// the default effect (RGB test) +#define RGB_BACKLIGHT_EFFECT 255 + +// These define which keys in the matrix are alphas/mods +// Used for backlight effects so colors are different for +// alphas vs. mods +// Each value is for a row, bit 0 is column 0 +// Alpha=0 Mod=1 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b0110000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0110000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0111000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0111000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0111100000000111 + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Backlight config starts after EEPROM version +#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 +// Dynamic keymap starts after backlight config (35+31) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 66 +// Dynamic macro starts after dynamic keymaps (66+(4*5*15*2)) = (66+600) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 666 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 358 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/rama/koyu/info.json b/keyboards/rama/koyu/info.json new file mode 100644 index 0000000000..4b6edc7bfa --- /dev/null +++ b/keyboards/rama/koyu/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "KOYU", + "url": "", + "maintainer": "Wilba", + "bootloader": "DFU", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT_all": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"PrtSc", "x":13, "y":0}, {"label":"Pause", "x":14, "y":0}, {"label":"Num Lock", "x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Insert", "x":15, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Home", "x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"\u2191", "x":14, "y":3}, {"label":"/", "x":15, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Ctrl", "x":11, "y":4, "w":1.5}, {"label":"\u2190", "x":13, "y":4}, {"label":"\u2193", "x":14, "y":4}, {"label":"\u2192", "x":15, "y":4}] + } + } +}
\ No newline at end of file diff --git a/keyboards/rama/koyu/keymaps/default/keymap.c b/keyboards/rama/koyu/keymaps/default/keymap.c new file mode 100644 index 0000000000..f6bc94fbd6 --- /dev/null +++ b/keyboards/rama/koyu/keymaps/default/keymap.c @@ -0,0 +1,36 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + // Default layer + [0] = LAYOUT_all( + KC_ESC, 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_BSLS, KC_DEL, KC_HOME, + 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_BSPC, KC_PGUP, + KC_LCTL, 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_PGDN, + 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_END, + MO(1), KC_LGUI, KC_LALT, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_RGHT), + + // Fn1 Layer + [1] = LAYOUT_all( + KC_GRV, 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_INS, KC_DEL, KC_TRNS, + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_EJCT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + // Fn2 Layer + [2] = LAYOUT_all( + KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BR_DEC, BR_INC, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, ES_DEC, ES_INC, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + // Fn3 Layer + [3] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; diff --git a/keyboards/rama/koyu/koyu.c b/keyboards/rama/koyu/koyu.c new file mode 100644 index 0000000000..03d1e12159 --- /dev/null +++ b/keyboards/rama/koyu/koyu.c @@ -0,0 +1,18 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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/>. + */ +#ifndef RGB_BACKLIGHT_KOYU +#error RGB_BACKLIGHT_KOYU not defined, you done goofed somehao, brah +#endif diff --git a/keyboards/rama/koyu/koyu.h b/keyboards/rama/koyu/koyu.h new file mode 100644 index 0000000000..c2aaa0273a --- /dev/null +++ b/keyboards/rama/koyu/koyu.h @@ -0,0 +1,42 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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" +#include "../../zeal60/rgb_backlight_keycodes.h" +#include "../../zeal60/zeal60_keycodes.h" + +#define ____ KC_NO + +// Right switch of split backspace is at 2,13 and is the only switch +// whose physical position doesn't match switch matrix position :-( +// However, it also makes no sense to view the physical as 16 columns, +// so the numbering goes 00 to 14. Deal with it. + +#define LAYOUT_all( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K213, K014, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, \ + K400, K401, K402, K407, K411, K412, K413, K414 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \ + { K300, ____, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \ + { K400, K401, K402, ____, ____, ____, ____, K407, ____, ____, ____, K411, K412, K413, K414 } \ +} diff --git a/keyboards/rama/koyu/readme.md b/keyboards/rama/koyu/readme.md new file mode 100644 index 0000000000..0372747f58 --- /dev/null +++ b/keyboards/rama/koyu/readme.md @@ -0,0 +1,23 @@ +# RAMA KOYU + +![RAMA KOYU](https://static1.squarespace.com/static/563c788ae4b099120ae219e2/t/5b8bd6e6b8a045c95eac2003/1535891375794/RW-KOYU-A-RENDER-04-TOP.1335.jpg?format=1500w) + +The wait for something isnt the most conscious desire, but that anticipation creates nostalgia. + +At Rama Works, youve embraced this. From updates of the blog, to direct communication with the community, being part of a Rama Works product doesnt just start when you receive it. If youve ever received a Rama Works product, you know that no detail is overlooked. + +Let us take you on a journey that will capture that sensory experience, and explore the gravitational interaction between aesthetic and design. The Rama Works X element personifies the understanding that taking something away doesnt necessarily make it less. + +This is the sound of Rama Works. Never too busya feeling of delightful modern weightlessness. A rich sonic experience. Sparse and ethereal, this music boldly inhabits a nondescript, borderless space. Warm, synthetic textures, bespoke musical sound design. percussive elements percolating and accentuating movement on the screen and in the stereo field. a sonic palette full of clicks, taps and resonances evoking a sense of calm comfort and familiarity. + +[More info at RAMA WORKS](https://rama.works/koyu/) + +Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) +Hardware Supported: RAMA KOYU PCB +Hardware Availability: [RAMA WORKS Store](https://ramaworks.store/) + +Make example for this keyboard (after setting up your build environment): + + make rama/koyu:default + +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).
\ No newline at end of file diff --git a/keyboards/rama/koyu/rules.mk b/keyboards/rama/koyu/rules.mk new file mode 100644 index 0000000000..5e470769d6 --- /dev/null +++ b/keyboards/rama/koyu/rules.mk @@ -0,0 +1,80 @@ + + +# project specific files +SRC = keyboards/zeal60/zeal60.c \ + keyboards/zeal60/rgb_backlight.c \ + quantum/color.c \ + drivers/issi/is31fl3731.c \ + drivers/avr/i2c_master.c + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Boot Section +BOOTLOADER = atmel-dfu + +# Do not put the microcontroller into power saving mode +# when we get USB suspend event. We want it to keep updating +# backlight effects. +OPT_DEFS += -DNO_SUSPEND_POWER_DOWN + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes +CIE1931_CURVE = yes + +#LAYOUTS = ??? diff --git a/keyboards/rama/m10_b/keymaps/default/config.h b/keyboards/rama/m10_b/keymaps/default/config.h index d150575c1a..2a3bf1819f 100644 --- a/keyboards/rama/m10_b/keymaps/default/config.h +++ b/keyboards/rama/m10_b/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/rama/m60_a/config.h b/keyboards/rama/m60_a/config.h index 2b54cda790..1cbdee5ae3 100644 --- a/keyboards/rama/m60_a/config.h +++ b/keyboards/rama/m60_a/config.h @@ -87,9 +87,19 @@ // disable backlight after timeout in minutes, 0 = no timeout #define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0 +// the default brightness +#define RGB_BACKLIGHT_BRIGHTNESS 255 + // the default effect (RGB test) #define RGB_BACKLIGHT_EFFECT 255 +// the default effect speed (0-3) +#define RGB_BACKLIGHT_EFFECT_SPEED 0 + +// the default color1 and color2 +#define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 } +#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 } + // These define which keys in the matrix are alphas/mods // Used for backlight effects so colors are different for // alphas vs. mods @@ -101,6 +111,11 @@ #define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0011000000000001 #define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0011100000000111 +#define RGB_BACKLIGHT_CAPS_LOCK_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_1_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_2_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_3_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } + #define DYNAMIC_KEYMAP_LAYER_COUNT 4 // EEPROM usage diff --git a/keyboards/rama/m6_b/config.h b/keyboards/rama/m6_b/config.h index c2a225d53a..0d690bffaf 100644 --- a/keyboards/rama/m6_b/config.h +++ b/keyboards/rama/m6_b/config.h @@ -120,9 +120,19 @@ // disable backlight after timeout in minutes, 0 = no timeout #define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0 +// the default brightness +#define RGB_BACKLIGHT_BRIGHTNESS 255 + // the default effect (RGB test) #define RGB_BACKLIGHT_EFFECT 255 +// the default effect speed (0-3) +#define RGB_BACKLIGHT_EFFECT_SPEED 0 + +// the default color1 and color2 +#define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 } +#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 } + // These define which keys in the matrix are alphas/mods // Used for backlight effects so colors are different for // alphas vs. mods @@ -134,6 +144,11 @@ #define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0 #define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0 +#define RGB_BACKLIGHT_CAPS_LOCK_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_1_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_2_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_3_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } + #define DYNAMIC_KEYMAP_LAYER_COUNT 4 // EEPROM usage diff --git a/keyboards/readme.md b/keyboards/readme.md index 8b0c10ab48..81284755f4 100644 --- a/keyboards/readme.md +++ b/keyboards/readme.md @@ -35,7 +35,7 @@ These keyboards are part of the QMK repository, but their manufacturers are not * [9key](/keyboards/9key) — A 9-key minipad sold by Bishop Keyboards. * [Alps64](/keyboards/alps64) — A 60% keyboard for Alps keyswitches. * [AMJ60](/keyboards/amj60) — DIY/Assembled compact 60% keyboard. -* [Arrow Pad](/keyboards/arrow_pad) — A custom creation by IBNobody. +* [Arrow Pad](/keyboards/handwired/arrow_pad) — A custom creation by IBNobody. * [Atreus](/keyboards/atreus) — Made by Technomancy. * [Bantam44](/keyboards/bantam44) — It is a 44-key 40% staggered keyboard. * [DataHand](/keyboards/handwired/datahand) — DataHand keyboard converted to use a Teensy board. @@ -53,7 +53,7 @@ These keyboards are part of the QMK repository, but their manufacturers are not * [The Kitten Paw](/keyboards/kitten_paw) — A replacement controller (2016 revision) for the Filco Majestouch by [Bathroom Epiphanies](https://github.com/BathroomEpiphanies). * [Lets Split](/keyboards/lets_split) - Split ortholinear 40% keyboard. * [Phantom](/keyboards/phantom) — A tenkeyless kit by Teel, also from Geekhack. -* [Retro Refit](/keyboards/retro_refit) — Another creation by IBNobody. +* [Retro Refit](/keyboards/handwired/retro_refit) — Another creation by IBNobody. * [S60-x](/keyboards/s60_x) — DIY compact keyboard designed by VinnyCordeiro for Sentraq. * [Satan](/keyboards/satan) — A GH60 variant. * [SixKeyBoard](/keyboards/sixkeyboard) — A 6-key keyboard made by TechKeys. diff --git a/keyboards/redox/keymaps/fculpo/config.h b/keyboards/redox/keymaps/fculpo/config.h new file mode 100644 index 0000000000..bff76aef26 --- /dev/null +++ b/keyboards/redox/keymaps/fculpo/config.h @@ -0,0 +1,34 @@ +/* +Copyright 2018 Mattia Dal Ben <matthewdibi@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 + +/* Use I2C or Serial, not both */ +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ +#define MASTER_LEFT +//#define MASTER_RIGHT +//#define EE_HANDS + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 14 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/redox/keymaps/fculpo/keymap.c b/keyboards/redox/keymaps/fculpo/keymap.c new file mode 100644 index 0000000000..b5aeca99dd --- /dev/null +++ b/keyboards/redox/keymaps/fculpo/keymap.c @@ -0,0 +1,92 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _SYMB 1 +#define _NAV 2 +#define _ADJUST 3 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + SYMB, + NAV, + ADJUST, +}; + +// Shortcut to make keymap more readable +#define SYM_L MO(_SYMB) + +#define KC_ALAS LALT_T(KC_PAST) +#define KC_CTES LCTL_T(KC_ESC) +#define KC_CTQU RCTL_T(KC_QUOT) + +#define KC_NAGR LT(_NAV, KC_GRV) +#define KC_NAMI LT(_NAV, KC_MINS) + +#define KC_ADEN LT(_ADJUST, KC_END) +#define KC_ADPU LT(_ADJUST, KC_PGUP) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_NAGR ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_NAMI , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,SYM_L , SYM_L ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_EQL , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_CTES ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_LBRC , KC_RBRC ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,KC_CTQU , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_ADPU ,KC_PGDN , KC_HOME ,KC_ADEN ,KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_RSFT , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + KC_BSLS ,KC_PPLS ,KC_PMNS ,KC_ALAS , KC_LGUI , KC_BSPC ,KC_DEL , KC_ENT ,KC_SPC , KC_RALT , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + [_SYMB] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_EXLM ,KC_AT ,KC_LCBR ,KC_RCBR ,KC_PIPE ,KC_F6 , KC_F7 ,XXXXXXX ,KC_KP_7 ,KC_KP_8 ,KC_KP_9 ,XXXXXXX ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_HASH ,KC_DLR ,KC_LBRC ,KC_RBRC ,KC_GRV ,_______ , _______ ,XXXXXXX ,KC_KP_4 ,KC_KP_5 ,KC_KP_6 ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_PERC ,KC_CIRC ,KC_LPRN ,KC_RPRN ,KC_TILD ,_______ ,_______ , _______ ,_______ ,XXXXXXX ,KC_KP_1 ,KC_KP_2 ,KC_KP_3 ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ , _______ , _______ ,_______ , _______ ,_______ , KC_KP_0 , KC_KP_0 ,KC_PDOT ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + [_NAV] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,KC_MS_U ,XXXXXXX ,KC_WH_U ,XXXXXXX ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_WH_D ,XXXXXXX ,_______ , _______ ,KC_LEFT ,KC_DOWN ,KC_UP ,KC_RIGHT,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , KC_BTN1 , KC_BTN2 ,_______ , _______ ,_______ , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + [_ADJUST] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + XXXXXXX ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,RESET ,RGB_M_P ,RGB_TOG ,RGB_MOD ,RGB_HUD ,RGB_HUI , RGB_SAD ,RGB_SAI ,RGB_VAD ,RGB_VAI ,XXXXXXX ,XXXXXXX ,KC_F12 , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ ,XXXXXXX , XXXXXXX ,_______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ) + +}; diff --git a/keyboards/redox/keymaps/fculpo/keymap.json b/keyboards/redox/keymaps/fculpo/keymap.json new file mode 100644 index 0000000000..ca7905b169 --- /dev/null +++ b/keyboards/redox/keymaps/fculpo/keymap.json @@ -0,0 +1,399 @@ +[ + { + "name": "Redox/rev1", + "author": "Fabien Culpo", + "switchMount": "cherry", + "plate": false, + "pcb": false + }, + [ + { + "x": 3.5 + }, + "#\n3", + { + "x": 10.5 + }, + "*\n8" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "@\n2", + { + "x": 1 + }, + "$\n4", + { + "x": 8.5 + }, + "&\n7", + { + "x": 1 + }, + "(\n9" + ], + [ + { + "y": -0.875, + "x": 5.5 + }, + "%\n5", + { + "x": 6.5 + }, + "^\n6" + ], + [ + { + "y": -0.875, + "x": 0.25, + "a": 5, + "w": 1.25 + }, + "`\nLayer 2\n\n\n\n\n~", + { + "a": 4 + }, + "!\n1", + { + "x": 14.5 + }, + ")\n0", + { + "a": 5, + "w": 1.25 + }, + "_\nLayer 2\n\n\n\n\n-" + ], + [ + { + "y": -0.625, + "x": 6.5 + }, + "Layer 1", + { + "x": 4.5 + }, + "Layer 1" + ], + [ + { + "y": -0.75, + "x": 3.5, + "a": 4 + }, + "E", + { + "x": 10.5 + }, + "I" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "W", + { + "x": 1 + }, + "R", + { + "x": 8.5 + }, + "U", + { + "x": 1 + }, + "O" + ], + [ + { + "y": -0.875, + "x": 5.5 + }, + "T", + { + "x": 6.5 + }, + "Y" + ], + [ + { + "y": -0.875, + "x": 0.25, + "a": 7, + "w": 1.25 + }, + "TAB", + { + "a": 4 + }, + "Q", + { + "x": 14.5 + }, + "P", + { + "a": 5, + "w": 1.25 + }, + "+\n=" + ], + [ + { + "y": -0.625, + "x": 6.5, + "a": 7, + "h": 1.5 + }, + "[", + { + "x": 4.5, + "h": 1.5 + }, + "]" + ], + [ + { + "y": -0.75, + "x": 3.5, + "a": 4 + }, + "D", + { + "x": 10.5 + }, + "K" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "S", + { + "x": 1, + "n": true + }, + "F", + { + "x": 8.5, + "n": true + }, + "J", + { + "x": 1 + }, + "L" + ], + [ + { + "y": -0.875, + "x": 5.5 + }, + "G", + { + "x": 6.5 + }, + "H" + ], + [ + { + "y": -0.875, + "x": 0.25, + "a": 5, + "w": 1.25 + }, + "ESC\nCTRL", + { + "a": 4 + }, + "A", + { + "x": 14.5 + }, + ":\n;", + { + "a": 5, + "w": 1.25 + }, + "'\nCTRL" + ], + [ + { + "y": -0.375, + "x": 3.5, + "a": 4 + }, + "C", + { + "x": 10.5 + }, + "<\n," + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "X", + { + "x": 1 + }, + "V", + { + "x": 8.5 + }, + "M", + { + "x": 1 + }, + ">\n." + ], + [ + { + "y": -0.875, + "x": 5.5 + }, + "B", + { + "x": 6.5 + }, + "N" + ], + [ + { + "y": -0.875, + "x": 0.25, + "a": 5, + "w": 1.25 + }, + "SHIFT", + { + "a": 4 + }, + "Z", + { + "x": 14.5 + }, + "?\n/", + { + "a": 5, + "w": 1.25 + }, + "SHIFT" + ], + [ + { + "y": -0.375, + "x": 3.5 + }, + "*\nALT", + { + "x": 10.5 + }, + "Left" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "-", + { + "x": 12.5 + }, + "Down" + ], + [ + { + "y": -0.75, + "x": 0.5 + }, + "|\n\n\n\n\n\n\\", + "+", + { + "x": 14.5 + }, + "Up", + { + "sb": "cherry", + "st": "MX1A-21xx" + }, + "Right" + ], + [ + { + "r": 15, + "y": -2.625, + "x": 5.75, + "a": 7, + "w": 1.25 + }, + "SUPER" + ], + [ + { + "r": 30, + "rx": 6.5, + "ry": 4.25, + "y": -1, + "a": 5 + }, + "PgUp\nLay. 3", + { + "a": 7 + }, + "PgDn" + ], + [ + { + "h": 1.5 + }, + "Bksp", + { + "h": 1.5 + }, + "Del" + ], + [ + { + "r": -30, + "rx": 13, + "y": -1, + "x": -2 + }, + "Home", + { + "a": 5 + }, + "End\nLay. 3" + ], + [ + { + "x": -2, + "a": 7, + "h": 1.5 + }, + "Enter", + { + "h": 1.5 + }, + "Space" + ], + [ + { + "r": -15, + "rx": 0, + "ry": 0, + "y": 7.75, + "x": 11.75, + "w": 1.25 + }, + "ALT" + ] +] diff --git a/keyboards/redox/keymaps/fculpo/readme.md b/keyboards/redox/keymaps/fculpo/readme.md new file mode 100644 index 0000000000..1250e47b9c --- /dev/null +++ b/keyboards/redox/keymaps/fculpo/readme.md @@ -0,0 +1,18 @@ +# A tweaked keymap for Redox + +This keymap modifies the [default keymap](https://github.com/qmk/qmk_firmware/tree/master/keyboards/redox) for the awesome [Redox keyboard](https://github.com/mattdibi/redox-keyboard) designed by Mattia Dal Ben. + +Also heavily inspired by nrichers layout. + +![fculpo Layout Image](https://i.imgur.com/OXT8boJ.png) + +## Changes to the default keymap + +These keymap changes are meant to improve the usability of the layout in everyday use: + +- Move `GUI` (`SUPER`) key to where default left `CTRL` is +- Move `/?` into usual location next to right `SHIFT` - the default flash from Falbatech put `\|` here (might not be the Redox default?), which felt unintuitive +- Put `\|` into bottom-left spot where `GUI` (`SUPER`) was - had to go somewhere and this bottom-left placement sort of balances with the almost bottom-right `/?` +- Change default `ESC` into `ESC` on tap, `CTRL` on hold - Love the UNIX-ey `CTRL` key location and wanted to keep `ESC` in the original position +- Change default `'` above right `SHIFT` into `'` on tap, `CTRL` on hold - Love the UNIX-ey CTRL key location, but it can give you 'left claw hand', which a second, mirrored `CTRL` key fixes +- Add `F11` and `F12` keys to two layers - needed on macOS if you want to control volume up and down from your keyboard (not shown, on a different layer)S diff --git a/keyboards/redox/keymaps/fculpo/rules.mk b/keyboards/redox/keymaps/fculpo/rules.mk new file mode 100644 index 0000000000..a81250cdf6 --- /dev/null +++ b/keyboards/redox/keymaps/fculpo/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_ENABLE = yes + diff --git a/keyboards/redox/keymaps/finex/config.h b/keyboards/redox/keymaps/finex/config.h index b23342ce0f..8852a4cc87 100644 --- a/keyboards/redox/keymaps/finex/config.h +++ b/keyboards/redox/keymaps/finex/config.h @@ -32,3 +32,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 + +// #define PERMISSIVE_HOLD +#define IGNORE_MOD_TAP_INTERRUPT +#define TAPPING_TERM 200 diff --git a/keyboards/redox/keymaps/finex/keymap.c b/keyboards/redox/keymaps/finex/keymap.c index 8b8f5f1839..5a508815b2 100644 --- a/keyboards/redox/keymaps/finex/keymap.c +++ b/keyboards/redox/keymaps/finex/keymap.c @@ -3,47 +3,161 @@ extern keymap_config_t keymap_config; // Layer names -#define _QWERTY 0 -#define _COLEMAKDHMK 1 -#define _QWERTY_MAC 2 -#define _COLEMAKDHMK_MAC 3 -#define _SYMB 4 -#define _ADJUST 5 +enum{ + // - Base layers: + _COLEMAKDHMK, + _COLEMAKDHMK_MAC, + _QWERTY, + _QWERTY_MAC, + // - Symbols, numbers, functions and custom shifts: + _SYMB, + _NUMB, + _FUNC, + _RHSH, // Righ hand shifted keycodes + _LHSH, // Left hand shifted keycodes + // - Adjust layer: + _ADJUST +}; // Custom keycodes enum custom_keycodes { - QWERTY = SAFE_RANGE, - COLEMAKDHMK, - QWERTY_MAC, + COLEMAKDHMK = SAFE_RANGE, COLEMAKDHMK_MAC, - SYMB, - ADJUST, + QWERTY, + QWERTY_MAC, ASC_SAR, ASC_DAR, ASC_SQT, ASC_DQT, + ASC_CIRC, + ASC_TILD, ASC_HAP, - ASC_SAD + ASC_SAD, + ASC_BKT, + ASC_CBRL, + ASC_CBRR }; +// Tap dance keycodes +enum tap_dance{ + TD_SCLN, // ;; -> : + TD_LBRC, // [[ -> { + TD_RBRC, // ]] -> } + TD_QMRK // // -> ? +}; + +// Semicolon to Colon +void dance_scln_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code (KC_SCLN); + } else { + register_code (KC_RSFT); + register_code (KC_SCLN); + } +} +void dance_scln_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code (KC_SCLN); + } else { + unregister_code (KC_RSFT); + unregister_code (KC_SCLN); + } +} + +// Square braket to curly bracket (left) +void dance_lbrc_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code (KC_LBRC); + } else { + register_code (KC_RSFT); + register_code (KC_LBRC); + } +} +void dance_lbrc_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code (KC_LBRC); + } else { + unregister_code (KC_RSFT); + unregister_code (KC_LBRC); + } +} + +// Square braket to curly bracket (right) +void dance_rbrc_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code (KC_RBRC); + } else { + register_code (KC_RSFT); + register_code (KC_RBRC); + } +} +void dance_rbrc_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code (KC_RBRC); + } else { + unregister_code (KC_RSFT); + unregister_code (KC_RBRC); + } +} + + +//Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_SCLN] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_scln_finished, dance_scln_reset), + [TD_LBRC] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_lbrc_finished, dance_lbrc_reset), + [TD_RBRC] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_rbrc_finished, dance_rbrc_reset) +}; + + // Shortcut to make keymap more readable -#define KC_SYQT LT(_SYMB, KC_QUOT) -#define KC_SYGR LT(_SYMB, KC_GRV) -#define KC_SYSP LT(_SYMB, KC_SPC) -#define KC_ADEN LT(_ADJUST, KC_END) -#define KC_ADPU LT(_ADJUST, KC_PGUP) -#define KC_CESC LCTL_T(KC_ESC) -#define KC_CBSP LCTL_T(KC_BSPC) -#define KC_CMIN RCTL_T(KC_MINUS) -#define KC_GBSP LGUI_T(KC_BSPC) -#define KC_ADEL LALT_T(KC_DEL) -#define KC_APLS RALT_T(KC_PPLS) -#define KC_LSEN LSFT_T(KC_ENT) -#define KC_RSEN RSFT_T(KC_ENT) -#define FN1 QWERTY -#define FN2 COLEMAKDHMK -#define FN3 QWERTY_MAC -#define FN4 COLEMAKDHMK_MAC + +// - Adjustment Layer: +#define KC_ADEN LT(_ADJUST, KC_END) // End / _ADJUST layer +#define KC_ADPU LT(_ADJUST, KC_PGUP) // Page Up / _ADJUST layer + +// - Custom layers: +#define KC_SYSP LT(_SYMB, KC_SPC) // Space / _symbols +#define KC_NUES LT(_NUMB, KC_ESC) // Esc / _numbers +#define KC_FUTA LT(_FUNC, KC_TAB) // Tab / _functions +#define KC_N_SH LT(_LHSH, KC_N) // Pressing N key, enable shifted keys on other half (the left one) +#define KC_T_SH LT(_RHSH, KC_T) // Pressing T key, enable shifted keys on other half (the right one) + +// - Custom keys/modifiers: +#define KC_ATAB RALT_T(KC_TAB) // - Tab / Alt Gr +#define KC_CESC LCTL_T(KC_ESC) // - Esc / Left Ctrl +#define KC_GSPC LGUI_T(KC_SPC) // - Space / Left GUI +#define KC_CBSP LCTL_T(KC_BSPC) // - Backspace / Left Ctrl + +// -- Mac os mode: +#define KC_CSPC LCTL_T(KC_SPC) // - Space / Left Ctrl +#define KC_GBSP LGUI_T(KC_BSPC) // - Backspace / Left GUI + + +#define KC_AEQL LALT_T(KC_EQL) // - Equals / Alt (left alt) +#define KC_CMIN RCTL_T(KC_MINUS) // - Minus / Right Ctrl +#define KC_ADEL RALT_T(KC_DEL) // - Del / Alt Gr +#define KC_RSEN RSFT_T(KC_ENT) // - Enter / Right Shift (standard shift) +#define KC_LAEN LALT_T(KC_ENT) // - Enter / Left Alt + +// Home row mod tap keys: +// - Left hand +#define KC_CT_A CTL_T(KC_A) // A / Left Ctrl +#define KC_AL_S ALT_T(KC_S) // S / Left Alt +// - Right hand +#define KC_AL_E ALT_T(KC_E) // E / Left Alt +#define KC_CT_O CTL_T(KC_O) // O / Left Ctrl + +// - Tap dance: +#define KC_TDSC TD(TD_SCLN) // ;; -> : +#define KC_TDLB TD(TD_LBRC) // [[ -> { +#define KC_TDRB TD(TD_RBRC) // ]] -> } + +// - Keyboard base maps: +#define LR1 COLEMAKDHMK +#define LR2 COLEMAKDHMK_MAC +#define LR3 QWERTY +#define LR4 QWERTY_MAC + // Send custom strings or change default base layer bool process_record_user(uint16_t keycode, keyrecord_t *record) { @@ -63,12 +177,30 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { // SS_RALT(SS_LSFT()): Avoid sending dead key on software intl layouts SEND_STRING(SS_RALT(SS_LSFT("\""))); return false; + case ASC_CIRC: + // SS_RALT(): Avoid sending dead key on software intl layouts + SEND_STRING(SS_RALT("^")); + return false; + case ASC_TILD: + // SS_RALT(SS_LSFT()): Avoid sending dead key on software intl layouts + SEND_STRING(SS_RALT(SS_LSFT("~"))); + return false; case ASC_HAP: SEND_STRING(":-) "); return false; case ASC_SAD: SEND_STRING(":-( "); return false; + case ASC_BKT: + // SS_RALT(): Avoid sending dead key on software intl layouts + SEND_STRING(SS_RALT("`")); + return false; + case ASC_CBRL: + SEND_STRING("{"); + return false; + case ASC_CBRR: + SEND_STRING("}"); + return false; case QWERTY: if (record->event.pressed) { set_single_persistent_default_layer(_QWERTY); @@ -98,91 +230,157 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; }; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT( - //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ - KC_SYGR ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_SYQT , - //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_DEL , KC_BSPC ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_EQL , - //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - KC_CESC ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_LBRC , KC_RBRC ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,KC_CMIN , - //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - KC_LSPO ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_ADPU ,KC_PGDN , KC_HOME ,KC_ADEN ,KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_RSPC , - //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ - KC_SYSP ,KC_BSLS ,KC_QUOT ,KC_LGUI , KC_ADEL , KC_CBSP ,KC_LSEN , KC_RSEN ,KC_SYSP , KC_APLS , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT - //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + // Colemak DM-MK Mod + [_COLEMAKDHMK] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + XXXXXXX ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_ESC , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_ATAB ,KC_Q ,KC_W ,KC_F ,KC_P ,KC_B ,XXXXXXX , XXXXXXX ,KC_J ,KC_L ,KC_U ,KC_Y ,KC_TDSC ,KC_AEQL , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_CESC ,KC_A ,KC_R ,KC_AL_S ,KC_T_SH ,KC_G ,KC_TDLB , KC_TDRB ,KC_M ,KC_N_SH ,KC_AL_E ,KC_I ,KC_O ,KC_CMIN , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSPO ,KC_Z ,KC_X ,KC_C ,KC_D ,KC_V ,KC_ADPU ,KC_PGDN , KC_HOME ,KC_ADEN ,KC_K ,KC_H ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_RSPC , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + KC_GSPC ,KC_HYPR ,KC_MEH ,XXXXXXX , KC_NUES , KC_CBSP ,KC_FUTA , KC_LAEN ,KC_SYSP , KC_ADEL , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ), - [_COLEMAKDHMK] = LAYOUT( - //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ - KC_SYGR ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_SYQT , - //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - KC_TAB ,KC_Q ,KC_W ,KC_F ,KC_P ,KC_B ,KC_DEL , KC_BSPC ,KC_J ,KC_L ,KC_U ,KC_Y ,KC_SCLN ,KC_EQL , - //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - KC_CESC ,KC_A ,KC_R ,KC_S ,KC_T ,KC_G ,KC_LBRC , KC_RBRC ,KC_M ,KC_N ,KC_E ,KC_I ,KC_O ,KC_CMIN , - //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - KC_LSPO ,KC_Z ,KC_X ,KC_C ,KC_D ,KC_V ,KC_ADPU ,KC_PGDN , KC_HOME ,KC_ADEN ,KC_K ,KC_H ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_RSPC , - //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ - KC_SYSP ,KC_BSLS ,KC_QUOT ,KC_LGUI , KC_ADEL , KC_CBSP ,KC_LSEN , KC_RSEN ,KC_SYSP , KC_APLS , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT - //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + // Colemak DM-MK Mod, Mac version (CTRL and GUI are swapped) + [_COLEMAKDHMK_MAC] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + XXXXXXX ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_ESC , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_ATAB ,KC_Q ,KC_W ,KC_F ,KC_P ,KC_B ,XXXXXXX , XXXXXXX ,KC_J ,KC_L ,KC_U ,KC_Y ,KC_TDSC ,KC_AEQL , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_CESC ,KC_A ,KC_R ,KC_AL_S ,KC_T_SH ,KC_G ,KC_TDLB , KC_TDRB ,KC_M ,KC_N_SH ,KC_AL_E ,KC_I ,KC_O ,KC_CMIN , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSPO ,KC_Z ,KC_X ,KC_C ,KC_D ,KC_V ,KC_ADPU ,KC_PGDN , KC_HOME ,KC_ADEN ,KC_K ,KC_H ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_RSPC , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + KC_CSPC ,KC_HYPR ,KC_MEH ,XXXXXXX , KC_NUES , KC_GBSP ,KC_FUTA , KC_LAEN ,KC_SYSP , KC_ADEL , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ), - [_QWERTY_MAC] = LAYOUT( - //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ - KC_SYGR ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_SYQT , - //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_DEL , KC_BSPC ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_EQL , - //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - KC_CESC ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_LBRC , KC_RBRC ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,KC_CMIN , - //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - KC_LSPO ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_ADPU ,KC_PGDN , KC_HOME ,KC_ADEN ,KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_RSPC , - //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ - KC_SYSP ,KC_BSLS ,KC_QUOT ,KC_LCTL , KC_ADEL , KC_GBSP ,KC_LSEN , KC_RSEN ,KC_SYSP , KC_APLS , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT - //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + // QWERTY + [_QWERTY] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + XXXXXXX ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_ESC , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_ATAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,XXXXXXX , XXXXXXX ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_AEQL , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_CESC ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_TDLB , KC_TDRB ,KC_H ,KC_J ,KC_K ,KC_L ,KC_TDSC ,KC_CMIN , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSPO ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_ADPU ,KC_PGDN , KC_HOME ,KC_ADEN ,KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_RSPC , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + KC_GSPC ,KC_HYPR ,KC_MEH ,XXXXXXX , KC_NUES , KC_CBSP ,KC_FUTA , KC_LAEN ,KC_SYSP , KC_ADEL , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ), - [_COLEMAKDHMK_MAC] = LAYOUT( - //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ - KC_SYGR ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_SYQT , - //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - KC_TAB ,KC_Q ,KC_W ,KC_F ,KC_P ,KC_B ,KC_DEL , KC_BSPC ,KC_J ,KC_L ,KC_U ,KC_Y ,KC_SCLN ,KC_EQL , - //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - KC_CESC ,KC_A ,KC_R ,KC_S ,KC_T ,KC_G ,KC_LBRC , KC_RBRC ,KC_M ,KC_N ,KC_E ,KC_I ,KC_O ,KC_CMIN , - //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - KC_LSPO ,KC_Z ,KC_X ,KC_C ,KC_D ,KC_V ,KC_ADPU ,KC_PGDN , KC_HOME ,KC_ADEN ,KC_K ,KC_H ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_RSPC , - //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ - KC_SYSP ,KC_BSLS ,KC_QUOT ,KC_LCTL , KC_ADEL , KC_GBSP ,KC_LSEN , KC_RSEN ,KC_SYSP , KC_APLS , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT - //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + // QWERTY, Mac version (CTRL and GUI are swapped) + [_QWERTY_MAC] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + XXXXXXX ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_ESC , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_ATAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,XXXXXXX , XXXXXXX ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_AEQL , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_CESC ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_TDLB , KC_TDRB ,KC_H ,KC_J ,KC_K ,KC_L ,KC_TDSC ,KC_CMIN , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSPO ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_ADPU ,KC_PGDN , KC_HOME ,KC_ADEN ,KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_RSPC , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + KC_CSPC ,KC_HYPR ,KC_MEH ,XXXXXXX , KC_NUES , KC_GBSP ,KC_FUTA , KC_LAEN ,KC_SYSP , KC_ADEL , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ), + // Symbols, home row arrows, function keys and macros layer [_SYMB] = LAYOUT( - //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ - XXXXXXX ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,XXXXXXX , - //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - _______ ,KC_CIRC ,KC_BSLS ,KC_PMNS ,KC_UNDS ,XXXXXXX ,_______ , _______ ,XXXXXXX ,KC_KP_7 ,KC_KP_8 ,KC_KP_9 ,KC_F11 ,KC_APP , - //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - _______ ,KC_PAST ,KC_PIPE ,ASC_SQT ,KC_TILD ,KC_QUOT ,ASC_SAR , ASC_DAR ,XXXXXXX ,KC_KP_4 ,KC_KP_5 ,KC_KP_6 ,KC_F12 ,KC_PSCR , - //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - _______ ,KC_HASH ,KC_AMPR ,KC_AT ,ASC_DQT ,KC_GRV ,ASC_SAD ,ASC_HAP , _______ ,_______ ,XXXXXXX ,KC_KP_1 ,KC_KP_2 ,KC_KP_3 ,KC_UP ,_______ , - //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ - _______ ,_______ ,_______ ,_______ , _______ , _______ ,_______ , _______ ,_______ , KC_KP_0 , KC_PDOT ,KC_LEFT ,KC_DOWN ,KC_RGHT - //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_EXLM ,KC_AT ,KC_HASH ,KC_DLR ,KC_PERC ,_______ , _______ ,ASC_CIRC,KC_AMPR ,KC_ASTR ,KC_PLUS ,_______ ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_PIPE ,KC_PMNS ,ASC_SQT ,ASC_DQT ,KC_GRV ,ASC_SAR , ASC_DAR ,KC_QUOT ,KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_BSLS ,KC_UNDS ,KC_COLN ,ASC_TILD,KC_EQL ,ASC_SAD ,ASC_HAP , _______ ,_______ ,ASC_BKT ,KC_PGUP ,KC_PGDN ,KC_HOME ,KC_END ,_______ , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ , _______ , _______ ,_______ , _______ ,_______ , _______ , _______ ,_______ ,_______ ,_______ + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + // Numeric keypad layer + [_NUMB] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,KC_PAST ,KC_KP_7 ,KC_KP_8 ,KC_KP_9 ,KC_PPLS ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,XXXXXXX ,KC_KP_4 ,KC_KP_5 ,KC_KP_6 ,KC_PMNS ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,XXXXXXX ,KC_KP_1 ,KC_KP_2 ,KC_KP_3 ,KC_PSLS ,_______ , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ , _______ , _______ ,_______ , _______ ,_______ , XXXXXXX , KC_KP_0 ,KC_PDOT ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + // Function layer and some extra keys on right hand + [_FUNC] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F12 ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F11 ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_PSCR ,KC_NLCK ,KC_INS ,KC_CAPS ,KC_APP ,_______ ,_______ , _______ ,_______ ,_______ ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F10 ,_______ , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ , _______ , _______ ,_______ , _______ ,_______ , _______ , _______ ,_______ ,_______ ,_______ + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + + // Left hand shifted keycodes + [_LHSH] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,S(KC_Q) ,S(KC_W) ,S(KC_F) ,S(KC_P) ,S(KC_B) ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,S(KC_A) ,S(KC_R) ,S(KC_S) ,S(KC_T) ,S(KC_G) ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,S(KC_Z) ,S(KC_X) ,S(KC_C) ,S(KC_D) ,S(KC_V) ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ , _______ , _______ ,_______ , KC_TAB ,KC_BSPC , KC_ESC , _______ ,_______ ,_______ ,_______ + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + // Right hand shifted keycodes + [_RHSH] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,S(KC_J) ,S(KC_L) ,S(KC_U) ,S(KC_Y) ,KC_COLN ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,S(KC_M) ,S(KC_N) ,S(KC_E) ,S(KC_I) ,S(KC_O) ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,S(KC_K) ,S(KC_H) ,KC_LABK ,KC_RABK ,KC_QUES ,_______ , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ , KC_DEL , KC_SPC ,KC_ENT , _______ ,_______ , _______ , _______ ,_______ ,_______ ,_______ + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ), + // Adjust layer (RGB, Reset and base layer switch) [_ADJUST] = LAYOUT( - //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ - XXXXXXX ,FN1 ,FN2 ,FN3 ,FN4 ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , - //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - XXXXXXX ,RESET ,RGB_M_P ,RGB_TOG ,RGB_MOD ,RGB_HUD ,RGB_HUI , RGB_SAD ,RGB_SAI ,RGB_VAD ,RGB_VAI ,XXXXXXX ,XXXXXXX ,XXXXXXX , - //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - XXXXXXX ,XXXXXXX ,RGB_M_B ,RGB_M_R ,RGB_M_SW,RGB_M_SN,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , - //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - XXXXXXX ,XXXXXXX ,RGB_M_K ,RGB_M_X ,RGB_M_G ,XXXXXXX ,_______ ,XXXXXXX , XXXXXXX ,_______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , - //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ - XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX - //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + XXXXXXX ,LR1 ,LR2 ,LR3 ,LR4 ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,RESET ,RGB_M_P ,RGB_TOG ,RGB_MOD ,RGB_HUD ,RGB_HUI , RGB_SAD ,RGB_SAI ,RGB_VAD ,RGB_VAI ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,RGB_M_B ,RGB_M_R ,RGB_M_SW,RGB_M_SN,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,RGB_M_K ,RGB_M_X ,RGB_M_G ,XXXXXXX ,_______ ,XXXXXXX , XXXXXXX ,_______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ) }; diff --git a/keyboards/redox/keymaps/finex/readme.md b/keyboards/redox/keymaps/finex/readme.md index f1b6fa7c7b..9b88469a13 100644 --- a/keyboards/redox/keymaps/finex/readme.md +++ b/keyboards/redox/keymaps/finex/readme.md @@ -4,27 +4,61 @@ ## Features - Enabled USE_SERIAL for Falba.Tech Redox keyboards. -- PC Layouts: QWERTY, Colemak Mod DH-MK. -- Mac Layouts: same as above with CTRL-GUI keys inverted on the bottom row. -- Added redundant "Space", "Esc" and "Ctrl" keys. -- Added macro to print "->" and "=>" strings. -- Added macro to print ":-( " and ":-) " strings. +- PC Layouts: Colemak Mod DH-MK, Qwerty. +- Mac Layouts: same as above with CTRL-GUI keys inverted. +- Added redundant `Space`, `Esc`, `Ctrl` and `Enter` keys. I like to have this + keys on both halves. +- Added macro to print `->` and `=>` strings. +- Added macro to print `:-( ` and `:-) ` strings. - Added more arrows. -- Added "(" and ")" on Shifts keys. -- Added Shift on both ) "Enter" keys. +- Added `(` and `)` on Shifts keys. +- Tapdance: `:` (`;` × 2), `{` (`[` × 2), `}` (`]` × 2). - Removed Mouse and media support. - Added missing "Print Screen" and "Menu" keys. - Added missing "F11" and "F12" keys. +- Added `Alt` modifier on home row. +- Added `Shift other half` on home keys: this allows to shift the right half +pressing `t` on the left (or `f` using Qwerty), and the opposite pressing `n` +(or `j` for Qwerty layout). -## Layers +## Description + +This keymap use the default one with some changes to suit my needs. Mainly +having most used symbol on a separated layer copying the common symbols on the +number keys on the second row and adding other symbols and ``|´` dead keys for +accents. + + +## Main Keyboard Layout + +[TODO] -This keymap use the default one with some minor improvements to suit my needs. ## Changelog - 2018/11/13 - First public release + First public release. +- 2018/12/04 + Added Caps Lock, Num Lock and Insert on Symbols Layout. Inverted KC_GRV and + KC_QUOT on Symbols Layout. Added "Toggle Symbols Layout" and "Momentarily + activates Symbols Layout" on bottom row. Added Space/Control on left bottom + corner: now both halves contains Enter and Space keys. +- 2018/12/23 + Moved around modifiers key. + Added MEH and HYPER keys. + Improved symbols layout. + Rearranged layers. +- 2019/01/04 + Added new layer with numeric keypad and rearranged symbols. +- 2019/01/26 + Added curly brackets on own keys (normally unused). + Added tap dance for testing purpose. + Minor fixes. +- 2019/02/25 + Major layouts upgrade, partially inspired by Steven Hum's Beakl layouts. +- 2019/03/17 + Aligned qwerty and mac to main layout. ## TODO @@ -32,4 +66,5 @@ This keymap use the default one with some minor improvements to suit my needs. - Bring back mouse and multimedia keys. - Add default Colemak Mod DH layout. - Improve top corner keys. -- Improve bottom row keys (mostly KC_BSLS and KC_QUOT). +- Improve bottom row keys. +- Improve README.md diff --git a/keyboards/redox/keymaps/finex/rules.mk b/keyboards/redox/keymaps/finex/rules.mk index 21550e9fe1..f248688fb4 100644 --- a/keyboards/redox/keymaps/finex/rules.mk +++ b/keyboards/redox/keymaps/finex/rules.mk @@ -1,3 +1,4 @@ RGBLIGHT_ENABLE = yes - COMMAND_ENABLE = no +KEY_LOCK_ENABLE = yes +TAP_DANCE_ENABLE=yes diff --git a/keyboards/redox/keymaps/nrichers/config.h b/keyboards/redox/keymaps/nrichers/config.h new file mode 100755 index 0000000000..a3ef209a05 --- /dev/null +++ b/keyboards/redox/keymaps/nrichers/config.h @@ -0,0 +1,34 @@ +/* +Copyright 2018 Mattia Dal Ben <matthewdibi@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 + +/* Use I2C or Serial, not both */ +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 14 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/redox/keymaps/nrichers/keymap.c b/keyboards/redox/keymaps/nrichers/keymap.c new file mode 100755 index 0000000000..7434b43682 --- /dev/null +++ b/keyboards/redox/keymaps/nrichers/keymap.c @@ -0,0 +1,92 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _SYMB 1 +#define _NAV 2 +#define _ADJUST 3 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + SYMB, + NAV, + ADJUST, +}; + +// Shortcut to make keymap more readable +#define SYM_L MO(_SYMB) + +#define KC_ALAS LALT_T(KC_PAST) +#define KC_CTES LCTL_T(KC_ESC) +#define KC_CTQU RCTL_T(KC_QUOT) + +#define KC_NAGR LT(_NAV, KC_GRV) +#define KC_NAMI LT(_NAV, KC_MINS) + +#define KC_ADEN LT(_ADJUST, KC_END) +#define KC_ADPU LT(_ADJUST, KC_PGUP) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_NAGR ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_NAMI , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,SYM_L , SYM_L ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_EQL , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_CTES ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_LBRC , KC_RBRC ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,KC_CTQU , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_ADPU ,KC_PGDN , KC_HOME ,KC_ADEN ,KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_RSFT , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + KC_BSLS ,KC_PPLS ,KC_PMNS ,KC_ALAS , KC_LGUI , KC_SPC ,KC_BSPC , KC_DEL ,KC_ENT , KC_RGUI , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + [_SYMB] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_EXLM ,KC_AT ,KC_LCBR ,KC_RCBR ,KC_PIPE ,_______ , _______ ,XXXXXXX ,KC_KP_7 ,KC_KP_8 ,KC_KP_9 ,XXXXXXX ,KC_F12 , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_HASH ,KC_DLR ,KC_LBRC ,KC_RBRC ,KC_GRV ,_______ , _______ ,XXXXXXX ,KC_KP_4 ,KC_KP_5 ,KC_KP_6 ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_PERC ,KC_CIRC ,KC_LPRN ,KC_RPRN ,KC_TILD ,_______ ,_______ , _______ ,_______ ,XXXXXXX ,KC_KP_1 ,KC_KP_2 ,KC_KP_3 ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ , _______ , _______ ,_______ , _______ ,_______ , KC_KP_0 , KC_KP_0 ,KC_PDOT ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + [_NAV] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,KC_MS_U ,XXXXXXX ,KC_WH_U ,XXXXXXX ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_WH_D ,XXXXXXX ,_______ , _______ ,KC_LEFT ,KC_DOWN ,KC_UP ,KC_RIGHT,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , KC_BTN1 , KC_BTN2 ,_______ , _______ ,_______ , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + [_ADJUST] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + XXXXXXX ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,RESET ,RGB_M_P ,RGB_TOG ,RGB_MOD ,RGB_HUD ,RGB_HUI , RGB_SAD ,RGB_SAI ,RGB_VAD ,RGB_VAI ,XXXXXXX ,XXXXXXX ,KC_F12 , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ ,XXXXXXX , XXXXXXX ,_______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ) + +}; diff --git a/keyboards/redox/keymaps/nrichers/keymap.png b/keyboards/redox/keymaps/nrichers/keymap.png Binary files differnew file mode 100644 index 0000000000..8ef3fe4eaa --- /dev/null +++ b/keyboards/redox/keymaps/nrichers/keymap.png diff --git a/keyboards/redox/keymaps/nrichers/readme.md b/keyboards/redox/keymaps/nrichers/readme.md new file mode 100755 index 0000000000..6189e8e9b2 --- /dev/null +++ b/keyboards/redox/keymaps/nrichers/readme.md @@ -0,0 +1,28 @@ +# A tweaked keymap for Redox + +This keymap modifies the [default keymap](https://github.com/qmk/qmk_firmware/tree/master/keyboards/redox) for the awesome [Redox keyboard](https://github.com/mattdibi/redox-keyboard) designed by Mattia Dal Ben. + +![Modified Redox keymap](https://github.com/nrichers/qmk_firmware/blob/master/keyboards/redox/keymaps/nrichers/keymap.png) + +## Changes to the default keymap ![#99fcbe](https://placehold.it/15/99fcbe/000000?text=+) + +These keymap changes are meant to improve the usability of the layout in everyday use: + +- Move `GUI` (`SUPER`) key to where default left `CTRL` and right `ALT` are - gives you two frequently used `CMD` keys on macOS where my brain expects them +- Move `/?` into usual location next to right `SHIFT` - the default flash from Falbatech put `\|` here (might not be the Redox default?), which felt unintuitive +- Put `\|` into bottom-left spot where `GUI` (`SUPER`) was - had to go somewhere and this bottom-left placement sort of balances with the almost bottom-right `/?` +- Change default `ESC` into `ESC` on tap, `CTRL` on hold - Love the UNIX-ey `CTRL` key location and wanted to keep `ESC` in the original position +- Change default `'` above right `SHIFT` into `'` on tap, `CTRL` on hold - Love the UNIX-ey CTRL key location, but it can give you 'left claw hand', which a second, mirrored `CTRL` key fixes +- Add `F11` and `F12` keys to two layers - needed on macOS if you want to control volume up and down from your keyboard (not shown, on a different layer) +- On thumb clusters: + - Left: Move `SPACE` closest to left thumb and move `BACKSPACE` to the right of that - put the key for 'getting it right' closest to your thumb and reduce usage of my right hand (purely personal preference) + - Right: Move `ENTER` closest to right thumb and move `DEL` to the left of that - put the key for 'getting it right' closest to your thumb + +## Changes to the Redox layout ![#99e6fc](https://placehold.it/15/99e6fc/000000?text=+) + +These are physical keycap changes on the board that make reaching the `Layer 1` keys easier and that, subjectively, look more balanced visually: + +- Increase the `Layer 1` key sizes from 1U to 1.25U +- Decrease the 1.5 U key size for `[` and `]` to 1.25U + +You could even make `[` and `]` 1U so that you can use keycaps from a standard ANSI key set and also increase the size of the `Layer 2` keys to 1.5U. diff --git a/keyboards/redox/keymaps/nrichers/rules.mk b/keyboards/redox/keymaps/nrichers/rules.mk new file mode 100755 index 0000000000..a81250cdf6 --- /dev/null +++ b/keyboards/redox/keymaps/nrichers/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_ENABLE = yes + diff --git a/keyboards/romac/config.h b/keyboards/romac/config.h new file mode 100644 index 0000000000..b92785fd52 --- /dev/null +++ b/keyboards/romac/config.h @@ -0,0 +1,40 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER TheRoyalSweatshirt +#define PRODUCT romac +#define DESCRIPTION A *Plaid inspired twelve-key macropad +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 3 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D4, C6, D7, E6 } +#define MATRIX_COL_PINS { F7, B1, B3 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ + +#define BACKLIGHT_LEVELS 0 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* 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 RGBLED_NUM 0 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/romac/info.json b/keyboards/romac/info.json new file mode 100644 index 0000000000..305785991e --- /dev/null +++ b/keyboards/romac/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "RoMac", + "url": "", + "maintainer": "TheRoyalSweatshirt", + "width": 3, + "height": 4, + "layouts": { + "LAYOUT": { + "key_count": 12, + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}] + } + } +} diff --git a/keyboards/romac/keymaps/default/keymap.c b/keyboards/romac/keymaps/default/keymap.c new file mode 100644 index 0000000000..35636f36b3 --- /dev/null +++ b/keyboards/romac/keymaps/default/keymap.c @@ -0,0 +1,37 @@ +/* Copyright 2018 Jack Humbert + * + * 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 QMK_KEYBOARD_H + +#define _BASE 0 +#define _FN1 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BASE] = LAYOUT( + KC_7, KC_8, KC_9, \ + KC_4, KC_5, KC_6, \ + KC_1, KC_2, KC_3, \ + MO(_FN1), KC_0, KC_ENT \ + ), + + [_FN1] = LAYOUT( + KC_TRNS, KC_HOME, KC_PGUP, \ + KC_TRNS, KC_END, KC_PGDN, \ + KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_DOT \ + ) +}; diff --git a/keyboards/romac/readme.md b/keyboards/romac/readme.md new file mode 100644 index 0000000000..98ed21502a --- /dev/null +++ b/keyboards/romac/readme.md @@ -0,0 +1,16 @@ + +# RoMac + +![RoMac](https://i.imgur.com/hAOyoqj.jpg) + +A “Plaid” Inspired 12-Key (3x4) Macropad. + +- Keyboard Maintainer: [Garret G.](https://github.com/TheRoyalSweatshirt) +- Hardware Supported: RoMac rev.1, rev.2, Pro Micro, Elite-C, Proton C, BlueMicro. +- Hardware Availability: Through GB or Direct Message (If extra stock is available). + +Make example for this keyboard (after setting up your build environment): + + make romac:default + +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/romac/romac.c b/keyboards/romac/romac.c new file mode 100644 index 0000000000..24f4c16333 --- /dev/null +++ b/keyboards/romac/romac.c @@ -0,0 +1 @@ +#include "romac.h" diff --git a/keyboards/romac/romac.h b/keyboards/romac/romac.h new file mode 100644 index 0000000000..e6fb9694d2 --- /dev/null +++ b/keyboards/romac/romac.h @@ -0,0 +1,16 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + K00, K01, K02, \ + K10, K11, K12, \ + K20, K21, K22, \ + K30, K31, K32 \ +) \ +{ \ + { K00, K01, K02 }, \ + { K10, K11, K12 }, \ + { K20, K21, K22 }, \ + { K30, K31, K32 } \ +} diff --git a/keyboards/romac/rules.mk b/keyboards/romac/rules.mk new file mode 100644 index 0000000000..b500f1b885 --- /dev/null +++ b/keyboards/romac/rules.mk @@ -0,0 +1,57 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = full # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = no + diff --git a/keyboards/scarletbandana/keymaps/default/config.h b/keyboards/scarletbandana/keymaps/default/config.h index 36f483c111..8533e6f6d6 100644 --- a/keyboards/scarletbandana/keymaps/default/config.h +++ b/keyboards/scarletbandana/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/singa/keymaps/default/config.h b/keyboards/singa/keymaps/default/config.h index 0f75635051..4496c59100 100644 --- a/keyboards/singa/keymaps/default/config.h +++ b/keyboards/singa/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/speedo/keymaps/default/config.h b/keyboards/speedo/keymaps/default/config.h index 112836e5e7..0ab49e8bc4 100644 --- a/keyboards/speedo/keymaps/default/config.h +++ b/keyboards/speedo/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/standaside/config.h b/keyboards/standaside/config.h new file mode 100644 index 0000000000..fa3576ca5b --- /dev/null +++ b/keyboards/standaside/config.h @@ -0,0 +1,204 @@ + + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xF7E0 +#define PRODUCT_ID 0x0412 +#define DEVICE_VER 0x0003 +#define MANUFACTURER Fate Everywhere +#define PRODUCT Stand Aside +#define DESCRIPTION A compact 60% keyboard + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 8 + +/* + * 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 { D1, F4, F6, F7, B1, B3, B2, B6 } +#define MATRIX_COL_PINS { F5, D0, D4, C6, D7, E6, B4, B5 } +#define UNUSED_PINS {} + + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN C7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* + * Enable RGB Underlighting + */ +#define RGB_DI_PIN C7 +#define RGBLED_NUM 12 +#define RGBLIGHT_ANIMATIONS + +/* 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 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + diff --git a/keyboards/standaside/keymaps/default/config.h b/keyboards/standaside/keymaps/default/config.h new file mode 100644 index 0000000000..d533d806c9 --- /dev/null +++ b/keyboards/standaside/keymaps/default/config.h @@ -0,0 +1,5 @@ + + +#pragma once + +// place overrides here diff --git a/keyboards/standaside/keymaps/default/keymap.c b/keyboards/standaside/keymaps/default/keymap.c new file mode 100644 index 0000000000..0f13cb7632 --- /dev/null +++ b/keyboards/standaside/keymaps/default/keymap.c @@ -0,0 +1,77 @@ + +#include QMK_KEYBOARD_H + +#define _MAIN 0 +#define _RAISE 1 +#define _LOWER 2 + +// Readability keycodes +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + +/* MAIN + * .-----------------------------------------------------------------------------------------------------------------------------------------------. + * | TAB | Q | W | E | R | T | Y | U | I | O | P | Backsp | Delete | 7 | 8 | 9 | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | ESC | A | S | D | F | G | H | J | K | L | ; | ' | PgUp | 4 | 5 | 6 | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | SHIFT | Z | X | C | V | B | N | M | , | . | / | ENTER | PgDn | 1 | 2 | 3 | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | LCTRL | PAUS | GUI | ALT | Lower | Space | Space | Raise | Left | Down | Up | Right | Shift | 0 | . | ENTER | + * '-----------------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_MAIN] = LAYOUT_ortho_4x16( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_DEL, KC_KP_7, KC_KP_8, KC_KP_9, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_PGUP, KC_KP_4, KC_KP_5, KC_KP_6, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, KC_PGDN, KC_KP_1, KC_KP_2, KC_KP_3, + KC_LCTL, KC_PAUS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_RSFT, KC_KP_0, KC_KP_DOT, KC_PENT + ), + +/* RAISE + * .-----------------------------------------------------------------------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | Insert | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | - | = | [ | ] | \ | Home | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | | PScr | End | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | Next | Vol- | Vol+ | Play | NumLok | | | | + * '-----------------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_RAISE] = LAYOUT_ortho_4x16( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, KC_INS, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, KC_HOME, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_END, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, KC_NLCK, _______, _______, _______ + ), + +/* LOWER + * .-----------------------------------------------------------------------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | | RGBPWR | Mode | Reset | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | | HUE+ | SAT+ | VAL+ | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | | | | HUE- | SAT- | VAL- | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | Mute | | Plain | Rainbo | Larsen | + * '-----------------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_LOWER] = LAYOUT_ortho_4x16( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, _______, RGB_TOG, RGB_MOD, RESET, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, _______, RGB_HUI, RGB_SAI, RGB_VAI, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_VAD, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, RGB_M_P, RGB_M_R, RGB_M_K + ), + +}; + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +}
\ No newline at end of file diff --git a/keyboards/standaside/readme.md b/keyboards/standaside/readme.md new file mode 100644 index 0000000000..ca1cfb2763 --- /dev/null +++ b/keyboards/standaside/readme.md @@ -0,0 +1,15 @@ +# Stand Aside + +![Stand Aside](https://i.imgur.com/X6Katar.png) + +A compact 60% keyboard designed by Fate Everywhere. Born out of the desire for a Planck with a numpad for technical work. Available for sale (kit and completed) once the store comes up. + +Keyboard Maintainer: [Fate Everywhere](https://github.com/fateeverywhere) +Hardware Supported: Mark 3 Stand Aside. +Hardware Availability: Seven Store (https://store.7storm.org). + +Make example for this keyboard (after setting up your build environment): + + make standaside:default + +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).
\ No newline at end of file diff --git a/keyboards/standaside/rules.mk b/keyboards/standaside/rules.mk new file mode 100644 index 0000000000..a7ebc21fa4 --- /dev/null +++ b/keyboards/standaside/rules.mk @@ -0,0 +1,73 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = atmel_dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +RGBLIGHT_ENABLE = yes # Enable RGB underlighting support + diff --git a/keyboards/standaside/standaside.c b/keyboards/standaside/standaside.c new file mode 100644 index 0000000000..904e92d335 --- /dev/null +++ b/keyboards/standaside/standaside.c @@ -0,0 +1,14 @@ + +#include "standaside.h" +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/standaside/standaside.h b/keyboards/standaside/standaside.h new file mode 100644 index 0000000000..b661696397 --- /dev/null +++ b/keyboards/standaside/standaside.h @@ -0,0 +1,29 @@ + +#ifndef STANDASIDE_H +#define STANDASIDE_H + +#include "quantum.h" +#define ___ KC_NO + +// 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_ortho_4x16( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, K13, K14, K15, \ + K16, K17, K18, K19, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K30, K31, \ + K32, K33, K34, K35, K36, K37, K38, K39, K40, K41, K42, K43, K44, K45, K46, K47, \ + K48, K49, K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K60, K61, K62, K63 \ +) \ +{ \ + { K00, K02, K04, K06, K08, K10, K12, K14 }, \ + { K01, K03, K05, K07, K09, K11, K13, K15 }, \ + { K16, K18, K20, K22, K24, K26, K28, K30 }, \ + { K17, K19, K21, K23, K25, K27, K29, K31 }, \ + { K32, K34, K36, K38, K40, K42, K44, K46 }, \ + { K33, K35, K37, K39, K41, K43, K45, K47 }, \ + { K48, K50, K52, K54, K56, K58, K60, K62 }, \ + { K49, K51, K53, K55, K57, K59, K61, K63 } \ +} + +#endif diff --git a/keyboards/staryu/backlight_staryu.c b/keyboards/staryu/backlight_staryu.c deleted file mode 100644 index 6fb9713f3a..0000000000 --- a/keyboards/staryu/backlight_staryu.c +++ /dev/null @@ -1,52 +0,0 @@ -#include "backlight.h" -#include <avr/pgmspace.h> - -/* backlighting */ -void init_backlight_led(void) -{ - DDRC |= (1<<PC2 | 1<<PC7); - DDRD |= (1<<PD5 | 1<<PD6); - DDRB |= (1<<PB0); -} - -void backlight_led_off(uint8_t index) -{ - switch (index) { - case 0: - PORTC |= (1<<PC2); - break; - case 1: - PORTC |= (1<<PC7); - break; - case 2: - PORTD |= (1<<PD5); - break; - case 3: - PORTD |= (1<<PD6); - break; - case 4: - PORTB |= (1<<PB0); - break; - } -} - -void backlight_led_on(uint8_t index) -{ - switch (index) { - case 0: - PORTC &= ~(1<<PC2); - break; - case 1: - PORTC &= ~(1<<PC7); - break; - case 2: - PORTD &= ~(1<<PD5); - break; - case 3: - PORTD &= ~(1<<PD6); - break; - case 4: - PORTB &= ~(1<<PB0); - break; - } -} diff --git a/keyboards/staryu/backlight_staryu.h b/keyboards/staryu/backlight_staryu.h index f718b970c2..3272283e99 100644 --- a/keyboards/staryu/backlight_staryu.h +++ b/keyboards/staryu/backlight_staryu.h @@ -1,12 +1,21 @@ -#ifndef STARYU_BL -#define STARYU_BL +/* +Copyright 2019 -#include <stdint.h> +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. -void init_backlight_led(void); +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. -void backlight_led_on(uint8_t index); +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 -void backlight_led_off(uint8_t index); - -#endif +// Add backwards compatibility for existing keymaps +#define backlight_led_off(i) backlight_set_value(i, 0) +#define backlight_led_on(i) backlight_set_value(i, 1)
\ No newline at end of file diff --git a/keyboards/staryu/config.h b/keyboards/staryu/config.h index 268fe991ac..7f8b39ba7b 100755 --- a/keyboards/staryu/config.h +++ b/keyboards/staryu/config.h @@ -14,8 +14,7 @@ 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/>. */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -32,43 +31,38 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define MATRIX_COLS 5 /* key matrix pins */ -#define MATRIX_ROW_PINS { } +#define MATRIX_ROW_PINS { NO_PIN } #define MATRIX_COL_PINS { D0, D1, D2, D3, D4 } #define UNUSED_PINS -// from light_ws2812_config @ -// https://github.com/kairyu/tmk_keyboard_custom/tree/master/keyboard/staryu +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + #define RGB_DI_PIN C6 -#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 1 // Number of LEDs +#define RGBLIGHT_ANIMATIONS +// #ifdef RGB_DI_PIN +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// #endif -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW +#define BACKLIGHT_LEVELS 1 // either on/off +#define RGBLIGHT_LIMIT_VAL 200 /* Set 0 if debouncing isn't needed */ #define DEBOUNCING_DELAY 5 - -// TODO backlighting -#define BACKLIGHT_LEVELS 10 -// #define BACKLIGHT_PIN B7 -/* -Backlight: C2, C7, D5, D6, B0 -switch (index) { - case 0: - PORTC &= ~(1<<PC2); - break; - case 1: - PORTC &= ~(1<<PC7); - break; - case 2: - PORTD &= ~(1<<PD5); - break; - case 3: - PORTD &= ~(1<<PD6); - break; - case 4: - PORTB &= ~(1<<PB0); - break; -*/ - -#endif diff --git a/keyboards/staryu/keymaps/default/keymap.c b/keyboards/staryu/keymaps/default/keymap.c index 3dc480299f..8c47ff44ab 100755 --- a/keyboards/staryu/keymaps/default/keymap.c +++ b/keyboards/staryu/keymaps/default/keymap.c @@ -15,68 +15,90 @@ 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 QMK_KEYBOARD_H -#include "action_layer.h" enum layers { _LAYER0, _LAYER1, _LAYER2, - _LAYER3 + _LAYER3, + _LAYER4 }; +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_LAYER0] = LAYOUT( +/* ┌─────────┬─────────┬─────────┐ */ + KC_UP, TO(_LAYER1), +/* ├─────────┼─────────┼─────────┤ */ + KC_LEFT, KC_DOWN, KC_RIGHT +/* └─────────┴─────────┴─────────┘ */ + ), + + [_LAYER1] = LAYOUT( +/* ┌─────────┬─────────┬─────────┐ */ + KC_PGUP, TO(_LAYER2), +/* ├─────────┼─────────┼─────────┤ */ + KC_HOME, KC_PGDN, KC_END +/* └─────────┴─────────┴─────────┘ */ + ), + + [_LAYER2] = LAYOUT( +/* ┌─────────┬─────────┬─────────┐ */ + KC_MSEL, TO(_LAYER3), +/* ├─────────┼─────────┼─────────┤ */ + KC_MPRV, KC_MPLY, KC_MNXT +/* └─────────┴─────────┴─────────┘ */ + ), + + [_LAYER3] = LAYOUT( +/* ┌─────────┬─────────┬─────────┐ */ + KC_MS_U, TO(_LAYER4), +/* ├─────────┼─────────┼─────────┤ */ + KC_MS_L, KC_MS_D, KC_MS_R +/* └─────────┴─────────┴─────────┘ */ + ), + + [_LAYER4] = LAYOUT( +/* ┌─────────┬─────────┬─────────┐ */ + XXXXXXX, TO(_LAYER0), +/* ├─────────┼─────────┼─────────┤ */ + RGB_TOG, BL_TOGG, BL_STEP +/* └─────────┴─────────┴─────────┘ */ + ), -const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { - /* Keymap 0 - * ,-----------. - * | |Up |Fn0| - * |---+---+---| - * |Lef|Dow|Rig| - * `-----------' - */ - LAYOUT( KC_UP, TO(_LAYER1), KC_LEFT,KC_DOWN,KC_RIGHT ), - /* Keymap 1 - * ,-----------. - * | |PgU|Fn1| - * |---+---+---| - * |Hom|PgD|End| - * `-----------' - */ - LAYOUT( KC_PGUP,TO(_LAYER2), KC_HOME,KC_PGDN,KC_END ), - /* Keymap 2 - * ,-----------. - * | |Sel|Fn2| - * |---+---+---| - * |Pre|Pla|Nex| - * `-----------' - */ - LAYOUT( KC_MSEL,TO(_LAYER3), KC_MPRV,KC_MPLY,KC_MNXT ), - /* Keymap 3 - * ,-----------. - * | |MsU|Fn3| - * |---+---+---| - * |MsL|MsD|MsR| - * `-----------' - */ - LAYOUT( KC_MS_U,TO(_LAYER0), KC_MS_L,KC_MS_D,KC_MS_R ), - // /* Keymap 4 - // * ,-----------. - // * | |Fn6|Fn4| - // * |---+---+---| - // * |Fn7|Fn5|Fn8| - // * `-----------' - // */ - // LAYOUT( FN6, FN4, FN7, FN5, FN8 ), }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE ; -} +void eeconfig_init_user(void) { + // use the non noeeprom versions, to write these values to EEPROM too + rgblight_enable(); + rgblight_mode(RGBLIGHT_MODE_BREATHING+1); -void matrix_init_user(void) { + backlight_enable(); } -void matrix_scan_user(void) { +void keyboard_post_init_user(void) { + //layer_state_set_user is not called for inital state - set it here + rgblight_sethsv_noeeprom_white(); } -void led_set_user(uint8_t usb_led) { +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case _LAYER1: + rgblight_sethsv_noeeprom_cyan(); + break; + case _LAYER2: + rgblight_sethsv_noeeprom_magenta(); + break; + case _LAYER3: + rgblight_sethsv_noeeprom_red(); + break; + case _LAYER4: + rgblight_sethsv_noeeprom_orange(); + break; + case _LAYER0: + default: // for any other layers, or the default layer + rgblight_sethsv_noeeprom_white(); + break; + } + return state; } diff --git a/keyboards/staryu/rules.mk b/keyboards/staryu/rules.mk index 3e043bbcd5..ad4873a39a 100755 --- a/keyboards/staryu/rules.mk +++ b/keyboards/staryu/rules.mk @@ -1,10 +1,6 @@ # MCU name MCU = atmega32u2 -BOOTLOADER = lufa-dfu - -SRC = backlight_staryu.c - # Processor frequency. # This will define a symbol, F_CPU, in all source code files equal to the # processor frequency in Hz. You can then use this symbol in your source code to @@ -40,21 +36,43 @@ F_USB = $(F_CPU) # Interrupt driven control endpoint task(+60) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = lufa-dfu + -# Boot Section Size in *bytes* -OPT_DEFS += -DBOOTLOADER_SIZE=4096 +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 # Build Options # comment out to disable the options. # -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -NKRO_ENABLE = no # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # In-switch LEDs -AUDIO_ENABLE = no # There is no available timer or pin for audio on the NovelPad -RGBLIGHT_ENABLE = yes # RGB LEDs for underglow, installed and enabled by default for the NovelPad +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/staryu/staryu.c b/keyboards/staryu/staryu.c index 6dcaaea0e8..20334c0b78 100755 --- a/keyboards/staryu/staryu.c +++ b/keyboards/staryu/staryu.c @@ -15,12 +15,30 @@ 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 "staryu.h" -#include "backlight_staryu.h" - -// for keyboard subdirectory level init functions -// @Override -void matrix_init_kb(void) { - // call user level keymaps, if any - init_backlight_led(); - matrix_init_user(); + +#ifdef BACKLIGHT_ENABLE + +#ifdef BACKLIGHT_PIN + #pragma error "BACKLIGHT_PIN must stay undefined otherwise software pwm is incorrectly used" +#endif + +#define BACKLIGHT_PIN_COUNT 5 +static const pin_t backlight_pins[BACKLIGHT_PIN_COUNT] = { C2, C7, D5, D6, B0 }; + +void backlight_init_ports(void) { + for (uint8_t index = 0; index < BACKLIGHT_PIN_COUNT; index++) { + setPinOutput(backlight_pins[index]); + } } + +void backlight_set_value(uint8_t index, uint8_t level) { + writePin(backlight_pins[index], !!level); +} + +void backlight_set(uint8_t level) { + for (uint8_t index = 0; index < BACKLIGHT_PIN_COUNT; index++) { + backlight_set_value(index, level); + } +} + +#endif //BACKLIGHT_ENABLE diff --git a/keyboards/staryu/staryu.h b/keyboards/staryu/staryu.h index 12b8be92e7..f404dff284 100755 --- a/keyboards/staryu/staryu.h +++ b/keyboards/staryu/staryu.h @@ -14,15 +14,19 @@ 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/>. */ -#ifndef KB_H -#define KB_H +#pragma once #include "quantum.h" #define LAYOUT( \ - K00, K01, \ - K10, K11, K12 \ + K00, K01, \ + K10, K11, K12 \ ) { \ { K00, K01, K12, K11, K10 }, \ } + +#ifdef BACKLIGHT_ENABLE + +void backlight_set_value(uint8_t index, uint8_t level); + #endif diff --git a/keyboards/subatomic/keymaps/default/config.h b/keyboards/subatomic/keymaps/default/config.h index 4c61581993..5352ef06c9 100644 --- a/keyboards/subatomic/keymaps/default/config.h +++ b/keyboards/subatomic/keymaps/default/config.h @@ -1,7 +1,6 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "../../config.h" +// place overrides here /* * MIDI options @@ -25,5 +24,3 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 2 - -#endif
\ No newline at end of file diff --git a/keyboards/subatomic/keymaps/default/keymap.c b/keyboards/subatomic/keymaps/default/keymap.c index 184df24d56..8def46961a 100644 --- a/keyboards/subatomic/keymaps/default/keymap.c +++ b/keyboards/subatomic/keymaps/default/keymap.c @@ -1,9 +1,4 @@ -#include "subatomic.h" -#include "action_layer.h" -#include "eeconfig.h" -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. diff --git a/keyboards/sx60/keymaps/default/config.h b/keyboards/sx60/keymaps/default/config.h index a5568e400d..271f48d001 100644 --- a/keyboards/sx60/keymaps/default/config.h +++ b/keyboards/sx60/keymaps/default/config.h @@ -1 +1,3 @@ -#include "../../config.h" +#pragma once + +// place overrides here diff --git a/keyboards/tanuki/keymaps/default/keymap.c b/keyboards/tanuki/keymaps/default/keymap.c index 59f5843ea9..29c9071bfa 100644 --- a/keyboards/tanuki/keymaps/default/keymap.c +++ b/keyboards/tanuki/keymaps/default/keymap.c @@ -1,5 +1,4 @@ #include QMK_KEYBOARD_H -#include "rgblight.h" //Layer definitions #define _BL 0 diff --git a/keyboards/telophase/keymaps/default/keymap.c b/keyboards/telophase/keymaps/default/keymap.c index d4afa65f93..9cc6c1bb00 100644 --- a/keyboards/telophase/keymaps/default/keymap.c +++ b/keyboards/telophase/keymaps/default/keymap.c @@ -1,7 +1,7 @@ // this is the style you want to emulate. // This is the canonical layout file for the Quantum project. If you want to add another keyboard, -#include "telophase.h" +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. @@ -15,7 +15,7 @@ enum telophase_layers _ADJUST, }; -enum telophase_keycodes +enum telophase_keycodes { LOWER = SAFE_RANGE, RAISE, @@ -97,4 +97,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { void matrix_scan_user(void) { return; }; - diff --git a/keyboards/tetris/keymaps/default/keymap.c b/keyboards/tetris/keymaps/default/keymap.c index 6ce856178b..0ec12435e7 100644 --- a/keyboards/tetris/keymaps/default/keymap.c +++ b/keyboards/tetris/keymaps/default/keymap.c @@ -1,7 +1,6 @@ #include QMK_KEYBOARD_H #ifdef AUDIO_ENABLE - #include "audio.h" float tone_caps[][2] = SONG( CAPS_LOCK_ON_SOUND ); float tone_taps[][2] = SONG( E__NOTE( _A6 ) ); #endif diff --git a/keyboards/the_ruler/keymaps/default/config.h b/keyboards/the_ruler/keymaps/default/config.h index df06a26206..271f48d001 100644 --- a/keyboards/the_ruler/keymaps/default/config.h +++ b/keyboards/the_ruler/keymaps/default/config.h @@ -1,8 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif
\ No newline at end of file diff --git a/keyboards/the_ruler/keymaps/default/keymap.c b/keyboards/the_ruler/keymaps/default/keymap.c index cb8e8ece8c..8b0f44b5ed 100644 --- a/keyboards/the_ruler/keymaps/default/keymap.c +++ b/keyboards/the_ruler/keymaps/default/keymap.c @@ -1,6 +1,4 @@ #include QMK_KEYBOARD_H -#include "action_layer.h" -#include "eeconfig.h" extern keymap_config_t keymap_config; diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/default/config.h b/keyboards/thevankeyboards/bananasplit/keymaps/default/config.h index 060f5922f2..b89b05009a 100644 --- a/keyboards/thevankeyboards/bananasplit/keymaps/default/config.h +++ b/keyboards/thevankeyboards/bananasplit/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/thevankeyboards/minivan/keymaps/default/config.h b/keyboards/thevankeyboards/minivan/keymaps/default/config.h index df06a26206..271f48d001 100644 --- a/keyboards/thevankeyboards/minivan/keymaps/default/config.h +++ b/keyboards/thevankeyboards/minivan/keymaps/default/config.h @@ -1,8 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif
\ No newline at end of file diff --git a/keyboards/thevankeyboards/roadkit/keymaps/default/config.h b/keyboards/thevankeyboards/roadkit/keymaps/default/config.h index df06a26206..271f48d001 100644 --- a/keyboards/thevankeyboards/roadkit/keymaps/default/config.h +++ b/keyboards/thevankeyboards/roadkit/keymaps/default/config.h @@ -1,8 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif
\ No newline at end of file diff --git a/keyboards/tmo50/keymaps/pyrol/keymap.c b/keyboards/tmo50/keymaps/pyrol/keymap.c index a37370c389..f67d26092f 100644 --- a/keyboards/tmo50/keymaps/pyrol/keymap.c +++ b/keyboards/tmo50/keymaps/pyrol/keymap.c @@ -15,37 +15,54 @@ */ #include QMK_KEYBOARD_H +#define CALTDEL LCA(KC_DEL) +#define TSKMGR C(S(KC_ESC)) + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Default layer - [0] = LAYOUT( - KC_TRNS, 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_BSPC, - KC_TRNS, KC_LCTL, 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_TRNS, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(2), - KC_TRNS, KC_GESC, KC_LGUI, KC_LALT, LT(1, KC_SPC), LT(1, KC_SPC), KC_RALT, MO(3) + [0] = LAYOUT_all( + KC_VOLU, KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, KC_EQL, KC_BSPC, + KC_VOLD, KC_LCTRL, 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_MPLY, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(3), + KC_MUTE, KC_LGUI, KC_LALT, LT(1, KC_SPC), LT(2, KC_SPC), KC_RALT, MO(4) ), // Fn1 layer - [1] = LAYOUT( - KC_VOLU, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_MINS, KC_EQL, KC_BSPC, - KC_VOLD, KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_GRV, KC_TRNS, - KC_MPLY, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SPC, KC_TRNS, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, KC_TRNS, KC_TRNS, - KC_MUTE, KC_TAB, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + [1] = LAYOUT_all( + A(KC_TAB), KC_TAB, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_RBRC, KC_LBRC, KC_DEL, + C(KC_C), KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_GRV, KC_TRNS, + C(KC_V), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SPC, KC_TRNS, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, KC_TRNS, KC_TRNS, + C(KC_X), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), - // Fn2 layer - [2] = LAYOUT( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_END, KC_UP, KC_TRNS, KC_TRNS, KC_DEL, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + //Fn2 layer + [2] = LAYOUT_all( + A(KC_TAB), KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_RBRC, KC_LBRC, KC_DEL, + C(KC_C), KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TILD, KC_TRNS, + C(KC_V), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SPC, KC_TRNS, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, KC_TRNS, KC_TRNS, + C(KC_X), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), // Fn3 layer - [3] = LAYOUT( - RESET, 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_TRNS, - KC_TRNS, KC_CAPS, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, BL_TOGG, BL_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, BL_STEP, BL_DEC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + [3] = LAYOUT_all( + CALTDEL, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, + TSKMGR, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, TO(5), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_PGUP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), -}; + // Fn4 layer + [4] = LAYOUT_all( + RESET, KC_TRNS, 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_TRNS, + KC_TRNS, KC_CAPS, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_SLEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + // Game layer! + [5] = LAYOUT_all( + KC_VOLU, KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, KC_EQL, KC_BSPC, + KC_VOLD, KC_LCTRL, 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_MPLY, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(3), + KC_F12, KC_F13, KC_LALT, KC_SPC, LT(2, KC_SPC), KC_RALT, TO(0) + ), +}; diff --git a/keyboards/treadstone48/common/glcdfont.c b/keyboards/treadstone48/common/glcdfont.c new file mode 100644 index 0000000000..32c688e2bb --- /dev/null +++ b/keyboards/treadstone48/common/glcdfont.c @@ -0,0 +1,244 @@ +// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0. +// See gfxfont.h for newer custom bitmap font info. + +#ifndef FONT5X7_H +#define FONT5X7_H + +#ifdef __AVR__ + #include <avr/io.h> + #include <avr/pgmspace.h> +#elif defined(ESP8266) + #include <pgmspace.h> +#else + #define PROGMEM +#endif + +// Standard ASCII 5x7 font + +static const unsigned char font[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, + 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, + 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, + 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, + 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, + 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, + 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, + 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, + 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, + 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, + 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, + 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, + 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, + 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, + 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, + 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, + 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, + 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, + 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, + 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, + 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, + 0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, + 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, + 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, + 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, + 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, + 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, + 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, + 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, + 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, + 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, + 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, + 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, + 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, + 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, + 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, + 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, + 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, + 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, + 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, + 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, + 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, + 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, + 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, + 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, + 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, + 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, + 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, + 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, + 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, + 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, + 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, + 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, + 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, + 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, + 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, + 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, + 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, + 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, + 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, + 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, + 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, + 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, + 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, + 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, + 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, + 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, + 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, + 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, + 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, + 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, + 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, + 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, + 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x28, 0x00, + 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, + 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, + 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, + 0x18, 0x24, 0x24, 0x1C, 0x78, 0x00, + 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, + 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, + 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, + 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, + 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, + 0xFC, 0x18, 0x24, 0x24, 0x18, 0x00, + 0x18, 0x24, 0x24, 0x18, 0xFC, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, + 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, + 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, + 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, + 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, + 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, + 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, + 0x4C, 0x10, 0x10, 0x10, 0x7C, 0x00, + 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, + 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, + 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, + 0x00, 0x41, 0x36, 0x08, 0x00, 0x00, + 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, + 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; +#endif // FONT5X7_H diff --git a/keyboards/treadstone48/common/oled_helper.c b/keyboards/treadstone48/common/oled_helper.c new file mode 100644 index 0000000000..500d3c0dc1 --- /dev/null +++ b/keyboards/treadstone48/common/oled_helper.c @@ -0,0 +1,83 @@ +#ifdef SSD1306OLED +#include QMK_KEYBOARD_H +#include "ssd1306.h" + +void render_logo(struct CharacterMatrix *matrix) { + + const char logo_buf[]={ + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, + 0}; + + matrix_write(matrix, logo_buf); +} + +static char keylog_buf[24] = "Key state ready."; +const char code_to_name[60] = { + ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', + 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', + 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', + '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', + 'R', 'E', 'B', 'T', ' ', '-', ' ', '@', ' ', ' ', + ' ', ';', ':', ' ', ',', '.', '/', ' ', ' ', ' '}; + +void update_key_status(uint16_t keycode, keyrecord_t *record) { + + if (!record->event.pressed) return; + + char name = (keycode < 60) ? code_to_name[keycode] : ' '; + snprintf(keylog_buf, sizeof(keylog_buf) - 1, "Key:%dx%d %2x %c", + record->event.key.row, record->event.key.col, + (uint16_t)keycode, name); +} + +void render_key_status(struct CharacterMatrix *matrix) { + + matrix_write(matrix, keylog_buf); +} + +static char lock_buf[24] = "Lock state ready.\n"; +void update_lock_status(void) { + + uint8_t leds = host_keyboard_leds(); + char *num_lock = (leds & (1<<USB_LED_NUM_LOCK)) ? "Num" : ""; + char *caps_lock = (leds & (1<<USB_LED_CAPS_LOCK)) ? "Caps" : ""; + char *scrl_lock = (leds & (1<<USB_LED_SCROLL_LOCK)) ? "Scrn" : ""; + snprintf(lock_buf, sizeof(lock_buf) - 1, "Lock:%s %s %s\n", + num_lock, caps_lock, scrl_lock); +} + +void render_lock_status(struct CharacterMatrix *matrix) { + + matrix_write(matrix, lock_buf); +} + +#ifdef RGBLIGHT_ENABLE +extern rgblight_config_t rgblight_config; + +static char led_buf[24] = "LED state ready.\n"; +rgblight_config_t rgblight_config_bak; +void update_led_status(void) { + + if (rgblight_config_bak.enable != rgblight_config.enable || + rgblight_config_bak.mode != rgblight_config.mode || + rgblight_config_bak.hue != rgblight_config.hue || + rgblight_config_bak.sat != rgblight_config.sat || + rgblight_config_bak.val != rgblight_config.val + ) { + snprintf(led_buf, sizeof(led_buf) - 1, "LED%c:%2d hsv:%2d %2d %2d\n", + rgblight_config.enable ? '*' : '.', (uint8_t)rgblight_config.mode, + (uint8_t)(rgblight_config.hue / RGBLIGHT_HUE_STEP), + (uint8_t)(rgblight_config.sat / RGBLIGHT_SAT_STEP), + (uint8_t)(rgblight_config.val / RGBLIGHT_VAL_STEP)); + rgblight_config_bak = rgblight_config; + } +} + +void render_led_status(struct CharacterMatrix *matrix) { + + matrix_write(matrix, led_buf); +} +#endif +#endif diff --git a/keyboards/treadstone48/common/oled_helper.h b/keyboards/treadstone48/common/oled_helper.h new file mode 100644 index 0000000000..44628a5261 --- /dev/null +++ b/keyboards/treadstone48/common/oled_helper.h @@ -0,0 +1,35 @@ +#ifdef SSD1306OLED + +void render_logo(struct CharacterMatrix *matrix); +void update_key_status(uint16_t keycode, keyrecord_t *record); +void render_key_status(struct CharacterMatrix *matrix); +void update_lock_status(void); +void render_lock_status(struct CharacterMatrix *matrix); + +#define RENDER_LOGO(a) render_logo(a) +#define UPDATE_KEY_STATUS(a, b) update_key_status(a, b) +#define RENDER_KEY_STATUS(a) render_key_status(a) +#define UPDATE_LOCK_STATUS() update_lock_status() +#define RENDER_LOCK_STATUS(a) render_lock_status(a) + +#ifdef RGBLIGHT_ENABLE + void update_led_status(void); + void render_led_status(struct CharacterMatrix *matrix); + #define UPDATE_LED_STATUS() update_led_status() + #define RENDER_LED_STATUS(a) render_led_status(a) +#else + #define UPDATE_LED_STATUS() + #define RENDER_LED_STATUS(a) +#endif + +#else + +#define RENDER_LOGO(a) +#define UPDATE_KEY_STATUS(a, b) +#define RENDER_KEY_STATUS(a) +#define UPDATE_LOCK_STATUS() +#define RENDER_LOCK_STATUS(a) +#define UPDATE_LED_STATUS() +#define RENDER_LED_STATUS(a) + +#endif diff --git a/keyboards/treadstone48/config.h b/keyboards/treadstone48/config.h new file mode 100644 index 0000000000..2e571e2690 --- /dev/null +++ b/keyboards/treadstone48/config.h @@ -0,0 +1,43 @@ +/* +Copyright 2012 Jun Wako <wakojun@gmail.com> +Copyright 2015 Jack Humbert + +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" + +// GCC include 'config.h" sequence in qmk_firmware/keyboards/treadstone48/ +// -include keyboards/treadstone48/config.h +// -include keyboards/treadstone48/rev?/config.h +// -include keyboards/treadstone48/rev?/keymaps/MAPNAME/config.h +// XXXX.c + +#include <serial_config.h> + +// GCC include search path in qmk_firmare/keyboards/treadstone48/ +// #include "..." search starts here: +// #include <...> search starts here: +// keyboards/treadstone48/rev?/keymaps/MAPNAME +// keyboards/treadstone48 +// keyboards/treadstone48/rev? +// . +// ./tmk_core +// ...... + +// MACRO and FUNCTION are features that are depreciated. +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION diff --git a/keyboards/treadstone48/i2c.c b/keyboards/treadstone48/i2c.c new file mode 100644 index 0000000000..4bee5c6398 --- /dev/null +++ b/keyboards/treadstone48/i2c.c @@ -0,0 +1,162 @@ +#include <util/twi.h> +#include <avr/io.h> +#include <stdlib.h> +#include <avr/interrupt.h> +#include <util/twi.h> +#include <stdbool.h> +#include "i2c.h" + +#ifdef USE_I2C + +// Limits the amount of we wait for any one i2c transaction. +// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is +// 9 bits, a single transaction will take around 90μs to complete. +// +// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit +// poll loop takes at least 8 clock cycles to execute +#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 + +#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) + +volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +static volatile uint8_t slave_buffer_pos; +static volatile bool slave_has_register_set = false; + +// Wait for an i2c operation to finish +inline static +void i2c_delay(void) { + uint16_t lim = 0; + while(!(TWCR & (1<<TWINT)) && lim < I2C_LOOP_TIMEOUT) + lim++; + + // easier way, but will wait slightly longer + // _delay_us(100); +} + +// Setup twi to run at 100kHz or 400kHz (see ./i2c.h SCL_CLOCK) +void i2c_master_init(void) { + // no prescaler + TWSR = 0; + // Set TWI clock frequency to SCL_CLOCK. Need TWBR>10. + // Check datasheets for more info. + TWBR = ((F_CPU/SCL_CLOCK)-16)/2; +} + +// Start a transaction with the given i2c slave address. The direction of the +// transfer is set with I2C_READ and I2C_WRITE. +// returns: 0 => success +// 1 => error +uint8_t i2c_master_start(uint8_t address) { + TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTA); + + i2c_delay(); + + // check that we started successfully + if ( (TW_STATUS != TW_START) && (TW_STATUS != TW_REP_START)) + return 1; + + TWDR = address; + TWCR = (1<<TWINT) | (1<<TWEN); + + i2c_delay(); + + if ( (TW_STATUS != TW_MT_SLA_ACK) && (TW_STATUS != TW_MR_SLA_ACK) ) + return 1; // slave did not acknowledge + else + return 0; // success +} + + +// Finish the i2c transaction. +void i2c_master_stop(void) { + TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO); + + uint16_t lim = 0; + while(!(TWCR & (1<<TWSTO)) && lim < I2C_LOOP_TIMEOUT) + lim++; +} + +// Write one byte to the i2c slave. +// returns 0 => slave ACK +// 1 => slave NACK +uint8_t i2c_master_write(uint8_t data) { + TWDR = data; + TWCR = (1<<TWINT) | (1<<TWEN); + + i2c_delay(); + + // check if the slave acknowledged us + return (TW_STATUS == TW_MT_DATA_ACK) ? 0 : 1; +} + +// Read one byte from the i2c slave. If ack=1 the slave is acknowledged, +// if ack=0 the acknowledge bit is not set. +// returns: byte read from i2c device +uint8_t i2c_master_read(int ack) { + TWCR = (1<<TWINT) | (1<<TWEN) | (ack<<TWEA); + + i2c_delay(); + return TWDR; +} + +void i2c_reset_state(void) { + TWCR = 0; +} + +void i2c_slave_init(uint8_t address) { + TWAR = address << 0; // slave i2c address + // TWEN - twi enable + // TWEA - enable address acknowledgement + // TWINT - twi interrupt flag + // TWIE - enable the twi interrupt + TWCR = (1<<TWIE) | (1<<TWEA) | (1<<TWINT) | (1<<TWEN); +} + +ISR(TWI_vect); + +ISR(TWI_vect) { + uint8_t ack = 1; + switch(TW_STATUS) { + case TW_SR_SLA_ACK: + // this device has been addressed as a slave receiver + slave_has_register_set = false; + break; + + case TW_SR_DATA_ACK: + // this device has received data as a slave receiver + // The first byte that we receive in this transaction sets the location + // of the read/write location of the slaves memory that it exposes over + // i2c. After that, bytes will be written at slave_buffer_pos, incrementing + // slave_buffer_pos after each write. + if(!slave_has_register_set) { + slave_buffer_pos = TWDR; + // don't acknowledge the master if this memory loctaion is out of bounds + if ( slave_buffer_pos >= SLAVE_BUFFER_SIZE ) { + ack = 0; + slave_buffer_pos = 0; + } + slave_has_register_set = true; + } else { + i2c_slave_buffer[slave_buffer_pos] = TWDR; + BUFFER_POS_INC(); + } + break; + + case TW_ST_SLA_ACK: + case TW_ST_DATA_ACK: + // master has addressed this device as a slave transmitter and is + // requesting data. + TWDR = i2c_slave_buffer[slave_buffer_pos]; + BUFFER_POS_INC(); + break; + + case TW_BUS_ERROR: // something went wrong, reset twi state + TWCR = 0; + default: + break; + } + // Reset everything, so we are ready for the next TWI interrupt + TWCR |= (1<<TWIE) | (1<<TWINT) | (ack<<TWEA) | (1<<TWEN); +} +#endif diff --git a/keyboards/treadstone48/i2c.h b/keyboards/treadstone48/i2c.h new file mode 100644 index 0000000000..710662c7ab --- /dev/null +++ b/keyboards/treadstone48/i2c.h @@ -0,0 +1,46 @@ +#pragma once + +#include <stdint.h> + +#ifndef F_CPU +#define F_CPU 16000000UL +#endif + +#define I2C_READ 1 +#define I2C_WRITE 0 + +#define I2C_ACK 1 +#define I2C_NACK 0 + +#define SLAVE_BUFFER_SIZE 0x10 + +// i2c SCL clock frequency 400kHz +#define SCL_CLOCK 400000L + +extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +void i2c_master_init(void); +uint8_t i2c_master_start(uint8_t address); +void i2c_master_stop(void); +uint8_t i2c_master_write(uint8_t data); +uint8_t i2c_master_read(int); +void i2c_reset_state(void); +void i2c_slave_init(uint8_t address); + + +static inline unsigned char i2c_start_read(unsigned char addr) { + return i2c_master_start((addr << 1) | I2C_READ); +} + +static inline unsigned char i2c_start_write(unsigned char addr) { + return i2c_master_start((addr << 1) | I2C_WRITE); +} + +// from SSD1306 scrips +extern unsigned char i2c_rep_start(unsigned char addr); +extern void i2c_start_wait(unsigned char addr); +extern unsigned char i2c_readAck(void); +extern unsigned char i2c_readNak(void); +extern unsigned char i2c_read(unsigned char ack); + +#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); diff --git a/keyboards/treadstone48/keymaps/default/config.h b/keyboards/treadstone48/keymaps/default/config.h new file mode 100644 index 0000000000..3f63a0cfbb --- /dev/null +++ b/keyboards/treadstone48/keymaps/default/config.h @@ -0,0 +1,60 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako <wakojun@gmail.com> +Copyright 2015 Jack Humbert + +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 + +// place overrides here + +#ifdef TAPPING_TERM +#undef TAPPING_TERM +#endif +#define TAPPING_TERM 225 +// #define PREVENT_STUCK_MODIFIERS +// #define IGNORE_MOD_TAP_INTERRUPT + +#ifdef MOUSEKEY_ENABLE + #undef MOUSEKEY_INTERVAL + #define MOUSEKEY_INTERVAL 1 + + #undef MOUSEKEY_TIME_TO_MAX + #define MOUSEKEY_TIME_TO_MAX 150 + + #undef MOUSEKEY_MAX_SPEED + #define MOUSEKEY_MAX_SPEED 3 + + #undef MOUSEKEY_MOVE_DELTA + #define MOUSEKEY_MOVE_DELTA 4 + + #undef MOUSEKEY_DELAY + #define MOUSEKEY_DELAY 0 +#endif + +// Selection of RGBLIGHT MODE to use. +#if defined(LED_ANIMATIONS) + //#define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + //#define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + //#define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif diff --git a/keyboards/treadstone48/keymaps/default/keymap.c b/keyboards/treadstone48/keymaps/default/keymap.c new file mode 100644 index 0000000000..406f112921 --- /dev/null +++ b/keyboards/treadstone48/keymaps/default/keymap.c @@ -0,0 +1,278 @@ +#include QMK_KEYBOARD_H +#include "keymap_jp.h" +#include "../common/oled_helper.h" + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_number { + _BASE = 0, + _LOWER, + _RAISE, + _ADJUST, +}; + +enum custom_keycodes { + LOWER = SAFE_RANGE, + RAISE, + ADJUST, + KANJI, + RGBRST +}; + +enum tapdances{ + TD_SCCL = 0, + TD_SLRO, +}; + +// Layer Mode aliases +#define _____ KC_TRNS +#define XXXXX KC_NO + +#define KC_TBSF LSFT_T(KC_TAB) +// #define KC_SPSF LSFT_T(KC_SPC) +#define KC_ALAP LALT_T(KC_APP) +#define KC_JEQL LSFT(KC_MINS) + +#define KC_SCCL TD(TD_SCCL) +#define KC_SLRO TD(TD_SLRO) + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_SCCL] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, KC_QUOT), + [TD_SLRO] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_RO), +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_base( \ + //,--------------------------------------------------------------------------------------------------------------------. + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+-----------------| + KC_TBSF, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCCL, KC_ENT,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLRO, KC_UP, \ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| + KC_LCTRL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, RAISE, KC_ALAP, KC_LEFT, KC_DOWN, KC_RGHT,\ + //`-------------------------------------------------------------------------------------------------------------------' + KC_DEL \ + // ExtraKey: Split backspace key or it is below the enter key. + ), + + [_LOWER] = LAYOUT_base( \ + //,--------------------------------------------------------------------------------------------------------------------. + _____, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+-----------------| + _____, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXX, XXXXX, XXXXX, KC_SCLN, KC_QUOT, _____,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| + _____, KC_F11, KC_F12, XXXXX, KANJI, KC_ENT, XXXXX, XXXXX, KC_COMM, KC_DOT, KC_GRV, KC_PGUP, \ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| + _____, _____, _____, _____, KC_DEL, _____, _____, XXXXX, KC_HOME, KC_PGDN, KC_END,\ + //`-------------------------------------------------------------------------------------------------------------------' + XXXXX \ + // ExtraKey: Split backspace key or it is below the enter key. + ), + + [_RAISE] = LAYOUT_base( \ + //,--------------------------------------------------------------------------------------------------------------------. + _____, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, XXXXX,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+-----------------| + _____, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, KC_4, KC_5, KC_6, KC_QUOT, _____,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| + _____, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, KC_1, KC_2, KC_3, KC_RO, XXXXX, \ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| + _____, _____, _____, _____, _____, _____, _____, KC_0, KC_DOT, KC_COMM, KC_SLSH,\ + //`-------------------------------------------------------------------------------------------------------------------' + XXXXX \ + // ExtraKey: Split backspace key or it is below the enter key. + ), + + [_ADJUST] = LAYOUT_base( \ + //,--------------------------------------------------------------------------------------------------------------------. + XXXXX, RESET, RGBRST, AG_NORM, AG_SWAP, XXXXX, XXXXX, KC_WH_L, KC_WH_U, KC_HOME, KC_PGUP, XXXXX,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+-----------------| + XXXXX, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXX, XXXXX, KC_WH_R, KC_WH_D, KC_END, KC_PGDN, XXXXX,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| + _____, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXX, XXXXX, XXXXX, KC_BTN1, KC_BTN2, XXXXX, KC_MS_U, \ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| + _____, _____, _____, _____, XXXXX, XXXXX, _____, XXXXX, KC_MS_L, KC_MS_D, KC_MS_R,\ + //`-------------------------------------------------------------------------------------------------------------------' + XXXXX \ + // ExtraKey: Split backspace key or it is below the enter key. + ) +}; + +#define L_BASE _BASE +#define L_LOWER (1<<_LOWER) +#define L_RAISE (1<<_RAISE) +#define L_ADJUST (1<<_ADJUST) +#define L_ADJUST_TRI (L_ADJUST|L_RAISE|L_LOWER) + +#ifdef SSD1306OLED +typedef struct { + uint8_t state; + char name[8]; +}LAYER_DISPLAY_NAME; + +#define LAYER_DISPLAY_MAX 5 +const LAYER_DISPLAY_NAME layer_display_name[LAYER_DISPLAY_MAX] = { + {L_BASE, "Base"}, + {L_BASE + 1, "Base"}, + {L_LOWER, "Lower"}, + {L_RAISE, "Raise"}, + {L_ADJUST_TRI, "Adjust"} +}; + +static inline const char* get_leyer_status(void) { + + for (uint8_t i = 0; i < LAYER_DISPLAY_MAX; ++i) { + if (layer_state == 0 && layer_display_name[i].state == default_layer_state) { + + return layer_display_name[i].name; + } else if (layer_state != 0 && layer_display_name[i].state == layer_state) { + + return layer_display_name[i].name; + } + } + + return "?"; +} + +static char layer_status_buf[24] = "Layer state ready.\n"; +static inline void update_keymap_status(void) { + + snprintf(layer_status_buf, sizeof(layer_status_buf) - 1, "OS:%s Layer:%s\n", + keymap_config.swap_lalt_lgui? "win" : "mac", get_leyer_status()); +} + +static inline void render_keymap_status(struct CharacterMatrix *matrix) { + + matrix_write(matrix, layer_status_buf); +} + +#define UPDATE_KEYMAP_STATUS() update_keymap_status() +#define RENDER_KEYMAP_STATUS(a) render_keymap_status(a) + +#else + +#define UPDATE_KEYMAP_STATUS() +#define RENDER_KEYMAP_STATUS(a) + +#endif + +static inline void update_change_layer(bool pressed, uint8_t layer1, uint8_t layer2, uint8_t layer3) { + + pressed ? layer_on(layer1) : layer_off(layer1); + IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2) ? layer_on(layer3) : layer_off(layer3); +} + +int RGB_current_mode; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + UPDATE_KEY_STATUS(keycode, record); + + bool result = false; + switch (keycode) { + case LOWER: + update_change_layer(record->event.pressed, _LOWER, _RAISE, _ADJUST); + break; + case RAISE: + update_change_layer(record->event.pressed, _RAISE, _LOWER, _ADJUST); + break; + case KANJI: + if (record->event.pressed) { + if (keymap_config.swap_lalt_lgui == false) { + register_code(KC_LANG2); + } else { + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG2); + } + break; + #ifdef RGBLIGHT_ENABLE + case RGB_MOD: + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + break; + case RGBRST: + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + break; + #endif + default: + result = true; + break; + } + + UPDATE_KEYMAP_STATUS(); + return result; +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + iota_gfx_init(!has_usb()); // turns on the display + #endif +} + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +void matrix_scan_user(void) { + iota_gfx_task(); // this is what updates the display continuously +} + +static inline void matrix_update(struct CharacterMatrix *dest, + const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +static inline void render_status(struct CharacterMatrix *matrix) { + + UPDATE_LED_STATUS(); + RENDER_LED_STATUS(matrix); + RENDER_KEYMAP_STATUS(matrix); + UPDATE_LOCK_STATUS(); + RENDER_LOCK_STATUS(matrix); + RENDER_KEY_STATUS(matrix); +} + +void iota_gfx_task_user(void) { + struct CharacterMatrix matrix; + + #if DEBUG_TO_SCREEN + if (debug_enable) { + return; + } + #endif + + matrix_clear(&matrix); + if (is_master) { + render_status(&matrix); + } + + matrix_update(&display, &matrix); +} + +#endif diff --git a/keyboards/treadstone48/keymaps/default/readme.md b/keyboards/treadstone48/keymaps/default/readme.md new file mode 100644 index 0000000000..bb835d169c --- /dev/null +++ b/keyboards/treadstone48/keymaps/default/readme.md @@ -0,0 +1,5 @@ +# Default keymap for treadstone48 + +## Description + +## How to use diff --git a/keyboards/treadstone48/keymaps/default/readme_jp.md b/keyboards/treadstone48/keymaps/default/readme_jp.md new file mode 100644 index 0000000000..6043c93cbc --- /dev/null +++ b/keyboards/treadstone48/keymaps/default/readme_jp.md @@ -0,0 +1,80 @@ +# US配列ライクデフォルトキーマップ + +## 概要 + + US配列ライクなデフォルトキーマップです。 + +## キーマップの見かた + +qmk_firmware\tmk_core\common\keycode.h +に基本的なキーコードがあります。また、Keymap.cの上部にカスタムしたKC_で始まるものを登録しています。 +キーマップに書くときは「KC_」を省略して書いています。 +例:KC_A → A + +Leyer Tap、Mod Tap、Tap DanceというQMKの機能を使っています。 + +Layer Tapはタップで指定したキー、長押しで指定したレイヤーに移動します。 +例:LT(RAISE, KC_V) → タップでV、長押しでRAISEレイヤー移動 + +Mod Tapはタップで視程したキー、長押しで視程したレイヤーに移動します。 +例:LSFT_T(KC_Z) → タップでZ、長押しで左シフト + +Tap Danceは指定した二つのキーをシングルタップ、ダブルタップで切り替えられます。 +例:[TD_CODO] = ACTION_TAP_DANCE_DOUBLE(KC_COMM, KC_DOT) → シングルタップでCOMM、ダブルタップでDOT + +もう少し詳しい内容についてはQMK Documentをお読みいただくかネットを検索すれば情報が載っていますので別途検索してみてください。 + +## 機能 + + QWERTYキーマップをベースにしていて、LowerレイヤーとRaiseレイヤーに他のキーを配置しています。 + LowerとRaiseを同時押しでAdjustレイヤーを使うことが出来ます。 + DOTの横、SLROと書いてあるのはシングルタップで/記号、ダブルタップで\記号が入力出来るようになっています。 + Lの横、SCCLと書いてあるのはシングルタップで;記号、ダブルタップで:記号が入力出来るようになっています。 + マウスキーの割り当てがありますので、もし使用したい場合はrules.mkでMOUSEKEY_ENABLE = yesにしてmakeすると使用することができます。 + +## 48キー目について + + このキーボードはEnterキーの上の2Uキーを1Ux2個にして使用する事が出来るようになっています。 使用する場合はキーマップの書き換えが必要です。 + + 各レイヤーの最下段の + +```c + XXXXX \ + // ExtraKey: Split backspace key or it is below the enter key. +``` + + のXXXXXに任意のキーを入れることでPの右隣のキーとして動作するようになっています。その右隣りに従来のキーが配置されています。 + +## OS切り替え方法 + + Adjustレイヤーにあります。LowerとRaiseを同時押しでAdjustレイヤーを使うことが出来ます。 + +- KNRM: QMKのノーマル状態です。macだと正常に使える(はず)です +- KSWP: ノーマル状態のままWindowsで使用するとALTキーとGUI(win)キーが逆ですので、それを入れ換えます。Windowsユーザーはこちらのモードにしてください + +## NUMPADモードについて + + Lower + DLNPキーを一度押下するとNumpadモードになります。通常モードに戻す場合はDLBSキーを押下してください。 + +## IME切り替え方法 + + Winの場合、LowerレイヤーにKANJIキー(半角/全角 漢字)がありますので、Lower+KANJIで切り替えてください。 + +## ソフトウェアリセットについて + + キーボードにはハードウェアのリセットボタンが付いていますが、ソフトウェアリセットをかけられます。 + LowerとRaiseを同時押しでAdjustレイヤーを使うことが出来、AdjustレイヤーのRESETを押下するとリセットがかかります。 + +## LEDの点灯切り替え方法 + + Adjustレイヤーにあります。LowerとRaiseを同時押しでAdjustレイヤーを使うことが出来ます。 + +- RGBRST: LEDのリセット +- RGB_TOG: LEDのON/OFF切り替え +- RGB_MOD: LEDの光り方の変更 +- RGB_HUI: Hue+ 色合いを変更 +- RGB_HUD: Hue- 色合いを変更 +- RGB_SAI: Saturation+ 色の濃さを変更 +- RGB_SAD: Saturation- 色の濃さを変更 +- RGB_VAI: Value+ 明るさを変更 +- RGB_VAD: Value- 明るさを変更 diff --git a/keyboards/treadstone48/keymaps/default/rules.mk b/keyboards/treadstone48/keymaps/default/rules.mk new file mode 100644 index 0000000000..c53226431d --- /dev/null +++ b/keyboards/treadstone48/keymaps/default/rules.mk @@ -0,0 +1,67 @@ + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SWAP_HANDS_ENABLE = no # Enable one-hand typing +TAP_DANCE_ENABLE = yes + +# If your custom treadstone48 pcb, you can rewrite to yes. +OLED_ENABLE = no # OLED_ENABLE +LED_UNDERGLOW_ENABLE = yes # LED underglow (Enable WS2812 RGB underlight.) +LED_ANIMATIONS = yes # LED animations + +# Other selectable option +IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) +LOCAL_GLCDFONT = no # use each keymaps "font.h" insted of "common/glcdfont.c" +# RHYMESTONE_RIGHTHAND = no # If connect right hand side of the Rhymestone, set to yes. +ANGELINA_KEYMAP = no # If Alfa verstion use set to yes. + +ifeq ($(strip $(OLED_ENABLE)), yes) + OPT_DEFS += -DOLED_ENABLE +endif + +ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) + RGBLIGHT_ENABLE = yes +else + RGBLIGHT_ENABLE = no +endif + +ifeq ($(strip $(LED_ANIMATIONS)), yes) + # OPT_DEFS += -DRGBLIGHT_ANIMATIONS + OPT_DEFS += -DLED_ANIMATIONS +endif + +ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) + OPT_DEFS += -DIOS_DEVICE_ENABLE +endif + +ifeq ($(strip $(LOCAL_GLCDFONT)), yes) + OPT_DEFS += -DLOCAL_GLCDFONT +endif + +# ifeq ($(strip $(RHYMESTONE_RIGHTHAND)), yes) +# OPT_DEFS += -DRHYMESTONE_RIGHTHAND +# endif + +ifeq ($(strip $(ANGELINA_KEYMAP)), yes) + OPT_DEFS += -DANGELINA_KEYMAP +endif + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# If you want to change the display of OLED, you need to change here +SRC += ./common/oled_helper.c \ diff --git a/keyboards/treadstone48/keymaps/like_jis/config.h b/keyboards/treadstone48/keymaps/like_jis/config.h new file mode 100644 index 0000000000..3f63a0cfbb --- /dev/null +++ b/keyboards/treadstone48/keymaps/like_jis/config.h @@ -0,0 +1,60 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako <wakojun@gmail.com> +Copyright 2015 Jack Humbert + +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 + +// place overrides here + +#ifdef TAPPING_TERM +#undef TAPPING_TERM +#endif +#define TAPPING_TERM 225 +// #define PREVENT_STUCK_MODIFIERS +// #define IGNORE_MOD_TAP_INTERRUPT + +#ifdef MOUSEKEY_ENABLE + #undef MOUSEKEY_INTERVAL + #define MOUSEKEY_INTERVAL 1 + + #undef MOUSEKEY_TIME_TO_MAX + #define MOUSEKEY_TIME_TO_MAX 150 + + #undef MOUSEKEY_MAX_SPEED + #define MOUSEKEY_MAX_SPEED 3 + + #undef MOUSEKEY_MOVE_DELTA + #define MOUSEKEY_MOVE_DELTA 4 + + #undef MOUSEKEY_DELAY + #define MOUSEKEY_DELAY 0 +#endif + +// Selection of RGBLIGHT MODE to use. +#if defined(LED_ANIMATIONS) + //#define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + //#define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + //#define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif diff --git a/keyboards/treadstone48/keymaps/like_jis/keymap.c b/keyboards/treadstone48/keymaps/like_jis/keymap.c new file mode 100644 index 0000000000..b63b0c9f49 --- /dev/null +++ b/keyboards/treadstone48/keymaps/like_jis/keymap.c @@ -0,0 +1,278 @@ +#include QMK_KEYBOARD_H +#include "keymap_jp.h" +#include "../common/oled_helper.h" + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_number { + _BASE = 0, + _LOWER, + _RAISE, + _ADJUST, +}; + +enum custom_keycodes { + LOWER = SAFE_RANGE, + RAISE, + ADJUST, + KANJI, + RGBRST +}; + +enum tapdances{ + TD_SCCL = 0, + TD_SLRO, +}; + +// Layer Mode aliases +#define _____ KC_TRNS +#define XXXXX KC_NO + +#define KC_TBSF LSFT_T(KC_TAB) +// #define KC_SPSF LSFT_T(KC_SPC) +#define KC_ALAP LALT_T(KC_APP) +#define KC_JEQL LSFT(KC_MINS) + +#define KC_SCCL TD(TD_SCCL) +#define KC_SLRO TD(TD_SLRO) + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_SCCL] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, KC_QUOT), + [TD_SLRO] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_RO), +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_base( \ + //,--------------------------------------------------------------------------------------------------------------------. + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+-----------------| + KC_TBSF, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCCL, KC_ENT,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLRO, KC_UP, \ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| + KC_LCTRL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, RAISE, KC_ALAP, KC_LEFT, KC_DOWN, KC_RGHT,\ + //`-------------------------------------------------------------------------------------------------------------------' + KC_DEL \ + // ExtraKey: Split backspace key or it is below the enter key. + ), + + [_LOWER] = LAYOUT_base( \ + //,--------------------------------------------------------------------------------------------------------------------. + _____, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_MINS, KC_EQL, KC_JYEN, KC_LBRC, KC_RBRC, KC_DEL,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+-----------------| + _____, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXX, XXXXX, KC_SCLN, KC_QUOT, KC_BSLS, _____,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| + _____, KC_F11, KC_F12, XXXXX, KANJI, KC_ENT, XXXXX, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_PGUP, \ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| + _____, _____, _____, _____, KC_DEL, _____, _____, XXXXX, KC_HOME, KC_PGDN, KC_END,\ + //`-------------------------------------------------------------------------------------------------------------------' + XXXXX \ + // ExtraKey: Split backspace key or it is below the enter key. + ), + + [_RAISE] = LAYOUT_base( \ + //,--------------------------------------------------------------------------------------------------------------------. + _____, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, XXXXX,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+-----------------| + _____, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, KC_4, KC_5, KC_6, KC_QUOT, _____,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| + _____, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, KC_1, KC_2, KC_3, KC_RO, XXXXX, \ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| + _____, _____, _____, _____, _____, _____, _____, KC_0, KC_DOT, KC_COMM, KC_SLSH,\ + //`-------------------------------------------------------------------------------------------------------------------' + XXXXX \ + // ExtraKey: Split backspace key or it is below the enter key. + ), + + [_ADJUST] = LAYOUT_base( \ + //,--------------------------------------------------------------------------------------------------------------------. + XXXXX, RESET, RGBRST, AG_NORM, AG_SWAP, XXXXX, XXXXX, KC_WH_L, KC_WH_U, KC_HOME, KC_PGUP, XXXXX,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+-----------------| + XXXXX, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXX, XXXXX, KC_WH_R, KC_WH_D, KC_END, KC_PGDN, XXXXX,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| + _____, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXX, XXXXX, XXXXX, KC_BTN1, KC_BTN2, XXXXX, KC_MS_U, \ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| + _____, _____, _____, _____, XXXXX, XXXXX, _____, XXXXX, KC_MS_L, KC_MS_D, KC_MS_R,\ + //`-------------------------------------------------------------------------------------------------------------------' + XXXXX \ + // ExtraKey: Split backspace key or it is below the enter key. + ) +}; + +#define L_BASE _BASE +#define L_LOWER (1<<_LOWER) +#define L_RAISE (1<<_RAISE) +#define L_ADJUST (1<<_ADJUST) +#define L_ADJUST_TRI (L_ADJUST|L_RAISE|L_LOWER) + +#ifdef SSD1306OLED +typedef struct { + uint8_t state; + char name[8]; +}LAYER_DISPLAY_NAME; + +#define LAYER_DISPLAY_MAX 5 +const LAYER_DISPLAY_NAME layer_display_name[LAYER_DISPLAY_MAX] = { + {L_BASE, "Base"}, + {L_BASE + 1, "Base"}, + {L_LOWER, "Lower"}, + {L_RAISE, "Raise"}, + {L_ADJUST_TRI, "Adjust"} +}; + +static inline const char* get_leyer_status(void) { + + for (uint8_t i = 0; i < LAYER_DISPLAY_MAX; ++i) { + if (layer_state == 0 && layer_display_name[i].state == default_layer_state) { + + return layer_display_name[i].name; + } else if (layer_state != 0 && layer_display_name[i].state == layer_state) { + + return layer_display_name[i].name; + } + } + + return "?"; +} + +static char layer_status_buf[24] = "Layer state ready.\n"; +static inline void update_keymap_status(void) { + + snprintf(layer_status_buf, sizeof(layer_status_buf) - 1, "OS:%s Layer:%s\n", + keymap_config.swap_lalt_lgui? "win" : "mac", get_leyer_status()); +} + +static inline void render_keymap_status(struct CharacterMatrix *matrix) { + + matrix_write(matrix, layer_status_buf); +} + +#define UPDATE_KEYMAP_STATUS() update_keymap_status() +#define RENDER_KEYMAP_STATUS(a) render_keymap_status(a) + +#else + +#define UPDATE_KEYMAP_STATUS() +#define RENDER_KEYMAP_STATUS(a) + +#endif + +static inline void update_change_layer(bool pressed, uint8_t layer1, uint8_t layer2, uint8_t layer3) { + + pressed ? layer_on(layer1) : layer_off(layer1); + IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2) ? layer_on(layer3) : layer_off(layer3); +} + +int RGB_current_mode; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + UPDATE_KEY_STATUS(keycode, record); + + bool result = false; + switch (keycode) { + case LOWER: + update_change_layer(record->event.pressed, _LOWER, _RAISE, _ADJUST); + break; + case RAISE: + update_change_layer(record->event.pressed, _RAISE, _LOWER, _ADJUST); + break; + case KANJI: + if (record->event.pressed) { + if (keymap_config.swap_lalt_lgui == false) { + register_code(KC_LANG2); + } else { + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG2); + } + break; + #ifdef RGBLIGHT_ENABLE + case RGB_MOD: + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + break; + case RGBRST: + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + break; + #endif + default: + result = true; + break; + } + + UPDATE_KEYMAP_STATUS(); + return result; +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + iota_gfx_init(!has_usb()); // turns on the display + #endif +} + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +void matrix_scan_user(void) { + iota_gfx_task(); // this is what updates the display continuously +} + +static inline void matrix_update(struct CharacterMatrix *dest, + const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +static inline void render_status(struct CharacterMatrix *matrix) { + + UPDATE_LED_STATUS(); + RENDER_LED_STATUS(matrix); + RENDER_KEYMAP_STATUS(matrix); + UPDATE_LOCK_STATUS(); + RENDER_LOCK_STATUS(matrix); + RENDER_KEY_STATUS(matrix); +} + +void iota_gfx_task_user(void) { + struct CharacterMatrix matrix; + + #if DEBUG_TO_SCREEN + if (debug_enable) { + return; + } + #endif + + matrix_clear(&matrix); + if (is_master) { + render_status(&matrix); + } + + matrix_update(&display, &matrix); +} + +#endif diff --git a/keyboards/treadstone48/keymaps/like_jis/readme.md b/keyboards/treadstone48/keymaps/like_jis/readme.md new file mode 100644 index 0000000000..796df6c4cd --- /dev/null +++ b/keyboards/treadstone48/keymaps/like_jis/readme.md @@ -0,0 +1,5 @@ +# The like jis type keyboard keymap for treadstone48 + +## Description + +## How to use diff --git a/keyboards/treadstone48/keymaps/like_jis/readme_jp.md b/keyboards/treadstone48/keymaps/like_jis/readme_jp.md new file mode 100644 index 0000000000..305ded471d --- /dev/null +++ b/keyboards/treadstone48/keymaps/like_jis/readme_jp.md @@ -0,0 +1,80 @@ +# JISキーボードライクなキーマップ + +## 概要 + + デフォルトキーマップの記号類をJISライクな配置に揃えなおしたものです。 + +## キーマップの見かた + +qmk_firmware\tmk_core\common\keycode.h +に基本的なキーコードがあります。また、Keymap.cの上部にカスタムしたKC_で始まるものを登録しています。 +キーマップに書くときは「KC_」を省略して書いています。 +例:KC_A → A + +Leyer Tap、Mod Tap、Tap DanceというQMKの機能を使っています。 + +Layer Tapはタップで指定したキー、長押しで指定したレイヤーに移動します。 +例:LT(RAISE, KC_V) → タップでV、長押しでRAISEレイヤー移動 + +Mod Tapはタップで視程したキー、長押しで視程したレイヤーに移動します。 +例:LSFT_T(KC_Z) → タップでZ、長押しで左シフト + +Tap Danceは指定した二つのキーをシングルタップ、ダブルタップで切り替えられます。 +例:[TD_CODO] = ACTION_TAP_DANCE_DOUBLE(KC_COMM, KC_DOT) → シングルタップでCOMM、ダブルタップでDOT + +もう少し詳しい内容についてはQMK Documentをお読みいただくかネットを検索すれば情報が載っていますので別途検索してみてください。 + +## 機能 + + QWERTYキーマップをベースにしていて、LowerレイヤーとRaiseレイヤーに他のキーを配置しています。 + LowerとRaiseを同時押しでAdjustレイヤーを使うことが出来ます。 + DOTの横、SLROと書いてあるのはシングルタップで/記号、ダブルタップで\記号が入力出来るようになっています。 + Lの横、SCCLと書いてあるのはシングルタップで;記号、ダブルタップで:記号が入力出来るようになっています。 + マウスキーの割り当てがありますので、もし使用したい場合はrules.mkでMOUSEKEY_ENABLE = yesにしてmakeすると使用することができます。 + +## 48キー目について + + このキーボードはEnterキーの上の2Uキーを1Ux2個にして使用する事が出来るようになっています。 使用する場合はキーマップの書き換えが必要です。 + + 各レイヤーの最下段の + +```c + XXXXX \ + // ExtraKey: Split backspace key or it is below the enter key. +``` + + のXXXXXに任意のキーを入れることでPの右隣のキーとして動作するようになっています。その右隣りに従来のキーが配置されています。 + +## OS切り替え方法 + + Adjustレイヤーにあります。LowerとRaiseを同時押しでAdjustレイヤーを使うことが出来ます。 + +- KNRM: QMKのノーマル状態です。macだと正常に使える(はず)です +- KSWP: ノーマル状態のままWindowsで使用するとALTキーとGUI(win)キーが逆ですので、それを入れ換えます。Windowsユーザーはこちらのモードにしてください + +## NUMPADモードについて + + Lower + DLNPキーを一度押下するとNumpadモードになります。通常モードに戻す場合はDLBSキーを押下してください。 + +## IME切り替え方法 + + Winの場合、LowerレイヤーにKANJIキー(半角/全角 漢字)がありますので、Lower+KANJIで切り替えてください。 + +## ソフトウェアリセットについて + + キーボードにはハードウェアのリセットボタンが付いていますが、ソフトウェアリセットをかけられます。 + LowerとRaiseを同時押しでAdjustレイヤーを使うことが出来、AdjustレイヤーのRSTを押下するとリセットがかかります。 + +## LEDの点灯切り替え方法 + + Adjustレイヤーにあります。LowerとRaiseを同時押しでAdjustレイヤーを使うことが出来ます。 + +- RGBRST: LEDのリセット +- RGB_TOG: LEDのON/OFF切り替え +- RGB_MOD: LEDの光り方の変更 +- RGB_HUI: Hue+ 色合いを変更 +- RGB_HUD: Hue- 色合いを変更 +- RGB_SAI: Saturation+ 色の濃さを変更 +- RGB_SAD: Saturation- 色の濃さを変更 +- RGB_VAI: Value+ 明るさを変更 +- RGB_VAD: Value- 明るさを変更 diff --git a/keyboards/treadstone48/keymaps/like_jis/rules.mk b/keyboards/treadstone48/keymaps/like_jis/rules.mk new file mode 100644 index 0000000000..c53226431d --- /dev/null +++ b/keyboards/treadstone48/keymaps/like_jis/rules.mk @@ -0,0 +1,67 @@ + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SWAP_HANDS_ENABLE = no # Enable one-hand typing +TAP_DANCE_ENABLE = yes + +# If your custom treadstone48 pcb, you can rewrite to yes. +OLED_ENABLE = no # OLED_ENABLE +LED_UNDERGLOW_ENABLE = yes # LED underglow (Enable WS2812 RGB underlight.) +LED_ANIMATIONS = yes # LED animations + +# Other selectable option +IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) +LOCAL_GLCDFONT = no # use each keymaps "font.h" insted of "common/glcdfont.c" +# RHYMESTONE_RIGHTHAND = no # If connect right hand side of the Rhymestone, set to yes. +ANGELINA_KEYMAP = no # If Alfa verstion use set to yes. + +ifeq ($(strip $(OLED_ENABLE)), yes) + OPT_DEFS += -DOLED_ENABLE +endif + +ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) + RGBLIGHT_ENABLE = yes +else + RGBLIGHT_ENABLE = no +endif + +ifeq ($(strip $(LED_ANIMATIONS)), yes) + # OPT_DEFS += -DRGBLIGHT_ANIMATIONS + OPT_DEFS += -DLED_ANIMATIONS +endif + +ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) + OPT_DEFS += -DIOS_DEVICE_ENABLE +endif + +ifeq ($(strip $(LOCAL_GLCDFONT)), yes) + OPT_DEFS += -DLOCAL_GLCDFONT +endif + +# ifeq ($(strip $(RHYMESTONE_RIGHTHAND)), yes) +# OPT_DEFS += -DRHYMESTONE_RIGHTHAND +# endif + +ifeq ($(strip $(ANGELINA_KEYMAP)), yes) + OPT_DEFS += -DANGELINA_KEYMAP +endif + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# If you want to change the display of OLED, you need to change here +SRC += ./common/oled_helper.c \ diff --git a/keyboards/treadstone48/keymaps/like_jis_rs/config.h b/keyboards/treadstone48/keymaps/like_jis_rs/config.h new file mode 100644 index 0000000000..e8acd5c76d --- /dev/null +++ b/keyboards/treadstone48/keymaps/like_jis_rs/config.h @@ -0,0 +1,60 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako <wakojun@gmail.com> +Copyright 2015 Jack Humbert + +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 + +// place overrides here + +#ifdef TAPPING_TERM +#undef TAPPING_TERM +#endif +#define TAPPING_TERM 225 +#define PREVENT_STUCK_MODIFIERS +#define IGNORE_MOD_TAP_INTERRUPT + +#ifdef MOUSEKEY_ENABLE + #undef MOUSEKEY_INTERVAL + #define MOUSEKEY_INTERVAL 1 + + #undef MOUSEKEY_TIME_TO_MAX + #define MOUSEKEY_TIME_TO_MAX 150 + + #undef MOUSEKEY_MAX_SPEED + #define MOUSEKEY_MAX_SPEED 3 + + #undef MOUSEKEY_MOVE_DELTA + #define MOUSEKEY_MOVE_DELTA 4 + + #undef MOUSEKEY_DELAY + #define MOUSEKEY_DELAY 0 +#endif + +// Selection of RGBLIGHT MODE to use. +#if defined(LED_ANIMATIONS) + //#define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + //#define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + //#define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif diff --git a/keyboards/treadstone48/keymaps/like_jis_rs/keymap.c b/keyboards/treadstone48/keymaps/like_jis_rs/keymap.c new file mode 100644 index 0000000000..0e4ec063cc --- /dev/null +++ b/keyboards/treadstone48/keymaps/like_jis_rs/keymap.c @@ -0,0 +1,342 @@ +#include QMK_KEYBOARD_H +#include "keymap_jp.h" +#include "../common/oled_helper.h" + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_number { + _BASE = 0, + _BASES, + _LOWER, + _LOWRS, + _RAISE, + _ADJUST, +}; + +enum custom_keycodes { + BASE = SAFE_RANGE, + BASES, + LOWER, + LOWRS, + RAISE, + ADJUST, + KANJI, + RGBRST +}; + +enum tapdances{ + TD_SCCL = 0, + TD_SLRO, +}; + +// Layer Mode aliases +#define _____ KC_TRNS +#define XXXXX KC_NO + +#define KC_TBSF LSFT_T(KC_TAB) +// #define KC_SPSF LSFT_T(KC_SPC) +#define KC_ALAP LALT_T(KC_APP) +#define KC_JEQL LSFT(KC_MINS) +#define KC_SFUC LSFT(KC_RO) +#define KC_RSBR LSFT(KC_8) +#define KC_REBR LSFT(KC_9) + +#define KC_ZSFT LSFT_T(KC_Z) +#define KC_ESCT LCTL_T(KC_ESC) +#define KC_TBAL LALT_T(KC_TAB) +#define KC_11SF LSFT_T(KC_F11) + +#define KC_SCCL TD(TD_SCCL) +#define KC_SLRO TD(TD_SLRO) + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_SCCL] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, KC_QUOT), + [TD_SLRO] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_RO), +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_rs( \ + // Treadstone48 Rhymestone + //,--------------------------------------------------------------------------------------------------------------------. --------------------------------------------. + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, KC_P7, KC_P8, KC_P9, KC_PSLS, KC_NLCK,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+-----------------| --------+--------+--------+--------+--------| + KC_TBSF, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCCL, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PAST, KC_TAB,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| --------+--------+--------+--------+--------| + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLRO, KC_UP, KC_P1, KC_P2, KC_P3, KC_PMNS, KC_PENT,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| --------+--------+--------+--------+--------| + KC_LCTRL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, RAISE, KC_ALAP, KC_LEFT, KC_DOWN, KC_RGHT, LOWER, KC_P0, KC_PDOT, KC_PPLS, KC_BSPC,\ + //`--------------------------------------------------------------------------------------------------------------------' --------------------------------------------' + KC_DEL \ + // ExtraKey: Split backspace key or it is below the enter key. + ), + + [_LOWER] = LAYOUT_rs( \ + // Treadstone48 Rhymestone + //,--------------------------------------------------------------------------------------------------------------------. --------------------------------------------. + _____, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_MINS, KC_EQL, KC_JYEN, KC_LBRC, KC_RBRC, KC_DEL, KC_A, KC_B, KC_C, KC_JYEN, KC_HASH,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+-----------------| --------+--------+--------+--------+--------| + _____, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXX, XXXXX, KC_SCLN, KC_QUOT, KC_BSLS, _____, KC_D, KC_E, KC_F, KC_PERC, KC_SFUC,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| --------+--------+--------+--------+--------| + _____, KC_F11, KC_F12, BASES, KANJI, KC_ENT, XXXXX, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_PGUP, KC_RSBR, KC_REBR, KC_RBRC, KC_QUOT, _____,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| --------+--------+--------+--------+--------| + _____, _____, _____, _____, KC_DEL, _____, _____, XXXXX, KC_HOME, KC_PGDN, KC_END, _____, XXXXX, KC_COMM, KC_JEQL, KC_DEL,\ + //`--------------------------------------------------------------------------------------------------------------------' --------------------------------------------' + XXXXX \ + // ExtraKey: Split backspace key or it is below the enter key. + ), + + [_BASES] = LAYOUT_rs( \ + // Treadstone48 Rhymestone + //,--------------------------------------------------------------------------------------------------------------------. --------------------------------------------. + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, KC_Q, KC_W, KC_E, KC_R, KC_T,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+-----------------| --------+--------+--------+--------+--------| + KC_TBSF, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCCL, KC_ENT, KC_A, KC_S, KC_D, KC_F, KC_G,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| --------+--------+--------+--------+--------| + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLRO, KC_UP, KC_ZSFT, KC_X, KC_C, KC_V, KC_B,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| --------+--------+--------+--------+--------| + KC_LCTRL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, RAISE, KC_ALAP, KC_LEFT, KC_DOWN, KC_RGHT, KC_ESCT, KC_TBAL, KC_LGUI, LOWRS, KC_BSPC,\ + //`--------------------------------------------------------------------------------------------------------------------' --------------------------------------------' + KC_DEL \ + // ExtraKey: Split backspace key or it is below the enter key. + ), + + [_LOWRS] = LAYOUT_rs( \ + // Treadstone48 Rhymestone + //,--------------------------------------------------------------------------------------------------------------------. --------------------------------------------. + _____, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_MINS, KC_EQL, KC_JYEN, KC_LBRC, KC_RBRC, KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+-----------------| --------+--------+--------+--------+--------| + _____, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXX, XXXXX, KC_SCLN, KC_QUOT, KC_BSLS, _____, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| --------+--------+--------+--------+--------| + _____, KC_F11, KC_F12, BASE, KANJI, KC_ENT, XXXXX, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_PGUP, KC_11SF, KC_F12, BASE, KANJI, KC_ENT,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| --------+--------+--------+--------+--------| + _____, _____, _____, _____, KC_DEL, _____, _____, XXXXX, KC_HOME, KC_PGDN, KC_END, _____, _____, _____, _____, KC_DEL,\ + //`--------------------------------------------------------------------------------------------------------------------' --------------------------------------------' + XXXXX \ + // ExtraKey: Split backspace key or it is below the enter key. + ), + + [_RAISE] = LAYOUT_rs( \ + // Treadstone48 Rhymestone + //,--------------------------------------------------------------------------------------------------------------------. --------------------------------------------. + _____, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+-----------------| --------+--------+--------+--------+--------| + _____, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, KC_4, KC_5, KC_6, KC_QUOT, _____, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| --------+--------+--------+--------+--------| + _____, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, KC_1, KC_2, KC_3, KC_RO, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| --------+--------+--------+--------+--------| + _____, _____, _____, _____, _____, _____, _____, KC_0, KC_DOT, KC_COMM, KC_SLSH, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + //`--------------------------------------------------------------------------------------------------------------------' --------------------------------------------' + XXXXX \ + // ExtraKey: Split backspace key or it is below the enter key. + ), + + [_ADJUST] = LAYOUT_rs( \ + // Treadstone48 Rhymestone + //,--------------------------------------------------------------------------------------------------------------------. --------------------------------------------. + XXXXX, RESET, RGBRST, AG_NORM, AG_SWAP, XXXXX, XXXXX, KC_WH_L, KC_WH_U, KC_HOME, KC_PGUP, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+-----------------| --------+--------+--------+--------+--------| + XXXXX, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXX, XXXXX, KC_WH_R, KC_WH_D, KC_END, KC_PGDN, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| --------+--------+--------+--------+--------| + _____, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXX, XXXXX, XXXXX, KC_BTN1, KC_BTN2, XXXXX, KC_MS_U, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| --------+--------+--------+--------+--------| + _____, _____, _____, _____, XXXXX, XXXXX, _____, XXXXX, KC_MS_L, KC_MS_D, KC_MS_R, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + //`--------------------------------------------------------------------------------------------------------------------' --------------------------------------------' + XXXXX \ + // ExtraKey: Split backspace key or it is below the enter key. + ) +}; + +#define L_BASE _BASE +#define L_BASES (1<<_BASES) +#define L_LOWER (1<<_LOWER) +#define L_LOWRS (1<<_LOWRS) +#define L_RAISE (1<<_RAISE) +#define L_ADJUST (1<<_ADJUST) +#define L_ADJUST_TRI (L_ADJUST|L_RAISE|L_LOWER) + +#ifdef SSD1306OLED +typedef struct { + uint8_t state; + char name[8]; +}LAYER_DISPLAY_NAME; + +#define LAYER_DISPLAY_MAX 7 +const LAYER_DISPLAY_NAME layer_display_name[LAYER_DISPLAY_MAX] = { + {L_BASE, "Base"}, + {L_BASE + 1, "Base"}, + {L_BASES, "BaseSpl"}, + {L_LOWER, "Lower"}, + {L_LOWRS, "LowrSpl"}, + {L_RAISE, "Raise"}, + {L_ADJUST_TRI, "Adjust"} +}; + +static inline const char* get_leyer_status(void) { + + for (uint8_t i = 0; i < LAYER_DISPLAY_MAX; ++i) { + if (layer_state == 0 && layer_display_name[i].state == default_layer_state) { + + return layer_display_name[i].name; + } else if (layer_state != 0 && layer_display_name[i].state == layer_state) { + + return layer_display_name[i].name; + } + } + + return "?"; +} + +static char layer_status_buf[24] = "Layer state ready.\n"; +static inline void update_keymap_status(void) { + + snprintf(layer_status_buf, sizeof(layer_status_buf) - 1, "OS:%s Layer:%s\n", + keymap_config.swap_lalt_lgui? "win" : "mac", get_leyer_status()); +} + +static inline void render_keymap_status(struct CharacterMatrix *matrix) { + + matrix_write(matrix, layer_status_buf); +} + +#define UPDATE_KEYMAP_STATUS() update_keymap_status() +#define RENDER_KEYMAP_STATUS(a) render_keymap_status(a) + +#else + +#define UPDATE_KEYMAP_STATUS() +#define RENDER_KEYMAP_STATUS(a) + +#endif + +void update_change_layer(bool pressed, uint8_t layer1, uint8_t layer2, uint8_t layer3) { + + pressed ? layer_on(layer1) : layer_off(layer1); + IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2) ? layer_on(layer3) : layer_off(layer3); +} + +int RGB_current_mode; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + UPDATE_KEY_STATUS(keycode, record); + + bool result = false; + switch (keycode) { + case LOWER: + update_change_layer(record->event.pressed, _LOWER, _RAISE, _ADJUST); + break; + case RAISE: + update_change_layer(record->event.pressed, _RAISE, _LOWER, _ADJUST); + break; + case BASE: + if (record->event.pressed) { + default_layer_set(L_BASE); + } + break; + case BASES: + if (record->event.pressed) { + default_layer_set(L_BASES); + } + break; + case LOWRS: + update_change_layer(record->event.pressed, _LOWRS, _RAISE, _ADJUST); + break; + case KANJI: + if (record->event.pressed) { + if (keymap_config.swap_lalt_lgui == false) { + register_code(KC_LANG2); + } else { + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG2); + } + break; + #ifdef RGBLIGHT_ENABLE + case RGB_MOD: + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + break; + case RGBRST: + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + break; + #endif + default: + result = true; + break; + } + + UPDATE_KEYMAP_STATUS(); + return result; +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + iota_gfx_init(!has_usb()); // turns on the display + #endif +} + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +void matrix_scan_user(void) { + iota_gfx_task(); // this is what updates the display continuously +} + +static inline void matrix_update(struct CharacterMatrix *dest, + const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +static inline void render_status(struct CharacterMatrix *matrix) { + + UPDATE_LED_STATUS(); + RENDER_LED_STATUS(matrix); + RENDER_KEYMAP_STATUS(matrix); + UPDATE_LOCK_STATUS(); + RENDER_LOCK_STATUS(matrix); + RENDER_KEY_STATUS(matrix); +} + +void iota_gfx_task_user(void) { + struct CharacterMatrix matrix; + + #if DEBUG_TO_SCREEN + if (debug_enable) { + return; + } + #endif + + matrix_clear(&matrix); + if (is_master) { + render_status(&matrix); + } + + matrix_update(&display, &matrix); +} + +#endif diff --git a/keyboards/treadstone48/keymaps/like_jis_rs/readme.md b/keyboards/treadstone48/keymaps/like_jis_rs/readme.md new file mode 100644 index 0000000000..796df6c4cd --- /dev/null +++ b/keyboards/treadstone48/keymaps/like_jis_rs/readme.md @@ -0,0 +1,5 @@ +# The like jis type keyboard keymap for treadstone48 + +## Description + +## How to use diff --git a/keyboards/treadstone48/keymaps/like_jis_rs/readme_jp.md b/keyboards/treadstone48/keymaps/like_jis_rs/readme_jp.md new file mode 100644 index 0000000000..5a6fc1d73b --- /dev/null +++ b/keyboards/treadstone48/keymaps/like_jis_rs/readme_jp.md @@ -0,0 +1,84 @@ +# JISキーボードライクなキーマップ + +## 概要 + + デフォルトキーマップの記号類をJISライクな配置に揃えなおしたものです。 + オプションのRhymestone用のマップを使用するために拡張しています。RhymestoneのpromicroにもTreadstone48のキーマップを入れてください。 + Rhymestoneは基本的には左手側を使うことを想定していますが、右手側を使用する場合はrules.mkにあるRHYMESTONE_RIGHTHAND設定をyesにすれば使えるようになります。 + +```RHYMESTONE_RIGHTHAND=yes``` + +## キーマップの見かた + +qmk_firmware\tmk_core\common\keycode.h +に基本的なキーコードがあります。また、Keymap.cの上部にカスタムしたKC_で始まるものを登録しています。 +キーマップに書くときは「KC_」を省略して書いています。 +例:KC_A → A + +Leyer Tap、Mod Tap、Tap DanceというQMKの機能を使っています。 + +Layer Tapはタップで指定したキー、長押しで指定したレイヤーに移動します。 +例:LT(RAISE, KC_V) → タップでV、長押しでRAISEレイヤー移動 + +Mod Tapはタップで視程したキー、長押しで視程したレイヤーに移動します。 +例:LSFT_T(KC_Z) → タップでZ、長押しで左シフト + +Tap Danceは指定した二つのキーをシングルタップ、ダブルタップで切り替えられます。 +例:[TD_CODO] = ACTION_TAP_DANCE_DOUBLE(KC_COMM, KC_DOT) → シングルタップでCOMM、ダブルタップでDOT + +もう少し詳しい内容についてはQMK Documentをお読みいただくかネットを検索すれば情報が載っていますので別途検索してみてください。 + +## 機能 + + QWERTYキーマップをベースにしていて、LowerレイヤーとRaiseレイヤーに他のキーを配置しています。 + LowerとRaiseを同時押しでAdjustレイヤーを使うことが出来ます。 + DOTの横、SLROと書いてあるのはシングルタップで/記号、ダブルタップで\記号が入力出来るようになっています。 + Lの横、SCCLと書いてあるのはシングルタップで;記号、ダブルタップで:記号が入力出来るようになっています。 + マウスキーの割り当てがありますので、もし使用したい場合はrules.mkでMOUSEKEY_ENABLE = yesにしてmakeすると使用することができます。 + +## 48キー目について + + このキーボードはEnterキーの上の2Uキーを1Ux2個にして使用する事が出来るようになっています。 使用する場合はキーマップの書き換えが必要です。 + + 各レイヤーの最下段の + +```c + XXXXX \ + // ExtraKey: Split backspace key or it is below the enter key. +``` + + のXXXXXに任意のキーを入れることでPの右隣のキーとして動作するようになっています。その右隣りに従来のキーが配置されています。 + +## OS切り替え方法 + + Adjustレイヤーにあります。LowerとRaiseを同時押しでAdjustレイヤーを使うことが出来ます。 + +- KNRM: QMKのノーマル状態です。macだと正常に使える(はず)です +- KSWP: ノーマル状態のままWindowsで使用するとALTキーとGUI(win)キーが逆ですので、それを入れ換えます。Windowsユーザーはこちらのモードにしてください + +## NUMPADモードについて + + Lower + DLNPキーを一度押下するとNumpadモードになります。通常モードに戻す場合はDLBSキーを押下してください。 + +## IME切り替え方法 + + Winの場合、LowerレイヤーにKANJIキー(半角/全角 漢字)がありますので、Lower+KANJIで切り替えてください。 + +## ソフトウェアリセットについて + + キーボードにはハードウェアのリセットボタンが付いていますが、ソフトウェアリセットをかけられます。 + LowerとRaiseを同時押しでAdjustレイヤーを使うことが出来、AdjustレイヤーのRSTを押下するとリセットがかかります。 + +## LEDの点灯切り替え方法 + + Adjustレイヤーにあります。LowerとRaiseを同時押しでAdjustレイヤーを使うことが出来ます。 + +- RGBRST: LEDのリセット +- RGB_TOG: LEDのON/OFF切り替え +- RGB_MOD: LEDの光り方の変更 +- RGB_HUI: Hue+ 色合いを変更 +- RGB_HUD: Hue- 色合いを変更 +- RGB_SAI: Saturation+ 色の濃さを変更 +- RGB_SAD: Saturation- 色の濃さを変更 +- RGB_VAI: Value+ 明るさを変更 +- RGB_VAD: Value- 明るさを変更 diff --git a/keyboards/treadstone48/keymaps/like_jis_rs/rules.mk b/keyboards/treadstone48/keymaps/like_jis_rs/rules.mk new file mode 100644 index 0000000000..c34bb2e34a --- /dev/null +++ b/keyboards/treadstone48/keymaps/like_jis_rs/rules.mk @@ -0,0 +1,67 @@ + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SWAP_HANDS_ENABLE = no # Enable one-hand typing +TAP_DANCE_ENABLE = yes + +# If your custom treadstone48 pcb, you can rewrite to yes. +OLED_ENABLE = no # OLED_ENABLE +LED_UNDERGLOW_ENABLE = yes # LED underglow (Enable WS2812 RGB underlight.) +LED_ANIMATIONS = yes # LED animations + +# Other selectable option +IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) +LOCAL_GLCDFONT = no # use each keymaps "font.h" insted of "common/glcdfont.c" +RHYMESTONE_RIGHTHAND = no # If connect right hand side of the Rhymestone, set to yes. +ANGELINA_KEYMAP = no # If Alfa verstion use set to yes. + +ifeq ($(strip $(OLED_ENABLE)), yes) + OPT_DEFS += -DOLED_ENABLE +endif + +ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) + RGBLIGHT_ENABLE = yes +else + RGBLIGHT_ENABLE = no +endif + +ifeq ($(strip $(LED_ANIMATIONS)), yes) + # OPT_DEFS += -DRGBLIGHT_ANIMATIONS + OPT_DEFS += -DLED_ANIMATIONS +endif + +ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) + OPT_DEFS += -DIOS_DEVICE_ENABLE +endif + +ifeq ($(strip $(LOCAL_GLCDFONT)), yes) + OPT_DEFS += -DLOCAL_GLCDFONT +endif + +ifeq ($(strip $(RHYMESTONE_RIGHTHAND)), yes) + OPT_DEFS += -DRHYMESTONE_RIGHTHAND +endif + +ifeq ($(strip $(ANGELINA_KEYMAP)), yes) + OPT_DEFS += -DANGELINA_KEYMAP +endif + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# If you want to change the display of OLED, you need to change here +SRC += ./common/oled_helper.c \ diff --git a/keyboards/treadstone48/pro_micro.h b/keyboards/treadstone48/pro_micro.h new file mode 100644 index 0000000000..f9e7ed75d9 --- /dev/null +++ b/keyboards/treadstone48/pro_micro.h @@ -0,0 +1,362 @@ +/* + pins_arduino.h - Pin definition functions for Arduino + Part of Arduino - http://www.arduino.cc/ + + Copyright (c) 2007 David A. Mellis + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General + Public License along with this library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, + Boston, MA 02111-1307 USA + + $Id: wiring.h 249 2007-02-03 16:52:51Z mellis $ +*/ + +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include <avr/pgmspace.h> + +// Workaround for wrong definitions in "iom32u4.h". +// This should be fixed in the AVR toolchain. +#undef UHCON +#undef UHINT +#undef UHIEN +#undef UHADDR +#undef UHFNUM +#undef UHFNUML +#undef UHFNUMH +#undef UHFLEN +#undef UPINRQX +#undef UPINTX +#undef UPNUM +#undef UPRST +#undef UPCONX +#undef UPCFG0X +#undef UPCFG1X +#undef UPSTAX +#undef UPCFG2X +#undef UPIENX +#undef UPDATX +#undef TCCR2A +#undef WGM20 +#undef WGM21 +#undef COM2B0 +#undef COM2B1 +#undef COM2A0 +#undef COM2A1 +#undef TCCR2B +#undef CS20 +#undef CS21 +#undef CS22 +#undef WGM22 +#undef FOC2B +#undef FOC2A +#undef TCNT2 +#undef TCNT2_0 +#undef TCNT2_1 +#undef TCNT2_2 +#undef TCNT2_3 +#undef TCNT2_4 +#undef TCNT2_5 +#undef TCNT2_6 +#undef TCNT2_7 +#undef OCR2A +#undef OCR2_0 +#undef OCR2_1 +#undef OCR2_2 +#undef OCR2_3 +#undef OCR2_4 +#undef OCR2_5 +#undef OCR2_6 +#undef OCR2_7 +#undef OCR2B +#undef OCR2_0 +#undef OCR2_1 +#undef OCR2_2 +#undef OCR2_3 +#undef OCR2_4 +#undef OCR2_5 +#undef OCR2_6 +#undef OCR2_7 + +#define NUM_DIGITAL_PINS 30 +#define NUM_ANALOG_INPUTS 12 + +#define TX_RX_LED_INIT DDRD |= (1<<5), DDRB |= (1<<0) +#define TXLED0 PORTD |= (1<<5) +#define TXLED1 PORTD &= ~(1<<5) +#define RXLED0 PORTB |= (1<<0) +#define RXLED1 PORTB &= ~(1<<0) + +static const uint8_t SDA = 2; +static const uint8_t SCL = 3; +#define LED_BUILTIN 13 + +// Map SPI port to 'new' pins D14..D17 +static const uint8_t SS = 17; +static const uint8_t MOSI = 16; +static const uint8_t MISO = 14; +static const uint8_t SCK = 15; + +// Mapping of analog pins as digital I/O +// A6-A11 share with digital pins +static const uint8_t ADC0 = 18; +static const uint8_t ADC1 = 19; +static const uint8_t ADC2 = 20; +static const uint8_t ADC3 = 21; +static const uint8_t ADC4 = 22; +static const uint8_t ADC5 = 23; +static const uint8_t ADC6 = 24; // D4 +static const uint8_t ADC7 = 25; // D6 +static const uint8_t ADC8 = 26; // D8 +static const uint8_t ADC9 = 27; // D9 +static const uint8_t ADC10 = 28; // D10 +static const uint8_t ADC11 = 29; // D12 + +#define digitalPinToPCICR(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCICR) : ((uint8_t *)0)) +#define digitalPinToPCICRbit(p) 0 +#define digitalPinToPCMSK(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCMSK0) : ((uint8_t *)0)) +#define digitalPinToPCMSKbit(p) ( ((p) >= 8 && (p) <= 11) ? (p) - 4 : ((p) == 14 ? 3 : ((p) == 15 ? 1 : ((p) == 16 ? 2 : ((p) == 17 ? 0 : (p - A8 + 4)))))) + +// __AVR_ATmega32U4__ has an unusual mapping of pins to channels +extern const uint8_t PROGMEM analog_pin_to_channel_PGM[]; +#define analogPinToChannel(P) ( pgm_read_byte( analog_pin_to_channel_PGM + (P) ) ) + +#define digitalPinToInterrupt(p) ((p) == 0 ? 2 : ((p) == 1 ? 3 : ((p) == 2 ? 1 : ((p) == 3 ? 0 : ((p) == 7 ? 4 : NOT_AN_INTERRUPT))))) + +#ifdef ARDUINO_MAIN + +// On the Arduino board, digital pins are also used +// for the analog output (software PWM). Analog input +// pins are a separate set. + +// ATMEL ATMEGA32U4 / ARDUINO LEONARDO +// +// D0 PD2 RXD1/INT2 +// D1 PD3 TXD1/INT3 +// D2 PD1 SDA SDA/INT1 +// D3# PD0 PWM8/SCL OC0B/SCL/INT0 +// D4 A6 PD4 ADC8 +// D5# PC6 ??? OC3A/#OC4A +// D6# A7 PD7 FastPWM #OC4D/ADC10 +// D7 PE6 INT6/AIN0 +// +// D8 A8 PB4 ADC11/PCINT4 +// D9# A9 PB5 PWM16 OC1A/#OC4B/ADC12/PCINT5 +// D10# A10 PB6 PWM16 OC1B/0c4B/ADC13/PCINT6 +// D11# PB7 PWM8/16 0C0A/OC1C/#RTS/PCINT7 +// D12 A11 PD6 T1/#OC4D/ADC9 +// D13# PC7 PWM10 CLK0/OC4A +// +// A0 D18 PF7 ADC7 +// A1 D19 PF6 ADC6 +// A2 D20 PF5 ADC5 +// A3 D21 PF4 ADC4 +// A4 D22 PF1 ADC1 +// A5 D23 PF0 ADC0 +// +// New pins D14..D17 to map SPI port to digital pins +// +// MISO D14 PB3 MISO,PCINT3 +// SCK D15 PB1 SCK,PCINT1 +// MOSI D16 PB2 MOSI,PCINT2 +// SS D17 PB0 RXLED,SS/PCINT0 +// +// Connected LEDs on board for TX and RX +// TXLED D24 PD5 XCK1 +// RXLED D17 PB0 +// HWB PE2 HWB + +// these arrays map port names (e.g. port B) to the +// appropriate addresses for various functions (e.g. reading +// and writing) +const uint16_t PROGMEM port_to_mode_PGM[] = { + NOT_A_PORT, + NOT_A_PORT, + (uint16_t) &DDRB, + (uint16_t) &DDRC, + (uint16_t) &DDRD, + (uint16_t) &DDRE, + (uint16_t) &DDRF, +}; + +const uint16_t PROGMEM port_to_output_PGM[] = { + NOT_A_PORT, + NOT_A_PORT, + (uint16_t) &PORTB, + (uint16_t) &PORTC, + (uint16_t) &PORTD, + (uint16_t) &PORTE, + (uint16_t) &PORTF, +}; + +const uint16_t PROGMEM port_to_input_PGM[] = { + NOT_A_PORT, + NOT_A_PORT, + (uint16_t) &PINB, + (uint16_t) &PINC, + (uint16_t) &PIND, + (uint16_t) &PINE, + (uint16_t) &PINF, +}; + +const uint8_t PROGMEM digital_pin_to_port_PGM[] = { + PD, // D0 - PD2 + PD, // D1 - PD3 + PD, // D2 - PD1 + PD, // D3 - PD0 + PD, // D4 - PD4 + PC, // D5 - PC6 + PD, // D6 - PD7 + PE, // D7 - PE6 + + PB, // D8 - PB4 + PB, // D9 - PB5 + PB, // D10 - PB6 + PB, // D11 - PB7 + PD, // D12 - PD6 + PC, // D13 - PC7 + + PB, // D14 - MISO - PB3 + PB, // D15 - SCK - PB1 + PB, // D16 - MOSI - PB2 + PB, // D17 - SS - PB0 + + PF, // D18 - A0 - PF7 + PF, // D19 - A1 - PF6 + PF, // D20 - A2 - PF5 + PF, // D21 - A3 - PF4 + PF, // D22 - A4 - PF1 + PF, // D23 - A5 - PF0 + + PD, // D24 - PD5 + PD, // D25 / D6 - A7 - PD7 + PB, // D26 / D8 - A8 - PB4 + PB, // D27 / D9 - A9 - PB5 + PB, // D28 / D10 - A10 - PB6 + PD, // D29 / D12 - A11 - PD6 +}; + +const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = { + _BV(2), // D0 - PD2 + _BV(3), // D1 - PD3 + _BV(1), // D2 - PD1 + _BV(0), // D3 - PD0 + _BV(4), // D4 - PD4 + _BV(6), // D5 - PC6 + _BV(7), // D6 - PD7 + _BV(6), // D7 - PE6 + + _BV(4), // D8 - PB4 + _BV(5), // D9 - PB5 + _BV(6), // D10 - PB6 + _BV(7), // D11 - PB7 + _BV(6), // D12 - PD6 + _BV(7), // D13 - PC7 + + _BV(3), // D14 - MISO - PB3 + _BV(1), // D15 - SCK - PB1 + _BV(2), // D16 - MOSI - PB2 + _BV(0), // D17 - SS - PB0 + + _BV(7), // D18 - A0 - PF7 + _BV(6), // D19 - A1 - PF6 + _BV(5), // D20 - A2 - PF5 + _BV(4), // D21 - A3 - PF4 + _BV(1), // D22 - A4 - PF1 + _BV(0), // D23 - A5 - PF0 + + _BV(5), // D24 - PD5 + _BV(7), // D25 / D6 - A7 - PD7 + _BV(4), // D26 / D8 - A8 - PB4 + _BV(5), // D27 / D9 - A9 - PB5 + _BV(6), // D28 / D10 - A10 - PB6 + _BV(6), // D29 / D12 - A11 - PD6 +}; + +const uint8_t PROGMEM digital_pin_to_timer_PGM[] = { + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + TIMER0B, /* 3 */ + NOT_ON_TIMER, + TIMER3A, /* 5 */ + TIMER4D, /* 6 */ + NOT_ON_TIMER, + + NOT_ON_TIMER, + TIMER1A, /* 9 */ + TIMER1B, /* 10 */ + TIMER0A, /* 11 */ + + NOT_ON_TIMER, + TIMER4A, /* 13 */ + + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, +}; + +const uint8_t PROGMEM analog_pin_to_channel_PGM[] = { + 7, // A0 PF7 ADC7 + 6, // A1 PF6 ADC6 + 5, // A2 PF5 ADC5 + 4, // A3 PF4 ADC4 + 1, // A4 PF1 ADC1 + 0, // A5 PF0 ADC0 + 8, // A6 D4 PD4 ADC8 + 10, // A7 D6 PD7 ADC10 + 11, // A8 D8 PB4 ADC11 + 12, // A9 D9 PB5 ADC12 + 13, // A10 D10 PB6 ADC13 + 9 // A11 D12 PD6 ADC9 +}; + +#endif /* ARDUINO_MAIN */ + +// These serial port names are intended to allow libraries and architecture-neutral +// sketches to automatically default to the correct port name for a particular type +// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, +// the first hardware serial port whose RX/TX pins are not dedicated to another use. +// +// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor +// +// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial +// +// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library +// +// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. +// +// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX +// pins are NOT connected to anything by default. +#define SERIAL_PORT_MONITOR Serial +#define SERIAL_PORT_USBVIRTUAL Serial +#define SERIAL_PORT_HARDWARE Serial1 +#define SERIAL_PORT_HARDWARE_OPEN Serial1 + +#endif /* Pins_Arduino_h */ diff --git a/keyboards/treadstone48/readme.md b/keyboards/treadstone48/readme.md new file mode 100644 index 0000000000..eef39c39b3 --- /dev/null +++ b/keyboards/treadstone48/readme.md @@ -0,0 +1,18 @@ +# treadstone48 + +![treadstone48](https://github.com/marksard/Keyboards/raw/master/_image/20181219-PC190003.jpg) + +A 47 (or 48) keys Symmetric Staggered keyboard. + +Keyboard Maintainer: [marksard](https://github.com/marksard) +Hardware Supported: The PCBs, controllers supported +Hardware Availability: links to where you can find this hardware + +Make example for this keyboard (after setting up your build environment): + + make treadstone48:default + +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). + +[Build guide](https://github.com/marksard/Keyboards/blob/master/treadstpne48/documents/treadstone48_buildguide.md) +[Firmware](https://github.com/marksard/qmk_firmware/tree/my_customize/keyboards/treadstone48) diff --git a/keyboards/treadstone48/rev1/config.h b/keyboards/treadstone48/rev1/config.h new file mode 100644 index 0000000000..d8ecf170dd --- /dev/null +++ b/keyboards/treadstone48/rev1/config.h @@ -0,0 +1,128 @@ +/* +Copyright 2012 Jun Wako <wakojun@gmail.com> +Copyright 2015 Jack Humbert + +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/>. +*/ + +#ifndef REV1_CONFIG_H +#define REV1_CONFIG_H + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0xDFA3 +#define DEVICE_VER 0x0010 +#define MANUFACTURER marksard +#define PRODUCT treadstone48 +#define DESCRIPTION Symmetrical staggered 47+1 Keys Keyboard + +#define PREVENT_STUCK_MODIFIERS +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 150 + +/* Use I2C or Serial */ +#define USE_I2C +#define USE_SERIAL +//#define USE_MATRIX_I2C + +/* Select hand configuration */ +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +// OLED support +// see ./rules.mk: OLED_ENABLE=yes or no +#ifdef OLED_ENABLE + #define SSD1306OLED +#endif + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 16 +#define MATRIX_ROW_PINS { F4, F5, F6, F7, B1, B3, B2, B6 } + +// wiring of each half +#define MATRIX_COLS 6 +#define MATRIX_COL_PINS { D4, C6, D7, E6, B4, B5 } + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +// #define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* 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 + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_TIMER +//#define RGBLED_NUM 12 // Number of LEDs. see ./keymaps/default/config.h +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD + +// treadstone48 keyboard RGB LED support +//#define RGBLIGHT_ANIMATIONS : see ./rules.mk: LED_ANIMATIONS = yes or no +// see ./rules.mk: LED_BACK_ENABLE or LED_UNDERGLOW_ENABLE set yes +#define RGBLED_NUM 12 + +#ifndef IOS_DEVICE_ENABLE + #define RGBLIGHT_LIMIT_VAL 180 + #define RGBLIGHT_VAL_STEP 17 +#else + #define RGBLIGHT_LIMIT_VAL 50 + #define RGBLIGHT_VAL_STEP 4 +#endif +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 + +#if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE) +// USB_MAX_POWER_CONSUMPTION value for treadstone48 keyboard +// 120 RGBoff, OLEDoff +// 120 OLED +// 330 RGB 6 +// 300 RGB 32 +// 310 OLED & RGB 32 + #define USB_MAX_POWER_CONSUMPTION 400 +#else + // fix iPhone and iPad power adapter issue + // iOS device need lessthan 100 + #define USB_MAX_POWER_CONSUMPTION 100 +#endif + +/* + * 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 + + +#endif diff --git a/keyboards/treadstone48/rev1/info.json b/keyboards/treadstone48/rev1/info.json new file mode 100644 index 0000000000..df9e7591b5 --- /dev/null +++ b/keyboards/treadstone48/rev1/info.json @@ -0,0 +1,261 @@ +{ + "keyboard_name": "Treadstone48", + "url": "https://github.com/marksard/Keyboards", + "maintainer": "marksard", + "width": 14.75, + "height": 4, + "layouts": { + "LAYOUT_base": { + "layout": [ + { + "label": "Esc", + "x": 1, + "y": 0 + }, + { + "label": "Q", + "x": 2.25, + "y": 0 + }, + { + "label": "W", + "x": 3.25, + "y": 0 + }, + { + "label": "E", + "x": 4.25, + "y": 0 + }, + { + "label": "R", + "x": 5.25, + "y": 0 + }, + { + "label": "T", + "x": 6.25, + "y": 0 + }, + { + "label": "Y", + "x": 7.75, + "y": 0 + }, + { + "label": "U", + "x": 8.75, + "y": 0 + }, + { + "label": "I", + "x": 9.75, + "y": 0 + }, + { + "label": "O", + "x": 10.75, + "y": 0 + }, + { + "label": "P", + "x": 11.75, + "y": 0 + }, + { + "label": "-", + "x": 13.75, + "y": 0 + }, + { + "label": "Tab", + "x": 1, + "y": 1, + "w": 1.5 + }, + { + "label": "A", + "x": 2.5, + "y": 1 + }, + { + "label": "S", + "x": 3.5, + "y": 1 + }, + { + "label": "D", + "x": 4.5, + "y": 1 + }, + { + "label": "F", + "x": 5.5, + "y": 1 + }, + { + "label": "G", + "x": 6.5, + "y": 1 + }, + { + "label": "H", + "x": 7.5, + "y": 1 + }, + { + "label": "J", + "x": 8.5, + "y": 1 + }, + { + "label": "K", + "x": 9.5, + "y": 1 + }, + { + "label": "L", + "x": 10.5, + "y": 1 + }, + { + "label": ":", + "x": 11.5, + "y": 1 + }, + { + "label": "Enter", + "x": 12.5, + "y": 1, + "w": 2.25 + }, + { + "label": "Shift", + "x": 0, + "y": 2, + "w": 2.25 + }, + { + "label": "Z", + "x": 2.25, + "y": 2 + }, + { + "label": "X", + "x": 3.25, + "y": 2 + }, + { + "label": "C", + "x": 4.25, + "y": 2 + }, + { + "label": "V", + "x": 5.25, + "y": 2 + }, + { + "label": "B", + "x": 6.25, + "y": 2 + }, + { + "label": "N", + "x": 7.75, + "y": 2 + }, + { + "label": "M", + "x": 8.75, + "y": 2 + }, + { + "label": "<", + "x": 9.75, + "y": 2 + }, + { + "label": ">", + "x": 10.75, + "y": 2 + }, + { + "label": "?", + "x": 11.75, + "y": 2 + }, + { + "label": "\u2191", + "x": 12.75, + "y": 2 + }, + { + "label": "Ctrl", + "x": 0.75, + "y": 3, + "w": 1.25 + }, + { + "label": "Win", + "x": 2, + "y": 3, + "w": 1.25 + }, + { + "label": "Alt", + "x": 3.25, + "y": 3, + "w": 1.25 + }, + { + "label": "Lower", + "x": 4.5, + "y": 3 + }, + { + "label": "BackSpace", + "x": 5.5, + "y": 3, + "w": 2 + }, + { + "x": 7.5, + "y": 3, + "w": 2 + }, + { + "label": "Raise", + "x": 9.5, + "y": 3 + }, + { + "label": "Menu", + "x": 10.5, + "y": 3, + "w": 1.25 + }, + { + "label": "\u2190", + "x": 11.75, + "y": 3 + }, + { + "label": "\u2193", + "x": 12.75, + "y": 3 + }, + { + "label": "\u2192", + "x": 13.75, + "y": 3 + }, + { + "label": "_", + "x": 12.75, + "y": 0 + } + ] + } + } +} diff --git a/keyboards/treadstone48/rev1/matrix.c b/keyboards/treadstone48/rev1/matrix.c new file mode 100644 index 0000000000..8685a8125e --- /dev/null +++ b/keyboards/treadstone48/rev1/matrix.c @@ -0,0 +1,357 @@ +/* +Copyright 2012 Jun Wako <wakojun@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/>. +*/ + +/* + * scan matrix + */ +#include <stdint.h> +#include <stdbool.h> +#include <string.h> +#include <avr/io.h> +#include <avr/wdt.h> +#include <avr/interrupt.h> +#include <util/delay.h> +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "split_util.h" +#include "pro_micro.h" + +#ifdef USE_MATRIX_I2C +# include "i2c.h" +#else // USE_SERIAL +# include "split_scomm.h" +#endif + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +#define ERROR_DISCONNECT_COUNT 5 + +static uint8_t debouncing = DEBOUNCE; +static const int ROWS_PER_HAND = MATRIX_ROWS/2; +static uint8_t error_count = 0; +uint8_t is_master = 0 ; + +static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_cols(void); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); +static uint8_t matrix_master_scan(void); + + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + debug_enable = true; + debug_matrix = true; + debug_mouse = true; + // initialize row and col + unselect_rows(); + init_cols(); + + TX_RX_LED_INIT; + TXLED0; + RXLED0; + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + + is_master = has_usb(); + + matrix_init_quantum(); +} + +uint8_t _matrix_scan(void) +{ + // Right hand is stored after the left in the matirx so, we need to offset it + int offset = isLeftHand ? 0 : (ROWS_PER_HAND); + + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + select_row(i); + _delay_us(30); // without this wait read unstable value. + matrix_row_t cols = read_cols(); + if (matrix_debouncing[i+offset] != cols) { + matrix_debouncing[i+offset] = cols; + debouncing = DEBOUNCE; + } + unselect_rows(); + } + + if (debouncing) { + if (--debouncing) { + _delay_ms(1); + } else { + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + matrix[i+offset] = matrix_debouncing[i+offset]; + } + } + } + + return 1; +} + +#ifdef USE_MATRIX_I2C + +// Get rows from other half over i2c +int i2c_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + + int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + if (err) goto i2c_error; + + // start of matrix stored at 0x00 + err = i2c_master_write(0x00); + if (err) goto i2c_error; + + // Start read + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); + if (err) goto i2c_error; + + if (!err) { + int i; + for (i = 0; i < ROWS_PER_HAND-1; ++i) { + matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); + } + matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); + i2c_master_stop(); + } else { +i2c_error: // the cable is disconnceted, or something else went wrong + i2c_reset_state(); + return err; + } + + return 0; +} + +#else // USE_SERIAL + +int serial_transaction(int master_changed) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; +#ifdef SERIAL_USE_MULTI_TRANSACTION + int ret=serial_update_buffers(master_changed); +#else + int ret=serial_update_buffers(); +#endif + if (ret ) { + if(ret==2) RXLED1; + return 1; + } + RXLED0; + memcpy(&matrix[slaveOffset], + (void *)serial_slave_buffer, sizeof(serial_slave_buffer)); + return 0; +} +#endif + +uint8_t matrix_scan(void) +{ + if (is_master) { + matrix_master_scan(); + }else{ + matrix_slave_scan(); + int offset = (isLeftHand) ? ROWS_PER_HAND : 0; + memcpy(&matrix[offset], + (void *)serial_master_buffer, sizeof(serial_master_buffer)); + matrix_scan_quantum(); + } + return 1; +} + + +uint8_t matrix_master_scan(void) { + + int ret = _matrix_scan(); + int mchanged = 1; + + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + +#ifdef USE_MATRIX_I2C +// for (int i = 0; i < ROWS_PER_HAND; ++i) { + /* i2c_slave_buffer[i] = matrix[offset+i]; */ +// i2c_slave_buffer[i] = matrix[offset+i]; +// } +#else // USE_SERIAL + #ifdef SERIAL_USE_MULTI_TRANSACTION + mchanged = memcmp((void *)serial_master_buffer, + &matrix[offset], sizeof(serial_master_buffer)); + #endif + memcpy((void *)serial_master_buffer, + &matrix[offset], sizeof(serial_master_buffer)); +#endif + +#ifdef USE_MATRIX_I2C + if( i2c_transaction() ) { +#else // USE_SERIAL + if( serial_transaction(mchanged) ) { +#endif + // turn on the indicator led when halves are disconnected + TXLED1; + + error_count++; + + if (error_count > ERROR_DISCONNECT_COUNT) { + // reset other half if disconnected + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = 0; + } + } + } else { + // turn off the indicator led on no error + TXLED0; + error_count = 0; + } + matrix_scan_quantum(); + return ret; +} + +void matrix_slave_scan(void) { + _matrix_scan(); + + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + +#ifdef USE_MATRIX_I2C + for (int i = 0; i < ROWS_PER_HAND; ++i) { + /* i2c_slave_buffer[i] = matrix[offset+i]; */ + i2c_slave_buffer[i] = matrix[offset+i]; + } +#else // USE_SERIAL + #ifdef SERIAL_USE_MULTI_TRANSACTION + int change = 0; + #endif + for (int i = 0; i < ROWS_PER_HAND; ++i) { + #ifdef SERIAL_USE_MULTI_TRANSACTION + if( serial_slave_buffer[i] != matrix[offset+i] ) + change = 1; + #endif + serial_slave_buffer[i] = matrix[offset+i]; + } + #ifdef SERIAL_USE_MULTI_TRANSACTION + slave_buffer_change_count += change; + #endif +#endif +} + +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<<col)); +} + +inline +matrix_row_t matrix_get_row(uint8_t row) +{ + return matrix[row]; +} + +void matrix_print(void) +{ + print("\nr/c 0123456789ABCDEF\n"); + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + phex(row); print(": "); + pbin_reverse16(matrix_get_row(row)); + print("\n"); + } +} + +uint8_t matrix_key_count(void) +{ + uint8_t count = 0; + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + count += bitpop16(matrix[i]); + } + return count; +} + +static void init_cols(void) +{ + for(int x = 0; x < MATRIX_COLS; x++) { + _SFR_IO8((col_pins[x] >> 4) + 1) &= ~_BV(col_pins[x] & 0xF); + _SFR_IO8((col_pins[x] >> 4) + 2) |= _BV(col_pins[x] & 0xF); + } +} + +static matrix_row_t read_cols(void) +{ + matrix_row_t result = 0; + for(int x = 0; x < MATRIX_COLS; x++) { + result |= (_SFR_IO8(col_pins[x] >> 4) & _BV(col_pins[x] & 0xF)) ? 0 : (1 << x); + } + return result; +} + +static void unselect_rows(void) +{ + for(int x = 0; x < ROWS_PER_HAND; x++) { + _SFR_IO8((row_pins[x] >> 4) + 1) &= ~_BV(row_pins[x] & 0xF); + _SFR_IO8((row_pins[x] >> 4) + 2) |= _BV(row_pins[x] & 0xF); + } +} + +static void select_row(uint8_t row) +{ + _SFR_IO8((row_pins[row] >> 4) + 1) |= _BV(row_pins[row] & 0xF); + _SFR_IO8((row_pins[row] >> 4) + 2) &= ~_BV(row_pins[row] & 0xF); +} diff --git a/keyboards/treadstone48/rev1/rev1.c b/keyboards/treadstone48/rev1/rev1.c new file mode 100644 index 0000000000..2637864271 --- /dev/null +++ b/keyboards/treadstone48/rev1/rev1.c @@ -0,0 +1,15 @@ +#include "treadstone48.h" + + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + //led_set_user(usb_led); +} +#endif + +void matrix_init_kb(void) { + + matrix_init_user(); +}; + diff --git a/keyboards/treadstone48/rev1/rev1.h b/keyboards/treadstone48/rev1/rev1.h new file mode 100644 index 0000000000..c6145398dd --- /dev/null +++ b/keyboards/treadstone48/rev1/rev1.h @@ -0,0 +1,202 @@ +#ifndef REV1_H +#define REV1_CONFIG_H + +#include "../treadstone48.h" + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + +#ifdef RGBLIGHT_ENABLE +//rgb led driver +#include "ws2812.h" +#endif + +#ifdef USE_I2C +#include <stddef.h> +#ifdef __AVR__ + #include <avr/io.h> + #include <avr/interrupt.h> +#endif +#endif + +// full Keymap +// (TRRS jack on the left half is to the right, TRRS jack on the right half is to the left) +#define LAYOUT_full( \ + L00, L01, L02, L03, L04, L05, L40, L41, L42, L43, L44, L45, R00, R01, R02, R03, R04, R05, R40, R41, R42, R43, R44, R45, \ + L10, L11, L12, L13, L14, L15, L50, L51, L52, L53, L54, L55, R10, R11, R12, R13, R14, R15, R50, R51, R52, R53, R54, R55, \ + L20, L21, L22, L23, L24, L25, L60, L61, L62, L63, L64, L65, R20, R21, R22, R23, R24, R25, R60, R61, R62, R63, R64, R65, \ + L30, L31, L32, L33, L34, L35, L70, L71, L72, L73, L74, L75, R30, R31, R32, R33, R34, R35, R70, R71, R72, R73, R74, R75 \ + ) \ + { \ + { L45, L44, L43, L42, L41, L40 }, \ + { L55, L54, L53, L52, L51, L50 }, \ + { L65, L64, L63, L62, L61, L60 }, \ + { L75, L74, L73, L72, L71, L70 }, \ + { L05, L04, L03, L02, L01, L00 }, \ + { L15, L14, L13, L12, L11, L10 }, \ + { L25, L24, L23, L22, L21, L20 }, \ + { L35, L34, L33, L32, L31, L30 }, \ + { R45, R44, R43, R42, R41, R40 }, \ + { R55, R54, R53, R52, R51, R50 }, \ + { R65, R64, R63, R62, R61, R60 }, \ + { R75, R74, R73, R72, R71, R70 }, \ + { R05, R04, R03, R02, R01, R00 }, \ + { R15, R14, R13, R12, R11, R10 }, \ + { R25, R24, R23, R22, R21, R20 }, \ + { R35, R34, R33, R32, R31, R30 }, \ + } + +#define K_N KC_NO + +////////////////////////////////////////////////////////////////////////////// +// When only use Treadstone48. +// L75 is ExtraKey +////////////////////////////////////////////////////////////////////////////// +#define LAYOUT_base( \ + L00, L01, L02, L03, L04, L05, L40, L41, L42, L43, L44, L45, \ + L10, L11, L12, L13, L14, L15, L50, L51, L52, L53, L54, L55, \ + L20, L21, L22, L23, L24, L25, L60, L61, L62, L63, L64, L65, \ + L30, L31, L32, L33, L34, L35, L70, L71, L72, L73, L74, L75 \ + ) \ + LAYOUT_full( \ + L00, L01, L02, L03, L04, L05, L40, L41, L42, L43, L44, L45, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, \ + L10, L11, L12, L13, L14, L15, L50, L51, L52, L53, L54, L55, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, \ + L20, L21, L22, L23, L24, L25, L60, L61, L62, L63, L64, L65, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, \ + L30, L31, L32, L33, L34, L35, L70, L71, L72, L73, L74, L75, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N \ + ) + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_base_kc( \ + L00, L01, L02, L03, L04, L05, L40, L41, L42, L43, L44, L45, \ + L10, L11, L12, L13, L14, L15, L50, L51, L52, L53, L54, L55, \ + L20, L21, L22, L23, L24, L25, L60, L61, L62, L63, L64, L65, \ + L30, L31, L32, L33, L34, L35, L70, L71, L72, L73, L74, L75 \ + ) \ + LAYOUT_base( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##L45, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##L50, KC_##L51, KC_##L52, KC_##L53, KC_##L54, KC_##L55, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L60, KC_##L61, KC_##L62, KC_##L63, KC_##L64, KC_##L65, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L70, KC_##L71, KC_##L72, KC_##L73, KC_##L74, KC_##L75 \ + ) +////////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////// +// When connecting Rhymestone to Treadstone48. +// L75 is ExtraKey +////////////////////////////////////////////////////////////////////////////// +#define LAYOUT_rs( \ + L00, L01, L02, L03, L04, L05, L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, \ + L10, L11, L12, L13, L14, L15, L50, L51, L52, L53, L54, L55, R50, R51, R52, R53, R54, \ + L20, L21, L22, L23, L24, L25, L60, L61, L62, L63, L64, L65, R60, R61, R62, R63, R64, \ + L30, L31, L32, L33, L34, L35, L70, L71, L72, L73, L74, R70, R71, R72, R73, R74, L75 \ + ) \ + LAYOUT_full( \ + L00, L01, L02, L03, L04, L05, L40, L41, L42, L43, L44, L45, K_N, K_N, K_N, K_N, K_N, K_N, K_N, R44, R43, R42, R41, R40, \ + L10, L11, L12, L13, L14, L15, L50, L51, L52, L53, L54, L55, K_N, K_N, K_N, K_N, K_N, K_N, K_N, R54, R53, R52, R51, R50, \ + L20, L21, L22, L23, L24, L25, L60, L61, L62, L63, L64, L65, K_N, K_N, K_N, K_N, K_N, K_N, K_N, R64, R63, R62, R61, R60, \ + L30, L31, L32, L33, L34, L35, L70, L71, L72, L73, L74, L75, K_N, K_N, K_N, K_N, K_N, K_N, K_N, R74, R73, R72, R71, R70 \ + ) + +// When use right hand side of the Rhymestone. +#ifdef RHYMESTONE_RIGHTHAND +#undef LAYOUT_rs +#define LAYOUT_rs( \ + L00, L01, L02, L03, L04, L05, L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, \ + L10, L11, L12, L13, L14, L15, L50, L51, L52, L53, L54, L55, R50, R51, R52, R53, R54, \ + L20, L21, L22, L23, L24, L25, L60, L61, L62, L63, L64, L65, R60, R61, R62, R63, R64, \ + L30, L31, L32, L33, L34, L35, L70, L71, L72, L73, L74, R70, R71, R72, R73, R74, L75 \ + ) \ + LAYOUT_full( \ + L00, L01, L02, L03, L04, L05, L40, L41, L42, L43, L44, L45, K_N, K_N, K_N, K_N, K_N, K_N, K_N, R40, R41, R42, R43, R44, \ + L10, L11, L12, L13, L14, L15, L50, L51, L52, L53, L54, L55, K_N, K_N, K_N, K_N, K_N, K_N, K_N, R50, R51, R52, R53, R54, \ + L20, L21, L22, L23, L24, L25, L60, L61, L62, L63, L64, L65, K_N, K_N, K_N, K_N, K_N, K_N, K_N, R60, R61, R62, R63, R64, \ + L30, L31, L32, L33, L34, L35, L70, L71, L72, L73, L74, L75, K_N, K_N, K_N, K_N, K_N, K_N, K_N, R70, R71, R72, R73, R74 \ + ) +#endif + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_rs_kc( \ + L00, L01, L02, L03, L04, L05, L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, \ + L10, L11, L12, L13, L14, L15, L50, L51, L52, L53, L54, L55, R50, R51, R52, R53, R54, \ + L20, L21, L22, L23, L24, L25, L60, L61, L62, L63, L64, L65, R60, R61, R62, R63, R64, \ + L30, L31, L32, L33, L34, L35, L70, L71, L72, L73, L74, L75, R70, R71, R72, R73, R74 \ + ) \ + LAYOUT_rs( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##L45, KC_##R40, KC_##R41, KC_##R42, KC_##R43, KC_##R44, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##L50, KC_##L51, KC_##L52, KC_##L53, KC_##L54, KC_##L55, KC_##R50, KC_##R51, KC_##R52, KC_##R53, KC_##R54, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L60, KC_##L61, KC_##L62, KC_##L63, KC_##L64, KC_##L65, KC_##R60, KC_##R61, KC_##R62, KC_##R63, KC_##R64, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L70, KC_##L71, KC_##L72, KC_##L73, KC_##L74, KC_##L75, KC_##R70, KC_##R71, KC_##R72, KC_##R73, KC_##R74 \ + ) +////////////////////////////////////////////////////////////////////////////// + + + +////////////////////////////////////////////////////////////////////////////// +// Alpha version keymap. +// L30 is ExtraKey +////////////////////////////////////////////////////////////////////////////// +#ifdef ANGELINA_KEYMAP +#undef LAYOUT_base +#undef LAYOUT_base_kc +#undef LAYOUT_rs +#undef LAYOUT_rs_kc + +#define LAYOUT_base( \ + L00, L01, L02, L03, L04, L05, L40, L41, L42, L43, L44, L45, \ + L10, L11, L12, L13, L14, L15, L50, L51, L52, L53, L54, L55, \ + L20, L21, L22, L23, L24, L25, L60, L61, L62, L63, L64, L65, \ + L31, L32, L33, L34, L35, L70, L71, L72, L73, L74, L75, L30 \ + ) \ + LAYOUT_full( \ + L00, L01, L02, L03, L04, L05, L40, L41, L42, L43, L44, L45, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, \ + L10, L11, L12, L13, L14, L15, L50, L51, L52, L53, L54, L55, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, \ + L20, L21, L22, L23, L24, L25, L60, L61, L62, L63, L64, L65, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, \ + L30, L31, L32, L33, L34, L35, L70, L71, L72, L73, L74, L75, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N \ + ) + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_base_kc( \ + L00, L01, L02, L03, L04, L05, L40, L41, L42, L43, L44, L45, \ + L10, L11, L12, L13, L14, L15, L50, L51, L52, L53, L54, L55, \ + L20, L21, L22, L23, L24, L25, L60, L61, L62, L63, L64, L65, \ + L30, L31, L32, L33, L34, L35, L70, L71, L72, L73, L74, L75 \ + ) \ + LAYOUT_base( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##L45, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##L50, KC_##L51, KC_##L52, KC_##L53, KC_##L54, KC_##L55, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L60, KC_##L61, KC_##L62, KC_##L63, KC_##L64, KC_##L65, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L70, KC_##L71, KC_##L72, KC_##L73, KC_##L74, KC_##L75 \ + ) + +#define LAYOUT_rs( \ + L00, L01, L02, L03, L04, L05, L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, \ + L10, L11, L12, L13, L14, L15, L50, L51, L52, L53, L54, L55, R50, R51, R52, R53, R54, \ + L20, L21, L22, L23, L24, L25, L60, L61, L62, L63, L64, L65, R60, R61, R62, R63, R64, \ + L31, L32, L33, L34, L35, L70, L71, L72, L73, L74, L75, R70, R71, R72, R73, R74, L30 \ + ) \ + LAYOUT_full( \ + L00, L01, L02, L03, L04, L05, L40, L41, L42, L43, L44, L45, K_N, K_N, K_N, K_N, K_N, K_N, K_N, R44, R43, R42, R41, R40, \ + L10, L11, L12, L13, L14, L15, L50, L51, L52, L53, L54, L55, K_N, K_N, K_N, K_N, K_N, K_N, K_N, R54, R53, R52, R51, R50, \ + L20, L21, L22, L23, L24, L25, L60, L61, L62, L63, L64, L65, K_N, K_N, K_N, K_N, K_N, K_N, K_N, R64, R63, R62, R61, R60, \ + L30, L31, L32, L33, L34, L35, L70, L71, L72, L73, L74, L75, K_N, K_N, K_N, K_N, K_N, K_N, K_N, R74, R73, R72, R71, R70 \ + ) + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_rs_kc( \ + L00, L01, L02, L03, L04, L05, L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, \ + L10, L11, L12, L13, L14, L15, L50, L51, L52, L53, L54, L55, R50, R51, R52, R53, R54, \ + L20, L21, L22, L23, L24, L25, L60, L61, L62, L63, L64, L65, R60, R61, R62, R63, R64, \ + L30, L31, L32, L33, L34, L35, L70, L71, L72, L73, L74, L75, R70, R71, R72, R73, R74 \ + ) \ + LAYOUT_rs( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##L45, KC_##R40, KC_##R41, KC_##R42, KC_##R43, KC_##R44, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##L50, KC_##L51, KC_##L52, KC_##L53, KC_##L54, KC_##L55, KC_##R50, KC_##R51, KC_##R52, KC_##R53, KC_##R54, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L60, KC_##L61, KC_##L62, KC_##L63, KC_##L64, KC_##L65, KC_##R60, KC_##R61, KC_##R62, KC_##R63, KC_##R64, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L70, KC_##L71, KC_##L72, KC_##L73, KC_##L74, KC_##L75, KC_##R70, KC_##R71, KC_##R72, KC_##R73, KC_##R74 \ + ) + +#endif +////////////////////////////////////////////////////////////////////////////// + +#endif diff --git a/keyboards/treadstone48/rev1/rules.mk b/keyboards/treadstone48/rev1/rules.mk new file mode 100644 index 0000000000..6028b5a5b9 --- /dev/null +++ b/keyboards/treadstone48/rev1/rules.mk @@ -0,0 +1,3 @@ +SRC += rev1/matrix.c +SRC += rev1/split_util.c +SRC += rev1/split_scomm.c diff --git a/keyboards/treadstone48/rev1/serial_config.h b/keyboards/treadstone48/rev1/serial_config.h new file mode 100644 index 0000000000..37135213d5 --- /dev/null +++ b/keyboards/treadstone48/rev1/serial_config.h @@ -0,0 +1,8 @@ +//// #error rev2 serial config + +#ifndef SOFT_SERIAL_PIN +/* Soft Serial defines */ +#define SOFT_SERIAL_PIN D2 + +#define SERIAL_USE_MULTI_TRANSACTION +#endif diff --git a/keyboards/treadstone48/rev1/serial_config_simpleapi.h b/keyboards/treadstone48/rev1/serial_config_simpleapi.h new file mode 100644 index 0000000000..e2d22a41e7 --- /dev/null +++ b/keyboards/treadstone48/rev1/serial_config_simpleapi.h @@ -0,0 +1,8 @@ +#ifndef SERIAL_CONFIG_SIMPLEAPI_H +#define SERIAL_CONFIG_SIMPLEAPI_H + +#undef SERIAL_USE_MULTI_TRANSACTION +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 + +#endif // SERIAL_CONFIG_SIMPLEAPI_H diff --git a/keyboards/treadstone48/rev1/split_scomm.c b/keyboards/treadstone48/rev1/split_scomm.c new file mode 100644 index 0000000000..ada7867960 --- /dev/null +++ b/keyboards/treadstone48/rev1/split_scomm.c @@ -0,0 +1,92 @@ +#ifdef USE_SERIAL +#ifdef SERIAL_USE_MULTI_TRANSACTION +/* --- USE flexible API (using multi-type transaction function) --- */ + +#include <stdbool.h> +#include <stdint.h> +#include <stddef.h> +#include <split_scomm.h> +#include "serial.h" +#ifdef CONSOLE_ENABLE + #include <print.h> +#endif + +uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; +uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; +uint8_t volatile status_com = 0; +uint8_t volatile status1 = 0; +uint8_t slave_buffer_change_count = 0; +uint8_t s_change_old = 0xff; +uint8_t s_change_new = 0xff; + +SSTD_t transactions[] = { +#define GET_SLAVE_STATUS 0 + /* master buffer not changed, only recive slave_buffer_change_count */ + { (uint8_t *)&status_com, + 0, NULL, + sizeof(slave_buffer_change_count), &slave_buffer_change_count, + }, +#define PUT_MASTER_GET_SLAVE_STATUS 1 + /* master buffer changed need send, and recive slave_buffer_change_count */ + { (uint8_t *)&status_com, + sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer, + sizeof(slave_buffer_change_count), &slave_buffer_change_count, + }, +#define GET_SLAVE_BUFFER 2 + /* recive serial_slave_buffer */ + { (uint8_t *)&status1, + 0, NULL, + sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer + } +}; + +void serial_master_init(void) +{ + soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); +} + +void serial_slave_init(void) +{ + soft_serial_target_init(transactions, TID_LIMIT(transactions)); +} + +// 0 => no error +// 1 => slave did not respond +// 2 => checksum error +int serial_update_buffers(int master_update) +{ + int status, smatstatus; + static int need_retry = 0; + + if( s_change_old != s_change_new ) { + smatstatus = soft_serial_transaction(GET_SLAVE_BUFFER); + if( smatstatus == TRANSACTION_END ) { + s_change_old = s_change_new; +#ifdef CONSOLE_ENABLE + uprintf("slave matrix = %b %b %b %b %b\n", + serial_slave_buffer[0], serial_slave_buffer[1], + serial_slave_buffer[2], serial_slave_buffer[3], + serial_slave_buffer[4] ); +#endif + } + } else { + // serial_slave_buffer dosen't change + smatstatus = TRANSACTION_END; // dummy status + } + + if( !master_update && !need_retry) { + status = soft_serial_transaction(GET_SLAVE_STATUS); + } else { + status = soft_serial_transaction(PUT_MASTER_GET_SLAVE_STATUS); + } + if( status == TRANSACTION_END ) { + s_change_new = slave_buffer_change_count; + need_retry = 0; + } else { + need_retry = 1; + } + return smatstatus; +} + +#endif // SERIAL_USE_MULTI_TRANSACTION +#endif /* USE_SERIAL */ diff --git a/keyboards/treadstone48/rev1/split_scomm.h b/keyboards/treadstone48/rev1/split_scomm.h new file mode 100644 index 0000000000..16887eb74f --- /dev/null +++ b/keyboards/treadstone48/rev1/split_scomm.h @@ -0,0 +1,21 @@ +#pragma once + +#ifndef SERIAL_USE_MULTI_TRANSACTION +/* --- USE Simple API (OLD API, compatible with let's split serial.c) --- */ +#include "serial.h" + +#else +/* --- USE flexible API (using multi-type transaction function) --- */ +// Buffers for master - slave communication +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 + +extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; +extern uint8_t slave_buffer_change_count; + +void serial_master_init(void); +void serial_slave_init(void); +int serial_update_buffers(int master_changed); + +#endif diff --git a/keyboards/treadstone48/rev1/split_util.c b/keyboards/treadstone48/rev1/split_util.c new file mode 100644 index 0000000000..e1ff8b4379 --- /dev/null +++ b/keyboards/treadstone48/rev1/split_util.c @@ -0,0 +1,70 @@ +#include <avr/io.h> +#include <avr/wdt.h> +#include <avr/power.h> +#include <avr/interrupt.h> +#include <util/delay.h> +#include <avr/eeprom.h> +#include "split_util.h" +#include "matrix.h" +#include "keyboard.h" + +#ifdef USE_MATRIX_I2C +# include "i2c.h" +#else +# include "split_scomm.h" +#endif + +volatile bool isLeftHand = true; + +static void setup_handedness(void) { + #ifdef EE_HANDS + isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); + #else + // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c + #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) + isLeftHand = !has_usb(); + #else + isLeftHand = has_usb(); + #endif + #endif +} + +static void keyboard_master_setup(void) { + +#ifdef USE_MATRIX_I2C + i2c_master_init(); +#else + serial_master_init(); +#endif +} + +static void keyboard_slave_setup(void) { + +#ifdef USE_MATRIX_I2C + i2c_slave_init(SLAVE_I2C_ADDRESS); +#else + serial_slave_init(); +#endif +} + +bool has_usb(void) { + USBCON |= (1 << OTGPADE); //enables VBUS pad + _delay_us(5); + return (USBSTA & (1<<VBUS)); //checks state of VBUS +} + +void split_keyboard_setup(void) { + setup_handedness(); + + if (has_usb()) { + keyboard_master_setup(); + } else { + keyboard_slave_setup(); + } + sei(); +} + +// this code runs before the usb and keyboard is initialized +void matrix_setup(void) { + split_keyboard_setup(); +} diff --git a/keyboards/treadstone48/rev1/split_util.h b/keyboards/treadstone48/rev1/split_util.h new file mode 100644 index 0000000000..f593047560 --- /dev/null +++ b/keyboards/treadstone48/rev1/split_util.h @@ -0,0 +1,16 @@ +#pragma once + +#include <stdbool.h> +#include "eeconfig.h" + +#define SLAVE_I2C_ADDRESS 0x32 + +extern volatile bool isLeftHand; + +// slave version of matix scan, defined in matrix.c +void matrix_slave_scan(void); + +void split_keyboard_setup(void); +bool has_usb(void); + +void matrix_master_OLED_init (void); diff --git a/keyboards/treadstone48/rules.mk b/keyboards/treadstone48/rules.mk new file mode 100644 index 0000000000..6ddbdaf80e --- /dev/null +++ b/keyboards/treadstone48/rules.mk @@ -0,0 +1,73 @@ +SRC += i2c.c +SRC += serial.c +SRC += ssd1306.c + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +SUBPROJECT_rev1 = no +USE_I2C = yes +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +CUSTOM_MATRIX = yes + +DEFAULT_FOLDER = treadstone48/rev1 diff --git a/keyboards/treadstone48/serial.c b/keyboards/treadstone48/serial.c new file mode 100644 index 0000000000..6006ebf1bd --- /dev/null +++ b/keyboards/treadstone48/serial.c @@ -0,0 +1,590 @@ +/* + * WARNING: be careful changing this code, it is very timing dependent + * + * 2018-10-28 checked + * avr-gcc 4.9.2 + * avr-gcc 5.4.0 + * avr-gcc 7.3.0 + */ + +#ifndef F_CPU +#define F_CPU 16000000 +#endif + +#include <avr/io.h> +#include <avr/interrupt.h> +#include <util/delay.h> +#include <stddef.h> +#include <stdbool.h> +#include "serial.h" +//#include <pro_micro.h> + +#ifdef SOFT_SERIAL_PIN + +#ifdef __AVR_ATmega32U4__ + // if using ATmega32U4 I2C, can not use PD0 and PD1 in soft serial. + #ifdef USE_I2C + #if SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1 + #error Using ATmega32U4 I2C, so can not use PD0, PD1 + #endif + #endif + + #if SOFT_SERIAL_PIN >= D0 && SOFT_SERIAL_PIN <= D3 + #define SERIAL_PIN_DDR DDRD + #define SERIAL_PIN_PORT PORTD + #define SERIAL_PIN_INPUT PIND + #if SOFT_SERIAL_PIN == D0 + #define SERIAL_PIN_MASK _BV(PD0) + #define EIMSK_BIT _BV(INT0) + #define EICRx_BIT (~(_BV(ISC00) | _BV(ISC01))) + #define SERIAL_PIN_INTERRUPT INT0_vect + #elif SOFT_SERIAL_PIN == D1 + #define SERIAL_PIN_MASK _BV(PD1) + #define EIMSK_BIT _BV(INT1) + #define EICRx_BIT (~(_BV(ISC10) | _BV(ISC11))) + #define SERIAL_PIN_INTERRUPT INT1_vect + #elif SOFT_SERIAL_PIN == D2 + #define SERIAL_PIN_MASK _BV(PD2) + #define EIMSK_BIT _BV(INT2) + #define EICRx_BIT (~(_BV(ISC20) | _BV(ISC21))) + #define SERIAL_PIN_INTERRUPT INT2_vect + #elif SOFT_SERIAL_PIN == D3 + #define SERIAL_PIN_MASK _BV(PD3) + #define EIMSK_BIT _BV(INT3) + #define EICRx_BIT (~(_BV(ISC30) | _BV(ISC31))) + #define SERIAL_PIN_INTERRUPT INT3_vect + #endif + #elif SOFT_SERIAL_PIN == E6 + #define SERIAL_PIN_DDR DDRE + #define SERIAL_PIN_PORT PORTE + #define SERIAL_PIN_INPUT PINE + #define SERIAL_PIN_MASK _BV(PE6) + #define EIMSK_BIT _BV(INT6) + #define EICRx_BIT (~(_BV(ISC60) | _BV(ISC61))) + #define SERIAL_PIN_INTERRUPT INT6_vect + #else + #error invalid SOFT_SERIAL_PIN value + #endif + +#else + #error serial.c now support ATmega32U4 only +#endif + +//////////////// for backward compatibility //////////////////////////////// +#if !defined(SERIAL_USE_SINGLE_TRANSACTION) && !defined(SERIAL_USE_MULTI_TRANSACTION) +/* --- USE OLD API (compatible with let's split serial.c) */ + #if SERIAL_SLAVE_BUFFER_LENGTH > 0 + uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; + #endif + #if SERIAL_MASTER_BUFFER_LENGTH > 0 + uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; + #endif + uint8_t volatile status0 = 0; + +SSTD_t transactions[] = { + { (uint8_t *)&status0, + #if SERIAL_MASTER_BUFFER_LENGTH > 0 + sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer, + #else + 0, (uint8_t *)NULL, + #endif + #if SERIAL_SLAVE_BUFFER_LENGTH > 0 + sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer + #else + 0, (uint8_t *)NULL, + #endif + } +}; + +void serial_master_init(void) +{ soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } + +void serial_slave_init(void) +{ soft_serial_target_init(transactions, TID_LIMIT(transactions)); } + +// 0 => no error +// 1 => slave did not respond +// 2 => checksum error +int serial_update_buffers() +{ + int result; + result = soft_serial_transaction(); + return result; +} + +#endif // end of OLD API (compatible with let's split serial.c) +//////////////////////////////////////////////////////////////////////////// + +#define ALWAYS_INLINE __attribute__((always_inline)) +#define NO_INLINE __attribute__((noinline)) +#define _delay_sub_us(x) __builtin_avr_delay_cycles(x) + +// parity check +#define ODD_PARITY 1 +#define EVEN_PARITY 0 +#define PARITY EVEN_PARITY + +#ifdef SERIAL_DELAY + // custom setup in config.h + // #define TID_SEND_ADJUST 2 + // #define SERIAL_DELAY 6 // micro sec + // #define READ_WRITE_START_ADJUST 30 // cycles + // #define READ_WRITE_WIDTH_ADJUST 8 // cycles +#else +// ============ Standard setups ============ + +#ifndef SELECT_SOFT_SERIAL_SPEED +#define SELECT_SOFT_SERIAL_SPEED 1 +// 0: about 189kbps +// 1: about 137kbps (default) +// 2: about 75kbps +// 3: about 39kbps +// 4: about 26kbps +// 5: about 20kbps +#endif + +#if __GNUC__ < 6 + #define TID_SEND_ADJUST 14 +#else + #define TID_SEND_ADJUST 2 +#endif + +#if SELECT_SOFT_SERIAL_SPEED == 0 + // Very High speed + #define SERIAL_DELAY 4 // micro sec + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 34 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 1 + // High speed + #define SERIAL_DELAY 6 // micro sec + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 2 + // Middle speed + #define SERIAL_DELAY 12 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 3 + // Low speed + #define SERIAL_DELAY 24 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 4 + // Very Low speed + #define SERIAL_DELAY 36 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 5 + // Ultra Low speed + #define SERIAL_DELAY 48 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#else +#error invalid SELECT_SOFT_SERIAL_SPEED value +#endif /* SELECT_SOFT_SERIAL_SPEED */ +#endif /* SERIAL_DELAY */ + +#define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) +#define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) + +#define SLAVE_INT_WIDTH_US 1 +#ifndef SERIAL_USE_MULTI_TRANSACTION + #define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY +#else + #define SLAVE_INT_ACK_WIDTH_UNIT 2 + #define SLAVE_INT_ACK_WIDTH 4 +#endif + +static SSTD_t *Transaction_table = NULL; +static uint8_t Transaction_table_size = 0; + +inline static void serial_delay(void) ALWAYS_INLINE; +inline static +void serial_delay(void) { + _delay_us(SERIAL_DELAY); +} + +inline static void serial_delay_half1(void) ALWAYS_INLINE; +inline static +void serial_delay_half1(void) { + _delay_us(SERIAL_DELAY_HALF1); +} + +inline static void serial_delay_half2(void) ALWAYS_INLINE; +inline static +void serial_delay_half2(void) { + _delay_us(SERIAL_DELAY_HALF2); +} + +inline static void serial_output(void) ALWAYS_INLINE; +inline static +void serial_output(void) { + SERIAL_PIN_DDR |= SERIAL_PIN_MASK; +} + +// make the serial pin an input with pull-up resistor +inline static void serial_input_with_pullup(void) ALWAYS_INLINE; +inline static +void serial_input_with_pullup(void) { + SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +inline static uint8_t serial_read_pin(void) ALWAYS_INLINE; +inline static +uint8_t serial_read_pin(void) { + return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); +} + +inline static void serial_low(void) ALWAYS_INLINE; +inline static +void serial_low(void) { + SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; +} + +inline static void serial_high(void) ALWAYS_INLINE; +inline static +void serial_high(void) { + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size) +{ + Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; + serial_output(); + serial_high(); +} + +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size) +{ + Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; + serial_input_with_pullup(); + + // Enable INT0-INT3,INT6 + EIMSK |= EIMSK_BIT; +#if SERIAL_PIN_MASK == _BV(PE6) + // Trigger on falling edge of INT6 + EICRB &= EICRx_BIT; +#else + // Trigger on falling edge of INT0-INT3 + EICRA &= EICRx_BIT; +#endif +} + +// Used by the sender to synchronize timing with the reciver. +static void sync_recv(void) NO_INLINE; +static +void sync_recv(void) { + for (uint8_t i = 0; i < SERIAL_DELAY*5 && serial_read_pin(); i++ ) { + } + // This shouldn't hang if the target disconnects because the + // serial line will float to high if the target does disconnect. + while (!serial_read_pin()); +} + +// Used by the reciver to send a synchronization signal to the sender. +static void sync_send(void) NO_INLINE; +static +void sync_send(void) { + serial_low(); + serial_delay(); + serial_high(); +} + +// Reads a byte from the serial line +static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) NO_INLINE; +static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) { + uint8_t byte, i, p, pb; + + _delay_sub_us(READ_WRITE_START_ADJUST); + for( i = 0, byte = 0, p = PARITY; i < bit; i++ ) { + serial_delay_half1(); // read the middle of pulses + if( serial_read_pin() ) { + byte = (byte << 1) | 1; p ^= 1; + } else { + byte = (byte << 1) | 0; p ^= 0; + } + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); + } + /* recive parity bit */ + serial_delay_half1(); // read the middle of pulses + pb = serial_read_pin(); + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); + + *pterrcount += (p != pb)? 1 : 0; + + return byte; +} + +// Sends a byte with MSB ordering +void serial_write_chunk(uint8_t data, uint8_t bit) NO_INLINE; +void serial_write_chunk(uint8_t data, uint8_t bit) { + uint8_t b, p; + for( p = PARITY, b = 1<<(bit-1); b ; b >>= 1) { + if(data & b) { + serial_high(); p ^= 1; + } else { + serial_low(); p ^= 0; + } + serial_delay(); + } + /* send parity bit */ + if(p & 1) { serial_high(); } + else { serial_low(); } + serial_delay(); + + serial_low(); // sync_send() / senc_recv() need raise edge +} + +static void serial_send_packet(uint8_t *buffer, uint8_t size) NO_INLINE; +static +void serial_send_packet(uint8_t *buffer, uint8_t size) { + for (uint8_t i = 0; i < size; ++i) { + uint8_t data; + data = buffer[i]; + sync_send(); + serial_write_chunk(data,8); + } +} + +static uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) NO_INLINE; +static +uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) { + uint8_t pecount = 0; + for (uint8_t i = 0; i < size; ++i) { + uint8_t data; + sync_recv(); + data = serial_read_chunk(&pecount, 8); + buffer[i] = data; + } + return pecount == 0; +} + +inline static +void change_sender2reciver(void) { + sync_send(); //0 + serial_delay_half1(); //1 + serial_low(); //2 + serial_input_with_pullup(); //2 + serial_delay_half1(); //3 +} + +inline static +void change_reciver2sender(void) { + sync_recv(); //0 + serial_delay(); //1 + serial_low(); //3 + serial_output(); //3 + serial_delay_half1(); //4 +} + +static inline uint8_t nibble_bits_count(uint8_t bits) +{ + bits = (bits & 0x5) + (bits >> 1 & 0x5); + bits = (bits & 0x3) + (bits >> 2 & 0x3); + return bits; +} + +// interrupt handle to be used by the target device +ISR(SERIAL_PIN_INTERRUPT) { + +#ifndef SERIAL_USE_MULTI_TRANSACTION + serial_low(); + serial_output(); + SSTD_t *trans = Transaction_table; +#else + // recive transaction table index + uint8_t tid, bits; + uint8_t pecount = 0; + sync_recv(); + bits = serial_read_chunk(&pecount,7); + tid = bits>>3; + bits = (bits&7) != nibble_bits_count(tid); + if( bits || pecount> 0 || tid > Transaction_table_size ) { + return; + } + serial_delay_half1(); + + serial_high(); // response step1 low->high + serial_output(); + _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT*SLAVE_INT_ACK_WIDTH); + SSTD_t *trans = &Transaction_table[tid]; + serial_low(); // response step2 ack high->low +#endif + + // target send phase + if( trans->target2initiator_buffer_size > 0 ) + serial_send_packet((uint8_t *)trans->target2initiator_buffer, + trans->target2initiator_buffer_size); + // target switch to input + change_sender2reciver(); + + // target recive phase + if( trans->initiator2target_buffer_size > 0 ) { + if (serial_recive_packet((uint8_t *)trans->initiator2target_buffer, + trans->initiator2target_buffer_size) ) { + *trans->status = TRANSACTION_ACCEPTED; + } else { + *trans->status = TRANSACTION_DATA_ERROR; + } + } else { + *trans->status = TRANSACTION_ACCEPTED; + } + + sync_recv(); //weit initiator output to high +} + +///////// +// start transaction by initiator +// +// int soft_serial_transaction(int sstd_index) +// +// Returns: +// TRANSACTION_END +// TRANSACTION_NO_RESPONSE +// TRANSACTION_DATA_ERROR +// this code is very time dependent, so we need to disable interrupts +#ifndef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_transaction(void) { + SSTD_t *trans = Transaction_table; +#else +int soft_serial_transaction(int sstd_index) { + if( sstd_index > Transaction_table_size ) + return TRANSACTION_TYPE_ERROR; + SSTD_t *trans = &Transaction_table[sstd_index]; +#endif + cli(); + + // signal to the target that we want to start a transaction + serial_output(); + serial_low(); + _delay_us(SLAVE_INT_WIDTH_US); + +#ifndef SERIAL_USE_MULTI_TRANSACTION + // wait for the target response + serial_input_with_pullup(); + _delay_us(SLAVE_INT_RESPONSE_TIME); + + // check if the target is present + if (serial_read_pin()) { + // target failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; + sei(); + return TRANSACTION_NO_RESPONSE; + } + +#else + // send transaction table index + int tid = (sstd_index<<3) | (7 & nibble_bits_count(sstd_index)); + sync_send(); + _delay_sub_us(TID_SEND_ADJUST); + serial_write_chunk(tid, 7); + serial_delay_half1(); + + // wait for the target response (step1 low->high) + serial_input_with_pullup(); + while( !serial_read_pin() ) { + _delay_sub_us(2); + } + + // check if the target is present (step2 high->low) + for( int i = 0; serial_read_pin(); i++ ) { + if (i > SLAVE_INT_ACK_WIDTH + 1) { + // slave failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; + sei(); + return TRANSACTION_NO_RESPONSE; + } + _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT); + } +#endif + + // initiator recive phase + // if the target is present syncronize with it + if( trans->target2initiator_buffer_size > 0 ) { + if (!serial_recive_packet((uint8_t *)trans->target2initiator_buffer, + trans->target2initiator_buffer_size) ) { + serial_output(); + serial_high(); + *trans->status = TRANSACTION_DATA_ERROR; + sei(); + return TRANSACTION_DATA_ERROR; + } + } + + // initiator switch to output + change_reciver2sender(); + + // initiator send phase + if( trans->initiator2target_buffer_size > 0 ) { + serial_send_packet((uint8_t *)trans->initiator2target_buffer, + trans->initiator2target_buffer_size); + } + + // always, release the line when not in use + sync_send(); + + *trans->status = TRANSACTION_END; + sei(); + return TRANSACTION_END; +} + +#ifdef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_get_and_clean_status(int sstd_index) { + SSTD_t *trans = &Transaction_table[sstd_index]; + cli(); + int retval = *trans->status; + *trans->status = 0;; + sei(); + return retval; +} +#endif + +#endif + +// Helix serial.c history +// 2018-1-29 fork from let's split and add PD2, modify sync_recv() (#2308, bceffdefc) +// 2018-6-28 bug fix master to slave comm and speed up (#3255, 1038bbef4) +// (adjusted with avr-gcc 4.9.2) +// 2018-7-13 remove USE_SERIAL_PD2 macro (#3374, f30d6dd78) +// (adjusted with avr-gcc 4.9.2) +// 2018-8-11 add support multi-type transaction (#3608, feb5e4aae) +// (adjusted with avr-gcc 4.9.2) +// 2018-10-21 fix serial and RGB animation conflict (#4191, 4665e4fff) +// (adjusted with avr-gcc 7.3.0) +// 2018-10-28 re-adjust compiler depend value of delay (#4269, 8517f8a66) +// (adjusted with avr-gcc 5.4.0, 7.3.0) diff --git a/keyboards/treadstone48/serial.h b/keyboards/treadstone48/serial.h new file mode 100644 index 0000000000..5deaf789e3 --- /dev/null +++ b/keyboards/treadstone48/serial.h @@ -0,0 +1,86 @@ +#pragma once + +#include <stdbool.h> + +// ///////////////////////////////////////////////////////////////// +// Need Soft Serial defines in config.h +// ///////////////////////////////////////////////////////////////// +// ex. +// #define SOFT_SERIAL_PIN ?? // ?? = D0,D1,D2,D3,E6 +// OPTIONAL: #define SELECT_SOFT_SERIAL_SPEED ? // ? = 1,2,3,4,5 +// // 1: about 137kbps (default) +// // 2: about 75kbps +// // 3: about 39kbps +// // 4: about 26kbps +// // 5: about 20kbps +// +// //// USE OLD API (compatible with let's split serial.c) +// ex. +// #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +// #define SERIAL_MASTER_BUFFER_LENGTH 1 +// +// //// USE NEW API +// //// USE simple API (using signle-type transaction function) +// #define SERIAL_USE_SINGLE_TRANSACTION +// //// USE flexible API (using multi-type transaction function) +// #define SERIAL_USE_MULTI_TRANSACTION +// +// ///////////////////////////////////////////////////////////////// + + +//////////////// for backward compatibility //////////////////////////////// +#if !defined(SERIAL_USE_SINGLE_TRANSACTION) && !defined(SERIAL_USE_MULTI_TRANSACTION) +/* --- USE OLD API (compatible with let's split serial.c) */ + #if SERIAL_SLAVE_BUFFER_LENGTH > 0 + extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; + #endif + #if SERIAL_MASTER_BUFFER_LENGTH > 0 + extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; + #endif + + void serial_master_init(void); + void serial_slave_init(void); + int serial_update_buffers(void); + +#endif // end of USE OLD API +//////////////////////////////////////////////////////////////////////////// + +// Soft Serial Transaction Descriptor +typedef struct _SSTD_t { + uint8_t *status; + uint8_t initiator2target_buffer_size; + uint8_t *initiator2target_buffer; + uint8_t target2initiator_buffer_size; + uint8_t *target2initiator_buffer; +} SSTD_t; +#define TID_LIMIT( table ) (sizeof(table) / sizeof(SSTD_t)) + +// initiator is transaction start side +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size); +// target is interrupt accept side +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size); + +// initiator resullt +#define TRANSACTION_END 0 +#define TRANSACTION_NO_RESPONSE 0x1 +#define TRANSACTION_DATA_ERROR 0x2 +#define TRANSACTION_TYPE_ERROR 0x4 +#ifndef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_transaction(void); +#else +int soft_serial_transaction(int sstd_index); +#endif + +// target status +// *SSTD_t.status has +// initiator: +// TRANSACTION_END +// or TRANSACTION_NO_RESPONSE +// or TRANSACTION_DATA_ERROR +// target: +// TRANSACTION_DATA_ERROR +// or TRANSACTION_ACCEPTED +#define TRANSACTION_ACCEPTED 0x8 +#ifdef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_get_and_clean_status(int sstd_index); +#endif diff --git a/keyboards/treadstone48/ssd1306.c b/keyboards/treadstone48/ssd1306.c new file mode 100644 index 0000000000..dd3290ba0c --- /dev/null +++ b/keyboards/treadstone48/ssd1306.c @@ -0,0 +1,342 @@ + +#ifdef SSD1306OLED + +#include "ssd1306.h" +#include "i2c.h" +#include <string.h> +#include "print.h" +#ifndef LOCAL_GLCDFONT +#include "common/glcdfont.c" +#else +#include <helixfont.h> +#endif +#ifdef ADAFRUIT_BLE_ENABLE +#include "adafruit_ble.h" +#endif +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#endif +#include "sendchar.h" +#include "timer.h" + +// Set this to 1 to help diagnose early startup problems +// when testing power-on with ble. Turn it off otherwise, +// as the latency of printing most of the debug info messes +// with the matrix scan, causing keys to drop. +#define DEBUG_TO_SCREEN 0 + +//static uint16_t last_battery_update; +//static uint32_t vbat; +//#define BatteryUpdateInterval 10000 /* milliseconds */ + +// 'last_flush' is declared as uint16_t, +// so this must be less than 65535 +#define ScreenOffInterval 60000 /* milliseconds */ +#if DEBUG_TO_SCREEN +static uint8_t displaying; +#endif +static uint16_t last_flush; + +static bool force_dirty = true; + +// Write command sequence. +// Returns true on success. +static inline bool _send_cmd1(uint8_t cmd) { + bool res = false; + + if (i2c_start_write(SSD1306_ADDRESS)) { + xprintf("failed to start write to %d\n", SSD1306_ADDRESS); + goto done; + } + + if (i2c_master_write(0x0 /* command byte follows */)) { + print("failed to write control byte\n"); + + goto done; + } + + if (i2c_master_write(cmd)) { + xprintf("failed to write command %d\n", cmd); + goto done; + } + res = true; +done: + i2c_master_stop(); + return res; +} + +// Write 2-byte command sequence. +// Returns true on success +static inline bool _send_cmd2(uint8_t cmd, uint8_t opr) { + if (!_send_cmd1(cmd)) { + return false; + } + return _send_cmd1(opr); +} + +// Write 3-byte command sequence. +// Returns true on success +static inline bool _send_cmd3(uint8_t cmd, uint8_t opr1, uint8_t opr2) { + if (!_send_cmd1(cmd)) { + return false; + } + if (!_send_cmd1(opr1)) { + return false; + } + return _send_cmd1(opr2); +} + +#define send_cmd1(c) if (!_send_cmd1(c)) {goto done;} +#define send_cmd2(c,o) if (!_send_cmd2(c,o)) {goto done;} +#define send_cmd3(c,o1,o2) if (!_send_cmd3(c,o1,o2)) {goto done;} + +static void clear_display(void) { + matrix_clear(&display); + + // Clear all of the display bits (there can be random noise + // in the RAM on startup) + send_cmd3(PageAddr, 0, (DisplayHeight / 8) - 1); + send_cmd3(ColumnAddr, 0, DisplayWidth - 1); + + if (i2c_start_write(SSD1306_ADDRESS)) { + goto done; + } + if (i2c_master_write(0x40)) { + // Data mode + goto done; + } + for (uint8_t row = 0; row < MatrixRows; ++row) { + for (uint8_t col = 0; col < DisplayWidth; ++col) { + i2c_master_write(0); + } + } + + display.dirty = false; + +done: + i2c_master_stop(); +} + +#if DEBUG_TO_SCREEN +#undef sendchar +static int8_t capture_sendchar(uint8_t c) { + sendchar(c); + iota_gfx_write_char(c); + + if (!displaying) { + iota_gfx_flush(); + } + return 0; +} +#endif + +bool iota_gfx_init(bool rotate) { + bool success = false; + + i2c_master_init(); + send_cmd1(DisplayOff); + send_cmd2(SetDisplayClockDiv, 0x80); + send_cmd2(SetMultiPlex, DisplayHeight - 1); + + send_cmd2(SetDisplayOffset, 0); + + + send_cmd1(SetStartLine | 0x0); + send_cmd2(SetChargePump, 0x14 /* Enable */); + send_cmd2(SetMemoryMode, 0 /* horizontal addressing */); + + if(rotate){ + // the following Flip the display orientation 180 degrees + send_cmd1(SegRemap); + send_cmd1(ComScanInc); + }else{ + // Flips the display orientation 0 degrees + send_cmd1(SegRemap | 0x1); + send_cmd1(ComScanDec); + } + + send_cmd2(SetComPins, 0x2); + send_cmd2(SetContrast, 0x8f); + send_cmd2(SetPreCharge, 0xf1); + send_cmd2(SetVComDetect, 0x40); + send_cmd1(DisplayAllOnResume); + send_cmd1(NormalDisplay); + send_cmd1(DeActivateScroll); + send_cmd1(DisplayOn); + + send_cmd2(SetContrast, 0); // Dim + + clear_display(); + + success = true; + + iota_gfx_flush(); + +#if DEBUG_TO_SCREEN + print_set_sendchar(capture_sendchar); +#endif + +done: + return success; +} + +bool iota_gfx_off(void) { + bool success = false; + + send_cmd1(DisplayOff); + success = true; + +done: + return success; +} + +bool iota_gfx_on(void) { + bool success = false; + + send_cmd1(DisplayOn); + success = true; + +done: + return success; +} + +void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c) { + *matrix->cursor = c; + ++matrix->cursor; + + if (matrix->cursor - &matrix->display[0][0] == sizeof(matrix->display)) { + // We went off the end; scroll the display upwards by one line + memmove(&matrix->display[0], &matrix->display[1], + MatrixCols * (MatrixRows - 1)); + matrix->cursor = &matrix->display[MatrixRows - 1][0]; + memset(matrix->cursor, ' ', MatrixCols); + } +} + +void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c) { + matrix->dirty = true; + + if (c == '\n') { + // Clear to end of line from the cursor and then move to the + // start of the next line + uint8_t cursor_col = (matrix->cursor - &matrix->display[0][0]) % MatrixCols; + + while (cursor_col++ < MatrixCols) { + matrix_write_char_inner(matrix, ' '); + } + return; + } + + matrix_write_char_inner(matrix, c); +} + +void iota_gfx_write_char(uint8_t c) { + matrix_write_char(&display, c); +} + +void matrix_write(struct CharacterMatrix *matrix, const char *data) { + const char *end = data + strlen(data); + while (data < end) { + matrix_write_char(matrix, *data); + ++data; + } +} + +void iota_gfx_write(const char *data) { + matrix_write(&display, data); +} + +void matrix_write_P(struct CharacterMatrix *matrix, const char *data) { + while (true) { + uint8_t c = pgm_read_byte(data); + if (c == 0) { + return; + } + matrix_write_char(matrix, c); + ++data; + } +} + +void iota_gfx_write_P(const char *data) { + matrix_write_P(&display, data); +} + +void matrix_clear(struct CharacterMatrix *matrix) { + memset(matrix->display, ' ', sizeof(matrix->display)); + matrix->cursor = &matrix->display[0][0]; + matrix->dirty = true; +} + +void iota_gfx_clear_screen(void) { + matrix_clear(&display); +} + +void matrix_render(struct CharacterMatrix *matrix) { + last_flush = timer_read(); + iota_gfx_on(); +#if DEBUG_TO_SCREEN + ++displaying; +#endif + + // Move to the home position + send_cmd3(PageAddr, 0, MatrixRows - 1); + send_cmd3(ColumnAddr, 0, (MatrixCols * FontWidth) - 1); + + if (i2c_start_write(SSD1306_ADDRESS)) { + goto done; + } + if (i2c_master_write(0x40)) { + // Data mode + goto done; + } + + for (uint8_t row = 0; row < MatrixRows; ++row) { + for (uint8_t col = 0; col < MatrixCols; ++col) { + const uint8_t *glyph = font + (matrix->display[row][col] * FontWidth); + + for (uint8_t glyphCol = 0; glyphCol < FontWidth; ++glyphCol) { + uint8_t colBits = pgm_read_byte(glyph + glyphCol); + i2c_master_write(colBits); + } + + // 1 column of space between chars (it's not included in the glyph) + //i2c_master_write(0); + } + } + + matrix->dirty = false; + +done: + i2c_master_stop(); +#if DEBUG_TO_SCREEN + --displaying; +#endif +} + +void iota_gfx_flush(void) { + matrix_render(&display); +} + +__attribute__ ((weak)) +void iota_gfx_task_user(void) { +} + +void iota_gfx_task(void) { + iota_gfx_task_user(); + + if (display.dirty|| force_dirty) { + iota_gfx_flush(); + force_dirty = false; + } + + if (timer_elapsed(last_flush) > ScreenOffInterval) { + iota_gfx_off(); + } +} + +bool process_record_gfx(uint16_t keycode, keyrecord_t *record) { + force_dirty = true; + return true; +} + +#endif diff --git a/keyboards/treadstone48/ssd1306.h b/keyboards/treadstone48/ssd1306.h new file mode 100644 index 0000000000..49f258efa9 --- /dev/null +++ b/keyboards/treadstone48/ssd1306.h @@ -0,0 +1,90 @@ +#pragma once + +#include <stdbool.h> +#include <stdio.h> +#include "pincontrol.h" +#include "action.h" + +enum ssd1306_cmds { + DisplayOff = 0xAE, + DisplayOn = 0xAF, + + SetContrast = 0x81, + DisplayAllOnResume = 0xA4, + + DisplayAllOn = 0xA5, + NormalDisplay = 0xA6, + InvertDisplay = 0xA7, + SetDisplayOffset = 0xD3, + SetComPins = 0xda, + SetVComDetect = 0xdb, + SetDisplayClockDiv = 0xD5, + SetPreCharge = 0xd9, + SetMultiPlex = 0xa8, + SetLowColumn = 0x00, + SetHighColumn = 0x10, + SetStartLine = 0x40, + + SetMemoryMode = 0x20, + ColumnAddr = 0x21, + PageAddr = 0x22, + + ComScanInc = 0xc0, + ComScanDec = 0xc8, + SegRemap = 0xa0, + SetChargePump = 0x8d, + ExternalVcc = 0x01, + SwitchCapVcc = 0x02, + + ActivateScroll = 0x2f, + DeActivateScroll = 0x2e, + SetVerticalScrollArea = 0xa3, + RightHorizontalScroll = 0x26, + LeftHorizontalScroll = 0x27, + VerticalAndRightHorizontalScroll = 0x29, + VerticalAndLeftHorizontalScroll = 0x2a, +}; + +// Controls the SSD1306 128x32 OLED display via i2c + +#ifndef SSD1306_ADDRESS +#define SSD1306_ADDRESS 0x3C +#endif + +#define DisplayHeight 32 +#define DisplayWidth 128 + +#define FontHeight 8 +#define FontWidth 6 + +#define MatrixRows (DisplayHeight / FontHeight) +#define MatrixCols (DisplayWidth / FontWidth) + +struct CharacterMatrix { + uint8_t display[MatrixRows][MatrixCols]; + uint8_t *cursor; + bool dirty; +}; + +struct CharacterMatrix display; + +bool iota_gfx_init(bool rotate); +void iota_gfx_task(void); +bool iota_gfx_off(void); +bool iota_gfx_on(void); +void iota_gfx_flush(void); +void iota_gfx_write_char(uint8_t c); +void iota_gfx_write(const char *data); +void iota_gfx_write_P(const char *data); +void iota_gfx_clear_screen(void); + +void iota_gfx_task_user(void); + +void matrix_clear(struct CharacterMatrix *matrix); +void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c); +void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c); +void matrix_write(struct CharacterMatrix *matrix, const char *data); +void matrix_write_P(struct CharacterMatrix *matrix, const char *data); +void matrix_render(struct CharacterMatrix *matrix); + +bool process_record_gfx(uint16_t keycode, keyrecord_t *record); diff --git a/keyboards/treadstone48/treadstone48.c b/keyboards/treadstone48/treadstone48.c new file mode 100644 index 0000000000..faadb26906 --- /dev/null +++ b/keyboards/treadstone48/treadstone48.c @@ -0,0 +1 @@ +#include "treadstone48.h" diff --git a/keyboards/treadstone48/treadstone48.h b/keyboards/treadstone48/treadstone48.h new file mode 100644 index 0000000000..3123d1de53 --- /dev/null +++ b/keyboards/treadstone48/treadstone48.h @@ -0,0 +1,15 @@ +#pragma once + +#ifdef KEYBOARD_treadstone48_rev1 + #include "rev1.h" +#endif + +#include "quantum.h" + +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#include "split_util.h" +#endif +#ifdef SSD1306OLED + #include "ssd1306.h" +#endif diff --git a/keyboards/v60_type_r/config.h b/keyboards/v60_type_r/config.h index 703745d564..e3e00a9f80 100644 --- a/keyboards/v60_type_r/config.h +++ b/keyboards/v60_type_r/config.h @@ -1,5 +1,5 @@ /* -Copyright 2017 REPLACE_WITH_YOUR_NAME +Copyright 2017 benlyall, MechMerlin 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 @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -190,5 +189,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 - -#endif diff --git a/keyboards/v60_type_r/keymaps/default/config.h b/keyboards/v60_type_r/keymaps/default/config.h index 9561b0255f..744bea207b 100644 --- a/keyboards/v60_type_r/keymaps/default/config.h +++ b/keyboards/v60_type_r/keymaps/default/config.h @@ -1,4 +1,4 @@ -/* Copyright 2017 REPLACE_WITH_YOUR_NAME +/* Copyright 2017 benlyall, MechMerlin * * 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 @@ -13,14 +13,11 @@ * 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 -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +// place overrides here -#include "../../config.h" #ifdef V60_POLESTAR #undef V60_POLESTAR #endif - -#endif diff --git a/keyboards/v60_type_r/keymaps/default/keymap.c b/keyboards/v60_type_r/keymaps/default/keymap.c index 77546c0a65..831def0789 100644 --- a/keyboards/v60_type_r/keymaps/default/keymap.c +++ b/keyboards/v60_type_r/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -/* Copyright 2017 REPLACE_WITH_YOUR_NAME +/* Copyright 2017 benlyall, MechMerlin * * 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 diff --git a/keyboards/v60_type_r/keymaps/default/readme.md b/keyboards/v60_type_r/keymaps/default/readme.md index 57ac901ada..9b3c6f0643 100644 --- a/keyboards/v60_type_r/keymaps/default/readme.md +++ b/keyboards/v60_type_r/keymaps/default/readme.md @@ -1,5 +1,4 @@ -KB Paradise V60 Type R Default Layout -====================== +# KB Paradise V60 Type R Default Layout This is the default layout as defined by the KBP V60 Type R manual/keycaps @@ -9,4 +8,4 @@ This is the default layout as defined by the KBP V60 Type R manual/keycaps ### Build -To build this keymap, simply run `make KEYMAP=default`.
\ No newline at end of file +To build this keymap, simply run `make v60_type_r:default`. diff --git a/keyboards/v60_type_r/keymaps/default/rules.mk b/keyboards/v60_type_r/keymaps/default/rules.mk new file mode 100644 index 0000000000..b6c9a25805 --- /dev/null +++ b/keyboards/v60_type_r/keymaps/default/rules.mk @@ -0,0 +1,2 @@ +BACKLIGHT_ENABLE = no +RGBLIGHT_ENABLE = no diff --git a/keyboards/v60_type_r/keymaps/vimouse/config.h b/keyboards/v60_type_r/keymaps/vimouse/config.h index 3937420d00..285cb4fa23 100644 --- a/keyboards/v60_type_r/keymaps/vimouse/config.h +++ b/keyboards/v60_type_r/keymaps/vimouse/config.h @@ -1,4 +1,4 @@ -/* Copyright 2017 REPLACE_WITH_YOUR_NAME +/* Copyright 2017 benlyall, MechMerlin * * 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 @@ -14,10 +14,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once #define V60_POLESTAR @@ -27,5 +24,3 @@ #define MOUSEKEY_TIME_TO_MAX 60 #define MOUSEKEY_MAX_SPEED 7 #define MOUSEKEY_WHEEL_DELAY 0 - -#endif diff --git a/keyboards/v60_type_r/keymaps/vimouse/keymap.c b/keyboards/v60_type_r/keymaps/vimouse/keymap.c index 2586683127..8b0019e7ba 100644 --- a/keyboards/v60_type_r/keymaps/vimouse/keymap.c +++ b/keyboards/v60_type_r/keymaps/vimouse/keymap.c @@ -1,4 +1,4 @@ -/* Copyright 2017 REPLACE_WITH_YOUR_NAME +/* Copyright 2017 benlyall, MechMerlin * * 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 diff --git a/keyboards/v60_type_r/readme.md b/keyboards/v60_type_r/readme.md index 06ff749b86..76cb5f39fc 100644 --- a/keyboards/v60_type_r/readme.md +++ b/keyboards/v60_type_r/readme.md @@ -13,17 +13,6 @@ Please note that other variants of the KBP V60 are not fully programmable. Backlight and RGB Underglow are both supported. -To use the backlight and/or RGB underglow: -* Create a new keymap -* Create a rules.mk file in the keymap -* Add RGBLIGHT_ENABLE = yes and/or BACKLIGHT_ENABLE = yes to the rules.mk -* Setup your keymap to your preference. Use [the `vimouse` keymap](keymaps/vimouse/keymap.c) as a starting point -* Some extra keys are defined to allow you to set the red, green and blue values of the underglow directly, rather than using the HSV spectrum. These are RGB_RI, RGB_RD, RGB_GI, RGB_GD, RGB_BI, RGB_BD for increase and decrease of the red, green and blue channels respectively. - -The provided `default` keymap pretty closely matches the default V60 Type R keymap, minus the backlight and underglow control keys. The `vimouse` keymap is completely customised and makes use of many of the possibilities, including mouse keys, backlighting, RGB underglow, etc. - -Note for those customising: The configuration used in the `vimouse` keymap results in about 93% of the available flash being utilised. Keep that in mind if you're adding functionality. - Note: By default the V60 Type R uses TMK. You should know what you're doing and none of this is guaranteed to work. If you want to stick with the TMK default, then the KB Paradise preferred way of creating the hex file is by using https://tkg.io/, selecting Fantastic60 and then defining your keymap. You will then have to use tkg-toolkit to finish the flashing @@ -40,7 +29,4 @@ or make v60_type_r:vimouse -See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. - - - +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/v60_type_r/rules.mk b/keyboards/v60_type_r/rules.mk index 7a1340a1ac..54a20a7815 100644 --- a/keyboards/v60_type_r/rules.mk +++ b/keyboards/v60_type_r/rules.mk @@ -52,21 +52,21 @@ BOOTLOADER = atmel-dfu # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE ?= no # USB Nkey Rollover -BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default -RGBLIGHT_ENABLE ?= no # Enable the RGB Underglow -MIDI_ENABLE ?= no # MIDI support (+2400 to 4200, depending on config) -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE ?= no # Audio output on port C6 -FAUXCLICKY_ENABLE ?= no # Use buzzer to emulate clicky switches +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable the RGB Underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches LAYOUTS = 60_ansi diff --git a/keyboards/v60_type_r/v60_type_r.c b/keyboards/v60_type_r/v60_type_r.c index 86d87e12da..41eb75807d 100644 --- a/keyboards/v60_type_r/v60_type_r.c +++ b/keyboards/v60_type_r/v60_type_r.c @@ -1,4 +1,4 @@ -/* Copyright 2017 REPLACE_WITH_YOUR_NAME +/* Copyright 2017 benlyall, MechMerlin * * 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 diff --git a/keyboards/v60_type_r/v60_type_r.h b/keyboards/v60_type_r/v60_type_r.h index 3d7aef7eaf..25097ed48e 100644 --- a/keyboards/v60_type_r/v60_type_r.h +++ b/keyboards/v60_type_r/v60_type_r.h @@ -1,4 +1,4 @@ -/* Copyright 2017 REPLACE_WITH_YOUR_NAME +/* Copyright 2017 benlyall, MechMerlin * * 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 @@ -13,8 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef V60_TYPE_R_H -#define V60_TYPE_R_H +#pragma once #include "quantum.h" @@ -106,4 +105,3 @@ enum my_keycodes { { k40, k41, k42, k43, k44, k45, k46, k47 } \ } -#endif diff --git a/keyboards/vision_division/keymaps/default/config.h b/keyboards/vision_division/keymaps/default/config.h index efd43f41b4..694ab6a696 100644 --- a/keyboards/vision_division/keymaps/default/config.h +++ b/keyboards/vision_division/keymaps/default/config.h @@ -1,7 +1,7 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once + +// place overrides here -#include "../../config.h" #include "matrix_types.h" /* USB Device descriptor parameter */ @@ -77,5 +77,3 @@ KEYMAP_MASTER(MATRIX_LAYER, NUMERIC_NORMAL, HOMING k601, k602, k603, k604, k605, k606, k607, k608, k609, k60A, KC_NO, KC_NO, k611, k612, k613, k614, k615, k616, k617, k618, k619, k61A, k61B, KC_NO \ ) */ - -#endif
\ No newline at end of file diff --git a/keyboards/vision_division/keymaps/default/keymap.c b/keyboards/vision_division/keymaps/default/keymap.c index af60a8bd7f..18fb7c16d7 100644 --- a/keyboards/vision_division/keymaps/default/keymap.c +++ b/keyboards/vision_division/keymaps/default/keymap.c @@ -1,13 +1,6 @@ -#include "vision_division.h" -#include "action_layer.h" -#include "eeconfig.h" +#include QMK_KEYBOARD_H #include "led.h" -#ifdef AUDIO_ENABLE - #include "audio.h" - #include "song_list.h" -#endif - enum keyboard_layers { LAYER_QWERTY = 0, LAYER_UPPER, diff --git a/keyboards/westfoxtrot/cypher/config.h b/keyboards/westfoxtrot/cypher/config.h new file mode 100644 index 0000000000..48ff816f9b --- /dev/null +++ b/keyboards/westfoxtrot/cypher/config.h @@ -0,0 +1,66 @@ +/* +Copyright 2019 westfoxtrot + +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 0x21FF +#define PRODUCT_ID 0xAA97 +#define DEVICE_VER 0x0001 +#define MANUFACTURER westfoxtrot +#define PRODUCT cypher +#define DESCRIPTION Cypher + +/* key matrix size */ +#define MATRIX_ROWS 10 +#define MATRIX_COLS 10 + +/* + * 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 { B0, B1, B2, B3, B4, F6, B6, B7, C6, C7 } +#define MATRIX_COL_PINS { D0, D1, D2, D3, D4, D5, D6, D7, E6, F0 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B5 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 5 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* 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 + +/* 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 diff --git a/keyboards/westfoxtrot/cypher/cypher.c b/keyboards/westfoxtrot/cypher/cypher.c new file mode 100644 index 0000000000..d2407525ea --- /dev/null +++ b/keyboards/westfoxtrot/cypher/cypher.c @@ -0,0 +1,56 @@ +/* Copyright 2019 westfoxtrot + * + * 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 "cypher.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { + writePinHigh(F4); + } else { + writePinLow(F4); + } + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinHigh(F1); + } else { + writePinLow(F1); + } + if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { + writePinHigh(F5); + } else { + writePinLow(F5); + } + led_set_user(usb_led); +} diff --git a/keyboards/westfoxtrot/cypher/cypher.h b/keyboards/westfoxtrot/cypher/cypher.h new file mode 100644 index 0000000000..fdff12e9b1 --- /dev/null +++ b/keyboards/westfoxtrot/cypher/cypher.h @@ -0,0 +1,68 @@ +/* Copyright 2019 westfoxtrot + * + * 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 + +#define ___ KC_NO + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K50, K51, K52, K53, K54, K55, K56, K57, K58,\ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K60, K61, K62, K63, K65, K66, K67, K68, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K70, K71, K73, K75, K76, K77, K78, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K80, K81, K82, K83, K85, K86, K87, K88, \ + K40, K41, K42, K46, K49, K90, K91, K92, K93, K95, K96, K97, K98 \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09 }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19 }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29 }, \ + { K30, ___, K32, K33, K34, K35, K36, K37, K38, K39 }, \ + { K40, K41, K42, ___, ___, ___, K46, ___, ___, K49 }, \ + { K50, K51, K52, K53, K54, K55, K56, K57, K58 }, \ + { K60, K61, K62, K63, ___, K65, K66, K67, K68 }, \ + { K70, K71, ___, K73, ___, K75, K76, K77, K78 }, \ + { K80, K81, K82, K83, ___, K85, K86, K87, K88 }, \ + { K90, K91, K92, K93, ___, K95, K96, K97, K98 } \ +} + +#define LAYOUT_iso( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K50, K51, K52, K53, K54, K55, K56, K57, K58,\ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K60, K61, K62, K65, K66, K67, K68, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K70, K71, K72, K73, K75, K76, K77, K78, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K80, K81, K82, K83, K85, K86, K87, K88, \ + K40, K41, K42, K46, K49, K90, K91, K92, K93, K95, K96, K97, K98 \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09 }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19 }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29 }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39 }, \ + { K40, K41, K42, ___, ___, ___, K46, ___, ___, K49 }, \ + { K50, K51, K52, K53, K54, K55, K56, K57, K58 }, \ + { K60, K61, K62, ___, ___, K65, K66, K67, K68 }, \ + { K70, K71, K72, K73, ___, K75, K76, K77, K78 }, \ + { K80, K81, K82, K83, ___, K85, K86, K87, K88 }, \ + { K90, K91, K92, K93, ___, K95, K96, K97, K98 } \ +} diff --git a/keyboards/westfoxtrot/cypher/info.json b/keyboards/westfoxtrot/cypher/info.json new file mode 100644 index 0000000000..ab139aeafb --- /dev/null +++ b/keyboards/westfoxtrot/cypher/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Cypher", + "width": 19.5, + "height": 5, + "layouts": { + "LAYOUT_ansi": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Num Lock", "x":15.5, "y":0}, {"label":"/", "x":16.5, "y":0}, {"label":"*", "x":17.5, "y":0}, {"label":"-", "x":18.5, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"7", "x":15.5, "y":1}, {"label":"8", "x":16.5, "y":1}, {"label":"9", "x":17.5, "y":1}, {"label":"+", "x":18.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"4", "x":15.5, "y":2}, {"label":"5", "x":16.5, "y":2}, {"label":"6", "x":17.5, "y":2}, {"label":"=", "x":18.5, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Up", "x":14.25, "y":3.25}, {"label":"1", "x":15.5, "y":3}, {"label":"2", "x":16.5, "y":3}, {"label":"3", "x":17.5, "y":3}, {"label":"Enter", "x":18.5, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4}, {"label":"Alt", "x":2.25, "y":4, "w":1.25}, {"label":"Space", "x":3.5, "y":4, "w":6}, {"label":"Alt", "x":9.5, "y":4, "w":1.25}, {"label":"Win", "x":10.75, "y":4}, {"label":"Ctrl", "x":11.75, "y":4, "w":1.25}, {"label":"Left", "x":13.25, "y":4.25}, {"label":"Down", "x":14.25, "y":4.25}, {"label":"Right", "x":15.25, "y":4.25}, {"label":"0", "x":16.5, "y":4}, {"label":".", "x":17.5, "y":4}, {"label":"Backspace", "x":18.5, "y":4}] }, + + "LAYOUT_iso": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Num Lock", "x":15.5, "y":0}, {"label":"/", "x":16.5, "y":0}, {"label":"*", "x":17.5, "y":0}, {"label":"-", "x":18.5, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"7", "x":15.5, "y":1}, {"label":"8", "x":16.5, "y":1}, {"label":"9", "x":17.5, "y":1}, {"label":"+", "x":18.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"4", "x":15.5, "y":2}, {"label":"5", "x":16.5, "y":2}, {"label":"6", "x":17.5, "y":2}, {"label":"=", "x":18.5, "y":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Up", "x":14.25, "y":3.25}, {"label":"1", "x":15.5, "y":3}, {"label":"2", "x":16.5, "y":3}, {"label":"3", "x":17.5, "y":3}, {"label":"Enter", "x":18.5, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4}, {"label":"Alt", "x":2.25, "y":4, "w":1.25}, {"label":"Space", "x":3.5, "y":4, "w":6}, {"label":"Alt", "x":9.5, "y":4, "w":1.25}, {"label":"Win", "x":10.75, "y":4}, {"label":"Ctrl", "x":11.75, "y":4, "w":1.25}, {"label":"Left", "x":13.25, "y":4.25}, {"label":"Down", "x":14.25, "y":4.25}, {"label":"Right", "x":15.25, "y":4.25}, {"label":"0", "x":16.5, "y":4}, {"label":".", "x":17.5, "y":4}, {"label":"Backspace", "x":18.5, "y":4}] } + } +} diff --git a/keyboards/westfoxtrot/cypher/keymaps/default-iso/config.h b/keyboards/westfoxtrot/cypher/keymaps/default-iso/config.h new file mode 100644 index 0000000000..41d70907eb --- /dev/null +++ b/keyboards/westfoxtrot/cypher/keymaps/default-iso/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 westfoxtrot + * + * 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 + +// place overrides here diff --git a/keyboards/westfoxtrot/cypher/keymaps/default-iso/keymap.c b/keyboards/westfoxtrot/cypher/keymaps/default-iso/keymap.c new file mode 100644 index 0000000000..2a08ae853b --- /dev/null +++ b/keyboards/westfoxtrot/cypher/keymaps/default-iso/keymap.c @@ -0,0 +1,49 @@ +/* Copyright 2019 westfoxtrot + * + * 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 QMK_KEYBOARD_H + +#define _MA 0 +#define _F1 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_MA] = LAYOUT_iso( /* Base */ + KC_GESC, 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_DEL, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,\ + 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_P7, KC_P8, KC_P9, KC_PPLS,\ + 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_ENT, KC_P4, KC_P5, KC_P6, KC_PEQL,\ + 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_P1, KC_P2, KC_P3, KC_PENT,\ + KC_LCTRL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,MO(_F1), KC_LEFT,KC_DOWN,KC_RGHT, KC_P0, KC_PDOT, KC_BSPC), + +[_F1] = LAYOUT_iso( /* Function Layer */ + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______,\ + _______, BL_TOGG,BL_STEP,BL_ON,BL_OFF,BL_INC,BL_DEC,BL_BRTG,_______,_______,_______,_______, _______, _______, _______, _______, _______,\ + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, _______, _______, _______, _______,\ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, _______, _______, _______,\ + _______, _______,_______, _______, _______,_______,_______, _______,_______,_______, _______, _______, _______), + +}; + +void matrix_init_user(void) { + //user initialization +} + +void matrix_scan_user(void) { + //user matrix +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} diff --git a/keyboards/westfoxtrot/cypher/keymaps/default-iso/readme.md b/keyboards/westfoxtrot/cypher/keymaps/default-iso/readme.md new file mode 100644 index 0000000000..81a4a677fd --- /dev/null +++ b/keyboards/westfoxtrot/cypher/keymaps/default-iso/readme.md @@ -0,0 +1 @@ +# The default iso keymap for cypher diff --git a/keyboards/westfoxtrot/cypher/keymaps/default/config.h b/keyboards/westfoxtrot/cypher/keymaps/default/config.h new file mode 100644 index 0000000000..41d70907eb --- /dev/null +++ b/keyboards/westfoxtrot/cypher/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 westfoxtrot + * + * 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 + +// place overrides here diff --git a/keyboards/westfoxtrot/cypher/keymaps/default/keymap.c b/keyboards/westfoxtrot/cypher/keymaps/default/keymap.c new file mode 100644 index 0000000000..1906f93969 --- /dev/null +++ b/keyboards/westfoxtrot/cypher/keymaps/default/keymap.c @@ -0,0 +1,49 @@ +/* Copyright 2019 westfoxtrot + * + * 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 QMK_KEYBOARD_H + +#define _MA 0 +#define _F1 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_MA] = LAYOUT_ansi( /* Base */ + KC_GESC, 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_DEL, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,\ + 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_P7, KC_P8, KC_P9, KC_PPLS,\ + 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_P4, KC_P5, KC_P6, KC_PEQL,\ + 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_P1, KC_P2, KC_P3, KC_PENT,\ + KC_LCTRL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,MO(_F1), KC_LEFT,KC_DOWN,KC_RGHT, KC_P0, KC_PDOT, KC_BSPC), + +[_F1] = LAYOUT_ansi( /* Function Layer */ + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______,\ + _______, BL_TOGG,BL_STEP,BL_ON,BL_OFF,BL_INC,BL_DEC,BL_BRTG,_______,_______,_______,_______, _______, _______, _______, _______, _______, _______,\ + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, _______, _______,\ + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, _______, _______, _______,\ + _______, _______,_______, _______, _______,_______,_______, _______,_______,_______, _______, _______, _______), + +}; + +void matrix_init_user(void) { + //user initialization +} + +void matrix_scan_user(void) { + //user matrix +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} diff --git a/keyboards/westfoxtrot/cypher/keymaps/default/readme.md b/keyboards/westfoxtrot/cypher/keymaps/default/readme.md new file mode 100644 index 0000000000..05c3700266 --- /dev/null +++ b/keyboards/westfoxtrot/cypher/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for cypher
\ No newline at end of file diff --git a/keyboards/westfoxtrot/cypher/keymaps/kwer/config.h b/keyboards/westfoxtrot/cypher/keymaps/kwer/config.h new file mode 100644 index 0000000000..947e340c32 --- /dev/null +++ b/keyboards/westfoxtrot/cypher/keymaps/kwer/config.h @@ -0,0 +1,33 @@ +/* Copyright 2018 westfoxtrot + * + * 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 + +#define RGB_DI_PIN F7 +#ifdef RGB_DI_PIN + #define RGBLED_NUM 15 + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 15 + #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + #define RGBLIGHT_EFFECT_KNIGHT + #define RGBLIGHT_EFFECT_KNIGHT_LENGTH 5 + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + #endif + +// place overrides here diff --git a/keyboards/westfoxtrot/cypher/keymaps/kwer/keymap.c b/keyboards/westfoxtrot/cypher/keymaps/kwer/keymap.c new file mode 100644 index 0000000000..2d7bf2a5e2 --- /dev/null +++ b/keyboards/westfoxtrot/cypher/keymaps/kwer/keymap.c @@ -0,0 +1,79 @@ +/* Copyright 2018 westfoxtrot + * Copyright 2019 kwerdenker + * + * 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 QMK_KEYBOARD_H +#include "keymap_german.h" + +#define _DL 0 +#define _FN 1 +#define _LE 2 + +#define SPECIAL LT(_FN, DE_CIRC) //capslock layer switch + stargate key on tap + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_DL] = LAYOUT_iso ( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, DE_SS, DE_ACUT, KC_BSPC, _______, KC_NLCK, KC_PSCR,KC_PSLS,KC_PAST, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, DE_Z, KC_U, KC_I, KC_O, KC_P, DE_UE, DE_PLUS, KC_P7, KC_P8, KC_P9, KC_PMNS, + SPECIAL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, DE_OE, DE_AE, DE_HASH, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_LSFT, DE_LESS, DE_Y, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, DE_MINS, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, _______, KC_LALT, KC_SPC, _______, KC_RALT, TG(_LE), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_NO + ), + + [_FN] = LAYOUT_iso ( + DE_RING, 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_DEL, _______, _______, _______, _______, _______, + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, KC_LGUI, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_LE] = LAYOUT_iso ( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_RMOD,_______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUI, RGB_SAI, RGB_VAI, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_VAD, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +}; + + + +void matrix_init_user(void) { + //user initialization +} + +void matrix_scan_user(void) { + //user matrix +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + // Insert custom handling for CAPS_LOCK, NUM_LOCK, SCROLL_LOCK here + if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { + writePinHigh(F4); + writePinHigh(F1); + writePinHigh(F5); + } else { + writePinLow(F4); + writePinLow(F1); + writePinLow(F5); + } +} diff --git a/keyboards/westfoxtrot/cypher/keymaps/kwer/readme.md b/keyboards/westfoxtrot/cypher/keymaps/kwer/readme.md new file mode 100644 index 0000000000..c1a132e713 --- /dev/null +++ b/keyboards/westfoxtrot/cypher/keymaps/kwer/readme.md @@ -0,0 +1,39 @@ +# The kwer keymap and RGB MOD for cypher + +![](https://i.imgur.com/b7snIju.jpg) + +## Hardware +To make this mod, all you need a piece of WS2812b RGB strip (I used one with 144 LEDs per meter, so it's rather dense), some wiring (I used 0.6mm solid core wire) and steady hands for soldering to the MCU pin. + +**Installed mod** +![](https://i.imgur.com/IKcFd0k.jpg) + +As you can see, the wiring is relatively simple. VCC and GND can be easily accessed through the ISP header on the right side of the spacebar while the DATA line can be routed relatively easy through one of the stabilizer holes. While it isn't important where exactly you solder the VCC/GND wires to their respective lines on the strip, you have to keep the direction of the data line in mind. Most strip have arrows printed on them to show you in which direction the data is shifted through the LEDs and your should always solder your DATA line on the _from_ side, as seen in the above picture. + +**Close-up for the VCC/GND connections** +![](https://i.imgur.com/K0OibwW.jpg) + +Since there is no pinout availble for the pin we're gonna use to control the strip, the line has to be soldered to the MCU directly. While this is not a very complex process, you should have a fine tipped soldering irong and a steady hand. Make sure you do not bridge any of the neighboring pins when soldering the wire to the MCU pin. As shown in the picture below, you want to connect the DATA line to the third pin from the right on the top of the controller chip. + +**Close-up for the DATA connection** +![](https://i.imgur.com/zkD3RjF.jpg) + +## Software +To enable your RGB strip in QMK, you have to add change/add the following lines + +**rules.​mk** +``` +[...] +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +[...] +``` + +**config.h** +``` +[...] +#define RGB_DI_PIN F7 +#define RGBLED_NUM 15 // Change this number to the amount of LEDs on the strip you soldered +#define RGBLIGHT_ANIMATIONS +[...] +``` +To control the RGB color, animation, etc. you need to add the appropriate keycodes to your keymap. Either see [my keymap](./keymap.c) or the [official QMK documentation](https://docs.qmk.fm/#/feature_rgblight?id=keycodes) for references. diff --git a/keyboards/westfoxtrot/cypher/keymaps/kwer/rules.mk b/keyboards/westfoxtrot/cypher/keymaps/kwer/rules.mk new file mode 100644 index 0000000000..df87c59a23 --- /dev/null +++ b/keyboards/westfoxtrot/cypher/keymaps/kwer/rules.mk @@ -0,0 +1,2 @@ +# Build options override +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow diff --git a/keyboards/westfoxtrot/cypher/readme.md b/keyboards/westfoxtrot/cypher/readme.md new file mode 100644 index 0000000000..6db417fae8 --- /dev/null +++ b/keyboards/westfoxtrot/cypher/readme.md @@ -0,0 +1,15 @@ +# cypher + +![cypher](https://github.com/westfoxtrot/Cypher_PCB) + +PCB for the cypher keyboard + +Keyboard Maintainer: [westfoxtrot](https://github.com/westfoxtrot) +Hardware Supported: Cypher PCB +Hardware Availability: with group buy + Files released here (https://github.com/westfoxtrot/Cypher_PCB) + +Make example for this keyboard (after setting up your build environment): + + make westfoxtrot/cypher:default + +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/westfoxtrot/cypher/rules.mk b/keyboards/westfoxtrot/cypher/rules.mk new file mode 100644 index 0000000000..ab03dc9f9d --- /dev/null +++ b/keyboards/westfoxtrot/cypher/rules.mk @@ -0,0 +1,81 @@ +# MCU name +#MCU = at90usb1286 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/winkeyless/bface/program b/keyboards/winkeyless/bface/program deleted file mode 100755 index 298e645477..0000000000 --- a/keyboards/winkeyless/bface/program +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/env python -# Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>, Sebastian Kaim <sebb@sebb767.de> -# -# 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/>. - -from __future__ import print_function - -import os -import sys -import time -import usb - - -def checkForKeyboardInNormalMode(): - """Returns a device if a ps2avrGB device in normal made (that is in keyboard mode) or None if it is not found.""" - return usb.core.find(idVendor=0x20A0, idProduct=0x422D) - -def checkForKeyboardInBootloaderMode(): - """Returns True if a ps2avrGB device in bootloader (flashable) mode is found and False otherwise.""" - return (usb.core.find(idVendor=0x16c0, idProduct=0x05df) is not None) - -def flashKeyboard(firmware_file): - """Calls bootloadHID to flash the given file to the device.""" - print('Flashing firmware to device ...') - if os.system('bootloadHID -r "%s"' % firmware_file) == 0: - print('\nDone!') - else: - print('\nbootloadHID returned an error.') - -def printDeviceInfo(dev): - """Prints all infos for a given USB device""" - print('Device Information:') - print(' idVendor: %d (0x%04x)' % (dev.idVendor, dev.idVendor)) - print(' idProduct: %d (0x%04x)' % (dev.idProduct, dev.idProduct)) - print('Manufacturer: %s' % (dev.iManufacturer)) - print('Serial: %s' % (dev.iSerialNumber)) - print('Product: %s' % (dev.iProduct), end='\n\n') - -def sendDeviceToBootloaderMode(dev): - """Tries to send a given ps2avrGB keyboard to bootloader mode to allow flashing.""" - try: - dev.set_configuration() - - request_type = usb.util.build_request_type( - usb.util.CTRL_OUT, - usb.util.CTRL_TYPE_CLASS, - usb.util.CTRL_RECIPIENT_DEVICE) - - USBRQ_HID_SET_REPORT = 0x09 - HID_REPORT_OPTION = 0x0301 - - dev.ctrl_transfer(request_type, USBRQ_HID_SET_REPORT, HID_REPORT_OPTION, 0, [0, 0, 0xFF] + [0] * 5) - except usb.core.USBError: - # for some reason I keep getting USBError, but it works! - pass - - -if len(sys.argv) < 2: - print('Usage: %s <firmware.hex>' % sys.argv[0]) - sys.exit(1) - -kb = checkForKeyboardInNormalMode() - -if kb is not None: - print('Found a keyboad in normal mode. Attempting to send it to bootloader mode ...', end='') - sendDeviceToBootloaderMode(kb) - print(' done.') - print("Hint: If your keyboard can't be set to bootloader mode automatically, plug it in while pressing the bootloader key to do so manually.") - print(" You can find more infos about this here: https://github.com/qmk/qmk_firmware/tree/master/keyboards/ps2avrGB#setting-the-board-to-bootloader-mode") - -attempts = 12 # 60 seconds -found = False -for attempt in range(1, attempts + 1): - print("Searching for keyboard in bootloader mode (%i/%i) ... " % (attempt, attempts), end='') - - if checkForKeyboardInBootloaderMode(): - print('Found', end='\n\n') - flashKeyboard(sys.argv[1]) - found = True - break - else: - print('Nothing.', end='') - - if attempt != attempts: # no need to wait on the last attempt - print(' Sleeping 5 seconds.', end='') - time.sleep(5) - - # print a newline - print() - -if not found: - print("Couldn't find a flashable keyboard. Aborting.") - sys.exit(2) - diff --git a/keyboards/winkeyless/bface/rules.mk b/keyboards/winkeyless/bface/rules.mk index 10331ef700..369ccf2eda 100644 --- a/keyboards/winkeyless/bface/rules.mk +++ b/keyboards/winkeyless/bface/rules.mk @@ -44,5 +44,5 @@ CUSTOM_MATRIX = yes SRC = matrix.c i2c.c backlight_ps2avrGB.c # programming options -PROGRAM_CMD = ./keyboards/winkeyless/bface/program .build/$(TARGET).hex +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/xd60/keymaps/default/keymap.c b/keyboards/xd60/keymaps/default/keymap.c index 868ca632ef..b49803fa84 100644 --- a/keyboards/xd60/keymaps/default/keymap.c +++ b/keyboards/xd60/keymaps/default/keymap.c @@ -1,5 +1,4 @@ #include QMK_KEYBOARD_H -#include "action_layer.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboards/xd75/keymaps/adi/config.h b/keyboards/xd75/keymaps/adi/config.h index 244c75c77c..08bed9ccb9 100644 --- a/keyboards/xd75/keymaps/adi/config.h +++ b/keyboards/xd75/keymaps/adi/config.h @@ -14,12 +14,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // Disable backlight #undef BACKLIGHT_ENABLE - -#endif diff --git a/keyboards/xd75/keymaps/adi/keymap.c b/keyboards/xd75/keymaps/adi/keymap.c index a91b7d35db..4f9e414c1c 100644 --- a/keyboards/xd75/keymaps/adi/keymap.c +++ b/keyboards/xd75/keymaps/adi/keymap.c @@ -13,7 +13,7 @@ * 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 "xd75.h" +#include QMK_KEYBOARD_H // Fillers to make layering more clear #define ___T___ KC_TRNS diff --git a/keyboards/xd75/keymaps/adi/rules.mk b/keyboards/xd75/keymaps/adi/rules.mk index 52a8f38d45..a0c4fc9678 100644 --- a/keyboards/xd75/keymaps/adi/rules.mk +++ b/keyboards/xd75/keymaps/adi/rules.mk @@ -13,3 +13,4 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +BACKLIGHT_ENABLE = no diff --git a/keyboards/xd75/keymaps/atomic_style/config.h b/keyboards/xd75/keymaps/atomic_style/config.h index f52a97bbc8..a72596783d 100644 --- a/keyboards/xd75/keymaps/atomic_style/config.h +++ b/keyboards/xd75/keymaps/atomic_style/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/xd75/keymaps/atomic_style/keymap.c b/keyboards/xd75/keymaps/atomic_style/keymap.c index d3e86b0509..bdbbc4af33 100644 --- a/keyboards/xd75/keymaps/atomic_style/keymap.c +++ b/keyboards/xd75/keymaps/atomic_style/keymap.c @@ -13,7 +13,7 @@ * 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 "xd75.h" +#include QMK_KEYBOARD_H // Fillers to make layering more clear #define ___T___ KC_TRNS diff --git a/keyboards/xd75/keymaps/bbaserdem/config.h b/keyboards/xd75/keymaps/bbaserdem/config.h index 28d32e5628..271f48d001 100644 --- a/keyboards/xd75/keymaps/bbaserdem/config.h +++ b/keyboards/xd75/keymaps/bbaserdem/config.h @@ -1,6 +1,3 @@ -#ifndef CONFIG_KEYMAP_H -#define CONFIG_KEYMAP_H +#pragma once -#include "../../config.h" - -#endif +// place overrides here diff --git a/keyboards/xd75/keymaps/bbaserdem/keymap.c b/keyboards/xd75/keymaps/bbaserdem/keymap.c index 68071d018e..6f8576b09b 100644 --- a/keyboards/xd75/keymaps/bbaserdem/keymap.c +++ b/keyboards/xd75/keymaps/bbaserdem/keymap.c @@ -1,4 +1,4 @@ -#include "xd75.h" +#include QMK_KEYBOARD_H #include "bbaserdem.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboards/xd75/keymaps/bramver/README.md b/keyboards/xd75/keymaps/bramver/readme.md index 2dcac5f0e3..2dcac5f0e3 100644 --- a/keyboards/xd75/keymaps/bramver/README.md +++ b/keyboards/xd75/keymaps/bramver/readme.md diff --git a/keyboards/xd75/keymaps/c4software_bepo/config.h b/keyboards/xd75/keymaps/c4software_bepo/config.h index 39845f15b7..6605bbf93f 100644 --- a/keyboards/xd75/keymaps/c4software_bepo/config.h +++ b/keyboards/xd75/keymaps/c4software_bepo/config.h @@ -16,4 +16,4 @@ # pragma once -#include "../../config.h" +// place overrides here diff --git a/keyboards/xd75/keymaps/c4software_bepo/README.md b/keyboards/xd75/keymaps/c4software_bepo/readme.md index b95130a31b..b95130a31b 100644 --- a/keyboards/xd75/keymaps/c4software_bepo/README.md +++ b/keyboards/xd75/keymaps/c4software_bepo/readme.md diff --git a/keyboards/xd75/keymaps/cbbrowne/config.h b/keyboards/xd75/keymaps/cbbrowne/config.h index f6bb06f399..0ff61e1f42 100644 --- a/keyboards/xd75/keymaps/cbbrowne/config.h +++ b/keyboards/xd75/keymaps/cbbrowne/config.h @@ -14,9 +14,9 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once +// place overrides here #ifndef NO_DEBUG #define NO_DEBUG #endif @@ -24,8 +24,6 @@ #define NO_PRINT #endif -#include "../../config.h" - #define LEADER_TIMEOUT 300 #define BACKLIGHT_BREATHING @@ -34,10 +32,3 @@ #define randadd 53 #define randmul 181 #define randmod 167 - -/* Filler to make layering a bit clearer * - * borrowed from basic keymap */ - -#define _____ KC_NO - -#endif diff --git a/keyboards/xd75/keymaps/cbbrowne/keymap.c b/keyboards/xd75/keymaps/cbbrowne/keymap.c index b20cafabc9..6c356ac803 100644 --- a/keyboards/xd75/keymaps/cbbrowne/keymap.c +++ b/keyboards/xd75/keymaps/cbbrowne/keymap.c @@ -13,7 +13,7 @@ * 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 "xd75.h" +#include QMK_KEYBOARD_H /* Fillers to make layering more clear */ #define ___T___ KC_TRNS diff --git a/keyboards/xd75/keymaps/cbbrowne/rules.mk b/keyboards/xd75/keymaps/cbbrowne/rules.mk index 0968298a0a..eb2f870634 100644 --- a/keyboards/xd75/keymaps/cbbrowne/rules.mk +++ b/keyboards/xd75/keymaps/cbbrowne/rules.mk @@ -1,5 +1,5 @@ # Build Options -# change to "no" to disable the options, or define them in the Makefile in +# change to "no" to disable the options, or define them in the Makefile in # the appropriate keymap folder that will get included automatically # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) @@ -18,7 +18,3 @@ API_SYSEX_ENABLE = no # Enable SYSEX API (+5390) # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/xd75/keymaps/colinta/config.h b/keyboards/xd75/keymaps/colinta/config.h index 3b39bee81c..354c9c9186 100644 --- a/keyboards/xd75/keymaps/colinta/config.h +++ b/keyboards/xd75/keymaps/colinta/config.h @@ -14,15 +14,12 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "../../config.h" +// place overrides here // QMK customization: // - after 1.5s, turn off one-shot keys #define ONESHOT_TIMEOUT 1500 // - TT(layer) only needs one press #define TAPPING_TOGGLE 1 - -#endif diff --git a/keyboards/xd75/keymaps/colinta/keymap.c b/keyboards/xd75/keymaps/colinta/keymap.c index a50a02c360..257caad339 100644 --- a/keyboards/xd75/keymaps/colinta/keymap.c +++ b/keyboards/xd75/keymaps/colinta/keymap.c @@ -13,7 +13,7 @@ * 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 "xd75.h" +#include QMK_KEYBOARD_H #ifdef IS_COLINTA #include "secrets.h" @@ -91,7 +91,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * '--/RRND----/MUTE----/FFWD-------------------------------------------------------------------------------------------------------------' */ - [LAYER_COLEMAK] = KEYMAP( + [LAYER_COLEMAK] = LAYOUT( KC_GRV, TH_F1, TH_F2, TH_F3, TH_F4, TH_F5, MM_0, MM_1, KC_DEL, TH_F6, TH_F7, TH_F8, TH_F9, TH_F10, KC_MINS, KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, MM_2, GOTO_FN, KC_BSPC, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_EQL, OSCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_LBRC, KC_RBRC, KC_ENT, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, @@ -113,7 +113,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * '--------------------------------------------------------------------------------------------------------------------------------------' */ - [LAYER_RECORD] = KEYMAP( + [LAYER_RECORD] = LAYOUT( _____, _____, _____, _____, _____, _____, DYN_REC_STOP, DYN_REC_STOP, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, DYN_REC_STOP, DYN_REC_STOP, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, @@ -135,7 +135,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * '--------------------------------------------------------------------------------------------------------------------------------------' */ - [LAYER_QWERTY] = KEYMAP( + [LAYER_QWERTY] = LAYOUT( _____, _____, _____, _____, _____, _____, MM_0, MM_1, _____, _____, _____, _____, _____, _____, _____, _____, KC_Q, KC_W, KC_E, KC_R, KC_T, MM_2, GOTO_FN, _____, KC_Y, KC_U, KC_I, KC_O, KC_P, _____, MOD_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, _____, _____, _____, KC_H, KC_J, KC_K, KC_L, KC_SCLN, _____, @@ -157,7 +157,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * '--------------------------------------------------------------------------------------------------------------------------------------' */ - [LAYER_FN] = KEYMAP( + [LAYER_FN] = LAYOUT( GOTO_CM, GOTO_QW, KC_NO, KC_NO, KC_NO, KC_NO, DYN_REC_START1, DYN_REC_START2, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, diff --git a/keyboards/xd75/keymaps/davidrambo/config.h b/keyboards/xd75/keymaps/davidrambo/config.h index f219147034..6e6349c7cf 100644 --- a/keyboards/xd75/keymaps/davidrambo/config.h +++ b/keyboards/xd75/keymaps/davidrambo/config.h @@ -14,12 +14,9 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "../../config.h" +// place overrides here #define TAPPING_TERM 200 #define PERMISSIVE_HOLD - -#endif diff --git a/keyboards/xd75/keymaps/davidrambo/keymap.c b/keyboards/xd75/keymaps/davidrambo/keymap.c index b37cad0548..7be197a81c 100644 --- a/keyboards/xd75/keymaps/davidrambo/keymap.c +++ b/keyboards/xd75/keymaps/davidrambo/keymap.c @@ -1,51 +1,53 @@ -#include "xd75.h" +#include QMK_KEYBOARD_H +//aliases for clarity in layering #define A_BSPC LALT(KC_BSPC) // delete whole word in Mac -// #define C_BSPS LCTL(KC_BSPC) // delete whole word in PC; currently not in use +#define C_BSPC LCTL(KC_BSPC) // delete whole word in PC #define A_LEFT LALT(KC_LEFT) #define A_RGHT LALT(KC_RGHT) #define C_RGHT LCTL(KC_RGHT) #define C_LEFT LCTL(KC_LEFT) #define SftEnt SFT_T(KC_ENT) -#define GBSPC LGUI_T(KC_BSPC) -#define CBSPC LCTL_T(KC_BSPC) +#define BS_GUI LGUI_T(KC_BSPC) +#define BS_CTL LCTL_T(KC_BSPC) -//internet browser tab shortcuts and window swapping for Mac and Win +// internet browser tab shortcuts and window/application swapping for Mac and Win #define GSL LGUI(S(KC_LEFT)) // back one tab in Safari #define GSR LGUI(S(KC_RGHT)) // forward one tab in Safari #define CTLPGDN LCTL(KC_PGDN) // back one tab on Windows #define CTLPGUP LCTL(KC_PGUP) // forward one tab on Windows -#define G_TAB LGUI(KC_TAB) // MAC: switch applications -#define G_GRV LGUI(KC_GRV) // MAC: switch between windows within an application +#define G_TAB LGUI(KC_TAB) // Mac: switch applications +#define G_GRV LGUI(KC_GRV) // Mac: switch between windows within an application #define A_TAB LALT(KC_TAB) #define C_TAB LCTL(KC_TAB) -// -#define NAV LT(3, KC_TAB) -#define NAVPC LT(4, KC_TAB) +// navigation layers for both Mac OS X and Windows +#define NAV LT(4, KC_TAB) +#define NAVPC LT(5, KC_TAB) // Layer shorthand #define _COLEMAK 0 #define _PC 1 -#define _SYMBOL 2 //Function keys, numbers, symbols, Backlighting -#define _NAV 3 //Navigation Layer on Mac -#define _NAVPC 4 //Navigation Layer on Win +#define _GAME 2 // Gaming layer +#define _SYMBOL 3 // Function keys, numbers, symbols, Backlighting +#define _NAV 4 // Navigation Layer on Mac +#define _NAVPC 5 // Navigation Layer on Win -//tapdance declarations +// tapdance declarations enum { SFT_LCK }; -//alias for tapdance +// alias for tapdance #define SftLck TD(SFT_LCK) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* COLEMAK * .--------------------------------------------------------------------------------------------------------------------------------------. - * | `~ | 1 | 2 | 3 | 4 | 5 | - | SWITCH | = | 6 | 7 | 8 | 9 | 0 | BACKSP | + * | `~ | 1 | 2 | 3 | 4 | 5 | -_ | PC | =+ | 6 | 7 | 8 | 9 | 0 | BACKSP | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| - * | ESC/`~ | Q | W | F | P | G | [ | \ | ] | J | L | U | Y | ; | BACKSP | + * | ESC/`~ | Q | W | F | P | G | [ | \| | ] | J | L | U | Y | ; | BACKSP | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| * | NAVTAB | A | S | D | F | G | PgUp |PlayPaus| ENTER | H | N | E | I | O | ' | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| @@ -55,24 +57,32 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * '--------------------------------------------------------------------------------------------------------------------------------------' */ - [_COLEMAK] = { /* COLEMAK */ - { KC_GRV , KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, TG(1) , KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC }, - { KC_GESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_LBRC, KC_BSLS, KC_RBRC, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC }, - { NAV , KC_A, KC_R, KC_S, KC_T, KC_D, KC_PGUP, KC_ESC , KC_ENT , KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT }, - { SftLck , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_PGDN, KC_UP , KC_ENT , KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SftEnt }, - { KC_DEL , KC_LGUI, KC_LCTL, KC_LALT, KC_LGUI, GBSPC, KC_LEFT, KC_DOWN, KC_RGHT, KC_SPC, MO(2) , KC_RGUI, KC_RALT, KC_RCTL, BL_STEP }, - }, + [_COLEMAK] = LAYOUT_ortho_5x15( /* COLEMAK */ + KC_GRV , KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, TG(1) , KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_GESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_LBRC, KC_BSLS, KC_RBRC, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + NAV , KC_A, KC_R, KC_S, KC_T, KC_D, KC_PGUP, KC_ESC , KC_ENT , KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + SftLck , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_PGDN, KC_UP , KC_ENT , KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SftEnt , + KC_DEL , KC_LGUI, KC_LCTL, KC_LALT, KC_LGUI, BS_GUI, KC_LEFT, KC_DOWN, KC_RGHT, KC_SPC, MO(3) , KC_RGUI, KC_RALT, KC_RCTL, BL_STEP + ), // Windows Layer: essentially swaps Control and GUI - [_PC] = { /* WINDOWS */ - { _______, _______, _______, _______, _______, _______, _______, TG(0) , _______, _______, _______, _______, _______, _______, _______ }, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - { NAVPC , _______, _______, _______, _______, _______, _______, KC_MPLY, _______, _______, _______, _______, _______, _______, _______ }, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - { _______, KC_LCTL, KC_LGUI, _______, KC_LCTL, _______, _______, _______, _______, _______, _______, KC_RCTL, KC_RALT, KC_RGUI, _______ }, - }, - + [_PC] = LAYOUT_ortho_5x15( /* WINDOWS */ + _______, _______, _______, _______, _______, _______, _______, TG(2) , _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + NAVPC , _______, _______, _______, _______, _______, _______, KC_MPLY, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_LCTL, KC_LGUI, _______, KC_LCTL, BS_CTL , _______, _______, _______, _______, _______, KC_RCTL, KC_RALT, KC_RGUI, _______ + ), + + [_GAME] = LAYOUT_ortho_5x15( /* Gaming Layer */ + _______, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_F10 , KC_F11 , KC_F12 , _______, _______, _______, _______, _______, TO(0) , + KC_ESC , KC_T , KC_Q , KC_W , KC_E , KC_R , KC_F7 , KC_F8 , KC_F9 , KC_Y , KC_U , KC_I , KC_O , KC_P , _______, + KC_TAB , KC_LSFT, KC_A , KC_S , KC_D , KC_F , KC_F4 , KC_F5 , KC_F6 , KC_H , KC_J , KC_K , KC_L , KC_SCLN, _______, + KC_LALT, KC_LCTL, KC_Z , KC_X , KC_C , KC_V , KC_F1 , KC_F2 , KC_F3 , KC_N , KC_M , _______, _______, _______, KC_ENT , + _______, _______, _______, KC_G , KC_B , KC_SPC , KC_I , KC_M , _______, _______, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT, _______ + ), + /* SYMBOL * .--------------------------------------------------------------------------------------------------------------------------------------. * | F12 | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | @@ -87,30 +97,30 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * '--------------------------------------------------------------------------------------------------------------------------------------' */ - [_SYMBOL] = { /* SYMBOL */ - { _______, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , _______, _______, _______, KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , _______}, - { KC_LBRC, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , _______, _______, _______, KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_RBRC}, - { _______, KC_EXLM, KC_AT , KC_HASH, KC_DLR , KC_PERC, _______, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_EQL }, - { _______, KC_HOME, KC_END , BL_OFF , BL_ON , KC_F11 , _______, _______, _______, KC_F12 , KC_MINS, _______, _______, _______, _______}, - { _______, _______, _______, _______, _______, A_BSPC , _______, _______, _______, _______, _______, _______, _______, _______, _______}, - }, + [_SYMBOL] = LAYOUT_ortho_5x15( /* SYMBOL */ + KC_F12 , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , _______, _______, _______, KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , + KC_LBRC, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , _______, _______, _______, KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_RBRC, + _______, KC_EXLM, KC_AT , KC_HASH, KC_DLR , KC_PERC, _______, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_EQL , + _______, KC_HOME, KC_END , BL_OFF , BL_ON , KC_F11 , _______, _______, _______, KC_F12 , KC_MINS, _______, _______, _______, _______, + _______, _______, _______, _______, _______, A_BSPC , _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), - [_NAV] = { /* NAVIGATION for Mac */ - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, C_TAB , A_LEFT, KC_UP, A_RGHT , KC_DEL , _______}, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, GSL , KC_LEFT, KC_DOWN, KC_RGHT, GSR , _______}, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, G_TAB , ABSPC , KC_HOME, KC_END , G_GRV , _______}, - { RESET , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - }, - - [_NAVPC] = { /* NAVIGATION FOR WINDOWS: replaces Alt with Control, GUI with Alt, and browser tab shortcuts*/ - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, C_TAB , C_LEFT, KC_UP, C_RGHT , KC_DEL , _______}, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, CTLPGUP, KC_LEFT, KC_DOWN, KC_RGHT, CTLPGDN, _______}, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, A_TAB , CBSPC , KC_HOME, KC_END , _______, _______}, - { RESET , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - } + [_NAV] = LAYOUT_ortho_5x15( /* NAVIGATION for Mac */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, C_TAB , A_LEFT, KC_UP, A_RGHT , KC_DEL , _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, GSL , KC_LEFT, KC_DOWN, KC_RGHT, GSR , _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, G_TAB , A_BSPC , KC_HOME, KC_END , G_GRV , _______, + RESET , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_NAVPC] = LAYOUT_ortho_5x15( /* NAVIGATION FOR WINDOWS: replaces Alt with Control, GUI with Alt, and browser tab shortcuts*/ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, C_TAB , C_LEFT, KC_UP, C_RGHT , KC_DEL , _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, CTLPGUP, KC_LEFT, KC_DOWN, KC_RGHT, CTLPGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, A_TAB , C_BSPC , KC_HOME, KC_END , _______, _______, + RESET , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) }; // Shift vs capslock function. From bbaserdem's Planck keymap. diff --git a/keyboards/xd75/keymaps/davidrambo/readme.md b/keyboards/xd75/keymaps/davidrambo/readme.md index 17b928c501..a53abc8afc 100644 --- a/keyboards/xd75/keymaps/davidrambo/readme.md +++ b/keyboards/xd75/keymaps/davidrambo/readme.md @@ -1,4 +1,7 @@ -# A Colemak layout for XD75 with both Mac and Windows layers. -# These two layers share momentary toggle access to a "Symbol" layer, which is modeled after my Planck layout. -# Each of the base Colemak layers have their own Navigation layers for the right hand to use arrows and shortcuts for both text editing and web browsing. -# The rules.mk file overrides the XD75's "BACKLIGHT_ENABLE" with YES and also adds tap dance functionality.
\ No newline at end of file +# XD75 + +This is a Colemak layout for XD75 with both Mac and Windows layers. +These two layers share momentary toggle access to a "Symbol" layer, which is modeled after my Planck layout (see planck/keymaps/davidrambo). +Each of the base Colemak layers have their own Navigation layers for the right hand to use arrows and shortcuts for both text editing and web browsing. + +The rules.mk file overrides the XD75's "BACKLIGHT_ENABLE" with YES and also adds tap dance functionality.
\ No newline at end of file diff --git a/keyboards/xd75/keymaps/default/config.h b/keyboards/xd75/keymaps/default/config.h index 015377b5f8..e6975da8a2 100644 --- a/keyboards/xd75/keymaps/default/config.h +++ b/keyboards/xd75/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/xd75/keymaps/default/keymap.c b/keyboards/xd75/keymaps/default/keymap.c index 03f6053853..0e5c7dbaaa 100644 --- a/keyboards/xd75/keymaps/default/keymap.c +++ b/keyboards/xd75/keymaps/default/keymap.c @@ -13,12 +13,18 @@ * 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 "xd75.h" +#include QMK_KEYBOARD_H // Layer shorthand #define _QW 0 #define _FN 1 +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* QWERTY @@ -35,13 +41,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * '--------------------------------------------------------------------------------------------------------------------------------------' */ - [_QW] = { /* QWERTY */ - { KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_GRV, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC }, - { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_BSLS, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT }, - { KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HOME, KC_DEL, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT }, - { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END, KC_UP, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT }, - { KC_LCTL, KC_LGUI, KC_LALT, MO(_FN), KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_RGHT, KC_SPC, KC_SPC, MO(_FN), KC_RALT, KC_RGUI, KC_RCTL }, - }, + [_QW] = LAYOUT_ortho_5x15( /* QWERTY */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_GRV, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_BSLS, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HOME, KC_DEL, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END, KC_UP, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, MO(_FN), KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_RGHT, KC_SPC, KC_SPC, MO(_FN), KC_RALT, KC_RGUI, KC_RCTL + ), /* FUNCTION * .--------------------------------------------------------------------------------------------------------------------------------------. @@ -56,30 +62,46 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | RGB TG | FN | RGB RMD| RGB MD | P0 | | P. | PENT | PENT | FN | | | | * '--------------------------------------------------------------------------------------------------------------------------------------' */ - - [_FN] = { /* FUNCTION */ - { KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_NLCK, KC_SLSH, KC_ASTR, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 }, - { KC_MSEL, KC_CALC, KC_MYCM, KC_MAIL, RGB_HUD, RGB_HUI, KC_P7, KC_P8, KC_P9, KC_MINS, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS }, - { KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, RGB_SAD, RGB_SAI, KC_P4, KC_P5, KC_P6, KC_PLUS, _______, RESET, _______, _______, _______ }, - { KC_VOLD, KC_MUTE, KC_VOLU, KC_APP, RGB_VAD, RGB_VAI, KC_P1, KC_P2, KC_P3, KC_PENT, _______, _______, _______, _______, _______ }, - { _______, _______, RGB_TOG, MO(_FN), RGB_RMOD,RGB_MOD, KC_P0, _______, KC_PDOT, KC_PENT, KC_PENT, MO(_FN), _______, _______, _______ }, - } + + [_FN] = LAYOUT_ortho_5x15( /* FUNCTION */ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_NLCK, KC_SLSH, KC_ASTR, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + KC_MSEL, KC_CALC, KC_MYCM, KC_MAIL, RGB_HUD, RGB_HUI, KC_P7, KC_P8, KC_P9, KC_MINS, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, + KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, RGB_SAD, RGB_SAI, KC_P4, KC_P5, KC_P6, KC_PLUS, _______, RESET, _______, _______, _______, + KC_VOLD, KC_MUTE, KC_VOLU, KC_APP, RGB_VAD, RGB_VAI, KC_P1, KC_P2, KC_P3, KC_PENT, _______, _______, _______, _______, _______, + _______, _______, RGB_TOG, MO(_FN), RGB_RMOD,RGB_MOD, KC_P0, _______, KC_PDOT, KC_PENT, KC_PENT, MO(_FN), _______, _______, _______ + ) }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - #ifdef BACKLIGHT_ENABLE - backlight_step(); - #endif - } else { - unregister_code(KC_RSFT); - } - break; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released } - return MACRO_NONE; -}; + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/xd75/keymaps/developper_bepo/config.h b/keyboards/xd75/keymaps/developper_bepo/config.h index 78357b5bc4..0183e02427 100644 --- a/keyboards/xd75/keymaps/developper_bepo/config.h +++ b/keyboards/xd75/keymaps/developper_bepo/config.h @@ -16,4 +16,4 @@ #pragma once -#include "../../config.h" +// place overrides here diff --git a/keyboards/xd75/keymaps/developper_bepo/README.md b/keyboards/xd75/keymaps/developper_bepo/readme.md index 7954a683a0..7954a683a0 100644 --- a/keyboards/xd75/keymaps/developper_bepo/README.md +++ b/keyboards/xd75/keymaps/developper_bepo/readme.md diff --git a/keyboards/xd75/keymaps/dyn_macro_tap_dance/config.h b/keyboards/xd75/keymaps/dyn_macro_tap_dance/config.h index 015377b5f8..e6975da8a2 100644 --- a/keyboards/xd75/keymaps/dyn_macro_tap_dance/config.h +++ b/keyboards/xd75/keymaps/dyn_macro_tap_dance/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/xd75/keymaps/dyn_macro_tap_dance/keymap.c b/keyboards/xd75/keymaps/dyn_macro_tap_dance/keymap.c index 594e5c41cf..cf4bfb4dc5 100644 --- a/keyboards/xd75/keymaps/dyn_macro_tap_dance/keymap.c +++ b/keyboards/xd75/keymaps/dyn_macro_tap_dance/keymap.c @@ -13,7 +13,7 @@ * 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 "xd75.h" +#include QMK_KEYBOARD_H enum planck_keycodes { DUMMY = SAFE_RANGE, diff --git a/keyboards/xd75/keymaps/emilyh/config.h b/keyboards/xd75/keymaps/emilyh/config.h index f52a97bbc8..a72596783d 100644 --- a/keyboards/xd75/keymaps/emilyh/config.h +++ b/keyboards/xd75/keymaps/emilyh/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/xd75/keymaps/emilyh/keymap.c b/keyboards/xd75/keymaps/emilyh/keymap.c index f597dc2b99..bea9863d5b 100644 --- a/keyboards/xd75/keymaps/emilyh/keymap.c +++ b/keyboards/xd75/keymaps/emilyh/keymap.c @@ -13,7 +13,7 @@ * 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 "xd75.h" +#include QMK_KEYBOARD_H #include "backlight.h" // Fillers to make layering more clear diff --git a/keyboards/xd75/keymaps/fabian/config.h b/keyboards/xd75/keymaps/fabian/config.h index 59de3fa55f..a72596783d 100644 --- a/keyboards/xd75/keymaps/fabian/config.h +++ b/keyboards/xd75/keymaps/fabian/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include QMK_KEYBOARD_CONFIG_H +#pragma once // place overrides here - -#endif diff --git a/keyboards/xd75/keymaps/french/config.h b/keyboards/xd75/keymaps/french/config.h index 015377b5f8..e6975da8a2 100644 --- a/keyboards/xd75/keymaps/french/config.h +++ b/keyboards/xd75/keymaps/french/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/xd75/keymaps/french/keymap.c b/keyboards/xd75/keymaps/french/keymap.c index 1ffec2202e..547a67b6ef 100644 --- a/keyboards/xd75/keymaps/french/keymap.c +++ b/keyboards/xd75/keymaps/french/keymap.c @@ -1,5 +1,5 @@ #include "keymap_french.c" -#include "xd75.h" +#include QMK_KEYBOARD_H // Layer shorthand diff --git a/keyboards/xd75/keymaps/french/README.md b/keyboards/xd75/keymaps/french/readme.md index 8c5330290e..8c5330290e 100644 --- a/keyboards/xd75/keymaps/french/README.md +++ b/keyboards/xd75/keymaps/french/readme.md diff --git a/keyboards/xd75/keymaps/germanized/config.h b/keyboards/xd75/keymaps/germanized/config.h index dd3f32275b..65ab6a0dcb 100644 --- a/keyboards/xd75/keymaps/germanized/config.h +++ b/keyboards/xd75/keymaps/germanized/config.h @@ -14,10 +14,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here @@ -118,4 +115,3 @@ // Launchy #define ALT_SPC LALT(KC_SPC) -#endif diff --git a/keyboards/xd75/keymaps/germanized/keymap.c b/keyboards/xd75/keymaps/germanized/keymap.c index b7c9620c13..bba1172eca 100644 --- a/keyboards/xd75/keymaps/germanized/keymap.c +++ b/keyboards/xd75/keymaps/germanized/keymap.c @@ -1,6 +1,6 @@ /* Copyright 2017 Kolja Brauns */ -#include "xd75.h" +#include QMK_KEYBOARD_H #ifndef KEYMAP_GERMAN #define KEYMAP_GERMAN diff --git a/keyboards/xd75/keymaps/kim-kim-xd73/config.h b/keyboards/xd75/keymaps/kim-kim-xd73/config.h index e2390f770c..0c8015e227 100644 --- a/keyboards/xd75/keymaps/kim-kim-xd73/config.h +++ b/keyboards/xd75/keymaps/kim-kim-xd73/config.h @@ -14,12 +14,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include QMK_KEYBOARD_CONFIG_H +#pragma once // place overrides here #undef BACKLIGHT_BREATHING - -#endif diff --git a/keyboards/xd75/keymaps/kim-kim/config.h b/keyboards/xd75/keymaps/kim-kim/config.h index e2390f770c..0c8015e227 100644 --- a/keyboards/xd75/keymaps/kim-kim/config.h +++ b/keyboards/xd75/keymaps/kim-kim/config.h @@ -14,12 +14,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include QMK_KEYBOARD_CONFIG_H +#pragma once // place overrides here #undef BACKLIGHT_BREATHING - -#endif diff --git a/keyboards/xd75/keymaps/kloki/config.h b/keyboards/xd75/keymaps/kloki/config.h index 015377b5f8..e6975da8a2 100644 --- a/keyboards/xd75/keymaps/kloki/config.h +++ b/keyboards/xd75/keymaps/kloki/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/xd75/keymaps/kloki/keymap.c b/keyboards/xd75/keymaps/kloki/keymap.c index 340d9a8dc6..b9bb2c66d4 100644 --- a/keyboards/xd75/keymaps/kloki/keymap.c +++ b/keyboards/xd75/keymaps/kloki/keymap.c @@ -13,7 +13,7 @@ * 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 "xd75.h" +#include QMK_KEYBOARD_H // Layer shorthand #define _WO 0 diff --git a/keyboards/xd75/keymaps/markus/config.h b/keyboards/xd75/keymaps/markus/config.h index bde866636f..4e4e6f0d73 100644 --- a/keyboards/xd75/keymaps/markus/config.h +++ b/keyboards/xd75/keymaps/markus/config.h @@ -14,10 +14,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include QMK_KEYBOARD_CONFIG_H +#pragma once // place overrides here @@ -30,5 +27,3 @@ #define MOUSEKEY_TIME_TO_MAX 0 #define MOUSEKEY_WHEEL_MAX_SPEED 1 #define MOUSEKEY_WHEEL_TIME_TO_MAX 0 - -#endif diff --git a/keyboards/xd75/keymaps/markus/keymap.c b/keyboards/xd75/keymaps/markus/keymap.c index e61fb09b1b..eaf6201515 100644 --- a/keyboards/xd75/keymaps/markus/keymap.c +++ b/keyboards/xd75/keymaps/markus/keymap.c @@ -14,7 +14,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "xd75.h" +#include QMK_KEYBOARD_H #include "keymap_german.h" #define ________ KC_TRNS diff --git a/keyboards/xd75/keymaps/msiu/config.h b/keyboards/xd75/keymaps/msiu/config.h new file mode 100644 index 0000000000..4fbd59becc --- /dev/null +++ b/keyboards/xd75/keymaps/msiu/config.h @@ -0,0 +1,18 @@ +/* Copyright 2017 Benjamin Kesselring + * + * 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 +// place overrides here diff --git a/keyboards/xd75/keymaps/msiu/keymap.c b/keyboards/xd75/keymaps/msiu/keymap.c new file mode 100644 index 0000000000..c4cc456a90 --- /dev/null +++ b/keyboards/xd75/keymaps/msiu/keymap.c @@ -0,0 +1,120 @@ +/* Copyright 2017 Benjamin Kesselring + * + * 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/>. + */ + +/* What this layout is: QWERTY layout with the standard 40% layers. For easy + * switching between my xd75 and contra + */ + +#include QMK_KEYBOARD_H + +// Layer shorthand +#define _QW 0 +#define _DV 1 +#define _LW 2 +#define _RS 3 +#define _FN 4 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* QWERTY + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | - | = | \ | 6 | 7 | 8 | 9 | 0 | BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | TAB | Q | W | E | R | T | 7 | 8 | 9 | Y | U | I | O | P | BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | ESC | A | S | D | F | G | 4 | 5 | 6 | H | J | K | L | ; | ' | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | LSHIFT | Z | X | C | V | B | 1 | 2 | 3 | N | M | , | . | / | ENTER | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------+--------| + * | LCTRL | HYPER | LALT | LGUI | LOWER | FN | 0 | | . | SPACE | RAISE | LEFT | DOWN | UP | RIGHT | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_QW] = { /* QWERTY */ + { KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_PLUS, KC_MINS, KC_ASTR, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC }, + { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_7, KC_8, KC_9 , KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL }, + { LCTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_4, KC_5, KC_6 , KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT }, + { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_1, KC_2, KC_3 , KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + { KC_LCTL, KC_HYPR, KC_LALT, KC_LGUI, MO(_LW), MO(_FN), KC_0, _______, KC_DOT , KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT }, + }, + + /* Dvorak */ + + [_DV] = { /* Dvorak */ + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + { _______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, _______, _______, _______, KC_F, KC_G, KC_C, KC_R, KC_L, _______ }, + { _______, KC_A, KC_O, KC_E, KC_U, KC_I, _______, _______, _______, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH }, + { _______, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, _______, _______, _______, KC_B, KC_M, KC_W, KC_V, KC_Z, _______ }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + }, + + +/* LOWERED + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | DEL | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | ~ | ! | @ | # | $ | % | | VOLU | | ^ | & | * | ( | ) | DEL | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | F1 | F2 | F3 | F4 | F5 | PREV | PLAY | NEXT | F6 | _ | + | { | } | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------+--------| + * | | F7 | F8 | F9 | F10 | F11 | | VOLD | | F12 | PAGEDW | PAGEUP | HOME | END | MUTE | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------+--------| + * | | | | | | | | MUTE | | PLAY | | PREV | VOLD | VOLU | NEXT | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_LW] = { /* LOWERED */ + { _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL }, + { KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, KC_VOLU, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL }, + { _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_MPRV, KC_MPLY, KC_MNXT, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE }, + { _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, KC_VOLD, _______, KC_F12, KC_PGDN, KC_PGUP, KC_HOME, KC_END , KC_MUTE }, + { _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, KC_MPLY, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT }, + }, + +/* RAISED + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | DEL | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | ` | 1 | 2 | 3 | 4 | 5 | | VOLU | | 6 | 7 | 8 | 9 | 0 | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | F1 | F2 | F3 | F4 | F5 | PREV | PLAY | NEXT | F6 | - | = | [ | ] | \ | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | F7 | F8 | F9 | F10 | F11 | | VOLD | | F12 | PAGEUP | PAGEDW | HOME | END | MUTE | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | MUTE | | PLAY | | PREV | VOLD | VOLU | NEXT | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_RS] = { /* RAISED */ + { _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL }, + { KC_GRV , KC_1, KC_2, KC_3, KC_4, KC_5, _______, KC_VOLU, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL }, + { _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_MPRV, KC_MPLY, KC_MNXT, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS }, + { _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, KC_VOLD, _______, KC_F12, KC_PGDN, KC_PGUP, KC_HOME, KC_END , KC_MUTE }, + { _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, KC_MPLY, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT }, + }, + +/* FUNCTION */ + + [_FN] = { /* FUNCTION */ + { RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, BL_TOGG, BL_INC, BL_DEC, _______, _______, _______, _______ }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP , _______, KC_PSCR, _______ }, + { _______, _______, _______, TO(_DV), TO(_QW), _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______ }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + { RESET , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + }, +}; + + diff --git a/keyboards/xd75/keymaps/msiu/readme.md b/keyboards/xd75/keymaps/msiu/readme.md new file mode 100644 index 0000000000..d53c0f34a8 --- /dev/null +++ b/keyboards/xd75/keymaps/msiu/readme.md @@ -0,0 +1 @@ +# The default keymap for xd75 diff --git a/keyboards/xd75/keymaps/mtdjr/config.h b/keyboards/xd75/keymaps/mtdjr/config.h index 7e2227c874..0ceba236fe 100644 --- a/keyboards/xd75/keymaps/mtdjr/config.h +++ b/keyboards/xd75/keymaps/mtdjr/config.h @@ -14,10 +14,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here #undef MANUFACTURER @@ -25,5 +22,3 @@ #define MANUFACTURER mtdjr #define PRODUCT XD75 #define DESCRIPTION XD75Re - -#endif diff --git a/keyboards/xd75/keymaps/mtdjr/keymap.c b/keyboards/xd75/keymaps/mtdjr/keymap.c index 074cf7335a..e56d918fd5 100644 --- a/keyboards/xd75/keymaps/mtdjr/keymap.c +++ b/keyboards/xd75/keymaps/mtdjr/keymap.c @@ -3,7 +3,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = KC_KEYMAP( + [_QWERTY] = LAYOUT_kc( // .--------------------------------------------------------------------------. EXC, 1 , 2 , 3 , 4 , 5 ,PGUP,MPNT,PGDN, 6 , 7 , 8 , 9 , 0 ,BSPC, // |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----| @@ -17,7 +17,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // '----+----+----+----+----+----+----+----+----+----+----+----+----+----+----' ), - [_LOWER] = KC_KEYMAP( + [_LOWER] = LAYOUT_kc( // .--------------------------------------------------------------------------. xxxx, F1 , F2 , F3 , F4 , F5 , F6 ,xxxx, F7 , F8 , F9 , F10, F11, F12, DEL, // |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----| @@ -31,7 +31,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // '----+----+----+----+----+----+----+----+----+----+----+----+----+----+----' ), -[_RAISE] = KC_KEYMAP( +[_RAISE] = LAYOUT_kc( // .--------------------------------------------------------------------------. xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, // |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----| diff --git a/keyboards/xd75/keymaps/tdl-jturner/config.h b/keyboards/xd75/keymaps/tdl-jturner/config.h index 985247bb2e..596aaff665 100644 --- a/keyboards/xd75/keymaps/tdl-jturner/config.h +++ b/keyboards/xd75/keymaps/tdl-jturner/config.h @@ -16,10 +16,9 @@ // additional config optoinsa vailable at https://docs.qmk.fm/reference/config-options#the-config.h-file -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "../../config.h" +// place overrides here // place overrides here //#define TAPPING_TERM 200 @@ -33,5 +32,3 @@ #define MOUSEKEY_TIME_TO_MAX 60 #define MOUSEKEY_MAX_SPEED 7 #define MOUSEKEY_WHEEL_DELAY 0 - -#endif diff --git a/keyboards/xd75/keymaps/tdl-jturner/keymap.c b/keyboards/xd75/keymaps/tdl-jturner/keymap.c index 9789d9a867..593e54f14d 100644 --- a/keyboards/xd75/keymaps/tdl-jturner/keymap.c +++ b/keyboards/xd75/keymaps/tdl-jturner/keymap.c @@ -13,7 +13,7 @@ * 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 "xd75.h" +#include QMK_KEYBOARD_H enum xd75_layers { _QWERTY, diff --git a/keyboards/xd75/readme.md b/keyboards/xd75/readme.md index e11ce7dca9..fc5b8972c8 100644 --- a/keyboards/xd75/readme.md +++ b/keyboards/xd75/readme.md @@ -1,32 +1,25 @@ -xd75 keyboard firmware -====================== +# XD75 -The XD75Re is a 15x5 full-grid ortholinear keyboard manufactured by XIUDI. This port of the QMK firmware is my first shot at using QMK, so if you see any features done wrong (or just plain missing), feel free to fix them and put in a pull request! +![XD75](https://cdn.shopify.com/s/files/1/2711/4238/products/HTB1MzOISXXXXXXgXpXXq6xXFXXXO_1024x1024.jpg) -## Quantum MK Firmware +The XD75Re is a 15x5 full-grid ortholinear keyboard manufactured by XIUDI. This port of the QMK firmware is my first shot at using QMK, so if you see any features done wrong (or just plain missing), feel free to fix them and put in a pull request! -For more info on this firmware (and how to make it your own), head over to [qmk.fm](http://qmk.fm). +Keyboard Maintainer: [The QMK Community](https://github.com/qmk) +Hardware Supported: XD75Re +Hardware Availability: [KPrepublic](https://kprepublic.com/products/xd75re-xd75am-xd75-xiudi-60-custom-keyboard-pcb), [AliExpress](https://www.aliexpress.com/item/xd75re-Custom-Mechanical-Keyboard-75-keys-TKG-TOOLS-Underglow-RGB-PCB-GH60-60-programmed-gh60-kle/32818745981.html) -## Building +Make example for this keyboard (after setting up your build environment): -Download or clone the whole firmware and navigate to the -keyboards/xd75 folder. Once your dev env is setup, you'll be able to -type `make` to generate your .hex - you can then use the Teensy Loader -to install the resulting .hex file, or have the `make` process install -it using DFU. + make xd75:default -### Default +Flashing example: -To build with the default keymap, simply run `make xd75:default` from the root directory (i.e. two levels above this file), and to install via DFU, `make xd75:default:dfu`, also from the root directory. + make xd75:default:dfu -Note that DFU is likely to require root permissions, so installing the -firmware likely requires a command line like: +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). -``` -$ sudo make xd75:default:dfu -``` -### LED control +## LED control There are 3 individual LEDs that can be turned on and off, plus the keycap LEDs (which are all wired into the same pin). The functions are named according to how they're labeled on the PCB. @@ -65,23 +58,3 @@ GP103_LED F4 KEYCAPS_LED F5 GP100_LED F7 ``` - -### Other Keymaps - -The "default" keymap included is basically the OLKB Atomic keymap with -a few buttons added for RGB underglow control. This should be usable -as a starting point, but most people will be best served creating -their own keymap and flashing it - more info on creating your own -keymap is available in [the official QMK -documentation](https://docs.qmk.fm). - -Keymaps follow the format **__\<name\>.c__** and are stored in -subdirectories under `keyboards/xd75/keymaps` - -To build the firmware binary hex file for a specific keymap, and -install it, using DFU, just do `make` with a keymap like this: - -``` -$ make xd75:[default|<name>] -``` - diff --git a/keyboards/xd75/xd75.h b/keyboards/xd75/xd75.h index e278066900..c27930a845 100644 --- a/keyboards/xd75/xd75.h +++ b/keyboards/xd75/xd75.h @@ -13,8 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef XD75_H -#define XD75_H +#pragma once #include "quantum.h" @@ -22,7 +21,7 @@ // The following is an example using the Planck MIT layout // The first section contains all of the arguments // The second converts the arguments into a two-dimensional array -#define KEYMAP( \ +#define LAYOUT( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E,\ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E,\ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E,\ @@ -36,7 +35,7 @@ { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4E } \ } -#define KC_KEYMAP( \ +#define LAYOUT_kc( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E,\ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E,\ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E,\ @@ -50,7 +49,7 @@ { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47, KC_##K48, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E } \ } -#define LAYOUT_ortho_5x15 KEYMAP +#define LAYOUT_ortho_5x15 LAYOUT void capslock_led_init(void); void capslock_led_off(void); @@ -67,5 +66,3 @@ void gp103_led_on(void); void keycaps_led_init(void); void keycaps_led_off(void); void keycaps_led_on(void); - -#endif diff --git a/keyboards/xd96/config.h b/keyboards/xd96/config.h new file mode 100644 index 0000000000..df21205f8d --- /dev/null +++ b/keyboards/xd96/config.h @@ -0,0 +1,244 @@ +/* Copyright 2019 + * + * 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 0xFEED +#define PRODUCT_ID 0x4096 +#define DEVICE_VER 0x0001 +#define MANUFACTURER KPrepublic +#define PRODUCT XD96 +#define DESCRIPTION KPrepublic XD96 + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 18 + +/* + * 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 { D0, D5 } +//#define MATRIX_COL_PINS { F1, F0, B0 } +//#define UNUSED_PINS + +/* COL2ROW, ROW2COL */ +//#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B5 +#define BACKLIGHT_LEVELS 10 +// #define BACKLIGHT_BREATHING + +#define RGB_DI_PIN C7 +#define RGBLED_NUM 16 +#define RGBLIGHT_ANIMATIONS +#define RGBLIGHT_LIMIT_VAL 50 +// #ifdef RGB_DI_PIN +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* 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. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* 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 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 + +// LTO options +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION diff --git a/keyboards/xd96/custom_matrix_helper.c b/keyboards/xd96/custom_matrix_helper.c new file mode 100644 index 0000000000..a4c5b6afa5 --- /dev/null +++ b/keyboards/xd96/custom_matrix_helper.c @@ -0,0 +1,127 @@ +/* Copyright 2019 + * + * 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 <stdint.h> +#include <stdbool.h> +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "debounce.h" +#include "quantum.h" + +//_____COMMON__________________________________________________________________ +// user-defined overridable functions +__attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); } +__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); } +__attribute__((weak)) void matrix_init_user(void) {} +__attribute__((weak)) void matrix_scan_user(void) {} + + +//_____COULD BE COMMON_________________________________________________________ +/* matrix state(1:on, 0:off) */ +/*static*/ matrix_row_t raw_matrix[MATRIX_ROWS]; +/*static*/ matrix_row_t matrix[MATRIX_ROWS]; + +#if (MATRIX_COLS <= 8) +# define print_matrix_header() print("\nr/c 01234567\n") +# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop(matrix[i]) +# define ROW_SHIFTER ((uint8_t)1) +#elif (MATRIX_COLS <= 16) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop16(matrix[i]) +# define ROW_SHIFTER ((uint16_t)1) +#elif (MATRIX_COLS <= 32) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop32(matrix[i]) +# define ROW_SHIFTER ((uint32_t)1) +#endif + +__attribute__ ((weak)) +uint8_t matrix_rows(void) { + return MATRIX_ROWS; +} + +__attribute__ ((weak)) +uint8_t matrix_cols(void) { + return MATRIX_COLS; +} + +__attribute__ ((weak)) +matrix_row_t matrix_get_row(uint8_t row) { + return matrix[row]; +} + +__attribute__ ((weak)) +uint8_t matrix_key_count(void) { + uint8_t count = 0; + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + count += matrix_bitpop(i); + } + return count; +} + +__attribute__ ((weak)) +void matrix_print(void) { + print_matrix_header(); + + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + phex(row); print(": "); + print_matrix_row(row); + print("\n"); + } +} + + +//_____CUSTOM MATRIX 'LITE'____________________________________________________ +__attribute__ ((weak)) +void custom_matrix_init(void) { +} + +__attribute__ ((weak)) +bool custom_matrix_scan(matrix_row_t current_matrix[]) { + bool changed = true; + return changed; +} + +__attribute__ ((weak)) +void matrix_init(void) { + + custom_matrix_init(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + raw_matrix[i] = 0; + matrix[i] = 0; + } + + debounce_init(MATRIX_ROWS); + + matrix_init_quantum(); +} + +__attribute__ ((weak)) +uint8_t matrix_scan(void) { + bool changed = custom_matrix_scan(raw_matrix); + + debounce(raw_matrix, matrix, MATRIX_ROWS, changed); + + matrix_scan_quantum(); + return 1; +} diff --git a/keyboards/xd96/info.json b/keyboards/xd96/info.json new file mode 100644 index 0000000000..f180682735 --- /dev/null +++ b/keyboards/xd96/info.json @@ -0,0 +1,17 @@ +{ + "keyboard_name": "xd96", + "url": "", + "maintainer": "qmk", + "width": 19, + "height": 6, + "layouts": { + "LAYOUT_96_ansi": { + "key_count": 99, + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"Insert", "x":13, "y":0}, {"label":"Delete", "x":14, "y":0}, {"label":"Home", "x":15, "y":0}, {"label":"End", "x":16, "y":0}, {"label":"PgUp", "x":17, "y":0}, {"label":"PgDn", "x":18, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"label":"Backspace", "x":13, "y":1, "w":2}, {"label":"Num Lock", "x":15, "y":1}, {"label":"/", "x":16, "y":1}, {"label":"*", "x":17, "y":1}, {"label":"-", "x":18, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"7", "x":15, "y":2}, {"label":"8", "x":16, "y":2}, {"label":"9", "x":17, "y":2}, {"label":"+", "x":18, "y":2, "h":2}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"label":"Enter", "x":12.75, "y":3, "w":2.25}, {"label":"4", "x":15, "y":3}, {"label":"5", "x":16, "y":3}, {"label":"6", "x":17, "y":3}, {"label":"Shift", "x":0, "y":4, "w":2.25}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"label":"\u2191", "x":14, "y":4}, {"label":"1", "x":15, "y":4}, {"label":"2", "x":16, "y":4}, {"label":"3", "x":17, "y":4}, {"label":"Enter", "x":18, "y":4, "h":2}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5, "w":1.5}, {"label":"Ctrl", "x":11.5, "y":5, "w":1.5}, {"label":"\u2190", "x":13, "y":5}, {"label":"\u2193", "x":14, "y":5}, {"label":"\u2192", "x":15, "y":5}, {"label":"0", "x":16, "y":5}, {"label":".", "x":17, "y":5}] + }, + "LAYOUT_96_iso": { + "key_count": 100, + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"Insert", "x":13, "y":0}, {"label":"Delete", "x":14, "y":0}, {"label":"Home", "x":15, "y":0}, {"label":"End", "x":16, "y":0}, {"label":"PgUp", "x":17, "y":0}, {"label":"PgDn", "x":18, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"\"", "x":2, "y":1}, {"label":"\u00a3", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"label":"Backspace", "x":13, "y":1, "w":2}, {"label":"Num Lock", "x":15, "y":1}, {"label":"/", "x":16, "y":1}, {"label":"*", "x":17, "y":1}, {"label":"-", "x":18, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"7", "x":15, "y":2}, {"label":"8", "x":16, "y":2}, {"label":"9", "x":17, "y":2}, {"label":"+", "x":18, "y":2, "h":2}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"@", "x":11.75, "y":3}, {"label":"~", "x":12.75, "y":3}, {"label":"Enter", "x":13.75, "y":2, "w":1.25, "h":2}, {"label":"4", "x":15, "y":3}, {"label":"5", "x":16, "y":3}, {"label":"6", "x":17, "y":3}, {"label":"Shift", "x":0, "y":4, "w":1.25}, {"label":"|", "x":1.25, "y":4}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"label":"\u2191", "x":14, "y":4}, {"label":"1", "x":15, "y":4}, {"label":"2", "x":16, "y":4}, {"label":"3", "x":17, "y":4}, {"label":"Enter", "x":18, "y":4, "h":2}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5, "w":1.5}, {"label":"Ctrl", "x":11.5, "y":5, "w":1.5}, {"label":"\u2190", "x":13, "y":5}, {"label":"\u2193", "x":14, "y":5}, {"label":"\u2192", "x":15, "y":5}, {"label":"0", "x":16, "y":5}, {"label":".", "x":17, "y":5}] + } + } +} diff --git a/keyboards/xd96/keymaps/default/keymap.c b/keyboards/xd96/keymaps/default/keymap.c new file mode 100644 index 0000000000..45588f18c4 --- /dev/null +++ b/keyboards/xd96/keymaps/default/keymap.c @@ -0,0 +1,38 @@ +#include QMK_KEYBOARD_H + +#define L1_RALT LM(1, MOD_RALT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_96_ansi( +/* ┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐ */ + 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_INS, KC_DEL, KC_HOME, KC_END, KC_PGUP, KC_PGDN, +/* ├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┴─────────┼─────────┼─────────┼─────────┼─────────┤ */ + 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_NLCK, KC_PSLS, KC_PAST, KC_PMNS, +/* ├─────────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬──────────────┼─────────┼─────────┼─────────┼─────────┤ */ + 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_P7, KC_P8, KC_P9, +/* ├──────────────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──────────────├─────────├─────────├─────────├ ┤ */ + 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_P4, KC_P5, KC_P6, KC_PPLS, +/* ├─────────────────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───────────┬─────────┼─────────┼─────────┼─────────┼─────────┤ */ + 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_P1, KC_P2, KC_P3, +/* ├───────────┬─────────┴─┬───────┴───┬─────┴─────────┴─────────┴─────────┴─────────┴─────────┴───────┬─┴─────────┴──┬──────┴───────┬─────────┼─────────┼─────────┼─────────┼─────────┼ ┤ */ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, L1_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT +/* └───────────┴───────────┴───────────┴───────────────────────────────────────────────────────────────┴──────────────┴──────────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘ */ + ), + + [1] = LAYOUT_96_ansi( +/* ┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐ */ + _______, BL_TOGG, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +/* ├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┴─────────┼─────────┼─────────┼─────────┼─────────┤ */ + _______, RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +/* ├─────────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬──────────────┼─────────┼─────────┼─────────┼─────────┤ */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +/* ├──────────────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──────────────├─────────├─────────├─────────┼ ┤ */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +/* ├─────────────────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───────────┬─────────┼─────────┼─────────┼─────────┼─────────┤ */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +/* ├───────────┬─────────┴─┬───────┴───┬─────┴─────────┴─────────┴─────────┴─────────┴─────────┴───────┬─┴─────────┴──┬──────┴───────┬─────────┼─────────┼─────────┼─────────┼─────────┼ ┤ */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +/* └───────────┴───────────┴───────────┴───────────────────────────────────────────────────────────────┴──────────────┴──────────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘ */ + ) +}; diff --git a/keyboards/xd96/keymaps/default_iso/keymap.c b/keyboards/xd96/keymaps/default_iso/keymap.c new file mode 100644 index 0000000000..cdd1f49679 --- /dev/null +++ b/keyboards/xd96/keymaps/default_iso/keymap.c @@ -0,0 +1,38 @@ +#include QMK_KEYBOARD_H + +#define L1_RALT LM(1, MOD_RALT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_96_iso( +/* ┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐ */ + 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_INS, KC_DEL, KC_HOME, KC_END, KC_PGUP, KC_PGDN, +/* ├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┴─────────┼─────────┼─────────┼─────────┼─────────┤ */ + 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_NLCK, KC_PSLS, KC_PAST, KC_PMNS, +/* ├─────────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬──────────────┼─────────┼─────────┼─────────┼─────────┤ */ + 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_P7, KC_P8, KC_P9, +/* ├──────────────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬ ├─────────├─────────├─────────├ ┤ */ + 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_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, +/* ├───────────┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴─────────┴─┬─────────┼─────────┼─────────┼─────────┼─────────┤ */ + 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_P1, KC_P2, KC_P3, +/* ├───────────┼─────────┴─┬───────┴───┬─────┴─────────┴─────────┴─────────┴─────────┴─────────┴───────┬─┴─────────┴──┬──────┴───────┬─────────┼─────────┼─────────┼─────────┼─────────┼ ┤ */ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, L1_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT +/* └───────────┴───────────┴───────────┴───────────────────────────────────────────────────────────────┴──────────────┴──────────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘ */ + ), + + [1] = LAYOUT_96_iso( +/* ┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐ */ + _______, BL_TOGG, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +/* ├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┴─────────┼─────────┼─────────┼─────────┼─────────┤ */ + _______, RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +/* ├─────────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬──────────────┼─────────┼─────────┼─────────┼─────────┤ */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +/* ├──────────────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬ ├─────────├─────────├─────────┼ ┤ */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +/* ├───────────┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴─────────┴─┬─────────┼─────────┼─────────┼─────────┼─────────┤ */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +/* ├───────────┼─────────┴─┬───────┴───┬─────┴─────────┴─────────┴─────────┴─────────┴─────────┴───────┬─┴─────────┴──┬──────┴───────┬─────────┼─────────┼─────────┼─────────┼─────────┼ ┤ */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +/* └───────────┴───────────┴───────────┴───────────────────────────────────────────────────────────────┴──────────────┴──────────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘ */ + ) +}; diff --git a/keyboards/xd96/matrix.c b/keyboards/xd96/matrix.c new file mode 100644 index 0000000000..550dae4d02 --- /dev/null +++ b/keyboards/xd96/matrix.c @@ -0,0 +1,96 @@ +/* Copyright 2019 + * + * 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 <stdint.h> +#include <stdbool.h> +#include <avr/io.h> +#include <string.h> +#include "matrix.h" +#include "pca9555.h" +#include "quantum.h" + +#include "debug.h" + +// PCA9555 slave addresses +#define IC1 0x20 +#define IC2 0x21 + +//_____Utility funcs___________________________________________________________ + +static void init_pins(void) { + // init all cols high - IC2 all input + pca9555_set_config(IC2, PCA9555_PORT0, ALL_INPUT);//same as initial state + pca9555_set_config(IC2, PCA9555_PORT1, ALL_INPUT);//same as initial state + pca9555_set_config(IC1, PCA9555_PORT1, ALL_INPUT);//same as initial state + + // init all rows - IC1 port0 input + pca9555_set_config(IC1, PCA9555_PORT0, ALL_INPUT);//same as initial state +} + +static void select_row(uint8_t row) { + // For the XD96 all rows are on the same IC and port + // so its safe enough to assume here row == pin + uint8_t pin = row; + uint8_t mask = 1 << pin; + + pca9555_set_output(IC1, PCA9555_PORT0, ALL_HIGH & (~mask)); + pca9555_set_config(IC1, PCA9555_PORT0, ALL_INPUT & (~mask)); +} + +static uint32_t read_cols(void) { + uint32_t state_1 = pca9555_readPins(IC2, PCA9555_PORT0); + uint32_t state_2 = pca9555_readPins(IC2, PCA9555_PORT1); + uint32_t state_3 = pca9555_readPins(IC1, PCA9555_PORT1); + + // For the XD96 the pins are mapped to port expanders as follows: + // all 8 pins port 0 IC2, first 6 pins port 1 IC2, first 4 pins port 1 IC1 + uint32_t state = (((state_3 & 0b00001111) << 14) | ((state_2 & 0b00111111) << 8) | state_1); + return (~state) & 0b111111111111111111; +} + +static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) { + // Store last value of row prior to reading + matrix_row_t last_row_value = current_matrix[current_row]; + + // Clear data in matrix row + current_matrix[current_row] = 0; + + // Select row and wait for row selecton to stabilize + select_row(current_row); + wait_us(30); + + current_matrix[current_row] = read_cols(); + + // No need to Unselect row as the next `select_row` will blank everything + + return (last_row_value != current_matrix[current_row]); +} + +//_____CUSTOM MATRIX IMPLEMENTATION____________________________________________________ + +void custom_matrix_init(void) { + pca9555_init(IC1); + pca9555_init(IC2); + + init_pins(); +} + +bool custom_matrix_scan(matrix_row_t current_matrix[]) { + bool changed = false; + for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { + changed |= read_cols_on_row(current_matrix, current_row); + } + return changed; +}
\ No newline at end of file diff --git a/keyboards/xd96/pca9555.c b/keyboards/xd96/pca9555.c new file mode 100644 index 0000000000..960df4f4e5 --- /dev/null +++ b/keyboards/xd96/pca9555.c @@ -0,0 +1,78 @@ +/* Copyright 2019 + * + * 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 "i2c_master.h" +#include "pca9555.h" + +#include "debug.h" + +#define SLAVE_TO_ADDR(n) (n<<1) +#define TIMEOUT 100 + +enum { + CMD_INPUT_0 = 0, + CMD_INPUT_1, + CMD_OUTPUT_0, + CMD_OUTPUT_1, + CMD_INVERSION_0, + CMD_INVERSION_1, + CMD_CONFIG_0, + CMD_CONFIG_1 +}; + +void pca9555_init(uint8_t slave_addr) { + static uint8_t s_init = 0; + if (!s_init) { + i2c_init(); + + s_init=1; + } + + // TODO: could check device connected + //i2c_start(SLAVE_TO_ADDR(slave) | I2C_WRITE); + //i2c_stop(); +} + +void pca9555_set_config(uint8_t slave_addr, uint8_t port, uint8_t conf) { + uint8_t addr = SLAVE_TO_ADDR(slave_addr); + uint8_t cmd = port ? CMD_OUTPUT_1 : CMD_OUTPUT_0; + + i2c_status_t ret = i2c_writeReg(addr, cmd, &conf, sizeof(conf), TIMEOUT); + if (ret != I2C_STATUS_SUCCESS) { + print("pca9555_set_config::FAILED\n"); + } +} + +void pca9555_set_output(uint8_t slave_addr, uint8_t port, uint8_t conf) { + uint8_t addr = SLAVE_TO_ADDR(slave_addr); + uint8_t cmd = port ? CMD_CONFIG_1 : CMD_CONFIG_0; + + i2c_status_t ret = i2c_writeReg(addr, cmd, &conf, sizeof(conf), TIMEOUT); + if (ret != I2C_STATUS_SUCCESS) { + print("pca9555_set_output::FAILED\n"); + } +} + +uint8_t pca9555_readPins(uint8_t slave_addr, uint8_t port) { + uint8_t addr = SLAVE_TO_ADDR(slave_addr); + uint8_t cmd = port ? CMD_INPUT_1 : CMD_INPUT_0; + + uint8_t data = 0; + i2c_status_t ret = i2c_readReg(addr, cmd, &data, sizeof(data), TIMEOUT); + if (ret != I2C_STATUS_SUCCESS) { + print("pca9555_readPins::FAILED\n"); + } + return data; +} diff --git a/keyboards/xd96/pca9555.h b/keyboards/xd96/pca9555.h new file mode 100644 index 0000000000..6aaee8a6f8 --- /dev/null +++ b/keyboards/xd96/pca9555.h @@ -0,0 +1,55 @@ +/* Copyright 2019 + * + * 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 + +/* + PCA9555 + ,----------. + SDA --| SDA P00 |-- P1 + SCL --| SCL P01 |-- P2 + INT --| INT P02 |-- P3 + | P03 |-- P4 + A0 --| A0 P04 |-- P5 + A1 --| A1 P05 |-- P6 + A2 --| A2 P06 |-- P7 + | P07 |-- P8 + | | + | P10 |-- P10 + | P11 |-- P11 + | P12 |-- P12 + | P13 |-- P13 + | P14 |-- P14 + | P15 |-- P15 + | P16 |-- P16 + | P17 |-- P17 + `----------' +*/ + +#define PCA9555_PORT0 0 +#define PCA9555_PORT1 1 + +#define ALL_OUTPUT 0 +#define ALL_INPUT 0xFF +#define ALL_LOW 0 +#define ALL_HIGH 0xFF + +void pca9555_init(uint8_t slave_addr); + +void pca9555_set_config(uint8_t slave_addr, uint8_t port, uint8_t conf); + +void pca9555_set_output(uint8_t slave_addr, uint8_t port, uint8_t conf); + +uint8_t pca9555_readPins(uint8_t slave_addr, uint8_t port);
\ No newline at end of file diff --git a/keyboards/xd96/readme.md b/keyboards/xd96/readme.md new file mode 100644 index 0000000000..237d7a0516 --- /dev/null +++ b/keyboards/xd96/readme.md @@ -0,0 +1,22 @@ +# XD96 + +![XD96](https://cdn.shopify.com/s/files/1/2711/4238/products/xd96_pcb_1024x1024.jpg?v=1515425370) + +Compact With 96 Keys & RGB LED Underglow +- Designed by Xiudi +- ISO and ANSI support +- Uses Kimera core + +Keyboard Maintainer: QMK Community +Hardware Supported: XD96 +Hardware Availability: [KPrepublic](https://kprepublic.com/products/xd96-pcb-90-custom-mechanical-keyboard-supports-tkg-tools-underglow-rgb-programmed); [AliExpress](https://aliexpress.com/item/cospad-Custom-Mechanical-Keyboard-Kit-up-tp-24-keys-Supports-TKG-TOOLS-Underglow-RGB-PCB-20/32818383873.html) + +Make example for this keyboard (after setting up your build environment): + + make xd96:default + +Install examples: + + make xd96:default:dfu + +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/xd96/rules.mk b/keyboards/xd96/rules.mk new file mode 100644 index 0000000000..c9f8044712 --- /dev/null +++ b/keyboards/xd96/rules.mk @@ -0,0 +1,86 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +# custom matrix setup +CUSTOM_MATRIX = yes +SRC = i2c_master.c custom_matrix_helper.c pca9555.c matrix.c + +EXTRAFLAGS += -flto diff --git a/keyboards/xd96/xd96.c b/keyboards/xd96/xd96.c new file mode 100644 index 0000000000..45cfb3b1f1 --- /dev/null +++ b/keyboards/xd96/xd96.c @@ -0,0 +1,34 @@ +/* Copyright 2019 + * + * 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 "xd96.h" + +#define CAPS_PIN B6 + +void keyboard_pre_init_kb(void) { + setPinOutput(CAPS_PIN); + + keyboard_pre_init_user(); +} + +void led_set_kb(uint8_t usb_led) { + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(CAPS_PIN); + } else { + writePinHigh(CAPS_PIN); + } + + led_set_user(usb_led); +} diff --git a/keyboards/xd96/xd96.h b/keyboards/xd96/xd96.h new file mode 100644 index 0000000000..04c2cc46e2 --- /dev/null +++ b/keyboards/xd96/xd96.h @@ -0,0 +1,59 @@ +/* Copyright 2019 + * + * 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" +#define ____ KC_NO + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_96_ansi( \ + K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, K117, K118, K119, \ + K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K216, K217, K218, K219, \ + K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K316, K317, K318, \ + K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K414, K416, K417, K418, K419, \ + K501, K503, K504, K505, K506, K507, K508, K509, K510, K511, K512, K513, K515, K516, K517, K518, \ + K601, K602, K603, K607, K611, K612, K614, K615, K616, K617, K618, K619 \ +) { \ + { K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K116, K117, K118, K119 }, \ + { K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K216, K217, K218, K219 }, \ + { K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K316, K317, K318, K419 }, \ + { K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, ____, K414, K416, K417, K418, ____ }, \ + { K501, ____, K503, K504, K505, K506, K507, K508, K509, K510, K511, K512, K513, K515, K516, K517, K518, K619 }, \ + { K601, K602, K603, ____, ____, K607, K115, ____, K612, ____, K611, K612, K614, K615, K616, K617, K618, ____ } \ +} + +#define LAYOUT_96_iso( \ + K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, K117, K118, K119, \ + K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K216, K217, K218, K219, \ + K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K316, K317, K318, \ + K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K414, K415, K416, K417, K418, K419, \ + K501, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, K512, K513, K515, K516, K517, K518, \ + K601, K602, K603, K607, K611, K612, K614, K615, K616, K617, K618, K619 \ +) { \ + { K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K116, K117, K118, K119 }, \ + { K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K216, K217, K218, K219 }, \ + { K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, ____, K316, K317, K318, K419 }, \ + { K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K414, K415, K416, K417, K418, ____ }, \ + { K501, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, K512, K513, K515, K516, K517, K518, K619 }, \ + { K601, K602, K603, ____, ____, K607, K115, ____, K612, ____, K611, K612, K614, K615, K616, K617, K618, ____ } \ +} diff --git a/keyboards/ymd75/README.md b/keyboards/ymd75/README.md index eed6ce13ee..d1c4e95ae7 100644 --- a/keyboards/ymd75/README.md +++ b/keyboards/ymd75/README.md @@ -37,7 +37,7 @@ $ brew cask install crosspack-avr $ brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb ``` -In order to use the `./program` script, which can reboot the board into +In order to use the `./util/atmega32a_program.py` script, which can reboot the board into the bootloader, you'll need Python 2 with PyUSB installed: ``` diff --git a/keyboards/ymd75/program b/keyboards/ymd75/program deleted file mode 100644 index a88d9cd9b0..0000000000 --- a/keyboards/ymd75/program +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env python -# Copyright 2017 Luiz Ribeiro <luizribeiro@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/>. - -from __future__ import print_function - -import os -import sys -import time -import usb - -if len(sys.argv) < 2: - print('Usage: %s <firmware.hex>' % sys.argv[0]) - sys.exit(1) - -print('Searching for ps2avrGB... ', end='') - -dev = usb.core.find(idVendor=0x20A0, idProduct=0x422D) -if dev is None: - raise ValueError('Device not found') - -print('Found', end='\n\n') - -print('Device Information:') -print(' idVendor: %d (0x%04x)' % (dev.idVendor, dev.idVendor)) -print(' idProduct: %d (0x%04x)' % (dev.idProduct, dev.idProduct)) -print('Manufacturer: %s' % (dev.iManufacturer)) -print('Serial: %s' % (dev.iSerialNumber)) -print('Product: %s' % (dev.iProduct), end='\n\n') - -print('Transferring control to bootloader... ', end='') - -dev.set_configuration() - -request_type = usb.util.build_request_type( - usb.util.CTRL_OUT, - usb.util.CTRL_TYPE_CLASS, - usb.util.CTRL_RECIPIENT_DEVICE) - -USBRQ_HID_SET_REPORT = 0x09 -HID_REPORT_OPTION = 0x0301 - - -try: - dev.ctrl_transfer( - request_type, - USBRQ_HID_SET_REPORT, - HID_REPORT_OPTION, - 0, - [0, 0, 0xFF] + [0] * 5 - ) -except usb.core.USBError: - # for some reason I keep getting USBError, but it works! - pass - -# wait a bit until bootloader starts up -time.sleep(2) - -print('OK') -print('Programming...') -if os.system('bootloadHID -r "%s"' % sys.argv[1]) == 0: - print('\nDone!') diff --git a/keyboards/ymd75/rules.mk b/keyboards/ymd75/rules.mk index 9697a76f1e..9d09d3da94 100644 --- a/keyboards/ymd75/rules.mk +++ b/keyboards/ymd75/rules.mk @@ -59,4 +59,4 @@ SRC = matrix.c i2c.c backlight.c # programming options -PROGRAM_CMD = ./keyboards/ps2avrGB/program $(TARGET).hex +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/ymd96/keymaps/default/keymap.c b/keyboards/ymd96/keymaps/default/keymap.c index 9d0a8261dc..3d54c7395c 100644 --- a/keyboards/ymd96/keymaps/default/keymap.c +++ b/keyboards/ymd96/keymaps/default/keymap.c @@ -16,9 +16,7 @@ You should have received a copy of the GNU General Public LicensezZZ along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "ymd96.h" -#include "action_layer.h" -#include "rgblight.h" +#include QMK_KEYBOARD_H #define ______ KC_TRNS #define _DEFLT 0 @@ -27,7 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define KEYMAP KEYMAP_DEFAULT const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - + /* Layer 0, default layer * | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |Print | Home | End |Insert|Delete| PgUp | 19 keys * | ~` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BkSpc |NumLck| / | * | PgDn | 18 keys @@ -36,7 +34,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | LShft | Z | X | C | V | B | N | M | , | . | / | RShft | 1 | 2 | 3 | En | 16 keys * | Ctrl | Win | Alt | Space | Fn | Win | Left | Down | Up | Right| 0 | . | | 12 keys */ - + [_DEFLT] = KEYMAP( 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_PSCR, KC_HOME, KC_END, KC_INSERT, KC_DELETE, KC_PGUP, \ 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_NUMLOCK, KC_KP_SLASH, KC_KP_ASTERISK, KC_PGDN, \ @@ -52,7 +50,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | | | | | | * | | | | | | | | | VolDn| VolUp| Mute | Play/Pause | | | | | * | | | | | | |MPrev | | | MNext| | | | - */ + */ [_RAISE] = KEYMAP( ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ @@ -61,4 +59,4 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ______, ______, ______, ______, ______, ______, ______, ______, KC_VOLD,KC_VOLU, KC_MUTE, KC_MPLY, ______, ______, ______, ______, \ ______, ______, ______, ______, ______, ______, KC_MPRV, ______, ______, KC_MNXT, ______, ______ \ ) -};
\ No newline at end of file +}; diff --git a/keyboards/ymd96/program b/keyboards/ymd96/program deleted file mode 100644 index a88d9cd9b0..0000000000 --- a/keyboards/ymd96/program +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env python -# Copyright 2017 Luiz Ribeiro <luizribeiro@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/>. - -from __future__ import print_function - -import os -import sys -import time -import usb - -if len(sys.argv) < 2: - print('Usage: %s <firmware.hex>' % sys.argv[0]) - sys.exit(1) - -print('Searching for ps2avrGB... ', end='') - -dev = usb.core.find(idVendor=0x20A0, idProduct=0x422D) -if dev is None: - raise ValueError('Device not found') - -print('Found', end='\n\n') - -print('Device Information:') -print(' idVendor: %d (0x%04x)' % (dev.idVendor, dev.idVendor)) -print(' idProduct: %d (0x%04x)' % (dev.idProduct, dev.idProduct)) -print('Manufacturer: %s' % (dev.iManufacturer)) -print('Serial: %s' % (dev.iSerialNumber)) -print('Product: %s' % (dev.iProduct), end='\n\n') - -print('Transferring control to bootloader... ', end='') - -dev.set_configuration() - -request_type = usb.util.build_request_type( - usb.util.CTRL_OUT, - usb.util.CTRL_TYPE_CLASS, - usb.util.CTRL_RECIPIENT_DEVICE) - -USBRQ_HID_SET_REPORT = 0x09 -HID_REPORT_OPTION = 0x0301 - - -try: - dev.ctrl_transfer( - request_type, - USBRQ_HID_SET_REPORT, - HID_REPORT_OPTION, - 0, - [0, 0, 0xFF] + [0] * 5 - ) -except usb.core.USBError: - # for some reason I keep getting USBError, but it works! - pass - -# wait a bit until bootloader starts up -time.sleep(2) - -print('OK') -print('Programming...') -if os.system('bootloadHID -r "%s"' % sys.argv[1]) == 0: - print('\nDone!') diff --git a/keyboards/zeal60/config.h b/keyboards/zeal60/config.h index e39b06cf6b..a5e41116dc 100644 --- a/keyboards/zeal60/config.h +++ b/keyboards/zeal60/config.h @@ -86,9 +86,19 @@ // disable backlight after timeout in minutes, 0 = no timeout #define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0 +// the default brightness +#define RGB_BACKLIGHT_BRIGHTNESS 255 + // the default effect (RGB test) #define RGB_BACKLIGHT_EFFECT 255 +// the default effect speed (0-3) +#define RGB_BACKLIGHT_EFFECT_SPEED 0 + +// the default color1 and color2 +#define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 } +#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 } + // These define which keys in the matrix are alphas/mods // Used for backlight effects so colors are different for // alphas vs. mods @@ -100,6 +110,11 @@ #define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0011000000000001 #define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0011110000000111 +#define RGB_BACKLIGHT_CAPS_LOCK_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_1_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_2_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_3_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } + #define DYNAMIC_KEYMAP_LAYER_COUNT 4 // EEPROM usage diff --git a/keyboards/zeal60/rgb_backlight.c b/keyboards/zeal60/rgb_backlight.c index a965a13bbd..d5f206fdce 100644 --- a/keyboards/zeal60/rgb_backlight.c +++ b/keyboards/zeal60/rgb_backlight.c @@ -69,15 +69,15 @@ backlight_config g_config = { .disable_hhkb_blocker_leds = RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS, .disable_when_usb_suspended = RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED, .disable_after_timeout = RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT, - .brightness = 255, + .brightness = RGB_BACKLIGHT_BRIGHTNESS, .effect = RGB_BACKLIGHT_EFFECT, - .effect_speed = 0, - .color_1 = { .h = 0, .s = 255 }, - .color_2 = { .h = 127, .s = 255 }, - .caps_lock_indicator = { .color = { .h = 0, .s = 0 }, .index = 255 }, - .layer_1_indicator = { .color = { .h = 0, .s = 0 }, .index = 255 }, - .layer_2_indicator = { .color = { .h = 0, .s = 0 }, .index = 255 }, - .layer_3_indicator = { .color = { .h = 0, .s = 0 }, .index = 255 }, + .effect_speed = RGB_BACKLIGHT_EFFECT_SPEED, + .color_1 = RGB_BACKLIGHT_COLOR_1, + .color_2 = RGB_BACKLIGHT_COLOR_2, + .caps_lock_indicator = RGB_BACKLIGHT_CAPS_LOCK_INDICATOR, + .layer_1_indicator = RGB_BACKLIGHT_LAYER_1_INDICATOR, + .layer_2_indicator = RGB_BACKLIGHT_LAYER_2_INDICATOR, + .layer_3_indicator = RGB_BACKLIGHT_LAYER_3_INDICATOR, .alphas_mods = { RGB_BACKLIGHT_ALPHAS_MODS_ROW_0, RGB_BACKLIGHT_ALPHAS_MODS_ROW_1, diff --git a/keyboards/zeal60/zeal60_api.h b/keyboards/zeal60/zeal60_api.h index 8061146fde..048344d712 100644 --- a/keyboards/zeal60/zeal60_api.h +++ b/keyboards/zeal60/zeal60_api.h @@ -43,6 +43,7 @@ enum zeal60_command_id enum zeal60_keyboard_value_id { - id_uptime = 0x01 + id_uptime = 0x01, + id_firmware_version }; diff --git a/keyboards/zeal65/config.h b/keyboards/zeal65/config.h index 7406be865b..224fce1f65 100644 --- a/keyboards/zeal65/config.h +++ b/keyboards/zeal65/config.h @@ -86,9 +86,19 @@ // disable backlight after timeout in minutes, 0 = no timeout #define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0 +// the default brightness +#define RGB_BACKLIGHT_BRIGHTNESS 255 + // the default effect (RGB test) #define RGB_BACKLIGHT_EFFECT 255 +// the default effect speed (0-3) +#define RGB_BACKLIGHT_EFFECT_SPEED 0 + +// the default color1 and color2 +#define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 } +#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 } + // These define which keys in the matrix are alphas/mods // Used for backlight effects so colors are different for // alphas vs. mods @@ -100,6 +110,11 @@ #define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0111000000000001 #define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0111110000000011 +#define RGB_BACKLIGHT_CAPS_LOCK_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_1_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_2_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_3_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } + #define DYNAMIC_KEYMAP_LAYER_COUNT 4 // EEPROM usage diff --git a/keyboards/zen/keymaps/default/config.h b/keyboards/zen/keymaps/default/config.h index 38e4d73f0d..d813085e46 100644 --- a/keyboards/zen/keymaps/default/config.h +++ b/keyboards/zen/keymaps/default/config.h @@ -15,10 +15,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "config_common.h" +// place overrides here /* Use I2C or Serial, not both */ @@ -37,5 +36,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 - -#endif diff --git a/keyboards/zen/matrix.c b/keyboards/zen/matrix.c index 6e274d3bac..34655237b5 100644 --- a/keyboards/zen/matrix.c +++ b/keyboards/zen/matrix.c @@ -133,7 +133,7 @@ void matrix_init(void) matrix_debouncing[i] = 0; } - + matrix_init_quantum(); } uint8_t _matrix_scan(void) @@ -264,6 +264,7 @@ uint8_t matrix_scan(void) TXLED0; error_count = 0; } + matrix_scan_quantum(); return ret; } |