From 77433b1a3140411b8b8f1b0389827c38384fc5fe Mon Sep 17 00:00:00 2001
From: itsdrdick <itsdrdick@gmail.com>
Date: Thu, 20 Sep 2018 07:16:18 +0800
Subject: Keyboard: Add evil80 keyboard (#3921)

* Add evil80 keyboard

* Delete rules.mk

* Update config.h

* Update keymap.c

* Update keymap.c
---
 keyboards/evil80/config.h                 | 64 +++++++++++++++++++++++++++++
 keyboards/evil80/evil80.c                 | 47 +++++++++++++++++++++
 keyboards/evil80/evil80.h                 | 23 +++++++++++
 keyboards/evil80/info.json                | 13 ++++++
 keyboards/evil80/keymaps/default/keymap.c | 31 ++++++++++++++
 keyboards/evil80/rules.mk                 | 68 +++++++++++++++++++++++++++++++
 6 files changed, 246 insertions(+)
 create mode 100644 keyboards/evil80/config.h
 create mode 100644 keyboards/evil80/evil80.c
 create mode 100644 keyboards/evil80/evil80.h
 create mode 100644 keyboards/evil80/info.json
 create mode 100644 keyboards/evil80/keymaps/default/keymap.c
 create mode 100644 keyboards/evil80/rules.mk

(limited to 'keyboards/evil80')

diff --git a/keyboards/evil80/config.h b/keyboards/evil80/config.h
new file mode 100644
index 000000000..81138a770
--- /dev/null
+++ b/keyboards/evil80/config.h
@@ -0,0 +1,64 @@
+#pragma once
+
+#include "config_common.h"
+
+/* USB Device descriptor parameter */
+#define VENDOR_ID       0xFEED
+#define PRODUCT_ID      0x6060
+#define DEVICE_VER 		0x0001
+#define MANUFACTURER    Evil
+#define PRODUCT         Evil80
+#define DESCRIPTION     QMK keyboard firmware for Evil80
+
+/* key matrix size */
+#define MATRIX_ROWS 6
+#define MATRIX_COLS 16
+
+/* Planck PCB default pin-out */
+#define MATRIX_ROW_PINS { F1, F4, F5, F0, B3, B0 }
+#define MATRIX_COL_PINS { B2, D0, D1, D2, D3, D5, D4, D6, D7, B4, B1, C6, C7, E6, F6, F7 }
+#define UNUSED_PINS
+
+#define BACKLIGHT_PIN B5
+#define BACKLIGHT_BREATHING
+
+/* COL2ROW or ROW2COL */
+#define DIODE_DIRECTION COL2ROW
+
+/* define if matrix has ghost */
+//#define MATRIX_HAS_GHOST
+
+/* number of backlight levels */
+#define BACKLIGHT_LEVELS 3
+
+/* Set 0 if debouncing isn't needed */
+#define DEBOUNCING_DELAY 5
+
+/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
+#define LOCKING_SUPPORT_ENABLE
+
+/* Locking resynchronize hack */
+#define LOCKING_RESYNC_ENABLE
+
+/* key combination for command */
+#define IS_COMMAND() ( \
+    keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
+)
+
+/*
+ * Feature disable options
+ *  These options are also useful to firmware size reduction.
+ */
+
+/* disable debug print */
+//#define NO_DEBUG
+
+/* disable print */
+//#define NO_PRINT
+
+/* disable action features */
+//#define NO_ACTION_LAYER
+//#define NO_ACTION_TAPPING
+//#define NO_ACTION_ONESHOT
+//#define NO_ACTION_MACRO
+//#define NO_ACTION_FUNCTION
diff --git a/keyboards/evil80/evil80.c b/keyboards/evil80/evil80.c
new file mode 100644
index 000000000..d4653d049
--- /dev/null
+++ b/keyboards/evil80/evil80.c
@@ -0,0 +1,47 @@
+#include "evil80.h"
+void matrix_init_kb(void) {
+    // put your keyboard start-up code here
+    // runs once when the firmware starts up
+    led_init_ports();
+    matrix_init_user();
+}
+
+void matrix_scan_kb(void) {
+    // put your looping keyboard code here
+    // runs every cycle (a lot)
+
+    matrix_scan_user();
+}
+
+bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
+    // put your per-action keyboard code here
+    // runs for every action, just before processing by the firmware
+
+    return process_record_user(keycode, record);
+}
+
+void led_init_ports(void) {
+    DDRB |= (1<<6) | (1<<7); // OUT
+}
+
+void led_set_kb(uint8_t usb_led) {
+    if (usb_led & (1<<USB_LED_CAPS_LOCK))
+    {
+        PORTB |= (1<<6); // HI
+    }
+    else
+    {
+        PORTB &= ~(1<<6); // LO
+    }
+
+    if (usb_led & (1<<USB_LED_SCROLL_LOCK))
+    {
+        PORTB |= (1<<7); // HI
+    }
+    else
+    {
+        PORTB &= ~(1<<7); // LO
+    }
+
+    led_set_user(usb_led);
+}
diff --git a/keyboards/evil80/evil80.h b/keyboards/evil80/evil80.h
new file mode 100644
index 000000000..a880de98f
--- /dev/null
+++ b/keyboards/evil80/evil80.h
@@ -0,0 +1,23 @@
+#ifndef EVIL80_H
+#define EVIL80_H
+
+#include "quantum.h"
+
+#define LAYOUT( \
+      K000,       K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012,       K013, K014, K015, \
+      K500, K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112,       K113, K114, K115, \
+      K501, K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212,       K213, K214, K215, \
+      K502, K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312,                         \
+      K503, K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412,             K414,       \
+      K504, K505, K506,                   K507,                   K509, K510, K511, K512,       K513, K514, K515  \
+) \
+{ \
+    { K000,  K001,  K002,  K003,  K004,  K005,  K006,  K007,  K008,  K009,  K010,  K011,  K012,  K013,  K014,  K015  }, \
+    { K100,  K101,  K102,  K103,  K104,  K105,  K106,  K107,  K108,  K109,  K110,  K111,  K112,  K113,  K114,  K115  }, \
+    { K200,  K201,  K202,  K203,  K204,  K205,  K206,  K207,  K208,  K209,  K210,  K211,  K212,  K213,  K214,  K215  }, \
+    { K300,  K301,  K302,  K303,  K304,  K305,  K306,  K307,  K308,  K309,  K310,  K311,  K312, KC_NO, KC_NO, KC_NO  }, \
+    { K400,  K401,  K402,  K403,  K404,  K405,  K406,  K407,  K408,  K409,  K410,  K411,  K412, KC_NO,  K414, KC_NO  }, \
+    { K500,  K501,  K502,  K503,  K504,  K505,  K506,  K507, KC_NO,  K509,  K510,  K511,  K512,  K513,  K514,  K515  }  \
+} 
+
+#endif
diff --git a/keyboards/evil80/info.json b/keyboards/evil80/info.json
new file mode 100644
index 000000000..8b3b4cd0d
--- /dev/null
+++ b/keyboards/evil80/info.json
@@ -0,0 +1,13 @@
+{
+    "keyboard_name": "Evil80",
+    "url": "",
+    "maintainer": "qmk",
+    "width": 18.25,
+    "height": 6.5,
+    "layouts": {
+        "LAYOUT": {
+            "key_count": 90,
+            "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Backspace", "x":13, "y":1.5, "w":2}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"x":12.75, "y":3.5}, {"label":"Enter", "x":13.75, "y":3.5, "w":1.25}, {"label":"Shift", "x":0, "y":4.5, "w":1.25}, {"x":1.25, "y":4.5}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, {"x":14, "y":4.5}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"Alt", "x":10, "y":5.5, "w":1.25}, {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}]
+        }
+    }
+}
\ No newline at end of file
diff --git a/keyboards/evil80/keymaps/default/keymap.c b/keyboards/evil80/keymaps/default/keymap.c
new file mode 100644
index 000000000..1706517a2
--- /dev/null
+++ b/keyboards/evil80/keymaps/default/keymap.c
@@ -0,0 +1,31 @@
+#include QMK_KEYBOARD_H
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+    /* 0: Winkey */
+    LAYOUT(
+        KC_ESC,          KC_F1,  KC_F2,  KC_F3,  KC_F4,  KC_F5,  KC_F6,  KC_F7,  KC_F8,  KC_F9, KC_F10, KC_F11, KC_F12,     KC_PSCR,KC_SLCK,KC_PAUS,\
+        KC_GRV,   KC_1,   KC_2,   KC_3,   KC_4,   KC_5,   KC_6,   KC_7,   KC_8,   KC_9,   KC_0,KC_MINS, KC_EQL,KC_BSPC,      KC_INS,KC_HOME,KC_PGUP,\
+        KC_TAB,   KC_Q,   KC_W,   KC_E,   KC_R,   KC_T,   KC_Y,   KC_U,   KC_I,   KC_O,   KC_P,KC_LBRC,KC_RBRC,KC_BSLS,      KC_DEL, KC_END,KC_PGDN,\
+       KC_CAPS,   KC_A,   KC_S,   KC_D,   KC_F,   KC_G,   KC_H,   KC_J,   KC_K,   KC_L,KC_SCLN,KC_QUOT,KC_NUHS, KC_ENT,                             \
+       KC_LSFT,KC_NUBS,   KC_Z,   KC_X,   KC_C,   KC_V,   KC_B,   KC_N,   KC_M,KC_COMM, KC_DOT,KC_SLSH,KC_RSFT,  MO(2),               KC_UP,        \
+       KC_LCTL,KC_LGUI,KC_LALT,                         KC_SPC,                        KC_RALT,KC_RGUI, KC_APP,KC_RCTL,     KC_LEFT,KC_DOWN,KC_RGHT \
+	   ),
+    /* 1: Winkeyless */
+    LAYOUT(
+        KC_ESC,          KC_F1,  KC_F2,  KC_F3,  KC_F4,  KC_F5,  KC_F6,  KC_F7,  KC_F8,  KC_F9, KC_F10, KC_F11, KC_F12,     KC_PSCR,KC_SLCK,KC_PAUS,\
+        KC_GRV,   KC_1,   KC_2,   KC_3,   KC_4,   KC_5,   KC_6,   KC_7,   KC_8,   KC_9,   KC_0,KC_MINS, KC_EQL,KC_BSPC,      KC_INS,KC_HOME,KC_PGUP,\
+        KC_TAB,   KC_Q,   KC_W,   KC_E,   KC_R,   KC_T,   KC_Y,   KC_U,   KC_I,   KC_O,   KC_P,KC_LBRC,KC_RBRC,KC_BSLS,      KC_DEL, KC_END,KC_PGDN,\
+       KC_CAPS,   KC_A,   KC_S,   KC_D,   KC_F,   KC_G,   KC_H,   KC_J,   KC_K,   KC_L,KC_SCLN,KC_QUOT,KC_NUHS, KC_ENT,                             \
+       KC_LSFT,KC_NUBS,   KC_Z,   KC_X,   KC_C,   KC_V,   KC_B,   KC_N,   KC_M,KC_COMM, KC_DOT,KC_SLSH,KC_RSFT,  MO(2),               KC_UP,        \
+       KC_LCTL,KC_LGUI,KC_LALT,                         KC_SPC,                          KC_NO,KC_RALT,KC_RGUI,KC_RCTL,     KC_LEFT,KC_DOWN,KC_RGHT \
+	   ),
+    /* 2: Fn */
+    LAYOUT(
+       KC_TRNS,          BL_ON, BL_OFF,BL_STEP,BL_BRTG,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,     KC_TRNS,KC_TRNS,KC_TRNS,\
+       KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,     KC_TRNS,KC_TRNS,KC_TRNS,\
+       KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,     KC_TRNS,KC_TRNS,KC_TRNS,\
+       KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,                             \
+       KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,             KC_TRNS,        \
+       KC_TRNS,KC_TRNS,KC_TRNS,                        KC_TRNS,                        KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,     KC_TRNS,KC_TRNS,KC_TRNS \
+	   ),
+};
diff --git a/keyboards/evil80/rules.mk b/keyboards/evil80/rules.mk
new file mode 100644
index 000000000..1067b4344
--- /dev/null
+++ b/keyboards/evil80/rules.mk
@@ -0,0 +1,68 @@
+# MCU name
+#MCU = at90usb1287
+MCU = atmega32u4
+
+# Processor frequency.
+#     This will define a symbol, F_CPU, in all source code files equal to the
+#     processor frequency in Hz. You can then use this symbol in your source code to
+#     calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+#     automatically to create a 32-bit value in your source code.
+#
+#     This will be an integer division of F_USB below, as it is sourced by
+#     F_USB after it has run through any CPU prescalers. Note that this value
+#     does not *change* the processor frequency - it should merely be updated to
+#     reflect the processor speed set externally so that the code can use accurate
+#     software delays.
+F_CPU = 16000000
+
+#
+# LUFA specific
+#
+# Target architecture (see library "Board Types" documentation).
+ARCH = AVR8
+
+# Input clock frequency.
+#     This will define a symbol, F_USB, in all source code files equal to the
+#     input clock frequency (before any prescaling is performed) in Hz. This value may
+#     differ from F_CPU if prescaling is used on the latter, and is required as the
+#     raw input clock is fed directly to the PLL sections of the AVR for high speed
+#     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
+#     at the end, this will be done automatically to create a 32-bit value in your
+#     source code.
+#
+#     If no clock division is performed on the input clock inside the AVR (via the
+#     CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
+F_USB = $(F_CPU)
+
+# Interrupt driven control endpoint task(+60)
+OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
+
+
+# Boot Section Size in *bytes*
+#   Teensy halfKay   512
+#   Teensy++ halfKay 1024
+#   Atmel DFU loader 4096
+#   LUFA bootloader  4096
+#   USBaspLoader     2048
+OPT_DEFS += -DBOOTLOADER_SIZE=4096
+
+# Build Options
+#   change to "no" to disable the options, or define them in the Makefile in 
+#   the appropriate keymap folder that will get included automatically
+#
+BOOTMAGIC_ENABLE = no       # Virtual DIP switch configuration(+1000)
+MOUSEKEY_ENABLE = no        # Mouse keys(+4700)
+EXTRAKEY_ENABLE = no       # Audio control and System control(+450)
+CONSOLE_ENABLE = no         # Console for debug(+400)
+COMMAND_ENABLE = no        # Commands for debug and configuration
+NKRO_ENABLE = yes            # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+BACKLIGHT_ENABLE = yes      # Enable keyboard backlight functionality
+MIDI_ENABLE = no            # MIDI controls
+AUDIO_ENABLE = no           # Audio output on port C6
+UNICODE_ENABLE = no         # Unicode
+BLUETOOTH_ENABLE = no       # Enable Bluetooth with the Adafruit EZ-Key HID
+RGBLIGHT_ENABLE = no        # Enable WS2812 RGB underlight.
+API_SYSEX_ENABLE = no
+
+# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
+SLEEP_LED_ENABLE = no    # Breathing sleep LED during USB suspend
-- 
cgit v1.2.3