From 48a992f1c037658bbacccefd2709ffdcda8bb345 Mon Sep 17 00:00:00 2001 From: Wilba6582 Date: Fri, 14 Sep 2018 04:37:13 +1000 Subject: Zeal60/Zeal65/M60-A implementation (#3879) * Initial version of zeal60 * WIP * Fixes issue #900 * Adding RGB underglow functionality. Fixed a compile-time conflict caused by enabling RGB underglow functionality. * Refactor RPC protocol * Fix last merge * README for RGB underglow updated. * Additional README changes. * Adding RGBW strip software-based current-limiting functionality. * RGBW current-limiting functionality should be handled by RGBSTRIP_MAX_CURRENT_PER_LIGHT instead. * Updated README to reflect implementation of built-in current limiting. * Keymap readability improvements. * Minor keymap improvements. * Fixed LED driver init sequence, formatting * Dimming implementation tested, working. * Stab LEDs synced with spacebar hits in effects. * RGB underglow tested and functional. Simplified README for RGB underglow. * Undid accidental file deletion from previous merge conflict. Safer values for RGB underglow. * Improved arrow key positions in keymap. * Added functionality to correct uneven RGB underglow. Refactored related code. * Reverted to safer values for underglow. * Changes for v0.3 * Custom LED brightness scaling will take place after current adjustment in order to avoid being overridden. * Create keymap.c Added split backspace and split shift to ISO layout * Create config.h Turned on LEDs for new layout * Fixed bug where left spacebar stabilizer LED (LC06) would adopt color of row above. * Added hhkb_wilba keymap * Update keymap.c * Update keymap.c * Update keymap.c * Added indicators, full param setting via host * Added "mousekey" layout * Added Zeal65 support, factory test mode * Keycode safe range changed, caused bugs * Bumped EEPROM version due to change in QMK keycodes * Disable HHKB "blocked" LEDs if KC_NO in keymap * Added "disable_hhkb_blocker_leds" * Required overridden function for keymaps in EEPROM * Added polar coordinate mapping, effect speed * Force Raw HID interface number to 1 always * Fixed last merge from master * Added effect speed to default keymaps * add BACKLIGHT_ prefix to vars * add BACKLIGHT_ prefix to vars * Keymap speed effect; keymap improvements/fixes Readme updated to match changes * Refactored to use common IS31FL3731/I2C drivers * Fixed make rules, backlight disabled feature * Make split rightshift default for Zeal65 * Added M60-A as a "version" of Zeal60. * Renamed IS31FL3731 driver functions * Fix suspend_wakeup_init_kb() being defined twice * First pass refactor dynamic keymaps * Updated to changed I2C and ISSI drivers * Refactor zeal_color.* usage to quantum/color.* * Updated Zeal65, fixed dynamic_keymap * Major refactoring of Zeal60 backlight and API * Lots of little cleanups * Added readme.md * Added readme.md * Added LAYOUT_60*() macros, refactored and cleaned up default keymaps * Fix compile error in suspend.c * Added Zeal65 LAYOUT macros, info.json * Added rama/m60_a, deleted zeal60/keymaps/m60_a * Fixed rama/m60_a/keymaps/proto * Fixed compilation error for suspend.c * Requested changes for PR * Fixed readme.md images * Another readme.md fix * Added drashna's requested changes --- keyboards/rama/m60_a/config.h | 128 ++++++++++++++++++++++++++ keyboards/rama/m60_a/info.json | 13 +++ keyboards/rama/m60_a/keymaps/default/keymap.c | 40 ++++++++ keyboards/rama/m60_a/keymaps/proto/config.h | 5 + keyboards/rama/m60_a/keymaps/proto/keymap.c | 40 ++++++++ keyboards/rama/m60_a/m60_a.c | 18 ++++ keyboards/rama/m60_a/m60_a.h | 37 ++++++++ keyboards/rama/m60_a/readme.md | 15 +++ keyboards/rama/m60_a/rules.mk | 79 ++++++++++++++++ 9 files changed, 375 insertions(+) create mode 100644 keyboards/rama/m60_a/config.h create mode 100644 keyboards/rama/m60_a/info.json create mode 100644 keyboards/rama/m60_a/keymaps/default/keymap.c create mode 100644 keyboards/rama/m60_a/keymaps/proto/config.h create mode 100644 keyboards/rama/m60_a/keymaps/proto/keymap.c create mode 100644 keyboards/rama/m60_a/m60_a.c create mode 100644 keyboards/rama/m60_a/m60_a.h create mode 100644 keyboards/rama/m60_a/readme.md create mode 100644 keyboards/rama/m60_a/rules.mk (limited to 'keyboards/rama') diff --git a/keyboards/rama/m60_a/config.h b/keyboards/rama/m60_a/config.h new file mode 100644 index 000000000..45e7d8896 --- /dev/null +++ b/keyboards/rama/m60_a/config.h @@ -0,0 +1,128 @@ +/* Copyright 2017 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 0xFEED // This is same as Zeal60 for now +#define PRODUCT_ID 0x6060 // This is same as Zeal60 for now +#define DEVICE_VER 0x0001 +#define MANUFACTURER RAMA.WORKS +#define PRODUCT RAMA M60-A +#define DESCRIPTION RAMA M60-A Keyboard + + + +// key matrix size +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +// Zeal60 PCB default pin-out +#define MATRIX_ROW_PINS { F0, F1, F4, F6, F7 } +#define MATRIX_COL_PINS { F5, D5, B1, B2, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6 } +#define UNUSED_PINS + +// IS31FL3731 driver +#define DRIVER_COUNT 2 +#define DRIVER_LED_TOTAL 72 + +// COL2ROW or ROW2COL +#define DIODE_DIRECTION COL2ROW + +// Set 0 if debouncing isn't 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)) \ +) + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +// disable debug print +//#define NO_DEBUG + +// disable print +//#define NO_PRINT + +// disable action features +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#define RGB_BACKLIGHT_ENABLED 1 + +// This conditionally compiles the backlight code for M60-A specifics +#define RGB_BACKLIGHT_M60_A + +// enable/disable LEDs based on layout +// they aren't really used if RGB_BACKLIGHT_M60_A defined +#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 1 +#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0 +#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 1 +#define RGB_BACKLIGHT_USE_7U_SPACEBAR 1 +#define RGB_BACKLIGHT_USE_ISO_ENTER 0 +#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 1 + +// 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 0b0000000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0010000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0011000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0011000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0011100000000111 + +#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 + diff --git a/keyboards/rama/m60_a/info.json b/keyboards/rama/m60_a/info.json new file mode 100644 index 000000000..577becd21 --- /dev/null +++ b/keyboards/rama/m60_a/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "M60-A", + "url": "", + "maintainer": "Wilba", + "bootloader": "DFU", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_60_hhkb": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Delete", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Os", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Os", "x":12.5, "y":4}] + } + } +} \ No newline at end of file diff --git a/keyboards/rama/m60_a/keymaps/default/keymap.c b/keyboards/rama/m60_a/keymaps/default/keymap.c new file mode 100644 index 000000000..7b6d9b756 --- /dev/null +++ b/keyboards/rama/m60_a/keymaps/default/keymap.c @@ -0,0 +1,40 @@ +// M60-A layout +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// Default layer +[0] = LAYOUT_60_hhkb( + 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_BSLS, KC_DEL, + 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_BSPC, + KC_LCTL, 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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, FN_MO13, + KC_LGUI, KC_LALT, KC_SPC, KC_RALT, FN_MO23), + +// Fn1 Layer +[1] = LAYOUT_60_hhkb( + KC_GRV, 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_INS, KC_DEL, + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_TRNS, + KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_EJCT, KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +// Fn2 Layer +[2] = LAYOUT_60_hhkb( + 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, 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), + +// Fn3 Layer (zeal60 Configuration) +[3] = LAYOUT_60_hhkb( + KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BR_DEC, BR_INC, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, ES_DEC, ES_INC, 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), + +}; + + diff --git a/keyboards/rama/m60_a/keymaps/proto/config.h b/keyboards/rama/m60_a/keymaps/proto/config.h new file mode 100644 index 000000000..54a185ff1 --- /dev/null +++ b/keyboards/rama/m60_a/keymaps/proto/config.h @@ -0,0 +1,5 @@ +#pragma once + +// This fixes the diodes mounted reversed (fab fail) on M60-A prototype +#undef DIODE_DIRECTION +#define DIODE_DIRECTION ROW2COL diff --git a/keyboards/rama/m60_a/keymaps/proto/keymap.c b/keyboards/rama/m60_a/keymaps/proto/keymap.c new file mode 100644 index 000000000..7b6d9b756 --- /dev/null +++ b/keyboards/rama/m60_a/keymaps/proto/keymap.c @@ -0,0 +1,40 @@ +// M60-A layout +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// Default layer +[0] = LAYOUT_60_hhkb( + 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_BSLS, KC_DEL, + 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_BSPC, + KC_LCTL, 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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, FN_MO13, + KC_LGUI, KC_LALT, KC_SPC, KC_RALT, FN_MO23), + +// Fn1 Layer +[1] = LAYOUT_60_hhkb( + KC_GRV, 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_INS, KC_DEL, + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_TRNS, + KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_EJCT, KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +// Fn2 Layer +[2] = LAYOUT_60_hhkb( + 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, 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), + +// Fn3 Layer (zeal60 Configuration) +[3] = LAYOUT_60_hhkb( + KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BR_DEC, BR_INC, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, ES_DEC, ES_INC, 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), + +}; + + diff --git a/keyboards/rama/m60_a/m60_a.c b/keyboards/rama/m60_a/m60_a.c new file mode 100644 index 000000000..80a98460d --- /dev/null +++ b/keyboards/rama/m60_a/m60_a.c @@ -0,0 +1,18 @@ +/* Copyright 2017 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 . + */ +#ifndef RGB_BACKLIGHT_M60_A +#error RGB_BACKLIGHT_M60_A not defined, you done goofed somehao, brah +#endif diff --git a/keyboards/rama/m60_a/m60_a.h b/keyboards/rama/m60_a/m60_a.h new file mode 100644 index 000000000..3caab6ac0 --- /dev/null +++ b/keyboards/rama/m60_a/m60_a.h @@ -0,0 +1,37 @@ +/* Copyright 2017 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 "quantum.h" +#include "../../zeal60/rgb_backlight_keycodes.h" +#include "../../zeal60/zeal60_keycodes.h" + +#define XXX KC_NO + +#define LAYOUT_60_hhkb( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K41, K42, K47, K4B, K4C \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ + { XXX, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, XXX, XXX, K4B, K4C, XXX } \ +} + diff --git a/keyboards/rama/m60_a/readme.md b/keyboards/rama/m60_a/readme.md new file mode 100644 index 000000000..fe54f0163 --- /dev/null +++ b/keyboards/rama/m60_a/readme.md @@ -0,0 +1,15 @@ +# RAMA M60-A + +![RAMA M60-A](https://static1.squarespace.com/static/563c788ae4b099120ae219e2/t/5aafa6a20e2e7254480b21bf/1535873164793/RAMA-M60-A-03.688.jpg?format=1500w) + +The M60-A represents the benchmark and equilibrium between function and design for us at Rama Works. The gently exaggerated design of the frame is not understated, but rather provocative. Inspiration and evolution from previous models are evident in the beautifully articulated design and the well defined aesthetic, the fingerprint of our 'Industrial Modern' designs. The M60-A offers a unique contender in the traditional 60% form factor. [More info at RAMA WORKS](https://rama.works/m60-a/) + +Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) +Hardware Supported: RAMA M60-A PCB +Hardware Availability: [RAMA WORKS Store](https://ramaworks.store/) + +Make example for this keyboard (after setting up your build environment): + + make rama/m60_a: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). \ No newline at end of file diff --git a/keyboards/rama/m60_a/rules.mk b/keyboards/rama/m60_a/rules.mk new file mode 100644 index 000000000..02617cf1c --- /dev/null +++ b/keyboards/rama/m60_a/rules.mk @@ -0,0 +1,79 @@ + + +# project specific files +SRC = ../zeal60/zeal60.c \ + ../zeal60/rgb_backlight.c \ + quantum/color.c \ + drivers/issi/is31fl3731.c \ + drivers/avr/i2c_master.c + +# 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 +BOOTLOADER = atmel-dfu + +# Do not put the microcontroller into power saving mode +# when we get USB suspend event. We want it to keep updating +# backlight effects. +OPT_DEFS += -DNO_SUSPEND_POWER_DOWN + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # 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 +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes +CIE1931_CURVE = yes + -- cgit v1.2.3-24-g4f1b From 13e166d9c42845e2622605e94d4a0c38fa5443a0 Mon Sep 17 00:00:00 2001 From: Wilba6582 Date: Fri, 28 Sep 2018 00:40:44 +1000 Subject: RAMA U80-A, wilba.tech WT60-A, WT65-A, WT80-A, IS31FL3736 driver (#3925) * Initial commit of RAMA U80-A * Initial commit of RAMA U80-A * Moved IS31FL3736 driver, minor cleanups * Superficial stuff * Review changes * Refactored to use common code. --- keyboards/rama/readme.md | 2 + keyboards/rama/u80_a/config.h | 187 ++++++++++++++++++++++++++ keyboards/rama/u80_a/info.json | 13 ++ keyboards/rama/u80_a/keymaps/default/keymap.c | 22 +++ keyboards/rama/u80_a/readme.md | 15 +++ keyboards/rama/u80_a/rules.mk | 68 ++++++++++ keyboards/rama/u80_a/u80_a.c | 17 +++ keyboards/rama/u80_a/u80_a.h | 43 ++++++ 8 files changed, 367 insertions(+) create mode 100644 keyboards/rama/u80_a/config.h create mode 100644 keyboards/rama/u80_a/info.json create mode 100644 keyboards/rama/u80_a/keymaps/default/keymap.c create mode 100644 keyboards/rama/u80_a/readme.md create mode 100644 keyboards/rama/u80_a/rules.mk create mode 100644 keyboards/rama/u80_a/u80_a.c create mode 100644 keyboards/rama/u80_a/u80_a.h (limited to 'keyboards/rama') diff --git a/keyboards/rama/readme.md b/keyboards/rama/readme.md index 4625eb1ef..c7ddf6d11 100644 --- a/keyboards/rama/readme.md +++ b/keyboards/rama/readme.md @@ -6,4 +6,6 @@ Firmware for keyboards designed by [RAMA WORKS](https://rama.works) [RAMA M60-A](https://rama.works/#/m60-a/) +[RAMA U80-A](https://rama.works/#/tkl-a/) + [RAMA M10-B](https://www.massdrop.com/buy/rama-m10-a?mode=guest_open) diff --git a/keyboards/rama/u80_a/config.h b/keyboards/rama/u80_a/config.h new file mode 100644 index 000000000..bfd972828 --- /dev/null +++ b/keyboards/rama/u80_a/config.h @@ -0,0 +1,187 @@ +/* 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 0x080A // 80-A +#define DEVICE_VER 0x0001 +#define MANUFACTURER RAMA.WORKS +#define PRODUCT RAMA U80-A +#define DESCRIPTION RAMA U80-A Keyboard + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 17 + +/* + * 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 { F1, F0, E6, F4, F6, F7 } +#define MATRIX_COL_PINS { F5, D5, B1, B2, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6, D4, B7, B0 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION ROW2COL + +// #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)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + diff --git a/keyboards/rama/u80_a/info.json b/keyboards/rama/u80_a/info.json new file mode 100644 index 000000000..cb61c89b8 --- /dev/null +++ b/keyboards/rama/u80_a/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "RAMA U80-A", + "url": "https://rama.works/#/tkl-a/", + "maintainer": "Wilba", + "bootloader": "atmel-dfu", + "width": 18.25, + "height": 6.5, + "layouts": { + "LAYOUT_all": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Backspace", "x":13, "y":1.5}, {"x":14, "y":1.5}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, {"label":"Shift", "x":0, "y":4.5, "w":2.25}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, {"x":14, "y":4.5}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"Alt", "x":10, "y":5.5, "w":1.25}, {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}] + } + } +} diff --git a/keyboards/rama/u80_a/keymaps/default/keymap.c b/keyboards/rama/u80_a/keymaps/default/keymap.c new file mode 100644 index 000000000..cf9225e3e --- /dev/null +++ b/keyboards/rama/u80_a/keymaps/default/keymap.c @@ -0,0 +1,22 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_all( + KC_ESC, 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_PSCR, KC_SLCK, KC_PAUS, + KC_GRV, 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_BSPC, KC_INS, KC_HOME, KC_PGUP, + 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_DEL, KC_END, KC_PGDN, + 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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_TRNS, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [1] = LAYOUT_all( + 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, 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, 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), + +}; + diff --git a/keyboards/rama/u80_a/readme.md b/keyboards/rama/u80_a/readme.md new file mode 100644 index 000000000..c98d00cb6 --- /dev/null +++ b/keyboards/rama/u80_a/readme.md @@ -0,0 +1,15 @@ +# RAMA U80-A + +![RAMA U80-A](https://something.com/something.jpg) + +A TKL keyboard. [More info at RAMA WORKS](https://rama.works/#/tkl-a/) + +Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) +Hardware Supported: RAMA U80-A PCB +Hardware Availability: [RAMA WORKS Store](https://ramaworks.store/) + +Make example for this keyboard (after setting up your build environment): + + make rama/u80_a: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). \ No newline at end of file diff --git a/keyboards/rama/u80_a/rules.mk b/keyboards/rama/u80_a/rules.mk new file mode 100644 index 000000000..99224c247 --- /dev/null +++ b/keyboards/rama/u80_a/rules.mk @@ -0,0 +1,68 @@ +# project specific files +SRC = drivers/issi/is31fl3736.c \ + drivers/avr/i2c_master.c \ + keyboards/wilba_tech/wt_mono_backlight.c \ + keyboards/wilba_tech/wt_main.c + +# 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 +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # 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 = no # 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 diff --git a/keyboards/rama/u80_a/u80_a.c b/keyboards/rama/u80_a/u80_a.c new file mode 100644 index 000000000..ccff6d62c --- /dev/null +++ b/keyboards/rama/u80_a/u80_a.c @@ -0,0 +1,17 @@ +/* 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 . + */ + +// Nothing to see here, move along... ;-) diff --git a/keyboards/rama/u80_a/u80_a.h b/keyboards/rama/u80_a/u80_a.h new file mode 100644 index 000000000..26403ef34 --- /dev/null +++ b/keyboards/rama/u80_a/u80_a.h @@ -0,0 +1,43 @@ +/* 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 "quantum.h" + +#define ____ KC_NO + +// Right switch of split backspace is at 3,13 and is the only switch +// whose physical position doesn't match switch matrix position :-( +// However, it also makes no sense to view the physical as 18 columns, +// so the numbering goes 00 to 16. Deal with it. + +#define LAYOUT_all( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K015, K016, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K313, K114, K115, K116, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, \ + K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K415, \ + K500, K501, K502, K506, K510, K511, K512, K513, K514, K515, K516 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, ____, K014, K015, K016 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, ____, ____, ____ }, \ + { K400, ____, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, ____, K415, ____ }, \ + { K500, K501, K502, ____, ____, ____, K506, ____, ____, ____, K510, K511, K512, K513, K514, K515, K516 } \ +} + -- cgit v1.2.3-24-g4f1b From daa11dc414d505076ebdf147a4e2c800b8a06190 Mon Sep 17 00:00:00 2001 From: Wilba6582 Date: Sat, 29 Sep 2018 02:01:00 +1000 Subject: Changed VID/PID, added commands, refactoring --- keyboards/rama/m60_a/config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'keyboards/rama') diff --git a/keyboards/rama/m60_a/config.h b/keyboards/rama/m60_a/config.h index 45e7d8896..03794965f 100644 --- a/keyboards/rama/m60_a/config.h +++ b/keyboards/rama/m60_a/config.h @@ -18,8 +18,8 @@ #include "config_common.h" // USB Device descriptor parameter -#define VENDOR_ID 0xFEED // This is same as Zeal60 for now -#define PRODUCT_ID 0x6060 // This is same as Zeal60 for now +#define VENDOR_ID 0x5241 // "RW" +#define PRODUCT_ID 0x060A // 60-A #define DEVICE_VER 0x0001 #define MANUFACTURER RAMA.WORKS #define PRODUCT RAMA M60-A -- cgit v1.2.3-24-g4f1b 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_a/config.h | 24 +- keyboards/rama/m6_a/keymaps/default/config.h | 24 -- keyboards/rama/m6_a/keymaps/default/keymap.c | 316 +-------------------------- keyboards/rama/m6_a/m6_a.c | 31 +-- keyboards/rama/m6_a/readme.md | 2 +- keyboards/rama/m6_a/rules.mk | 44 ++-- keyboards/rama/m6_b/config.h | 129 +++++++++++ keyboards/rama/m6_b/info.json | 19 ++ keyboards/rama/m6_b/keymaps/default/keymap.c | 16 ++ keyboards/rama/m6_b/m6_b.c | 230 +++++++++++++++++++ keyboards/rama/m6_b/m6_b.h | 28 +++ keyboards/rama/m6_b/m6_b_api.h | 39 ++++ keyboards/rama/m6_b/readme.md | 15 ++ keyboards/rama/m6_b/rgb_backlight.c | 139 ++++++++++++ keyboards/rama/m6_b/rgb_backlight.h | 34 +++ keyboards/rama/m6_b/rules.mk | 77 +++++++ 16 files changed, 774 insertions(+), 393 deletions(-) delete mode 100644 keyboards/rama/m6_a/keymaps/default/config.h create mode 100644 keyboards/rama/m6_b/config.h create mode 100644 keyboards/rama/m6_b/info.json create mode 100644 keyboards/rama/m6_b/keymaps/default/keymap.c create mode 100644 keyboards/rama/m6_b/m6_b.c create mode 100644 keyboards/rama/m6_b/m6_b.h create mode 100644 keyboards/rama/m6_b/m6_b_api.h create mode 100644 keyboards/rama/m6_b/readme.md create mode 100644 keyboards/rama/m6_b/rgb_backlight.c create mode 100644 keyboards/rama/m6_b/rgb_backlight.h create mode 100644 keyboards/rama/m6_b/rules.mk (limited to 'keyboards/rama') diff --git a/keyboards/rama/m6_a/config.h b/keyboards/rama/m6_a/config.h index 0c5355f4a..8d77f5339 100644 --- a/keyboards/rama/m6_a/config.h +++ b/keyboards/rama/m6_a/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -187,4 +186,23 @@ along with this program. If not, see . /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 -#endif +#define RGB_BACKLIGHT_ENABLED 0 + +#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 diff --git a/keyboards/rama/m6_a/keymaps/default/config.h b/keyboards/rama/m6_a/keymaps/default/config.h deleted file mode 100644 index d150575c1..000000000 --- a/keyboards/rama/m6_a/keymaps/default/config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright 2018 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 . - */ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -// place overrides here - -#endif diff --git a/keyboards/rama/m6_a/keymaps/default/keymap.c b/keyboards/rama/m6_a/keymaps/default/keymap.c index 6b15f3cd1..7a408fa8a 100644 --- a/keyboards/rama/m6_a/keymaps/default/keymap.c +++ b/keyboards/rama/m6_a/keymaps/default/keymap.c @@ -3,322 +3,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LAYOUT( - TO(1), KC_A, KC_B, KC_C, KC_D, KC_E), + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6), LAYOUT( - TO(2), KC_F, KC_G, KC_H, KC_I, KC_J), + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO), LAYOUT( - TO(3), KC_K, KC_L, KC_M, KC_N, KC_O), + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO), LAYOUT( - TO(4), KC_P, KC_Q, KC_R, KC_S, KC_T), + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO) }; - LAYOUT( - TO(5), KC_U, KC_V, KC_W, KC_X, KC_Y), - - LAYOUT( - TO(0), KC_Z, KC_1, KC_2, KC_3, KC_4)}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - //keyevent_t event = record->event; - - switch (id) - { - case 0: - if (record->event.pressed) - { - return MACRO(T(T), T(G), T(L), T(H), T(F), T(ENT), END); - } - break; - case 1: - if (record->event.pressed) - { - return MACRO(T(T), T(G), T(G), T(ENT), END); - } - break; - case 2: - if (record->event.pressed) - { - return MACRO(D(NO), T(L), U(NO), END); - } - break; - case 3: - if (record->event.pressed) - { - return MACRO(D(LCTL), T(Z), U(LCTL), END); - } - break; - case 4: - if (record->event.pressed) - { - return MACRO(D(LCTL), D(LSFT), T(Z), U(LSFT), U(LCTL), END); - } - break; - case 5: - if (record->event.pressed) - { - return MACRO(D(LCTL), T(X), U(LCTL), END); - } - break; - case 6: - if (record->event.pressed) - { - return MACRO(D(LCTL), T(C), U(LCTL), END); - } - break; - case 7: - if (record->event.pressed) - { - return MACRO(D(LCTL), T(V), U(LCTL), END); - } - break; - } - return MACRO_NONE; -} - -// M6-A LEDs are connected to D6, B6, F5, B4, C7, F7 -// This is 1-based because I copied it from Knops code. -void set_switch_led(int ledId, bool state) -{ - if (state) - { - switch (ledId) - { - case 1: - PORTD |= (1 << 6); - break; - case 2: - PORTB |= (1 << 6); - break; - case 3: - PORTF |= (1 << 5); - break; - case 4: - PORTB |= (1 << 4); - break; - case 5: - PORTC |= (1 << 7); - break; - case 6: - PORTF |= (1 << 7); - break; - } - } - else - { - switch (ledId) - { - case 1: - PORTD &= ~(1 << 6); - break; - case 2: - PORTB &= ~(1 << 6); - break; - case 3: - PORTF &= ~(1 << 5); - break; - case 4: - PORTB &= ~(1 << 4); - break; - case 5: - PORTC &= ~(1 << 7); - break; - case 6: - PORTF &= ~(1 << 7); - break; - } - } -} - -void set_layer_led(int layerId) -{ - // UNUSED -} - -void led_set_layer(int layer); - -void matrix_init_user(void) -{ - led_init_ports(); - led_set_layer(0); -} - -void matrix_scan_user(void) -{ -} - -// M6-A LEDs are connected to D6, B6, F5, B4, C7, F7 -void led_init_ports() -{ - // Switch #1 - DDRD |= (1 << 6); - PORTD &= ~(1 << 6); - - // Switch #2 - DDRB |= (1 << 6); - PORTB &= ~(1 << 6); - - // Switch #3 - DDRF |= (1 << 5); - PORTF &= ~(1 << 5); - - // Switch #4 - DDRB |= (1 << 4); - PORTB &= ~(1 << 4); - - // Switch #5 - DDRC |= (1 << 7); - PORTC &= ~(1 << 7); - - // Switch #6 - DDRF |= (1 << 7); - PORTF &= ~(1 << 7); -} - -void led_set_user(uint8_t usb_led) -{ - - if (usb_led & (1 << USB_LED_NUM_LOCK)) - { - } - else - { - } - - if (usb_led & (1 << USB_LED_CAPS_LOCK)) - { - } - else - { - } - - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) - { - } - else - { - } - - if (usb_led & (1 << USB_LED_COMPOSE)) - { - } - else - { - } - - if (usb_led & (1 << USB_LED_KANA)) - { - } - else - { - } -} - -void led_set_layer(int layer) -{ - switch (layer) - { - case 0: - set_switch_led(1, true); - set_switch_led(2, false); - set_switch_led(3, false); - set_switch_led(4, false); - set_switch_led(5, false); - set_switch_led(6, false); - break; - case 1: - set_switch_led(1, false); - set_switch_led(2, true); - set_switch_led(3, false); - set_switch_led(4, false); - set_switch_led(5, false); - set_switch_led(6, false); - break; - case 2: - set_switch_led(1, false); - set_switch_led(2, false); - set_switch_led(3, true); - set_switch_led(4, false); - set_switch_led(5, false); - set_switch_led(6, false); - break; - case 3: - set_switch_led(1, false); - set_switch_led(2, false); - set_switch_led(3, false); - set_switch_led(4, true); - set_switch_led(5, false); - set_switch_led(6, false); - break; - case 4: - set_switch_led(1, false); - set_switch_led(2, false); - set_switch_led(3, false); - set_switch_led(4, false); - set_switch_led(5, true); - set_switch_led(6, false); - break; - case 5: - set_switch_led(1, false); - set_switch_led(2, false); - set_switch_led(3, false); - set_switch_led(4, false); - set_switch_led(5, false); - set_switch_led(6, true); - break; - default: - set_switch_led(1, true); - set_switch_led(2, true); - set_switch_led(3, true); - set_switch_led(4, true); - set_switch_led(5, true); - set_switch_led(6, true); - break; - } -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) -{ - switch (keycode) - { - case TO(0): - if (record->event.pressed) - { - led_set_layer(0); - } - break; - case TO(1): - if (record->event.pressed) - { - led_set_layer(1); - } - break; - case TO(2): - if (record->event.pressed) - { - led_set_layer(2); - } - break; - case TO(3): - if (record->event.pressed) - { - led_set_layer(3); - } - break; - case TO(4): - if (record->event.pressed) - { - led_set_layer(4); - } - break; - case TO(5): - if (record->event.pressed) - { - led_set_layer(5); - } - break; - } - return true; -} diff --git a/keyboards/rama/m6_a/m6_a.c b/keyboards/rama/m6_a/m6_a.c index 1c84ea2b8..fa1900360 100644 --- a/keyboards/rama/m6_a/m6_a.c +++ b/keyboards/rama/m6_a/m6_a.c @@ -1,4 +1,4 @@ -/* Copyright 2018 Wilba +/* 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 @@ -13,32 +13,3 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "m6_a.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(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - led_set_user(usb_led); -} -*/ diff --git a/keyboards/rama/m6_a/readme.md b/keyboards/rama/m6_a/readme.md index 5dd2b92e1..ceaf6a88d 100644 --- a/keyboards/rama/m6_a/readme.md +++ b/keyboards/rama/m6_a/readme.md @@ -12,4 +12,4 @@ Make example for this keyboard (after setting up your build environment): make rama/m6_a: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. \ No newline at end of file +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). \ No newline at end of file diff --git a/keyboards/rama/m6_a/rules.mk b/keyboards/rama/m6_a/rules.mk index ca2a2a5f8..ed85ac36d 100644 --- a/keyboards/rama/m6_a/rules.mk +++ b/keyboards/rama/m6_a/rules.mk @@ -1,5 +1,7 @@ +# project specific files +SRC = keyboards/rama/m6_b/m6_b.c + # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. @@ -38,31 +40,27 @@ 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 - +# Boot Section +BOOTLOADER = atmel-dfu # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration +BOOTMAGIC_ENABLE = no # 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 +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 ?= no # 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 +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 + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/rama/m6_b/config.h b/keyboards/rama/m6_b/config.h new file mode 100644 index 000000000..1adaad3f9 --- /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 diff --git a/keyboards/rama/m6_b/info.json b/keyboards/rama/m6_b/info.json new file mode 100644 index 000000000..c88a3cc61 --- /dev/null +++ b/keyboards/rama/m6_b/info.json @@ -0,0 +1,19 @@ +{ + "keyboard_name": "m6-b", + "url": "", + "maintainer": "qmk", + "width": 3, + "height": 2, + "layouts": { + "LAYOUT": { + "layout": [ + { "x": 0, "y": 0 }, + { "x": 1, "y": 0 }, + { "x": 2, "y": 0 }, + { "x": 0, "y": 1 }, + { "x": 1, "y": 1 }, + { "x": 2, "y": 1 } + ] + } + } +} diff --git a/keyboards/rama/m6_b/keymaps/default/keymap.c b/keyboards/rama/m6_b/keymaps/default/keymap.c new file mode 100644 index 000000000..7a408fa8a --- /dev/null +++ b/keyboards/rama/m6_b/keymaps/default/keymap.c @@ -0,0 +1,16 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6), + + LAYOUT( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO), + + LAYOUT( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO), + + LAYOUT( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO) }; + diff --git a/keyboards/rama/m6_b/m6_b.c b/keyboards/rama/m6_b/m6_b.c new file mode 100644 index 000000000..e7cd2f628 --- /dev/null +++ b/keyboards/rama/m6_b/m6_b.c @@ -0,0 +1,230 @@ +/* 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 . + */ +#include "m6_b.h" +#include "m6_b_api.h" + +// Check that no backlight functions are called +#if RGB_BACKLIGHT_ENABLED +#include "rgb_backlight.h" +#endif // RGB_BACKLIGHT_ENABLED + +#include "raw_hid.h" +#include "dynamic_keymap.h" +#include "timer.h" +#include "tmk_core/common/eeprom.h" + +bool eeprom_is_valid(void) +{ + return (eeprom_read_word(((void*)EEPROM_MAGIC_ADDR)) == EEPROM_MAGIC && + eeprom_read_byte(((void*)EEPROM_VERSION_ADDR)) == EEPROM_VERSION); +} + +void eeprom_set_valid(bool valid) +{ + eeprom_update_word(((void*)EEPROM_MAGIC_ADDR), valid ? EEPROM_MAGIC : 0xFFFF); + eeprom_update_byte(((void*)EEPROM_VERSION_ADDR), valid ? EEPROM_VERSION : 0xFF); +} + +void eeprom_reset(void) +{ + // Set the keyboard-specific EEPROM state as invalid. + eeprom_set_valid(false); + // Set the TMK/QMK EEPROM state as invalid. + eeconfig_disable(); +} + +#ifdef RAW_ENABLE + +void raw_hid_receive( uint8_t *data, uint8_t length ) +{ + uint8_t *command_id = &(data[0]); + uint8_t *command_data = &(data[1]); + switch ( *command_id ) + { + case id_get_protocol_version: + { + command_data[0] = PROTOCOL_VERSION >> 8; + command_data[1] = PROTOCOL_VERSION & 0xFF; + break; + } + case id_get_keyboard_value: + { + if ( command_data[0] == id_uptime ) + { + uint32_t value = timer_read32(); + command_data[1] = (value >> 24 ) & 0xFF; + command_data[2] = (value >> 16 ) & 0xFF; + command_data[3] = (value >> 8 ) & 0xFF; + command_data[4] = value & 0xFF; + } + else + { + *command_id = id_unhandled; + } + break; + } +#ifdef DYNAMIC_KEYMAP_ENABLE + case id_dynamic_keymap_get_keycode: + { + uint16_t keycode = dynamic_keymap_get_keycode( command_data[0], command_data[1], command_data[2] ); + command_data[3] = keycode >> 8; + command_data[4] = keycode & 0xFF; + break; + } + case id_dynamic_keymap_set_keycode: + { + dynamic_keymap_set_keycode( command_data[0], command_data[1], command_data[2], ( command_data[3] << 8 ) | command_data[4] ); + break; + } + case id_dynamic_keymap_reset: + { + dynamic_keymap_reset(); + break; + } +#endif // DYNAMIC_KEYMAP_ENABLE +#if RGB_BACKLIGHT_ENABLED + case id_backlight_config_set_value: + { + //backlight_config_set_value(command_data); + break; + } + case id_backlight_config_get_value: + { + //backlight_config_get_value(command_data); + break; + } + case id_backlight_config_save: + { + //backlight_config_save(); + break; + } +#endif // RGB_BACKLIGHT_ENABLED + case id_eeprom_reset: + { + eeprom_reset(); + break; + } + case id_bootloader_jump: + { + // Need to send data back before the jump + // Informs host that the command is handled + raw_hid_send( data, length ); + // Give host time to read it + wait_ms(100); + bootloader_jump(); + break; + } + default: + { + // Unhandled message. + *command_id = id_unhandled; + break; + } + } + + // Return same buffer with values changed + raw_hid_send( data, length ); + +} + +#endif + +void main_init(void) +{ + // If the EEPROM has the magic, the data is good. + // OK to load from EEPROM. + if (eeprom_is_valid()) { +#if RGB_BACKLIGHT_ENABLED + //backlight_config_load(); +#endif // RGB_BACKLIGHT_ENABLED + } else { +#if RGB_BACKLIGHT_ENABLED + // If the EEPROM has not been saved before, or is out of date, + // save the default values to the EEPROM. Default values + // come from construction of the zeal_backlight_config instance. + //backlight_config_save(); +#endif // RGB_BACKLIGHT_ENABLED +#ifdef DYNAMIC_KEYMAP_ENABLE + // This resets the keymaps in EEPROM to what is in flash. + dynamic_keymap_reset(); +#endif + // Save the magic number last, in case saving was interrupted + eeprom_set_valid(true); + } +#if RGB_BACKLIGHT_ENABLED + // Initialize LED drivers for backlight. + backlight_init_drivers(); + + backlight_timer_init(); + backlight_timer_enable(); +#endif // RGB_BACKLIGHT_ENABLED +} + +void bootmagic_lite(void) +{ + // The lite version of TMK's bootmagic. + // 100% less potential for accidentally making the + // keyboard do stupid things. + + // We need multiple scans because debouncing can't be turned off. + matrix_scan(); + wait_ms(DEBOUNCING_DELAY); + wait_ms(DEBOUNCING_DELAY); + matrix_scan(); + + // If the Esc (matrix 0,0) is held down on power up, + // reset the EEPROM valid state and jump to bootloader. + if ( matrix_get_row(0) & (1<<0) ) { + eeprom_reset(); + bootloader_jump(); + } +} + +void matrix_init_kb(void) { + bootmagic_lite(); + main_init(); + matrix_init_user(); +} + +void matrix_scan_kb(void) { +#if RGB_BACKLIGHT_ENABLED + // This only updates the LED driver buffers if something has changed. + backlight_update_pwm_buffers(); +#endif // BACKLIGHT_ENABLED + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + led_set_user(usb_led); +} + +void suspend_power_down_kb(void) +{ +#if RGB_BACKLIGHT_ENABLED + //backlight_set_suspend_state(true); +#endif // BACKLIGHT_ENABLED +} + +void suspend_wakeup_init_kb(void) +{ +#if RGB_BACKLIGHT_ENABLED + //backlight_set_suspend_state(false); +#endif // BACKLIGHT_ENABLED +} diff --git a/keyboards/rama/m6_b/m6_b.h b/keyboards/rama/m6_b/m6_b.h new file mode 100644 index 000000000..bd4158bcb --- /dev/null +++ b/keyboards/rama/m6_b/m6_b.h @@ -0,0 +1,28 @@ +/* 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 "quantum.h" + +// This a shortcut to help you visually see your layout. +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05) \ + { \ + {K00, K01, K02, K03, K04, K05}, \ + } + diff --git a/keyboards/rama/m6_b/m6_b_api.h b/keyboards/rama/m6_b/m6_b_api.h new file mode 100644 index 000000000..041fd6e6e --- /dev/null +++ b/keyboards/rama/m6_b/m6_b_api.h @@ -0,0 +1,39 @@ +/* Copyright 2017 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 + +#define PROTOCOL_VERSION 0x0001 + +enum m6_b_command_id +{ + id_get_protocol_version = 0x01, // always 0x01 + id_get_keyboard_value, + id_set_keyboard_value, + id_dynamic_keymap_get_keycode, + id_dynamic_keymap_set_keycode, + id_dynamic_keymap_reset, + id_backlight_config_set_value, + id_backlight_config_get_value, + id_backlight_config_save, + id_eeprom_reset, + id_bootloader_jump, + id_unhandled = 0xFF, +}; + +enum m6_b_keyboard_value_id +{ + id_uptime = 0x01 +}; diff --git a/keyboards/rama/m6_b/readme.md b/keyboards/rama/m6_b/readme.md new file mode 100644 index 000000000..d6bdd0c4c --- /dev/null +++ b/keyboards/rama/m6_b/readme.md @@ -0,0 +1,15 @@ +# RAMA M6-B + +![RAMA M6-B](https://static1.squarespace.com/static/563c788ae4b099120ae219e2/t/59fc7b1053450adf5bf9a852/1515932239307/RAMA-RAMA-M6-DSA-XO-CAPS.73-3_1.jpg?format=1500w) + +A 6-key companion keyboard. [More info at RAMA WORKS](https://rama.works/m6a) + +Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) +Hardware Supported: RAMA M6-B PCB +Hardware Availability: [RAMA WORKS Store](https://ramaworks.store/) + +Make example for this keyboard (after setting up your build environment): + + make rama/m6_b: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). \ No newline at end of file diff --git a/keyboards/rama/m6_b/rgb_backlight.c b/keyboards/rama/m6_b/rgb_backlight.c new file mode 100644 index 000000000..8f7ac0630 --- /dev/null +++ b/keyboards/rama/m6_b/rgb_backlight.c @@ -0,0 +1,139 @@ +/* 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 . + */ +#if RGB_BACKLIGHT_ENABLED + +#include "rgb_backlight.h" +//#include "rgb_backlight_api.h" + +#include +#include +#include +#include "progmem.h" + +#include "quantum/color.h" +#include "drivers/avr/i2c_master.h" +#include "drivers/issi/is31fl3218.h" + +bool g_suspend_state = false; + +// Global tick at 20 Hz +uint32_t g_tick = 0; +uint8_t g_config_effect_speed = 0; +uint8_t g_config_brightness = 255; + +void backlight_update_pwm_buffers(void) +{ + IS31FL3218_update_pwm_buffers(); +} + +void backlight_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) +{ + IS31FL3218_set_color( index, red, green, blue ); +} + +void backlight_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) +{ + IS31FL3218_set_color_all( red, green, blue ); +} + + +// This is (F_CPU/1024) / 20 Hz +// = 15625 Hz / 20 Hz +// = 781 +#define TIMER3_TOP 260 + +void backlight_timer_init(void) +{ + static uint8_t backlight_timer_is_init = 0; + if ( backlight_timer_is_init ) + { + return; + } + backlight_timer_is_init = 1; + + // Timer 3 setup + TCCR3B = _BV(WGM32) | // CTC mode OCR3A as TOP + _BV(CS32) | _BV(CS30); // prescale by /1024 + // Set TOP value + uint8_t sreg = SREG; + cli(); + + OCR3AH = (TIMER3_TOP >> 8) & 0xff; + OCR3AL = TIMER3_TOP & 0xff; + SREG = sreg; +} + +void backlight_timer_enable(void) +{ + TIMSK3 |= _BV(OCIE3A); +} + +void backlight_timer_disable(void) +{ + TIMSK3 &= ~_BV(OCIE3A); +} + +void backlight_set_suspend_state(bool state) +{ + g_suspend_state = state; +} + +void backlight_effect_cycle_all(void) +{ + uint8_t hueOffset = ( g_tick << g_config_effect_speed ) & 0xFF; + uint8_t satOffset = 127; + // Relies on hue being 8-bit and wrapping + for ( int i=0; i<6; i++ ) + { + HSV hsv = { .h = hueOffset, .s = satOffset, .v = g_config_brightness }; + RGB rgb = hsv_to_rgb( hsv ); + backlight_set_color( i, rgb.r, rgb.g, rgb.b ); + } +} + +ISR(TIMER3_COMPA_vect) +{ + // delay 1 second before driving LEDs or doing anything else + static uint8_t startup_tick = 0; + if ( startup_tick < 20 ) + { + startup_tick++; + return; + } + + g_tick++; + + if ( g_suspend_state ) + { + backlight_set_color_all( 0, 0, 0 ); + } + else + { + //HSV hsv = { .h = 240, .s = 255, .v = g_config_brightness }; + //RGB rgb = hsv_to_rgb( hsv ); + //backlight_set_color_all( rgb.r, rgb.g, rgb.b ); + backlight_effect_cycle_all(); + } +} + +void backlight_init_drivers(void) +{ + // Initialize I2C + i2c_init(); + IS31FL3218_init(); +} + +#endif // RGB_BACKLIGHT_ENABLED diff --git a/keyboards/rama/m6_b/rgb_backlight.h b/keyboards/rama/m6_b/rgb_backlight.h new file mode 100644 index 000000000..bbf605284 --- /dev/null +++ b/keyboards/rama/m6_b/rgb_backlight.h @@ -0,0 +1,34 @@ +/* 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 + +#if RGB_BACKLIGHT_ENABLED +#else +#error rgb_backlight.h included when RGB_BACKLIGHT_ENABLED == 0 +#endif // RGB_BACKLIGHT_ENABLED + +#include +#include + +#include "quantum/color.h" + +void backlight_init_drivers(void); +void backlight_update_pwm_buffers(void); +void backlight_timer_init(void); +void backlight_timer_enable(void); +void backlight_timer_disable(void); +void backlight_set_suspend_state(bool state); + diff --git a/keyboards/rama/m6_b/rules.mk b/keyboards/rama/m6_b/rules.mk new file mode 100644 index 000000000..8226debd4 --- /dev/null +++ b/keyboards/rama/m6_b/rules.mk @@ -0,0 +1,77 @@ +# project specific files +SRC = rgb_backlight.c \ + quantum/color.c \ + drivers/issi/is31fl3218.c \ + drivers/avr/i2c_master.c + + +# 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 +BOOTLOADER = atmel-dfu + +# Do not put the microcontroller into power saving mode +# when we get USB suspend event. We want it to keep updating +# backlight effects. +OPT_DEFS += -DNO_SUSPEND_POWER_DOWN + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # 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 + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes +CIE1931_CURVE = yes -- cgit v1.2.3-24-g4f1b From 00b6f14821f44ead75504e28d7fed26791cb2875 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 22 Oct 2018 08:57:37 -0700 Subject: Replace outdated RGB/Audio information --- keyboards/rama/m60_a/rules.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'keyboards/rama') diff --git a/keyboards/rama/m60_a/rules.mk b/keyboards/rama/m60_a/rules.mk index 02617cf1c..7ab1b7d3b 100644 --- a/keyboards/rama/m60_a/rules.mk +++ b/keyboards/rama/m60_a/rules.mk @@ -68,7 +68,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend @@ -76,4 +76,3 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend RAW_ENABLE = yes DYNAMIC_KEYMAP_ENABLE = yes CIE1931_CURVE = yes - -- cgit v1.2.3-24-g4f1b 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_a/config.h | 113 ++------------ keyboards/rama/m6_a/rules.mk | 32 ++-- keyboards/rama/m6_b/config.h | 33 +++- keyboards/rama/m6_b/m6_b.c | 216 +------------------------- keyboards/rama/m6_b/m6_b_api.h | 39 ----- keyboards/rama/m6_b/rgb_backlight.c | 139 ----------------- keyboards/rama/m6_b/rgb_backlight.h | 34 ---- keyboards/rama/m6_b/rules.mk | 24 +-- keyboards/rama/u80_a/config.h | 17 ++ keyboards/rama/u80_a/keymaps/default/keymap.c | 15 ++ keyboards/rama/u80_a/rules.mk | 12 +- 11 files changed, 124 insertions(+), 550 deletions(-) delete mode 100644 keyboards/rama/m6_b/m6_b_api.h delete mode 100644 keyboards/rama/m6_b/rgb_backlight.c delete mode 100644 keyboards/rama/m6_b/rgb_backlight.h (limited to 'keyboards/rama') diff --git a/keyboards/rama/m6_a/config.h b/keyboards/rama/m6_a/config.h index 8d77f5339..63da79274 100644 --- a/keyboards/rama/m6_a/config.h +++ b/keyboards/rama/m6_a/config.h @@ -1,20 +1,18 @@ -/* -Copyright 2018 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 . -*/ - +/* 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" @@ -47,7 +45,7 @@ along with this program. If not, see . /* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ #define DIODE_DIRECTION COL2ROW - + // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 @@ -109,88 +107,10 @@ along with this program. If not, see . keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -/* - * MIDI options - */ - -/* Prevent use of disabled MIDI features in the keymap */ -//#define MIDI_ENABLE_STRICT 1 - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ -//#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 1 - #define RGB_BACKLIGHT_ENABLED 0 #define DYNAMIC_KEYMAP_LAYER_COUNT 4 - // EEPROM usage // TODO: refactor with new user EEPROM code (coming soon) @@ -206,3 +126,4 @@ along with this program. If not, see . #define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 // Dynamic keymap starts after backlight config (35+37) #define DYNAMIC_KEYMAP_EEPROM_ADDR 72 + diff --git a/keyboards/rama/m6_a/rules.mk b/keyboards/rama/m6_a/rules.mk index ed85ac36d..ff1706918 100644 --- a/keyboards/rama/m6_a/rules.mk +++ b/keyboards/rama/m6_a/rules.mk @@ -1,5 +1,5 @@ # project specific files -SRC = keyboards/rama/m6_b/m6_b.c +SRC = ../zeal60/zeal60.c # MCU name MCU = atmega32u4 @@ -43,24 +43,32 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT # Boot Section BOOTLOADER = atmel-dfu +# Do not put the microcontroller into power saving mode +# when we get USB suspend event. We want it to keep updating +# backlight effects. +OPT_DEFS += -DNO_SUSPEND_POWER_DOWN + + # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +BOOTMAGIC_ENABLE = no # 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) +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) +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 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 +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend RAW_ENABLE = yes -DYNAMIC_KEYMAP_ENABLE = yes \ No newline at end of file +DYNAMIC_KEYMAP_ENABLE = yes +CIE1931_CURVE = no + diff --git a/keyboards/rama/m6_b/config.h b/keyboards/rama/m6_b/config.h index 1adaad3f9..c016703e0 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 + diff --git a/keyboards/rama/m6_b/m6_b.c b/keyboards/rama/m6_b/m6_b.c index e7cd2f628..581b31d75 100644 --- a/keyboards/rama/m6_b/m6_b.c +++ b/keyboards/rama/m6_b/m6_b.c @@ -13,218 +13,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "m6_b.h" -#include "m6_b_api.h" - -// Check that no backlight functions are called -#if RGB_BACKLIGHT_ENABLED -#include "rgb_backlight.h" -#endif // RGB_BACKLIGHT_ENABLED - -#include "raw_hid.h" -#include "dynamic_keymap.h" -#include "timer.h" -#include "tmk_core/common/eeprom.h" - -bool eeprom_is_valid(void) -{ - return (eeprom_read_word(((void*)EEPROM_MAGIC_ADDR)) == EEPROM_MAGIC && - eeprom_read_byte(((void*)EEPROM_VERSION_ADDR)) == EEPROM_VERSION); -} - -void eeprom_set_valid(bool valid) -{ - eeprom_update_word(((void*)EEPROM_MAGIC_ADDR), valid ? EEPROM_MAGIC : 0xFFFF); - eeprom_update_byte(((void*)EEPROM_VERSION_ADDR), valid ? EEPROM_VERSION : 0xFF); -} - -void eeprom_reset(void) -{ - // Set the keyboard-specific EEPROM state as invalid. - eeprom_set_valid(false); - // Set the TMK/QMK EEPROM state as invalid. - eeconfig_disable(); -} - -#ifdef RAW_ENABLE - -void raw_hid_receive( uint8_t *data, uint8_t length ) -{ - uint8_t *command_id = &(data[0]); - uint8_t *command_data = &(data[1]); - switch ( *command_id ) - { - case id_get_protocol_version: - { - command_data[0] = PROTOCOL_VERSION >> 8; - command_data[1] = PROTOCOL_VERSION & 0xFF; - break; - } - case id_get_keyboard_value: - { - if ( command_data[0] == id_uptime ) - { - uint32_t value = timer_read32(); - command_data[1] = (value >> 24 ) & 0xFF; - command_data[2] = (value >> 16 ) & 0xFF; - command_data[3] = (value >> 8 ) & 0xFF; - command_data[4] = value & 0xFF; - } - else - { - *command_id = id_unhandled; - } - break; - } -#ifdef DYNAMIC_KEYMAP_ENABLE - case id_dynamic_keymap_get_keycode: - { - uint16_t keycode = dynamic_keymap_get_keycode( command_data[0], command_data[1], command_data[2] ); - command_data[3] = keycode >> 8; - command_data[4] = keycode & 0xFF; - break; - } - case id_dynamic_keymap_set_keycode: - { - dynamic_keymap_set_keycode( command_data[0], command_data[1], command_data[2], ( command_data[3] << 8 ) | command_data[4] ); - break; - } - case id_dynamic_keymap_reset: - { - dynamic_keymap_reset(); - break; - } -#endif // DYNAMIC_KEYMAP_ENABLE -#if RGB_BACKLIGHT_ENABLED - case id_backlight_config_set_value: - { - //backlight_config_set_value(command_data); - break; - } - case id_backlight_config_get_value: - { - //backlight_config_get_value(command_data); - break; - } - case id_backlight_config_save: - { - //backlight_config_save(); - break; - } -#endif // RGB_BACKLIGHT_ENABLED - case id_eeprom_reset: - { - eeprom_reset(); - break; - } - case id_bootloader_jump: - { - // Need to send data back before the jump - // Informs host that the command is handled - raw_hid_send( data, length ); - // Give host time to read it - wait_ms(100); - bootloader_jump(); - break; - } - default: - { - // Unhandled message. - *command_id = id_unhandled; - break; - } - } - - // Return same buffer with values changed - raw_hid_send( data, length ); - -} - +#ifndef RGB_BACKLIGHT_M6_B +#error RGB_BACKLIGHT_M6_B not defined, you done goofed somehao, brah #endif - -void main_init(void) -{ - // If the EEPROM has the magic, the data is good. - // OK to load from EEPROM. - if (eeprom_is_valid()) { -#if RGB_BACKLIGHT_ENABLED - //backlight_config_load(); -#endif // RGB_BACKLIGHT_ENABLED - } else { -#if RGB_BACKLIGHT_ENABLED - // If the EEPROM has not been saved before, or is out of date, - // save the default values to the EEPROM. Default values - // come from construction of the zeal_backlight_config instance. - //backlight_config_save(); -#endif // RGB_BACKLIGHT_ENABLED -#ifdef DYNAMIC_KEYMAP_ENABLE - // This resets the keymaps in EEPROM to what is in flash. - dynamic_keymap_reset(); -#endif - // Save the magic number last, in case saving was interrupted - eeprom_set_valid(true); - } -#if RGB_BACKLIGHT_ENABLED - // Initialize LED drivers for backlight. - backlight_init_drivers(); - - backlight_timer_init(); - backlight_timer_enable(); -#endif // RGB_BACKLIGHT_ENABLED -} - -void bootmagic_lite(void) -{ - // The lite version of TMK's bootmagic. - // 100% less potential for accidentally making the - // keyboard do stupid things. - - // We need multiple scans because debouncing can't be turned off. - matrix_scan(); - wait_ms(DEBOUNCING_DELAY); - wait_ms(DEBOUNCING_DELAY); - matrix_scan(); - - // If the Esc (matrix 0,0) is held down on power up, - // reset the EEPROM valid state and jump to bootloader. - if ( matrix_get_row(0) & (1<<0) ) { - eeprom_reset(); - bootloader_jump(); - } -} - -void matrix_init_kb(void) { - bootmagic_lite(); - main_init(); - matrix_init_user(); -} - -void matrix_scan_kb(void) { -#if RGB_BACKLIGHT_ENABLED - // This only updates the LED driver buffers if something has changed. - backlight_update_pwm_buffers(); -#endif // BACKLIGHT_ENABLED - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - led_set_user(usb_led); -} - -void suspend_power_down_kb(void) -{ -#if RGB_BACKLIGHT_ENABLED - //backlight_set_suspend_state(true); -#endif // BACKLIGHT_ENABLED -} - -void suspend_wakeup_init_kb(void) -{ -#if RGB_BACKLIGHT_ENABLED - //backlight_set_suspend_state(false); -#endif // BACKLIGHT_ENABLED -} diff --git a/keyboards/rama/m6_b/m6_b_api.h b/keyboards/rama/m6_b/m6_b_api.h deleted file mode 100644 index 041fd6e6e..000000000 --- a/keyboards/rama/m6_b/m6_b_api.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright 2017 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 - -#define PROTOCOL_VERSION 0x0001 - -enum m6_b_command_id -{ - id_get_protocol_version = 0x01, // always 0x01 - id_get_keyboard_value, - id_set_keyboard_value, - id_dynamic_keymap_get_keycode, - id_dynamic_keymap_set_keycode, - id_dynamic_keymap_reset, - id_backlight_config_set_value, - id_backlight_config_get_value, - id_backlight_config_save, - id_eeprom_reset, - id_bootloader_jump, - id_unhandled = 0xFF, -}; - -enum m6_b_keyboard_value_id -{ - id_uptime = 0x01 -}; diff --git a/keyboards/rama/m6_b/rgb_backlight.c b/keyboards/rama/m6_b/rgb_backlight.c deleted file mode 100644 index 8f7ac0630..000000000 --- a/keyboards/rama/m6_b/rgb_backlight.c +++ /dev/null @@ -1,139 +0,0 @@ -/* 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 . - */ -#if RGB_BACKLIGHT_ENABLED - -#include "rgb_backlight.h" -//#include "rgb_backlight_api.h" - -#include -#include -#include -#include "progmem.h" - -#include "quantum/color.h" -#include "drivers/avr/i2c_master.h" -#include "drivers/issi/is31fl3218.h" - -bool g_suspend_state = false; - -// Global tick at 20 Hz -uint32_t g_tick = 0; -uint8_t g_config_effect_speed = 0; -uint8_t g_config_brightness = 255; - -void backlight_update_pwm_buffers(void) -{ - IS31FL3218_update_pwm_buffers(); -} - -void backlight_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) -{ - IS31FL3218_set_color( index, red, green, blue ); -} - -void backlight_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) -{ - IS31FL3218_set_color_all( red, green, blue ); -} - - -// This is (F_CPU/1024) / 20 Hz -// = 15625 Hz / 20 Hz -// = 781 -#define TIMER3_TOP 260 - -void backlight_timer_init(void) -{ - static uint8_t backlight_timer_is_init = 0; - if ( backlight_timer_is_init ) - { - return; - } - backlight_timer_is_init = 1; - - // Timer 3 setup - TCCR3B = _BV(WGM32) | // CTC mode OCR3A as TOP - _BV(CS32) | _BV(CS30); // prescale by /1024 - // Set TOP value - uint8_t sreg = SREG; - cli(); - - OCR3AH = (TIMER3_TOP >> 8) & 0xff; - OCR3AL = TIMER3_TOP & 0xff; - SREG = sreg; -} - -void backlight_timer_enable(void) -{ - TIMSK3 |= _BV(OCIE3A); -} - -void backlight_timer_disable(void) -{ - TIMSK3 &= ~_BV(OCIE3A); -} - -void backlight_set_suspend_state(bool state) -{ - g_suspend_state = state; -} - -void backlight_effect_cycle_all(void) -{ - uint8_t hueOffset = ( g_tick << g_config_effect_speed ) & 0xFF; - uint8_t satOffset = 127; - // Relies on hue being 8-bit and wrapping - for ( int i=0; i<6; i++ ) - { - HSV hsv = { .h = hueOffset, .s = satOffset, .v = g_config_brightness }; - RGB rgb = hsv_to_rgb( hsv ); - backlight_set_color( i, rgb.r, rgb.g, rgb.b ); - } -} - -ISR(TIMER3_COMPA_vect) -{ - // delay 1 second before driving LEDs or doing anything else - static uint8_t startup_tick = 0; - if ( startup_tick < 20 ) - { - startup_tick++; - return; - } - - g_tick++; - - if ( g_suspend_state ) - { - backlight_set_color_all( 0, 0, 0 ); - } - else - { - //HSV hsv = { .h = 240, .s = 255, .v = g_config_brightness }; - //RGB rgb = hsv_to_rgb( hsv ); - //backlight_set_color_all( rgb.r, rgb.g, rgb.b ); - backlight_effect_cycle_all(); - } -} - -void backlight_init_drivers(void) -{ - // Initialize I2C - i2c_init(); - IS31FL3218_init(); -} - -#endif // RGB_BACKLIGHT_ENABLED diff --git a/keyboards/rama/m6_b/rgb_backlight.h b/keyboards/rama/m6_b/rgb_backlight.h deleted file mode 100644 index bbf605284..000000000 --- a/keyboards/rama/m6_b/rgb_backlight.h +++ /dev/null @@ -1,34 +0,0 @@ -/* 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 - -#if RGB_BACKLIGHT_ENABLED -#else -#error rgb_backlight.h included when RGB_BACKLIGHT_ENABLED == 0 -#endif // RGB_BACKLIGHT_ENABLED - -#include -#include - -#include "quantum/color.h" - -void backlight_init_drivers(void); -void backlight_update_pwm_buffers(void); -void backlight_timer_init(void); -void backlight_timer_enable(void); -void backlight_timer_disable(void); -void backlight_set_suspend_state(bool state); - diff --git a/keyboards/rama/m6_b/rules.mk b/keyboards/rama/m6_b/rules.mk index 8226debd4..1a7466af3 100644 --- a/keyboards/rama/m6_b/rules.mk +++ b/keyboards/rama/m6_b/rules.mk @@ -1,5 +1,6 @@ # project specific files -SRC = rgb_backlight.c \ +SRC = ../zeal60/zeal60.c \ + ../zeal60/rgb_backlight.c \ quantum/color.c \ drivers/issi/is31fl3218.c \ drivers/avr/i2c_master.c @@ -56,22 +57,23 @@ OPT_DEFS += -DNO_SUSPEND_POWER_DOWN # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +BOOTMAGIC_ENABLE = no # 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) +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) +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 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 +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend RAW_ENABLE = yes DYNAMIC_KEYMAP_ENABLE = yes CIE1931_CURVE = yes + diff --git a/keyboards/rama/u80_a/config.h b/keyboards/rama/u80_a/config.h index bfd972828..9c74735ad 100644 --- a/keyboards/rama/u80_a/config.h +++ b/keyboards/rama/u80_a/config.h @@ -185,3 +185,20 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 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 diff --git a/keyboards/rama/u80_a/keymaps/default/keymap.c b/keyboards/rama/u80_a/keymaps/default/keymap.c index cf9225e3e..036a57b68 100644 --- a/keyboards/rama/u80_a/keymaps/default/keymap.c +++ b/keyboards/rama/u80_a/keymaps/default/keymap.c @@ -18,5 +18,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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), + [2] = LAYOUT_all( + 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, 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, 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), + + [3] = LAYOUT_all( + 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, 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, 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), }; diff --git a/keyboards/rama/u80_a/rules.mk b/keyboards/rama/u80_a/rules.mk index 99224c247..67b04e350 100644 --- a/keyboards/rama/u80_a/rules.mk +++ b/keyboards/rama/u80_a/rules.mk @@ -52,17 +52,21 @@ BOOTLOADER = atmel-dfu # change yes to no to disable # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration +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 = no # USB Nkey Rollover +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 + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes +CIE1931_CURVE = yes \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 2f34252278280c34b6958066240e38a2ee6a7237 Mon Sep 17 00:00:00 2001 From: Joe Wasson Date: Wed, 21 Nov 2018 13:18:18 -0800 Subject: Keymap: Update keymap to match latest changes to Wilba's firmware. (#4432) * Fix firmware to work with latest Wilba changes (i.e. dynamic keymap) and M60a. * Get back RGB Backlight codes. * More tweaks. * Update users/talljoe/rules.mk Co-Authored-By: Talljoe --- keyboards/rama/m60_a/rules.mk | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'keyboards/rama') diff --git a/keyboards/rama/m60_a/rules.mk b/keyboards/rama/m60_a/rules.mk index 7ab1b7d3b..9c1a2d9df 100644 --- a/keyboards/rama/m60_a/rules.mk +++ b/keyboards/rama/m60_a/rules.mk @@ -54,7 +54,7 @@ BOOTLOADER = atmel-dfu OPT_DEFS += -DNO_SUSPEND_POWER_DOWN # Build Options -# change to "no" to disable the options, or define them in the Makefile in +# change to "no" to disable the options, or define them in the Makefile in # the appropriate keymap folder that will get included automatically # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) @@ -68,7 +68,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend @@ -76,3 +76,5 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend RAW_ENABLE = yes DYNAMIC_KEYMAP_ENABLE = yes CIE1931_CURVE = yes + +LAYOUTS = 60_hhkb -- cgit v1.2.3-24-g4f1b 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/m60_a/config.h | 13 ++++++++----- keyboards/rama/m60_a/rules.mk | 4 ++-- keyboards/rama/m6_a/config.h | 14 ++++++++++---- keyboards/rama/m6_a/rules.mk | 2 +- keyboards/rama/m6_b/config.h | 11 +++++++---- keyboards/rama/m6_b/rules.mk | 4 ++-- keyboards/rama/u80_a/config.h | 10 ++++++---- 7 files changed, 36 insertions(+), 22 deletions(-) (limited to 'keyboards/rama') diff --git a/keyboards/rama/m60_a/config.h b/keyboards/rama/m60_a/config.h index 03794965f..01cfe05a5 100644 --- a/keyboards/rama/m60_a/config.h +++ b/keyboards/rama/m60_a/config.h @@ -31,7 +31,7 @@ #define MATRIX_ROWS 5 #define MATRIX_COLS 14 -// Zeal60 PCB default pin-out +// M60-A PCB default pin-out #define MATRIX_ROW_PINS { F0, F1, F4, F6, F7 } #define MATRIX_COL_PINS { F5, D5, B1, B2, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6 } #define UNUSED_PINS @@ -118,11 +118,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+31) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 66 +// Dynamic macro starts after dynamic keymaps (66+(4*5*14*2)) = (66+560) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 626 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 398 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/rama/m60_a/rules.mk b/keyboards/rama/m60_a/rules.mk index 9c1a2d9df..09ed03e95 100644 --- a/keyboards/rama/m60_a/rules.mk +++ b/keyboards/rama/m60_a/rules.mk @@ -1,8 +1,8 @@ # project specific files -SRC = ../zeal60/zeal60.c \ - ../zeal60/rgb_backlight.c \ +SRC = keyboards/zeal60/zeal60.c \ + keyboards/zeal60/rgb_backlight.c \ quantum/color.c \ drivers/issi/is31fl3731.c \ drivers/avr/i2c_master.c diff --git a/keyboards/rama/m6_a/config.h b/keyboards/rama/m6_a/config.h index 63da79274..049749bd7 100644 --- a/keyboards/rama/m6_a/config.h +++ b/keyboards/rama/m6_a/config.h @@ -119,11 +119,17 @@ // 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 +// NOTE: M6-A doesn't use RGB backlight, but we keep this +// consistent with M6-B which does. + // 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 diff --git a/keyboards/rama/m6_a/rules.mk b/keyboards/rama/m6_a/rules.mk index ff1706918..399e9e80d 100644 --- a/keyboards/rama/m6_a/rules.mk +++ b/keyboards/rama/m6_a/rules.mk @@ -1,5 +1,5 @@ # project specific files -SRC = ../zeal60/zeal60.c +SRC = keyboards/zeal60/zeal60.c # MCU name MCU = atmega32u4 diff --git a/keyboards/rama/m6_b/config.h b/keyboards/rama/m6_b/config.h index c016703e0..67034ef8c 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 diff --git a/keyboards/rama/m6_b/rules.mk b/keyboards/rama/m6_b/rules.mk index 1a7466af3..b7a76b8dd 100644 --- a/keyboards/rama/m6_b/rules.mk +++ b/keyboards/rama/m6_b/rules.mk @@ -1,6 +1,6 @@ # project specific files -SRC = ../zeal60/zeal60.c \ - ../zeal60/rgb_backlight.c \ +SRC = keyboards/zeal60/zeal60.c \ + keyboards/zeal60/rgb_backlight.c \ quantum/color.c \ drivers/issi/is31fl3218.c \ drivers/avr/i2c_master.c diff --git a/keyboards/rama/u80_a/config.h b/keyboards/rama/u80_a/config.h index 9c74735ad..b5dc27598 100644 --- a/keyboards/rama/u80_a/config.h +++ b/keyboards/rama/u80_a/config.h @@ -198,7 +198,9 @@ #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 +// Dynamic keymap starts after EEPROM version +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +// Dynamic macro starts after dynamic keymaps (35+(4*6*17*2)) = (35+816) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 851 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 173 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 -- cgit v1.2.3-24-g4f1b From cc45f62d757f56c2fa9be92685f83f127b63b509 Mon Sep 17 00:00:00 2001 From: Wilba6582 Date: Thu, 13 Dec 2018 19:33:04 +1100 Subject: Added Dynamic Keymaps to M10-B --- keyboards/rama/m10_b/config.h | 24 ++++++++++++++- keyboards/rama/m10_b/keymaps/default/keymap.c | 18 ------------ keyboards/rama/m10_b/keymaps/knops/config.h | 3 +- keyboards/rama/m10_b/m10_b.c | 31 ++------------------ keyboards/rama/m10_b/rules.mk | 42 +++++++++++++-------------- keyboards/rama/u80_a/config.h | 2 ++ keyboards/rama/u80_a/rules.mk | 1 - 7 files changed, 50 insertions(+), 71 deletions(-) (limited to 'keyboards/rama') diff --git a/keyboards/rama/m10_b/config.h b/keyboards/rama/m10_b/config.h index de626dba5..144f88d56 100644 --- a/keyboards/rama/m10_b/config.h +++ b/keyboards/rama/m10_b/config.h @@ -26,7 +26,7 @@ along with this program. If not, see . #define DEVICE_VER 0x0001 #define MANUFACTURER RAMA.WORKS #define PRODUCT RAMA M10-B -#define DESCRIPTION RAMA M10-B Macropad +#define DESCRIPTION RAMA M10-B /* key matrix size */ #define MATRIX_ROWS 1 @@ -186,4 +186,26 @@ along with this program. If not, see . /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 +//#define WT_MONO_BACKLIGHT + +#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 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Dynamic keymap starts after EEPROM version +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +// Dynamic macro starts after dynamic keymaps (35+(4*10*2)) = (35+80) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 115 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 909 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 + #endif diff --git a/keyboards/rama/m10_b/keymaps/default/keymap.c b/keyboards/rama/m10_b/keymaps/default/keymap.c index 8002b8c7c..c307bcb2a 100644 --- a/keyboards/rama/m10_b/keymaps/default/keymap.c +++ b/keyboards/rama/m10_b/keymaps/default/keymap.c @@ -6,21 +6,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_0 ) }; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - return MACRO_NONE; -} - -void matrix_init_user(void) -{ -} - -void matrix_scan_user(void) -{ -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) -{ - return true; -} diff --git a/keyboards/rama/m10_b/keymaps/knops/config.h b/keyboards/rama/m10_b/keymaps/knops/config.h index d150575c1..7c3ec9601 100644 --- a/keyboards/rama/m10_b/keymaps/knops/config.h +++ b/keyboards/rama/m10_b/keymaps/knops/config.h @@ -19,6 +19,7 @@ #include "../../config.h" -// place overrides here +#undef RAW_ENABLE +#undef DYNAMIC_KEYMAP_ENABLE #endif diff --git a/keyboards/rama/m10_b/m10_b.c b/keyboards/rama/m10_b/m10_b.c index f43f6e2a1..ccff6d62c 100644 --- a/keyboards/rama/m10_b/m10_b.c +++ b/keyboards/rama/m10_b/m10_b.c @@ -1,4 +1,4 @@ -/* Copyright 2018 Wilba +/* 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 @@ -13,32 +13,5 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "m10_b.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(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - led_set_user(usb_led); -} -*/ +// Nothing to see here, move along... ;-) diff --git a/keyboards/rama/m10_b/rules.mk b/keyboards/rama/m10_b/rules.mk index 24df4632d..70258b9ea 100644 --- a/keyboards/rama/m10_b/rules.mk +++ b/keyboards/rama/m10_b/rules.mk @@ -1,5 +1,7 @@ +# project specific files +SRC = keyboards/wilba_tech/wt_main.c + # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. @@ -39,30 +41,28 @@ F_USB = $(F_CPU) 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 +# Boot Section +BOOTLOADER = atmel-dfu # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration +BOOTMAGIC_ENABLE = no # 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 +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 ?= no # USB Nkey Rollover -BACKLIGHT_ENABLE ?= yes # 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 +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 + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes diff --git a/keyboards/rama/u80_a/config.h b/keyboards/rama/u80_a/config.h index b5dc27598..c733601e1 100644 --- a/keyboards/rama/u80_a/config.h +++ b/keyboards/rama/u80_a/config.h @@ -185,6 +185,8 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 +#define WT_MONO_BACKLIGHT + #define DYNAMIC_KEYMAP_LAYER_COUNT 4 // EEPROM usage diff --git a/keyboards/rama/u80_a/rules.mk b/keyboards/rama/u80_a/rules.mk index 67b04e350..54479529b 100644 --- a/keyboards/rama/u80_a/rules.mk +++ b/keyboards/rama/u80_a/rules.mk @@ -69,4 +69,3 @@ FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches RAW_ENABLE = yes DYNAMIC_KEYMAP_ENABLE = yes -CIE1931_CURVE = yes \ No newline at end of file -- cgit v1.2.3-24-g4f1b