From 4d46489a2ac4ff7099e9b7498e34c6201f0b14cb Mon Sep 17 00:00:00 2001 From: moyi4681 Date: Wed, 29 May 2019 02:20:39 +0800 Subject: [PATCH] [Keyboard] add geekboards 8key macro-pad tester (#5940) * add geekboards 8key macro-pad tester * Update readme.md * Update keyboards/geekboards/tester/rules.mk Co-Authored-By: fauxpark * Update keyboards/geekboards/tester/keymaps/default/keymap.c Co-Authored-By: fauxpark * Update keyboards/geekboards/tester/keymaps/default/keymap.c Co-Authored-By: fauxpark * Update keyboards/geekboards/tester/keymaps/default/keymap.c Co-Authored-By: fauxpark * Update keyboards/geekboards/tester/keymaps/default/keymap.c Co-Authored-By: fauxpark * Update keymap.c * Update keyboards/geekboards/tester/readme.md Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/geekboards/tester/readme.md Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/geekboards/tester/readme.md Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/geekboards/tester/readme.md Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/geekboards/tester/readme.md Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> * Update readme.md * Update tester.c * Update keyboards/geekboards/tester/config.h Co-Authored-By: Drashna Jaelre * Update keyboards/geekboards/tester/rules.mk Co-Authored-By: Drashna Jaelre * Update keyboards/geekboards/tester/keymaps/default/keymap.c Co-Authored-By: Drashna Jaelre * Update keyboards/geekboards/tester/keymaps/default/keymap.c Co-Authored-By: Drashna Jaelre --- keyboards/geekboards/tester/config.h | 39 +++++++++++ .../tester/keymaps/default/keymap.c | 23 +++++++ keyboards/geekboards/tester/readme.md | 12 ++++ keyboards/geekboards/tester/rules.mk | 68 +++++++++++++++++++ keyboards/geekboards/tester/tester.c | 56 +++++++++++++++ keyboards/geekboards/tester/tester.h | 10 +++ 6 files changed, 208 insertions(+) create mode 100644 keyboards/geekboards/tester/config.h create mode 100644 keyboards/geekboards/tester/keymaps/default/keymap.c create mode 100644 keyboards/geekboards/tester/readme.md create mode 100644 keyboards/geekboards/tester/rules.mk create mode 100644 keyboards/geekboards/tester/tester.c create mode 100644 keyboards/geekboards/tester/tester.h diff --git a/keyboards/geekboards/tester/config.h b/keyboards/geekboards/tester/config.h new file mode 100644 index 0000000000..ac67877ffc --- /dev/null +++ b/keyboards/geekboards/tester/config.h @@ -0,0 +1,39 @@ +#pragma once + +#include "config_common.h" + + +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x1319 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Geekboards +#define PRODUCT Geekboards Tester +#define DESCRIPTION Geekboards 8-keys macropad + + +#define MATRIX_ROWS 2 +#define MATRIX_COLS 4 + +#define MATRIX_ROW_PINS { B0, D4} +#define MATRIX_COL_PINS { F7, F6, D2, D3} +#define UNUSED_PINS + +#define DIODE_DIRECTION COL2ROW +#define LOCKING_SUPPORT_ENABL +#define LOCKING_RESYNC_ENABLE + +#define DEBOUNCE 3 +#define RGB_DISABLE_AFTER_TIMEOUT 0 +#define RGB_DISABLE_WHEN_USB_SUSPENDED true +#define RGB_MATRIX_KEYPRESSES +#define DISABLE_RGB_MATRIX_SPLASH +#define DISABLE_RGB_MATRIX_MULTISPLASH +#define DISABLE_RGB_MATRIX_SOLID_SPLASH +#define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH +#define DRIVER_ADDR_1 0b1110100 +#define DRIVER_ADDR_2 0b1110101 + +#define DRIVER_COUNT 2 +#define DRIVER_1_LED_TOTAL 8 +#define DRIVER_2_LED_TOTAL 0 +#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) diff --git a/keyboards/geekboards/tester/keymaps/default/keymap.c b/keyboards/geekboards/tester/keymaps/default/keymap.c new file mode 100644 index 0000000000..e68f15f63d --- /dev/null +++ b/keyboards/geekboards/tester/keymaps/default/keymap.c @@ -0,0 +1,23 @@ +#include QMK_KEYBOARD_H +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT( /* Base */ + RGB_MOD, KC_1, KC_2, KC_3, + KC_4, KC_5, KC_6, MO(1) + ), +[1] = LAYOUT( /* Base */ + KC_ESC, KC_F1, KC_F2, KC_F3, + KC_F4, KC_F5, KC_F6, KC_F7 + ), +}; + +void matrix_init_user(void) { + //user initialization +} + +void matrix_scan_user(void) { + //user matrix +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} diff --git a/keyboards/geekboards/tester/readme.md b/keyboards/geekboards/tester/readme.md new file mode 100644 index 0000000000..7da0693082 --- /dev/null +++ b/keyboards/geekboards/tester/readme.md @@ -0,0 +1,12 @@ +Geekboards 8-keys macropad +===== + +Keyboard Maintainer: [dztech](https://github.com/moyi4681) +Hardware Supported: Geekboards 8-keys macropad +Hardware Availability: geekboards.ru(https://geekboards.ru/) + +Make example for this keyboard (after setting up your build environment): + + make geekboards/tester: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/geekboards/tester/rules.mk b/keyboards/geekboards/tester/rules.mk new file mode 100644 index 0000000000..7e8d595fb7 --- /dev/null +++ b/keyboards/geekboards/tester/rules.mk @@ -0,0 +1,68 @@ +# MCU name +MCU = atmega32u4 + +# project specific files +#SRC = + +# 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 +BOOTLOADER = qmk-dfu + +# Do not put the microcontroller into power saving mode +# when we get USB suspend event. We want it to keep updating +# backlight effects. + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +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 on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +RGB_MATRIX_ENABLE = yes # Use RGB matrix diff --git a/keyboards/geekboards/tester/tester.c b/keyboards/geekboards/tester/tester.c new file mode 100644 index 0000000000..4fab1a7012 --- /dev/null +++ b/keyboards/geekboards/tester/tester.c @@ -0,0 +1,56 @@ +#include "tester.h" +const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + {0, C1_1, C3_2, C4_2}, //A1 + {0, C1_2, C2_2, C4_3}, //A2 + {0, C1_3, C2_3, C3_3}, //A3 + {0, C1_4, C2_4, C3_4}, //A4 + {0, C1_5, C2_5, C3_5}, //A5 + {0, C1_6, C2_6, C3_6}, //A6 + {0, C1_7, C2_7, C3_7}, //A7 + {0, C1_8, C2_8, C3_8}, //A8 +}; + +led_config_t g_led_config = { +{ + { 0, 1, 2, 3}, + { 4, 5, 6, 7} +}, +{ + { 0, 0 }, { 75, 0 }, { 151, 0 }, { 224, 0 }, { 0, 64 }, { 75, 64 }, { 151, 64 }, { 224, 64 } +}, +{ + 4, 4, 4, 4, 4, 4, 4, 4 +} +}; + + + +void matrix_init_kb(void) { + matrix_init_user(); +} + +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + return process_record_user(keycode, record); +} + +void suspend_power_down_kb(void) +{ + rgb_matrix_set_suspend_state(true); + suspend_power_down_user(); +} + +void suspend_wakeup_init_kb(void) +{ + rgb_matrix_set_suspend_state(false); + suspend_wakeup_init_user(); +} diff --git a/keyboards/geekboards/tester/tester.h b/keyboards/geekboards/tester/tester.h new file mode 100644 index 0000000000..28c555f0b6 --- /dev/null +++ b/keyboards/geekboards/tester/tester.h @@ -0,0 +1,10 @@ +#pragma once +#include "quantum.h" +#define LAYOUT( \ + k00, k01, k02, k03,\ + k10, k11, k12, k13\ +) \ +{ \ + { k00, k01, k02, k03 }, \ + { k10, k11, k12, k13 } \ +}