diff options
| author | Anne Demey <anneyvdemey@gmail.com> | 2020-10-23 17:14:17 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-23 15:14:17 -0700 |
| commit | d689f76110ee20e45d6531eac31bf72461ed504b (patch) | |
| tree | abcf9cd25057cff9d5532b9ae2c41dad1514c015 /keyboards/terrazzo | |
| parent | 5d2deaca069834843bacb5769787c907bdd6bf15 (diff) | |
| download | qmk_firmware-d689f76110ee20e45d6531eac31bf72461ed504b.tar.gz qmk_firmware-d689f76110ee20e45d6531eac31bf72461ed504b.zip | |
[Keyboard] Add Terrazzo Keyboard (#10408)
* Ciao Terrazzo!
* Keymap updates
* Adding info json
Cleaning up keymap files
Readme updates with template
* Coding style updates
* Removing vscode files
* PR feedback updates
* biton32 -> get_highest_layer update
Adding license headers
Diffstat (limited to 'keyboards/terrazzo')
| -rw-r--r-- | keyboards/terrazzo/README.md | 125 | ||||
| -rw-r--r-- | keyboards/terrazzo/config.h | 104 | ||||
| -rw-r--r-- | keyboards/terrazzo/info.json | 41 | ||||
| -rw-r--r-- | keyboards/terrazzo/keymaps/default/keymap.c | 85 | ||||
| -rw-r--r-- | keyboards/terrazzo/keymaps/ortho/keymap.c | 84 | ||||
| -rw-r--r-- | keyboards/terrazzo/keymaps/ortho_all/keymap.c | 84 | ||||
| -rw-r--r-- | keyboards/terrazzo/keymaps/ortho_mit/keymap.c | 82 | ||||
| -rw-r--r-- | keyboards/terrazzo/rules.mk | 33 | ||||
| -rw-r--r-- | keyboards/terrazzo/terrazzo.c | 165 | ||||
| -rw-r--r-- | keyboards/terrazzo/terrazzo.h | 122 | ||||
| -rw-r--r-- | keyboards/terrazzo/terrazzo_effects/dino.h | 162 | ||||
| -rw-r--r-- | keyboards/terrazzo/terrazzo_effects/dot.h | 27 | ||||
| -rw-r--r-- | keyboards/terrazzo/terrazzo_effects/heart.h | 99 | ||||
| -rw-r--r-- | keyboards/terrazzo/terrazzo_effects/outrun.h | 127 | ||||
| -rw-r--r-- | keyboards/terrazzo/terrazzo_effects/pac_dude.h | 67 | ||||
| -rw-r--r-- | keyboards/terrazzo/terrazzo_effects/stripes.h | 35 | ||||
| -rw-r--r-- | keyboards/terrazzo/terrazzo_effects/terrazzo_effects.inc | 7 | ||||
| -rw-r--r-- | keyboards/terrazzo/terrazzo_effects/wpm_chart.h | 111 |
18 files changed, 1560 insertions, 0 deletions
diff --git a/keyboards/terrazzo/README.md b/keyboards/terrazzo/README.md new file mode 100644 index 000000000..08cecd6a6 --- /dev/null +++ b/keyboards/terrazzo/README.md | |||
| @@ -0,0 +1,125 @@ | |||
| 1 | # Terrazzo | ||
| 2 | |||
| 3 |  | ||
| 4 | |||
| 5 | Terrazzo is a 40% pro micro keyboard kit with a fun, hot-swapable LED module. It is offered in both staggered and ortholinear variations, each with multiple layout options. A left hand macro column has 4 positions for switches or rotary encoders. | ||
| 6 | |||
| 7 | Extended layout options and multiple encoder support will require use of an Elite-C controller. Key switch support is MX soldered only. | ||
| 8 | |||
| 9 | * Keyboard Maintainer: MsMustard, [Anne Demey](https://github.com/ademey) | ||
| 10 | * Hardware Supported: Terrazzo v1 & v2 PCB in staggered and ortholinear | ||
| 11 | |||
| 12 | Make example for this keyboard (after setting up your build environment): | ||
| 13 | |||
| 14 | - `make terrazzo:default` Split spacebar staggered layout | ||
| 15 | - `make terrazzo:ortho` 2 x 2u spacebar ortho layout | ||
| 16 | - `make terrazzo:ortho_mit` 2u spacebar ortho layout | ||
| 17 | - `make terrazzo:ortho_all` All 1u ortho layout | ||
| 18 | |||
| 19 | 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). | ||
| 20 | |||
| 21 | ## Parts List | ||
| 22 | - 1 PCB (staggered or ortho) | ||
| 23 | - 1 LED module ([red](https://www.digikey.com/product-detail/en/adafruit-industries-llc/3134/1528-1699-ND/6058480), [green](https://www.digikey.com/product-detail/en/adafruit-industries-llc/3136/1528-1701-ND/6058482), [yellow](https://www.digikey.com/short/zbttp5), [blue](https://www.digikey.com/product-detail/en/adafruit-industries-llc/3137/1528-1702-ND/6058483), or [white](https://www.digikey.com/product-detail/en/adafruit-industries-llc/3138/1528-1703-ND/6058484)) | ||
| 24 | - [1 Rotary encoder](https://www.digikey.com/short/zbttzn) | ||
| 25 | - 1 Knurled knob ([black](https://www.digikey.com/short/zbttz4) or [silver](https://www.digikey.com/short/zbttz4)) | ||
| 26 | - [SMD diodes](https://www.digikey.com/short/zbttzr) | ||
| 27 | - [Reset switch](https://www.digikey.com/short/zbttz1) | ||
| 28 | - Mill-max female headers ([12](https://www.digikey.com/short/zbtt42) & [5](https://www.digikey.com/short/zbttmt) pins) and [through-hole diodes](https://www.digikey.com/short/zbttmj) to aid in socketing a pro micro | ||
| 29 | - Mill-max [male](https://www.digikey.com/short/zbttm5) & [female](https://www.digikey.com/short/zbttm4) headers for LED module | ||
| 30 | |||
| 31 | ## Custom Keycodes | ||
| 32 | |||
| 33 | Terrazzo has several custom keycodes for LED control. | ||
| 34 | |||
| 35 | | Key | Description | | ||
| 36 | |-----|-------------| | ||
| 37 | | `TZ_NXT` | Next Animation | | ||
| 38 | | `TZ_PRV` | Previous Animation | | ||
| 39 | | `TZ_OFF` | LED Off | | ||
| 40 | |||
| 41 | ## LED Animations | ||
| 42 | |||
| 43 | LED animations for Terrazzo are reactive to keyboard input. Each key press or encoder turn increments an internal counter, looping through the number of individual LEDs. | ||
| 44 | |||
| 45 | This counter (`terrazzo_led_index`) is used as a seed for the animation functions, along with a boolean indicating the direction. Turning the encoder counter-clockwise, or pressing backspace will decrement the counter, allowing for animations to reverse or display alternative frames. | ||
| 46 | |||
| 47 | The current animations are: | ||
| 48 | |||
| 49 | - DINO: It's like your internet went out | ||
| 50 | - DOT: Just a single led at a time, for debugging | ||
| 51 | - HEART: Love you too | ||
| 52 | - OUTRUN: Driving into the sunset | ||
| 53 | - PAC_DUDE: Vintage arcade fun | ||
| 54 | - STRIPES: Just a nice gradient | ||
| 55 | - WPM_CHART: 2 digit readout with lights indicating speed, each pixel = 2 wpm | ||
| 56 | |||
| 57 | Not all animations are enabled by default. You can enable or disable animations in the `config.h` file to limit firmware size. | ||
| 58 | |||
| 59 | ``` | ||
| 60 | // #define DISABLE_TERRAZZO_EFFECT_STRIPES | ||
| 61 | // #define DISABLE_TERRAZZO_EFFECT_DINO | ||
| 62 | // #define DISABLE_TERRAZZO_EFFECT_OUTRUN | ||
| 63 | #define DISABLE_TERRAZZO_EFFECT_PAC_DUDE | ||
| 64 | #define DISABLE_TERRAZZO_EFFECT_HEART | ||
| 65 | // #define DISABLE_TERRAZZO_EFFECT_WPM_CHART | ||
| 66 | #define DISABLE_TERRAZZO_EFFECT_DOT | ||
| 67 | ``` | ||
| 68 | |||
| 69 | ## Microcontroller Support | ||
| 70 | |||
| 71 | Terrazzo is designed for use with a Pro Micro (or compatible, like Bit-C), or an Elite-C. The extra pinouts of an Elite-C are required for the ortho MIT and ALL layouts and multiple encoders. By default the firmware is set up for an Elite-C. For a Pro Micro some changes to `config.h` are needed. | ||
| 72 | |||
| 73 | Change number of rows from 9 to 8. | ||
| 74 | ``` | ||
| 75 | #define MATRIX_ROWS 8 | ||
| 76 | ``` | ||
| 77 | |||
| 78 | Change pinouts, Pro Micro does not have the "F0" pin. | ||
| 79 | ``` | ||
| 80 | #define MATRIX_ROW_PINS { D2, D7, E6, B4, B5, B6, B2, B3 } | ||
| 81 | ``` | ||
| 82 | |||
| 83 | Set encoder to just top or bottom position. | ||
| 84 | ``` | ||
| 85 | #define ENCODERS_PAD_A { C6 } | ||
| 86 | #define ENCODERS_PAD_B { D4 } | ||
| 87 | ``` | ||
| 88 | |||
| 89 | ## Encoder Setup | ||
| 90 | |||
| 91 | Terrazzo has 4 positions for encoders in the left-hand column. Up to 3 may be used at a time, but this requires the extra pins of an Elite-C. Please refer to `config.h` for examples of pin configurations. | ||
| 92 | |||
| 93 | The default keymaps are setup for one encoder. Encoders can change behavior based on the current layer. Here, on the "NAV" layer, the encoder changes volume instead of scrolling. | ||
| 94 | |||
| 95 | ```c | ||
| 96 | void encoder_update_user(uint8_t index, bool clockwise) { | ||
| 97 | terrazzo_scroll_pixel(clockwise); | ||
| 98 | switch(get_highest_layer(layer_state)) { | ||
| 99 | case _NAV: | ||
| 100 | // Change volume when on nav layer | ||
| 101 | clockwise ? tap_code(KC_AUDIO_VOL_UP) : tap_code(KC_AUDIO_VOL_DOWN); | ||
| 102 | break; | ||
| 103 | default: | ||
| 104 | // Default encoder behavior of Page Up and Down | ||
| 105 | clockwise ? tap_code(KC_PGDN) : tap_code(KC_PGUP); | ||
| 106 | break; | ||
| 107 | } | ||
| 108 | } | ||
| 109 | ``` | ||
| 110 | |||
| 111 | If using multiple encoders, the `index` param can be used to distingish which is providing input. | ||
| 112 | |||
| 113 | ```c | ||
| 114 | void encoder_update_user(uint8_t index, bool clockwise) { | ||
| 115 | terrazzo_scroll_pixel(clockwise); | ||
| 116 | switch(index) { | ||
| 117 | case 0: | ||
| 118 | clockwise ? tap_code(KC_PGDN) : tap_code(KC_PGUP); | ||
| 119 | break; | ||
| 120 | case 1: | ||
| 121 | clockwise ? tap_code(KC_AUDIO_VOL_UP) : tap_code(KC_AUDIO_VOL_DOWN); | ||
| 122 | break; | ||
| 123 | } | ||
| 124 | } | ||
| 125 | ``` \ No newline at end of file | ||
diff --git a/keyboards/terrazzo/config.h b/keyboards/terrazzo/config.h new file mode 100644 index 000000000..4b1dac706 --- /dev/null +++ b/keyboards/terrazzo/config.h | |||
| @@ -0,0 +1,104 @@ | |||
| 1 | /* Copyright 2020 ademey "MsMustard" | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | #pragma once | ||
| 17 | |||
| 18 | #include "config_common.h" | ||
| 19 | |||
| 20 | |||
| 21 | /* USB Device descriptor parameter */ | ||
| 22 | #define VENDOR_ID 0x4d4d // MM | ||
| 23 | #define PRODUCT_ID 0x545a // TZ | ||
| 24 | #define DEVICE_VER 0x0002 | ||
| 25 | #define MANUFACTURER MsMustard | ||
| 26 | #define PRODUCT Terrazzo | ||
| 27 | |||
| 28 | /* key matrix size */ | ||
| 29 | |||
| 30 | // SWAP FOR PRO MICRO | ||
| 31 | // #define MATRIX_ROWS 8 | ||
| 32 | #define MATRIX_ROWS 9 | ||
| 33 | #define MATRIX_COLS 6 | ||
| 34 | |||
| 35 | /* key matrix pins */ | ||
| 36 | |||
| 37 | // SWAP FOR PRO MICRO | ||
| 38 | // #define MATRIX_ROW_PINS { D2, D7, E6, B4, B5, B6, B2, B3 } | ||
| 39 | #define MATRIX_ROW_PINS { D2, D7, E6, B4, B5, B6, B2, B3, F0 } | ||
| 40 | #define MATRIX_COL_PINS { D3, F4, F5, F6, F7, B1 } | ||
| 41 | |||
| 42 | #define UNUSED_PINS | ||
| 43 | #define DIODE_DIRECTION COL2ROW | ||
| 44 | |||
| 45 | /* ROTARY ENCODERS */ | ||
| 46 | |||
| 47 | /* 4 encoder positions are supported. With multiple | ||
| 48 | encoder support when using the extra pins of | ||
| 49 | Elite-C controller. | ||
| 50 | |||
| 51 | Use the following configuration guides for your | ||
| 52 | encoder layout. */ | ||
| 53 | |||
| 54 | /* PRO MICRO CONFIGURATIONS */ | ||
| 55 | |||
| 56 | /* If using a Pro Micro, only 1 encoder may be used, | ||
| 57 | and only in the top or bottom position. | ||
| 58 | Top and bottom encoders share the same net, | ||
| 59 | so there is only one configuration. */ | ||
| 60 | |||
| 61 | /* TOP or BOTTOM */ | ||
| 62 | // #define ENCODERS_PAD_A { C6 } | ||
| 63 | // #define ENCODERS_PAD_B { D4 } | ||
| 64 | |||
| 65 | /* ELITE-C ONLY CONFIGURATIONS */ | ||
| 66 | |||
| 67 | /* TOP 3 | ||
| 68 | Default configuration */ | ||
| 69 | #define ENCODERS_PAD_A { C6 , B7, C7 } | ||
| 70 | #define ENCODERS_PAD_B { D4 , D5, F1 } | ||
| 71 | |||
| 72 | /* BOTTOM 3 */ | ||
| 73 | // #define ENCODERS_PAD_A { B7, C7, C6 } | ||
| 74 | // #define ENCODERS_PAD_B { D5, F1, D4 } | ||
| 75 | |||
| 76 | /* BOTTOM 2 */ | ||
| 77 | // #define ENCODERS_PAD_A { C7, C6 } | ||
| 78 | // #define ENCODERS_PAD_B { F1, D4 } | ||
| 79 | |||
| 80 | |||
| 81 | #define ENCODER_RESOLUTION 2 | ||
| 82 | #define BACKLIGHT_LEVELS 5 | ||
| 83 | |||
| 84 | #ifdef LED_MATRIX_ENABLE | ||
| 85 | |||
| 86 | #define LED_DRIVER_ADDR_1 0x74 | ||
| 87 | #define LED_DRIVER_COUNT 1 | ||
| 88 | #define LED_DRIVER_LED_COUNT 105 | ||
| 89 | #define LED_MATRIX_ROWS 15 | ||
| 90 | #define LED_MATRIX_COLS 7 | ||
| 91 | #define LED_MATRIX_MAXIMUM_BRIGHTNESS 20 | ||
| 92 | #define LED_DISABLE_WHEN_USB_SUSPENDED true | ||
| 93 | |||
| 94 | #endif | ||
| 95 | |||
| 96 | /* Terrazzo animations */ | ||
| 97 | |||
| 98 | // #define DISABLE_TERRAZZO_EFFECT_STRIPES | ||
| 99 | // #define DISABLE_TERRAZZO_EFFECT_DINO | ||
| 100 | // #define DISABLE_TERRAZZO_EFFECT_OUTRUN | ||
| 101 | #define DISABLE_TERRAZZO_EFFECT_PAC_DUDE | ||
| 102 | #define DISABLE_TERRAZZO_EFFECT_HEART | ||
| 103 | // #define DISABLE_TERRAZZO_EFFECT_WPM_CHART | ||
| 104 | #define DISABLE_TERRAZZO_EFFECT_DOT | ||
diff --git a/keyboards/terrazzo/info.json b/keyboards/terrazzo/info.json new file mode 100644 index 000000000..d41a81c5d --- /dev/null +++ b/keyboards/terrazzo/info.json | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | { | ||
| 2 | "keyboard_name": "Terrazzo", | ||
| 3 | "url": "", | ||
| 4 | "maintainer": "MsMustard", | ||
| 5 | "width": 14.5, | ||
| 6 | "height": 4, | ||
| 7 | "layouts": { | ||
| 8 | "LAYOUT": { | ||
| 9 | "layout": [ | ||
| 10 | {"label":"Mute", "x":0, "y":0}, {"label":"Esc", "x":2.5, "y":0}, {"label":"Q", "x":3.5, "y":0}, {"label":"W", "x":4.5, "y":0}, {"label":"E", "x":5.5, "y":0}, {"label":"R", "x":6.5, "y":0}, {"label":"T", "x":7.5, "y":0}, {"label":"Y", "x":8.5, "y":0}, {"label":"U", "x":9.5, "y":0}, {"label":"I", "x":10.5, "y":0}, {"label":"O", "x":11.5, "y":0}, {"label":"P", "x":12.5, "y":0}, {"label":"Back", "x":13.5, "y":0}, | ||
| 11 | {"label":"TZ Nxt", "x":0, "y":1}, {"label":"Control", "x":2.5, "y":1, "w":1.25}, {"label":"A", "x":3.75, "y":1}, {"label":"S", "x":4.75, "y":1}, {"label":"D", "x":5.75, "y":1}, {"label":"F", "x":6.75, "y":1}, {"label":"G", "x":7.75, "y":1}, {"label":"H", "x":8.75, "y":1}, {"label":"J", "x":9.75, "y":1}, {"label":"K", "x":10.75, "y":1}, {"label":"L", "x":11.75, "y":1}, {"label":"Enter", "x":12.75, "y":1, "w":1.75}, | ||
| 12 | {"label":"TZ Prv", "x":0, "y":2}, {"label":"Shift", "x":2.5, "y":2, "w":1.75}, {"label":"Z", "x":4.25, "y":2}, {"label":"X", "x":5.25, "y":2}, {"label":"C", "x":6.25, "y":2}, {"label":"V", "x":7.25, "y":2}, {"label":"B", "x":8.25, "y":2}, {"label":"N", "x":9.25, "y":2}, {"label":"M", "x":10.25, "y":2}, {"label":"<", "x":11.25, "y":2}, {"label":">", "x":12.25, "y":2}, {"label":"Shift", "x":13.25, "y":2, "w":1.25}, | ||
| 13 | {"label":"TZ Off", "x":0, "y":3}, {"label":"Win", "x":3.5, "y":3}, {"label":"Alt", "x":4.5, "y":3, "w":1.5}, {"label":"Space", "x":6, "y":3, "w":2.25}, {"label":"Space", "x":8.25, "y":3, "w":2.75}, {"label":"Fn", "x":11, "y":3, "w":1.5}, {"label":"Fn1", "x":12.5, "y":3} | ||
| 14 | ] | ||
| 15 | }, | ||
| 16 | "LAYOUT_ortho": { | ||
| 17 | "layout": [ | ||
| 18 | {"label":"Mute", "x":0, "y":0}, {"label":"Esc", "x":2.5, "y":0}, {"label":"Q", "x":3.5, "y":0}, {"label":"W", "x":4.5, "y":0}, {"label":"E", "x":5.5, "y":0}, {"label":"R", "x":6.5, "y":0}, {"label":"T", "x":7.5, "y":0}, {"label":"Y", "x":8.5, "y":0}, {"label":"U", "x":9.5, "y":0}, {"label":"I", "x":10.5, "y":0}, {"label":"O", "x":11.5, "y":0}, {"label":"P", "x":12.5, "y":0}, {"label":"Back", "x":13.5, "y":0}, | ||
| 19 | {"label":"TZ Nxt", "x":0, "y":1}, {"label":"Ctrl", "x":2.5, "y":1}, {"label":"A", "x":3.5, "y":1}, {"label":"S", "x":4.5, "y":1}, {"label":"D", "x":5.5, "y":1}, {"label":"F", "x":6.5, "y":1}, {"label":"G", "x":7.5, "y":1}, {"label":"H", "x":8.5, "y":1}, {"label":"J", "x":9.5, "y":1}, {"label":"K", "x":10.5, "y":1}, {"label":"L", "x":11.5, "y":1}, {"label":";", "x":12.5, "y":1}, {"label":"Enter", "x":13.5, "y":1}, | ||
| 20 | {"label":"TZ Prv", "x":0, "y":2}, {"label":"Shift", "x":2.5, "y":2}, {"label":"Z", "x":3.5, "y":2}, {"label":"X", "x":4.5, "y":2}, {"label":"C", "x":5.5, "y":2}, {"label":"V", "x":6.5, "y":2}, {"label":"B", "x":7.5, "y":2}, {"label":"N", "x":8.5, "y":2}, {"label":"M", "x":9.5, "y":2}, {"label":"<", "x":10.5, "y":2}, {"label":">", "x":11.5, "y":2}, {"label":"/", "x":12.5, "y":2}, {"label":"Shift", "x":13.5, "y":2}, | ||
| 21 | {"label":"TZ Off", "x":0, "y":3}, {"label":"Win", "x":3.5, "y":3}, {"label":"Alt", "x":4.5, "y":3}, {"label":"Lower", "x":5.5, "y":3}, {"label":"Space", "x":6.5, "y":3, "w":2}, {"label":"Space", "x":8.5, "y":3, "w":2}, {"label":"Raise", "x":10.5, "y":3}, {"label":"Nav", "x":11.5, "y":3}, {"label":"Fn", "x":12.5, "y":3} | ||
| 22 | ] | ||
| 23 | }, | ||
| 24 | "LAYOUT_ortho_mit": { | ||
| 25 | "layout": [ | ||
| 26 | {"label":"Mute", "x":0, "y":0}, {"label":"Esc", "x":2.5, "y":0}, {"label":"Q", "x":3.5, "y":0}, {"label":"W", "x":4.5, "y":0}, {"label":"E", "x":5.5, "y":0}, {"label":"R", "x":6.5, "y":0}, {"label":"T", "x":7.5, "y":0}, {"label":"Y", "x":8.5, "y":0}, {"label":"U", "x":9.5, "y":0}, {"label":"I", "x":10.5, "y":0}, {"label":"O", "x":11.5, "y":0}, {"label":"P", "x":12.5, "y":0}, {"label":"Back", "x":13.5, "y":0}, | ||
| 27 | {"label":"TZ Nxt", "x":0, "y":1}, {"label":"Ctrl", "x":2.5, "y":1}, {"label":"A", "x":3.5, "y":1}, {"label":"S", "x":4.5, "y":1}, {"label":"D", "x":5.5, "y":1}, {"label":"F", "x":6.5, "y":1}, {"label":"G", "x":7.5, "y":1}, {"label":"H", "x":8.5, "y":1}, {"label":"J", "x":9.5, "y":1}, {"label":"K", "x":10.5, "y":1}, {"label":"L", "x":11.5, "y":1}, {"label":";", "x":12.5, "y":1}, {"label":"Enter", "x":13.5, "y":1}, | ||
| 28 | {"label":"TZ Prv", "x":0, "y":2}, {"label":"Shift", "x":2.5, "y":2}, {"label":"Z", "x":3.5, "y":2}, {"label":"X", "x":4.5, "y":2}, {"label":"C", "x":5.5, "y":2}, {"label":"V", "x":6.5, "y":2}, {"label":"B", "x":7.5, "y":2}, {"label":"N", "x":8.5, "y":2}, {"label":"M", "x":9.5, "y":2}, {"label":"<", "x":10.5, "y":2}, {"label":">", "x":11.5, "y":2}, {"label":"/", "x":12.5, "y":2}, {"label":"Shift", "x":13.5, "y":2}, | ||
| 29 | {"label":"TZ Off", "x":0, "y":3}, {"label":"Tab", "x":3.5, "y":3}, {"label":"Win", "x":4.5, "y":3}, {"label":"Alt", "x":5.5, "y":3}, {"label":"Lower", "x":6.5, "y":3}, {"label":"Space", "x":7.5, "y":3, "w":2}, {"label":"Raise", "x":9.5, "y":3}, {"label":"Nav", "x":10.5, "y":3}, {"label":"Fn", "x":11.5, "y":3}, {"label":"Del", "x":12.5, "y":3} | ||
| 30 | ] | ||
| 31 | }, | ||
| 32 | "LAYOUT_ortho_all": { | ||
| 33 | "layout": [ | ||
| 34 | {"label":"Mute", "x":0, "y":0}, {"label":"Esc", "x":2.5, "y":0}, {"label":"Q", "x":3.5, "y":0}, {"label":"W", "x":4.5, "y":0}, {"label":"E", "x":5.5, "y":0}, {"label":"R", "x":6.5, "y":0}, {"label":"T", "x":7.5, "y":0}, {"label":"Y", "x":8.5, "y":0}, {"label":"U", "x":9.5, "y":0}, {"label":"I", "x":10.5, "y":0}, {"label":"O", "x":11.5, "y":0}, {"label":"P", "x":12.5, "y":0}, {"label":"Back", "x":13.5, "y":0}, | ||
| 35 | {"label":"TZ Nxt", "x":0, "y":1}, {"label":"Ctrl", "x":2.5, "y":1}, {"label":"A", "x":3.5, "y":1}, {"label":"S", "x":4.5, "y":1}, {"label":"D", "x":5.5, "y":1}, {"label":"F", "x":6.5, "y":1}, {"label":"G", "x":7.5, "y":1}, {"label":"H", "x":8.5, "y":1}, {"label":"J", "x":9.5, "y":1}, {"label":"K", "x":10.5, "y":1}, {"label":"L", "x":11.5, "y":1}, {"label":";", "x":12.5, "y":1}, {"label":"Enter", "x":13.5, "y":1}, | ||
| 36 | {"label":"TZ Prv", "x":0, "y":2}, {"label":"Shift", "x":2.5, "y":2}, {"label":"Z", "x":3.5, "y":2}, {"label":"X", "x":4.5, "y":2}, {"label":"C", "x":5.5, "y":2}, {"label":"V", "x":6.5, "y":2}, {"label":"B", "x":7.5, "y":2}, {"label":"N", "x":8.5, "y":2}, {"label":"M", "x":9.5, "y":2}, {"label":"<", "x":10.5, "y":2}, {"label":">", "x":11.5, "y":2}, {"label":"/", "x":12.5, "y":2}, {"label":"Shift", "x":13.5, "y":2}, | ||
| 37 | {"label":"TZ Off", "x":0, "y":3}, {"label":"Tab", "x":3.5, "y":3}, {"label":"Win", "x":4.5, "y":3}, {"label":"Alt", "x":5.5, "y":3}, {"label":"Lower", "x":6.5, "y":3}, {"label":"Space", "x":7.5, "y":3}, {"label":"Space", "x":8.5, "y":3}, {"label":"Raise", "x":9.5, "y":3}, {"label":"Nav", "x":10.5, "y":3}, {"label":"Fn", "x":11.5, "y":3}, {"label":"Del", "x":12.5, "y":3} | ||
| 38 | ] | ||
| 39 | } | ||
| 40 | } | ||
| 41 | } \ No newline at end of file | ||
diff --git a/keyboards/terrazzo/keymaps/default/keymap.c b/keyboards/terrazzo/keymaps/default/keymap.c new file mode 100644 index 000000000..9392a6055 --- /dev/null +++ b/keyboards/terrazzo/keymaps/default/keymap.c | |||
| @@ -0,0 +1,85 @@ | |||
| 1 | /* Copyright 2020 ademey "MsMustard" | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | /* Staggered layout with split spacebars | ||
| 18 | * make terrazzo:default | ||
| 19 | */ | ||
| 20 | #include QMK_KEYBOARD_H | ||
| 21 | |||
| 22 | enum layers { | ||
| 23 | _QWERTY, | ||
| 24 | _RAISE, | ||
| 25 | _LOWER, | ||
| 26 | _NAV, | ||
| 27 | _FN | ||
| 28 | }; | ||
| 29 | |||
| 30 | #define LOWERSP LT(_LOWER, KC_SPC) | ||
| 31 | #define RAISESP LT(_RAISE, KC_SPC) | ||
| 32 | #define SFTSLSH MT(MOD_RSFT, KC_SLSH) | ||
| 33 | |||
| 34 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 35 | |||
| 36 | [_QWERTY] = LAYOUT( | ||
| 37 | KC_MUTE, KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, | ||
| 38 | TZ_NXT, KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, | ||
| 39 | TZ_PRV, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, SFTSLSH, | ||
| 40 | TZ_OFF, KC_LGUI, KC_RALT, LOWERSP, RAISESP, MO(_NAV), MO(_FN) | ||
| 41 | ), | ||
| 42 | |||
| 43 | [_RAISE] = LAYOUT( | ||
| 44 | _______, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, | ||
| 45 | _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MINS, KC_EQL, KC_SCLN, KC_QUOT, | ||
| 46 | _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSLS, KC_LBRC, KC_RBRC, _______, | ||
| 47 | _______, _______, _______, _______, _______, _______, _______ | ||
| 48 | ), | ||
| 49 | |||
| 50 | [_LOWER] = LAYOUT( | ||
| 51 | _______, KC_TAB, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, | ||
| 52 | _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UNDS, KC_PLUS, KC_COLN, KC_DQT, | ||
| 53 | _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PIPE, KC_LCBR, KC_RCBR, _______, | ||
| 54 | _______, _______, _______, _______, _______, _______, _______ | ||
| 55 | ), | ||
| 56 | |||
| 57 | [_NAV] = LAYOUT( | ||
| 58 | _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_END, XXXXXXX, _______, | ||
| 59 | _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RIGHT, _______, | ||
| 60 | _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, | ||
| 61 | _______, _______, _______, _______, _______, _______, _______ | ||
| 62 | ), | ||
| 63 | |||
| 64 | [_FN] = LAYOUT( | ||
| 65 | _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, | ||
| 66 | _______, KC_CAPS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F11, KC_F12, _______, | ||
| 67 | _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, CG_TOGG, | ||
| 68 | _______, RESET, _______, _______, _______, _______, _______ | ||
| 69 | ) | ||
| 70 | }; | ||
| 71 | |||
| 72 | |||
| 73 | void encoder_update_user(uint8_t index, bool clockwise) { | ||
| 74 | terrazzo_scroll_pixel(clockwise); | ||
| 75 | switch(get_highest_layer(layer_state)) { | ||
| 76 | case _NAV: | ||
| 77 | // Change volume when on nav layer | ||
| 78 | clockwise ? tap_code(KC_AUDIO_VOL_UP) : tap_code(KC_AUDIO_VOL_DOWN); | ||
| 79 | break; | ||
| 80 | default: | ||
| 81 | // Default encoder behavior of Page Up and Down | ||
| 82 | clockwise ? tap_code(KC_PGDN) : tap_code(KC_PGUP); | ||
| 83 | break; | ||
| 84 | } | ||
| 85 | } \ No newline at end of file | ||
diff --git a/keyboards/terrazzo/keymaps/ortho/keymap.c b/keyboards/terrazzo/keymaps/ortho/keymap.c new file mode 100644 index 000000000..c2085c414 --- /dev/null +++ b/keyboards/terrazzo/keymaps/ortho/keymap.c | |||
| @@ -0,0 +1,84 @@ | |||
| 1 | /* Copyright 2020 ademey "MsMustard" | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | /* Ortho layout with 2x 2u spacebars | ||
| 18 | * Default ortho layout. | ||
| 19 | * make terrazzo:othro | ||
| 20 | */ | ||
| 21 | #include QMK_KEYBOARD_H | ||
| 22 | |||
| 23 | enum layers { | ||
| 24 | _QWERTY, | ||
| 25 | _RAISE, | ||
| 26 | _LOWER, | ||
| 27 | _NAV, | ||
| 28 | _FN | ||
| 29 | }; | ||
| 30 | |||
| 31 | #define LOWERSP LT(_LOWER, KC_SPC) | ||
| 32 | #define RAISESP LT(_RAISE, KC_SPC) | ||
| 33 | |||
| 34 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 35 | |||
| 36 | [_QWERTY] = LAYOUT_ortho( | ||
| 37 | KC_MUTE, KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, | ||
| 38 | TZ_NXT, KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, | ||
| 39 | TZ_PRV, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, | ||
| 40 | TZ_OFF, KC_TAB, KC_LGUI, KC_RALT, LOWERSP, RAISESP, MO(_NAV), MO(_FN), KC_DEL | ||
| 41 | ), | ||
| 42 | |||
| 43 | [_RAISE] = LAYOUT_ortho( | ||
| 44 | _______, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, | ||
| 45 | _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MINS, KC_EQL, KC_SCLN, KC_QUOT, _______, | ||
| 46 | _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSLS, KC_LBRC, KC_RBRC, _______, _______, | ||
| 47 | _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
| 48 | ), | ||
| 49 | |||
| 50 | [_LOWER] = LAYOUT_ortho( | ||
| 51 | _______, KC_TAB, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, | ||
| 52 | _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UNDS, KC_PLUS, KC_COLN, KC_DQT, _______, | ||
| 53 | _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PIPE, KC_LCBR, KC_RCBR, _______, _______, | ||
| 54 | _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
| 55 | ), | ||
| 56 | |||
| 57 | [_NAV] = LAYOUT_ortho( | ||
| 58 | _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_END, KC_PGUP, _______, | ||
| 59 | _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RIGHT, KC_PGDN, _______, | ||
| 60 | _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, | ||
| 61 | _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
| 62 | ), | ||
| 63 | |||
| 64 | [_FN] = LAYOUT_ortho( | ||
| 65 | _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, | ||
| 66 | _______, KC_CAPS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F11, KC_F12, _______, _______, | ||
| 67 | _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, CG_TOGG, | ||
| 68 | _______, RESET, _______, _______, _______, _______, _______, _______, _______ | ||
| 69 | ) | ||
| 70 | }; | ||
| 71 | |||
| 72 | void encoder_update_user(uint8_t index, bool clockwise) { | ||
| 73 | terrazzo_scroll_pixel(clockwise); | ||
| 74 | switch(get_highest_layer(layer_state)) { | ||
| 75 | case _NAV: | ||
| 76 | // Change volume when on nav layer | ||
| 77 | clockwise ? tap_code(KC_AUDIO_VOL_UP) : tap_code(KC_AUDIO_VOL_DOWN); | ||
| 78 | break; | ||
| 79 | default: | ||
| 80 | // Default encoder behavior of Page Up and Down | ||
| 81 | clockwise ? tap_code(KC_PGDN) : tap_code(KC_PGUP); | ||
| 82 | break; | ||
| 83 | } | ||
| 84 | } \ No newline at end of file | ||
diff --git a/keyboards/terrazzo/keymaps/ortho_all/keymap.c b/keyboards/terrazzo/keymaps/ortho_all/keymap.c new file mode 100644 index 000000000..ba33c15fb --- /dev/null +++ b/keyboards/terrazzo/keymaps/ortho_all/keymap.c | |||
| @@ -0,0 +1,84 @@ | |||
| 1 | /* Copyright 2020 ademey "MsMustard" | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | /* Ortho layout with all 1u | ||
| 18 | * make terrazzo:othro_all | ||
| 19 | */ | ||
| 20 | #include QMK_KEYBOARD_H | ||
| 21 | |||
| 22 | enum layers { | ||
| 23 | _QWERTY, | ||
| 24 | _RAISE, | ||
| 25 | _LOWER, | ||
| 26 | _NAV, | ||
| 27 | _FN | ||
| 28 | }; | ||
| 29 | |||
| 30 | #define LOWERSP LT(_LOWER, KC_SPC) | ||
| 31 | #define RAISESP LT(_RAISE, KC_SPC) | ||
| 32 | #define SFTSLSH MT(MOD_RSFT, KC_SLSH) | ||
| 33 | |||
| 34 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 35 | |||
| 36 | [_QWERTY] = LAYOUT_ortho_all( | ||
| 37 | KC_MUTE, KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, | ||
| 38 | TZ_NXT, KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, | ||
| 39 | TZ_PRV, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, | ||
| 40 | TZ_OFF, KC_TAB, KC_LGUI, KC_RALT, MO(_LOWER), KC_SPC, KC_SPC, MO(_RAISE), MO(_NAV), MO(_FN), KC_DEL | ||
| 41 | ), | ||
| 42 | |||
| 43 | [_RAISE] = LAYOUT_ortho_all( | ||
| 44 | _______, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, | ||
| 45 | _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MINS, KC_EQL, KC_SCLN, KC_QUOT, _______, | ||
| 46 | _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSLS, KC_LBRC, KC_RBRC, _______, _______, | ||
| 47 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
| 48 | ), | ||
| 49 | |||
| 50 | [_LOWER] = LAYOUT_ortho_all( | ||
| 51 | _______, KC_TAB, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, | ||
| 52 | _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UNDS, KC_PLUS, KC_COLN, KC_DQT, _______, | ||
| 53 | _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PIPE, KC_LCBR, KC_RCBR, _______, _______, | ||
| 54 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
| 55 | ), | ||
| 56 | |||
| 57 | [_NAV] = LAYOUT_ortho_all( | ||
| 58 | _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, KC_HOME, KC_UP, KC_END, KC_PGUP, _______, | ||
| 59 | _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RIGHT, KC_PGDN,_______, | ||
| 60 | _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, | ||
| 61 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
| 62 | ), | ||
| 63 | |||
| 64 | [_FN] = LAYOUT_ortho_all( | ||
| 65 | _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, | ||
| 66 | _______, KC_CAPS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F11, KC_F12, _______, _______, | ||
| 67 | _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, CG_TOGG, | ||
| 68 | _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
| 69 | ) | ||
| 70 | }; | ||
| 71 | |||
| 72 | void encoder_update_user(uint8_t index, bool clockwise) { | ||
| 73 | terrazzo_scroll_pixel(clockwise); | ||
| 74 | switch(get_highest_layer(layer_state)) { | ||
| 75 | case _NAV: | ||
| 76 | /* Change volume when on nav layer */ | ||
| 77 | clockwise ? tap_code(KC_AUDIO_VOL_UP) : tap_code(KC_AUDIO_VOL_DOWN); | ||
| 78 | break; | ||
| 79 | default: | ||
| 80 | /* Default encoder behavior of Page Up and Down */ | ||
| 81 | clockwise ? tap_code(KC_PGDN) : tap_code(KC_PGUP); | ||
| 82 | break; | ||
| 83 | } | ||
| 84 | } \ No newline at end of file | ||
diff --git a/keyboards/terrazzo/keymaps/ortho_mit/keymap.c b/keyboards/terrazzo/keymaps/ortho_mit/keymap.c new file mode 100644 index 000000000..ab63f5395 --- /dev/null +++ b/keyboards/terrazzo/keymaps/ortho_mit/keymap.c | |||
| @@ -0,0 +1,82 @@ | |||
| 1 | /* Copyright 2020 ademey "MsMustard" | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | /* Ortho layout with 1 2u spacebar | ||
| 18 | * make terrazzo:othro_mit | ||
| 19 | */ | ||
| 20 | #include QMK_KEYBOARD_H | ||
| 21 | |||
| 22 | enum layers { | ||
| 23 | _QWERTY, | ||
| 24 | _RAISE, | ||
| 25 | _LOWER, | ||
| 26 | _NAV, | ||
| 27 | _FN | ||
| 28 | }; | ||
| 29 | |||
| 30 | |||
| 31 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 32 | |||
| 33 | [_QWERTY] = LAYOUT_ortho_mit( | ||
| 34 | KC_MUTE, KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, | ||
| 35 | TZ_NXT, KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, | ||
| 36 | TZ_PRV, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, | ||
| 37 | TZ_OFF, KC_TAB, KC_LGUI, KC_RALT, MO(_LOWER), KC_SPC, MO(_RAISE), MO(_NAV), MO(_FN), KC_DEL | ||
| 38 | ), | ||
| 39 | |||
| 40 | [_RAISE] = LAYOUT_ortho_mit( | ||
| 41 | _______, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, | ||
| 42 | _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MINS, KC_EQL, KC_SCLN, KC_QUOT, _______, | ||
| 43 | _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSLS, KC_LBRC, KC_RBRC, _______, _______, | ||
| 44 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
| 45 | ), | ||
| 46 | |||
| 47 | [_LOWER] = LAYOUT_ortho_mit( | ||
| 48 | _______, KC_TAB, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, | ||
| 49 | _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UNDS, KC_PLUS, KC_COLN, KC_DQT, _______, | ||
| 50 | _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PIPE, KC_LCBR, KC_RCBR, _______, _______, | ||
| 51 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
| 52 | ), | ||
| 53 | |||
| 54 | [_NAV] = LAYOUT_ortho_mit( | ||
| 55 | _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, KC_HOME, KC_UP, KC_END, KC_PGUP, _______, | ||
| 56 | _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RIGHT, KC_PGDN,_______, | ||
| 57 | _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, | ||
| 58 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
| 59 | ), | ||
| 60 | |||
| 61 | [_FN] = LAYOUT_ortho_mit( | ||
| 62 | _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, | ||
| 63 | _______, KC_CAPS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F11, KC_F12, _______, _______, | ||
| 64 | _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, CG_TOGG, | ||
| 65 | _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______ | ||
| 66 | ) | ||
| 67 | }; | ||
| 68 | |||
| 69 | |||
| 70 | void encoder_update_user(uint8_t index, bool clockwise) { | ||
| 71 | terrazzo_scroll_pixel(clockwise); | ||
| 72 | switch(get_highest_layer(layer_state)) { | ||
| 73 | case _NAV: | ||
| 74 | /* Change volume when on nav layer */ | ||
| 75 | clockwise ? tap_code(KC_AUDIO_VOL_UP) : tap_code(KC_AUDIO_VOL_DOWN); | ||
| 76 | break; | ||
| 77 | default: | ||
| 78 | /* Default encoder behavior of Page Up and Down */ | ||
| 79 | clockwise ? tap_code(KC_PGDN) : tap_code(KC_PGUP); | ||
| 80 | break; | ||
| 81 | } | ||
| 82 | } \ No newline at end of file | ||
diff --git a/keyboards/terrazzo/rules.mk b/keyboards/terrazzo/rules.mk new file mode 100644 index 000000000..f6ea149e3 --- /dev/null +++ b/keyboards/terrazzo/rules.mk | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | # MCU name | ||
| 2 | MCU = atmega32u4 | ||
| 3 | |||
| 4 | # Bootloader selection | ||
| 5 | # Teensy halfkay | ||
| 6 | # Pro Micro caterina | ||
| 7 | # Atmel DFU atmel-dfu | ||
| 8 | # LUFA DFU lufa-dfu | ||
| 9 | # QMK DFU qmk-dfu | ||
| 10 | # ATmega32A bootloadHID | ||
| 11 | # ATmega328P USBasp | ||
| 12 | BOOTLOADER = atmel-dfu | ||
| 13 | |||
| 14 | |||
| 15 | |||
| 16 | # Build Options | ||
| 17 | # comment out to disable the options. | ||
| 18 | # | ||
| 19 | BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration | ||
| 20 | MOUSEKEY_ENABLE = no # Mouse keys | ||
| 21 | EXTRAKEY_ENABLE = yes # Audio control and System control | ||
| 22 | CONSOLE_ENABLE = no # Console for debug | ||
| 23 | COMMAND_ENABLE = no # Commands for debug and configuration | ||
| 24 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | ||
| 25 | NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | ||
| 26 | AUDIO_ENABLE = no | ||
| 27 | RGBLIGHT_ENABLE = no | ||
| 28 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | ||
| 29 | LED_MATRIX_ENABLE = IS31FL3731 | ||
| 30 | ENCODER_ENABLE = yes | ||
| 31 | WPM_ENABLE = yes | ||
| 32 | |||
| 33 | LAYOUTS = ortho ortho_mit ortho_all \ No newline at end of file | ||
diff --git a/keyboards/terrazzo/terrazzo.c b/keyboards/terrazzo/terrazzo.c new file mode 100644 index 000000000..2fe94f860 --- /dev/null +++ b/keyboards/terrazzo/terrazzo.c | |||
| @@ -0,0 +1,165 @@ | |||
| 1 | /* Copyright 2020 ademey "MsMustard" | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #include "terrazzo.h" | ||
| 18 | |||
| 19 | #ifdef LED_MATRIX_ENABLE | ||
| 20 | #include "is31fl3731-simple.h" | ||
| 21 | #include <math.h> | ||
| 22 | #include <print.h> | ||
| 23 | #include "quantum.h" | ||
| 24 | |||
| 25 | const is31_led g_is31_leds[LED_DRIVER_LED_COUNT] = { | ||
| 26 | /* Refer to IS31 manual for these locations | ||
| 27 | * https://cdn-learn.adafruit.com/downloads/pdf/adafruit-15x7-7x15-charlieplex-led-matrix-charliewing-featherwing.pdf | ||
| 28 | */ | ||
| 29 | {0, C1_2}, {0, C1_3}, {0, C1_4}, {0, C1_5}, {0, C1_6}, {0, C1_7}, {0, C1_8}, | ||
| 30 | {0, C2_2}, {0, C2_3}, {0, C2_4}, {0, C2_5}, {0, C2_6}, {0, C2_7}, {0, C2_8}, | ||
| 31 | {0, C3_2}, {0, C3_3}, {0, C3_4}, {0, C3_5}, {0, C3_6}, {0, C3_7}, {0, C3_8}, | ||
| 32 | {0, C4_2}, {0, C4_3}, {0, C4_4}, {0, C4_5}, {0, C4_6}, {0, C4_7}, {0, C4_8}, | ||
| 33 | {0, C5_2}, {0, C5_3}, {0, C5_4}, {0, C5_5}, {0, C5_6}, {0, C5_7}, {0, C5_8}, | ||
| 34 | {0, C6_2}, {0, C6_3}, {0, C6_4}, {0, C6_5}, {0, C6_6}, {0, C6_7}, {0, C6_8}, | ||
| 35 | {0, C7_2}, {0, C7_3}, {0, C7_4}, {0, C7_5}, {0, C7_6}, {0, C7_7}, {0, C7_8}, | ||
| 36 | {0, C8_2}, {0, C8_3}, {0, C8_4}, {0, C8_5}, {0, C8_6}, {0, C8_7}, {0, C8_8}, | ||
| 37 | // | ||
| 38 | {0, C8_15},{0, C8_14},{0, C8_13},{0, C8_12},{0, C8_11},{0, C8_10},{0, C8_9}, | ||
| 39 | {0, C7_15},{0, C7_14},{0, C7_13},{0, C7_12},{0, C7_11},{0, C7_10},{0, C7_9}, | ||
| 40 | {0, C6_15},{0, C6_14},{0, C6_13},{0, C6_12},{0, C6_11},{0, C6_10},{0, C6_9}, | ||
| 41 | {0, C5_15},{0, C5_14},{0, C5_13},{0, C5_12},{0, C5_11},{0, C5_10},{0, C5_9}, | ||
| 42 | {0, C4_15},{0, C4_14},{0, C4_13},{0, C4_12},{0, C4_11},{0, C4_10},{0, C4_9}, | ||
| 43 | {0, C3_15},{0, C3_14},{0, C3_13},{0, C3_12},{0, C3_11},{0, C3_10},{0, C3_9}, | ||
| 44 | {0, C2_15},{0, C2_14},{0, C2_13},{0, C2_12},{0, C2_11},{0, C2_10},{0, C2_9} | ||
| 45 | }; | ||
| 46 | |||
| 47 | #define TERRAZZO_EFFECT(name) | ||
| 48 | #define TERRAZZO_EFFECT_IMPLS | ||
| 49 | |||
| 50 | #include "terrazzo_effects/terrazzo_effects.inc" | ||
| 51 | |||
| 52 | #undef TERRAZZO_EFFECT_IMPLS | ||
| 53 | #undef TERRAZZO_EFFECT | ||
| 54 | |||
| 55 | uint8_t terrazzo_led_index = 0; | ||
| 56 | uint8_t terrazzo_dir = 1; | ||
| 57 | uint8_t terrazzo_effect = 1; | ||
| 58 | |||
| 59 | void terrazzo_set_pixel(uint8_t x, uint8_t y, uint8_t value) { | ||
| 60 | uint8_t target = y * LED_MATRIX_COLS + x; | ||
| 61 | if (target < LED_DRIVER_LED_COUNT && target >= 0) { | ||
| 62 | led_matrix_set_index_value(y * LED_MATRIX_COLS + x, value); | ||
| 63 | } | ||
| 64 | } | ||
| 65 | |||
| 66 | void terrazzo_draw_at(uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t image[]) { | ||
| 67 | uint8_t index = 0; | ||
| 68 | for (int v = 0; v < height; v++) { | ||
| 69 | for (int h = 0; h < width; h++) { | ||
| 70 | uint8_t pixel_value = image[index]; | ||
| 71 | if (pixel_value != 0) { | ||
| 72 | terrazzo_set_pixel(x + h, y + v, image[index]); | ||
| 73 | } | ||
| 74 | index++; | ||
| 75 | } | ||
| 76 | } | ||
| 77 | } | ||
| 78 | |||
| 79 | void terrazzo_scroll_pixel(bool clockwise) { | ||
| 80 | terrazzo_dir = clockwise; | ||
| 81 | |||
| 82 | if (clockwise) { | ||
| 83 | terrazzo_led_index = terrazzo_led_index + 1; | ||
| 84 | } else { | ||
| 85 | terrazzo_led_index = terrazzo_led_index - 1; | ||
| 86 | } | ||
| 87 | |||
| 88 | if (terrazzo_led_index >= LED_DRIVER_LED_COUNT) { | ||
| 89 | terrazzo_led_index = 0; | ||
| 90 | } else if (terrazzo_led_index <= 0 ) { | ||
| 91 | terrazzo_led_index = LED_DRIVER_LED_COUNT - 1; | ||
| 92 | } | ||
| 93 | } | ||
| 94 | |||
| 95 | void terrazzo_step_mode(void) { | ||
| 96 | terrazzo_effect++; | ||
| 97 | if (terrazzo_effect >= TERRAZZO_EFFECT_MAX) { | ||
| 98 | terrazzo_effect = 1; | ||
| 99 | } | ||
| 100 | } | ||
| 101 | |||
| 102 | void terrazzo_step_mode_reverse(void) { | ||
| 103 | terrazzo_effect--; | ||
| 104 | if (terrazzo_effect < 1) { | ||
| 105 | terrazzo_effect = TERRAZZO_EFFECT_MAX - 1; | ||
| 106 | } | ||
| 107 | } | ||
| 108 | |||
| 109 | void terrazzo_mode_off(void) { | ||
| 110 | terrazzo_effect = TERRAZZO_NONE; | ||
| 111 | } | ||
| 112 | |||
| 113 | void terrazzo_render(void) { | ||
| 114 | switch(terrazzo_effect) { | ||
| 115 | case TERRAZZO_NONE: | ||
| 116 | led_matrix_set_index_value_all(0); | ||
| 117 | break; | ||
| 118 | #define TERRAZZO_EFFECT(name, ...) \ | ||
| 119 | case TERRAZZO_EFFECT_##name: \ | ||
| 120 | name(terrazzo_led_index, terrazzo_dir); \ | ||
| 121 | break; | ||
| 122 | #include "terrazzo_effects/terrazzo_effects.inc" | ||
| 123 | #undef TERRAZZO_EFFECT | ||
| 124 | } | ||
| 125 | } | ||
| 126 | |||
| 127 | void led_matrix_indicators_kb(void) { | ||
| 128 | terrazzo_render(); | ||
| 129 | } | ||
| 130 | |||
| 131 | bool process_record_kb(uint16_t keycode, keyrecord_t *record) { | ||
| 132 | if (record->event.pressed) { | ||
| 133 | switch(keycode) { | ||
| 134 | case TZ_NXT: | ||
| 135 | terrazzo_step_mode(); | ||
| 136 | return true; | ||
| 137 | case TZ_PRV: | ||
| 138 | terrazzo_step_mode_reverse(); | ||
| 139 | return true; | ||
| 140 | case TZ_OFF: | ||
| 141 | terrazzo_mode_off(); | ||
| 142 | return true; | ||
| 143 | // Reverse animation on backspace | ||
| 144 | case KC_BSPC: | ||
| 145 | terrazzo_scroll_pixel(0); | ||
| 146 | return true; | ||
| 147 | // Any keycode increments counter | ||
| 148 | default: | ||
| 149 | terrazzo_scroll_pixel(1); | ||
| 150 | break; | ||
| 151 | } | ||
| 152 | } | ||
| 153 | return process_record_user(keycode, record); | ||
| 154 | } | ||
| 155 | |||
| 156 | void suspend_power_down_kb(void) { | ||
| 157 | led_matrix_set_suspend_state(true); | ||
| 158 | } | ||
| 159 | |||
| 160 | void suspend_wakeup_init_kb(void) { | ||
| 161 | led_matrix_set_suspend_state(false); | ||
| 162 | } | ||
| 163 | |||
| 164 | |||
| 165 | #endif \ No newline at end of file | ||
diff --git a/keyboards/terrazzo/terrazzo.h b/keyboards/terrazzo/terrazzo.h new file mode 100644 index 000000000..526b3f925 --- /dev/null +++ b/keyboards/terrazzo/terrazzo.h | |||
| @@ -0,0 +1,122 @@ | |||
| 1 | /* Copyright 2020 ademey "MsMustard" | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #pragma once | ||
| 18 | |||
| 19 | #include "quantum.h" | ||
| 20 | |||
| 21 | /* Default staggered layout | ||
| 22 | Bottom row: 1u 1.5u 2.25u 2.75u 1.5u 1u */ | ||
| 23 | #define LAYOUT( \ | ||
| 24 | K00, K01, K02, K03, K04, K05, K70, K71, K72, K73, K74, K75, K65, \ | ||
| 25 | K10, K11, K12, K13, K14, K15, K60, K61, K62, K63, K64, K55, \ | ||
| 26 | K20, K21, K22, K23, K24, K25, K50, K51, K52, K53, K54, K45, \ | ||
| 27 | K30, K31, K32, K33, K40, K42, K43 \ | ||
| 28 | ){ \ | ||
| 29 | { K00, K01, K02, K03, K04, K05,}, \ | ||
| 30 | { K10, K11, K12, K13, K14, K15,}, \ | ||
| 31 | { K20, K21, K22, K23, K24, K25,}, \ | ||
| 32 | { K30, K31, K32, K33, KC_NO, KC_NO,},\ | ||
| 33 | { K40, KC_NO, K42, K43, KC_NO, K45,},\ | ||
| 34 | { K50, K51, K52, K53, K54, K55,}, \ | ||
| 35 | { K60, K61, K62, K63, K64, K65,}, \ | ||
| 36 | { K70, K71, K72, K73, K74, K75, } \ | ||
| 37 | } | ||
| 38 | |||
| 39 | /* Default ortho layout | ||
| 40 | Bottom row: 1u 1u 1u 2u 2u 1u 1u 1u */ | ||
| 41 | #define LAYOUT_ortho( \ | ||
| 42 | K00, K01, K02, K03, K04, K05, K70, K71, K72, K73, K74, K75, K65, \ | ||
| 43 | K10, K11, K12, K13, K14, K15, K60, K61, K62, K63, K64, K54, K55, \ | ||
| 44 | K20, K21, K22, K23, K24, K25, K50, K51, K52, K53, K43, K44, K45, \ | ||
| 45 | K30, K31, K32, K33, K34, K35, K40, K41, K42 \ | ||
| 46 | ){ \ | ||
| 47 | { K00, K01, K02, K03, K04, K05,}, \ | ||
| 48 | { K10, K11, K12, K13, K14, K15,}, \ | ||
| 49 | { K20, K21, K22, K23, K24, K25,}, \ | ||
| 50 | { K30, K31, K32, K33, K34, K35,}, \ | ||
| 51 | { K40, K41, K42, K43, K44, K45,}, \ | ||
| 52 | { K50, K51, K52, K53, K54, K55,}, \ | ||
| 53 | { K60, K61, K62, K63, K64, K65,}, \ | ||
| 54 | { K70, K71, K72, K73, K74, K75, }, \ | ||
| 55 | { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, } \ | ||
| 56 | } | ||
| 57 | |||
| 58 | /* MIT ortho layout | ||
| 59 | Bottom row: 1u 1u 1u 1u 2u 1u 1u 1u 1u */ | ||
| 60 | #define LAYOUT_ortho_mit( \ | ||
| 61 | K00, K01, K02, K03, K04, K05, K70, K71, K72, K73, K74, K75, K65, \ | ||
| 62 | K10, K11, K12, K13, K14, K15, K60, K61, K62, K63, K64, K54, K55, \ | ||
| 63 | K20, K21, K22, K23, K24, K25, K50, K51, K52, K53, K43, K44, K45, \ | ||
| 64 | K30, K31, K32, K33, K84, K35, K85, K40, K41, K42 \ | ||
| 65 | ){ \ | ||
| 66 | { K00, K01, K02, K03, K04, K05,}, \ | ||
| 67 | { K10, K11, K12, K13, K14, K15,}, \ | ||
| 68 | { K20, K21, K22, K23, K24, K25,}, \ | ||
| 69 | { K30, K31, K32, K33, KC_NO, K35,}, \ | ||
| 70 | { K40, K41, K42, K43, K44, K45,}, \ | ||
| 71 | { K50, K51, K52, K53, K54, K55,}, \ | ||
| 72 | { K60, K61, K62, K63, K64, K65,}, \ | ||
| 73 | { K70, K71, K72, K73, K74, K75, }, \ | ||
| 74 | { KC_NO, KC_NO, KC_NO, KC_NO, K84, K85, } \ | ||
| 75 | } | ||
| 76 | |||
| 77 | /* All 1u ortho layout | ||
| 78 | Bottom row: 1u 1u 1u 1u 1u 1u 1u 1u 1u 1u */ | ||
| 79 | #define LAYOUT_ortho_all( \ | ||
| 80 | K00, K01, K02, K03, K04, K05, K70, K71, K72, K73, K74, K75, K65, \ | ||
| 81 | K10, K11, K12, K13, K14, K15, K60, K61, K62, K63, K64, K54, K55, \ | ||
| 82 | K20, K21, K22, K23, K24, K25, K50, K51, K52, K53, K43, K44, K45, \ | ||
| 83 | K30, K31, K32, K33, K84, K34, K35, K85, K40, K41, K42 \ | ||
| 84 | ){ \ | ||
| 85 | { K00, K01, K02, K03, K04, K05,}, \ | ||
| 86 | { K10, K11, K12, K13, K14, K15,}, \ | ||
| 87 | { K20, K21, K22, K23, K24, K25,}, \ | ||
| 88 | { K30, K31, K32, K33, K34, K35,}, \ | ||
| 89 | { K40, K41, K42, K43, K44, K45,}, \ | ||
| 90 | { K50, K51, K52, K53, K54, K55,}, \ | ||
| 91 | { K60, K61, K62, K63, K64, K65,}, \ | ||
| 92 | { K70, K71, K72, K73, K74, K75, }, \ | ||
| 93 | { KC_NO, KC_NO, KC_NO, KC_NO, K84, K85, } \ | ||
| 94 | } | ||
| 95 | |||
| 96 | |||
| 97 | enum terrazzo_matrix_effects { | ||
| 98 | TERRAZZO_NONE = 0, | ||
| 99 | // -------------------------------------- | ||
| 100 | // -----Begin led effect enum macros----- | ||
| 101 | #define TERRAZZO_EFFECT(name, ...) TERRAZZO_EFFECT_##name, | ||
| 102 | #include "terrazzo_effects/terrazzo_effects.inc" | ||
| 103 | #undef TERRAZZO_EFFECT | ||
| 104 | // -------------------------------------- | ||
| 105 | // -----End led effect enum macros------- | ||
| 106 | // All new effects go above this line | ||
| 107 | TERRAZZO_EFFECT_MAX | ||
| 108 | }; | ||
| 109 | |||
| 110 | enum terrazzo_keycodes { | ||
| 111 | TZ_NXT = SAFE_RANGE, | ||
| 112 | TZ_PRV, | ||
| 113 | TZ_OFF | ||
| 114 | }; | ||
| 115 | |||
| 116 | void terrazzo_render(void); | ||
| 117 | void terrazzo_set_pixel(uint8_t x, uint8_t y, uint8_t value); | ||
| 118 | void terrazzo_draw_at(uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t image[]); | ||
| 119 | void terrazzo_scroll_pixel(bool clockwise); | ||
| 120 | void terrazzo_step_mode(void); | ||
| 121 | void terrazzo_step_mode_reverse(void); | ||
| 122 | void terrazzo_mode_off(void); | ||
diff --git a/keyboards/terrazzo/terrazzo_effects/dino.h b/keyboards/terrazzo/terrazzo_effects/dino.h new file mode 100644 index 000000000..747ef6178 --- /dev/null +++ b/keyboards/terrazzo/terrazzo_effects/dino.h | |||
| @@ -0,0 +1,162 @@ | |||
| 1 | /* Copyright 2020 ademey "MsMustard" | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #ifndef DISABLE_TERRAZZO_EFFECT_DINO | ||
| 18 | TERRAZZO_EFFECT(DINO) | ||
| 19 | # ifdef TERRAZZO_EFFECT_IMPLS | ||
| 20 | |||
| 21 | static uint8_t dino_frames[2][56] = { | ||
| 22 | { | ||
| 23 | 0, 0, 0, 9, 9, 9, 9, | ||
| 24 | 0, 0, 0, 9, 0, 9, 9, | ||
| 25 | 9, 0, 0, 9, 9, 9, 9, | ||
| 26 | 9, 9, 9, 9, 9, 0, 0, | ||
| 27 | 9, 9, 9, 9, 9, 0, 0, | ||
| 28 | 0, 9, 9, 9, 0, 0, 0, | ||
| 29 | 0, 9, 0, 9, 9, 0, 0, | ||
| 30 | 0, 9, 9, 0, 0, 0, 0 | ||
| 31 | }, | ||
| 32 | { | ||
| 33 | 0, 0, 0, 9, 9, 9, 9, | ||
| 34 | 0, 0, 0, 9, 0, 9, 9, | ||
| 35 | 9, 0, 0, 9, 9, 9, 9, | ||
| 36 | 9, 9, 9, 9, 9, 0, 0, | ||
| 37 | 9, 9, 9, 9, 9, 0, 0, | ||
| 38 | 0, 9, 9, 9, 0, 0, 0, | ||
| 39 | 0, 9, 0, 9, 0, 0, 0, | ||
| 40 | 0, 0, 0, 9, 9, 0, 0 | ||
| 41 | } | ||
| 42 | }; | ||
| 43 | |||
| 44 | static uint8_t dino_reverse[2][56] = { | ||
| 45 | { | ||
| 46 | 9, 9, 9, 9, 0, 0, 0, | ||
| 47 | 9, 9, 0, 9, 0, 0, 0, | ||
| 48 | 9, 9, 9, 9, 0, 0, 9, | ||
| 49 | 0, 0, 9, 9, 9, 9, 9, | ||
| 50 | 0, 0, 9, 9, 9, 9, 9, | ||
| 51 | 0, 0, 0, 9, 9, 9, 0, | ||
| 52 | 0, 0, 9, 9, 0, 9, 0, | ||
| 53 | 0, 0, 0, 0, 9, 9, 0 | ||
| 54 | }, | ||
| 55 | { | ||
| 56 | 9, 9, 9, 9, 0, 0, 0, | ||
| 57 | 9, 9, 0, 9, 0, 0, 0, | ||
| 58 | 9, 9, 9, 9, 0, 0, 9, | ||
| 59 | 0, 0, 9, 9, 9, 9, 9, | ||
| 60 | 0, 0, 9, 9, 9, 9, 9, | ||
| 61 | 0, 0, 0, 9, 9, 9, 0, | ||
| 62 | 0, 0, 0, 9, 0, 9, 0, | ||
| 63 | 0, 0, 9, 9, 0, 0, 0 | ||
| 64 | } | ||
| 65 | }; | ||
| 66 | |||
| 67 | static uint8_t dino_bg[10][42] = { | ||
| 68 | { | ||
| 69 | 0, 0, 0, 0, 0, 0, 0, | ||
| 70 | 0, 0, 0, 0, 0, 4, 0, | ||
| 71 | 0, 0, 0, 0, 0, 4, 0, | ||
| 72 | 0, 1, 1, 0, 0, 0, 4, | ||
| 73 | 1, 0, 0, 1, 1, 1, 1, | ||
| 74 | 0, 0, 0, 0, 0, 0, 0 | ||
| 75 | }, | ||
| 76 | { | ||
| 77 | 0, 0, 0, 0, 0, 0, 4, | ||
| 78 | 0, 0, 0, 0, 4, 0, 4, | ||
| 79 | 0, 0, 0, 0, 4, 0, 4, | ||
| 80 | 1, 1, 0, 0, 0, 4, 4, | ||
| 81 | 0, 0, 1, 1, 1, 1, 4, | ||
| 82 | 0, 0, 0, 0, 0, 0, 4 | ||
| 83 | }, | ||
| 84 | { | ||
| 85 | 0, 0, 0, 0, 0, 4, 0, | ||
| 86 | 0, 0, 0, 4, 0, 4, 0, | ||
| 87 | 0, 0, 0, 4, 0, 4, 4, | ||
| 88 | 1, 0, 0, 0, 4, 4, 0, | ||
| 89 | 0, 1, 1, 1, 1, 4, 0, | ||
| 90 | 0, 0, 0, 0, 0, 4, 0 | ||
| 91 | }, | ||
| 92 | { | ||
| 93 | 0, 0, 0, 0, 4, 0, 0, | ||
| 94 | 0, 0, 4, 0, 4, 0, 4, | ||
| 95 | 0, 0, 4, 0, 4, 4, 4, | ||
| 96 | 0, 0, 0, 4, 4, 0, 0, | ||
| 97 | 1, 1, 1, 1, 4, 1, 1, | ||
| 98 | 0, 0, 0, 0, 4, 0, 0 | ||
| 99 | }, | ||
| 100 | { | ||
| 101 | 0, 0, 0, 4, 0, 0, 0, | ||
| 102 | 0, 4, 0, 4, 0, 4, 0, | ||
| 103 | 0, 4, 0, 4, 4, 4, 0, | ||
| 104 | 0, 0, 4, 4, 0, 0, 0, | ||
| 105 | 1, 1, 1, 4, 1, 1, 1, | ||
| 106 | 0, 0, 0, 4, 0, 0, 0 | ||
| 107 | }, | ||
| 108 | { | ||
| 109 | 0, 0, 4, 0, 0, 0, 0, | ||
| 110 | 4, 0, 4, 0, 4, 0, 0, | ||
| 111 | 4, 0, 4, 4, 4, 0, 0, | ||
| 112 | 0, 4, 4, 0, 0, 0, 1, | ||
| 113 | 1, 1, 4, 1, 1, 1, 0, | ||
| 114 | 0, 0, 4, 0, 0, 0, 0 | ||
| 115 | }, | ||
| 116 | { | ||
| 117 | 0, 4, 0, 0, 0, 0, 0, | ||
| 118 | 0, 4, 0, 4, 0, 0, 0, | ||
| 119 | 0, 4, 4, 4, 0, 0, 0, | ||
| 120 | 4, 4, 0, 0, 0, 1, 1, | ||
| 121 | 1, 4, 1, 1, 1, 0, 0, | ||
| 122 | 0, 4, 0, 0, 0, 0, 0 | ||
| 123 | }, | ||
| 124 | { | ||
| 125 | 4, 0, 0, 0, 0, 0, 0, | ||
| 126 | 4, 0, 4, 0, 0, 0, 0, | ||
| 127 | 4, 4, 4, 0, 0, 0, 0, | ||
| 128 | 4, 0, 0, 0, 1, 1, 0, | ||
| 129 | 4, 1, 1, 1, 0, 0, 1, | ||
| 130 | 4, 0, 0, 0, 0, 0, 0 | ||
| 131 | }, | ||
| 132 | { | ||
| 133 | 0, 0, 0, 0, 0, 0, 0, | ||
| 134 | 0, 4, 0, 0, 0, 0, 0, | ||
| 135 | 4, 4, 0, 0, 0, 0, 0, | ||
| 136 | 0, 0, 0, 1, 1, 0, 0, | ||
| 137 | 1, 1, 1, 0, 0, 1, 1, | ||
| 138 | 0, 0, 0, 0, 0, 0, 0 | ||
| 139 | }, | ||
| 140 | { | ||
| 141 | 0, 0, 0, 0, 0, 0, 0, | ||
| 142 | 4, 0, 0, 0, 0, 0, 4, | ||
| 143 | 4, 0, 0, 0, 0, 0, 4, | ||
| 144 | 0, 0, 1, 1, 0, 0, 0, | ||
| 145 | 1, 1, 0, 0, 1, 1, 1, | ||
| 146 | 0, 0, 0, 0, 0, 0, 0 | ||
| 147 | } | ||
| 148 | }; | ||
| 149 | |||
| 150 | void DINO(uint8_t i, bool dir) { | ||
| 151 | led_matrix_set_index_value_all(0); | ||
| 152 | if (dir) { | ||
| 153 | terrazzo_draw_at(0, 7, 7, 8, dino_frames[i % 2]); | ||
| 154 | } else { | ||
| 155 | terrazzo_draw_at(0, 7, 7, 8, dino_reverse[i % 2]); | ||
| 156 | |||
| 157 | } | ||
| 158 | terrazzo_draw_at(0, 0, 7, 6, dino_bg[i % 10]); | ||
| 159 | } | ||
| 160 | |||
| 161 | # endif | ||
| 162 | #endif \ No newline at end of file | ||
diff --git a/keyboards/terrazzo/terrazzo_effects/dot.h b/keyboards/terrazzo/terrazzo_effects/dot.h new file mode 100644 index 000000000..e8eb8e0fc --- /dev/null +++ b/keyboards/terrazzo/terrazzo_effects/dot.h | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | /* Copyright 2020 ademey "MsMustard" | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #ifndef DISABLE_TERRAZZO_EFFECT_DOT | ||
| 18 | TERRAZZO_EFFECT(DOT) | ||
| 19 | # ifdef TERRAZZO_EFFECT_IMPLS | ||
| 20 | // Animation for debugging. Lights one pixel according to animation index | ||
| 21 | void DOT(uint8_t i, bool dir) { | ||
| 22 | led_matrix_set_index_value_all(0); | ||
| 23 | led_matrix_set_index_value(i, 10); | ||
| 24 | } | ||
| 25 | |||
| 26 | # endif | ||
| 27 | #endif \ No newline at end of file | ||
diff --git a/keyboards/terrazzo/terrazzo_effects/heart.h b/keyboards/terrazzo/terrazzo_effects/heart.h new file mode 100644 index 000000000..bdcd2d7b9 --- /dev/null +++ b/keyboards/terrazzo/terrazzo_effects/heart.h | |||
| @@ -0,0 +1,99 @@ | |||
| 1 | /* Copyright 2020 ademey "MsMustard" | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #ifndef DISABLE_TERRAZZO_EFFECT_HEART | ||
| 18 | TERRAZZO_EFFECT(HEART) | ||
| 19 | # ifdef TERRAZZO_EFFECT_IMPLS | ||
| 20 | |||
| 21 | static uint8_t heart_frames[4][105] = { | ||
| 22 | { | ||
| 23 | 0, 0, 0, 0, 0, 0, 0, | ||
| 24 | 0, 0, 0, 0, 0, 0, 0, | ||
| 25 | 0, 0, 0, 0, 0, 0, 0, | ||
| 26 | 0, 0, 0, 0, 0, 0, 0, | ||
| 27 | 0, 5, 5, 0, 5, 5, 0, | ||
| 28 | 5, 0, 0, 5, 0, 0, 5, | ||
| 29 | 5, 0, 0, 0, 0, 0, 5, | ||
| 30 | 0, 5, 0, 0, 0, 5, 0, | ||
| 31 | 0, 0, 5, 0, 5, 0, 0, | ||
| 32 | 0, 0, 0, 5, 0, 0, 0, | ||
| 33 | 0, 0, 0, 0, 0, 0, 0, | ||
| 34 | 0, 0, 0, 0, 0, 0, 0, | ||
| 35 | 0, 0, 0, 0, 0, 0, 0, | ||
| 36 | 0, 0, 0, 0, 0, 0, 0, | ||
| 37 | 0, 0, 0, 0, 0, 0, 0 | ||
| 38 | }, | ||
| 39 | { | ||
| 40 | 0, 0, 0, 0, 0, 0, 0, | ||
| 41 | 0, 0, 0, 0, 0, 0, 0, | ||
| 42 | 0, 0, 0, 0, 0, 0, 0, | ||
| 43 | 0, 0, 0, 0, 0, 0, 0, | ||
| 44 | 0, 5, 5, 0, 5, 5, 0, | ||
| 45 | 5, 5, 5, 5, 5, 5, 5, | ||
| 46 | 5, 5, 5, 5, 5, 5, 5, | ||
| 47 | 0, 5, 5, 5, 5, 5, 0, | ||
| 48 | 0, 0, 5, 5, 5, 0, 0, | ||
| 49 | 0, 0, 0, 5, 0, 0, 0, | ||
| 50 | 0, 0, 0, 0, 0, 0, 0, | ||
| 51 | 0, 0, 0, 0, 0, 0, 0, | ||
| 52 | 0, 0, 0, 0, 0, 0, 0, | ||
| 53 | 0, 0, 0, 0, 0, 0, 0, | ||
| 54 | 0, 0, 0, 0, 0, 0, 0 | ||
| 55 | }, | ||
| 56 | { | ||
| 57 | 0, 0, 0, 0, 0, 0, 0, | ||
| 58 | 0, 0, 0, 0, 0, 0, 0, | ||
| 59 | 0, 1, 1, 0, 1, 1, 0, | ||
| 60 | 1, 0, 0, 5, 0, 0, 1, | ||
| 61 | 0, 5, 5, 0, 5, 5, 0, | ||
| 62 | 5, 5, 5, 5, 5, 5, 5, | ||
| 63 | 5, 5, 5, 5, 5, 5, 5, | ||
| 64 | 0, 5, 5, 5, 5, 5, 0, | ||
| 65 | 0, 0, 5, 5, 5, 0, 0, | ||
| 66 | 1, 0, 0, 5, 0, 0, 1, | ||
| 67 | 0, 1, 0, 0, 0, 1, 0, | ||
| 68 | 0, 0, 1, 0, 1, 0, 0, | ||
| 69 | 0, 0, 0, 1, 0, 0, 0, | ||
| 70 | 0, 0, 0, 0, 0, 0, 0, | ||
| 71 | 0, 0, 0, 0, 0, 0, 0 | ||
| 72 | }, | ||
| 73 | { | ||
| 74 | 0, 1, 1, 0, 1, 1, 0, | ||
| 75 | 1, 0, 0, 1, 0, 0, 1, | ||
| 76 | 0, 5, 5, 0, 5, 5, 0, | ||
| 77 | 5, 0, 0, 5, 0, 0, 5, | ||
| 78 | 0, 5, 5, 0, 5, 5, 0, | ||
| 79 | 5, 5, 5, 5, 5, 5, 5, | ||
| 80 | 5, 5, 5, 5, 5, 5, 5, | ||
| 81 | 0, 5, 5, 5, 5, 5, 0, | ||
| 82 | 0, 0, 5, 5, 5, 0, 0, | ||
| 83 | 5, 0, 0, 5, 0, 0, 5, | ||
| 84 | 0, 5, 0, 0, 0, 5, 0, | ||
| 85 | 1, 0, 5, 0, 5, 0, 1, | ||
| 86 | 0, 1, 0, 5, 0, 1, 0, | ||
| 87 | 0, 0, 1, 0, 1, 0, 0, | ||
| 88 | 0, 0, 0, 1, 0, 0, 0 | ||
| 89 | } | ||
| 90 | }; | ||
| 91 | |||
| 92 | |||
| 93 | void HEART(uint8_t i, bool dir) { | ||
| 94 | led_matrix_set_index_value_all(0); | ||
| 95 | terrazzo_draw_at(0, 0, 7, 15, heart_frames[i % 4]); | ||
| 96 | } | ||
| 97 | |||
| 98 | # endif | ||
| 99 | #endif \ No newline at end of file | ||
diff --git a/keyboards/terrazzo/terrazzo_effects/outrun.h b/keyboards/terrazzo/terrazzo_effects/outrun.h new file mode 100644 index 000000000..b4455ef49 --- /dev/null +++ b/keyboards/terrazzo/terrazzo_effects/outrun.h | |||
| @@ -0,0 +1,127 @@ | |||
| 1 | /* Copyright 2020 ademey "MsMustard" | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #ifndef DISABLE_TERRAZZO_EFFECT_OUTRUN | ||
| 18 | TERRAZZO_EFFECT(OUTRUN) | ||
| 19 | # ifdef TERRAZZO_EFFECT_IMPLS | ||
| 20 | |||
| 21 | static uint8_t outrun_sun[25] = { | ||
| 22 | 0, 9, 9, 9, 0, | ||
| 23 | 7, 7, 7, 7, 7, | ||
| 24 | 4, 4, 4, 4, 4, | ||
| 25 | 2, 2, 2, 2, 2, | ||
| 26 | 0, 1, 1, 1, 0 | ||
| 27 | }; | ||
| 28 | |||
| 29 | static uint8_t outrun_ground[63] = { | ||
| 30 | 0, 0, 1, 1, 1, 0, 0, | ||
| 31 | 0, 2, 0, 2, 0, 2, 0, | ||
| 32 | 0, 2, 0, 2, 0, 2, 0, | ||
| 33 | 0, 2, 0, 4, 0, 2, 0, | ||
| 34 | 2, 0, 0, 5, 0, 0, 2, | ||
| 35 | 2, 0, 0, 5, 0, 0, 2, | ||
| 36 | 2, 0, 0, 6, 0, 0, 2, | ||
| 37 | 0, 0, 0, 7, 0, 0, 0, | ||
| 38 | 0, 0, 0, 8, 0, 0, 0 | ||
| 39 | }; | ||
| 40 | |||
| 41 | static uint8_t outrun_rows[4][63] = { | ||
| 42 | { | ||
| 43 | 1, 1, 1, 1, 1, 1, 1, | ||
| 44 | 0, 0, 0, 0, 0, 0, 0, | ||
| 45 | 2, 2, 2, 2, 2, 2, 2, | ||
| 46 | 0, 0, 0, 0, 0, 0, 0, | ||
| 47 | 0, 0, 0, 0, 0, 0, 0, | ||
| 48 | 4, 4, 4, 4, 4, 4, 4, | ||
| 49 | 0, 0, 0, 0, 0, 0, 0, | ||
| 50 | 0, 0, 0, 0, 0, 0, 0, | ||
| 51 | 0, 0, 0, 0, 0, 0, 0 | ||
| 52 | }, | ||
| 53 | { | ||
| 54 | 0, 0, 0, 0, 0, 0, 0, | ||
| 55 | 1, 1, 1, 1, 1, 1, 1, | ||
| 56 | 0, 0, 0, 0, 0, 0, 0, | ||
| 57 | 2, 2, 2, 2, 2, 2, 2, | ||
| 58 | 0, 0, 0, 0, 0, 0, 0, | ||
| 59 | 0, 0, 0, 0, 0, 0, 0, | ||
| 60 | 4, 4, 4, 4, 4, 4, 4, | ||
| 61 | 0, 0, 0, 0, 0, 0, 0, | ||
| 62 | 0, 0, 0, 0, 0, 0, 0 | ||
| 63 | }, | ||
| 64 | { | ||
| 65 | 1, 1, 1, 1, 1, 1, 1, | ||
| 66 | 0, 0, 0, 0, 0, 0, 0, | ||
| 67 | 2, 2, 2, 2, 2, 2, 2, | ||
| 68 | 0, 0, 0, 0, 0, 0, 0, | ||
| 69 | 4, 4, 4, 4, 4, 4, 4, | ||
| 70 | 0, 0, 0, 0, 0, 0, 0, | ||
| 71 | 0, 0, 0, 0, 0, 0, 0, | ||
| 72 | 9, 9, 9, 9, 9, 9, 9, | ||
| 73 | 0, 0, 0, 0, 0, 0, 0 | ||
| 74 | }, | ||
| 75 | { | ||
| 76 | 0, 0, 0, 0, 0, 0, 0, | ||
| 77 | 1, 1, 1, 1, 1, 1, 1, | ||
| 78 | 0, 0, 0, 0, 0, 0, 0, | ||
| 79 | 2, 2, 2, 2, 2, 2, 2, | ||
| 80 | 0, 0, 0, 0, 0, 0, 0, | ||
| 81 | 4, 4, 4, 4, 4, 4, 4, | ||
| 82 | 0, 0, 0, 0, 0, 0, 0, | ||
| 83 | 0, 0, 0, 0, 0, 0, 0, | ||
| 84 | 9, 9, 9, 9, 9, 9, 9 | ||
| 85 | } | ||
| 86 | }; | ||
| 87 | |||
| 88 | bool last_dir; | ||
| 89 | uint8_t change_index = 0; | ||
| 90 | |||
| 91 | void OUTRUN(uint8_t i, bool dir) { | ||
| 92 | led_matrix_set_index_value_all(0); | ||
| 93 | |||
| 94 | if(dir != last_dir) { | ||
| 95 | change_index = i; | ||
| 96 | } | ||
| 97 | |||
| 98 | uint8_t change_diff = abs(i - change_index); | ||
| 99 | uint8_t horz_bright = 9; | ||
| 100 | |||
| 101 | if(change_diff < 4) { | ||
| 102 | if (dir) { | ||
| 103 | terrazzo_draw_at(1, 4 - change_diff, 5, 1 + change_diff, outrun_sun); | ||
| 104 | horz_bright = 3 + change_diff; | ||
| 105 | } else { | ||
| 106 | terrazzo_draw_at(1, 0 + change_diff, 5, 5 - change_diff, outrun_sun); | ||
| 107 | horz_bright = 5 - change_diff; | ||
| 108 | } | ||
| 109 | } else { | ||
| 110 | if (dir) { | ||
| 111 | terrazzo_draw_at(1, 0, 5, 5, outrun_sun); | ||
| 112 | } else { | ||
| 113 | horz_bright = 1; | ||
| 114 | } | ||
| 115 | } | ||
| 116 | |||
| 117 | for(int x = 0; x < 7; x++){ | ||
| 118 | terrazzo_set_pixel(x, 5, horz_bright); | ||
| 119 | } | ||
| 120 | // Sun is larger but render the top 3 rows only | ||
| 121 | terrazzo_draw_at(0, 6, 7, 10, outrun_ground); | ||
| 122 | terrazzo_draw_at(0, 6, 7, 10, outrun_rows[i % 4]); | ||
| 123 | last_dir = dir; | ||
| 124 | } | ||
| 125 | |||
| 126 | # endif | ||
| 127 | #endif \ No newline at end of file | ||
diff --git a/keyboards/terrazzo/terrazzo_effects/pac_dude.h b/keyboards/terrazzo/terrazzo_effects/pac_dude.h new file mode 100644 index 000000000..aa4fc9923 --- /dev/null +++ b/keyboards/terrazzo/terrazzo_effects/pac_dude.h | |||
| @@ -0,0 +1,67 @@ | |||
| 1 | /* Copyright 2020 ademey "MsMustard" | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #ifndef DISABLE_TERRAZZO_EFFECT_PAC_DUDE | ||
| 18 | TERRAZZO_EFFECT(PAC_DUDE) | ||
| 19 | # ifdef TERRAZZO_EFFECT_IMPLS | ||
| 20 | |||
| 21 | static uint8_t pac_frames[3][25] = { | ||
| 22 | { // up | ||
| 23 | 0, 0, 0, 0, 0, | ||
| 24 | 9, 0, 0, 0, 9, | ||
| 25 | 9, 9, 0, 9, 9, | ||
| 26 | 9, 9, 9, 9, 9, | ||
| 27 | 0, 9, 9, 9, 0 | ||
| 28 | }, | ||
| 29 | { // closed | ||
| 30 | 0, 9, 9, 9, 0, | ||
| 31 | 9, 9, 9, 9, 9, | ||
| 32 | 9, 9, 9, 9, 9, | ||
| 33 | 9, 9, 9, 9, 9, | ||
| 34 | 0, 9, 9, 9, 0 | ||
| 35 | }, | ||
| 36 | { // down | ||
| 37 | 0, 9, 9, 9, 0, | ||
| 38 | 9, 9, 9, 9, 9, | ||
| 39 | 9, 9, 0, 9, 9, | ||
| 40 | 9, 0, 0, 0, 9, | ||
| 41 | 0, 0, 0, 0, 0 | ||
| 42 | } | ||
| 43 | }; | ||
| 44 | |||
| 45 | static uint8_t pac_ghost[20] = { | ||
| 46 | 0, 4, 4, 4, 0, | ||
| 47 | 4, 0, 4, 0, 4, | ||
| 48 | 4, 4, 4, 4, 4, | ||
| 49 | 4, 0, 4, 0, 4 | ||
| 50 | }; | ||
| 51 | |||
| 52 | |||
| 53 | void PAC_DUDE(uint8_t i, bool dir) { | ||
| 54 | led_matrix_set_index_value_all(0); | ||
| 55 | if (dir) { | ||
| 56 | terrazzo_draw_at(1, 4, 5, 5, pac_frames[i % 2]); | ||
| 57 | terrazzo_set_pixel(3, 0 + i % 3, 5); | ||
| 58 | terrazzo_set_pixel(3, 3 + i % 3, 5); | ||
| 59 | } else { | ||
| 60 | terrazzo_draw_at(1, 4, 5, 5, pac_frames[1 + i % 2]); | ||
| 61 | terrazzo_draw_at(1, 8 + i % 8, 5, 4, pac_ghost); | ||
| 62 | } | ||
| 63 | |||
| 64 | } | ||
| 65 | |||
| 66 | # endif | ||
| 67 | #endif \ No newline at end of file | ||
diff --git a/keyboards/terrazzo/terrazzo_effects/stripes.h b/keyboards/terrazzo/terrazzo_effects/stripes.h new file mode 100644 index 000000000..4e1238cdc --- /dev/null +++ b/keyboards/terrazzo/terrazzo_effects/stripes.h | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | /* Copyright 2020 ademey "MsMustard" | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #ifndef DISABLE_TERRAZZO_EFFECT_STRIPES | ||
| 18 | TERRAZZO_EFFECT(STRIPES) | ||
| 19 | # ifdef TERRAZZO_EFFECT_IMPLS | ||
| 20 | |||
| 21 | void STRIPES(uint8_t i, bool dir) { | ||
| 22 | uint8_t sweep[] = {1, 2, 3, 4, 6, 8, 10, 15, 20, 30, 40, 60}; | ||
| 23 | uint8_t levels = 12; | ||
| 24 | float soften = 5; | ||
| 25 | |||
| 26 | for (int y = 0; y < LED_MATRIX_ROWS; y++) { | ||
| 27 | for (int x = 0; x < LED_MATRIX_COLS; x++) { | ||
| 28 | uint8_t target = (x+y+i)%levels; | ||
| 29 | terrazzo_set_pixel(x, y, floor(sweep[target] / soften)); | ||
| 30 | } | ||
| 31 | } | ||
| 32 | } | ||
| 33 | |||
| 34 | # endif | ||
| 35 | #endif \ No newline at end of file | ||
diff --git a/keyboards/terrazzo/terrazzo_effects/terrazzo_effects.inc b/keyboards/terrazzo/terrazzo_effects/terrazzo_effects.inc new file mode 100644 index 000000000..c5271db1b --- /dev/null +++ b/keyboards/terrazzo/terrazzo_effects/terrazzo_effects.inc | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | #include "terrazzo_effects/stripes.h" | ||
| 2 | #include "terrazzo_effects/dino.h" | ||
| 3 | #include "terrazzo_effects/outrun.h" | ||
| 4 | #include "terrazzo_effects/pac_dude.h" | ||
| 5 | #include "terrazzo_effects/heart.h" | ||
| 6 | #include "terrazzo_effects/wpm_chart.h" | ||
| 7 | #include "terrazzo_effects/dot.h" | ||
diff --git a/keyboards/terrazzo/terrazzo_effects/wpm_chart.h b/keyboards/terrazzo/terrazzo_effects/wpm_chart.h new file mode 100644 index 000000000..5c66bc39a --- /dev/null +++ b/keyboards/terrazzo/terrazzo_effects/wpm_chart.h | |||
| @@ -0,0 +1,111 @@ | |||
| 1 | /* Copyright 2020 ademey "MsMustard" | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #ifndef DISABLE_TERRAZZO_EFFECT_WPM_CHART | ||
| 18 | TERRAZZO_EFFECT(WPM_CHART) | ||
| 19 | # ifdef TERRAZZO_EFFECT_IMPLS | ||
| 20 | |||
| 21 | static uint8_t number_3_4[10][12] = { | ||
| 22 | { // 0 | ||
| 23 | 9, 9, 9, | ||
| 24 | 9, 0, 9, | ||
| 25 | 9, 0, 9, | ||
| 26 | 9, 9, 9 | ||
| 27 | }, | ||
| 28 | { // 1 | ||
| 29 | 0, 9, 0, | ||
| 30 | 9, 9, 0, | ||
| 31 | 0, 9, 0, | ||
| 32 | 9, 9, 9 | ||
| 33 | }, | ||
| 34 | { // 2 | ||
| 35 | 9, 9, 0, | ||
| 36 | 0, 0, 9, | ||
| 37 | 0, 9, 0, | ||
| 38 | 9, 9, 9 | ||
| 39 | }, | ||
| 40 | { // 3 | ||
| 41 | 9, 9, 9, | ||
| 42 | 0, 9, 0, | ||
| 43 | 0, 0, 9, | ||
| 44 | 9, 9, 0 | ||
| 45 | }, | ||
| 46 | { // 4 | ||
| 47 | 9, 0, 9, | ||
| 48 | 9, 0, 9, | ||
| 49 | 9, 9, 9, | ||
| 50 | 0, 0, 9 | ||
| 51 | }, | ||
| 52 | { // 5 | ||
| 53 | 9, 9, 9, | ||
| 54 | 9, 9, 0, | ||
| 55 | 0, 0, 9, | ||
| 56 | 9, 9, 9 | ||
| 57 | }, | ||
| 58 | { // 6 | ||
| 59 | 0, 0, 9, | ||
| 60 | 0, 9, 0, | ||
| 61 | 9, 0, 9, | ||
| 62 | 0, 9, 0 | ||
| 63 | }, | ||
| 64 | { // 7 | ||
| 65 | 9, 9, 9, | ||
| 66 | 0, 0, 9, | ||
| 67 | 0, 9, 0, | ||
| 68 | 9, 0, 0 | ||
| 69 | }, | ||
| 70 | { // 8 | ||
| 71 | 9, 9, 9, | ||
| 72 | 9, 0, 9, | ||
| 73 | 9, 4, 9, | ||
| 74 | 9, 9, 9 | ||
| 75 | }, | ||
| 76 | { // 9 | ||
| 77 | 9, 9, 9, | ||
| 78 | 9, 0, 9, | ||
| 79 | 9, 9, 9, | ||
| 80 | 0, 0, 9 | ||
| 81 | } | ||
| 82 | }; | ||
| 83 | |||
| 84 | /* Reference to create a gradient effect */ | ||
| 85 | uint8_t wpm_levels[10] = {20, 9, 8, 7, 6, 5, 4, 3, 2, 1}; | ||
| 86 | |||
| 87 | void WPM_CHART(uint8_t i, bool dir) { | ||
| 88 | led_matrix_set_index_value_all(0); | ||
| 89 | uint8_t c_wpm = get_current_wpm(); | ||
| 90 | uint8_t half_wpm = floor(c_wpm / 2); | ||
| 91 | uint8_t max_rows = 10; | ||
| 92 | /* Turn on LED for current WPM. Each pixel is 2 wpm. */ | ||
| 93 | for (int k = 0; k < half_wpm && k < 70; k++) { | ||
| 94 | uint8_t current_row = (int)floor(k / 7); | ||
| 95 | led_matrix_set_index_value(k, wpm_levels[max_rows - current_row]); | ||
| 96 | }; | ||
| 97 | uint8_t d1 = (int)floor(c_wpm / 10); | ||
| 98 | /* There is only room to print 2 digits. If the WPM is greater than | ||
| 99 | 99 then the last 2 digits will show, ie 120 = 20. */ | ||
| 100 | if (c_wpm > 99) { | ||
| 101 | uint8_t tens_place = d1 % 10; | ||
| 102 | terrazzo_draw_at(0, 11, 3, 4, number_3_4[tens_place]); | ||
| 103 | } else { | ||
| 104 | terrazzo_draw_at(0, 11, 3, 4, number_3_4[d1]); | ||
| 105 | } | ||
| 106 | |||
| 107 | terrazzo_draw_at(4, 11, 3, 4, number_3_4[c_wpm % 10]); | ||
| 108 | } | ||
| 109 | |||
| 110 | # endif | ||
| 111 | #endif \ No newline at end of file | ||
