|
HF-TMC51x0 Driver (TMC5130 & TMC5160) 0.1.0-dev
Hardware Agnostic C++ Driver for the TMC51x0 (TMC5130 & TMC5160)
|
ESP32 GPIO pin configuration and compile-time configuration for TMC51x0 driver (TMC5130 & TMC5160) More...
#include "driver/gpio.h"#include "tmc51x0_comm_interface.hpp"#include "features/tmc51x0_config_builder.hpp"#include "esp32_tmc51x0_bus.hpp"Go to the source code of this file.
Namespaces | |
| namespace | tmc51x0_test_config |
| namespace | tmc51x0_test_config::anonymous_namespace{esp32_tmc51x0_test_config.hpp} |
| namespace | tmc51x0_test_config::ConfigValidators |
| Validator helper - checks if a type has required members. | |
Typedefs | |
| template<TestRigType test_rig> | |
| using | tmc51x0_test_config::GetTestConfigForTestRig = typename TestRigConfig<test_rig>::Test |
| Get test configuration accessor for a given test rig. | |
Enumerations | |
| enum class | tmc51x0_test_config::MotorType { tmc51x0_test_config::MOTOR_17HS4401S_GEARBOX , tmc51x0_test_config::MOTOR_17HS4401S_DIRECT , tmc51x0_test_config::MOTOR_APPLIED_MOTION_5034 } |
| Motor type enumeration for compile-time motor selection. More... | |
| enum class | tmc51x0_test_config::BoardType { tmc51x0_test_config::BOARD_TMC51x0_EVAL , tmc51x0_test_config::BOARD_TMC51x0_BOB } |
| Board type enumeration. More... | |
| enum class | tmc51x0_test_config::PlatformType { tmc51x0_test_config::PLATFORM_CORE_DRIVER_TEST_RIG , tmc51x0_test_config::PLATFORM_FATIGUE_TEST_RIG } |
| Platform type enumeration. More... | |
| enum class | tmc51x0_test_config::TestRigType { tmc51x0_test_config::TEST_RIG_CORE_DRIVER , tmc51x0_test_config::TEST_RIG_FATIGUE } |
| Test rig type enumeration. More... | |
Functions | |
| Esp32SpiPinConfig | tmc51x0_test_config::GetDefaultPinConfig () noexcept |
| Complete pin configuration for all tests. | |
| template<BoardType board_type> | |
| void | tmc51x0_test_config::ApplyBoardConfig (tmc51x0::DriverConfig &cfg) noexcept |
| Helper function to apply board configuration to DriverConfig. | |
| void | tmc51x0_test_config::ConfigureDriverFromMotor_17HS4401S_Gearbox (tmc51x0::DriverConfig &cfg) noexcept |
| Helper function to populate DriverConfig from 17HS4401S gearbox motor configuration. | |
| void | tmc51x0_test_config::ConfigureDriverFromMotor_17HS4401S_Direct (tmc51x0::DriverConfig &cfg) noexcept |
| Helper function to populate DriverConfig from 17HS4401S direct drive motor configuration. | |
| void | tmc51x0_test_config::ConfigureDriverFromMotor_AppliedMotion_5034 (tmc51x0::DriverConfig &cfg) noexcept |
| Helper function to populate DriverConfig from Applied Motion 5034 motor configuration. | |
| template<PlatformType platform_type> | |
| void | tmc51x0_test_config::ApplyPlatformConfig (tmc51x0::DriverConfig &cfg) noexcept |
| Helper function to apply platform configuration to DriverConfig. | |
| template<PlatformType platform_type> | |
| tmc51x0::ReferenceSwitchConfig | tmc51x0_test_config::GetReferenceSwitchConfig () noexcept |
| Helper function to configure reference switches from platform config. | |
| template<PlatformType platform_type> | |
| tmc51x0::EncoderConfig | tmc51x0_test_config::GetEncoderConfig () noexcept |
| Helper function to configure encoder from platform config. | |
| template<PlatformType platform_type> | |
| constexpr uint16_t | tmc51x0_test_config::GetEncoderPulsesPerRev () noexcept |
| Helper function to get encoder pulses per revolution from platform config. | |
| template<PlatformType platform_type> | |
| bool | tmc51x0_test_config::GetEncoderInvertDirection () noexcept |
| Helper function to get encoder invert direction flag from platform config. | |
| template<TestRigType test_rig> | |
| constexpr MotorType | tmc51x0_test_config::GetTestRigMotorType () noexcept |
| Get motor type for a given test rig. | |
| template<TestRigType test_rig> | |
| constexpr BoardType | tmc51x0_test_config::GetTestRigBoardType () noexcept |
| Get board type for a given test rig. | |
| template<TestRigType test_rig> | |
| constexpr PlatformType | tmc51x0_test_config::GetTestRigPlatformType () noexcept |
| Get platform type for a given test rig. | |
| template<TestRigType test_rig> | |
| void | tmc51x0_test_config::ConfigureDriverFromTestRig (tmc51x0::DriverConfig &cfg, bool use_direct_drive=false) noexcept |
| Configure driver from test rig selection. | |
| template<TestRigType test_rig> | |
| tmc51x0::ReferenceSwitchConfig | tmc51x0_test_config::GetTestRigReferenceSwitchConfig () noexcept |
| Get reference switch configuration for a test rig. | |
| template<TestRigType test_rig> | |
| tmc51x0::EncoderConfig | tmc51x0_test_config::GetTestRigEncoderConfig () noexcept |
| Get encoder configuration for a test rig. | |
| template<TestRigType test_rig> | |
| constexpr uint16_t | tmc51x0_test_config::GetTestRigEncoderPulsesPerRev () noexcept |
| Get encoder pulses per revolution for a test rig. | |
| template<TestRigType test_rig> | |
| bool | tmc51x0_test_config::GetTestRigEncoderInvertDirection () noexcept |
| Get encoder invert direction flag for a test rig. | |
| template<TestRigType test_rig> | |
| constexpr uint16_t | tmc51x0_test_config::GetTestRigMotorOutputFullSteps (bool use_direct_drive=false) noexcept |
| Get motor output full steps per revolution for a test rig. | |
Variables | |
| constexpr gpio_num_t | tmc51x0_test_config::SPI_SCK = GPIO_NUM_5 |
| SPI clock pin. | |
| constexpr gpio_num_t | tmc51x0_test_config::SPI_MOSI = GPIO_NUM_6 |
| SPI MOSI (master out, slave in) | |
| constexpr gpio_num_t | tmc51x0_test_config::SPI_MISO = GPIO_NUM_2 |
| SPI MISO (master in, slave out) | |
| constexpr gpio_num_t | tmc51x0_test_config::SPI_CS = GPIO_NUM_18 |
| SPI chip select pin. | |
| constexpr gpio_num_t | tmc51x0_test_config::DRV_EN = GPIO_NUM_11 |
| Driver enable pin (DRV_ENN) | |
| constexpr gpio_num_t | tmc51x0_test_config::CLK = GPIO_NUM_10 |
| Clock input pin (CLK, pin 12) | |
| constexpr gpio_num_t | tmc51x0_test_config::SPI_MODE_PIN = GPIO_NUM_0 |
| SPI_MODE pin (pin 22) - GPIO0 if available as control pin. | |
| constexpr gpio_num_t | tmc51x0_test_config::SD_MODE_PIN = GPIO_NUM_1 |
| SD_MODE pin (pin 21) - GPIO1 if available as control pin. | |
| constexpr gpio_num_t | tmc51x0_test_config::DIAG0 = GPIO_NUM_23 |
| Diagnostic output 0 (DIAG0_SWN, pin 26) | |
| constexpr gpio_num_t | tmc51x0_test_config::DIAG1 = GPIO_NUM_15 |
| Diagnostic output 1 (DIAG1_SWP, pin 27) | |
| constexpr gpio_num_t | tmc51x0_test_config::DIR = static_cast<gpio_num_t>(-1) |
| Direction pin (optional) | |
| constexpr gpio_num_t | tmc51x0_test_config::STEP = static_cast<gpio_num_t>(-1) |
| Step pin (optional) | |
| constexpr uint32_t | tmc51x0_test_config::SPI_CLOCK_SPEED_HZ = 500000 |
| SPI clock speed. | |
| constexpr spi_host_device_t | tmc51x0_test_config::SPI_HOST = SPI2_HOST |
| SPI host device. | |
ESP32 GPIO pin configuration and compile-time configuration for TMC51x0 driver (TMC5130 & TMC5160)
This file defines compile-time configuration for TMC51x0 driver initialization using struct-based configuration with static constexpr members for zero runtime overhead.
All configurations are defined as structs with static constexpr members:
The TestRigConfig template provides unified access to all configurations:
You can also access configuration structs directly:
For advanced use cases, you can still manually select motor, board, and platform:
This file also provides GPIO pin assignments and a complete Esp32SpiPinConfig structure.
The project uses two test rigs, each with a specific motor, board, and platform configuration:
TEST_RIG_CORE_DRIVER):TEST_RIG_FATIGUE):