Helix oled rgb compile sw (#2606)
authorMakotoKurauchi <pluis@me.com>
Tue, 24 Apr 2018 16:43:57 +0000 (01:43 +0900)
committerDrashna Jaelre <drashna@live.com>
Tue, 24 Apr 2018 16:43:57 +0000 (09:43 -0700)
* Helix keyboard OLED, RGBLIGHT enable/disable control integrate into rules.mk

rules.mk: add 4 Variables for compile control.

   # Helix keyboard customize
   # you can edit follows 4 Variables
   #  jp: 以下の4つの変数を必要に応じて編集します。
   OLED_ENABLE = no            # OLED_ENABLE
   LED_BACK_ENABLE = no        # LED backlight (Enable WS2812 RGB underlight.)
   LED_UNDERGLOW_ENABLE = no   # LED underglow (Enable WS2812 RGB underlight.)
   LED_ANIMATIONS = yes        # LED animations

config.h: auto set RGBLED_NUM by HELIX_ROWS and rules.mk's define

* HELIX_ROWS define move from config.h to rules.mk

* add readme.md

* rename readme.md to readme_jp.md

* add readme.md and modify readme_jp.md

keyboards/helix/rev2/config.h
keyboards/helix/rev2/keymaps/default/config.h
keyboards/helix/rev2/keymaps/default/readme.md
keyboards/helix/rev2/keymaps/default/readme_jp.md [new file with mode: 0644]
keyboards/helix/rev2/keymaps/default/rules.mk

index 5905627..e8ad1b9 100644 (file)
@@ -56,7 +56,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 /* ws2812 RGB LED */
 #define RGB_DI_PIN D3
 #define RGBLIGHT_TIMER
-#define RGBLED_NUM 12    // Number of LEDs
+//#define RGBLED_NUM 12    // Number of LEDs. see ./keymaps/default/config.h
 #define ws2812_PORTREG  PORTD
 #define ws2812_DDRREG   DDRD
 
index 53ff0b3..66c9b9e 100644 (file)
@@ -36,11 +36,14 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 // #define EE_HANDS
 
 // Helix keyboard OLED support
-//#define SSD1306OLED
+//      see ./rules.mk: OLED_ENABLE=yes or no
+#ifdef OLED_ENABLE
+  #define SSD1306OLED
+#endif
 
 /* Select rows configuration */
 // Rows are 4 or 5
-#define HELIX_ROWS 5
+// #define HELIX_ROWS 5 see ./rules.mk
 
 /* key matrix size */
 // Rows are doubled-up
@@ -62,12 +65,19 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define TAPPING_FORCE_HOLD
 #define TAPPING_TERM 100
 
+// Helix keyboard RGB LED support
+//#define RGBLIGHT_ANIMATIONS : see ./rules.mk: LED_ANIMATIONS = yes or no
+//    see ./rules.mk: LED_BACK_ENABLE or LED_UNDERGLOW_ENABLE set yes
+#ifdef RGBLED_BACK
+  #if HELIX_ROWS == 4
+    #define RGBLED_NUM 25
+  #elif HELIX_ROWS == 5
+    #define RGBLED_NUM 32
+  #endif
+#else
+  #define RGBLED_NUM 6
+#endif
 
-#undef RGBLED_NUM
-#define RGBLIGHT_ANIMATIONS
-// Helix keyboard : see ./rules.mk: RGBLIGHT_ENABLE = yes or no
-// Helix keyboard : RGBLED_NUM 6 or 32
-#define RGBLED_NUM 6
 #if RGBLED_NUM <= 6
   #define RGBLIGHT_LIMIT_VAL 255
 #else
dissimilarity index 97%
index 0288885..307e5c3 100644 (file)
-SSD1306 OLED Display via I2C
-======
-
-Features
---------
-
-Some features supported by the firmware:
-
-
-* I2C connection between the two halves is required as the OLED display will use this connection as well. Note this
-  requires pull-up resistors on the data and clock lines.
-* OLED display will connect from either side
-
-
-Wiring
-------
-
-
-Work in progress...
-
-
-OLED Configuration
--------------------------------
-
-Work in progress...
+# The Default Helix Layout
+## Layout
+
+### Qwerty
+
+```
+ ,-----------------------------------------.             ,-----------------------------------------.
+ |   `  |   1  |   2  |   3  |   4  |   5  |             |   6  |   7  |   8  |   9  |   0  | Del  |
+ |------+------+------+------+------+------|             |------+------+------+------+------+------|
+ | Tab  |   Q  |   W  |   E  |   R  |   T  |             |   Y  |   U  |   I  |   O  |   P  | Bksp |
+ |------+------+------+------+------+------|             |------+------+------+------+------+------|
+ | Ctrl |   A  |   S  |   D  |   F  |   G  |             |   H  |   J  |   K  |   L  |   ;  |  '   |
+ |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
+ | Shift|   Z  |   X  |   C  |   V  |   B  |   [  |   ]  |   N  |   M  |   ,  |   .  |   /  |Enter |
+ |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
+ |Adjust| Esc  | Alt  | GUI  | EISU |Lower |Space |Space |Raise | KANA | Left | Down |  Up  |Right |
+ `-------------------------------------------------------------------------------------------------'
+```
+
+### Colemak
+```
+ ,-----------------------------------------.             ,-----------------------------------------.
+ |   `  |   1  |   2  |   3  |   4  |   5  |             |   6  |   7  |   8  |   9  |   0  | Del  |
+ |------+------+------+------+------+------|             |------+------+------+------+------+------|
+ | Tab  |   Q  |   W  |   F  |   P  |   G  |             |   J  |   L  |   U  |   Y  |   ;  | Bksp |
+ |------+------+------+------+------+------|             |------+------+------+------+------+------|
+ | Ctrl |   A  |   R  |   S  |   T  |   D  |             |   H  |   N  |   E  |   I  |   O  |  '   |
+ |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
+ | Shift|   Z  |   X  |   C  |   V  |   B  |   [  |   ]  |   K  |   M  |   ,  |   .  |   /  |Enter |
+ |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
+ |Adjust| Esc  | Alt  | GUI  | EISU |Lower |Space |Space |Raise | KANA | Left | Down |  Up  |Right |
+ `-------------------------------------------------------------------------------------------------'
+```
+
+### Dvorak
+```
+ ,-----------------------------------------.             ,-----------------------------------------.
+ |   `  |   1  |   2  |   3  |   4  |   5  |             |   6  |   7  |   8  |   9  |   0  | Bksp |
+ |------+------+------+------+------+------|             |------+------+------+------+------+------|
+ | Tab  |   '  |   ,  |   .  |   P  |   Y  |             |   F  |   G  |   C  |   R  |   L  | Del  |
+ |------+------+------+------+------+------|             |------+------+------+------+------+------|
+ | Ctrl |   A  |   O  |   E  |   U  |   I  |             |   D  |   H  |   T  |   N  |   S  |  /   |
+ |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
+ | Shift|   ;  |   Q  |   J  |   K  |   X  |   [  |   ]  |   B  |   M  |   W  |   V  |   Z  |Enter |
+ |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
+ |Adjust| Esc  | Alt  | GUI  | EISU |Lower |Space |Space |Raise | KANA | Left | Down |  Up  |Right |
+ `-------------------------------------------------------------------------------------------------'
+```
+
+## Layers
+
+|Priority|number|name|description|
+| ---- | ---- | --- | --- |
+|high|16|Adjust|Functions|
+||4|Raise|Numeric charactors|
+||3|Lower|Other charactors|
+||2|Dvorak|Dvorak leyout|
+||1|Colemak|Colemak leyout|
+|low|0|Qwerty|QWERTY leyout(base)|
+
+### Lower
+```
+ ,-----------------------------------------.             ,-----------------------------------------.
+ |   ~  |   !  |   @  |   #  |   $  |   %  |             |   ^  |   &  |   *  |   (  |   )  |      |
+ |------+------+------+------+------+------|             |------+------+------+------+------+------|
+ |   ~  |   !  |   @  |   #  |   $  |   %  |             |   ^  |   &  |   *  |   (  |   )  |      |
+ |------+------+------+------+------+------|             |------+------+------+------+------+------|
+ |      |  F1  |  F2  |  F3  |  F4  |  F5  |             |  F6  |   _  |   +  |   {  |   }  |  |   |
+ |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
+ |      |  F7  |  F8  |  F9  |  F10 |  F11 |  (   |   )  |  F12 |      |      | Home | End  |      |
+ |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
+ |      |      |      |      |      |      |      |      |      |      | Next | Vol- | Vol+ | Play |
+ `-------------------------------------------------------------------------------------------------'
+```
+
+### Raise
+```
+ ,-----------------------------------------.             ,-----------------------------------------.
+ |   `  |   1  |   2  |   3  |   4  |   5  |             |   6  |   7  |   8  |   9  |   0  | Bksp |
+ |------+------+------+------+------+------|             |------+------+------+------+------+------|
+ |   `  |   1  |   2  |   3  |   4  |   5  |             |   6  |   7  |   8  |   9  |   0  | Del  |
+ |------+------+------+------+------+------|             |------+------+------+------+------+------|
+ |      |  F1  |  F2  |  F3  |  F4  |  F5  |             |  F6  |   -  |   =  |   [  |   ]  |  \   |
+ |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
+ |      |  F7  |  F8  |  F9  |  F10 |  F11 |      |      |  F12 |      |      |PageDn|PageUp|      |
+ |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
+ |      |      |      |      |      |      |      |      |      |      | Next | Vol- | Vol+ | Play |
+ `-------------------------------------------------------------------------------------------------'
+```
+
+### Adjust (Lower + Raise)
+```
+ ,-----------------------------------------.             ,-----------------------------------------.
+ |  F1  |  F2  |  F3  |  F4  |  F5  |  F6  |             |  F7  |  F8  |  F9  |  F10 |  F11 |  F12 |
+ |------+------+------+------+------+------|             |------+------+------+------+------+------|
+ |      | Reset|RGBRST|      |      |      |             |      |      |      |      |      |  Del |
+ |------+------+------+------+------+------|             |------+------+------+------+------+------|
+ |      |      |      |Aud on|Audoff| Mac  |             | Win  |Qwerty|Colemk|Dvorak|      |      |
+ |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
+ |      |      |      |      |      |      |      |      |      |      |RGB ON| HUE+ | SAT+ | VAL+ |
+ |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
+ |      |      |      |      |      |      |      |      |      |      | MODE | HUE- | SAT- | VAL- |
+ `-------------------------------------------------------------------------------------------------'
+```
+
+## Customize
+
+see `qmk_firmware/keyboards/helix/rev2/keymaps/default/rules.mk`
+
+```
+# Helix keyboard customize
+# you can edit follows 5 Variables
+#  jp: 以下の5つの変数を必要に応じて編集します。
+HELIX_ROWS = 5              # Helix Rows is 4 or 5
+OLED_ENABLE = no            # OLED_ENABLE
+LED_BACK_ENABLE = no        # LED backlight (Enable WS2812 RGB underlight.)
+LED_UNDERGLOW_ENABLE = no   # LED underglow (Enable WS2812 RGB underlight.)
+LED_ANIMATIONS = yes        # LED animations
+
+```
+## Compile
+
+go to qmk top directory.
+```
+$ cd qmk_firmware
+```
+
+build
+```
+$ make helix:default
+```
+
+flash to keyboard
+```
+$ make helix:default:avrdude
+```
+
+## Link
+* more detail wrote in Japanese [helix/Doc/firmware_jp.md](https://github.com/MakotoKurauchi/helix/blob/master/Doc/firmware_jp.md)
+* [Helix top](https://github.com/MakotoKurauchi/helix)
+
diff --git a/keyboards/helix/rev2/keymaps/default/readme_jp.md b/keyboards/helix/rev2/keymaps/default/readme_jp.md
new file mode 100644 (file)
index 0000000..88ffc02
--- /dev/null
@@ -0,0 +1,98 @@
+# The Default Helix Layout
+## 配列
+
+### Qwerty配列
+
+```
+ ,-----------------------------------------.             ,-----------------------------------------.
+ |   `  |   1  |   2  |   3  |   4  |   5  |             |   6  |   7  |   8  |   9  |   0  | Del  |
+ |------+------+------+------+------+------|             |------+------+------+------+------+------|
+ | Tab  |   Q  |   W  |   E  |   R  |   T  |             |   Y  |   U  |   I  |   O  |   P  | Bksp |
+ |------+------+------+------+------+------|             |------+------+------+------+------+------|
+ | Ctrl |   A  |   S  |   D  |   F  |   G  |             |   H  |   J  |   K  |   L  |   ;  |  '   |
+ |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
+ | Shift|   Z  |   X  |   C  |   V  |   B  |   [  |   ]  |   N  |   M  |   ,  |   .  |   /  |Enter |
+ |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
+ |Adjust| Esc  | Alt  | GUI  | EISU |Lower |Space |Space |Raise | KANA | Left | Down |  Up  |Right |
+ `-------------------------------------------------------------------------------------------------'
+```
+
+他の配列(Colemak,Dvorak)は、[readme.md](readme.md) を参照
+
+## コンパイルの仕方
+
+コンパイルは、qmk_firmware のトップディレクトリで行います。
+
+```
+$ cd qmk_firmware
+```
+qmk_firmwareでは各キーボードのコンパイルは、`<キーボード名>:<キーマップ名>`という指定で行います。
+
+```
+$ make helix:default
+```
+
+キーボードへの書き込みまで同時に行うには下記のように`:avrdude`を付けます。
+
+```
+$ make helix:default:avrdude
+```
+
+コンパイル結果と中間生成物を消去したい場合は以下のようにします。
+
+```
+$ make helix:default:clean
+```
+
+## カスタマイズ
+
+Helix キーボードを4行版として製作したり、オプションの OLED をつけたり、
+RGB バックライトまたは、RGB Underglow をつけた場合は、
+`qmk_firmware/keyboards/helix/rev2/keymaps/default/rules.mk` の以下の部分を編集して機能を有効化してください。
+
+```
+# Helix keyboard customize
+# you can edit follows 5 Variables
+#  jp: 以下の5つの変数を必要に応じて編集します。
+HELIX_ROWS = 5              # Helix Rows is 4 or 5
+OLED_ENABLE = no            # OLED_ENABLE
+LED_BACK_ENABLE = no        # LED backlight (Enable WS2812 RGB underlight.)
+LED_UNDERGLOW_ENABLE = no   # LED underglow (Enable WS2812 RGB underlight.)
+LED_ANIMATIONS = yes        # LED animations
+
+```
+
+## 4行版Helix に対応する
+
+rules.mk の下記の部分を編集して 5 を 4 に変更してください。
+
+```
+HELIX_ROWS = 4              # Helix Rows is 4 or 5
+```
+
+## RGB バックライトを有効にする
+
+rules.mk の下記の部分を編集して no を yes に変更してください。
+
+```
+LED_BACK_ENABLE = yes        # LED backlight (Enable WS2812 RGB underlight.)
+```
+
+## RGB Underglow を有効にする
+
+rules.mk の下記の部分を編集して no を yes に変更してください。
+```
+LED_UNDERGLOW_ENABLE = yes   # LED underglow (Enable WS2812 RGB underlight.)
+```
+
+## OLEDを有効にする
+
+rules.mk の下記の部分を編集して no を yes に変更してください。
+```
+OLED_ENABLE = yes            # OLED_ENABLE
+```
+
+## リンク
+
+* さらに詳細は、[こちら helix/Doc/firmware_jp.md](https://github.com/MakotoKurauchi/helix/blob/master/Doc/firmware_jp.md)をご覧ください。
+* [Helix top](https://github.com/MakotoKurauchi/helix)
index dc4187c..976529e 100644 (file)
@@ -14,14 +14,70 @@ 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
-# Helix keyboard : see ./config.h: RGBLED_NUM 6 or 32
-# Helix keyboard : RGBLIGHT_ENABLE = no or yes
 RGBLIGHT_ENABLE = no        # Enable WS2812 RGB underlight.  Do not enable this with audio at the same time.
 SWAP_HANDS_ENABLE = no        # Enable one-hand typing
 
+define HELIX_CUSTOMISE_MSG
+  $(info Helix customize)
+  $(info -  OLED_ENABLE=$(OLED_ENABLE))
+  $(info -  LED_BACK_ENABLE=$(LED_BACK_ENABLE))
+  $(info -  LED_UNDERGLOW_ENABLE=$(LED_UNDERGLOW_ENABLE))
+  $(info -  LED_ANIMATION=$(LED_ANIMATIONS))
+endef
+
+# Helix keyboard customize
+# you can edit follows 5 Variables
+#  jp: 以下の5つの変数を必要に応じて編集します。
+HELIX_ROWS = 5              # Helix Rows is 4 or 5
+OLED_ENABLE = no            # OLED_ENABLE
+LED_BACK_ENABLE = no        # LED backlight (Enable WS2812 RGB underlight.)
+LED_UNDERGLOW_ENABLE = no   # LED underglow (Enable WS2812 RGB underlight.)
+LED_ANIMATIONS = yes        # LED animations
+
+####  LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE.
+####    Do not enable these with audio at the same time.
+
+# Uncomment these for checking
+#   jp: コンパイル時にカスタマイズの状態を表示したい時はコメントをはずします。
+# $(eval $(call HELIX_CUSTOMISE_MSG))
+# $(info )
+
+ifneq ($(strip $(HELIX_ROWS)), 4)
+  ifneq ($(strip $(HELIX_ROWS)), 5)
+    $(error HELIX_ROWS = $(strip $(HELIX_ROWS)) is unexpected value)
+  endif
+endif
+OPT_DEFS += -DHELIX_ROWS=$(strip $(HELIX_ROWS))
+
+ifeq ($(strip $(LED_BACK_ENABLE)), yes)
+  RGBLIGHT_ENABLE = yes
+  OPT_DEFS += -DRGBLED_BACK
+  ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes)
+    $(eval $(call HELIX_CUSTOMISE_MSG))
+    $(error LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE both 'yes')
+  endif
+else ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes)
+  RGBLIGHT_ENABLE = yes
+else
+  RGBLIGHT_ENABLE = no
+endif
+
+ifeq ($(strip $(LED_ANIMATIONS)), yes)
+    OPT_DEFS += -DRGBLIGHT_ANIMATIONS
+endif
+
+ifeq ($(strip $(OLED_ENABLE)), yes)
+    OPT_DEFS += -DOLED_ENABLE
+endif
+
 # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
 SLEEP_LED_ENABLE = no    # Breathing sleep LED during USB suspend
 
 ifndef QUANTUM_DIR
        include ../../../../Makefile
 endif
+
+# Uncomment these for debugging
+# $(info -- RGBLIGHT_ENABLE=$(RGBLIGHT_ENABLE))
+# $(info -- OPT_DEFS=$(OPT_DEFS))
+# $(info )