|
HF-TMC9660 Driver
Hardware Agnostic C++ Driver for the TMC9660
|
This friendly guide walks you through getting the library onto your machine and compiling it for a quick test build – or for integration into a larger project. It assumes a desktop environment with the GNU toolchain available – any C++20 compliant compiler will do.
Begin by cloning the code from GitHub. If you plan to integrate the driver into another repository you can instead add it as a Git submodule. Install git if needed and run:
Or as a submodule:
The remainder of this guide assumes the working directory is the root of the cloned repository.
The driver requires a modern compiler with C++20 support.
g++ 10+ or Clang 11+.-std:c++20 switch.Verify your compiler with:
If you get an error or the reported version is older than 10 then update or install a newer compiler before proceeding.
No special build system is provided so you can slot the files directly into your own build. For a quick standalone test, compile the sources with a single command:
This creates an object file which you can link into your program. If you are using the bootloader helper add src/TMC9660Bootloader.cpp to the command line as well. When integrating with a larger project you may instead compile the sources as part of your existing build system or turn them into a static library.
To confirm that everything is working try building one of the provided examples. The following compiles the Hall sensor BLDC demo:
Running the resulting executable should print a short message to the console. If you see it – 🎉 congratulations! The library is now built correctly and is ready to drop into your own project.