diff options
| author | Maarten Dekkers <maartenwut@gmail.com> | 2019-01-19 23:29:15 +0100 |
|---|---|---|
| committer | MechMerlin <30334081+mechmerlin@users.noreply.github.com> | 2019-01-19 14:29:15 -0800 |
| commit | 09ee7da6deb50a3ff5f808cc47daebe94f5a3f3a (patch) | |
| tree | 610462e4dabcd543bec661a028b5fd9de77fce11 | |
| parent | 9d2b10d07725580d89e9352c444756c1c2339459 (diff) | |
| download | qmk_firmware-09ee7da6deb50a3ff5f808cc47daebe94f5a3f3a.tar.gz qmk_firmware-09ee7da6deb50a3ff5f808cc47daebe94f5a3f3a.zip | |
Add Plain60 support (#4887)
* Add Plain60 support
* Delete info.json
* Remove definition of KC_TRNS in keymap
* Add spaces for proper markdown to readme.md
| -rw-r--r-- | keyboards/plain60/config.h | 75 | ||||
| -rw-r--r-- | keyboards/plain60/keymaps/default/keymap.c | 17 | ||||
| -rw-r--r-- | keyboards/plain60/plain60.c | 1 | ||||
| -rw-r--r-- | keyboards/plain60/plain60.h | 29 | ||||
| -rw-r--r-- | keyboards/plain60/readme.md | 12 | ||||
| -rw-r--r-- | keyboards/plain60/rules.mk | 66 |
6 files changed, 200 insertions, 0 deletions
diff --git a/keyboards/plain60/config.h b/keyboards/plain60/config.h new file mode 100644 index 000000000..9e838616b --- /dev/null +++ b/keyboards/plain60/config.h | |||
| @@ -0,0 +1,75 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2019 Maarten Dekkers <maartenwut@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 | #pragma once | ||
| 19 | |||
| 20 | #include QMK_KEYBOARD_CONFIG_H | ||
| 21 | |||
| 22 | /* USB Device descriptor parameter */ | ||
| 23 | #define VENDOR_ID 0x4705 | ||
| 24 | #define PRODUCT_ID 0x0160 | ||
| 25 | #define DEVICE_VER 0x0001 | ||
| 26 | #define MANUFACTURER Maartenwut | ||
| 27 | #define PRODUCT Plain60 | ||
| 28 | #define DESCRIPTION A plain 60% PCB | ||
| 29 | |||
| 30 | /* key matrix size */ | ||
| 31 | #define MATRIX_ROWS 5 | ||
| 32 | #define MATRIX_COLS 15 | ||
| 33 | |||
| 34 | // ROWS: Top to bottom, COLS: Left to right | ||
| 35 | |||
| 36 | #define MATRIX_ROW_PINS {B4,D7,D6,D4,E6} | ||
| 37 | #define MATRIX_COL_PINS {D2,D1,D0,D3,D5,B5,F0,B6,C6,C7,F1,F4,F5,F6,F7} | ||
| 38 | |||
| 39 | /* COL2ROW or ROW2COL */ | ||
| 40 | #define DIODE_DIRECTION COL2ROW | ||
| 41 | |||
| 42 | /* define if matrix has ghost */ | ||
| 43 | //#define MATRIX_HAS_GHOST | ||
| 44 | |||
| 45 | /* Set 0 if debouncing isn't needed */ | ||
| 46 | #define DEBOUNCING_DELAY 5 | ||
| 47 | |||
| 48 | /* key combination for command */ | ||
| 49 | #define IS_COMMAND() ( \ | ||
| 50 | keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ | ||
| 51 | ) | ||
| 52 | |||
| 53 | #define QMK_ESC_OUTPUT D2 // usually COL | ||
| 54 | #define QMK_ESC_INPUT B4 // usually ROW | ||
| 55 | |||
| 56 | //VIA | ||
| 57 | #define DYNAMIC_KEYMAP_LAYER_COUNT 4 | ||
| 58 | |||
| 59 | // EEPROM usage | ||
| 60 | |||
| 61 | // TODO: refactor with new user EEPROM code (coming soon) | ||
| 62 | #define EEPROM_MAGIC 0x451F | ||
| 63 | #define EEPROM_MAGIC_ADDR 32 | ||
| 64 | // Bump this every time we change what we store | ||
| 65 | // This will automatically reset the EEPROM with defaults | ||
| 66 | // and avoid loading invalid data from the EEPROM | ||
| 67 | #define EEPROM_VERSION 0x08 | ||
| 68 | #define EEPROM_VERSION_ADDR 34 | ||
| 69 | |||
| 70 | // Dynamic keymap starts after EEPROM version | ||
| 71 | #define DYNAMIC_KEYMAP_EEPROM_ADDR 35 | ||
| 72 | // Dynamic macro starts after dynamic keymaps (35+(4*10*6*2)) = (35+480) | ||
| 73 | #define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 635 | ||
| 74 | #define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 389 // 1024-DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR | ||
| 75 | #define DYNAMIC_KEYMAP_MACRO_COUNT 16 \ No newline at end of file | ||
diff --git a/keyboards/plain60/keymaps/default/keymap.c b/keyboards/plain60/keymaps/default/keymap.c new file mode 100644 index 000000000..7e8cfff35 --- /dev/null +++ b/keyboards/plain60/keymaps/default/keymap.c | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | #include QMK_KEYBOARD_H | ||
| 2 | |||
| 3 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | ||
| 4 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
| 5 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
| 6 | // entirely and just use numbers. | ||
| 7 | #define _MA 0 | ||
| 8 | |||
| 9 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 10 | |||
| 11 | [_MA] = LAYOUT( | ||
| 12 | 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_BSPC, \ | ||
| 13 | 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, \ | ||
| 14 | 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_BSLS, KC_ENT, \ | ||
| 15 | KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ | ||
| 16 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTRL) | ||
| 17 | }; | ||
diff --git a/keyboards/plain60/plain60.c b/keyboards/plain60/plain60.c new file mode 100644 index 000000000..d81606410 --- /dev/null +++ b/keyboards/plain60/plain60.c | |||
| @@ -0,0 +1 @@ | |||
| #include "plain60.h" | |||
diff --git a/keyboards/plain60/plain60.h b/keyboards/plain60/plain60.h new file mode 100644 index 000000000..01a6216a7 --- /dev/null +++ b/keyboards/plain60/plain60.h | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | #ifndef PLAIN60_H | ||
| 4 | #define PLAIN60_H | ||
| 5 | |||
| 6 | #include "quantum.h" | ||
| 7 | |||
| 8 | // readability | ||
| 9 | #define XXX KC_NO | ||
| 10 | |||
| 11 | #define LAYOUT( \ | ||
| 12 | k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ | ||
| 13 | k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ | ||
| 14 | k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ | ||
| 15 | k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, \ | ||
| 16 | k40, k41, k42, k46, k4a, k4b, k4c, k4d \ | ||
| 17 | ) \ | ||
| 18 | { \ | ||
| 19 | {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e}, \ | ||
| 20 | {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, XXX}, \ | ||
| 21 | {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, XXX}, \ | ||
| 22 | {k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, XXX}, \ | ||
| 23 | {k40, k41, k42, XXX, XXX, XXX, k46, XXX, XXX, XXX, k4a, k4b, k4c, k4d, XXX} \ | ||
| 24 | } | ||
| 25 | |||
| 26 | void matrix_init_user(void); | ||
| 27 | void matrix_scan_user(void); | ||
| 28 | |||
| 29 | #endif | ||
diff --git a/keyboards/plain60/readme.md b/keyboards/plain60/readme.md new file mode 100644 index 000000000..58be67ac0 --- /dev/null +++ b/keyboards/plain60/readme.md | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | Plain60-C and Plain60-B | ||
| 2 | ====== | ||
| 3 | |||
| 4 | A plain 60% PCB with USB-C. | ||
| 5 | |||
| 6 | Keyboard Maintainer: Maartenwut | ||
| 7 | Hardware Supported: Plain60-C and Plain60-B | ||
| 8 | Hardware Availability: https://github.com/Maartenwut/plain60-c | ||
| 9 | |||
| 10 | Make example for this keyboard (after setting up your build environment): | ||
| 11 | |||
| 12 | make plain60:default \ No newline at end of file | ||
diff --git a/keyboards/plain60/rules.mk b/keyboards/plain60/rules.mk new file mode 100644 index 000000000..a1a0e9ca1 --- /dev/null +++ b/keyboards/plain60/rules.mk | |||
| @@ -0,0 +1,66 @@ | |||
| 1 | SRC += keyboards/wilba_tech/wt_main.c | ||
| 2 | # MCU name | ||
| 3 | MCU = atmega32u4 | ||
| 4 | |||
| 5 | # Processor frequency. | ||
| 6 | # This will define a symbol, F_CPU, in all source code files equal to the | ||
| 7 | # processor frequency in Hz. You can then use this symbol in your source code to | ||
| 8 | # calculate timings. Do NOT tack on a 'UL' at the end, this will be done | ||
| 9 | # automatically to create a 32-bit value in your source code. | ||
| 10 | # | ||
| 11 | # This will be an integer division of F_USB below, as it is sourced by | ||
| 12 | # F_USB after it has run through any CPU prescalers. Note that this value | ||
| 13 | # does not *change* the processor frequency - it should merely be updated to | ||
| 14 | # reflect the processor speed set externally so that the code can use accurate | ||
| 15 | # software delays. | ||
| 16 | F_CPU = 16000000 | ||
| 17 | |||
| 18 | |||
| 19 | # | ||
| 20 | # LUFA specific | ||
| 21 | # | ||
| 22 | # Target architecture (see library "Board Types" documentation). | ||
| 23 | ARCH = AVR8 | ||
| 24 | |||
| 25 | # Input clock frequency. | ||
| 26 | # This will define a symbol, F_USB, in all source code files equal to the | ||
| 27 | # input clock frequency (before any prescaling is performed) in Hz. This value may | ||
| 28 | # differ from F_CPU if prescaling is used on the latter, and is required as the | ||
| 29 | # raw input clock is fed directly to the PLL sections of the AVR for high speed | ||
| 30 | # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' | ||
| 31 | # at the end, this will be done automatically to create a 32-bit value in your | ||
| 32 | # source code. | ||
| 33 | # | ||
| 34 | # If no clock division is performed on the input clock inside the AVR (via the | ||
| 35 | # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. | ||
| 36 | F_USB = $(F_CPU) | ||
| 37 | |||
| 38 | # Interrupt driven control endpoint task(+60) | ||
| 39 | OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT | ||
| 40 | |||
| 41 | |||
| 42 | # Boot Section Size in *bytes* | ||
| 43 | # Teensy halfKay 512 | ||
| 44 | # Teensy++ halfKay 1024 | ||
| 45 | # Atmel DFU loader 4096 | ||
| 46 | # LUFA bootloader 4096 | ||
| 47 | # USBaspLoader 2048 | ||
| 48 | OPT_DEFS += -DBOOTLOADER_SIZE=4096 | ||
| 49 | |||
| 50 | # Build Options | ||
| 51 | # comment out to disable the options. | ||
| 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 = no # Commands for debug and configuration | ||
| 58 | NKRO_ENABLE = no # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | ||
| 59 | RGBLIGHT_ENABLE = no # Enable keyboard underlight functionality (+4870) | ||
| 60 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality (+1150) | ||
| 61 | MIDI_ENABLE = no # MIDI controls | ||
| 62 | AUDIO_ENABLE = no | ||
| 63 | UNICODE_ENABLE = no # Unicode | ||
| 64 | BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID | ||
| 65 | RAW_ENABLE = yes | ||
| 66 | DYNAMIC_KEYMAP_ENABLE = yes | ||
