Skip to content

Update README.md #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 15, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 20 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -55,29 +55,6 @@ rtmouseをインストールして不具合が出た場合のみ以下の設定

* Device Tree機能を「切」にする。

### for arm64 Ubuntu18.04

According to
[issues#13](https://github.com/rt-net/RaspberryPiMouse/issues/13),
it may be necessary to set the I2C baudrate lower than the default value.
Add a following new line in `/boot/firmware/config.txt` to change the i2c_baudrate to 62.5 kHz.

I2Cのbaudrateをデフォルト値より下げる必要があります([issues#13](https://github.com/rt-net/RaspberryPiMouse/issues/13))。

`/boot/firmware/config.txt`に以下の1行を追加することでI2Cのbaudrateを62.5kHzに固定することができます。

```
dtparam=i2c_baudrate=62500
```

The following command shows current i2c baudrate value.

現在設定されているI2Cのbaudrateは以下のコマンドを実行することで確認できます。

```
$ printf "%d\n" 0x$(xxd -ps /sys/class/i2c-adapter/i2c-1/of_node/clock-frequency)
```

### for Raspberry Pi 4

Edit [`rtmouse.c`](https://github.com/rt-net/RaspberryPiMouse/blob/dd0343449951a99b067e24aef3c03ae5ed9ab936/src/drivers/rtmouse.c#L54) to change the defined value `RASPBERRYPI` from '2' to '4'.
@@ -94,6 +71,26 @@ Raspberry Pi 4で本ドライバを使用する際には`rtmouse.c`の以下の
#define RASPBERRYPI 2
```

### パルスカウンタについて

パルスカウンタは値の読み取りにI2Cを使用しています。仕様上は400kHzまでbaudrateを上げることができます(※1)。
I2Cのbaudrateを上げると通信に失敗する場合がある([issues#13](https://github.com/rt-net/RaspberryPiMouse/issues/13))ので、基本的にはI2Cのbaudrateはデフォルト値(※2)から変更して62.5kHzに固定してください。

According to
[issues#13](https://github.com/rt-net/RaspberryPiMouse/issues/13),
it may be necessary to set the I2C baudrate lower than the default value.
Add a following new line in `/boot/firmware/config.txt` to change the i2c_baudrate to 62.5 kHz.

`/boot/firmware/config.txt`に以下の1行を追加することでI2Cのbaudrateを62.5kHzに固定することができます。
```
dtparam=i2c_baudrate=62500
```
※1 Raspberry Pi 4 Model B(Ubuntu 18.04とUbuntu 20.04)を搭載して400kHzで通信できることを確認しています。
※2 現在設定されているI2Cのbaudrateは以下のコマンドを実行することで確認できます。
```
$ printf "%d\n" 0x$(xxd -ps /sys/class/i2c-adapter/i2c-1/of_node/clock-frequency)
```

## Device files

For example code of device files, please refer to [SampleProgram](./SampleProgram/README.md).