Skip to content

yutotnh/spirit

Repository files navigation

Icon

Build spirit Testing With CMake and CTest CodeQL

Dependency Review Deploy static content to Pages CodeFactor

👻 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を使って、ソースコードからドキュメントを生成しています

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

  • 一般ユーザ用
    • Controller側で利用するAPIのみをまとめたページ
  • 開発者用
    • Controller/Peripheral側の全てのAPIをまとめたページ(=全部入り)

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

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