Skip to content

Commit

Permalink
Prepare document site
Browse files Browse the repository at this point in the history
  • Loading branch information
sekigon-gonnoc committed Apr 17, 2020
1 parent c57de3c commit 0892192
Show file tree
Hide file tree
Showing 27 changed files with 3,711 additions and 548 deletions.
51 changes: 1 addition & 50 deletions AboutDefaultFirmware/doc/bmp_custom_keycode.md
@@ -1,51 +1,2 @@
# BLE Micro Pro 固有のキーコード

## カスタムキーコード
| keycode | 内容 |
| ------- | ------------------------------------ |
| BLE_DIS | Disable BLE HID sending |
| BLE_EN | Enable BLE HID sending |
| USB_DIS | Disable USB HID sending |
| USB_EN | Enable USB HID sending |
| BLE_SEL | Enable BLE and disable USB |
| USB_SEL | Enable USB and disable BLE |
| ADV_ID0 | Start advertising to PeerID 0 |
| ADV_ID1 | Start advertising to PeerID 1 |
| ADV_ID2 | Start advertising to PeerID 2 |
| ADV_ID3 | Start advertising to PeerID 3 |
| ADV_ID4 | Start advertising to PeerID 4 |
| ADV_ID5 | Start advertising to PeerID 5 |
| ADV_ID6 | Start advertising to PeerID 6 |
| ADV_ID7 | Start advertising to PeerID 7 |
| AD_WO_L | Start advertising without whitelist |
| DEL_ID0 | Delete bonding of PeerID 0 |
| DEL_ID1 | Delete bonding of PeerID 1 |
| DEL_ID2 | Delete bonding of PeerID 2 |
| DEL_ID3 | Delete bonding of PeerID 3 |
| DEL_ID4 | Delete bonding of PeerID 4 |
| DEL_ID5 | Delete bonding of PeerID 5 |
| DEL_ID6 | Delete bonding of PeerID 6 |
| DEL_ID7 | Delete bonding of PeerID 7 |
| DELBNDS | Delete all bonding |
| ENT_DFU | Start bootloader |
| ENT_WEB | Start web configurator |
| ENT_SLP | Deep sleep mode |
| BATT_LV | Display battery level in milli volts |
| SAVE_EE | Save eeprom config |
| DEL_EE | Delete eeprom config |
| xEISU | Send `LANG1` or `` Alt + ` `` |
| xKANA | Send `LANG2` or `` Alt + ` `` |

## 拡張キーコード

- LTやTDを使いやすくした独自の構文
- `EX()`で囲い明示的に宣言する
- 全ての関数でKCに16ビットコードが使えるので、モディファイアと組み合わせたキーやカスタムキーコードを指定できる
- KEYMAP.JSNの中に32種類まで登録可能。これを超えた場合は無視される。

| 構文 | 内容 |
| ------------------------------- | ---------------------------------------------------- |
| LTE(layer, kc) | LTと同じ。`EX(LTE(1, xEISU))` |
| TLT(layer1, layer2, layer3, kc) | LTとtri_layer_updateを組み合わせたもの |
| TDD(kc1, kc2) | 一回タップするとkc1, 二回タップするとkc2が入力される |
| TDH(kc1, kc2) | タップするとkc1, ホールドするとkc2が入力される |
[ドキュメントサイトに移転しました](https://sekigon-gonnoc.github.io/BLE-Micro-Pro)
43 changes: 1 addition & 42 deletions AboutDefaultFirmware/doc/build_bmp_qmk_firmware.md
@@ -1,43 +1,2 @@
# BLE Micro Pro用QMKファームウェアのビルド

## get source code

```
git clone --depth 1 -b dev/ble_micro_pro https://github.com/sekigon-gonnoc/qmk_firmware.git qmk_firmware_bmp
```

## install build tools
- Install `arm-none-eabi-gcc` and related tools via `util/qmk_install.sh`

- Install `nrfutil` via `pip2` or download [nrfutil.exe](https://github.com/NordicSemiconductor/pc-nrfutil/releases) to ~/qmk_utils (windows only).

## Build and write firmware
### uf2
`:uf2` option convert `.bin` file to `.uf2` file and copy it to uf2 drive if found.
Put your BLE Micro Pro into dfu mode `before` do following command if you want copy uf2 file automatically.
BLE Micro Pro start dfu mode if it is plugged during level of BOOT pin is low (reset switch of keyboard is pushed) or jump from application (BOOTLOADER keycode or [CLI](cli.md)).

- Default firmware
```
make ble_micro_pro:default:uf2
```

- Your own firmware
```
make <keyboard>:<keymap>:uf2
```

### nrfutil
`:nrfutil` option convert `.bin` file to `.zip` file and burn it to BLE Micro Pro if found.
Put your BLE Micro Pro into dfu mode `after` do following command if you want burn firmware automatically.
BLE Micro Pro start dfu mode if it is plugged during level of BOOT pin is low (reset switch of keyboard is pushed) or jump from application (BOOTLOADER keycode or [CLI](cli.md)).

- Default firmware
```
make ble_micro_pro:default:nrfutil
```

- Your own firmware
```
make <keyboard>:<keymap>:nrfutil
```
[ドキュメントサイトに移転しました](https://sekigon-gonnoc.github.io/BLE-Micro-Pro)
51 changes: 1 addition & 50 deletions AboutDefaultFirmware/doc/cli.md
@@ -1,51 +1,2 @@

# cli

TeraTermやscreen, cuなどを使ってシリアルポートを開きます。エラーメッセージの確認や以下のコマンドが使用ができます。

| command | description |
| ------- | ------------------------------------------- |
| reset | Reset system |
| adv | Start advertising |
| dfu | Jump to bootloader |
| show | Show bonded devices |
| del | Delete bond information |
| help | Show this message |
| map | Show keymap |
| conf | Show config |
| conv | Show keymap |
| update | Update file |
| remove | Remove file (0: config.json, 1:keymap.json) |
| dump | Dump memory |
| dumps | Dump memory |
| led | LED control |
| ee | eeprom control (show, save, del) |
| web | Start web config mode |
| i2c | Test i2c |



## adv <id>
id番目のペアリング済みデバイスに向けてアドバタイズを開始します。分割マスター設定の場合、スレーブデバイスのスキャンも開始します。idを指定しない場合はペアリングしていないデバイスも含めすべてのデバイスに向けてアドバタイズを開始します。
ペアリング済みデバイス一覧はshowコマンドで確認できます

## show
BLEのペアリング状況(ID, role, MAC)を表示します。

## del <id>
id番のデバイスとのペアリングを削除します。別途相手デバイス側に残っているペアリング情報も削除してください
idを指定しない場合すべてのペアリング情報を削除します


## conv <string>
<string>をキーコードに変換します。keymap.jsonに使える文字列かどうか確認できます。

## remove <id>
マスストレージ上のファイルを削除しデフォルトのファイルを復元します。
0: config.json, 1: keymap.json, 2:tapping_term.json

## led <pattern>
LEDを点灯します

## ee [show, save, or del]
eepromをエミュレーションします。eeprom上に今の設定を保存したい場合はsaveしてください。
[ドキュメントサイトに移転しました](https://sekigon-gonnoc.github.io/BLE-Micro-Pro)
86 changes: 1 addition & 85 deletions AboutDefaultFirmware/doc/define_new_keyboard.md
@@ -1,86 +1,2 @@
# 新しいキーボード用の設定を作成する

## コンフィグファイルの用意
Pro Micro用のQMKがすでにある場合、[変換スクリプト](../keyboards/config_converter.py)を用いて`config.json`を生成できます。

```example
keyboards/config_converter.py ~/qmk_firmware/helix/rev2
```

LAYOUTマクロなどが複数定義されている場合、最初に変換された定義が使用されます。他の定義を使いたい場合は関係のない定義を一時的に削除あるいは`//`でコメントアウトしてください。

### config.jsonの設定 (開発者向け)
|キー||内容|
|---|---|---|
|version|2|config構造体のバージョン. ブートローダ内の構造体の定義が変わらない限り変えない|
|pid, vid|string|16進数のPIDとVID|
|name|string||
|manufacture|string||
|description|string||
|rows|int|マトリクスの列数|
|cols|int|マトリクスの行数|
|device_rows|int|分割型の場合、片手分のマトリクスの列数. 一体型の場合rowsと同じにする|
|device_cols|int|分割型の場合、片手分のマトリクスの行数. 一体型の場合colsと同じにする|
|diode_direction|0 or 1|ROW2COLのとき 1|
|row_pins|int array|マトリクスの行ピン。番号はPINxxに対応|
|col_pins|int array|マトリクスの列ピン。番号はPINxxに対応|
|layout|int array|qmkのレイアウトマクロに対応するもの。詳細は後述|
|mode|SPLIT_MASTER, SPLIT_SLAVE, SINGLE|分割マスター、分割スレーブ、一体型|
|led->pin|int array|LED(ws2812系)のピン。番号はPINxxに対応|
|led->num|int|LEDの数|

### layoutの設定
layout配列の数値はキーマトリクスの行->列の順に1から降った番号に対応し、対応する位置にあるキーマップとスイッチの対応を表しています。分割型の場合は左のマトリクスから順に数値を割当てます。

ただし、0は列の区切りを表します。

例えば次のようにマトリクスが配置された左右分割キーボードがあったとき

```
+------+-----+ +-----+-----+
(1,0) |(1,1)| |(1,1)|(1,0)|
+------+-----+-----+ +-----+-----+-----+
(0,0) |(0,1)|(0,2)| |(0,2)|(0,1)|(0,0)|
+------+-----+-----+ +-----+-----+-----+
```
左手の(0,0)が1, そのまま2,3,4,5と続いて6は存在せず、右手の(0,0)から7,8,9...と割り当てられます。これらの割当をそのまま物理的な配置順に並べ、行の区切りに0を付けます。
```
"layout":[
4, 5, 11,10, 0,
1, 2, 3, 9, 8, 7
]
```

<img src="https://github.com/sekigon-gonnoc/BLE-Micro-Pro/blob/master/pin%20assign.jpg" width=300px/>

## ファームウェアを作成する
他のキーボードでも使えそうなカスタムキーコードを追加したい場合はkeyboard/ble_micro_pro に追加することも検討してください。
ハードウェアに依存する機能を追加する場合は以下を参考に新しいキーボードを定義してください。

### Start new project
```
$ ./util/new_keyboard.sh
Generating a new QMK keyboard directory
Keyboard Name: <your keyboard name>
Keyboard Type [avr]: nrf
Your Name [sekigon-gonnoc]:
Copying base template files... done
Copying nrf template files... done
Renaming keyboard files... done
Replacing %YEAR% with 2019... done
Replacing %KEYBOARD% with name... done
Replacing %YOUR_NAME% with sekigon-gonnoc... done
Created a new keyboard called name.
To start working on things, cd into keyboards/name,
or open the directory in your favourite text editor.
```

### Configure your project
Settings in config.h and keymap.c will be used as defaults, and overridden by config.json and keymap.json if given.
If you want to restore default settings, use `remove` command from [CLI](cli.md)

### [ビルド方法](doc/build_bmp_qmk_firmware.md)
[ドキュメントサイトに移転しました](https://sekigon-gonnoc.github.io/BLE-Micro-Pro)

0 comments on commit 0892192

Please sign in to comment.