Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Trinamic Stepper Controller

Trinamic Stepper Controller. More...

Data Structures

struct  tmc_stallguard_settings
 Trinamic Stepper StallGuard Settings. More...
struct  tmc_ramp_generator_data
 Trinamic Stepper Ramp Generator data. More...

Macros

#define TMC_RAMP_VACTUAL_SHIFT   22
#define TMC_RAMP_XACTUAL_SHIFT   31
#define TMC_RAMP_DT_SPEC_GET_COMMON(node)
 Get Trinamic Stepper Ramp Generator data from DT.
#define TMC_RAMP_DT_SPEC_GET_TMC50XX(node)
#define TMC_RAMP_DT_SPEC_GET_TMC51XX(node)

Functions

int tmc50xx_stepper_ctrl_set_ramp (const struct device *dev, const struct tmc_ramp_generator_data *ramp_data)
 Configure Trinamic Stepper Ramp Generator.
int tmc50xx_stepper_ctrl_set_max_velocity (const struct device *dev, uint32_t velocity)
 Set the maximum velocity of the stepper motor.
void tmc50xx_stepper_ctrl_configure_stallguard (const struct device *dev, const struct tmc_stallguard_settings *sg_settings)
 Configure TMC50XX Stepper StallGuard settings.
void tmc51xx_stepper_ctrl_configure_stallguard (const struct device *dev, const struct tmc_stallguard_settings *sg_settings)
 Configure TMC51XX Stepper StallGuard settings.
int tmc51xx_stepper_ctrl_set_max_velocity (const struct device *dev, uint32_t velocity)
 Set the maximum velocity of the stepper motor.

Detailed Description

Trinamic Stepper Controller.

Since
4.0
Version
0.9.0

Macro Definition Documentation

◆ TMC_RAMP_DT_SPEC_GET_COMMON

#define TMC_RAMP_DT_SPEC_GET_COMMON ( node)

#include <zephyr/drivers/stepper/stepper_trinamic.h>

Value:
.vstart = DT_PROP(node, vstart), \
.v1 = DT_PROP(node, v1), \
.vmax = DT_PROP(node, vmax), \
.a1 = DT_PROP(node, a1), \
.amax = DT_PROP(node, amax), \
.d1 = DT_PROP(node, d1), \
.dmax = DT_PROP(node, dmax), \
.vstop = DT_PROP(node, vstop), \
.tzerowait = DT_PROP(node, tzerowait), \
.iholdrun = (TMC5XXX_IRUN(DT_PROP(node, irun)) | \
TMC5XXX_IHOLD(DT_PROP(node, ihold)) | \
TMC5XXX_IHOLDDELAY(DT_PROP(node, iholddelay))),
#define DT_PROP(node_id, prop)
Get a devicetree property value.
Definition devicetree.h:873

Get Trinamic Stepper Ramp Generator data from DT.

Parameters
nodeDT node identifier
Returns
struct tmc_ramp_generator_data

◆ TMC_RAMP_DT_SPEC_GET_TMC50XX

#define TMC_RAMP_DT_SPEC_GET_TMC50XX ( node)

#include <zephyr/drivers/stepper/stepper_trinamic.h>

Value:
{ \
TMC_RAMP_DT_SPEC_GET_COMMON(node) \
.vhigh = DT_PROP(node, vhigh), \
.vcoolthrs = DT_PROP(node, vcoolthrs), \
}

◆ TMC_RAMP_DT_SPEC_GET_TMC51XX

#define TMC_RAMP_DT_SPEC_GET_TMC51XX ( node)

#include <zephyr/drivers/stepper/stepper_trinamic.h>

Value:
{ \
TMC_RAMP_DT_SPEC_GET_COMMON(DT_DRV_INST(node)) \
.tpowerdown = DT_INST_PROP(node, tpowerdown), \
.tpwmthrs = DT_INST_PROP(node, tpwmthrs), \
.tcoolthrs = DT_INST_PROP(node, tcoolthrs), \
.thigh = DT_INST_PROP(node, thigh), \
}
#define DT_DRV_INST(inst)
Node identifier for an instance of a DT_DRV_COMPAT compatible.
Definition devicetree.h:4333
#define DT_INST_PROP(inst, prop)
Get a DT_DRV_COMPAT instance property.
Definition devicetree.h:4734

◆ TMC_RAMP_VACTUAL_SHIFT

#define TMC_RAMP_VACTUAL_SHIFT   22

◆ TMC_RAMP_XACTUAL_SHIFT

#define TMC_RAMP_XACTUAL_SHIFT   31

Function Documentation

◆ tmc50xx_stepper_ctrl_configure_stallguard()

void tmc50xx_stepper_ctrl_configure_stallguard ( const struct device * dev,
const struct tmc_stallguard_settings * sg_settings )

#include <zephyr/drivers/stepper/stepper_trinamic.h>

Configure TMC50XX Stepper StallGuard settings.

Parameters
devPointer to the stepper motor controller instance
sg_settingsPointer to a struct containing the required StallGuard parameters

◆ tmc50xx_stepper_ctrl_set_max_velocity()

int tmc50xx_stepper_ctrl_set_max_velocity ( const struct device * dev,
uint32_t velocity )

#include <zephyr/drivers/stepper/stepper_trinamic.h>

Set the maximum velocity of the stepper motor.

Parameters
devPointer to the stepper driver instance
velocityMaximum velocity in microsteps per second.
Return values
-EIOGeneral input / output error
0Success

◆ tmc50xx_stepper_ctrl_set_ramp()

int tmc50xx_stepper_ctrl_set_ramp ( const struct device * dev,
const struct tmc_ramp_generator_data * ramp_data )

#include <zephyr/drivers/stepper/stepper_trinamic.h>

Configure Trinamic Stepper Ramp Generator.

Parameters
devPointer to the stepper motor controller instance
ramp_dataPointer to a struct containing the required ramp parameters
Return values
-EIOGeneral input / output error
-ENOSYSIf not implemented by device driver
0Success

◆ tmc51xx_stepper_ctrl_configure_stallguard()

void tmc51xx_stepper_ctrl_configure_stallguard ( const struct device * dev,
const struct tmc_stallguard_settings * sg_settings )

#include <zephyr/drivers/stepper/stepper_trinamic.h>

Configure TMC51XX Stepper StallGuard settings.

Parameters
devPointer to the stepper motor controller instance
sg_settingsPointer to a struct containing the required StallGuard parameters

◆ tmc51xx_stepper_ctrl_set_max_velocity()

int tmc51xx_stepper_ctrl_set_max_velocity ( const struct device * dev,
uint32_t velocity )

#include <zephyr/drivers/stepper/stepper_trinamic.h>

Set the maximum velocity of the stepper motor.

Parameters
devPointer to the stepper driver instance
velocityMaximum velocity in microsteps per second.
Return values
-EIOGeneral input / output error
0Success