https://github.com/aptpod/apt-peripheral-linux-driver
Device driver for EDGEPLANT USB Peripherals,
https://github.com/aptpod/apt-peripheral-linux-driver
c device-driver linux
Last synced: about 1 month ago
JSON representation
Device driver for EDGEPLANT USB Peripherals,
- Host: GitHub
- URL: https://github.com/aptpod/apt-peripheral-linux-driver
- Owner: aptpod
- License: gpl-2.0
- Created: 2021-09-14T06:05:56.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-12-01T01:53:23.000Z (over 2 years ago)
- Last Synced: 2025-01-12T08:41:55.957Z (over 1 year ago)
- Topics: c, device-driver, linux
- Language: C
- Homepage: https://www.aptpod.co.jp/products/edgeplant/edgeplant-peripherals/
- Size: 165 KB
- Stars: 2
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.ja.md
- License: LICENSE
Awesome Lists containing this project
README
# Device driver for EDGEPLANT USB Peripherals
## About
EDGEPLANT USB ペリフェラルを Linux 上で利用するためのデバイスドライバです。
本デバイスドライバをインストールすることで、以下の製品でデータの受信や送信を行えるようになります。
- EDGEPLANT CAN-USB Interface
- EDGEPLANT CAN FD USB Interface
- EDGEPLANT ANALOG-USB Interface
EDGEPLANT Peripherals の詳細については[製品のホームページ](https://www.aptpod.co.jp/products/edgeplant/edgeplant-peripherals)を参照してください。
## Getting Started
### Prerequisites
このデバイスドライバをビルドするためには、以下のパッケージが必要となります。
- GNU C
- GNU make
- Linux headers (kernel v4.4 以上)
このデバイスドライバを使用するためには、以下のカーネルコンフィグが必要となります。
- SocketCAN
- CONFIG_NET
- CONFIG_CAN
- CONFIG_CAN_DEV
- IIO
- CONFIG_IIO
- CONFIG_IIO_BUFFER
- CONFIG_IIO_KFIFO_BUF
### Installing
#### deb パッケージからのインストール
1. アプトポッドの公開リポジトリを設定します。
コマンド内の `${DISTRIBUTION}` には、ご使用の環境に応じて `ubuntu` または `debian` を指定してください。
```sh
sudo apt-get update
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://repository.aptpod.jp/intdash-edge/linux/${DISTRIBUTION}/gpg | \
sudo gpg --dearmor -o /etc/apt/keyrings/intdash-edge.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/intdash-edge.gpg] \
https://repository.aptpod.jp/intdash-edge/linux/${DISTRIBUTION} $(lsb_release -cs) \
stable" \
| sudo tee /etc/apt/sources.list.d/intdash-edge.list
sudo apt-get update
```
2. apt-usbtrx-dkms パッケージをインストールします。
```sh
sudo apt-get install apt-usbtrx-dkms
```
3. モジュールを読み込みます。
```sh
sudo modprobe apt_usbtrx
```
DKMS を使用することで、カーネルが更新されるたびに自動的にドライバが再ビルドされます。
#### ソースからビルドしてインストール
1. リポジトリをクローンします。
```sh
git clone https://github.com/aptpod/apt-peripheral-linux-driver
```
1. デバイスドライバとツールをビルドします。
```sh
make all
```
1. デバイスドライバとツールをインストールします。
```sh
sudo make install
sudo modprobe apt_usbtrx
```
デフォルトではツールは `/usr/local/bin` にインストールされます。任意のディレクトリにインストールする場合は、`DESTDIR` を指定します。
```sh
mkdir -p /path/to/dir
make DESTDIR=/path/to/dir install
```
### Running the unit test
本プロジェクトでは [KUnit](https://www.kernel.org/doc/html/latest/dev-tools/kunit/index.html) を利用して単体テストを行なっています。自身の環境で単体テストを実施する場合、以下のスクリプトを実行してください。
```sh
cd kunit && ./run_test.sh
```
## Usage
ペリフェラルごとの利用方法については、[docs](./docs/README.md)を参照してください。
## License
Distributed under the GPL v2.0 License. See LICENSE for more information.
## Contact
https://www.aptpod.co.jp/contact/