diff options
| author | MechMerlin <30334081+mechmerlin@users.noreply.github.com> | 2018-08-28 16:52:30 -0700 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2018-08-28 16:52:30 -0700 |
| commit | b1935c5e0dcd1adf32df652c65deffad35cd7405 (patch) | |
| tree | e3f814bae67a65d33bccf1ce187bf4b4104edf1f /keyboards/duck | |
| parent | 3916b06168f39233f77a252fbf5f9cfdae3df4fe (diff) | |
| download | qmk_firmware-b1935c5e0dcd1adf32df652c65deffad35cd7405.tar.gz qmk_firmware-b1935c5e0dcd1adf32df652c65deffad35cd7405.zip | |
Putting my ducks in a row: Eagle/Viper V2 into Duck directory (#3766)
* mv eagle_viper into duck
* delete files
* remove eagle_viper .c and .h
Diffstat (limited to 'keyboards/duck')
| -rw-r--r-- | keyboards/duck/eagle_viper/info.json | 19 | ||||
| -rw-r--r-- | keyboards/duck/eagle_viper/readme.md | 12 | ||||
| -rw-r--r-- | keyboards/duck/eagle_viper/rules.mk | 3 | ||||
| -rw-r--r-- | keyboards/duck/eagle_viper/v2/config.h | 54 | ||||
| -rw-r--r-- | keyboards/duck/eagle_viper/v2/indicator_leds.c | 89 | ||||
| -rw-r--r-- | keyboards/duck/eagle_viper/v2/indicator_leds.h | 2 | ||||
| -rw-r--r-- | keyboards/duck/eagle_viper/v2/keymaps/default/keymap.c | 39 | ||||
| -rw-r--r-- | keyboards/duck/eagle_viper/v2/keymaps/default/readme.md | 10 | ||||
| -rw-r--r-- | keyboards/duck/eagle_viper/v2/keymaps/profanum429/keymap.c | 39 | ||||
| -rw-r--r-- | keyboards/duck/eagle_viper/v2/keymaps/profanum429/readme.md | 5 | ||||
| -rw-r--r-- | keyboards/duck/eagle_viper/v2/matrix.c | 257 | ||||
| -rw-r--r-- | keyboards/duck/eagle_viper/v2/readme.md | 30 | ||||
| -rw-r--r-- | keyboards/duck/eagle_viper/v2/rules.mk | 72 | ||||
| -rw-r--r-- | keyboards/duck/eagle_viper/v2/v2.c | 65 | ||||
| -rw-r--r-- | keyboards/duck/eagle_viper/v2/v2.h | 81 |
15 files changed, 777 insertions, 0 deletions
diff --git a/keyboards/duck/eagle_viper/info.json b/keyboards/duck/eagle_viper/info.json new file mode 100644 index 000000000..f20babdbc --- /dev/null +++ b/keyboards/duck/eagle_viper/info.json | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | { | ||
| 2 | "keyboard_name": "Eagle/Viper", | ||
| 3 | "width": 15, | ||
| 4 | "height": 5, | ||
| 5 | "layouts": { | ||
| 6 | "LAYOUT_all": { | ||
| 7 | "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":"Backspace", "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":"ISO#", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":2, "w":1.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"ISO\\", "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":"Fn", "x":14, "y":3}, {"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}, {"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}] | ||
| 8 | }, | ||
| 9 | "LAYOUT_eagle": { | ||
| 10 | "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, "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}, {"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}] | ||
| 11 | }, | ||
| 12 | "LAYOUT_eagle_splits": { | ||
| 13 | "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":"GUI", "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":"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}] | ||
| 14 | }, | ||
| 15 | "LAYOUT_viper": { | ||
| 16 | "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":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}, {"x":14, "y":3}, {"label":"GUI", "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":"GUI", "x":12.5, "y":4}] | ||
| 17 | } | ||
| 18 | } | ||
| 19 | } | ||
diff --git a/keyboards/duck/eagle_viper/readme.md b/keyboards/duck/eagle_viper/readme.md new file mode 100644 index 000000000..ded0fa72e --- /dev/null +++ b/keyboards/duck/eagle_viper/readme.md | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | # Duck Eagle/Viper | ||
| 2 | |||
| 3 | Non official firmware for custom Korean keyboard with 60% key layout made by Duck. | ||
| 4 | |||
| 5 | See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. | ||
| 6 | |||
| 7 | Newest version is the [Eagle/Viper V2](http://duck0113.tistory.com/127) | ||
| 8 | |||
| 9 | Make example for this keyboard (after setting up your build environment): | ||
| 10 | |||
| 11 | make duck/eagle_viper/v2:default | ||
| 12 | |||
diff --git a/keyboards/duck/eagle_viper/rules.mk b/keyboards/duck/eagle_viper/rules.mk new file mode 100644 index 000000000..263767d06 --- /dev/null +++ b/keyboards/duck/eagle_viper/rules.mk | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | DEFAULT_FOLDER = duck/eagle_viper/v2 | ||
| 2 | |||
| 3 | LAYOUTS = 60_ansi \ No newline at end of file | ||
diff --git a/keyboards/duck/eagle_viper/v2/config.h b/keyboards/duck/eagle_viper/v2/config.h new file mode 100644 index 000000000..f04b4a0fd --- /dev/null +++ b/keyboards/duck/eagle_viper/v2/config.h | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2017 MechMerlin <mechmerlin@gmail.com> | ||
| 3 | |||
| 4 | This program is free software: you can redistribute it and/or modify | ||
| 5 | it under the terms of the GNU General Public License as published by | ||
| 6 | the Free Software Foundation, either version 2 of the License, or | ||
| 7 | (at your option) any later version. | ||
| 8 | |||
| 9 | This program is distributed in the hope that it will be useful, | ||
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | GNU General Public License for more details. | ||
| 13 | |||
| 14 | You should have received a copy of the GNU General Public License | ||
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 16 | */ | ||
| 17 | |||
| 18 | #ifndef CONFIG_H | ||
| 19 | #define CONFIG_H | ||
| 20 | |||
| 21 | #include "config_common.h" | ||
| 22 | |||
| 23 | /* USB Device descriptor parameter */ | ||
| 24 | #define VENDOR_ID 0xFEED | ||
| 25 | #define PRODUCT_ID 0x6050 | ||
| 26 | #define DEVICE_VER 0x0104 | ||
| 27 | #define MANUFACTURER Duck | ||
| 28 | #define PRODUCT Eagle/Viper V2 | ||
| 29 | #define DESCRIPTION 60% Korean custom keyboard | ||
| 30 | |||
| 31 | /* key matrix size */ | ||
| 32 | #define MATRIX_ROWS 5 | ||
| 33 | #define MATRIX_COLS 15 | ||
| 34 | |||
| 35 | #define DIODE_DIRECTION COL2ROW | ||
| 36 | |||
| 37 | /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ | ||
| 38 | #define DEBOUNCING_DELAY 5 | ||
| 39 | |||
| 40 | /* number of backlight levels */ | ||
| 41 | #define BACKLIGHT_LEVELS 3 | ||
| 42 | |||
| 43 | /* key combination for magic key command */ | ||
| 44 | #define IS_COMMAND() ( \ | ||
| 45 | keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ | ||
| 46 | ) | ||
| 47 | |||
| 48 | #define RGBLIGHT_ANIMATIONS | ||
| 49 | #define RGB_DI_PIN D6 | ||
| 50 | #define RGBLED_NUM 17 | ||
| 51 | |||
| 52 | #define TAPPING_TERM 200 | ||
| 53 | |||
| 54 | #endif | ||
diff --git a/keyboards/duck/eagle_viper/v2/indicator_leds.c b/keyboards/duck/eagle_viper/v2/indicator_leds.c new file mode 100644 index 000000000..03a93197d --- /dev/null +++ b/keyboards/duck/eagle_viper/v2/indicator_leds.c | |||
| @@ -0,0 +1,89 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2017 MechMerlin <mechmerlin@gmail.com> | ||
| 3 | |||
| 4 | This program is free software: you can redistribute it and/or modify | ||
| 5 | it under the terms of the GNU General Public License as published by | ||
| 6 | the Free Software Foundation, either version 2 of the License, or | ||
| 7 | (at your option) any later version. | ||
| 8 | |||
| 9 | This program is distributed in the hope that it will be useful, | ||
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | GNU General Public License for more details. | ||
| 13 | |||
| 14 | You should have received a copy of the GNU General Public License | ||
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 16 | */ | ||
| 17 | #include <avr/interrupt.h> | ||
| 18 | #include <avr/io.h> | ||
| 19 | #include <stdbool.h> | ||
| 20 | #include <util/delay.h> | ||
| 21 | #include "indicator_leds.h" | ||
| 22 | |||
| 23 | #define RES 6000 | ||
| 24 | |||
| 25 | #define LED_T1H 600 | ||
| 26 | #define LED_T1L 650 | ||
| 27 | #define LED_T0H 250 | ||
| 28 | #define LED_T0L 1000 | ||
| 29 | |||
| 30 | #define NS_PER_SEC (1000000000L) | ||
| 31 | #define CYCLES_PER_SEC (F_CPU) | ||
| 32 | #define NS_PER_CYCLE (NS_PER_SEC / CYCLES_PER_SEC) | ||
| 33 | #define NS_TO_CYCLES(n) ((n) / NS_PER_CYCLE) | ||
| 34 | |||
| 35 | void send_bit_d4(bool bitVal) { | ||
| 36 | if(bitVal) { | ||
| 37 | asm volatile ( | ||
| 38 | "sbi %[port], %[bit] \n\t" | ||
| 39 | ".rept %[onCycles] \n\t" | ||
| 40 | "nop \n\t" | ||
| 41 | ".endr \n\t" | ||
| 42 | "cbi %[port], %[bit] \n\t" | ||
| 43 | ".rept %[offCycles] \n\t" | ||
| 44 | "nop \n\t" | ||
| 45 | ".endr \n\t" | ||
| 46 | :: | ||
| 47 | [port] "I" (_SFR_IO_ADDR(PORTD)), | ||
| 48 | [bit] "I" (4), | ||
| 49 | [onCycles] "I" (NS_TO_CYCLES(LED_T1H) - 2), | ||
| 50 | [offCycles] "I" (NS_TO_CYCLES(LED_T1L) - 2)); | ||
| 51 | } else { | ||
| 52 | asm volatile ( | ||
| 53 | "sbi %[port], %[bit] \n\t" | ||
| 54 | ".rept %[onCycles] \n\t" | ||
| 55 | "nop \n\t" | ||
| 56 | ".endr \n\t" | ||
| 57 | "cbi %[port], %[bit] \n\t" | ||
| 58 | ".rept %[offCycles] \n\t" | ||
| 59 | "nop \n\t" | ||
| 60 | ".endr \n\t" | ||
| 61 | :: | ||
| 62 | [port] "I" (_SFR_IO_ADDR(PORTD)), | ||
| 63 | [bit] "I" (4), | ||
| 64 | [onCycles] "I" (NS_TO_CYCLES(LED_T0H) - 2), | ||
| 65 | [offCycles] "I" (NS_TO_CYCLES(LED_T0L) - 2)); | ||
| 66 | } | ||
| 67 | } | ||
| 68 | |||
| 69 | void show(void) { | ||
| 70 | _delay_us((RES / 1000UL) + 1); | ||
| 71 | } | ||
| 72 | |||
| 73 | void send_value(uint8_t byte) { | ||
| 74 | for(uint8_t b = 0; b < 8; b++) { | ||
| 75 | send_bit_d4(byte & 0b10000000); | ||
| 76 | byte <<= 1; | ||
| 77 | } | ||
| 78 | } | ||
| 79 | |||
| 80 | // Send the LED indicators to the WS2811S chips | ||
| 81 | void indicator_leds_set(bool leds[8]) { | ||
| 82 | uint8_t led_cnt; | ||
| 83 | |||
| 84 | cli(); | ||
| 85 | for(led_cnt = 0; led_cnt < 8; led_cnt++) | ||
| 86 | send_value(leds[led_cnt] ? 255 : 0); | ||
| 87 | sei(); | ||
| 88 | show(); | ||
| 89 | } | ||
diff --git a/keyboards/duck/eagle_viper/v2/indicator_leds.h b/keyboards/duck/eagle_viper/v2/indicator_leds.h new file mode 100644 index 000000000..c174fa404 --- /dev/null +++ b/keyboards/duck/eagle_viper/v2/indicator_leds.h | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | void indicator_leds_set(bool leds[8]); | ||
| 2 | void show(void); | ||
diff --git a/keyboards/duck/eagle_viper/v2/keymaps/default/keymap.c b/keyboards/duck/eagle_viper/v2/keymaps/default/keymap.c new file mode 100644 index 000000000..332db66e6 --- /dev/null +++ b/keyboards/duck/eagle_viper/v2/keymaps/default/keymap.c | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | /* Copyright 2017 MechMerlin <mechmerlin@gmail.com> | ||
| 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 | #include QMK_KEYBOARD_H | ||
| 17 | |||
| 18 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 19 | /* layer 0: qwerty */ | ||
| 20 | [0] = LAYOUT_all(\ | ||
| 21 | 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, XXXXXXX, KC_BSPC, \ | ||
| 22 | 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, \ | ||
| 23 | KC_CAPS, 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, \ | ||
| 24 | 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, XXXXXXX, \ | ||
| 25 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RALT, KC_RGUI, KC_RCTL \ | ||
| 26 | ), | ||
| 27 | |||
| 28 | [1] = LAYOUT_all(\ | ||
| 29 | _______, RGB_TOG, RGB_MOD, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ | ||
| 30 | _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ | ||
| 31 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ | ||
| 32 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ | ||
| 33 | _______, _______, _______, _______, _______, _______, _______, _______ \ | ||
| 34 | ), | ||
| 35 | }; | ||
| 36 | |||
| 37 | const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { | ||
| 38 | return MACRO_NONE; | ||
| 39 | }; | ||
diff --git a/keyboards/duck/eagle_viper/v2/keymaps/default/readme.md b/keyboards/duck/eagle_viper/v2/keymaps/default/readme.md new file mode 100644 index 000000000..834ff7cd3 --- /dev/null +++ b/keyboards/duck/eagle_viper/v2/keymaps/default/readme.md | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | # Default Eagle Layout | ||
| 2 | |||
| 3 | This is the default implement layout for Duck Eagle V2. | ||
| 4 | |||
| 5 |  | ||
| 6 | |||
| 7 | |||
| 8 | ## Features | ||
| 9 | |||
| 10 | * Default QWERTY layer | ||
diff --git a/keyboards/duck/eagle_viper/v2/keymaps/profanum429/keymap.c b/keyboards/duck/eagle_viper/v2/keymaps/profanum429/keymap.c new file mode 100644 index 000000000..a0163ad6a --- /dev/null +++ b/keyboards/duck/eagle_viper/v2/keymaps/profanum429/keymap.c | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | /* Copyright 2017 MechMerlin <mechmerlin@gmail.com> | ||
| 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 | #include QMK_KEYBOARD_H | ||
| 17 | |||
| 18 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 19 | /* layer 0: qwerty */ | ||
| 20 | [0] = LAYOUT_viper( \ | ||
| 21 | 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, \ | ||
| 22 | 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, \ | ||
| 23 | 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, \ | ||
| 24 | 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), \ | ||
| 25 | KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI \ | ||
| 26 | ), | ||
| 27 | |||
| 28 | [1] = LAYOUT_viper( \ | ||
| 29 | _______, 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, \ | ||
| 30 | KC_CAPS, RGB_TOG, RGB_MOD, RGB_VAI, RESET, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, _______, KC_BSPC, \ | ||
| 31 | _______, KC_VOLU, KC_VOLD, KC_MUTE, _______, _______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_ENT, \ | ||
| 32 | _______, _______, _______, _______, _______, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______, \ | ||
| 33 | _______, _______, _______, _______, _______ \ | ||
| 34 | ), | ||
| 35 | }; | ||
| 36 | |||
| 37 | const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { | ||
| 38 | return MACRO_NONE; | ||
| 39 | }; | ||
diff --git a/keyboards/duck/eagle_viper/v2/keymaps/profanum429/readme.md b/keyboards/duck/eagle_viper/v2/keymaps/profanum429/readme.md new file mode 100644 index 000000000..0f993559e --- /dev/null +++ b/keyboards/duck/eagle_viper/v2/keymaps/profanum429/readme.md | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # Profanum429 Duck Viper V2 Layout | ||
| 2 | TODO | ||
| 3 | |||
| 4 | ## Features | ||
| 5 | TODO | ||
diff --git a/keyboards/duck/eagle_viper/v2/matrix.c b/keyboards/duck/eagle_viper/v2/matrix.c new file mode 100644 index 000000000..7003a7ae0 --- /dev/null +++ b/keyboards/duck/eagle_viper/v2/matrix.c | |||
| @@ -0,0 +1,257 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2017 MechMerlin <mechmerlin@gmail.com> | ||
| 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 <util/delay.h> | ||
| 18 | #include <avr/io.h> | ||
| 19 | #include <stdio.h> | ||
| 20 | #include "matrix.h" | ||
| 21 | #include "util.h" | ||
| 22 | #include "print.h" | ||
| 23 | #include "debug.h" | ||
| 24 | |||
| 25 | static uint8_t debouncing = DEBOUNCING_DELAY; | ||
| 26 | |||
| 27 | /* matrix state(1:on, 0:off) */ | ||
| 28 | static matrix_row_t matrix[MATRIX_ROWS]; | ||
| 29 | static matrix_row_t matrix_debouncing[MATRIX_ROWS]; | ||
| 30 | |||
| 31 | static uint8_t read_rows(uint8_t col); | ||
| 32 | static void init_rows(void); | ||
| 33 | static void unselect_cols(void); | ||
| 34 | static void select_col(uint8_t col); | ||
| 35 | |||
| 36 | |||
| 37 | __attribute__ ((weak)) | ||
| 38 | void matrix_init_kb(void) { | ||
| 39 | matrix_init_user(); | ||
| 40 | } | ||
| 41 | |||
| 42 | __attribute__ ((weak)) | ||
| 43 | void matrix_scan_kb(void) { | ||
| 44 | matrix_scan_user(); | ||
| 45 | } | ||
| 46 | |||
| 47 | __attribute__ ((weak)) | ||
| 48 | void matrix_init_user(void) { | ||
| 49 | } | ||
| 50 | |||
| 51 | __attribute__ ((weak)) | ||
| 52 | void matrix_scan_user(void) { | ||
| 53 | } | ||
| 54 | |||
| 55 | void backlight_init_ports(void) | ||
| 56 | { | ||
| 57 | DDRD |= 0b11010000; | ||
| 58 | PORTD &= ~0b01010000; | ||
| 59 | PORTD |= 0b10000000; | ||
| 60 | DDRB |= 0b00011111; | ||
| 61 | PORTB &= ~0b00001110; | ||
| 62 | PORTB |= 0b00010001; | ||
| 63 | DDRE |= 0b01000000; | ||
| 64 | PORTE &= ~0b01000000; | ||
| 65 | } | ||
| 66 | |||
| 67 | void matrix_init(void) { | ||
| 68 | backlight_init_ports(); | ||
| 69 | unselect_cols(); | ||
| 70 | init_rows(); | ||
| 71 | |||
| 72 | for (uint8_t i=0; i < MATRIX_ROWS; i++) { | ||
| 73 | matrix[i] = 0; | ||
| 74 | matrix_debouncing[i] = 0; | ||
| 75 | } | ||
| 76 | |||
| 77 | matrix_init_quantum(); | ||
| 78 | } | ||
| 79 | |||
| 80 | uint8_t matrix_scan(void) { | ||
| 81 | for (uint8_t col = 0; col < MATRIX_COLS; col++) { | ||
| 82 | select_col(col); | ||
| 83 | _delay_us(3); | ||
| 84 | |||
| 85 | uint8_t rows = read_rows(col); | ||
| 86 | |||
| 87 | for (uint8_t row = 0; row < MATRIX_ROWS; row++) { | ||
| 88 | bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1<<col); | ||
| 89 | bool curr_bit = rows & (1<<row); | ||
| 90 | if (prev_bit != curr_bit) { | ||
| 91 | matrix_debouncing[row] ^= ((matrix_row_t)1<<col); | ||
| 92 | debouncing = DEBOUNCING_DELAY; | ||
| 93 | } | ||
| 94 | } | ||
| 95 | unselect_cols(); | ||
| 96 | } | ||
| 97 | |||
| 98 | if (debouncing) { | ||
| 99 | if (--debouncing) { | ||
| 100 | _delay_ms(1); | ||
| 101 | } else { | ||
| 102 | for (uint8_t i = 0; i < MATRIX_ROWS; i++) { | ||
| 103 | matrix[i] = matrix_debouncing[i]; | ||
| 104 | } | ||
| 105 | } | ||
| 106 | } | ||
| 107 | |||
| 108 | matrix_scan_quantum(); | ||
| 109 | return 1; | ||
| 110 | } | ||
| 111 | |||
| 112 | inline matrix_row_t matrix_get_row(uint8_t row) { | ||
| 113 | return matrix[row]; | ||
| 114 | } | ||
| 115 | |||
| 116 | void matrix_print(void) { | ||
| 117 | print("\nr/c 0123456789ABCDEF\n"); | ||
| 118 | for (uint8_t row = 0; row < MATRIX_ROWS; row++) { | ||
| 119 | xprintf("%02X: %032lb\n", row, bitrev32(matrix_get_row(row))); | ||
| 120 | } | ||
| 121 | } | ||
| 122 | |||
| 123 | /* Row pin configuration | ||
| 124 | * row: 0 1 2 3 4 5 | ||
| 125 | * pin: PB7 PD0 PD1 PD2 PD3 PD5 | ||
| 126 | * | ||
| 127 | * Esc uses its own pin PE2 | ||
| 128 | */ | ||
| 129 | static void init_rows(void) { | ||
| 130 | DDRD &= ~0b00101111; | ||
| 131 | PORTD &= ~0b00101111; | ||
| 132 | |||
| 133 | DDRB &= ~0b10000000; | ||
| 134 | PORTB &= ~0b10000000; | ||
| 135 | |||
| 136 | DDRE &= ~0b00000100; | ||
| 137 | PORTE |= 0b00000100; | ||
| 138 | } | ||
| 139 | |||
| 140 | static uint8_t read_rows(uint8_t col) { | ||
| 141 | |||
| 142 | return (PIND&(1<<0) ? (1<<0) : 0) | | ||
| 143 | (PIND&(1<<1) ? (1<<1) : 0) | | ||
| 144 | (PIND&(1<<2) ? (1<<2) : 0) | | ||
| 145 | (PIND&(1<<3) ? (1<<3) : 0) | | ||
| 146 | (PIND&(1<<5) ? (1<<4) : 0) | | ||
| 147 | (PINB&(1<<7) ? (1<<5) : 0) | | ||
| 148 | (col==0 ? ((PINE&(1<<2) ? 0 : (1<<2))) : 0); | ||
| 149 | |||
| 150 | } | ||
| 151 | |||
| 152 | uint8_t read_fwkey(void) | ||
| 153 | { | ||
| 154 | return PINE&(1<<2) ? 0 : (1<<2); | ||
| 155 | } | ||
| 156 | |||
| 157 | /* Columns 0 - 15 | ||
| 158 | * These columns uses two 74HC237D 3 to 8 bit demultiplexers. | ||
| 159 | * col / pin: PC6 PB6 PF0 PF1 PC7 | ||
| 160 | * 0: 1 0 0 0 0 | ||
| 161 | * 1: 1 0 1 0 0 | ||
| 162 | * 2: 1 0 0 1 0 | ||
| 163 | * 3: 1 0 1 1 0 | ||
| 164 | * 4: 1 0 0 0 1 | ||
| 165 | * 5: 1 0 1 0 1 | ||
| 166 | * 6: 1 0 0 1 1 | ||
| 167 | * 7: 1 0 1 1 1 | ||
| 168 | * 8: 0 1 0 0 0 | ||
| 169 | * 9: 0 1 1 0 0 | ||
| 170 | * 10: 0 1 0 1 0 | ||
| 171 | * 11: 0 1 1 1 0 | ||
| 172 | * 12: 0 1 0 0 1 | ||
| 173 | * 13: 0 1 1 0 1 | ||
| 174 | * 14: 0 1 0 1 1 | ||
| 175 | * 15: 0 1 1 1 1 | ||
| 176 | * | ||
| 177 | */ | ||
| 178 | static void unselect_cols(void) { | ||
| 179 | DDRB |= 0b01000000; | ||
| 180 | PORTB &= ~0b01000000; | ||
| 181 | |||
| 182 | DDRC |= 0b11000000; | ||
| 183 | PORTC &= ~0b11000000; | ||
| 184 | |||
| 185 | DDRF |= 0b00000011; | ||
| 186 | PORTF &= ~0b00000011; | ||
| 187 | } | ||
| 188 | |||
| 189 | static void select_col(uint8_t col) { | ||
| 190 | |||
| 191 | switch (col) { | ||
| 192 | case 0: | ||
| 193 | PORTC |= 0b01000000; | ||
| 194 | break; | ||
| 195 | case 1: | ||
| 196 | PORTC |= 0b01000000; | ||
| 197 | PORTF |= 0b00000001; | ||
| 198 | break; | ||
| 199 | case 2: | ||
| 200 | PORTC |= 0b01000000; | ||
| 201 | PORTF |= 0b00000010; | ||
| 202 | break; | ||
| 203 | case 3: | ||
| 204 | PORTC |= 0b01000000; | ||
| 205 | PORTF |= 0b00000011; | ||
| 206 | break; | ||
| 207 | case 4: | ||
| 208 | PORTC |= 0b11000000; | ||
| 209 | break; | ||
| 210 | case 5: | ||
| 211 | PORTC |= 0b11000000; | ||
| 212 | PORTF |= 0b00000001; | ||
| 213 | break; | ||
| 214 | case 6: | ||
| 215 | PORTC |= 0b11000000; | ||
| 216 | PORTF |= 0b00000010; | ||
| 217 | break; | ||
| 218 | case 7: | ||
| 219 | PORTC |= 0b11000000; | ||
| 220 | PORTF |= 0b00000011; | ||
| 221 | break; | ||
| 222 | case 8: | ||
| 223 | PORTB |= 0b01000000; | ||
| 224 | break; | ||
| 225 | case 9: | ||
| 226 | PORTB |= 0b01000000; | ||
| 227 | PORTF |= 0b00000001; | ||
| 228 | break; | ||
| 229 | case 10: | ||
| 230 | PORTB |= 0b01000000; | ||
| 231 | PORTF |= 0b00000010; | ||
| 232 | break; | ||
| 233 | case 11: | ||
| 234 | PORTB |= 0b01000000; | ||
| 235 | PORTF |= 0b00000011; | ||
| 236 | break; | ||
| 237 | case 12: | ||
| 238 | PORTB |= 0b01000000; | ||
| 239 | PORTC |= 0b10000000; | ||
| 240 | break; | ||
| 241 | case 13: | ||
| 242 | PORTB |= 0b01000000; | ||
| 243 | PORTF |= 0b00000001; | ||
| 244 | PORTC |= 0b10000000; | ||
| 245 | break; | ||
| 246 | case 14: | ||
| 247 | PORTB |= 0b01000000; | ||
| 248 | PORTF |= 0b00000010; | ||
| 249 | PORTC |= 0b10000000; | ||
| 250 | break; | ||
| 251 | case 15: | ||
| 252 | PORTB |= 0b01000000; | ||
| 253 | PORTF |= 0b00000011; | ||
| 254 | PORTC |= 0b10000000; | ||
| 255 | break; | ||
| 256 | } | ||
| 257 | } | ||
diff --git a/keyboards/duck/eagle_viper/v2/readme.md b/keyboards/duck/eagle_viper/v2/readme.md new file mode 100644 index 000000000..b613b63b9 --- /dev/null +++ b/keyboards/duck/eagle_viper/v2/readme.md | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | # Duck Eagle/Viper V2 | ||
| 2 | |||
| 3 | Non official firmware for custom Korean keyboard with 60% key layout made by Duck. | ||
| 4 | Group buy was run November 2016 via [geekhack](https://geekhack.org/index.php?topic=86087.0) with 100 keyboards total. | ||
| 5 | |||
| 6 | Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) | ||
| 7 | Hardware Supported: Duck Eagle/Viper PCB Ver 2.0, Atmega32u4 | ||
| 8 | Hardware Availability: Wait until GB of the next revision | ||
| 9 | |||
| 10 | Make example for this keyboard (after setting up your build environment): | ||
| 11 | |||
| 12 | make eagle_viper/v2:default | ||
| 13 | |||
| 14 | See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. | ||
| 15 | |||
| 16 | ## Hardware Notes | ||
| 17 | |||
| 18 | The Duck Eagle/Viper V2 PCB consists of: | ||
| 19 | |||
| 20 | ### Microchips | ||
| 21 | 2 74HC237D 3-to-8 line decoders | ||
| 22 | 1 Atmega32u4 microcontroller | ||
| 23 | 2 WS2811 LED controller | ||
| 24 | |||
| 25 | ## Notes | ||
| 26 | Thanks to Ralf Schmitt for previous implementations in his [TMK fork](https://github.com/xauser/tmk_keyboard/tree/xauser/) and few helping words. | ||
| 27 | |||
| 28 | Based heavily on Rasmus Schults [Duck Lightsaver QMK Port](https://github.com/qmk/qmk_firmware/tree/master/keyboards/lightsaver) | ||
| 29 | |||
| 30 | Special thanks to profanum429 for debugging help and contributions to support the Viper and LED indicators. | ||
diff --git a/keyboards/duck/eagle_viper/v2/rules.mk b/keyboards/duck/eagle_viper/v2/rules.mk new file mode 100644 index 000000000..64d839fcb --- /dev/null +++ b/keyboards/duck/eagle_viper/v2/rules.mk | |||
| @@ -0,0 +1,72 @@ | |||
| 1 | # MCU name | ||
| 2 | MCU = atmega32u4 | ||
| 3 | |||
| 4 | # Processor frequency. | ||
| 5 | # This will define a symbol, F_CPU, in all source code files equal to the | ||
| 6 | # processor frequency in Hz. You can then use this symbol in your source code to | ||
| 7 | # calculate timings. Do NOT tack on a 'UL' at the end, this will be done | ||
| 8 | # automatically to create a 32-bit value in your source code. | ||
| 9 | # | ||
| 10 | # This will be an integer division of F_USB below, as it is sourced by | ||
| 11 | # F_USB after it has run through any CPU prescalers. Note that this value | ||
| 12 | # does not *change* the processor frequency - it should merely be updated to | ||
| 13 | # reflect the processor speed set externally so that the code can use accurate | ||
| 14 | # software delays. | ||
| 15 | F_CPU = 16000000 | ||
| 16 | |||
| 17 | |||
| 18 | # | ||
| 19 | # LUFA specific | ||
| 20 | # | ||
| 21 | # Target architecture (see library "Board Types" documentation). | ||
| 22 | ARCH = AVR8 | ||
| 23 | |||
| 24 | # Input clock frequency. | ||
| 25 | # This will define a symbol, F_USB, in all source code files equal to the | ||
| 26 | # input clock frequency (before any prescaling is performed) in Hz. This value may | ||
| 27 | # differ from F_CPU if prescaling is used on the latter, and is required as the | ||
| 28 | # raw input clock is fed directly to the PLL sections of the AVR for high speed | ||
| 29 | # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' | ||
| 30 | # at the end, this will be done automatically to create a 32-bit value in your | ||
| 31 | # source code. | ||
| 32 | # | ||
| 33 | # If no clock division is performed on the input clock inside the AVR (via the | ||
| 34 | # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. | ||
| 35 | F_USB = $(F_CPU) | ||
| 36 | |||
| 37 | # Interrupt driven control endpoint task(+60) | ||
| 38 | #OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT | ||
| 39 | |||
| 40 | |||
| 41 | # Boot Section Size in *bytes* | ||
| 42 | # Teensy halfKay 512 | ||
| 43 | # Teensy++ halfKay 1024 | ||
| 44 | # Atmel DFU loader 4096 | ||
| 45 | # LUFA bootloader 4096 | ||
| 46 | # USBaspLoader 2048 | ||
| 47 | OPT_DEFS += -DBOOTLOADER_SIZE=4096 | ||
| 48 | |||
| 49 | |||
| 50 | # Build Options | ||
| 51 | # change yes to no to disable | ||
| 52 | # | ||
| 53 | BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) | ||
| 54 | MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) | ||
| 55 | EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) | ||
| 56 | CONSOLE_ENABLE ?= no # Console for debug(+400) | ||
| 57 | COMMAND_ENABLE ?= yes # Commands for debug and configuration | ||
| 58 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | ||
| 59 | SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend | ||
| 60 | # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | ||
| 61 | NKRO_ENABLE ?= yes # USB Nkey Rollover | ||
| 62 | BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality on B7 by default | ||
| 63 | MIDI_ENABLE ?= no # MIDI support (+2400 to 4200, depending on config) | ||
| 64 | UNICODE_ENABLE ?= no # Unicode | ||
| 65 | BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID | ||
| 66 | AUDIO_ENABLE ?= no # Audio output on port C6 | ||
| 67 | FAUXCLICKY_ENABLE ?= no # Use buzzer to emulate clicky switches | ||
| 68 | RGBLIGHT_ENABLE = yes | ||
| 69 | |||
| 70 | CUSTOM_MATRIX = yes | ||
| 71 | SRC += indicator_leds.c \ | ||
| 72 | matrix.c | ||
diff --git a/keyboards/duck/eagle_viper/v2/v2.c b/keyboards/duck/eagle_viper/v2/v2.c new file mode 100644 index 000000000..a60acb978 --- /dev/null +++ b/keyboards/duck/eagle_viper/v2/v2.c | |||
| @@ -0,0 +1,65 @@ | |||
| 1 | /* Copyright 2017 MechMerlin <mechmerlin@gmail.com> | ||
| 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 | #include "v2.h" | ||
| 17 | #include "indicator_leds.h" | ||
| 18 | |||
| 19 | enum BACKLIGHT_AREAS { | ||
| 20 | BACKLIGHT_ALPHAS = 0b00000010, | ||
| 21 | BACKLIGHT_MODNUM = 0b00001000 | ||
| 22 | }; | ||
| 23 | |||
| 24 | void backlight_set(uint8_t level) { | ||
| 25 | switch(level) { | ||
| 26 | case 0: | ||
| 27 | PORTB |= BACKLIGHT_ALPHAS; | ||
| 28 | PORTB |= BACKLIGHT_MODNUM; | ||
| 29 | break; | ||
| 30 | case 1: | ||
| 31 | PORTB &= ~BACKLIGHT_ALPHAS; | ||
| 32 | PORTB |= BACKLIGHT_MODNUM; | ||
| 33 | break; | ||
| 34 | case 2: | ||
| 35 | PORTB |= BACKLIGHT_ALPHAS; | ||
| 36 | PORTB &= ~BACKLIGHT_MODNUM; | ||
| 37 | break; | ||
| 38 | case 3: | ||
| 39 | PORTB &= ~BACKLIGHT_ALPHAS; | ||
| 40 | PORTB &= ~BACKLIGHT_MODNUM; | ||
| 41 | break; | ||
| 42 | } | ||
| 43 | } | ||
| 44 | |||
| 45 | // Port from backlight_update_state | ||
| 46 | void led_set_kb(uint8_t usb_led) { | ||
| 47 | bool status[8] = { | ||
| 48 | host_keyboard_leds() & (1<<USB_LED_SCROLL_LOCK), /* LED 3 */ | ||
| 49 | host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK), /* LED 2 */ | ||
| 50 | host_keyboard_leds() & (1<<USB_LED_NUM_LOCK), /* LED 1 */ | ||
| 51 | |||
| 52 | layer_state & (1<<2), /* LED 6 */ | ||
| 53 | layer_state & (1<<1), /* LED 5 */ | ||
| 54 | layer_state & (1<<0) ? 0: 1, /* LED 4 */ | ||
| 55 | |||
| 56 | layer_state & (1<<5), /* LED 8 */ | ||
| 57 | layer_state & (1<<4) /* LED 7 */ | ||
| 58 | }; | ||
| 59 | |||
| 60 | indicator_leds_set(status); | ||
| 61 | } | ||
| 62 | |||
| 63 | bool process_record_kb(uint16_t keycode, keyrecord_t *record) { | ||
| 64 | return process_record_user(keycode, record); | ||
| 65 | } | ||
diff --git a/keyboards/duck/eagle_viper/v2/v2.h b/keyboards/duck/eagle_viper/v2/v2.h new file mode 100644 index 000000000..d149471ba --- /dev/null +++ b/keyboards/duck/eagle_viper/v2/v2.h | |||
| @@ -0,0 +1,81 @@ | |||
| 1 | /* Copyright 2017 MechMerlin <mechmerlin@gmail.com> | ||
| 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 | #ifndef V2_H | ||
| 17 | #define V2_H | ||
| 18 | |||
| 19 | #include "quantum.h" | ||
| 20 | |||
| 21 | #define ___ KC_NO | ||
| 22 | |||
| 23 | #define LAYOUT_all( \ | ||
| 24 | K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O, \ | ||
| 25 | K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3O, \ | ||
| 26 | K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2M, K2O, \ | ||
| 27 | K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1M, K1N, K1O, \ | ||
| 28 | K0A, K0B, K0C, K0I, K0K, K0M, K0N, K0O \ | ||
| 29 | ) { \ | ||
| 30 | { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O }, \ | ||
| 31 | { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, ___, K3O }, \ | ||
| 32 | { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2M, ___, K2O }, \ | ||
| 33 | { K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, ___, K1M, K1N, K1O }, \ | ||
| 34 | { K0A, K0B, K0C, ___, ___, ___, ___, ___, K0I, ___, K0K, ___, K0M, K0N, K0O } \ | ||
| 35 | } | ||
| 36 | |||
| 37 | #define LAYOUT_60_ansi( \ | ||
| 38 | K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4O, \ | ||
| 39 | K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3O, \ | ||
| 40 | K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2O, \ | ||
| 41 | K1A, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1M, K1N, \ | ||
| 42 | K0A, K0B, K0C, K0I, K0K, K0M, K0N, K0O \ | ||
| 43 | ) { \ | ||
| 44 | { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, ___, K4O }, \ | ||
| 45 | { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, ___, K3O }, \ | ||
| 46 | { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, ___, ___, K2O }, \ | ||
| 47 | { K1A, ___, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, ___, K1M, K1N, ___ }, \ | ||
| 48 | { K0A, K0B, K0C, ___, ___, ___, ___, ___, K0I, ___, K0K, ___, K0M, K0N, K0O } \ | ||
| 49 | } | ||
| 50 | |||
| 51 | #define LAYOUT_eagle_splits( \ | ||
| 52 | K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O, \ | ||
| 53 | K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3O, \ | ||
| 54 | K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2O, \ | ||
| 55 | K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1M, K1N, K1O, \ | ||
| 56 | K0A, K0B, K0C, K0I, K0K, K0M, K0N, K0O \ | ||
| 57 | ) { \ | ||
| 58 | { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O }, \ | ||
| 59 | { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, ___, K3O }, \ | ||
| 60 | { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, ___, ___, K2O }, \ | ||
| 61 | { K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, ___, K1M, K1N, K1O }, \ | ||
| 62 | { K0A, K0B, K0C, ___, ___, ___, ___, ___, K0I, ___, K0K, ___, K0M, K0N, K0O } \ | ||
| 63 | } | ||
| 64 | |||
| 65 | #define LAYOUT_viper( \ | ||
| 66 | K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O, \ | ||
| 67 | K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3O, \ | ||
| 68 | K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2O, \ | ||
| 69 | K1A, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1M, K1N, K1O, \ | ||
| 70 | K0B, K0C, K0I, K0M, K0N \ | ||
| 71 | ) { \ | ||
| 72 | { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O }, \ | ||
| 73 | { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, ___, K3O }, \ | ||
| 74 | { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, ___, ___, K2O }, \ | ||
| 75 | { K1A, ___, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, ___, K1M, K1N, K1O }, \ | ||
| 76 | { ___, K0B, K0C, ___, ___, ___, ___, ___, K0I, ___, ___, ___, K0M, K0N, ___ } \ | ||
| 77 | } | ||
| 78 | |||
| 79 | #define LAYOUT_eagle LAYOUT_60_ansi | ||
| 80 | |||
| 81 | #endif | ||
