uStepper S
|
Function prototypes and definitions for the TMC5130 motor driver. More...
Go to the source code of this file.
Classes | |
class | uStepperDriver |
Prototype of class for the TMC5130 Driver. More... | |
Macros | |
#define | GCONF 0x00 |
#define | DIRECTION(n) (((n)&0x1)<<4) |
#define | EN_PWM_MODE(n) (((n)&0x1)<<2) |
#define | I_SCALE_ANALOG(n) (((n)&0x1)<<0) |
#define | GSTAT 0x01 |
#define | X_COMPARE 0x05 |
#define | IHOLD_IRUN 0x10 |
#define | TPOWERDOWN 0x11 |
#define | TSTEP 0x12 |
#define | TPWMTHRS 0x13 |
#define | TCOOLTHRS 0x14 |
#define | THIGH 0x15 |
#define | RAMPMODE 0x20 |
#define | XACTUAL 0x21 |
#define | VACTUAL 0x22 |
#define | VSTART_REG 0x23 |
#define | A1_REG 0x24 |
#define | V1_REG 0x25 |
#define | AMAX_REG 0x26 |
#define | VMAX_REG 0x27 |
#define | DMAX_REG 0x28 |
#define | D1_REG 0x2A |
#define | VSTOP_REG 0x2B |
#define | TZEROWAIT 0x2C |
#define | XTARGET 0x2D |
#define | VDCMIN 0x33 |
#define | SW_MODE 0x34 |
#define | SG_STOP(n) (((n)&0x1)<<10) |
#define | RAMP_STAT 0x35 |
#define | XLATCH 0x36 |
#define | PWMCONF 0x70 |
#define | FREEWHEEL(n) (((n)&0x3UL)<<20) |
#define | PWM_AUTOSCALE(n) (((n)&0x1UL)<<18) |
#define | PWM_FREQ(n) (((n)&0x3UL)<<16) |
#define | PWM_GRAD(n) (((n)&0xFF)<<8) |
#define | PWM_AMPL(n) (((n)&0xFF)<<0) |
#define | CHOPCONF 0x6C |
#define | DISS2G(n) (((n)&0x1UL)<<30) |
#define | DEDGE(n) (((n)&0x1UL)<<29) |
#define | INTPOL(n) (((n)&0x1UL)<<28) |
#define | MRES(n) (((n)&0xFUL)<<24) |
#define | SYNC(n) (((n)&0xFUL)<<20) |
#define | VHIGHCHM(n) (((n)&0x1UL)<<19) |
#define | VHIGHFS(n) (((n)&0x1UL)<<18) |
#define | VSENSE(n) (((n)&0x1UL)<<17) |
#define | TBL(n) (((n)&0x3UL)<<15) |
#define | CHM(n) (((n)&0x1UL)<<14) |
#define | RNDTF(n) (((n)&0x1)<<13) |
#define | DISFDCC(n) (((n)&0x1)<<12) |
#define | TFD3(n) (((n)&0x1)<<11) |
#define | HEND(n) (((n)&0xF)<<7) |
#define | HSTRT_TFD(n) (((n)&0x7)<<4) |
#define | TOFF(n) (((n)&0xF)<<0) |
#define | COOLCONF 0x6D |
#define | SFILT(n) (((n)&0x1UL)<<24) |
#define | SGT(n) (((n)&0x7FUL)<<16) |
#define | SEIMIN(n) (((n)&0x1UL)<<15) |
#define | SEDN(n) (((n)&0x3)<<13) |
#define | SEMAX(n) (((n)&0xF)<<8) |
#define | SEUP(n) (((n)&0x3)<<5) |
#define | SEMIN(n) (((n)&0xF)<<0) |
#define | DCCTRL 0x6E |
#define | DC_SG(n) (((n)&0xFFUL)<<16) |
#define | DC_TIME(n) (((n)&0x3FF)<<0) |
#define | DRV_STATUS 0x6F |
#define | IHOLDDELAY(n) (((n)&0xFUL)<<16) |
#define | IRUN(n) (((n)&0x1F)<<8) |
#define | IHOLD(n) (((n)&0x1F)<<0) |
#define | WRITE_ACCESS 0x80 |
#define | POSITIONING_MODE 0x00 |
#define | VELOCITY_MODE_POS 0x01 |
#define | VELOCITY_MODE_NEG 0x02 |
#define | HOLD_MODE 0x03 |
#define | DRIVER_STOP 0 |
#define | DRIVER_VELOCITY 1 |
#define | DRIVER_POSITION 2 |
#define | ACCELERATIONCONVERSION 1.0/116.415321827 |
#define | VELOCITYCONVERSION 1.0/0.953674316 |
Function prototypes and definitions for the TMC5130 motor driver.
This file contains class and function prototypes for the TMC5130 motor driver, as well as necessary constants and global variables.
Definition in file uStepperDriver.h.
#define A1_REG 0x24 |
Please check datasheet for register description
Definition at line 57 of file uStepperDriver.h.
#define ACCELERATIONCONVERSION 1.0/116.415321827 |
page 74 datasheet
Definition at line 140 of file uStepperDriver.h.
#define AMAX_REG 0x26 |
Please check datasheet for register description
Definition at line 59 of file uStepperDriver.h.
#define CHM | ( | n | ) | (((n)&0x1UL)<<14) |
Please check datasheet for register description
Definition at line 95 of file uStepperDriver.h.
#define CHOPCONF 0x6C |
Chopper and driver configuration Please check datasheet for register description
Definition at line 84 of file uStepperDriver.h.
#define COOLCONF 0x6D |
Please check datasheet for register description
Definition at line 106 of file uStepperDriver.h.
#define D1_REG 0x2A |
Please check datasheet for register description
Definition at line 62 of file uStepperDriver.h.
#define DC_SG | ( | n | ) | (((n)&0xFFUL)<<16) |
Please check datasheet for register description
Definition at line 117 of file uStepperDriver.h.
#define DC_TIME | ( | n | ) | (((n)&0x3FF)<<0) |
Please check datasheet for register description
Definition at line 118 of file uStepperDriver.h.
#define DCCTRL 0x6E |
Please check datasheet for register description
Definition at line 116 of file uStepperDriver.h.
#define DEDGE | ( | n | ) | (((n)&0x1UL)<<29) |
Please check datasheet for register description
Definition at line 87 of file uStepperDriver.h.
#define DIRECTION | ( | n | ) | (((n)&0x1)<<4) |
Please check datasheet for register description
Definition at line 39 of file uStepperDriver.h.
#define DISFDCC | ( | n | ) | (((n)&0x1)<<12) |
Please check datasheet for register description
Definition at line 97 of file uStepperDriver.h.
#define DISS2G | ( | n | ) | (((n)&0x1UL)<<30) |
Please check datasheet for register description
Definition at line 86 of file uStepperDriver.h.
#define DMAX_REG 0x28 |
Please check datasheet for register description
Definition at line 61 of file uStepperDriver.h.
#define DRIVER_POSITION 2 |
Define label for indicating driver is in position mode
Definition at line 138 of file uStepperDriver.h.
#define DRIVER_STOP 0 |
Define label for indicating driver is in standstill mode
Definition at line 136 of file uStepperDriver.h.
#define DRIVER_VELOCITY 1 |
Define label for indicating driver is in velocity mode
Definition at line 137 of file uStepperDriver.h.
#define DRV_STATUS 0x6F |
stallGuard2 value and driver error flags
Definition at line 120 of file uStepperDriver.h.
#define EN_PWM_MODE | ( | n | ) | (((n)&0x1)<<2) |
Please check datasheet for register description
Definition at line 40 of file uStepperDriver.h.
#define FREEWHEEL | ( | n | ) | (((n)&0x3UL)<<20) |
Please check datasheet for register description
Definition at line 75 of file uStepperDriver.h.
#define GCONF 0x00 |
Please check datasheet for register description
Definition at line 37 of file uStepperDriver.h.
#define GSTAT 0x01 |
Please check datasheet for register description
Definition at line 43 of file uStepperDriver.h.
#define HEND | ( | n | ) | (((n)&0xF)<<7) |
Please check datasheet for register description
Definition at line 99 of file uStepperDriver.h.
#define HOLD_MODE 0x03 |
velocity remains unchanged, unless stop event occurs
Definition at line 134 of file uStepperDriver.h.
#define HSTRT_TFD | ( | n | ) | (((n)&0x7)<<4) |
Please check datasheet for register description
Definition at line 100 of file uStepperDriver.h.
#define I_SCALE_ANALOG | ( | n | ) | (((n)&0x1)<<0) |
Please check datasheet for register description
Definition at line 41 of file uStepperDriver.h.
#define IHOLD | ( | n | ) | (((n)&0x1F)<<0) |
Please check datasheet for register description
Definition at line 124 of file uStepperDriver.h.
#define IHOLD_IRUN 0x10 |
Please check datasheet for register description
Definition at line 45 of file uStepperDriver.h.
#define IHOLDDELAY | ( | n | ) | (((n)&0xFUL)<<16) |
Please check datasheet for register description
Definition at line 122 of file uStepperDriver.h.
#define INTPOL | ( | n | ) | (((n)&0x1UL)<<28) |
Please check datasheet for register description
Definition at line 88 of file uStepperDriver.h.
#define IRUN | ( | n | ) | (((n)&0x1F)<<8) |
Please check datasheet for register description
Definition at line 123 of file uStepperDriver.h.
#define MRES | ( | n | ) | (((n)&0xFUL)<<24) |
Please check datasheet for register description
Definition at line 89 of file uStepperDriver.h.
#define POSITIONING_MODE 0x00 |
Modes for RAMPMODE register using all A, D and V parameters)
Definition at line 131 of file uStepperDriver.h.
#define PWM_AMPL | ( | n | ) | (((n)&0xFF)<<0) |
Please check datasheet for register description
Definition at line 79 of file uStepperDriver.h.
#define PWM_AUTOSCALE | ( | n | ) | (((n)&0x1UL)<<18) |
Please check datasheet for register description
Definition at line 76 of file uStepperDriver.h.
#define PWM_FREQ | ( | n | ) | (((n)&0x3UL)<<16) |
Please check datasheet for register description
Definition at line 77 of file uStepperDriver.h.
#define PWM_GRAD | ( | n | ) | (((n)&0xFF)<<8) |
Please check datasheet for register description
Definition at line 78 of file uStepperDriver.h.
#define PWMCONF 0x70 |
Please check datasheet for register description
Definition at line 73 of file uStepperDriver.h.
#define RAMP_STAT 0x35 |
Please check datasheet for register description
Definition at line 69 of file uStepperDriver.h.
#define RAMPMODE 0x20 |
Please check datasheet for register description
Definition at line 51 of file uStepperDriver.h.
#define RNDTF | ( | n | ) | (((n)&0x1)<<13) |
Please check datasheet for register description
Definition at line 96 of file uStepperDriver.h.
#define SEDN | ( | n | ) | (((n)&0x3)<<13) |
Please check datasheet for register description
Definition at line 110 of file uStepperDriver.h.
#define SEIMIN | ( | n | ) | (((n)&0x1UL)<<15) |
Please check datasheet for register description
Definition at line 109 of file uStepperDriver.h.
#define SEMAX | ( | n | ) | (((n)&0xF)<<8) |
Please check datasheet for register description
Definition at line 111 of file uStepperDriver.h.
#define SEMIN | ( | n | ) | (((n)&0xF)<<0) |
Please check datasheet for register description
Definition at line 113 of file uStepperDriver.h.
#define SEUP | ( | n | ) | (((n)&0x3)<<5) |
Please check datasheet for register description
Definition at line 112 of file uStepperDriver.h.
#define SFILT | ( | n | ) | (((n)&0x1UL)<<24) |
Please check datasheet for register description
Definition at line 107 of file uStepperDriver.h.
#define SG_STOP | ( | n | ) | (((n)&0x1)<<10) |
Please check datasheet for register description
Definition at line 68 of file uStepperDriver.h.
#define SGT | ( | n | ) | (((n)&0x7FUL)<<16) |
Please check datasheet for register description
Definition at line 108 of file uStepperDriver.h.
#define SW_MODE 0x34 |
Please check datasheet for register description
Definition at line 67 of file uStepperDriver.h.
#define SYNC | ( | n | ) | (((n)&0xFUL)<<20) |
Please check datasheet for register description
Definition at line 90 of file uStepperDriver.h.
#define TBL | ( | n | ) | (((n)&0x3UL)<<15) |
Please check datasheet for register description
Definition at line 94 of file uStepperDriver.h.
#define TCOOLTHRS 0x14 |
Please check datasheet for register description
Definition at line 49 of file uStepperDriver.h.
#define TFD3 | ( | n | ) | (((n)&0x1)<<11) |
Please check datasheet for register description
Definition at line 98 of file uStepperDriver.h.
#define THIGH 0x15 |
Please check datasheet for register description
Definition at line 50 of file uStepperDriver.h.
#define TOFF | ( | n | ) | (((n)&0xF)<<0) |
Please check datasheet for register description
Definition at line 101 of file uStepperDriver.h.
#define TPOWERDOWN 0x11 |
Please check datasheet for register description
Definition at line 46 of file uStepperDriver.h.
#define TPWMTHRS 0x13 |
Please check datasheet for register description
Definition at line 48 of file uStepperDriver.h.
#define TSTEP 0x12 |
Definition at line 47 of file uStepperDriver.h.
#define TZEROWAIT 0x2C |
Please check datasheet for register description
Definition at line 64 of file uStepperDriver.h.
#define V1_REG 0x25 |
Please check datasheet for register description
Definition at line 58 of file uStepperDriver.h.
#define VACTUAL 0x22 |
Please check datasheet for register description
Definition at line 53 of file uStepperDriver.h.
#define VDCMIN 0x33 |
Please check datasheet for register description
Definition at line 66 of file uStepperDriver.h.
#define VELOCITY_MODE_NEG 0x02 |
negativ VMAX, using AMAX acceleration
Definition at line 133 of file uStepperDriver.h.
#define VELOCITY_MODE_POS 0x01 |
positiv VMAX, using AMAX acceleration
Definition at line 132 of file uStepperDriver.h.
#define VELOCITYCONVERSION 1.0/0.953674316 |
page 74 datasheet
Definition at line 141 of file uStepperDriver.h.
#define VHIGHCHM | ( | n | ) | (((n)&0x1UL)<<19) |
Please check datasheet for register description
Definition at line 91 of file uStepperDriver.h.
#define VHIGHFS | ( | n | ) | (((n)&0x1UL)<<18) |
Please check datasheet for register description
Definition at line 92 of file uStepperDriver.h.
#define VMAX_REG 0x27 |
Please check datasheet for register description
Definition at line 60 of file uStepperDriver.h.
#define VSENSE | ( | n | ) | (((n)&0x1UL)<<17) |
Please check datasheet for register description
Definition at line 93 of file uStepperDriver.h.
#define VSTART_REG 0x23 |
Ramp curves Please check datasheet for register description
Definition at line 56 of file uStepperDriver.h.
#define VSTOP_REG 0x2B |
Please check datasheet for register description
Definition at line 63 of file uStepperDriver.h.
#define WRITE_ACCESS 0x80 |
Write access for spi communication
Definition at line 127 of file uStepperDriver.h.
#define X_COMPARE 0x05 |
Please check datasheet for register description
Definition at line 44 of file uStepperDriver.h.
#define XACTUAL 0x21 |
Please check datasheet for register description
Definition at line 52 of file uStepperDriver.h.
#define XLATCH 0x36 |
Please check datasheet for register description
Definition at line 70 of file uStepperDriver.h.
#define XTARGET 0x2D |
Please check datasheet for register description
Definition at line 65 of file uStepperDriver.h.