40#define TMC5240_DEFAULT_D1 10
41#define TMC5240_DEFAULT_D2 10
42#define TMC5240_DEFAULT_VSTOP 10
155 uint32_t mask, uint32_t val);
174 int32_t *acceleration);
struct ad7616_init_param init_param
Definition ad7616_sdz.c:107
uint32_t vmax[]
Definition uc_settings.c:37
Header file of SPI Interface.
Header file of utility functions.
Definition ad9361_util.h:63
Structure holding SPI descriptor.
Definition no_os_spi.h:180
Structure holding the parameters for SPI initialization.
Definition no_os_spi.h:128
TMC5240 device descriptor.
Definition tmc5240.h:48
uint32_t amax
Definition tmc5240.h:62
uint32_t vstart
Definition tmc5240.h:52
uint32_t step_angle_millidegrees
Definition tmc5240.h:76
uint32_t v1
Definition tmc5240.h:56
uint32_t a2
Definition tmc5240.h:58
uint32_t clock
Definition tmc5240.h:74
uint32_t dmax
Definition tmc5240.h:66
struct no_os_spi_desc * spi_desc
Definition tmc5240.h:50
uint8_t microsteps_res
Definition tmc5240.h:78
uint8_t id
Definition tmc5240.h:80
uint32_t d1
Definition tmc5240.h:70
uint32_t vmax
Definition tmc5240.h:64
uint32_t d2
Definition tmc5240.h:68
uint32_t v2
Definition tmc5240.h:60
uint32_t a1
Definition tmc5240.h:54
uint32_t vstop
Definition tmc5240.h:72
TMC5240 initialization parameters.
Definition tmc5240.h:87
uint8_t current_run
Definition tmc5240.h:125
uint32_t d1
Definition tmc5240.h:109
uint8_t slope_control
Definition tmc5240.h:133
uint32_t vmax
Definition tmc5240.h:103
uint8_t toff
Definition tmc5240.h:127
uint32_t v2
Definition tmc5240.h:99
uint32_t vstop
Definition tmc5240.h:111
uint32_t clock
Definition tmc5240.h:113
uint8_t iholddelay
Definition tmc5240.h:119
uint32_t d2
Definition tmc5240.h:107
uint8_t irundelay
Definition tmc5240.h:121
uint8_t current_hold
Definition tmc5240.h:123
uint32_t a2
Definition tmc5240.h:97
uint8_t current_range
Definition tmc5240.h:135
struct no_os_spi_init_param spi_init_param
Definition tmc5240.h:89
uint8_t global_scaler
Definition tmc5240.h:131
uint8_t tbl
Definition tmc5240.h:129
uint8_t microsteps_res
Definition tmc5240.h:117
uint32_t vstart
Definition tmc5240.h:91
uint32_t dmax
Definition tmc5240.h:105
uint32_t v1
Definition tmc5240.h:95
uint32_t a1
Definition tmc5240.h:93
uint32_t step_angle_millidegrees
Definition tmc5240.h:115
uint32_t amax
Definition tmc5240.h:101
int tmc5240_reg_update(struct tmc5240_dev *device, uint8_t reg_addr, uint32_t mask, uint32_t val)
Read-modify-write a TMC5240 register.
Definition tmc5240.c:356
int tmc5240_get_current_accel(struct tmc5240_dev *device, int32_t *acceleration)
Get the current acceleration of the motor.
Definition tmc5240.c:577
int tmc5240_get_a1(struct tmc5240_dev *device, int32_t *a1)
Get the first acceleration phase (A1) value.
Definition tmc5240.c:850
int tmc5240_set_vstart(struct tmc5240_dev *device, int32_t vstart)
Set the start velocity (VSTART) value.
Definition tmc5240.c:838
int tmc5240_set_dmax(struct tmc5240_dev *device, int32_t dmax)
Set the maximum deceleration (DMAX) value.
Definition tmc5240.c:806
int tmc5240_set_d1(struct tmc5240_dev *device, int32_t d1)
Set the first deceleration phase (D1) value.
Definition tmc5240.c:998
int tmc5240_get_rampmode(struct tmc5240_dev *device, int32_t *rampmode)
Get the ramp mode configuration.
Definition tmc5240.c:1079
int tmc5240_get_v1(struct tmc5240_dev *device, int32_t *v1)
Get the first velocity threshold (V1) value.
Definition tmc5240.c:882
int tmc5240_reg_read(struct tmc5240_dev *device, uint8_t reg_addr, uint32_t *reg_data)
Reads data from a given TMC5240 Register.
Definition tmc5240.c:300
int tmc5240_get_d1(struct tmc5240_dev *device, int32_t *d1)
Get the first deceleration phase (D1) value.
Definition tmc5240.c:978
int tmc5240_get_current_pos(struct tmc5240_dev *device, int32_t *position)
Get the current position of the motor.
Definition tmc5240.c:553
int tmc5240_get_amax(struct tmc5240_dev *device, int32_t *amax)
Get the maximum acceleration (AMAX) value.
Definition tmc5240.c:722
int tmc5240_get_d2(struct tmc5240_dev *device, int32_t *d2)
Get the second deceleration phase (D2) value.
Definition tmc5240.c:1010
int tmc5240_set_rampmode(struct tmc5240_dev *device, int32_t rampmode)
Set the ramp mode configuration.
Definition tmc5240.c:1104
int tmc5240_set_vmax(struct tmc5240_dev *device, int32_t vmax)
Set the maximum velocity (VMAX) value.
Definition tmc5240.c:774
int tmc5240_get_target_pos(struct tmc5240_dev *device, int32_t *position)
Get the target position of the motor.
Definition tmc5240.c:499
int tmc5240_set_target_vel(struct tmc5240_dev *device, int32_t velocity)
Set the target velocity for the TMC5240 motor driver.
Definition tmc5240.c:607
int tmc5240_get_v2(struct tmc5240_dev *device, int32_t *v2)
Get the second velocity threshold (V2) value.
Definition tmc5240.c:946
int tmc5240_remove(struct tmc5240_dev *device)
Free the resources allocated by the tmc5240_init()
Definition tmc5240.c:267
int tmc5240_set_a1(struct tmc5240_dev *device, int32_t a1)
Set the first acceleration phase (A1) value.
Definition tmc5240.c:870
int tmc5240_set_amax(struct tmc5240_dev *device, int32_t amax)
Set the maximum acceleration (AMAX) value.
Definition tmc5240.c:742
int tmc5240_get_a2(struct tmc5240_dev *device, int32_t *a2)
Get the second acceleration phase (A2) value.
Definition tmc5240.c:914
int tmc5240_set_target_pos(struct tmc5240_dev *device, int32_t position)
Set the target position for the TMC5240 motor driver.
Definition tmc5240.c:468
int tmc5240_set_vstop(struct tmc5240_dev *device, int32_t vstop)
Set the stop velocity (VSTOP) value.
Definition tmc5240.c:1062
int tmc5240_set_shaft_dir(struct tmc5240_dev *device, uint8_t dir)
Set the shaft direction for the TMC5240 device.
Definition tmc5240.c:709
int tmc5240_set_v1(struct tmc5240_dev *device, int32_t v1)
Set the first velocity threshold (V1) value.
Definition tmc5240.c:902
int tmc5240_get_shaft_dir(struct tmc5240_dev *device, uint8_t *dir)
Get the shaft direction setting from the TMC5240 device.
Definition tmc5240.c:682
int tmc5240_get_current_vel(struct tmc5240_dev *device, int32_t *velocity)
Get the current velocity of the motor.
Definition tmc5240.c:655
int tmc5240_set_d2(struct tmc5240_dev *device, int32_t d2)
Set the second deceleration phase (D2) value.
Definition tmc5240.c:1030
int tmc5240_set_motion_profile(struct tmc5240_dev *device)
Set motion profile parameters for the TMC5240 motor driver.
Definition tmc5240.c:383
int tmc5240_set_a2(struct tmc5240_dev *device, int32_t a2)
Set the second acceleration phase (A2) value.
Definition tmc5240.c:934
int tmc5240_set_current_pos(struct tmc5240_dev *device, int32_t position)
Replace the current position of the motor with a new absolute position value.
Definition tmc5240.c:527
int tmc5240_get_vmax(struct tmc5240_dev *device, int32_t *vmax)
Get the maximum velocity (VMAX) value.
Definition tmc5240.c:754
int tmc5240_get_vstop(struct tmc5240_dev *device, int32_t *vstop)
Get the stop velocity (VSTOP) value.
Definition tmc5240.c:1042
int tmc5240_get_dmax(struct tmc5240_dev *device, int32_t *dmax)
Get the maximum deceleration (DMAX) value.
Definition tmc5240.c:786
int tmc5240_set_v2(struct tmc5240_dev *device, int32_t v2)
Set the second velocity threshold (V2) value.
Definition tmc5240.c:966
int tmc5240_reg_write(struct tmc5240_dev *device, uint8_t reg_addr, uint32_t reg_data)
Writes data to a given TMC5240 Register.
Definition tmc5240.c:331
int tmc5240_init(struct tmc5240_dev **device, struct tmc5240_init_param *init_param)
Initialize the TMC5240 device.
Definition tmc5240.c:159
int tmc5240_stop(struct tmc5240_dev *device)
Stop the motor by setting VMAX to 0.
Definition tmc5240.c:1115
int tmc5240_get_vstart(struct tmc5240_dev *device, int32_t *vstart)
Get the start velocity (VSTART) value.
Definition tmc5240.c:818