From c50e80e13be5e34505f38eab31374ed2cee31da4 Mon Sep 17 00:00:00 2001 From: Michael Zoech Date: Fri, 20 Jul 2018 09:01:35 -0700 Subject: Keyboard: adding Sentraq S65-Plus (#3406) * New keyboard 'Sentraq S65-Plus' * Change ANSI_KEYMAP to LAYOUT_ansi * Use QMK_KEYBOARD_H as include --- keyboards/s65_plus/config.h | 55 ++++++++++++++++++++++++ keyboards/s65_plus/keymaps/default/keymap.c | 53 +++++++++++++++++++++++ keyboards/s65_plus/readme.md | 14 ++++++ keyboards/s65_plus/rules.mk | 66 +++++++++++++++++++++++++++++ keyboards/s65_plus/s65_plus.c | 24 +++++++++++ keyboards/s65_plus/s65_plus.h | 23 ++++++++++ 6 files changed, 235 insertions(+) create mode 100644 keyboards/s65_plus/config.h create mode 100644 keyboards/s65_plus/keymaps/default/keymap.c create mode 100644 keyboards/s65_plus/readme.md create mode 100644 keyboards/s65_plus/rules.mk create mode 100644 keyboards/s65_plus/s65_plus.c create mode 100644 keyboards/s65_plus/s65_plus.h (limited to 'keyboards/s65_plus') diff --git a/keyboards/s65_plus/config.h b/keyboards/s65_plus/config.h new file mode 100644 index 0000000000..df60e60a8d --- /dev/null +++ b/keyboards/s65_plus/config.h @@ -0,0 +1,55 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define PRODUCT S65-PLUS +#define DESCRIPTION q.m.k. keyboard firmware for S65-PLUS +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Sentraq + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 18 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { C7, C6, B6, B5, B4 } +#define MATRIX_COL_PINS { F6, F5, F4, F1, F0, E6, B0, B1, D5, B2, B3, D0, D1, D2, D4, D6, D7, F7 } +#define UNUSED_PINS + +/* number of backlight levels */ +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN D3 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 20 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 20 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not 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)) \ +) + +/* prevent stuck modifiers */ +#define PREVENT_STUCK_MODIFIERS + +#endif diff --git a/keyboards/s65_plus/keymaps/default/keymap.c b/keyboards/s65_plus/keymaps/default/keymap.c new file mode 100644 index 0000000000..04f6926de1 --- /dev/null +++ b/keyboards/s65_plus/keymaps/default/keymap.c @@ -0,0 +1,53 @@ +#include QMK_KEYBOARD_H + +#define _BL 0 +#define _AL 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: Main layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ F1 │ F2 │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ DEL │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ F3 │ F4 │ TAB │▒▒▒▒▒│ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │PG_UP│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ F5 │ F6 │CAPSL│▒▒▒▒▒│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│PG_DN│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ F7 │ F8 │▒▒▒▒▒│LSHFT│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │ END │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ F9 │ F10 │LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │RCTL │LEFT │DOWN │RIGHT│ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 0: ANSI qwerty */ + [_BL] = LAYOUT_ansi( + KC_F1, KC_F2, 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_BSPC, KC_DEL, \ + KC_F3, KC_F4, 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_PGUP, \ + KC_F5, KC_F6, 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_ENT, KC_PGDN, \ + KC_F7, KC_F8, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, \ + KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_AL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT), + + + /* 1: LED layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ │ │RESET│ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│BLTOG│BLSTP│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │▒▒▒▒▒│ │UGTOG│UGMOD│UGHUI│UGHUD│UGSAI│UGSAD│UGVAI│UGVAD│ │ │▒▒▒▒▒│ │VOLU │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │PREV │VOLD │NEXT │ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + [_AL] = LAYOUT_ansi( + KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_TOGG, BL_STEP, \ + 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, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_VOLD, KC_MNXT) +}; + +const uint16_t PROGMEM fn_actions[] = { +}; diff --git a/keyboards/s65_plus/readme.md b/keyboards/s65_plus/readme.md new file mode 100644 index 0000000000..426a6612d8 --- /dev/null +++ b/keyboards/s65_plus/readme.md @@ -0,0 +1,14 @@ +S65-PLUS +===== + +DIY 65% keyboard from Sentraq. + +Keyboard Maintainer: QMK Community +Hardware Supported: S65-PLUS PCB +Hardware Availability: https://sentraq.com/collections/kits/products/s65-plus-diy-keyboard-kit + +Make example for this keyboard (after setting up your build environment): + + make s65_plus:default + +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/s65_plus/rules.mk b/keyboards/s65_plus/rules.mk new file mode 100644 index 0000000000..08dd2d93c8 --- /dev/null +++ b/keyboards/s65_plus/rules.mk @@ -0,0 +1,66 @@ + + +# MCU name +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 yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +NKRO_ENABLE = yes # USB 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 +RGBLIGHT_ENABLE = yes # Enable RGB light diff --git a/keyboards/s65_plus/s65_plus.c b/keyboards/s65_plus/s65_plus.c new file mode 100644 index 0000000000..3eaaa37174 --- /dev/null +++ b/keyboards/s65_plus/s65_plus.c @@ -0,0 +1,24 @@ +#include "s65_plus.h" +#include "led.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + matrix_init_user(); +}; + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + matrix_scan_user(); +}; + +void led_set_kb(uint8_t usb_led) { + if (usb_led & (1<