Installation

This guide covers how to obtain and integrate the HF-TMC9660 driver into your project.

Prerequisites

  • C++20 compatible compiler (GCC 10+, Clang 11+, or MSVC 2019+)
  • Git (for cloning)
  • CMake (optional, for building examples)

Obtaining the Source

Option 1: Git Clone

1
2
git clone https://github.com/n3b3x/hf-tmc9660-driver.git
cd hf-tmc9660-driver
1
2
3
4
# From your project root
git submodule add https://github.com/n3b3x/hf-tmc9660-driver.git external/hf-tmc9660
cd external/hf-tmc9660
git submodule update --init --recursive

Option 3: Download ZIP

Download the ZIP file from GitHub and extract it to your project.

Integration Methods

Manual Integration

  1. Copy the driver files to your project:
    • inc/ directory (header files)
    • src/ directory (source files, if any)
  2. Add include path to your build system:
    1
    
    #include "inc/tmc9660.hpp"
    
  3. Enable C++20 in your compiler:
    • GCC/Clang: -std=c++20
    • MSVC: /std:c++20

CMake Integration

If your project uses CMake:

1
2
3
4
5
6
7
8
9
10
11
# Add the driver as a subdirectory
add_subdirectory(external/hf-tmc9660-driver)

# Link to your target
target_link_libraries(your_target PRIVATE hf_tmc9660_driver)

# Enable C++20
set_target_properties(your_target PROPERTIES
    CXX_STANDARD 20
    CXX_STANDARD_REQUIRED ON
)

ESP-IDF Component

For ESP-IDF projects:

  1. Add as component:
    1
    2
    
    # In your project's components directory
    git submodule add https://github.com/n3b3x/hf-tmc9660-driver.git hf-tmc9660
    
  2. Update CMakeLists.txt:
    1
    2
    3
    4
    5
    
    idf_component_register(
        INCLUDE_DIRS "inc"
        PRIV_INCLUDE_DIRS "src"
        REQUIRES driver
    )
    

Building Examples

ESP32 Examples

1
2
3
cd examples/esp32
idf.py build
idf.py flash monitor

Generic CMake Examples

1
2
3
mkdir build && cd build
cmake ..
make

Verification

After installation, verify your setup:

1
2
3
4
5
6
#include "inc/tmc9660.hpp"

int main() {
    // If this compiles, installation is successful
    return 0;
}

Next Steps