[Keyboard] Update to ZSA Boards (qmk#10119)

This commit is contained in:
Drashna Jael're
2020-09-30 04:32:30 -07:00
parent 396b86b92d
commit 454684a8bb
41 changed files with 397 additions and 130 deletions

View File

@@ -1,6 +1,8 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2013 Oleg Kostyuk <cub.uanic@gmail.com>
Copyright 2015 ZSA Technology Labs Inc (@zsa)
Copyright 2020 Christopher Courtney <drashna@live.com> (@drashna)
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
@@ -21,8 +23,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x1307
#define VENDOR_ID 0x3297
#define PRODUCT_ID 0x4974
#define DEVICE_VER 0x0001
#define MANUFACTURER ZSA Technology Labs Inc
#define PRODUCT ErgoDox EZ
@@ -152,8 +154,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT
//#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION
#define NO_ACTION_MACRO
#define NO_ACTION_FUNCTION
//#define DEBUG_MATRIX_SCAN_RATE
#endif

View File

@@ -1,3 +1,23 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2013 Oleg Kostyuk <cub.uanic@gmail.com>
Copyright 2015 ZSA Technology Labs Inc (@zsa)
Copyright 2020 Christopher Courtney <drashna@live.com> (@drashna)
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 <http://www.gnu.org/licenses/>.
*/
#include "ergodox_ez.h"
extern inline void ergodox_board_led_on(void);

View File

@@ -1,11 +1,36 @@
#ifndef ERGODOX_EZ_H
#define ERGODOX_EZ_H
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2013 Oleg Kostyuk <cub.uanic@gmail.com>
Copyright 2015 ZSA Technology Labs Inc (@zsa)
Copyright 2020 Christopher Courtney <drashna@live.com> (@drashna)
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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "quantum.h"
#include <stdint.h>
#include <stdbool.h>
#include "i2c_master.h"
#if defined(KEYBOARD_ergodox_ez_glow)
# include "glow.h"
#elif defined(KEYBOARD_ergodox_ez_shine)
# include "shine.h"
#endif
// I2C aliases and register addresses (see "mcp23018.md")
#define I2C_ADDR 0b0100000
#define I2C_ADDR_WRITE ( (I2C_ADDR<<1) | I2C_WRITE )
@@ -265,5 +290,3 @@ extern keyboard_config_t keyboard_config;
{ R05, R15, R25, R35, R45, R55 }, \
{ R06, R16, R26, R36, R46, KC_NO } \
}
#endif

View File

@@ -0,0 +1,24 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2013 Oleg Kostyuk <cub.uanic@gmail.com>
Copyright 2015 ZSA Technology Labs Inc (@zsa)
Copyright 2020 Christopher Courtney <drashna@live.com> (@drashna)
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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#undef PRODUCT_ID
#define PRODUCT_ID 0x4976
#undef PRODUCT
#define PRODUCT ErgoDox EZ Glow

View File

@@ -0,0 +1,20 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2013 Oleg Kostyuk <cub.uanic@gmail.com>
Copyright 2015 ZSA Technology Labs Inc (@zsa)
Copyright 2020 Christopher Courtney <drashna@live.com> (@drashna)
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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "ergodox_ez.h"

View File

@@ -0,0 +1,6 @@
RGBLIGHT_ENABLE = no
RGB_MATRIX_ENABLE = IS31FL3731 # enable later
SRC += keymaps/default/keymap.c
LTO_ENABLE = yes

View File

@@ -0,0 +1,7 @@
RGBLIGHT_ENABLE = no
RGB_MATRIX_ENABLE = IS31FL3731 # enable later
SRC += keymaps/default/keymap.c
LTO_ENABLE = yes
COMMAND_ENABLE = no

View File

@@ -0,0 +1 @@
RGB_MATRIX_ENABLE = IS31FL3731

View File

@@ -146,11 +146,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
case VRSN:
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
return false;
#ifdef RGBLIGHT_ENABLE
#ifdef RGBLIGHT_ENABLE
case RGB_SLD:
rgblight_mode(1);
return false;
#endif
#endif
}
}
return true;

View File

@@ -1,6 +0,0 @@
RGBLIGHT_ENABLE = no
RGB_MATRIX_ENABLE = yes # enable later
SRC += ../default/keymap.c
LINK_TIME_OPTIMIZATION_ENABLE = yes

View File

@@ -68,6 +68,7 @@ bool suspended = false;
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
#ifdef RGBLIGHT_ENABLE
case RGB_SLD:
if (record->event.pressed) {
rgblight_mode(1);
@@ -100,6 +101,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#endif
}
return false;
#endif
}
return true;
}

View File

@@ -1,7 +0,0 @@
RGBLIGHT_ENABLE = no
RGB_MATRIX_ENABLE = yes # enable later
SRC += ../default/keymap.c
LINK_TIME_OPTIMIZATION_ENABLE = yes
COMMAND_ENABLE = no

View File

@@ -68,6 +68,7 @@ bool suspended = false;
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
#ifdef RGBLIGHT_ENABLE
case RGB_SLD:
if (record->event.pressed) {
rgblight_mode(1);
@@ -100,6 +101,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#endif
}
return false;
#endif
}
return true;
}

View File

@@ -1,31 +1,27 @@
/*
* light weight WS2812 lib V2.0b
*
* Controls WS2811/WS2812/WS2812B RGB-LEDs
* Author: Tim (cpldcpu@gmail.com)
*
* Jan 18th, 2014 v2.0b Initial Version
* Nov 29th, 2015 v2.3 Added SK6812RGBW support
*
* 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 <http://www.gnu.org/licenses/>.
*/
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2013 Oleg Kostyuk <cub.uanic@gmail.com>
Copyright 2015 ZSA Technology Labs Inc (@zsa)
Copyright 2020 Christopher Courtney <drashna@live.com> (@drashna)
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 <http://www.gnu.org/licenses/>.
*/
#ifdef RGBLIGHT_ENABLE
# include "ergodox_ez.h"
extern rgblight_config_t rgblight_config;
void rgblight_call_driver(LED_TYPE *led, uint8_t led_num) {
i2c_init();
i2c_start(0x84, ERGODOX_EZ_I2C_TIMEOUT);

View File

@@ -5,7 +5,10 @@ This is not a file you want to be messing with.
All of the interesting stuff for you is under keymaps/ :)
Love, Erez
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2013 Oleg Kostyuk <cub.uanic@gmail.com>
Copyright 2015 ZSA Technology Labs Inc (@zsa)
Copyright 2020 Christopher Courtney <drashna@live.com> (@drashna)
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

View File

@@ -1,3 +1,23 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2013 Oleg Kostyuk <cub.uanic@gmail.com>
Copyright 2015 ZSA Technology Labs Inc (@zsa)
Copyright 2020 Christopher Courtney <drashna@live.com> (@drashna)
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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#if !defined(ERGODOX_LED_15) && !defined(ERGODOX_LED_30)

View File

@@ -1,41 +1,49 @@
# ErgoDox EZ
The Ez uses the [Teensy Loader](https://www.pjrc.com/teensy/loader.html).
![ErgoDox EZ](http://www.coolthings.com/wp-content/uploads/2017/05/ergodox-ez-2.jpg)
Linux users need to modify udev rules as described on the [Teensy
Linux page]. Some distributions provide a binary, maybe called
`teensy-loader-cli`.
The ErgoDox EZ is a mass produced version of the original ErgoDox keyboard, with optional support for RGB Light (Shine) or RGB Matrix (Glow).
[Teensy Linux page]: https://www.pjrc.com/teensy/loader_linux.html
* Keyboard Maintainer: [ZSA Technology Labs Inc](https://github.com/zsa), Firmware maintained by [drashna](https://github.com/drashna)
* Hardware Supported: Original ErgoDox, ErgoDox EZ
* Hardware Availability: [ErgoDox EZ](https://ergodox-ez.com/), [ErgoDox.io](https://ergodox.io)
To flash the firmware:
Make example for this keyboard (after setting up your build environment):
- Build the firmware with `make <keyboardname>:<keymapname>`, for example `make ergodox_ez:default`
make ergodox_ez:default:flash
- This will result in a hex file called `ergodox_ez_keymapname.hex`, e.g.
`ergodox_ez_default.hex`
For the ErgoDox EZ Shine, and Glow, use one of the following:
- Start the teensy loader.
make ergodox_ez/shine:default:flash
make ergodox_ez/glow:default:flash
- Load the .hex file into it.
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).
- Press the Reset button by inserting a paperclip gently into the reset hole
in the top right corner.
## Oryx Configuation
- Click the button in the Teensy app to download the firmware.
If you have `ORYX_CONFIGURATOR` defined in your keymap's `config.h`, this enables a number of the built in options from the Oryx Configurator.
See also [video demonstration](https://www.youtube.com/watch?v=9PyiGUO9_KQ) using Teensy in auto mode.
### Indicator LEDs
To flash with ´teensy-loader-cli´:
You can use the `LED_LEVEL` keycode to cycle through the brightness levels for the LEDs on the top right of the keyboard. These settings are saved in eeprom (persistant memory).
- Build the firmware with `make keymapname`, for example `make default`
Alternatively, you can set the brightness by calling the following functions:
- Run ´<path/to/>teensy_loader_cli -mmcu=atmega32u4 -w ergodox_ez_<keymap>.hex´
```c
void ergodox_led_all_set(uint8_t level);
void ergodox_right_led_1_set(uint8_t level);
void ergodox_right_led_2_set(uint8_t level);
void ergodox_right_led_3_set(uint8_t level);
```
- Press the Reset button by inserting a paperclip gently into the reset hole
in the top right corder.
These settings are not persistent, so you'd need to reset it every time the board starts.
## Settings
These are on a 0-255 scale
You may want to enable QMK_KEYS_PER_SCAN because the Ergodox has a relatively
slow scan rate.
### RGB Matrix Features
If you're using the Smart LED (layer indication) feature from the Oryx Configurator, you want to make sure that you enable these options by adding `#define ORYX_CONFIGURATOR` to your keymap's `config.h`.
This changes the `RGB_TOG` keycode so that it will toggle the lights on and off, in a way that will allow the Smart LEDs to continue to work, even with the rest of the LEDs turned off.
Additionally, a new keycode has been added to toggle the Smart LEDs. Use `TOGGLE_LAYER_COLOR`, if you aren't already.

View File

@@ -30,7 +30,6 @@ UNICODE_ENABLE = yes # Unicode
SWAP_HANDS_ENABLE= yes # Allow swapping hands of keyboard
SLEEP_LED_ENABLE = no
API_SYSEX_ENABLE = no
RGBLIGHT_ENABLE = yes
RGB_MATRIX_ENABLE = no # enable later
DEBOUNCE_TYPE = eager_pr

View File

@@ -0,0 +1,23 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2013 Oleg Kostyuk <cub.uanic@gmail.com>
Copyright 2015 ZSA Technology Labs Inc (@zsa)
Copyright 2020 Christopher Courtney <drashna@live.com> (@drashna)
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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#undef PRODUCT_ID
#define PRODUCT_ID 0x4975
#undef PRODUCT
#define PRODUCT ErgoDox EZ Shine

View File

@@ -0,0 +1 @@
RGBLIGHT_ENABLE = yes

View File

@@ -0,0 +1,20 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2013 Oleg Kostyuk <cub.uanic@gmail.com>
Copyright 2015 ZSA Technology Labs Inc (@zsa)
Copyright 2020 Christopher Courtney <drashna@live.com> (@drashna)
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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "ergodox_ez.h"

View File

@@ -78,10 +78,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT
#ifndef LINK_TIME_OPTIMIZATION_ENABLE
# define NO_ACTION_MACRO
# define NO_ACTION_FUNCTION
#endif
#define I2C1_CLOCK_SPEED 400000

View File

@@ -1,79 +1,73 @@
/*
Copyright 2018 Jack Humbert <jack.humb@gmail.com>
/* Copyright 2020 ZSA Technology Labs, Inc <@zsa>
* Copyright 2020 Jack Humbert <jack.humb@gmail.com>
* Copyright 2020 Christopher Courtney <drashna@live.com> (@drashna)
*
* 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 <http://www.gnu.org/licenses/>.
*/
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 <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
#include "version.h"
enum layers {
BASE, // default layer
SYMB, // symbols
MDIA, // media keys
BASE, // default layer
SYMB, // symbols
MDIA, // media keys
};
enum custom_keycodes {
EPRM = ML_SAFE_RANGE,
VRSN,
VRSN = ML_SAFE_RANGE,
};
// clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[BASE] = LAYOUT_moonlander(
KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HYPR, KC_MEH, KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN), GUI_T(KC_QUOT),
KC_LSFT, LCTL_T(KC_Z),KC_X,KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, LCTL_T(KC_SLSH), KC_LSFT,
LT(SYMB,KC_GRV),WEBUSB_PAIR,A(KC_LSFT),KC_LEFT, KC_RGHT, LALT_T(KC_APP), RCTL_T(KC_ESC), KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, TT(SYMB),
KC_SPC, KC_BSPC, KC_LGUI, KC_RALT, KC_TAB, KC_ENT
KC_DEL, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HYPR, KC_MEH, KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN), LGUI_T(KC_QUOT),
KC_LSFT, LCTL_T(KC_Z),KC_X,KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RCTL_T(KC_SLSH), KC_RSFT,
LT(SYMB,KC_GRV),WEBUSB_PAIR,A(KC_LSFT),KC_LEFT, KC_RGHT, LALT_T(KC_APP), RCTL_T(KC_ESC), KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, MO(SYMB),
KC_SPC, KC_BSPC, KC_LGUI, KC_LALT, KC_TAB, KC_ENT
),
[SYMB] = LAYOUT_moonlander(
VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
KC_TRNS, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_TRNS, KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12,
KC_TRNS, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, KC_TRNS, KC_TRNS, KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS,
KC_TRNS, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS,
EPRM, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAI, RGB_TOG, KC_TRNS, KC_DOT, KC_0, KC_EQL, KC_TRNS,
RGB_HUD, RGB_VAD, RGB_HUI, TOGGLE_LAYER_COLOR,KC_TRNS, KC_TRNS
VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
_______, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, _______, _______, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12,
_______, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, _______, _______, KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, _______,
_______, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, _______,
EEP_RST, _______, _______, _______, _______, RGB_VAI, RGB_TOG, _______, KC_DOT, KC_0, KC_EQL, _______,
RGB_HUD, RGB_VAD, RGB_HUI, TOGGLE_LAYER_COLOR,_______, _______
),
[MDIA] = LAYOUT_moonlander(
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, KC_TRNS, KC_TRNS, KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
LED_LEVEL,_______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET,
_______, _______, _______, KC_MS_U, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY,
_______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, _______, _______,
_______, _______, _______, KC_BTN1, KC_BTN2, _______, _______, KC_VOLU, KC_VOLD, KC_MUTE, _______, _______,
_______, _______, _______, _______, _______, _______
),
};
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
switch (keycode) {
case EPRM:
eeconfig_init();
return false;
case VRSN:
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
return false;
#ifdef RGBLIGHT_ENABLE
case RGB_SLD:
rgblight_mode(1);
return false;
#endif
if (record->event.pressed) {
switch (keycode) {
case VRSN:
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
return false;
}
}
}
return true;
return true;
}

View File

@@ -161,9 +161,10 @@ void keyboard_pre_init_kb(void) {
keyboard_pre_init_user();
}
#if !defined(MOONLANDER_USER_LEDS)
layer_state_t layer_state_set_kb(layer_state_t state) {
state = layer_state_set_user(state);
if (is_launching) return state;
if (is_launching || !keyboard_config.led_level) return state;
ML_LED_1(false);
ML_LED_2(false);
@@ -201,6 +202,7 @@ layer_state_t layer_state_set_kb(layer_state_t state) {
return state;
}
#endif
#ifdef RGB_MATRIX_ENABLE
// clang-format off
@@ -417,6 +419,24 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
layer_state_set_kb(layer_state);
break;
#endif
#if !defined(MOONLANDER_USER_LEDS)
case LED_LEVEL:
if (record->event.pressed) {
keyboard_config.led_level ^= 1;
eeconfig_update_kb(keyboard_config.raw);
if (keyboard_config.led_level) {
layer_state_set_kb(layer_state);
} else {
ML_LED_1(false);
ML_LED_2(false);
ML_LED_3(false);
ML_LED_4(false);
ML_LED_5(false);
ML_LED_6(false);
}
}
break;
#endif
#ifdef RGB_MATRIX_ENABLE
case TOGGLE_LAYER_COLOR:
if (record->event.pressed) {
@@ -452,6 +472,12 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
void matrix_init_kb(void) {
keyboard_config.raw = eeconfig_read_kb();
if (!keyboard_config.led_level && !keyboard_config.led_level_res) {
keyboard_config.led_level = true;
keyboard_config.led_level_res = 0b11;
eeconfig_update_kb(keyboard_config.raw);
}
#ifdef RGB_MATRIX_ENABLE
if (keyboard_config.rgb_matrix_enable) {
rgb_matrix_set_flags(LED_FLAG_ALL);
@@ -464,6 +490,8 @@ void matrix_init_kb(void) {
void eeconfig_init_kb(void) { // EEPROM is getting reset!
keyboard_config.raw = 0;
keyboard_config.rgb_matrix_enable = true;
keyboard_config.led_level = true;
keyboard_config.led_level_res = 0b11;
eeconfig_update_kb(keyboard_config.raw);
eeconfig_init_user();
}

View File

@@ -57,6 +57,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
enum planck_ez_keycodes {
TOGGLE_LAYER_COLOR = SAFE_RANGE,
LED_LEVEL,
ML_SAFE_RANGE,
};
@@ -65,6 +66,8 @@ typedef union {
struct {
bool disable_layer_led :1;
bool rgb_matrix_enable :1;
bool led_level :1;
uint8_t led_level_res :2; // DO NOT REMOVE
};
} keyboard_config_t;

View File

@@ -18,8 +18,12 @@
#pragma once
/* USB Device descriptor parameter */
#undef VENDOR_ID
#define VENDOR_ID 0x3297
#undef PRODUCT_ID
#define PRODUCT_ID 0xC6CE
#undef MANUFACTURER
#define MANUFACTURER ZSA
#define MANUFACTURER ZSA Technology Labs
#undef PRODUCT
#define PRODUCT Planck EZ
#define DEVICE_VER 0x0000

View File

@@ -19,7 +19,6 @@
keyboard_config_t keyboard_config;
#ifdef RGB_MATRIX_ENABLE
void suspend_power_down_kb(void) {
rgb_matrix_set_suspend_state(true);

View File

@@ -17,6 +17,10 @@
#include "planck.h"
#ifdef KEYBOARD_planck_ez_glow
# include "glow.h"
#endif
#define LAYOUT_planck_1x2uC( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \

View File

@@ -0,0 +1,24 @@
/*
* Copyright 2018 Jack Humbert <jack.humb@gmail.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#undef PRODUCT_ID
#define PRODUCT_ID 0xC6CF
#undef PRODUCT
#define PRODUCT Planck EZ Glow

View File

@@ -0,0 +1,3 @@
#pragma once
#include "ez.h"

View File

@@ -0,0 +1 @@
RGB_MATRIX_ENABLE = IS31FL3737

View File

@@ -13,3 +13,50 @@ Make example for this keyboard (after setting up your build environment):
make planck/ez: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).
# Planck EZ Glow
For the per key RGB version of this keyboard, you want to use the "glow" subdirectory. For example:
make planck/ez/glow:default
## Planck EZ Configuration (from Oryx)
### Indicator LEDs
The two front "teeth" LED indicators are PWM controlled. If you have `ORYX_CONFIGURATOR` defined in your keymap's `config.h`, you can use the `LED_LEVEL` to cycle through preset vales (0, 25%, 50%, 75%, 100%), and will be saved to EEPROM (persistent storage)
Alternatively, you can set the brightness by calling the following functions:
```c
void planck_ez_right_led_level(uint8_t level);
void planck_ez_left_led_level(uint8_t level);
```
These settings are not persistent, so you'd need to reset it every time the board starts.
These are on a 0-255 scale
#### Layer indication
By default, the indicator lights are used for layer indication, expecting the specific layers used in the default keymap. However, this may not work for you. And if that is the case, you can add `#define PLANCK_EZ_USER_LEDS` to your `config.h` file.
This will remove the default behavior for changing the LEDs based on layer, and allow you to control them manually.
Alternatively, you can use the following defines in your keymap's `config.h` to control which layers are used, as long as you have `ORYX_CONFIGURATOR` defined in your keymap's `config.h` file, as well.
```c
#define PLANCK_EZ_LED_LOWER 3
#define PLANCK_EZ_LED_RAISE 4
#define PLANCK_EZ_LED_ADJUST 6
```
This will allow you to change the layers that are used, without having to add anything code to your `keymap.c`
### RGB Matrix Features
If you're using the Smart LED (layer indication) feature from the Oryx Configurator, you want to make sure that you enable these options by adding `#define ORYX_CONFIGURATOR` to your keymap's `config.h`.
This changes the `RGB_TOG` keycode so that it will toggle the lights on and off, in a way that will allow the Smart LEDs to continue to work, even with the rest of the LEDs turned off.
Additionally, a new keycode has been added to toggle the Smart LEDs. Use `TOGGLE_LAYER_COLOR`, if you aren't already.

View File

@@ -13,11 +13,9 @@ CONSOLE_ENABLE = no # Console for debug
COMMAND_ENABLE = no # Commands for debug and configuration
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
NKRO_ENABLE = yes # USB Nkey Rollover
CUSTOM_MATRIX = no # Custom matrix file
AUDIO_ENABLE = yes
RGBLIGHT_ENABLE = no
# SERIAL_LINK_ENABLE = yes
ENCODER_ENABLE = yes
RGB_MATRIX_ENABLE = IS31FL3737
LAYOUTS += ortho_4x12

View File

@@ -53,11 +53,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
eeconfig_init();
}
return false;
#ifdef RGBLIGHT_ENABLE
case RGB_SLD:
if (record->event.pressed) {
rgblight_mode(1);
}
return false;
#endif
}
return true;
}