From e258b10d71049645c2e6ce50f652ce3f11578603 Mon Sep 17 00:00:00 2001 From: Angelo Gazzola Date: Wed, 30 Oct 2019 05:34:19 +0100 Subject: [PATCH] [Keyboard] Add 42 keyboard (#7071) * [Keyboard] Add 42 keyboard * Apply suggested fixes * Remove 42.c * Move keyboard to handwired folder --- keyboards/handwired/42/42.h | 32 +++++++++++++ keyboards/handwired/42/README.md | 15 ++++++ keyboards/handwired/42/config.h | 42 +++++++++++++++++ .../handwired/42/keymaps/default/keymap.c | 47 +++++++++++++++++++ keyboards/handwired/42/rules.mk | 39 +++++++++++++++ 5 files changed, 175 insertions(+) create mode 100644 keyboards/handwired/42/42.h create mode 100644 keyboards/handwired/42/README.md create mode 100644 keyboards/handwired/42/config.h create mode 100644 keyboards/handwired/42/keymaps/default/keymap.c create mode 100644 keyboards/handwired/42/rules.mk diff --git a/keyboards/handwired/42/42.h b/keyboards/handwired/42/42.h new file mode 100644 index 000000000..5be29bf25 --- /dev/null +++ b/keyboards/handwired/42/42.h @@ -0,0 +1,32 @@ +/* Copyright 2019 Angelo Gazzola (nglgzz) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "quantum.h" + +#define ___ KC_NO +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ + K33, K34, K35, K36, K37, K38 \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B }, \ + { ___, ___, ___, K33, K34, K35, K36, K37, K38, ___, ___, ___ } \ +} diff --git a/keyboards/handwired/42/README.md b/keyboards/handwired/42/README.md new file mode 100644 index 000000000..20fb67aa7 --- /dev/null +++ b/keyboards/handwired/42/README.md @@ -0,0 +1,15 @@ +# 42 + +42-keys ergonomic keyboard running on Adafruit Feather BLE. + +![42](https://github.com/nglgzz/42/raw/master/42.jpg) + +Keyboard Maintainer: [Angelo Gazzola (nglgzz)](https://github.com/nglgzz) +Hardware Supported: 42 (rev2, rev3), Feather 32u4 BLE +Hardware Availability: [GitHub](https://github.com/nglgzz/42/) + +Make example for this keyboard (after setting up your build environment): + + make handwired/42:default + +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). diff --git a/keyboards/handwired/42/config.h b/keyboards/handwired/42/config.h new file mode 100644 index 000000000..3f5060989 --- /dev/null +++ b/keyboards/handwired/42/config.h @@ -0,0 +1,42 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0003 +#define MANUFACTURER nglgzz +#define PRODUCT 42 +#define DESCRIPTION BT + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_COL_PINS { F5, F6, F7, F0, F1, F4, B6, B5, D7, C7, D6, B7 } +#define MATRIX_ROW_PINS { D2, D3, D0, D1 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 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 + +#define TAPPING_TERM 100 diff --git a/keyboards/handwired/42/keymaps/default/keymap.c b/keyboards/handwired/42/keymaps/default/keymap.c new file mode 100644 index 000000000..099e1fa01 --- /dev/null +++ b/keyboards/handwired/42/keymaps/default/keymap.c @@ -0,0 +1,47 @@ +#include QMK_KEYBOARD_H + +// MOD_KC +#define CTL_ESC MT(MOD_LCTL, KC_ESCAPE) +#define CTL_ENT MT(MOD_LCTL, KC_ENTER) +#define ALT_Z MT(MOD_LALT, KC_Z) +#define ALT_SLS MT(MOD_LALT, KC_SLASH) +#define SU_QUOT MT(MOD_LGUI, KC_QUOTE) +#define SU_BSLS MT(MOD_LGUI, KC_BSLS) +#define SFT_DEL MT(MOD_LSFT, KC_DELETE) + +// LAYER_KC +#define L3_SPC LT(3, KC_SPC) +#define L2_SPC LT(2, KC_SPC) +#define L1_LBRC LT(1, KC_LBRC) +#define L1_RBRC LT(1, KC_RBRC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + // Default Layer + LAYOUT( + KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_BSPC, + CTL_ESC, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, CTL_ENT, + KC_LSFT, ALT_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , ALT_SLS, SFT_DEL, + L1_LBRC, L3_SPC , SU_QUOT, SU_BSLS, L2_SPC , L1_RBRC + ), + // Symbols Layer + LAYOUT( + KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_EQL , + KC_INS , S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_MINS, + 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_CAPS, OUT_USB, OUT_BT , _______, _______, _______ + ), + // Navigation Layer + LAYOUT( + _______, _______, _______, KC_PGUP, _______, _______, KC_BRIU, _______, KC_UP , _______, _______, _______, + _______, _______, KC_HOME, KC_PGDN, KC_END , _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, + _______, _______, _______, _______, _______, _______, KC_BRID, KC_VOLD, KC_MUTE, KC_VOLU, _______, _______, + _______, _______, _______, _______, _______, _______ + ), + // Mouse Layer + LAYOUT( + _______, _______, KC_WREF, KC_WH_U, KC_WSCH, _______, _______, KC_BTN1, KC_MS_U, KC_BTN2, _______, _______, + _______, _______, KC_WH_L, KC_WH_D, KC_WH_R, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, + _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/handwired/42/rules.mk b/keyboards/handwired/42/rules.mk new file mode 100644 index 000000000..b44a0a518 --- /dev/null +++ b/keyboards/handwired/42/rules.mk @@ -0,0 +1,39 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +F_CPU = 8000000 + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# ATmega32A bootloadHID +# ATmega328p USBasp +BOOTLOADER = caterina + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs + +UNICODE_ENABLE = no # Unicode +UNICODEMAP_ENABLE = no # ^^ +UCIS_ENABLE = no # ^^ +BLUETOOTH = AdafruitBLE