1
0
Fork 0

Keyboards/zsa updates (#9214)

This commit is contained in:
Drashna Jaelre 2020-05-28 01:26:53 -07:00 committed by GitHub
parent 13206b2f87
commit 5263dfd465
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 76 additions and 107 deletions

View file

@ -16,8 +16,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef ERGODOX_EZ_CONFIG_H #pragma once
#define ERGODOX_EZ_CONFIG_H
#include "config_common.h" #include "config_common.h"
@ -25,9 +24,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define VENDOR_ID 0xFEED #define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x1307 #define PRODUCT_ID 0x1307
#define DEVICE_VER 0x0001 #define DEVICE_VER 0x0001
#define MANUFACTURER ErgoDox EZ #define MANUFACTURER ZSA Technology Labs Inc
#define PRODUCT ErgoDox EZ #define PRODUCT ErgoDox EZ
#define DESCRIPTION QMK keyboard firmware for Ergodox EZ
/* key matrix size */ /* key matrix size */
#define MATRIX_ROWS 14 #define MATRIX_ROWS 14
@ -149,5 +147,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
//#define NO_ACTION_MACRO //#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION //#define NO_ACTION_FUNCTION
//#define DEBUG_MATRIX_SCAN_RATE //#define DEBUG_MATRIX_SCAN_RATE
#endif

View file

@ -1,5 +1,4 @@
#ifndef ERGODOX_EZ_H #pragma once
#define ERGODOX_EZ_H
#include "quantum.h" #include "quantum.h"
#include <stdint.h> #include <stdint.h>
@ -65,8 +64,7 @@ inline void ergodox_left_led_2_off(void) { ergodox_left_led_2 = 0; }
inline void ergodox_left_led_3_off(void) { ergodox_left_led_3 = 0; } inline void ergodox_left_led_3_off(void) { ergodox_left_led_3 = 0; }
#endif // LEFT_LEDS #endif // LEFT_LEDS
inline void ergodox_led_all_on(void) inline void ergodox_led_all_on(void) {
{
ergodox_board_led_on(); ergodox_board_led_on();
ergodox_right_led_1_on(); ergodox_right_led_1_on();
ergodox_right_led_2_on(); ergodox_right_led_2_on();
@ -100,19 +98,20 @@ inline void ergodox_right_led_set(uint8_t led, uint8_t n) {
(OCR1C = n); (OCR1C = n);
} }
inline void ergodox_led_all_set(uint8_t n) inline void ergodox_led_all_set(uint8_t n) {
{
ergodox_right_led_1_set(n); ergodox_right_led_1_set(n);
ergodox_right_led_2_set(n); ergodox_right_led_2_set(n);
ergodox_right_led_3_set(n); ergodox_right_led_3_set(n);
} }
#ifdef ORYX_CONFIGURATOR
enum ergodox_ez_keycodes { enum ergodox_ez_keycodes {
LED_LEVEL = SAFE_RANGE, LED_LEVEL = SAFE_RANGE,
TOGGLE_LAYER_COLOR, TOGGLE_LAYER_COLOR,
EZ_SAFE_RANGE, EZ_SAFE_RANGE,
}; };
#ifndef WEBUSB_ENABLE
# define WEBUSB_PAIR KC_NO
#endif #endif
typedef union { typedef union {
@ -271,5 +270,3 @@ extern keyboard_config_t keyboard_config;
{ R05, R15, R25, R35, R45, R55 }, \ { R05, R15, R25, R35, R45, R55 }, \
{ R06, R16, R26, R36, R46, KC_NO } \ { R06, R16, R26, R36, R46, KC_NO } \
} }
#endif

View file

@ -1,7 +1,8 @@
{ {
"keyboard_name": "ErgoDox EZ", "keyboard_name": "ErgoDox EZ",
"url": "ergodox-ez.com", "url": "ergodox-ez.com",
"maintainer": "ZSA", "maintainer": "ZSA via Drashna",
"manufacturer": "ZSA Technology Labs Inc",
"width": 17, "width": 17,
"height": 8, "height": 8,

View file

@ -1,17 +1,18 @@
#include QMK_KEYBOARD_H #include QMK_KEYBOARD_H
#include "version.h" #include "version.h"
#define BASE 0 // default layer enum layers {
#define SYMB 1 // symbols BASE, // default layer
#define MDIA 2 // media keys SYMB, // symbols
MDIA, // media keys
};
enum custom_keycodes { enum custom_keycodes {
#ifdef ORYX_CONFIGURATOR #ifdef ORYX_CONFIGURATOR
EPRM = EZ_SAFE_RANGE, VRSN = EZ_SAFE_RANGE,
#else #else
EPRM = SAFE_RANGE, VRSN = SAFE_RANGE,
#endif #endif
VRSN,
RGB_SLD RGB_SLD
}; };
@ -37,25 +38,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | |ace | End | | PgDn | | | * | |ace | End | | PgDn | | |
* `--------------------' `----------------------' * `--------------------' `----------------------'
*/ */
[BASE] = LAYOUT_ergodox( [BASE] = LAYOUT_ergodox_pretty(
// left hand // left hand
KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, 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_DEL, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), 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_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN), GUI_T(KC_QUOT),
KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), MEH_T(KC_NO), KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLSH), KC_RSFT,
LT(SYMB,KC_GRV), KC_QUOT, LALT(KC_LSFT), KC_LEFT, KC_RGHT, LT(SYMB,KC_GRV), KC_QUOT, LALT(KC_LSFT), KC_LEFT, KC_RGHT, KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, TT(SYMB),
ALT_T(KC_APP), KC_LGUI, ALT_T(KC_APP), KC_LGUI, KC_LALT, CTL_T(KC_ESC),
KC_HOME, KC_HOME, KC_PGUP,
KC_SPC, KC_BSPC, KC_END, KC_SPC, KC_BSPC, KC_END, KC_PGDN, KC_TAB, KC_ENT
// right hand
KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN), GUI_T(KC_QUOT),
MEH_T(KC_NO), KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLSH), KC_RSFT,
KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, TT(SYMB),
KC_LALT, CTL_T(KC_ESC),
KC_PGUP,
KC_PGDN, KC_TAB, KC_ENT
), ),
/* Keymap 1: Symbol Layer /* Keymap 1: Symbol Layer
* *
@ -78,25 +70,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | * | | | | | | | |
* `--------------------' `--------------------' * `--------------------' `--------------------'
*/ */
[SYMB] = LAYOUT_ergodox( [SYMB] = LAYOUT_ergodox_pretty(
// left hand // left hand
VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, 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_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_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, 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_TRNS, KC_TRNS, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_TRNS, KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS,
EPRM, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, EEP_RST, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DOT, KC_0, KC_EQL, KC_TRNS,
RGB_MOD, KC_TRNS, RGB_MOD, KC_TRNS, RGB_TOG, RGB_SLD,
KC_TRNS, KC_TRNS, KC_TRNS,
RGB_VAD, RGB_VAI, KC_TRNS, RGB_VAD, RGB_VAI, KC_TRNS, KC_TRNS, RGB_HUD, RGB_HUI
// right hand
KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12,
KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS,
KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS,
KC_TRNS, KC_DOT, KC_0, KC_EQL, KC_TRNS,
RGB_TOG, RGB_SLD,
KC_TRNS,
KC_TRNS, RGB_HUD, RGB_HUI
), ),
/* Keymap 2: Media and mouse keys /* Keymap 2: Media and mouse keys
* *
@ -119,34 +102,23 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | * | | | | | | | |
* `--------------------' `--------------------' * `--------------------' `--------------------'
*/ */
[MDIA] = LAYOUT_ergodox( [MDIA] = LAYOUT_ergodox_pretty(
// left hand // left hand
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_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_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_MS_L, KC_MS_D, KC_MS_R, 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_TRNS, 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_TRNS, KC_BTN1, KC_BTN2, KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
// right hand KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_WBAK
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 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_MPRV, KC_MNXT, 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_WBAK
), ),
}; };
bool process_record_user(uint16_t keycode, keyrecord_t *record) { bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) { if (record->event.pressed) {
switch (keycode) { switch (keycode) {
case EPRM:
eeconfig_init();
return false;
case VRSN: case VRSN:
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
return false; return false;
@ -161,7 +133,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
} }
// Runs just one time when the keyboard initializes. // Runs just one time when the keyboard initializes.
void matrix_init_user(void) { void keyboard_post_init_user(void) {
#ifdef RGBLIGHT_COLOR_LAYER_0 #ifdef RGBLIGHT_COLOR_LAYER_0
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_0); rgblight_setrgb(RGBLIGHT_COLOR_LAYER_0);
#endif #endif
@ -179,10 +151,6 @@ layer_state_t layer_state_set_user(layer_state_t state) {
case 0: case 0:
#ifdef RGBLIGHT_COLOR_LAYER_0 #ifdef RGBLIGHT_COLOR_LAYER_0
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_0); rgblight_setrgb(RGBLIGHT_COLOR_LAYER_0);
#else
#ifdef RGBLIGHT_ENABLE
rgblight_init();
#endif
#endif #endif
break; break;
case 1: case 1:

View file

@ -1,41 +1,44 @@
# ErgoDox EZ # 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 The ErgoDox EZ is a mass produced version of the original ErgoDox keyboard, with optional support for RGB Light (Shine) or RGB Matrix (Glow).
Linux page]. Some distributions provide a binary, maybe called
`teensy-loader-cli`.
[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. 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).
`ergodox_ez_default.hex`
- Start the teensy loader. ## Oryx Configuation
- Load the .hex file into it. 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.
- Press the Reset button by inserting a paperclip gently into the reset hole ### Indicator LEDs
in the top right corner.
- Click the button in the Teensy app to download the firmware. 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).
See also [video demonstration](https://www.youtube.com/watch?v=9PyiGUO9_KQ) using Teensy in auto mode. Alternatively, you can set the brightness by calling the following functions:
To flash with ´teensy-loader-cli´: ```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);
```
- Build the firmware with `make keymapname`, for example `make default` These settings are not persistent, so you'd need to reset it every time the board starts.
- Run ´<path/to/>teensy_loader_cli -mmcu=atmega32u4 -w ergodox_ez_<keymap>.hex´ These are on a 0-255 scale
- Press the Reset button by inserting a paperclip gently into the reset hole ### RGB Matrix Features
in the top right corder.
## Settings 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`.
You may want to enable QMK_KEYS_PER_SCAN because the Ergodox has a relatively 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.
slow scan rate.
Additionally, a new keycode has been added to toggle the Smart LEDs. Use `TOGGLE_LAYER_COLOR`, if you aren't already.

View file

@ -64,6 +64,10 @@ enum planck_ez_keycodes {
EZ_SAFE_RANGE, EZ_SAFE_RANGE,
}; };
#ifndef WEBUSB_ENABLE
# define WEBUSB_PAIR KC_NO
#endif
typedef union { typedef union {
uint32_t raw; uint32_t raw;
struct { struct {