aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2014-07-10 15:28:36 +0900
committertmk <nobody@nowhere>2014-07-10 15:28:36 +0900
commit452866319bc30ef1bb018c4aa70df519ab78b9bf (patch)
tree2d573a3532988f095eb67fce90d8726115358156
parent92004d67869a371f1a8ff4d67ffb49f52141b768 (diff)
downloadqmk_firmware-452866319bc30ef1bb018c4aa70df519ab78b9bf.tar.gz
qmk_firmware-452866319bc30ef1bb018c4aa70df519ab78b9bf.zip
Fix READEM of hhkb and doc/build.md
-rw-r--r--doc/build.md24
-rw-r--r--keyboard/hhkb/README.md35
-rw-r--r--keyboard/hhkb/hhkb_avr.h11
3 files changed, 31 insertions, 39 deletions
diff --git a/doc/build.md b/doc/build.md
index bfe5de9fd..20702e94c 100644
--- a/doc/build.md
+++ b/doc/build.md
@@ -5,23 +5,22 @@ Build Firmware and Program Controller
5Download and Install 5Download and Install
6-------------------- 6--------------------
7### 1. Install Tools 7### 1. Install Tools
8First, you need tools to build firmware and program your controller. I assume you are on Windows here.
9 8
101. **Toolchain** Install [WinAVR][winavr]. This is old but works well for this purpose. `WinAVR` is a tool set to build firmware including C compiler(gcc) and make commands. You can use [CrossPack][crosspack] instead if you are on Mac. 91. **Toolchain** On Windows install [MHV AVR Tools][mhv] for AVR GCC compiler and [Cygwin][cygwin](or [MinGW][mingw]) for shell terminal. On Mac you can use [CrossPack][crosspack]. On Linux you can install AVR GCC with your favorite package manager.
11 10
122. **Programmer** Install [Atmel FLIP][flip]. `FLIP` is a tool to program(load) firmware into AVR controller via DFU bootloader. AVR USB chips including ATmega32U4 has DFU bootloader by factory default. You can also use [dfu-programmer][dfu-prog] instead if you are on Mac or Linux. 112. **Programmer** On Windows install [Atmel FLIP][flip]. On Mac and Linux install [dfu-programmer][dfu-prog].
13 12
143. **Driver** At first time you start DFU bootloader on Chip 'Found New Hardware Wizard' will come up on Windows. If you install device driver properly you can find chip name like 'ATmega32U4' under 'LibUSB-Win32 Devices' tree on 'Device Manager'. If not you shall need to update its driver on 'Device Manager'. You will find the driver in `FLIP` install directory like: C:\Program Files (x86)\Atmel\Flip 3.4.5\usb\. If you use `dfu-programmer` install its driver. 133. **Driver** On Windows you start DFU bootloader on the chip first time you will see 'Found New Hardware Wizard' to install driver. If you install device driver properly you can find chip name like 'ATmega32U4' under 'LibUSB-Win32 Devices' tree on 'Device Manager'. If not you shall need to update its driver on 'Device Manager'. You will find the driver in `FLIP` install directory like: C:\Program Files (x86)\Atmel\Flip 3.4.5\usb\. In case of `dfu-programmer` use its driver.
15 14
16If you use PJRC Teensy you don't need step 2 and 3 above, just get [Teensy loader][teensy-loader]. 15If you use PJRC Teensy you don't need step 2 and 3 above, just get [Teensy loader][teensy-loader].
17 16
18 17
19### 2. Download source 18### 2. Download source
20You can find firmware source at github: 19You can find firmware source at github:
21 20
22- <https://github.com/tmk/tmk_keyboard> 21- <https://github.com/tmk/tmk_keyboard>
23 22
24If you are familiar with `Git` tools you are recommended to use it but you can also download zip archive from: 23If you are familiar with `Git` tools you are recommended to use it but you can also download zip archive from:
25 24
26- <https://github.com/tmk/tmk_keyboard/archive/master.zip> 25- <https://github.com/tmk/tmk_keyboard/archive/master.zip>
27 26
@@ -29,7 +28,7 @@ If you are familiar with `Git` tools you are recommended to use it but you can a
29Build firmware 28Build firmware
30-------------- 29--------------
31### 1. Open terminal 30### 1. Open terminal
32Open terminal window to get access to commands. You can use `cmd` in Windows or `Terminal.app` on Mac OSX. In Windows press `Windows` key and `R` then enter `cmd` in 'Run command' dialog showing up. 31Open terminal window to get access to commands. Use Cygwin(or MingGW) `shell terminal` in Windows or `Terminal.app` on Mac OSX. In Windows press `Windows` key and `R` then enter `cmd` in 'Run command' dialog showing up.
33 32
34### 2. Change directory 33### 2. Change directory
35Move to project directory in the firmware source. 34Move to project directory in the firmware source.
@@ -100,6 +99,9 @@ You may want to use other programmer like `avrdude` with AVRISPmkII, Arduino or
100 $ make -f Makefile.<variant> program 99 $ make -f Makefile.<variant> program
101 100
102 101
102[cygwin]: https://www.cygwin.com/
103[mingw]: http://www.mingw.org/
104[mhv]: https://infernoembedded.com/products/avr-tools
103[winavr]: http://winavr.sourceforge.net/ 105[winavr]: http://winavr.sourceforge.net/
104[crosspack]: http://www.obdev.at/products/crosspack/index.html 106[crosspack]: http://www.obdev.at/products/crosspack/index.html
105[flip]: http://www.atmel.com/tools/FLIP.aspx 107[flip]: http://www.atmel.com/tools/FLIP.aspx
@@ -116,14 +118,18 @@ Makefile Options
116 #MCU = at90usb1286 # Teensy++ 2.0 118 #MCU = at90usb1286 # Teensy++ 2.0
117 F_CPU = 16000000 119 F_CPU = 16000000
118 120
121Set your MCU and its clock in Hz.
122
119 # Boot Section Size in *bytes* 123 # Boot Section Size in *bytes*
120 # Teensy halfKay 512 124 # Teensy halfKay 512
121 # Atmel DFU loader 4096 125 # Atmel DFU loader 4096
122 # LUFA bootloader 4096 126 # LUFA bootloader 4096
123 OPT_DEFS += -DBOOTLOADER_SIZE=4096 127 OPT_DEFS += -DBOOTLOADER_SIZE=4096
124 128
129If you are using PJRC Teensy use `512` for `BOOTLOADER_SIZE`, otherwise use `4096` unless you are sure.
130
125### 2. Features 131### 2. Features
126Optional. Note that ***comment out*** to disable them. 132Optional. Note that ***comment out*** with `#` to disable them.
127 133
128 BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) 134 BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
129 MOUSEKEY_ENABLE = yes # Mouse keys(+4700) 135 MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
@@ -152,7 +158,7 @@ Config.h Options
152---------------- 158----------------
153### 1. Magic command key combination 159### 1. Magic command key combination
154 160
155 #define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KB_LSHIFT) | MOD_BIT(KB_RSHIFT))) 161 #define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KB_LSHIFT) | MOD_BIT(KB_RSHIFT)))
156 162
157### 2. Mechanical Locking Support for CapsLock 163### 2. Mechanical Locking Support for CapsLock
158 164
diff --git a/keyboard/hhkb/README.md b/keyboard/hhkb/README.md
index 7ea9843a6..d4a2cd022 100644
--- a/keyboard/hhkb/README.md
+++ b/keyboard/hhkb/README.md
@@ -2,7 +2,7 @@ Alternative Controller for HHKB Pro
2=================================== 2===================================
3I wanted to add some features like vi cursor and mouse keys to my [HHKB][HHKB] but its controller is not programmable and firmware source code is not open, of course. This means customizing this keyboard needs to replace original controller with programmable one. 3I wanted to add some features like vi cursor and mouse keys to my [HHKB][HHKB] but its controller is not programmable and firmware source code is not open, of course. This means customizing this keyboard needs to replace original controller with programmable one.
4 4
5This controller can work with HHKB **Professional**, **Professional** 2 and **Type-S**. 5This controller can work with HHKB **Professional**, **Professional** 2, **JP** and **Type-S**.
6 6
7See [this thread][AltController] in geekhack.org. 7See [this thread][AltController] in geekhack.org.
8 8
@@ -43,7 +43,7 @@ See [doc/HHKB.txt](doc/HHKB.txt) and files under [doc/](doc/) for internal of HH
43See [this document](../../doc/build.md) first. 43See [this document](../../doc/build.md) first.
44 44
45### Configuration 45### Configuration
46Set `MCU`, `BOOTLOADER_SIZE` and other build options in `Makefile` and `config.h`. 46Set `MCU`, `BOOTLOADER_SIZE` and other build options in `Makefile` and `config.h`. If your target is **HHKB JP** you need to set `HHKB_JP` build option in `Makefile`.
47 47
48### Build 48### Build
49Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. Just `make` with `KEYMAP` option like: 49Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. Just `make` with `KEYMAP` option like:
@@ -66,37 +66,22 @@ Use [Teensy Loader] if your controller is Teensy/Teensy++.
66 66
67 67
68##Keymap 68##Keymap
69To define your own keymap create file named `keymap_<name>.c` and see keymap document(you can find in top README.md) and existent keymap files. 69To define your own keymap create file named `keymap_<name>.c` and see [keymap document](../../doc/keymap.md) and existent keymap files.
70 70
71 71
72##Hardware 72##Hardware
73You have some options for hardware. Development boards with USB AVR family(ATMega32U4, AT90USB1286) like Teensy will work while MegaAVR with [V-USB] library is also cheaper option for DIY. 73You have some options for hardware. Development boards with USB AVR family(ATMega32U4, AT90USB1286) like Teensy will work while MegaAVR with [V-USB] library is also cheaper option for DIY.
74 74
75###1. TMK Alt Controller Board 75###1. TMK Alt Controller Board
76TMK designed [Keyboard Controller Board for HHKB Pro2(KiCad project)](https://github.com/tmk/HHKB_controller). 76Design files are available at [Keyboard Controller Board for HHKB(KiCad project)](https://github.com/tmk/HHKB_controller) and see [Controller Distribution thread](http://geekhack.org/index.php?topic=56494.0) if you get an assembled one.
77See [this post](http://geekhack.org/index.php?topic=12047.msg948923#msg948923). 77
78 78
79 79###2. PJRC Teensy
80###2. PJRC Teensy++ 2.0 version 80See [this thread](http://geekhack.org/index.php?topic=57008.0).
81 +---------------+ 81
82 | Teensy++ |
83 | |
84 | | HHKB pro HHKB pro2
85 | | ~~~~~~~~ ~~~~~~~~~
86 | PB0-2|------->ROW (6-8) (5-7)
87 | PB3-5|------->COL (9-11) (8-10)
88 | PB6|------->ENABLE (12) (11)
89 | PE6|<-------KEY (4) (3)
90 | PE7|------->PREV (5) (4)
91 | |
92 | | 5V--- (1-3) (1-2)
93 | | GND--- (13-14) (12-13)
94 +---------------+
95
96- NOTE: PJRC [Teensy](http://www.pjrc.com/teensy/)
97 82
98###3. V-USB version 83###3. V-USB version
99See [V-USB controller for HHKB](doc/V-USB.md) 84See [V-USB controller for HHKB](doc/V-USB.md).
100 85
101 86
102[LUFA]: http://www.fourwalledcubicle.com/LUFA.php 87[LUFA]: http://www.fourwalledcubicle.com/LUFA.php
diff --git a/keyboard/hhkb/hhkb_avr.h b/keyboard/hhkb/hhkb_avr.h
index 46fb16679..b7bd507b5 100644
--- a/keyboard/hhkb/hhkb_avr.h
+++ b/keyboard/hhkb/hhkb_avr.h
@@ -71,13 +71,14 @@ static inline void KEY_SELECT(uint8_t ROW, uint8_t COL)
71 71
72 72
73#elif defined(__AVR_AT90USB1286__) 73#elif defined(__AVR_AT90USB1286__)
74/* 74/*
75 * For Teensy++(AT90USB1286) 75 * For Teensy++(AT90USB1286)
76 * 76 *
77 * row: PB0-2 77 * HHKB pro HHKB pro2
78 * col: PB3-5,6 78 * row: PB0-2 (6-8) (5-7)
79 * key: PE6(pull-uped) 79 * col: PB3-5,6 (9-12) (8-11)
80 * prev: PE7 80 * key: PE6(pull-uped) (4) (3)
81 * prev: PE7 (5) (4)
81 * 82 *
82 * TODO: convert into 'staitc inline' function 83 * TODO: convert into 'staitc inline' function
83 */ 84 */