diff options
| author | adiron <adi@adiron.me> | 2018-03-09 21:27:31 +0200 |
|---|---|---|
| committer | Jack Humbert <jack.humb@gmail.com> | 2018-03-09 14:27:31 -0500 |
| commit | fdeb7f7665899cf52e66436a06774eae10646596 (patch) | |
| tree | b66fdf2254afe80237e9b151587fbeede40edff9 /keyboards | |
| parent | 141a52982e9d6d5bc290b831713b6d4f400fbf83 (diff) | |
| download | qmk_firmware-fdeb7f7665899cf52e66436a06774eae10646596.tar.gz qmk_firmware-fdeb7f7665899cf52e66436a06774eae10646596.zip | |
Added Contra keyboard support (#2501)
* Added Contra keyboard support
The configuration came from a source distribution of the firmware on the
Contra's official website.
I have also included a simple MIDI keymap. (And it works!)
* Changes to Contra config and README
* Readme has been changed as requested by jackhumbert
* Config has been changed to add the Cartel and Contra names to
the USB configuration.
Diffstat (limited to 'keyboards')
| -rwxr-xr-x | keyboards/contra/config.h | 58 | ||||
| -rwxr-xr-x | keyboards/contra/contra.c | 1 | ||||
| -rwxr-xr-x | keyboards/contra/contra.h | 18 | ||||
| -rw-r--r-- | keyboards/contra/keymaps/dana/config.h | 30 | ||||
| -rw-r--r-- | keyboards/contra/keymaps/dana/keymap.c | 37 | ||||
| -rw-r--r-- | keyboards/contra/keymaps/dana/readme.md | 6 | ||||
| -rw-r--r-- | keyboards/contra/keymaps/dana/rules.mk | 25 | ||||
| -rw-r--r-- | keyboards/contra/readme.md | 16 | ||||
| -rwxr-xr-x | keyboards/contra/rules.mk | 58 |
9 files changed, 249 insertions, 0 deletions
diff --git a/keyboards/contra/config.h b/keyboards/contra/config.h new file mode 100755 index 000000000..85077ed46 --- /dev/null +++ b/keyboards/contra/config.h | |||
| @@ -0,0 +1,58 @@ | |||
| 1 | #ifndef CONFIG_H | ||
| 2 | #define CONFIG_H | ||
| 3 | |||
| 4 | #include "config_common.h" | ||
| 5 | |||
| 6 | /* USB Device descriptor parameter */ | ||
| 7 | #define VENDOR_ID 0xFEED | ||
| 8 | #define PRODUCT_ID 0x6060 | ||
| 9 | #define DEVICE_VER 0x0001 | ||
| 10 | #define MANUFACTURER Cartel | ||
| 11 | #define PRODUCT Contra | ||
| 12 | #define DESCRIPTION Keyboard | ||
| 13 | |||
| 14 | /* key matrix size */ | ||
| 15 | #define MATRIX_ROWS 4 | ||
| 16 | #define MATRIX_COLS 12 | ||
| 17 | |||
| 18 | /* key matrix pins */ | ||
| 19 | #define MATRIX_ROW_PINS { F6, B3, B2, B6 } | ||
| 20 | #define MATRIX_COL_PINS { F4, F5, B5, B4, E6, D7, C6, D4, D0, D1, D2, D3 } | ||
| 21 | #define UNUSED_PINS | ||
| 22 | |||
| 23 | /* COL2ROW or ROW2COL */ | ||
| 24 | #define DIODE_DIRECTION COL2ROW | ||
| 25 | |||
| 26 | /* number of backlight levels */ | ||
| 27 | |||
| 28 | #ifdef BACKLIGHT_PIN | ||
| 29 | #define BACKLIGHT_LEVELS 0 | ||
| 30 | #endif | ||
| 31 | |||
| 32 | /* Set 0 if debouncing isn't needed */ | ||
| 33 | #define DEBOUNCING_DELAY 5 | ||
| 34 | |||
| 35 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ | ||
| 36 | #define LOCKING_SUPPORT_ENABLE | ||
| 37 | |||
| 38 | /* Locking resynchronize hack */ | ||
| 39 | #define LOCKING_RESYNC_ENABLE | ||
| 40 | |||
| 41 | /* key combination for command */ | ||
| 42 | #define IS_COMMAND() ( \ | ||
| 43 | keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ | ||
| 44 | ) | ||
| 45 | |||
| 46 | /* prevent stuck modifiers */ | ||
| 47 | #define PREVENT_STUCK_MODIFIERS | ||
| 48 | |||
| 49 | |||
| 50 | #ifdef RGB_DI_PIN | ||
| 51 | #define RGBLIGHT_ANIMATIONS | ||
| 52 | #define RGBLED_NUM 0 | ||
| 53 | #define RGBLIGHT_HUE_STEP 8 | ||
| 54 | #define RGBLIGHT_SAT_STEP 8 | ||
| 55 | #define RGBLIGHT_VAL_STEP 8 | ||
| 56 | #endif | ||
| 57 | |||
| 58 | #endif | ||
diff --git a/keyboards/contra/contra.c b/keyboards/contra/contra.c new file mode 100755 index 000000000..3ef66a9c0 --- /dev/null +++ b/keyboards/contra/contra.c | |||
| @@ -0,0 +1 @@ | |||
| #include "contra.h" | |||
diff --git a/keyboards/contra/contra.h b/keyboards/contra/contra.h new file mode 100755 index 000000000..e9f9c5418 --- /dev/null +++ b/keyboards/contra/contra.h | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | #ifndef KB_H | ||
| 2 | #define KB_H | ||
| 3 | |||
| 4 | #include "quantum.h" | ||
| 5 | |||
| 6 | #define KEYMAP( \ | ||
| 7 | K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \ | ||
| 8 | K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, \ | ||
| 9 | K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, \ | ||
| 10 | K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311 \ | ||
| 11 | ) { \ | ||
| 12 | { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011 }, \ | ||
| 13 | { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111 }, \ | ||
| 14 | { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211 }, \ | ||
| 15 | { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311 } \ | ||
| 16 | } | ||
| 17 | |||
| 18 | #endif \ No newline at end of file | ||
diff --git a/keyboards/contra/keymaps/dana/config.h b/keyboards/contra/keymaps/dana/config.h new file mode 100644 index 000000000..2846b5791 --- /dev/null +++ b/keyboards/contra/keymaps/dana/config.h | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2012 Jun Wako <wakojun@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_USER_H | ||
| 19 | #define CONFIG_USER_H | ||
| 20 | |||
| 21 | #include "../../config.h" | ||
| 22 | |||
| 23 | |||
| 24 | #undef TAPPING_TERM | ||
| 25 | #define TAPPING_TERM 190 | ||
| 26 | |||
| 27 | #define MUSIC_MASK (keycode != KC_NO) | ||
| 28 | #define MIDI_ADVANCED | ||
| 29 | |||
| 30 | #endif | ||
diff --git a/keyboards/contra/keymaps/dana/keymap.c b/keyboards/contra/keymaps/dana/keymap.c new file mode 100644 index 000000000..529491923 --- /dev/null +++ b/keyboards/contra/keymaps/dana/keymap.c | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | // This is the canonical layout file for the Quantum project. If you want to add another keyboard, | ||
| 2 | // this is the style you want to emulate. | ||
| 3 | |||
| 4 | #include "contra.h" | ||
| 5 | #include "action_layer.h" | ||
| 6 | #include "eeconfig.h" | ||
| 7 | |||
| 8 | extern keymap_config_t keymap_config; | ||
| 9 | |||
| 10 | // Fillers to make layering more clear | ||
| 11 | #define _______ KC_TRNS | ||
| 12 | #define XXXXXXX KC_NO | ||
| 13 | |||
| 14 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 15 | |||
| 16 | /* Qwerty | ||
| 17 | * ,-----------------------------------------------------------------------------------. | ||
| 18 | * | ` | Q | W | E | R | T | Y | U | I | O | P | Bksp | | ||
| 19 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 20 | * | Tab | A | S | D | F | G | H | J | K | L | ; | " | | ||
| 21 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 22 | * | Shift| Z | X | C | V | B | N | M | , | . | / |Shift | | ||
| 23 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 24 | * | Brite| Ctrl | Alt | Cmd |Lower | Space |Raise | Enter| Cmd | Alt |Ctrl | | ||
| 25 | * `-----------------------------------------------------------------------------------' | ||
| 26 | */ | ||
| 27 | [0] = { | ||
| 28 | { MI_C_4, MI_Cs_4, MI_D_4, MI_Ds_4, MI_E_4, MI_F_4, MI_Fs_4, MI_G_4, MI_Gs_4, MI_A_4, MI_As_4, MI_B_4 }, | ||
| 29 | { MI_C_3, MI_Cs_3, MI_D_3, MI_Ds_3, MI_E_3, MI_F_3, MI_Fs_3, MI_G_3, MI_Gs_3, MI_A_3, MI_As_3, MI_B_3 }, | ||
| 30 | { MI_C_2, MI_Cs_2, MI_D_2, MI_Ds_2, MI_E_2, MI_F_2, MI_Fs_2, MI_G_2, MI_Gs_2, MI_A_2, MI_As_2, MI_B_2 }, | ||
| 31 | { MI_C_1, MI_Cs_1, MI_D_1, MI_Ds_1, MI_E_1, MI_F_1, MI_Fs_1, MI_G_1, MI_Gs_1, MI_A_1, MI_As_1, MI_B_1 } | ||
| 32 | } | ||
| 33 | }; | ||
| 34 | |||
| 35 | |||
| 36 | |||
| 37 | |||
diff --git a/keyboards/contra/keymaps/dana/readme.md b/keyboards/contra/keymaps/dana/readme.md new file mode 100644 index 000000000..75b4582d4 --- /dev/null +++ b/keyboards/contra/keymaps/dana/readme.md | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | # Dana musical MIDI keyboard layout | ||
| 2 | |||
| 3 | Has the contra mapped as a MIDI keyboard, where each row is an octave. | ||
| 4 | |||
| 5 | The keyboard has only MIDI, nothing else! | ||
| 6 | |||
diff --git a/keyboards/contra/keymaps/dana/rules.mk b/keyboards/contra/keymaps/dana/rules.mk new file mode 100644 index 000000000..1198f378a --- /dev/null +++ b/keyboards/contra/keymaps/dana/rules.mk | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | |||
| 2 | |||
| 3 | # Build Options | ||
| 4 | # change to "no" to disable the options, or define them in the Makefile in | ||
| 5 | # the appropriate keymap folder that will get included automatically | ||
| 6 | # | ||
| 7 | BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) | ||
| 8 | MOUSEKEY_ENABLE = no # Mouse keys(+4700) | ||
| 9 | EXTRAKEY_ENABLE = no # Audio control and System control(+450) | ||
| 10 | CONSOLE_ENABLE = no # Console for debug(+400) | ||
| 11 | COMMAND_ENABLE = no # Commands for debug and configuration | ||
| 12 | NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | ||
| 13 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | ||
| 14 | MIDI_ENABLE = yes # MIDI controls | ||
| 15 | AUDIO_ENABLE = no # Audio output on port C6 | ||
| 16 | UNICODE_ENABLE = no # Unicode | ||
| 17 | BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID | ||
| 18 | RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight | ||
| 19 | |||
| 20 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | ||
| 21 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | ||
| 22 | |||
| 23 | ifndef QUANTUM_DIR | ||
| 24 | include ../../../../Makefile | ||
| 25 | endif | ||
diff --git a/keyboards/contra/readme.md b/keyboards/contra/readme.md new file mode 100644 index 000000000..a83228507 --- /dev/null +++ b/keyboards/contra/readme.md | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | CONTRA | ||
| 2 | === | ||
| 3 | |||
| 4 |  | ||
| 5 | |||
| 6 | A 40% keyboard by | ||
| 7 | |||
| 8 | Keyboard Maintainer: The QMK Community | ||
| 9 | Hardware Supported: CONTRA | ||
| 10 | Hardware Availability: [CARTEL](https://cartel.ltd/projects/contra/) | ||
| 11 | |||
| 12 | Make example for this keyboard (after setting up your build environment): | ||
| 13 | |||
| 14 | make contra:dana | ||
| 15 | |||
| 16 | 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. | ||
diff --git a/keyboards/contra/rules.mk b/keyboards/contra/rules.mk new file mode 100755 index 000000000..ca2945e63 --- /dev/null +++ b/keyboards/contra/rules.mk | |||
| @@ -0,0 +1,58 @@ | |||
| 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 | # LUFA specific | ||
| 19 | # | ||
| 20 | # Target architecture (see library "Board Types" documentation). | ||
| 21 | ARCH = AVR8 | ||
| 22 | |||
| 23 | # Input clock frequency. | ||
| 24 | # This will define a symbol, F_USB, in all source code files equal to the | ||
| 25 | # input clock frequency (before any prescaling is performed) in Hz. This value may | ||
| 26 | # differ from F_CPU if prescaling is used on the latter, and is required as the | ||
| 27 | # raw input clock is fed directly to the PLL sections of the AVR for high speed | ||
| 28 | # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' | ||
| 29 | # at the end, this will be done automatically to create a 32-bit value in your | ||
| 30 | # source code. | ||
| 31 | # | ||
| 32 | # If no clock division is performed on the input clock inside the AVR (via the | ||
| 33 | # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. | ||
| 34 | F_USB = $(F_CPU) | ||
| 35 | |||
| 36 | # Interrupt driven control endpoint task(+60) | ||
| 37 | OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT | ||
| 38 | |||
| 39 | |||
| 40 | # Boot Section Size in *bytes* | ||
| 41 | OPT_DEFS += -DBOOTLOADER_SIZE=4096 | ||
| 42 | |||
| 43 | |||
| 44 | # Build Options | ||
| 45 | # change yes to no to disable | ||
| 46 | # | ||
| 47 | BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) | ||
| 48 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) | ||
| 49 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) | ||
| 50 | CONSOLE_ENABLE = no # Console for debug(+400) | ||
| 51 | COMMAND_ENABLE = no # Commands for debug and configuration | ||
| 52 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | ||
| 53 | NKRO_ENABLE = yes # USB Nkey Rollover | ||
| 54 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default | ||
| 55 | MIDI_ENABLE = no # MIDI controls | ||
| 56 | UNICODE_ENABLE = no # Unicode | ||
| 57 | BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID | ||
| 58 | AUDIO_ENABLE = no # Audio output on port C6 | ||
