From 66ef1e3d6770e388d631d25e4cd1c6b1640cea24 Mon Sep 17 00:00:00 2001 From: Wilba6582 Date: Mon, 1 Oct 2018 01:35:10 +1000 Subject: RAMA M6-B and IS31FL3218 driver (#4021) * Initial RAMA M6-B commit. * Moved IS31FL3218 driver, minor cleanups * Refactor, added dynamic keymap. * Added dynamic keymaps to RAMA M6-A * Refactor M6-A and M6-B to use common code. * Formatting * Cleanup * Cleanup * Changes from review --- keyboards/rama/m6_b/config.h | 129 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 keyboards/rama/m6_b/config.h (limited to 'keyboards/rama/m6_b/config.h') diff --git a/keyboards/rama/m6_b/config.h b/keyboards/rama/m6_b/config.h new file mode 100644 index 0000000000..1adaad3f9e --- /dev/null +++ b/keyboards/rama/m6_b/config.h @@ -0,0 +1,129 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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 "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x5241 // "RW" +#define PRODUCT_ID 0x006B // 6-B +#define DEVICE_VER 0x0001 +#define MANUFACTURER RAMA.WORKS +#define PRODUCT RAMA M6-B +#define DESCRIPTION RAMA M6-B Macropad + +/* key matrix size */ +#define MATRIX_ROWS 1 +#define MATRIX_COLS 6 + +/* + * 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_ROW_PINS { E6 } +#define MATRIX_COL_PINS { D4, B5, F4, D7, C6, F6 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +#define RGB_BACKLIGHT_ENABLED 1 + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x07 +#define EEPROM_VERSION_ADDR 34 + +// Backlight config starts after EEPROM version +#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 +// Dynamic keymap starts after backlight config (35+37) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 72 -- cgit v1.2.3 From 2dea540afbfcffaea82f70b6642c39aedb9e3b5b Mon Sep 17 00:00:00 2001 From: Wilba Date: Wed, 14 Nov 2018 03:31:25 +1100 Subject: Refactoring M6-A, M6-B, Zeal60, Zeal65, WT60-A, WT65-A, WT80-A (#4417) * Refactored M6-B to use Zeal60 RGB backlight code * Fixed M6-B LED co-ordinates * Minor changes to RGB config for Zeal65 * Added dynamic keymaps to WT80-A, WT60-A, WT-80A, U80-A --- keyboards/rama/m6_b/config.h | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'keyboards/rama/m6_b/config.h') diff --git a/keyboards/rama/m6_b/config.h b/keyboards/rama/m6_b/config.h index 1adaad3f9e..c016703e04 100644 --- a/keyboards/rama/m6_b/config.h +++ b/keyboards/rama/m6_b/config.h @@ -109,8 +109,38 @@ #define RGB_BACKLIGHT_ENABLED 1 -#define DYNAMIC_KEYMAP_LAYER_COUNT 4 +// This conditionally compiles the backlight code for M6-B specifics +#define RGB_BACKLIGHT_M6_B + +// enable/disable LEDs based on layout +#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0 +#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0 +#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 0 +#define RGB_BACKLIGHT_USE_7U_SPACEBAR 0 +#define RGB_BACKLIGHT_USE_ISO_ENTER 0 +#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0 + +// disable backlight when USB suspended (PC sleep/hibernate/shutdown) +#define RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0 + +// disable backlight after timeout in minutes, 0 = no timeout +#define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0 + +// the default effect (RGB test) +#define RGB_BACKLIGHT_EFFECT 255 + +// These define which keys in the matrix are alphas/mods +// Used for backlight effects so colors are different for +// alphas vs. mods +// Each value is for a row, bit 0 is column 0 +// Alpha=0 Mod=1 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0 +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 // EEPROM usage @@ -127,3 +157,4 @@ #define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 // Dynamic keymap starts after backlight config (35+37) #define DYNAMIC_KEYMAP_EEPROM_ADDR 72 + -- cgit v1.2.3 From d7f1e072a859d7fcbaccd675b4bad7d02d214e52 Mon Sep 17 00:00:00 2001 From: Wilba Date: Sat, 1 Dec 2018 03:43:34 +1100 Subject: Added macros to Dynamic Keymaps, Zeal60 RGB backlight improvements (#4520) * Refactored M6-B to use Zeal60 RGB backlight code * Fixed M6-B LED co-ordinates * Minor changes to RGB config for Zeal65 * Added dynamic keymaps to WT80-A, WT60-A, WT-80A, U80-A * Macro implementation * Implemented macros, API protocol version 8, RGB backlight fixes * Improved radial effects for M6-B * Fixed undefined references when building an RGB keyboard after M6-A --- keyboards/rama/m6_b/config.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'keyboards/rama/m6_b/config.h') diff --git a/keyboards/rama/m6_b/config.h b/keyboards/rama/m6_b/config.h index c016703e04..67034ef8ce 100644 --- a/keyboards/rama/m6_b/config.h +++ b/keyboards/rama/m6_b/config.h @@ -150,11 +150,14 @@ // Bump this every time we change what we store // This will automatically reset the EEPROM with defaults // and avoid loading invalid data from the EEPROM -#define EEPROM_VERSION 0x07 +#define EEPROM_VERSION 0x08 #define EEPROM_VERSION_ADDR 34 // Backlight config starts after EEPROM version #define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 -// Dynamic keymap starts after backlight config (35+37) -#define DYNAMIC_KEYMAP_EEPROM_ADDR 72 - +// Dynamic keymap starts after backlight config (35+43) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 78 +// Dynamic macro starts after dynamic keymaps (78+(4*6*2)) = (78+48) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 126 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 898 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 -- cgit v1.2.3