diff options
| -rw-r--r-- | keyboards/crkbd/keymaps/jarred/config.h | 44 | ||||
| -rw-r--r-- | keyboards/crkbd/keymaps/jarred/keymap.c | 182 | ||||
| -rw-r--r-- | keyboards/crkbd/keymaps/jarred/readme.md | 9 | ||||
| -rw-r--r-- | keyboards/crkbd/keymaps/jarred/rules.mk | 31 |
4 files changed, 266 insertions, 0 deletions
diff --git a/keyboards/crkbd/keymaps/jarred/config.h b/keyboards/crkbd/keymaps/jarred/config.h new file mode 100644 index 000000000..ac4c1cc88 --- /dev/null +++ b/keyboards/crkbd/keymaps/jarred/config.h | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | /* | ||
| 2 | This is the c configuration file for the keymap | ||
| 3 | |||
| 4 | Copyright 2012 Jun Wako <wakojun@gmail.com> | ||
| 5 | Copyright 2015 Jack Humbert | ||
| 6 | |||
| 7 | This program is free software: you can redistribute it and/or modify | ||
| 8 | it under the terms of the GNU General Public License as published by | ||
| 9 | the Free Software Foundation, either version 2 of the License, or | ||
| 10 | (at your option) any later version. | ||
| 11 | |||
| 12 | This program is distributed in the hope that it will be useful, | ||
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | GNU General Public License for more details. | ||
| 16 | |||
| 17 | You should have received a copy of the GNU General Public License | ||
| 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 19 | */ | ||
| 20 | |||
| 21 | #pragma once | ||
| 22 | |||
| 23 | //#define USE_MATRIX_I2C | ||
| 24 | |||
| 25 | /* Select hand configuration */ | ||
| 26 | |||
| 27 | #define MASTER_LEFT | ||
| 28 | // #define MASTER_RIGHT | ||
| 29 | // #define EE_HANDS | ||
| 30 | |||
| 31 | #define SSD1306OLED | ||
| 32 | |||
| 33 | #define USE_SERIAL_PD2 | ||
| 34 | |||
| 35 | //#define TAPPING_FORCE_HOLD | ||
| 36 | //#define TAPPING_TERM 100 | ||
| 37 | |||
| 38 | #undef RGBLED_NUM | ||
| 39 | #define RGBLIGHT_ANIMATIONS | ||
| 40 | #define RGBLED_NUM 27 | ||
| 41 | #define RGBLIGHT_LIMIT_VAL 120 | ||
| 42 | #define RGBLIGHT_HUE_STEP 10 | ||
| 43 | #define RGBLIGHT_SAT_STEP 17 | ||
| 44 | #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 000000000..f00a735bf --- /dev/null +++ b/keyboards/crkbd/keymaps/jarred/keymap.c | |||
| @@ -0,0 +1,182 @@ | |||
| 1 | #include QMK_KEYBOARD_H | ||
| 2 | #include "jarred.h" | ||
| 3 | |||
| 4 | #ifdef PROTOCOL_LUFA | ||
| 5 | #include "lufa.h" | ||
| 6 | #include "split_util.h" | ||
| 7 | #endif | ||
| 8 | #ifdef SSD1306OLED | ||
| 9 | #include "ssd1306.h" | ||
| 10 | #endif | ||
| 11 | |||
| 12 | extern keymap_config_t keymap_config; | ||
| 13 | extern uint8_t is_master; | ||
| 14 | |||
| 15 | #ifdef RGBLIGHT_ENABLE | ||
| 16 | //Following line allows macro to read current RGB settings | ||
| 17 | extern rgblight_config_t rgblight_config; | ||
| 18 | #endif | ||
| 19 | |||
| 20 | #define LAYOUT_crkbd_base( \ | ||
| 21 | K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, \ | ||
| 22 | K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \ | ||
| 23 | K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ | ||
| 24 | K31, K32, K33, K34, K35, K36 \ | ||
| 25 | ) | ||
| 26 | |||
| 27 | #define LAYOUT_crkbd_wrapper(...) LAYOUT(__VA_ARGS__) | ||
| 28 | |||
| 29 | #define QWERTY_4_CRKBD KC_LCTL, MO(_LW), KC_SPC, KC_ENT, MO(_LW), KC_RALT | ||
| 30 | |||
| 31 | #define BLANK_4_CRKBD KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS | ||
| 32 | |||
| 33 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 34 | [_QW] = LAYOUT_crkbd_wrapper( | ||
| 35 | QWERTY_1_12, | ||
| 36 | QWERTY_2_12, | ||
| 37 | QWERTY_3_12, | ||
| 38 | QWERTY_4_DOX | ||
| 39 | ), | ||
| 40 | |||
| 41 | [_LW] = LAYOUT_crkbd_wrapper( | ||
| 42 | LOWER_1_12, | ||
| 43 | LOWER_2_12, | ||
| 44 | LOWER_3_12, | ||
| 45 | LOWER_4_DOX | ||
| 46 | ), | ||
| 47 | |||
| 48 | [_NV] = LAYOUT_crkbd_wrapper( | ||
| 49 | NAV_1_12, | ||
| 50 | NAV_2_12, | ||
| 51 | NAV_3_12, | ||
| 52 | NAV_4_DOX | ||
| 53 | ), | ||
| 54 | |||
| 55 | [_NP] = LAYOUT_crkbd_wrapper( | ||
| 56 | NUMPAD_1_12, | ||
| 57 | NUMPAD_2_12, | ||
| 58 | NUMPAD_3_12, | ||
| 59 | NUMPAD_4_DOX | ||
| 60 | ), | ||
| 61 | |||
| 62 | [_MS] = LAYOUT_crkbd_wrapper( | ||
| 63 | MOUSE_1_12, | ||
| 64 | MOUSE_2_12, | ||
| 65 | MOUSE_3_12, | ||
| 66 | MOUSE_4_DOX | ||
| 67 | ) | ||
| 68 | }; | ||
| 69 | |||
| 70 | void matrix_init_user(void) { | ||
| 71 | //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h | ||
| 72 | #ifdef SSD1306OLED | ||
| 73 | iota_gfx_init(!has_usb()); // turns on the display | ||
| 74 | #endif | ||
| 75 | } | ||
| 76 | |||
| 77 | //SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h | ||
| 78 | #ifdef SSD1306OLED | ||
| 79 | |||
| 80 | // When add source files to SRC in rules.mk, you can use functions. | ||
| 81 | const char *read_logo(void); | ||
| 82 | void set_keylog(uint16_t keycode, keyrecord_t *record); | ||
| 83 | const char *read_keylog(void); | ||
| 84 | const char *read_keylogs(void); | ||
| 85 | |||
| 86 | char matrix_line_str[24]; | ||
| 87 | |||
| 88 | const char *read_layer_state(void) { | ||
| 89 | uint8_t layer = biton32(layer_state); | ||
| 90 | |||
| 91 | strcpy(matrix_line_str, "Layer: "); | ||
| 92 | |||
| 93 | switch (layer) | ||
| 94 | { | ||
| 95 | case _QW: | ||
| 96 | strcat(matrix_line_str, "Default"); | ||
| 97 | break; | ||
| 98 | case _LW: | ||
| 99 | strcat(matrix_line_str, "Lower"); | ||
| 100 | break; | ||
| 101 | case _NV: | ||
| 102 | strcat(matrix_line_str, "Navigation"); | ||
| 103 | break; | ||
| 104 | case _NP: | ||
| 105 | strcat(matrix_line_str, "Adjust"); | ||
| 106 | break; | ||
| 107 | case _MS: | ||
| 108 | strcat(matrix_line_str, "Mouse"); | ||
| 109 | break; | ||
| 110 | default: | ||
| 111 | sprintf(matrix_line_str + strlen(matrix_line_str), "Unknown (%d)", layer); | ||
| 112 | } | ||
| 113 | |||
| 114 | return matrix_line_str; | ||
| 115 | } | ||
| 116 | |||
| 117 | const char *read_usb_state(void) { | ||
| 118 | |||
| 119 | strcpy(matrix_line_str, "USB : "); | ||
| 120 | |||
| 121 | switch (USB_DeviceState) { | ||
| 122 | case DEVICE_STATE_Unattached: | ||
| 123 | strcat(matrix_line_str, "Unattached"); | ||
| 124 | break; | ||
| 125 | case DEVICE_STATE_Suspended: | ||
| 126 | strcat(matrix_line_str, "Suspended"); | ||
| 127 | break; | ||
| 128 | case DEVICE_STATE_Configured: | ||
| 129 | strcat(matrix_line_str, "Connected"); | ||
| 130 | break; | ||
| 131 | case DEVICE_STATE_Powered: | ||
| 132 | strcat(matrix_line_str, "Powered"); | ||
| 133 | break; | ||
| 134 | case DEVICE_STATE_Default: | ||
| 135 | strcat(matrix_line_str, "Default"); | ||
| 136 | break; | ||
| 137 | case DEVICE_STATE_Addressed: | ||
| 138 | strcat(matrix_line_str, "Addressed"); | ||
| 139 | break; | ||
| 140 | default: | ||
| 141 | strcat(matrix_line_str, "Invalid"); | ||
| 142 | } | ||
| 143 | |||
| 144 | return matrix_line_str; | ||
| 145 | } | ||
| 146 | |||
| 147 | void matrix_scan_user(void) { | ||
| 148 | iota_gfx_task(); | ||
| 149 | } | ||
| 150 | |||
| 151 | void matrix_render_user(struct CharacterMatrix *matrix) { | ||
| 152 | if (is_master) { | ||
| 153 | matrix_write_ln(matrix, read_layer_state()); | ||
| 154 | matrix_write_ln(matrix, read_usb_state()); | ||
| 155 | matrix_write_ln(matrix, read_keylogs()); | ||
| 156 | } else { | ||
| 157 | matrix_write(matrix, read_logo()); | ||
| 158 | } | ||
| 159 | } | ||
| 160 | |||
| 161 | void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { | ||
| 162 | if (memcmp(dest->display, source->display, sizeof(dest->display))) { | ||
| 163 | memcpy(dest->display, source->display, sizeof(dest->display)); | ||
| 164 | dest->dirty = true; | ||
| 165 | } | ||
| 166 | } | ||
| 167 | |||
| 168 | void iota_gfx_task_user(void) { | ||
| 169 | struct CharacterMatrix matrix; | ||
| 170 | matrix_clear(&matrix); | ||
| 171 | matrix_render_user(&matrix); | ||
| 172 | matrix_update(&display, &matrix); | ||
| 173 | } | ||
| 174 | #endif//SSD1306OLED | ||
| 175 | |||
| 176 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { | ||
| 177 | if (record->event.pressed) { | ||
| 178 | set_keylog(keycode, record); | ||
| 179 | } | ||
| 180 | |||
| 181 | return true; | ||
| 182 | } | ||
diff --git a/keyboards/crkbd/keymaps/jarred/readme.md b/keyboards/crkbd/keymaps/jarred/readme.md new file mode 100644 index 000000000..15e355bbc --- /dev/null +++ b/keyboards/crkbd/keymaps/jarred/readme.md | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | # Jarred's CRKBD Layout | ||
| 2 | |||
| 3 | Check out [user space readme](../../../../users/jarred/readme.md) for more info | ||
| 4 | |||
| 5 | # Build | ||
| 6 | |||
| 7 | ``` | ||
| 8 | make crkbd:jarred:avrdude | ||
| 9 | ``` | ||
diff --git a/keyboards/crkbd/keymaps/jarred/rules.mk b/keyboards/crkbd/keymaps/jarred/rules.mk new file mode 100644 index 000000000..ab6329f0e --- /dev/null +++ b/keyboards/crkbd/keymaps/jarred/rules.mk | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | |||
| 2 | # Build Options | ||
| 3 | # change to "no" to disable the options, or define them in the Makefile in | ||
| 4 | # the appropriate keymap folder that will get included automatically | ||
| 5 | # | ||
| 6 | BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) | ||
| 7 | MOUSEKEY_ENABLE = no # Mouse keys(+4700) | ||
| 8 | EXTRAKEY_ENABLE = no # Audio control and System control(+450) | ||
| 9 | CONSOLE_ENABLE = no # Console for debug(+400) | ||
| 10 | COMMAND_ENABLE = no # Commands for debug and configuration | ||
| 11 | NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | ||
| 12 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | ||
| 13 | MIDI_ENABLE = no # MIDI controls | ||
| 14 | AUDIO_ENABLE = no # Audio output on port C6 | ||
| 15 | UNICODE_ENABLE = no # Unicode | ||
| 16 | BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID | ||
| 17 | RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. | ||
| 18 | SWAP_HANDS_ENABLE = no # Enable one-hand typing | ||
| 19 | |||
| 20 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | ||
| 21 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | ||
| 22 | |||
| 23 | # If you want to change the display of OLED, you need to change here | ||
| 24 | SRC += ./lib/glcdfont.c \ | ||
| 25 | ./lib/rgb_state_reader.c \ | ||
| 26 | ./lib/logo_reader.c \ | ||
| 27 | ./lib/keylogger.c \ | ||
| 28 | #./lib/layer_state_reader.c \ | ||
| 29 | # ./lib/mode_icon_reader.c \ | ||
| 30 | # ./lib/host_led_state_reader.c \ | ||
| 31 | # ./lib/timelogger.c \ | ||
