### Get Hysteresis Start Value Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_t_m_c_stepper_8h_source.html Retrieves the current 'THysteresisStart' setting of the TMC2660Stepper driver. ```cpp uint8_t hysteresis_start(); ``` -------------------------------- ### begin() Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/class_t_m_c2160_stepper.html Initializes the TMC2160Stepper. ```APIDOC ## POST /begin ### Description Initializes the TMC2160Stepper. ### Method POST ### Endpoint /begin ### Parameters None ### Request Example None ### Response #### Success Response (200) - **status** (string) - Indicates success or failure of the initialization. #### Response Example ```json { "status": "initialized" } ``` ``` -------------------------------- ### Homing Start Control Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/class_t_m_c2660_stepper.html Functions to set and get the homing start value. ```APIDOC ## hstrt ### Description Sets or gets the homing start value. ### Method - `void hstrt(uint8_t value)`: Sets the homing start. - `uint8_t hstrt()`: Gets the homing start. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "value": 2 } ``` ### Response #### Success Response (200) - `uint8_t`: The current homing start value. #### Response Example ```json { "start": 2 } ``` ``` -------------------------------- ### Get Hysteresis Start Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_t_m_c2660_stepper_8cpp_source.html Returns the hysteresis start value incremented by one. ```cpp uint8_t TMC2660Stepper::hysteresis_start() { return hstrt()+1; } ``` -------------------------------- ### begin() Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/class_t_m_c5130_stepper.html Initializes the stepper driver hardware. ```APIDOC ## begin() ### Description Performs the necessary initialization for the TMC5130Stepper driver. ``` -------------------------------- ### begin() Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/class_t_m_c2660_stepper.html Initializes the TMC2660 stepper driver. ```APIDOC ## void begin() ### Description Initializes the TMC2660 stepper driver hardware communication. ``` -------------------------------- ### Get Hysteresis Start Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_t_m_c_stepper_8h_source.html Retrieves the current hysteresis start setting of the stepper driver. ```cpp uint8_t [hysteresis_start](class_t_m_c_stepper.html#ac06189981d4400bf5961719f468c39b1)(); ``` -------------------------------- ### TMC2130Stepper::begin Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_t_m_c2130_stepper_8cpp_source.html Initializes the TMC2130Stepper driver. ```APIDOC ## TMC2130Stepper::begin ### Description Initializes the TMC2130 stepper driver, preparing it for operation. ### Method ``` void begin() ``` ### Endpoint N/A (Class method) ### Parameters None ### Request Example None ### Response None ``` -------------------------------- ### TMCStepper::hstrt() (Get) Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/class_t_m_c_stepper.html Retrieves the hysteresis start value. ```APIDOC ## GET /teemuatlut/tmcstepper/hstrt ### Description Retrieves the hysteresis start value. ### Method GET ### Endpoint /teemuatlut/tmcstepper/hstrt ### Parameters None ### Response #### Success Response (200) - **hstrt** (uint8_t) - The hysteresis start value. #### Response Example ```json { "hstrt": 3 } ``` ``` -------------------------------- ### Get Hysteresis Start Value Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_t_m_c_stepper_8cpp_source.html Retrieves the hysteresis start value. The value read from the internal 'hstrt' register is adjusted by +1 to provide the user-facing value. ```cpp uint8_t TMCStepper::hysteresis_start() { return [hstrt](class_t_m_c_stepper.html#ae40affb96ca05b4380adbdd961b62c7e)()+1; } ``` -------------------------------- ### Member Function: begin Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/class_t_m_c2208_stepper.html Initializes the TMC2208Stepper. ```APIDOC ## void begin() ### Description Initializes the TMC2208Stepper device. ### Method `void begin` ### Endpoint N/A (This is a class method, not an API endpoint) ### Parameters None ### Request Example ```cpp TMC2208Stepper stepper(Serial, 0.11f, 0b00); stepper.begin(); ``` ### Response #### Success Response (200) N/A (This method does not return a value indicating success/failure in this format) #### Response Example N/A ``` -------------------------------- ### Initialize TMCStepper Driver and Basic Setup Source: https://context7.com/teemuatlut/tmcstepper/llms.txt Initializes the TMCStepper driver and sets essential parameters. Ensure the driver is enabled (toff > 0), current is set, microsteps are configured, and automatic current scaling is enabled. ```cpp #include #define EN_PIN 38 #define STEP_PIN 54 #define DIR_PIN 55 #define CS_PIN 42 #define R_SENSE 0.11f TMC2130Stepper driver(CS_PIN, R_SENSE); void setup() { pinMode(EN_PIN, OUTPUT); pinMode(STEP_PIN, OUTPUT); pinMode(DIR_PIN, OUTPUT); digitalWrite(EN_PIN, LOW); // Enable driver (active LOW) SPI.begin(); driver.begin(); // Initialize driver registers driver.toff(5); // Enable driver (toff > 0 enables output) driver.rms_current(600); // Set motor RMS current to 600mA driver.microsteps(16); // Set microstepping to 1/16 driver.pwm_autoscale(true); // Enable automatic current scaling } ``` -------------------------------- ### TMCStepper - hysteresis_start Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/class_t_m_c2208_stepper-members.html Sets or gets the hysteresis start value for the TMCStepper driver. ```APIDOC ## POST /hysteresis_start ### Description Sets the hysteresis start value for the TMCStepper driver. ### Method POST ### Endpoint /hysteresis_start ### Parameters #### Request Body - **value** (uint8_t) - Required - The hysteresis start value to set. ### Request Example ```json { "value": 10 } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "hysteresis_start set successfully" } ``` ## GET /hysteresis_start ### Description Gets the current hysteresis start value from the TMCStepper driver. ### Method GET ### Endpoint /hysteresis_start ### Response #### Success Response (200) - **hysteresis_start_value** (uint8_t) - The current hysteresis start value. #### Response Example ```json { "hysteresis_start_value": 10 } ``` ``` -------------------------------- ### TMCStepper - hysteresis_start Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/class_t_m_c2224_stepper-members.html Sets or gets the hysteresis start value for the TMCStepper driver. ```APIDOC ## POST /api/stepper/tmc/hysteresis_start ### Description Sets or gets the hysteresis start value for the TMC stepper driver. ### Method POST ### Endpoint /api/stepper/tmc/hysteresis_start ### Parameters #### Request Body - **value** (uint8_t) - Required - The value to set for hysteresis start. ### Request Example ```json { "value": 10 } ``` ### Response #### Success Response (200) - **status** (string) - Indicates success or failure. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Begin TMC2660Stepper Operation Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_t_m_c_stepper_8h_source.html Initializes the TMC2660Stepper driver. Call this after constructing the object and before performing other operations. ```cpp void begin(); ``` -------------------------------- ### TMC2160Stepper Initialization and Configuration Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_t_m_c_stepper_8h_source.html Methods for starting the stepper driver, setting default configurations, and pushing settings. ```APIDOC ## TMC2160Stepper Initialization and Configuration ### Description Provides methods to initialize the stepper driver, apply default settings, and push configuration changes. ### Method `begin()` `defaults()` `push()` ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### TMC2660Stepper::hysteresis_start Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_t_m_c2660_stepper_8cpp_source.html Gets the current hysteresis start value. This value is used to determine the starting point for the hysteresis function, which helps in reducing motor noise and vibration. ```APIDOC ## TMC2660Stepper::hysteresis_start ### Description Gets the current hysteresis start value. This value is used to determine the starting point for the hysteresis function, which helps in reducing motor noise and vibration. ### Method GET ### Endpoint /api/stepper/hysteresis_start ### Response #### Success Response (200) - **hysteresis_start** (uint8_t) - The current hysteresis start value. #### Response Example ```json { "hysteresis_start": 5 } ``` ``` -------------------------------- ### TMC2660Stepper Constructor Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_t_m_c2660_stepper_8cpp_source.html Initializes a new instance of the TMC2660Stepper driver. ```APIDOC ## TMC2660Stepper Constructor ### Description Initializes the TMC2660Stepper object with the specified chip select pin and sense resistor value. ### Method Constructor ### Parameters - **pinCS** (uint16_t) - Required - The chip select pin number. - **RS** (float) - Optional - The sense resistor value (defaults to default_RS). ``` -------------------------------- ### TMC2160Stepper::begin Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_t_m_c5130_stepper_8cpp_source.html Initializes the TMC2160 stepper driver. ```APIDOC ## void begin() ### Description Performs the initialization sequence for the TMC2160 stepper driver. ### Method void ``` -------------------------------- ### TMCStepper Hysteresis Control Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_t_m_c_stepper_8cpp_source.html Functions for setting and getting the hysteresis start and end values. ```APIDOC ## TMCStepper Hysteresis API ### Description This API allows for the configuration and retrieval of hysteresis settings for the TMC stepper motor driver. Hysteresis is used to control the motor's behavior under varying load conditions. ### Functions #### `void hysteresis_end(int8_t value)` ##### Description Sets the hysteresis end value. The input value is adjusted by adding 3 before being stored internally. ##### Parameters - **value** (int8_t) - The desired hysteresis end value. #### `int8_t hysteresis_end()` ##### Description Retrieves the current hysteresis end value. The internally stored value is adjusted by subtracting 3 before being returned. ##### Returns - int8_t - The current hysteresis end value. #### `void hysteresis_start(uint8_t value)` ##### Description Sets the hysteresis start value. The input value is adjusted by subtracting 1 before being stored internally. ##### Parameters - **value** (uint8_t) - The desired hysteresis start value. #### `uint8_t hysteresis_start()` ##### Description Retrieves the current hysteresis start value. The internally stored value is adjusted by adding 1 before being returned. ##### Returns - uint8_t - The current hysteresis start value. ### Internal Details - The `hysteresis_end` function interacts with an internal `hend` value, applying an offset of +3 during setting and -3 during retrieval. - The `hysteresis_start` function interacts with an internal `hstrt` value, applying an offset of -1 during setting and +1 during retrieval. ``` -------------------------------- ### TMC2208Stepper Initialization and Configuration Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/class_t_m_c2224_stepper-members.html Methods for initializing and configuring the TMC2208Stepper driver. ```APIDOC ## TMC2208Stepper Initialization and Configuration ### Description This section details methods related to the initialization and configuration of the TMC2208Stepper driver. ### Methods #### INIT_REGISTER(FACTORY_CONF) * **Description**: Initializes the driver with factory configuration. * **Method**: N/A (Constructor or initialization function) * **Endpoint**: N/A #### internal_Rsense(bool B) * **Description**: Sets the internal Rsense value. * **Method**: N/A * **Endpoint**: N/A #### internal_Rsense() * **Description**: Gets the internal Rsense value. * **Method**: N/A * **Endpoint**: N/A #### intpol(bool B) * **Description**: Enables or disables interpolation. * **Method**: N/A * **Endpoint**: N/A #### intpol() * **Description**: Gets the interpolation status. * **Method**: N/A * **Endpoint**: N/A #### isEnabled() * **Description**: Checks if the driver is enabled. * **Method**: N/A * **Endpoint**: N/A #### max_retries * **Description**: Property to get or set the maximum number of retries. * **Method**: N/A * **Endpoint**: N/A #### mres(uint8_t B) * **Description**: Sets the motor resistance. * **Method**: N/A * **Endpoint**: N/A #### mres() * **Description**: Gets the motor resistance. * **Method**: N/A * **Endpoint**: N/A #### mstep_reg_select(bool B) * **Description**: Selects the mstep register. * **Method**: N/A * **Endpoint**: N/A #### mstep_reg_select() * **Description**: Gets the mstep register selection status. * **Method**: N/A * **Endpoint**: N/A #### multistep_filt(bool B) * **Description**: Enables or disables multistep filter. * **Method**: N/A * **Endpoint**: N/A #### multistep_filt() * **Description**: Gets the multistep filter status. * **Method**: N/A * **Endpoint**: N/A #### ola() * **Description**: Gets the OLA status. * **Method**: N/A * **Endpoint**: N/A #### olb() * **Description**: Gets the OLB status. * **Method**: N/A * **Endpoint**: N/A #### ot() * **Description**: Gets the OT status. * **Method**: N/A * **Endpoint**: N/A #### OTP_PROG(uint16_t input) * **Description**: Programs the OTP value. * **Method**: N/A * **Endpoint**: N/A #### OTP_READ() * **Description**: Reads the OTP value. * **Method**: N/A * **Endpoint**: N/A #### otpw() * **Description**: Gets the OTPW status. * **Method**: N/A * **Endpoint**: N/A #### otttrim(uint8_t B) * **Description**: Sets the OTtrim value. * **Method**: N/A * **Endpoint**: N/A #### otttrim() * **Description**: Gets the OTtrim value. * **Method**: N/A * **Endpoint**: N/A #### pdn_disable(bool B) * **Description**: Enables or disables power down. * **Method**: N/A * **Endpoint**: N/A #### pdn_disable() * **Description**: Gets the power down status. * **Method**: N/A * **Endpoint**: N/A #### push() * **Description**: Pushes configuration to the driver. * **Method**: N/A * **Endpoint**: N/A #### PWM_AUTO() * **Description**: Enables automatic PWM mode. * **Method**: N/A * **Endpoint**: N/A ``` -------------------------------- ### Get VSTART Register Value Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_t_m_c5130_stepper_8cpp_source.html Retrieves the current value of the VSTART register. This is typically used to read the start velocity setting. ```cpp uint32_t TMC5130Stepper::VSTART() { return VSTART_register.sr; } ``` -------------------------------- ### TMC5130Stepper begin() Method Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_t_m_c5130_stepper_8cpp_source.html Initializes the TMC5130Stepper by calling the parent begin() method and setting initial XTARGET and XACTUAL values to 0. This method prepares the stepper driver for operation. ```cpp void TMC5130Stepper::begin() { TMC2160Stepper::begin(); XTARGET(0); XACTUAL(0); //while (( RAMP_STAT() & cfg.VZERO_bm) != cfg.VZERO_bm) {} } ``` -------------------------------- ### Read Hysteresis Start Value Source: https://github.com/teemuatlut/tmcstepper/wiki/API_TMC2130 Reads the current effective hysteresis start value. ```cpp uint8_t hysteresis_start() ``` -------------------------------- ### TMC2130Stepper::pwm_freq() (Get) Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/class_t_m_c2130_stepper.html Gets the PWM frequency setting for the TMC2130 stepper motor driver. ```APIDOC ## uint8_t TMC2130Stepper::pwm_freq() ### Description Gets the current PWM frequency setting for the TMC2130 stepper motor driver. ### Method GET ### Endpoint /api/stepper/tmc2130/pwm_freq ### Parameters None ### Request Example None ### Response #### Success Response (200) - **pwm_frequency** (uint8_t) - The current PWM frequency value. #### Response Example ```json { "pwm_frequency": 5 } ``` ``` -------------------------------- ### Begin TMC2130 Driver Initialization Source: https://github.com/teemuatlut/tmcstepper/wiki/API_TMC2130 Sets pin modes, initializes software SPI, and pushes default register values for GCONF, CHOPCONF, COOLCONF, PWMCONF, and IHOLD_IRUN. Also sets off time to 8 and blank time to 24. ```cpp void begin() ``` -------------------------------- ### Configure PWM Settings (PWMCONF) Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_t_m_c_stepper_8h_source.html Sets or gets the overall PWM configuration. Accepts a uint32_t value for setting. ```cpp void PWMCONF(uint32_t input); ``` ```cpp uint32_t PWMCONF(); ``` -------------------------------- ### TMC2130Stepper::pwm_autoscale() (Get) Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/class_t_m_c2130_stepper.html Gets the PWM autoscale setting for the TMC2130 stepper motor driver. ```APIDOC ## bool TMC2130Stepper::pwm_autoscale() ### Description Gets the current PWM autoscale setting for the TMC2130 stepper motor driver. ### Method GET ### Endpoint /api/stepper/tmc2130/pwm_autoscale ### Parameters None ### Request Example None ### Response #### Success Response (200) - **pwm_autoscale** (bool) - True if PWM autoscale is enabled, false otherwise. #### Response Example ```json { "pwm_autoscale": true } ``` ``` -------------------------------- ### TMC2130Stepper::pwm_ampl() (Get) Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/class_t_m_c2130_stepper.html Gets the PWM amplitude setting for the TMC2130 stepper motor driver. ```APIDOC ## uint8_t TMC2130Stepper::pwm_ampl() ### Description Gets the current PWM amplitude setting for the TMC2130 stepper motor driver. ### Method GET ### Endpoint /api/stepper/tmc2130/pwm_ampl ### Parameters None ### Request Example None ### Response #### Success Response (200) - **pwm_amplitude** (uint8_t) - The current PWM amplitude value. #### Response Example ```json { "pwm_amplitude": 128 } ``` ``` -------------------------------- ### TMC2208Stepper::begin Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_t_m_c2208_stepper_8cpp_source.html Initializes the TMC2208 stepper driver. ```APIDOC ## void begin() ### Description Initializes the TMC2208 stepper driver instance. ### Method void ### Endpoint TMC2208Stepper::begin() ``` -------------------------------- ### TMCStepper Initialization Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/class_t_m_c5160_stepper-members.html Methods for initializing TMCStepper with general settings. ```APIDOC ## TMCStepper::INIT_REGISTER ### Description Initializes the TMCStepper with general settings. ### Method protected ### Endpoint N/A (Class method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ``` TMCStepper::INIT_REGISTER(IHOLD_IRUN) TMCStepper::INIT_REGISTER(TPOWERDOWN) TMCStepper::INIT_REGISTER(TPWMTHRS) ``` ### Response #### Success Response (200) N/A (Method call) #### Response Example None ``` -------------------------------- ### Set Hysteresis Start Value Source: https://github.com/teemuatlut/tmcstepper/wiki/API_TMC2130 Sets the effective hysteresis start value. Valid range is [1 to 8]. ```cpp void hysteresis_start(uint8_t) ``` -------------------------------- ### Get TMC2660Stepper MRES Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_d_r_v_c_t_r_l_8cpp_source.html Gets the micro-step resolution setting. Disables the driver if it's currently enabled, then reads the register. ```cpp uint8_t TMC2660Stepper::mres(){ if([sdoff](class_t_m_c2660_stepper.html#aa20df51be5967e40cc23132a1d461275)()) [sdoff](class_t_m_c2660_stepper.html#aa20df51be5967e40cc23132a1d461275)(0); [GET_REG0](_d_r_v_c_t_r_l_8cpp.html#a2543a2e98c05e6772d620d3c538ef0c4)([mres](class_t_m_c2660_stepper.html#a90c921e4f637bb688c5fadf491ee6f44)); } ``` -------------------------------- ### TMC2130Stepper Configuration Methods Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/class_t_m_c2130_stepper.html Methods for getting and setting configuration parameters like vhighchm, vhighfs, and vsense. ```APIDOC ## vhighchm() ### Description Gets or sets the vhighchm configuration. ### Parameters - **B** (bool) - Optional - The value to set for vhighchm. ## vhighfs() ### Description Gets or sets the vhighfs configuration. ### Parameters - **B** (bool) - Optional - The value to set for vhighfs. ## vsense() ### Description Gets or sets the vsense configuration. ### Parameters - **B** (bool) - Optional - The value to set for vsense. ``` -------------------------------- ### Set Hysteresis Start Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_t_m_c_stepper_8h_source.html Sets the hysteresis start value for the stepper driver. This parameter affects the driver's current control. ```cpp void [hysteresis_start](class_t_m_c_stepper.html#ac06189981d4400bf5961719f468c39b1)(uint8_t value); ``` -------------------------------- ### TMC2660Stepper Configuration Methods Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/class_t_m_c2660_stepper.html Methods for getting and setting configuration values for ts2g, tst, and vsense. ```APIDOC ## ts2g() ### Description Gets or sets the ts2g configuration value. ### Parameters #### Request Body - **B** (uint8_t) - Optional - The value to set for ts2g. ### Response - **Return** (uint8_t) - The current ts2g value. ## tst() ### Description Gets or sets the tst configuration value. ### Parameters #### Request Body - **B** (bool) - Optional - The value to set for tst. ### Response - **Return** (bool) - The current tst value. ## vsense() ### Description Gets or sets the vsense configuration value. ### Parameters #### Request Body - **B** (bool) - Optional - The value to set for vsense. ### Response - **Return** (bool) - The current vsense value. ``` -------------------------------- ### Get TMC2660Stepper INT POL Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_d_r_v_c_t_r_l_8cpp_source.html Gets the interpolation mode setting. Disables the driver if it's currently enabled, then reads the register. ```cpp bool TMC2660Stepper::intpol() { if([sdoff](class_t_m_c2660_stepper.html#aa20df51be5967e40cc23132a1d461275)()) [sdoff](class_t_m_c2660_stepper.html#aa20df51be5967e40cc23132a1d461275)(0); [GET_REG0](_d_r_v_c_t_r_l_8cpp.html#a2543a2e98c05e6772d620d3c538ef0c4)([intpol](class_t_m_c2660_stepper.html#a75917a3c209b939392c44a2012287820)); } ``` -------------------------------- ### Configuration and State Methods Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/class_t_m_c5161_stepper-members.html Methods for configuring driver settings and retrieving state information. ```APIDOC ## Configuration Methods ### Description Methods to set or get configuration parameters like Rsense, interpolation, and current settings. ### Methods - internal_Rsense(bool B) / internal_Rsense() - intpol(bool B) / intpol() - inv(bool B) / inv() - IOIN() - irun(uint8_t B) / irun() - isEnabled() - latch_l_active(bool B) / latch_l_active() - latch_l_inactive(bool B) ``` -------------------------------- ### TMC2160Stepper Constructor Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_t_m_c2160_stepper_8cpp_source.html Initializes a new instance of the TMC2160Stepper driver. ```APIDOC ## TMC2160Stepper::TMC2160Stepper ### Description Initializes the TMC2160 stepper motor driver instance. ### Parameters - **pinCS** (uint16_t) - Required - Chip select pin number. - **RS** (float) - Optional - Sense resistor value (default: default_RS). - **link_index** (int8_t) - Optional - Link index (default: -1). ``` -------------------------------- ### Get seup Register Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_c_o_o_l_c_o_n_f_8cpp_source.html Gets the 'seup' field of the COOLCONF register. This function is part of the TMC2130Stepper class and uses the GET_REG macro. ```cpp uint8_t TMC2130Stepper::seup() { GET_REG(seup); } ``` -------------------------------- ### Get semin Register Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_c_o_o_l_c_o_n_f_8cpp_source.html Gets the 'semin' field of the COOLCONF register. This function is part of the TMC2130Stepper class and uses the GET_REG macro. ```cpp uint8_t TMC2130Stepper::semin() { GET_REG(semin); } ``` -------------------------------- ### Status and Configuration Methods Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_t_m_c_stepper_8h_source.html Methods for checking driver status and configuring PWM parameters. ```cpp bool olb(); bool stst(); void PWMCONF( uint32_t value); uint32_t PWMCONF(); void pwm_ampl( uint8_t B); void pwm_grad( uint8_t B); void pwm_freq( uint8_t B); void pwm_autoscale( bool B); void pwm_symmetric( bool B); void freewheel( uint8_t B); uint8_t pwm_ampl(); uint8_t pwm_grad(); uint8_t pwm_freq(); bool pwm_autoscale(); bool pwm_symmetric(); uint8_t freewheel(); uint8_t PWM_SCALE(); ``` -------------------------------- ### Set Hysteresis Start Value Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_t_m_c_stepper_8cpp_source.html Sets the hysteresis start value. The input value is adjusted by -1 before being written to the internal 'hstrt' register. ```cpp void TMCStepper::hysteresis_start(uint8_t value) { [hstrt](class_t_m_c_stepper.html#ae40affb96ca05b4380adbdd961b62c7e)(value-1); } ``` -------------------------------- ### TMC5130Stepper Initialization and Control Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_t_m_c_stepper_8h_source.html Methods for initializing the TMC5130 driver, setting defaults, and pushing configurations to the hardware. ```APIDOC ## TMC5130Stepper::begin ### Description Initializes the TMC5130 stepper driver. ### Method void ## TMC5130Stepper::defaults ### Description Resets the driver configuration to default values. ### Method void ## TMC5130Stepper::push ### Description Synchronizes the local configuration with the physical driver registers. ### Method void ``` -------------------------------- ### Get TMC2660Stepper DEDGE Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_d_r_v_c_t_r_l_8cpp_source.html Gets the "stealthChop" mode setting. Disables the driver if it's currently enabled, then reads the register. ```cpp bool TMC2660Stepper::dedge() { if([sdoff](class_t_m_c2660_stepper.html#aa20df51be5967e40cc23132a1d461275)()) [sdoff](class_t_m_c2660_stepper.html#aa20df51be5967e40cc23132a1d461275)(0); [GET_REG0](_d_r_v_c_t_r_l_8cpp.html#a2543a2e98c05e6772d620d3c538ef0c4)([dedge](class_t_m_c2660_stepper.html#a42f53be2a3773280e12cf9499dd02265)); } ``` -------------------------------- ### TMC2160Stepper Initialization Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/class_t_m_c5160_stepper-members.html Methods for initializing TMC2160Stepper with different configuration options. ```APIDOC ## TMC2160Stepper::INIT_REGISTER ### Description Initializes the TMC2160Stepper with a specified configuration. ### Method protected ### Endpoint N/A (Class method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ``` TMC2160Stepper::INIT_REGISTER(SHORT_CONF) TMC2160Stepper::INIT_REGISTER(DRV_CONF) TMC2160Stepper::INIT_REGISTER(GLOBAL_SCALER) ``` ### Response #### Success Response (200) N/A (Method call) #### Response Example None ``` -------------------------------- ### Set Hysteresis Start Value Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_t_m_c_stepper_8h_source.html Sets the 'THysteresisStart' value, which defines the start point of the hysteresis window for current control. This parameter influences motor behavior. ```cpp void hysteresis_start(uint8_t value); ``` -------------------------------- ### TMC5161Stepper Constructor Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_t_m_c_stepper_8h_source.html Initializes a new instance of the TMC5161Stepper driver. ```APIDOC ## TMC5161Stepper(uint16_t pinCS, float RS, int8_t link_index) ### Description Constructor for the TMC5161Stepper class. ### Parameters - **pinCS** (uint16_t) - Required - Chip select pin number. - **RS** (float) - Optional - Sense resistor value (default: default_RS). - **link_index** (int8_t) - Optional - Link index for daisy chaining (default: -1). ``` -------------------------------- ### VACTUAL() Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/class_t_m_c5130_stepper.html Gets the actual velocity. ```APIDOC ## int32_t VACTUAL() ### Description Gets the actual velocity. ### Method int32_t ### Endpoint N/A (Class method) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **int32_t**: The actual velocity value. #### Response Example N/A ``` -------------------------------- ### TMCStepper Initialization and Configuration Methods Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/functions_i.html Common methods used for initializing registers and configuring stepper driver parameters such as current scaling, hold current, and internal sense resistors. ```APIDOC ## Initialization and Configuration ### Description Methods for initializing driver registers and setting operational parameters. ### Methods - **INIT_REGISTER()**: Initializes the driver registers for various models (TMC2130, TMC2160, TMC2208, TMC2209, TMC5130, TMC5160). - **I_scale_analog()**: Configures the analog current scaling. - **internal_Rsense()**: Configures the internal sense resistor settings. - **isEnabled()**: Checks if the driver is currently enabled. ### Parameters - **TMCStepper Classes**: The methods are available across various driver classes including TMC2130Stepper, TMC2208Stepper, and TMC5130Stepper. ``` -------------------------------- ### Connection and Configuration Methods Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/functions_t.html Methods for testing driver connections and setting power-related thresholds. ```APIDOC ## test_connection() ### Description Verifies the communication link with the stepper driver. ### Method GET ### Endpoint /test_connection ## TCOOLTHRS(uint32_t) ### Description Sets the coolStep threshold speed. Below this speed, coolStep is disabled. ### Method POST ### Endpoint /TCOOLTHRS ## TPOWERDOWN(uint32_t) ### Description Sets the delay time after which the driver enters power-down mode. ### Method POST ### Endpoint /TPOWERDOWN ``` -------------------------------- ### SHORT_CONF() Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/class_t_m_c2160_stepper.html Gets the SHORT_CONF value. ```APIDOC ## uint32_t SHORT_CONF() ### Description Gets the SHORT_CONF value. ### Method uint32_t ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### s2vs_level() Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/class_t_m_c2160_stepper.html Gets the S2VS level. ```APIDOC ## uint8_t s2vs_level() ### Description Gets the S2VS level. ### Method uint8_t ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### TMC5160Stepper Constructor Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_t_m_c5160_stepper_8cpp_source.html Initializes the TMC5160Stepper driver with specified parameters. ```APIDOC ## TMC5160Stepper Constructor ### Description Initializes the TMC5160Stepper driver. Allows setting the CS pin, reference resistor value, and link index. ### Method Constructor ### Parameters #### Path Parameters - **pinCS** (uint16_t) - Required - The chip select pin for the driver. - **RS** (float) - Optional - The value of the reference resistor (default is `default_RS`). - **link_index** (int8_t) - Optional - The index for linking drivers (default is -1). ### Request Example ```cpp TMC5160Stepper stepper(10); ``` ### Response N/A (Constructor) ``` -------------------------------- ### TMCStepper Configuration Methods Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/class_t_m_c2160_stepper-members.html Methods for configuring power, thresholds, and stepper parameters. ```APIDOC ## TPOWERDOWN ### Description Sets or gets the TPOWERDOWN register value. ### Parameters #### Request Body - **input** (uint8_t) - Optional - The value to set for TPOWERDOWN. --- ## TPWMTHRS ### Description Sets or gets the TPWMTHRS register value. ### Parameters #### Request Body - **input** (uint32_t) - Optional - The value to set for TPWMTHRS. ``` -------------------------------- ### s2g_level() Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/class_t_m_c2160_stepper.html Gets the S2G level. ```APIDOC ## uint8_t s2g_level() ### Description Gets the S2G level. ### Method uint8_t ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### version() Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/class_t_m_c5130_stepper.html Gets the version of the stepper driver. ```APIDOC ## uint8_t version() ### Description Gets the version of the stepper driver. ### Method uint8_t ### Endpoint N/A (Class method) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **uint8_t**: The version number of the stepper driver. #### Response Example N/A ``` -------------------------------- ### TMCStepper::hysteresis_start (overload 1) Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/class_t_m_c_stepper.html Initializes hysteresis start for the TMCStepper motor driver. ```APIDOC ## uint8_t hysteresis_start() ### Description Initializes hysteresis start for the TMCStepper motor driver. ### Method uint8_t ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### shortfilter() Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/class_t_m_c2160_stepper.html Gets the short filter value. ```APIDOC ## uint8_t shortfilter() ### Description Gets the short filter value. ### Method uint8_t ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### TMC2660Stepper Initialization and Basic Control Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_t_m_c_stepper_8h_source.html Methods for initializing the stepper driver and performing basic operations like reading, writing, and checking connection status. ```APIDOC ## TMC2660Stepper Initialization and Control ### Description Methods to initialize the TMC2660 driver and perform low-level SPI communication. ### Methods - **TMC2660Stepper(uint16_t pinCS, float RS)**: Constructor with CS pin and sense resistor value. - **void write(uint8_t addressByte, uint32_t config)**: Writes a configuration value to a specific register address. - **uint32_t read()**: Reads the current register value. - **void begin()**: Initializes the driver. - **uint8_t test_connection()**: Verifies communication with the driver. ``` -------------------------------- ### ms2() Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/class_t_m_c2209_stepper.html Gets the status of the MS2 input. ```APIDOC ## ms2() ### Description Gets the status of the MS2 input. ### Method GET ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **bool**: The status of the MS2 input. #### Response Example ```json { "ms2_status": false } ``` ``` -------------------------------- ### TMC2209Stepper Initialization Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/class_t_m_c2209_stepper.html Initializes the TMC2209Stepper with CHOPCONF or PWMCONF settings. ```APIDOC ## TMC2209Stepper Initialization ### Description Initializes the TMC2209Stepper with either CHOPCONF or PWMCONF configuration. ### Methods - `INIT2208_REGISTER(CHOPCONF)` - `INIT2208_REGISTER(PWMCONF)` ### Parameters - `CHOPCONF`: Configuration structure for chop mode. - `PWMCONF`: Configuration structure for PWM mode. ``` -------------------------------- ### ms1() Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/class_t_m_c2209_stepper.html Gets the status of the MS1 input. ```APIDOC ## ms1() ### Description Gets the status of the MS1 input. ### Method GET ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **bool**: The status of the MS1 input. #### Response Example ```json { "ms1_status": true } ``` ``` -------------------------------- ### PWM Configuration Constructor Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/functions_p.html Details the constructor for PWM configuration. ```APIDOC ## PWM Configuration Constructor ### Description Constructor for initializing PWM configuration settings. ### Method - **PWMCONF()** ### Associated Classes - TMC2130Stepper - TMC2160Stepper - TMC2208Stepper ``` -------------------------------- ### TMC2660Stepper Methods Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_t_m_c2660_stepper_8cpp_source.html Core methods for initializing the driver, checking status, and managing motor current. ```APIDOC ## void begin() ### Description Initializes the TMC2660 stepper driver by setting pin modes and configuring default off-time and blank-time registers. ### Method void ## bool isEnabled() ### Description Checks if the driver is enabled by verifying if the off-time (toff) is greater than zero. ### Method bool ## uint8_t test_connection() ### Description Tests the connection to the driver by reading the DRVSTATUS register. ### Response - **Returns** (uint8_t) - 1 if connected, 2 if no response, 0 otherwise. ## uint16_t rms_current() ### Description Calculates and returns the current RMS value in milliamperes. ### Method uint16_t ## void rms_current(uint16_t mA) ### Description Sets the motor current in milliamperes. Automatically adjusts the current scale (CS) and sensitivity (vsense) based on the requested current. ### Parameters - **mA** (uint16_t) - Required - Target current in milliamperes. ## void push() ### Description Synchronizes local shadow registers with the physical TMC2660 registers (DRVCTRL, CHOPCONF, SMARTEN, SGCSCONF, DRVCONF). ## void hysteresis_end(int8_t value) ### Description Sets the hysteresis end value. ### Parameters - **value** (int8_t) - Required - The hysteresis end value to set. ``` -------------------------------- ### TMC2130Stepper::dc_sg Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_t_m_c2130_stepper_8cpp_source.html Gets the DC_SG setting. ```APIDOC ## TMC2130Stepper::dc_sg ### Description Retrieves the DC_SG (Stallguard Threshold) setting. ### Method ``` uint8_t dc_sg() ``` ### Endpoint N/A (Class method) ### Parameters None ### Request Example None ### Response #### Success Response (200) - **return value** (uint8_t) - The value of the DC_SG setting. #### Response Example ```json { "example": 10 } ``` ``` -------------------------------- ### TMC2660Stepper Methods Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/class_t_m_c2660_stepper.html A collection of methods for interacting with the TMC2660 stepper driver, including configuration and status retrieval. ```APIDOC ## void phb(bool B) ### Description Sets the phb configuration parameter. ### Parameters #### Request Body - **B** (bool) - Required - The boolean value to set for phb. --- ## void push() ### Description Pushes the current configuration to the TMC2660 stepper driver. --- ## uint8_t rdsel() ### Description Reads the current rdsel configuration value. ### Response - **value** (uint8_t) - The current rdsel value. --- ## void rdsel(uint8_t B) ### Description Sets the rdsel configuration value. ### Parameters #### Request Body - **B** (uint8_t) - Required - The value to set for rdsel. --- ## uint32_t read() ### Description Reads the current status or register value from the TMC2660. ### Response - **value** (uint32_t) - The raw register value read from the driver. --- ## uint16_t rms_current() ### Description Gets the current RMS current setting. ### Response - **mA** (uint16_t) - The current in milliamperes. --- ## void rms_current(uint16_t mA) ### Description Sets the RMS current for the stepper motor. ### Parameters #### Request Body - **mA** (uint16_t) - Required - The target current in milliamperes. --- ## bool rndtf() ### Description Gets the current rndtf configuration state. ### Response - **state** (bool) - The current state of rndtf. --- ## void rndtf(bool B) ### Description Sets the rndtf configuration state. ### Parameters #### Request Body - **B** (bool) - Required - The boolean state to set. --- ## bool s2ga() ### Description Checks the s2ga status flag. ### Response - **status** (bool) - True if s2ga is active, false otherwise. --- ## bool s2gb() ### Description Checks the s2gb status flag. ### Response - **status** (bool) - True if s2gb is active, false otherwise. ``` -------------------------------- ### TMC2130Stepper::sedn Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_t_m_c2130_stepper_8cpp_source.html Gets the SEDN setting. ```APIDOC ## TMC2130Stepper::sedn ### Description Retrieves the SEDN (Set Driver Enable) setting. ### Method ``` uint8_t sedn() ``` ### Endpoint N/A (Class method) ### Parameters None ### Request Example None ### Response #### Success Response (200) - **return value** (uint8_t) - The value of the SEDN setting. #### Response Example ```json { "example": 1 } ``` ``` -------------------------------- ### TMCStepper Configuration Methods Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/class_t_m_c2130_stepper-members.html Methods for configuring basic driver parameters like RMS current and device reset. ```APIDOC ## POST /reset ### Description Resets the TMC stepper driver to its default state. ## POST /rms_current ### Description Sets the RMS current for the stepper motor. ### Parameters #### Request Body - **mA** (uint16_t) - Required - Current in milliamperes - **mult** (float) - Optional - Multiplier for current calculation ``` -------------------------------- ### TMC2130Stepper::maxspeed Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_t_m_c2130_stepper_8cpp_source.html Gets the MAXSPEED setting. ```APIDOC ## TMC2130Stepper::maxspeed ### Description Retrieves the MAXSPEED setting, which defines the maximum speed for the driver. ### Method ``` bool maxspeed() ``` ### Endpoint N/A (Class method) ### Parameters None ### Request Example None ### Response #### Success Response (200) - **return value** (bool) - The status of the MAXSPEED setting. #### Response Example ```json { "example": true } ``` ``` -------------------------------- ### TMC5160Stepper Constructor (pinCS, RS, pinMOSI, pinMISO, pinSCK, link) Source: https://github.com/teemuatlut/tmcstepper/blob/master/docs/_t_m_c5160_stepper_8cpp_source.html Initializes the TMC5160Stepper with detailed SPI pins, reference resistor value, and link ID. Calls the defaults() method for initial configuration. ```cpp TMC5160Stepper::TMC5160Stepper(uint16_t pinCS, float RS, uint16_t pinMOSI, uint16_t pinMISO, uint16_t pinSCK, int8_t link) : TMC5130Stepper(pinCS, RS, pinMOSI, pinMISO, pinSCK, link) { defaults(); } ```