Skip to content

Commit

Permalink
[Keyboard] Update to ZSA Boards (qmk#10119)
Browse files Browse the repository at this point in the history
  • Loading branch information
drashna committed Sep 30, 2020
1 parent 396b86b commit 454684a
Show file tree
Hide file tree
Showing 41 changed files with 397 additions and 130 deletions.
12 changes: 6 additions & 6 deletions keyboards/ergodox_ez/config.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/*
Copyright 2012 Jun Wako <[email protected]>
Copyright 2013 Oleg Kostyuk <[email protected]>
Copyright 2015 ZSA Technology Labs Inc (@zsa)
Copyright 2020 Christopher Courtney <[email protected]> (@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
Expand All @@ -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
Expand Down Expand Up @@ -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
20 changes: 20 additions & 0 deletions keyboards/ergodox_ez/ergodox_ez.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
/*
Copyright 2012 Jun Wako <[email protected]>
Copyright 2013 Oleg Kostyuk <[email protected]>
Copyright 2015 ZSA Technology Labs Inc (@zsa)
Copyright 2020 Christopher Courtney <[email protected]> (@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);
Expand Down
31 changes: 27 additions & 4 deletions keyboards/ergodox_ez/ergodox_ez.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,36 @@
#ifndef ERGODOX_EZ_H
#define ERGODOX_EZ_H
/*
Copyright 2012 Jun Wako <[email protected]>
Copyright 2013 Oleg Kostyuk <[email protected]>
Copyright 2015 ZSA Technology Labs Inc (@zsa)
Copyright 2020 Christopher Courtney <[email protected]> (@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 )
Expand Down Expand Up @@ -265,5 +290,3 @@ extern keyboard_config_t keyboard_config;
{ R05, R15, R25, R35, R45, R55 }, \
{ R06, R16, R26, R36, R46, KC_NO } \
}

#endif
24 changes: 24 additions & 0 deletions keyboards/ergodox_ez/glow/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
Copyright 2012 Jun Wako <[email protected]>
Copyright 2013 Oleg Kostyuk <[email protected]>
Copyright 2015 ZSA Technology Labs Inc (@zsa)
Copyright 2020 Christopher Courtney <[email protected]> (@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
20 changes: 20 additions & 0 deletions keyboards/ergodox_ez/glow/glow.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
Copyright 2012 Jun Wako <[email protected]>
Copyright 2013 Oleg Kostyuk <[email protected]>
Copyright 2015 ZSA Technology Labs Inc (@zsa)
Copyright 2020 Christopher Courtney <[email protected]> (@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"
File renamed without changes.
6 changes: 6 additions & 0 deletions keyboards/ergodox_ez/glow/keymaps/glow/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
RGBLIGHT_ENABLE = no
RGB_MATRIX_ENABLE = IS31FL3731 # enable later

SRC += keymaps/default/keymap.c

LTO_ENABLE = yes
7 changes: 7 additions & 0 deletions keyboards/ergodox_ez/glow/keymaps/reactive/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
RGBLIGHT_ENABLE = no
RGB_MATRIX_ENABLE = IS31FL3731 # enable later

SRC += keymaps/default/keymap.c

LTO_ENABLE = yes
COMMAND_ENABLE = no
1 change: 1 addition & 0 deletions keyboards/ergodox_ez/glow/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
RGB_MATRIX_ENABLE = IS31FL3731
4 changes: 2 additions & 2 deletions keyboards/ergodox_ez/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 0 additions & 6 deletions keyboards/ergodox_ez/keymaps/glow/rules.mk

This file was deleted.

2 changes: 2 additions & 0 deletions keyboards/ergodox_ez/keymaps/oryx/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -100,6 +101,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#endif
}
return false;
#endif
}
return true;
}
Expand Down
7 changes: 0 additions & 7 deletions keyboards/ergodox_ez/keymaps/reactive/rules.mk

This file was deleted.

2 changes: 2 additions & 0 deletions keyboards/ergodox_ez/keymaps/webusb/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -100,6 +101,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#endif
}
return false;
#endif
}
return true;
}
Expand Down
42 changes: 19 additions & 23 deletions keyboards/ergodox_ez/led_i2c.c
Original file line number Diff line number Diff line change
@@ -1,31 +1,27 @@
/*
* light weight WS2812 lib V2.0b
*
* Controls WS2811/WS2812/WS2812B RGB-LEDs
* Author: Tim ([email protected])
*
* 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 <[email protected]>
Copyright 2013 Oleg Kostyuk <[email protected]>
Copyright 2015 ZSA Technology Labs Inc (@zsa)
Copyright 2020 Christopher Courtney <[email protected]> (@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);
Expand Down
3 changes: 3 additions & 0 deletions keyboards/ergodox_ez/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>
Copyright 2013 Oleg Kostyuk <[email protected]>
Copyright 2015 ZSA Technology Labs Inc (@zsa)
Copyright 2020 Christopher Courtney <[email protected]> (@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
Expand Down
20 changes: 20 additions & 0 deletions keyboards/ergodox_ez/post_config.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
/*
Copyright 2012 Jun Wako <[email protected]>
Copyright 2013 Oleg Kostyuk <[email protected]>
Copyright 2015 ZSA Technology Labs Inc (@zsa)
Copyright 2020 Christopher Courtney <[email protected]> (@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)
Expand Down
54 changes: 31 additions & 23 deletions keyboards/ergodox_ez/readme.md
Original file line number Diff line number Diff line change
@@ -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

For the ErgoDox EZ Shine, and Glow, use one of the following:

- This will result in a hex file called `ergodox_ez_keymapname.hex`, e.g.
`ergodox_ez_default.hex`
make ergodox_ez/shine:default:flash
make ergodox_ez/glow:default:flash

- Start the teensy loader.
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).

- Load the .hex file into it.
## Oryx Configuation

- Press the Reset button by inserting a paperclip gently into the reset hole
in the top right corner.
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.

- Click the button in the Teensy app to download the firmware.
### Indicator LEDs

See also [video demonstration](https://www.youtube.com/watch?v=9PyiGUO9_KQ) using Teensy in auto mode.
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).

To flash with ´teensy-loader-cli´:
Alternatively, you can set the brightness by calling the following functions:

- Build the firmware with `make keymapname`, for example `make default`
```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);
```
- Run ´<path/to/>teensy_loader_cli -mmcu=atmega32u4 -w ergodox_ez_<keymap>.hex´
These settings are not persistent, so you'd need to reset it every time the board starts.
- Press the Reset button by inserting a paperclip gently into the reset hole
in the top right corder.
These are on a 0-255 scale
## Settings
### RGB Matrix Features
You may want to enable QMK_KEYS_PER_SCAN because the Ergodox has a relatively
slow scan rate.
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.
1 change: 0 additions & 1 deletion keyboards/ergodox_ez/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 454684a

Please sign in to comment.