yutotnh / spirit

モータードライバ用ライブラリ
https://yutotnh.github.io/spirit/
MIT License
2 stars 2 forks source link
arduino arduino-library cmake cpp mbed-libraries mbed-os
![Icon](./images/icon.svg) [![Build spirit](https://github.com/yutotnh/spirit/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/yutotnh/spirit/actions/workflows/build.yml) [![Testing With CMake and CTest](https://github.com/yutotnh/spirit/actions/workflows/cmake-test.yml/badge.svg?branch=main)](https://github.com/yutotnh/spirit/actions/workflows/cmake-test.yml) [![CodeQL](https://github.com/yutotnh/spirit/actions/workflows/codeql.yml/badge.svg?=branch=main)](https://github.com/yutotnh/spirit/actions/workflows/codeql.yml) [![Dependency Review](https://github.com/yutotnh/spirit/actions/workflows/dependency-review.yml/badge.svg?=branch=main)](https://github.com/yutotnh/spirit/actions/workflows/dependency-review.yml) [![Deploy static content to Pages](https://github.com/yutotnh/spirit/actions/workflows/deploy-static.yml/badge.svg?=branch=main)](https://github.com/yutotnh/spirit/actions/workflows/deploy-static.yml) [![CodeFactor](https://www.codefactor.io/repository/github/yutotnh/spirit/badge)](https://www.codefactor.io/repository/github/yutotnh/spirit)

👻 spirit

モータードライバーを駆動するためのライブラリ

下の図のように、マイコン間の通信を行いモータードライバーを制御することを目的としています

flowchart TB
    A[Controller]
    A -- CAN --> B["Peripheral\n(Motor Driver)"] --> B2[Motor]
    A -- CAN --> C["Peripheral\n(Motor Driver)"] --> C2[Motor]
    A -- CAN --> D["Peripheral\n(Motor Driver)"] --> D2[Motor]
    A -- CAN --> E["Peripheral\n(Motor Driver)"] --> E2[Motor]

最終的にはMbed/Arduino等での利用を想定していますが、自動テストを非マイコンで行う都合上、可能な限り特定の環境への依存を減らしています

💻 Supported platforms

下記の環境では多分動きます

Platform architecture
Arduino ESP32
Arduino Portenta
Arduino Raspberry Pi Pico
Arduino STM32
Mbed OS 6 LPCxxxx
Mbed OS 6 STM32

⌨️ Development

🛠️ Build & Test

リポジトリのルートディレクトリで下の手順を行うことで、ビルドからテストの実行ができます

プリセットは DebugRelease の2種類があります

cmake -S . --preset Debug    # Configurate & Generate
cmake --build --preset Debug # Build
ctest --preset Debug         # Test

テストフレームワークとして Google Test を利用しています

🐋 Development Containers

このリポジトリは、Visual Studio Code Dev Containers/GitHub Codespaces を含んでいます

Development Containers を利用することで、本プロジェクトでの開発に必要な最低限の環境を自動的に構築し、直ちに開発に取り組むことができます

使い方等の詳細は、 Developing inside a Container をご覧ください

📖 Document

Doxygenを使って、ソースコードからドキュメントを生成しています

生成したドキュメントへのリンクは以下です

リポジトリのルートディレクトリで下の手順を行うことで、各ドキュメントの生成ができます

git submodule update --init                              # For doxygen-awesome-css
doxygen ${workspaceFolder}/doxygen/Doxyfile              # Generate developer documentation for spirit
doxygen ${workspaceFolder}/doxygen/Doxyfile4GeneralUsers # Generate general user documentation

🤝 Contributing

PullRequestやissueを送る際は、 CONTRIBUTING.md をご覧ください

🏃 Using spirit