|
HF-TMC51x0 Driver (TMC5130 & TMC5160) 0.1.0-dev
Hardware Agnostic C++ Driver for the TMC51x0 (TMC5130 & TMC5160)
|
Pin active level configuration structure. More...
#include <tmc51x0_comm_interface.hpp>
Public Member Functions | |
| bool | GetActiveLevel (TMC51x0CtrlPin pin) const noexcept |
| Get active level for a specific pin. | |
| void | SetActiveLevel (TMC51x0CtrlPin pin, bool active_level) noexcept |
| Set active level for a specific pin. | |
Public Attributes | |
| bool | en {false} |
| EN pin (DRV_ENN, pin 28): LOW=enable (active LOW) | |
| bool | dir {true} |
| DIR pin (REFR_DIR, pin 18): HIGH=active (active HIGH) | |
| bool | step {true} |
| STEP pin (REFL_STEP, pin 17): HIGH=active (active HIGH) | |
| bool | ref_left |
| REFL_STEP (pin 17): LOW=active (typically active LOW) | |
| bool | ref_right |
| REFR_DIR (pin 18): LOW=active (typically active LOW) | |
| bool | diag0 {true} |
| bool | diag1 {true} |
| bool | enca {true} |
| bool | encb {true} |
| bool | encn {true} |
| bool | dcen {true} |
| DCEN (pin 23): HIGH=active (active HIGH) | |
| bool | dcin {true} |
| DCIN (pin 24): HIGH=active (active HIGH) | |
| bool | dco {true} |
| bool | clk |
| CLK (pin 12): HIGH=active (active HIGH, if used as output) | |
| bool | spi_mode {true} |
| SPI_MODE (pin 22): HIGH=SPI mode (active HIGH) | |
| bool | sd_mode |
| SD_MODE (pin 21): HIGH=External Step/Dir (active HIGH) | |
Pin active level configuration structure.
This structure defines the physical GPIO level (HIGH or LOW) that corresponds to the ACTIVE state for each TMC51x0 control pin. Default values are based on the TMC51x0 datasheet specifications.
Users can create an instance of this struct, modify specific pin active levels if their board has inverters, NOT gates, or other logic that changes pin polarity, and pass it to the communication interface constructor.
Example usage:
|
inlinenoexcept |
Get active level for a specific pin.
| pin | The TMC51x0 control pin |
|
inlinenoexcept |
Set active level for a specific pin.
| pin | The TMC51x0 control pin |
| active_level | The active level (true=HIGH, false=LOW) |
| bool tmc51x0::PinActiveLevels::clk |
CLK (pin 12): HIGH=active (active HIGH, if used as output)
| bool tmc51x0::PinActiveLevels::dcen {true} |
DCEN (pin 23): HIGH=active (active HIGH)
| bool tmc51x0::PinActiveLevels::dcin {true} |
DCIN (pin 24): HIGH=active (active HIGH)
| bool tmc51x0::PinActiveLevels::dco {true} |
DCO (pin 25): Read-only output (default HIGH, but not used for control)
| bool tmc51x0::PinActiveLevels::diag0 {true} |
DIAG0 (pin 26): Read-only output (default HIGH, but not used for control)
| bool tmc51x0::PinActiveLevels::diag1 {true} |
DIAG1 (pin 27): Read-only output (default HIGH, but not used for control)
| bool tmc51x0::PinActiveLevels::dir {true} |
DIR pin (REFR_DIR, pin 18): HIGH=active (active HIGH)
| bool tmc51x0::PinActiveLevels::en {false} |
EN pin (DRV_ENN, pin 28): LOW=enable (active LOW)
| bool tmc51x0::PinActiveLevels::enca {true} |
ENCA (pin 24): Read-only input (default HIGH, but not used for control)
| bool tmc51x0::PinActiveLevels::encb {true} |
ENCB (pin 23): Read-only input (default HIGH, but not used for control)
| bool tmc51x0::PinActiveLevels::encn {true} |
ENCN (pin 25): Read-only input (default HIGH, but not used for control)
| bool tmc51x0::PinActiveLevels::ref_left |
REFL_STEP (pin 17): LOW=active (typically active LOW)
| bool tmc51x0::PinActiveLevels::ref_right |
REFR_DIR (pin 18): LOW=active (typically active LOW)
| bool tmc51x0::PinActiveLevels::sd_mode |
SD_MODE (pin 21): HIGH=External Step/Dir (active HIGH)
| bool tmc51x0::PinActiveLevels::spi_mode {true} |
SPI_MODE (pin 22): HIGH=SPI mode (active HIGH)
| bool tmc51x0::PinActiveLevels::step {true} |
STEP pin (REFL_STEP, pin 17): HIGH=active (active HIGH)