silentstep2  2.1.0.0
silentstep2.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** Copyright (C) 2020 MikroElektronika d.o.o.
3 ** Contact: https://www.mikroe.com/contact
4 **
5 ** Permission is hereby granted, free of charge, to any person obtaining a copy
6 ** of this software and associated documentation files (the "Software"), to deal
7 ** in the Software without restriction, including without limitation the rights
8 ** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 ** copies of the Software, and to permit persons to whom the Software is
10 ** furnished to do so, subject to the following conditions:
11 ** The above copyright notice and this permission notice shall be
12 ** included in all copies or substantial portions of the Software.
13 **
14 ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
16 ** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 ** DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
19 ** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 ** USE OR OTHER DEALINGS IN THE SOFTWARE.
21 ****************************************************************************/
22 
28 #ifndef SILENTSTEP2_H
29 #define SILENTSTEP2_H
30 
31 #ifdef __cplusplus
32 extern "C"{
33 #endif
34 
35 #include "drv_digital_out.h"
36 #include "drv_digital_in.h"
37 #include "drv_i2c_master.h"
38 #include "drv_spi_master.h"
39 #include "spi_specifics.h"
40 
61 #define SILENTSTEP2_REG_GCONF 0x00
62 #define SILENTSTEP2_REG_GSTAT 0x01
63 #define SILENTSTEP2_REG_IOIN 0x04
64 #define SILENTSTEP2_REG_IHOLD_IRUN 0x10
65 #define SILENTSTEP2_REG_TPOWERDOWN 0x11
66 #define SILENTSTEP2_REG_TSTEP 0x12
67 #define SILENTSTEP2_REG_TPWMTHRS 0x13
68 #define SILENTSTEP2_REG_TCOOLTHRS 0x14
69 #define SILENTSTEP2_REG_THIGH 0x15
70 #define SILENTSTEP2_REG_XDIRECT 0x2D
71 #define SILENTSTEP2_REG_VDCMIN 0x33
72 #define SILENTSTEP2_REG_MSLUT0 0x60
73 #define SILENTSTEP2_REG_MSLUT1 0x61
74 #define SILENTSTEP2_REG_MSLUT2 0x62
75 #define SILENTSTEP2_REG_MSLUT3 0x63
76 #define SILENTSTEP2_REG_MSLUT4 0x64
77 #define SILENTSTEP2_REG_MSLUT5 0x65
78 #define SILENTSTEP2_REG_MSLUT6 0x66
79 #define SILENTSTEP2_REG_MSLUT7 0x67
80 #define SILENTSTEP2_REG_MSLUTSEL 0x68
81 #define SILENTSTEP2_REG_MSLUTSTART 0x69
82 #define SILENTSTEP2_REG_MSCNT 0x6A
83 #define SILENTSTEP2_REG_MSCURACT 0x6B
84 #define SILENTSTEP2_REG_CHOPCONF 0x6C
85 #define SILENTSTEP2_REG_COOLCONF 0x6D
86 #define SILENTSTEP2_REG_DCCTRL 0x6E
87 #define SILENTSTEP2_REG_DRV_STATUS 0x6F
88 #define SILENTSTEP2_REG_PWMCONF 0x70
89 #define SILENTSTEP2_REG_PWM_SCALE 0x71
90 #define SILENTSTEP2_REG_ENCM_CTRL 0x72
91 #define SILENTSTEP2_REG_LOST_STEPS 0x73
92 #define SILENTSTEP2_REG_EXP_IN_PORT 0x00
93 #define SILENTSTEP2_REG_EXP_OUT_PORT 0x01
94 #define SILENTSTEP2_REG_EXP_POL_INV 0x02
95 #define SILENTSTEP2_REG_EXP_CONFIG 0x03
96  // silentstep2_reg
98 
113 #define SILENTSTEP2_GSTAT_RESET 0x00000001ul
114 #define SILENTSTEP2_GSTAT_DRV_ERR 0x00000002ul
115 #define SILENTSTEP2_GSTAT_UV_CP 0x00000004ul
116 
121 #define SILENTSTEP2_GCONF_I_SC_AN_OP_NORMAL 0x00
122 #define SILENTSTEP2_GCONF_I_SC_AN_AIN 0x01
123 #define SILENTSTEP2_GCONF_INT_RSE_OP_NORMAL 0x00
124 #define SILENTSTEP2_GCONF_INT_RSE_INT_RSE 0x01
125 #define SILENTSTEP2_GCONF_DISABLE 0x00
126 #define SILENTSTEP2_GCONF_ENABLE 0x01
127 
132 #define SILENTSTEP2_THIGH_DEFAULT 0x00000300ul
133 #define SILENTSTEP2_THIGH_MAX 0x000FFFFFul
134 
141 #define SILENTSTEP2_TCOOLTHRS_DEFAULT 0x00002700ul
142 #define SILENTSTEP2_TCOOLTHRS_MAX 0x000FFFFFul
143 
150 #define SILENTSTEP2_CHOPCONF_SEMIN_0 0x00
151 #define SILENTSTEP2_CHOPCONF_SEMIN_BIT_MASK 0x0F
152 #define SILENTSTEP2_CHOPCONF_SEUP_1 0x00
153 #define SILENTSTEP2_CHOPCONF_SEUP_2 0x01
154 #define SILENTSTEP2_CHOPCONF_SEUP_3 0x02
155 #define SILENTSTEP2_CHOPCONF_SEUP_8 0x03
156 #define SILENTSTEP2_CHOPCONF_SEMAX_0 0x00
157 #define SILENTSTEP2_CHOPCONF_SEMAX_BIT_MASK 0x0F
158 #define SILENTSTEP2_CHOPCONF_SEDN_32 0x00
159 #define SILENTSTEP2_CHOPCONF_SEDN_8 0x01
160 #define SILENTSTEP2_CHOPCONF_SEDN_2 0x02
161 #define SILENTSTEP2_CHOPCONF_SEDN_1 0x03
162 #define SILENTSTEP2_CHOPCONF_SEIMIN_1_2 0x00
163 #define SILENTSTEP2_CHOPCONF_SEIMIN_1_4 0x01
164 #define SILENTSTEP2_CHOPCONF_SGT_M64 0x00
165 #define SILENTSTEP2_CHOPCONF_SGT_P64 0x7F
166 #define SILENTSTEP2_CHOPCONF_SFILT_MODE_STD 0x00
167 #define SILENTSTEP2_CHOPCONF_SFILT_MODE_FLTR 0x01
168 
175 #define SILENTSTEP2_IHOLD_10_32 0x0A
176 #define SILENTSTEP2_IHOLD_BIT_MASK 0x1F
177 #define SILENTSTEP2_IRUN_10_32 0x0A
178 #define SILENTSTEP2_IRUN_BIT_MASK 0x1F
179 #define SILENTSTEP2_IHOLDDELAY_PWR_DOWN 0x00
180 #define SILENTSTEP2_IHOLDDELAY_32 0x05
181 #define SILENTSTEP2_IHOLDDELAY_BIT_MASK 0x0F
182 
187 #define SILENTSTEP2_TOFF_DIS 0x00
188 #define SILENTSTEP2_TOFF_NCLK_140 0x04
189 #define SILENTSTEP2_TOFF_BIT_MASK 0x0F
190 
195 #define SILENTSTEP2_STEP_SPEED_MIN 1
196 #define SILENTSTEP2_STEP_SPEED_MAX 100
197 #define SILENTSTEP2_ANGLE_360_DEGREES 360.0f
198 
203 #define SILENTSTEP2_CHOPCONF_CHM_MODE_STND 0x00
204 #define SILENTSTEP2_CHOPCONF_CHM_CONST_OFF_TIME 0x01
205 #define SILENTSTEP2_CHOPCONF_CHM_BIT_MASK 0x00004000ul
206 #define SILENTSTEP2_CHOPCONF_HE_OS_M3 0x00
207 #define SILENTSTEP2_CHOPCONF_HE_OS_M2 0x01
208 #define SILENTSTEP2_CHOPCONF_HE_OS_M1 0x02
209 #define SILENTSTEP2_CHOPCONF_HE_OS_0 0x03
210 #define SILENTSTEP2_CHOPCONF_HE_OS_1 0x04
211 #define SILENTSTEP2_CHOPCONF_HE_OS_2 0x05
212 #define SILENTSTEP2_CHOPCONF_HE_OS_3 0x06
213 #define SILENTSTEP2_CHOPCONF_HE_OS_4 0x07
214 #define SILENTSTEP2_CHOPCONF_HE_OS_5 0x08
215 #define SILENTSTEP2_CHOPCONF_HE_OS_6 0x09
216 #define SILENTSTEP2_CHOPCONF_HE_OS_7 0x0A
217 #define SILENTSTEP2_CHOPCONF_HE_OS_8 0x0B
218 #define SILENTSTEP2_CHOPCONF_HE_OS_9 0x0C
219 #define SILENTSTEP2_CHOPCONF_HE_OS_10 0x0D
220 #define SILENTSTEP2_CHOPCONF_HE_OS_11 0x0E
221 #define SILENTSTEP2_CHOPCONF_HE_OS_12 0x0F
222 #define SILENTSTEP2_CHOPCONF_HE_OS_BIT_MASK 0x00000780ul
223 #define SILENTSTEP2_CHOPCONF_HSTRT_TFD_0 0x00
224 #define SILENTSTEP2_CHOPCONF_HSTRT_TFD_1 0x01
225 #define SILENTSTEP2_CHOPCONF_HSTRT_TFD_2 0x02
226 #define SILENTSTEP2_CHOPCONF_HSTRT_TFD_3 0x03
227 #define SILENTSTEP2_CHOPCONF_HSTRT_TFD_4 0x04
228 #define SILENTSTEP2_CHOPCONF_HSTRT_TFD_5 0x05
229 #define SILENTSTEP2_CHOPCONF_HSTRT_TFD_6 0x06
230 #define SILENTSTEP2_CHOPCONF_HSTRT_TFD_7 0x07
231 #define SILENTSTEP2_CHOPCONF_HSTRT_TFD_BIT_MASK 0x00000070ul
232 
237 #define SILENTSTEP2_MSLUT_SEL_0 0x00
238 #define SILENTSTEP2_MSLUT_SEL_1 0x01
239 #define SILENTSTEP2_MSLUT_SEL_2 0x02
240 #define SILENTSTEP2_MSLUT_SEL_3 0x03
241 #define SILENTSTEP2_MSLUT_SEL_4 0x04
242 #define SILENTSTEP2_MSLUT_SEL_5 0x05
243 #define SILENTSTEP2_MSLUT_SEL_6 0x06
244 #define SILENTSTEP2_MSLUT_SEL_7 0x07
245 #define SILENTSTEP2_MSLUTSEL_WIDTH_BIT_MASK 0x000000FFul
246 #define SILENTSTEP2_MSLUTSEL_SEG_BIT_MASK 0x00FFFFFFul
247 
252 #define SILENTSTEP2_MSLUTSTART_SIN_BIT_MASK 0x000000FFul
253 #define SILENTSTEP2_MSLUTSTART_SIN90_BIT_MASK 0x000000FFul
254 
259 #define SILENTSTEP2_CHOPCONF_MRES_BIT_MASK 0xF0FFFFFFul
260 #define SILENTSTEP2_CHOPCONF_DEDGE_BIT_MASK 0xDFFFFFFFul
261 #define SILENTSTEP2_CHOPCONF_INTPOL_BIT_MASK 0xEFFFFFFFul
262 #define SILENTSTEP2_CHOPCONF_TBL_BIT_MASK 0xFFFE7FFFul
263 #define SILENTSTEP2_CHOPCONF_TOFF_BIT_MASK 0xFFFFFFF0ul
264 
269 #define SILENTSTEP2_PIN_NONE 0x00
270 #define SILENTSTEP2_PIN_EN 0x01
271 #define SILENTSTEP2_PIN_FT1 0x02
272 #define SILENTSTEP2_PIN_FT2 0x04
273 #define SILENTSTEP2_PIN_ALL 0x07
274 
279 #define SILENTSTEP2_DIRECTION_COUNTERCLOCKWISE 0
280 #define SILENTSTEP2_DIRECTION_CLOCKWISE 1
281 
286 #define SILENTSTEP2_STEP_DELAY_DEFAULT_100US 100ul
287 
293 #define SILENTSTEP2_DEVICE_ADDRESS_0 0x70
294 #define SILENTSTEP2_DEVICE_ADDRESS_1 0x72
295 #define SILENTSTEP2_DEVICE_ADDRESS_2 0x74
296 #define SILENTSTEP2_DEVICE_ADDRESS_3 0x76
297 
306 #define SILENTSTEP2_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
307 #define SILENTSTEP2_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
308  // silentstep2_set
310 
325 #define SILENTSTEP2_MAP_MIKROBUS( cfg, mikrobus ) \
326  cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
327  cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
328  cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
329  cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
330  cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
331  cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
332  cfg.dir = MIKROBUS( mikrobus, MIKROBUS_AN ); \
333  cfg.stp = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
334  cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
335  // silentstep2_map // silentstep2
338 
343 typedef enum
344 {
349 
354 typedef struct
355 {
356  digital_out_t dir;
357  digital_out_t stp;
359  digital_in_t int_pin;
361  i2c_master_t i2c;
362  spi_master_t spi;
364  uint8_t slave_address;
365  pin_name_t chip_select;
367  uint32_t step_delay;
369 } silentstep2_t;
370 
375 typedef struct
376 {
377  pin_name_t scl;
378  pin_name_t sda;
379  pin_name_t miso;
380  pin_name_t mosi;
381  pin_name_t sck;
382  pin_name_t cs;
383  pin_name_t dir;
384  pin_name_t stp;
385  pin_name_t int_pin;
387  uint32_t step_delay;
389  uint32_t i2c_speed;
390  uint8_t i2c_address;
392  uint32_t spi_speed;
393  spi_master_mode_t spi_mode;
394  spi_master_chip_select_polarity_t cs_polarity;
397 
402 typedef struct
403 {
404  uint8_t i_scale_analog;
405  uint8_t internal_rsense;
406  uint8_t en_pwm_mode;
407  uint8_t enc_commutation;
408  uint8_t shaft;
409  uint8_t diag0_error;
410  uint8_t diag0_otpw;
411  uint8_t diag0_stall;
412  uint8_t diag1_stall;
413  uint8_t diag1_index;
414  uint8_t diag1_onstate;
417  uint8_t diag1_pushpull;
419  uint8_t stop_enable;
420  uint8_t direct_mode;
423 
428 typedef struct
429 {
430  uint8_t semin;
431  uint8_t seup;
432  uint8_t semax;
433  uint8_t sedn;
434  uint8_t seimin;
435  uint8_t sgt;
436  uint8_t sfilt;
439 
444 typedef struct
445 {
446  uint8_t pwm_ampl;
447  uint8_t pwm_grad;
448  uint8_t pwm_freq;
449  uint8_t pwm_autoscale;
450  uint8_t pwm_symmetric;
451  uint8_t freewheel;
454 
459 typedef struct
460 {
461  uint16_t sg_result;
462  uint8_t fsactive;
463  uint8_t cs_actual;
464  uint8_t stall_guard;
465  uint8_t ot;
466  uint8_t otpw;
467  uint8_t s2ga;
468  uint8_t s2gb;
469  uint8_t ola;
470  uint8_t olb;
471  uint8_t stst;
474 
479 typedef enum
480 {
482  SILENTSTEP2_ERROR = -1
483 
485 
490 typedef enum
491 {
501 
503 
508 typedef enum
509 {
514 
516 
533 
548 
562 
577 err_t silentstep2_reg_write ( silentstep2_t *ctx, uint8_t reg, uint32_t data_in );
578 
593 err_t silentstep2_reg_read ( silentstep2_t *ctx, uint8_t reg, uint32_t *data_in );
594 
610 
624 err_t silentstep2_get_gstat ( silentstep2_t *ctx, uint32_t *gstat );
625 
641 err_t silentstep2_set_ihold_irun ( silentstep2_t *ctx, uint8_t ihold, uint8_t irun, uint8_t ihold_delay );
642 
657 err_t silentstep2_set_tcoolthrs ( silentstep2_t *ctx, uint32_t tcoolthrs );
658 
673 err_t silentstep2_set_thigh ( silentstep2_t *ctx, uint32_t thigh );
674 
690 err_t silentstep2_set_mslut ( silentstep2_t *ctx, uint8_t mslut_sel, uint32_t mslut );
691 
707 err_t silentstep2_set_mslutsel ( silentstep2_t *ctx, uint32_t lut_seg_str, uint32_t lut_width_sel );
708 
723 err_t silentstep2_set_mslutstart ( silentstep2_t *ctx, uint32_t start_sin, uint32_t start_sin90 );
724 
740 
755 err_t silentstep2_set_dedge ( silentstep2_t *ctx, uint8_t dedge_en );
756 
771 err_t silentstep2_set_intpol ( silentstep2_t *ctx, uint8_t intpol_en );
772 
789 
806 err_t silentstep2_set_h_end_strt ( silentstep2_t *ctx, uint8_t chm, uint8_t h_end_offset, uint8_t hstrt_tfd );
807 
821 err_t silentstep2_set_toff ( silentstep2_t *ctx, uint8_t off_time );
822 
839 
855 
871 
886 err_t silentstep2_port_exp_write ( silentstep2_t *ctx, uint8_t reg, uint8_t data_in );
887 
902 err_t silentstep2_port_exp_read ( silentstep2_t *ctx, uint8_t reg, uint8_t *data_out );
903 
918 err_t silentstep2_set_pins ( silentstep2_t *ctx, uint8_t set_mask, uint8_t clr_mask );
919 
933 err_t silentstep2_get_diag0 ( silentstep2_t *ctx, uint8_t *diag0 );
934 
948 err_t silentstep2_get_diag1 ( silentstep2_t *ctx, uint8_t *diag1 );
949 
963 
977 
989 void silentstep2_set_direction ( silentstep2_t *ctx, uint8_t dir );
990 
1002 void silentstep2_set_step ( silentstep2_t *ctx, uint8_t step );
1003 
1017 err_t silentstep2_make_one_step ( silentstep2_t *ctx, uint8_t step_speed );
1018 
1034 err_t silentstep2_rotate_by_angle ( silentstep2_t *ctx, uint8_t step_speed, float angle, uint16_t res_360 );
1035 
1049 
1050 #ifdef __cplusplus
1051 }
1052 #endif
1053 #endif // SILENTSTEP2_H
1054  // silentstep2
1056 
1057 // ------------------------------------------------------------------------ END
SILENTSTEP2_MRES_16
@ SILENTSTEP2_MRES_16
Definition: silentstep2.h:496
silentstep2_drv_status_t::olb
uint8_t olb
Definition: silentstep2.h:470
SILENTSTEP2_ERROR
@ SILENTSTEP2_ERROR
Definition: silentstep2.h:482
silentstep2_drv_status_t::s2gb
uint8_t s2gb
Definition: silentstep2.h:468
silentstep2_drv_status_t::sg_result
uint16_t sg_result
Definition: silentstep2.h:461
silentstep2_t::stp
digital_out_t stp
Definition: silentstep2.h:357
silentstep2_set_mslutstart
err_t silentstep2_set_mslutstart(silentstep2_t *ctx, uint32_t start_sin, uint32_t start_sin90)
Silent Step 2 sets the absolute current microstep table function.
silentstep2_drv_t
silentstep2_drv_t
Silent Step 2 Click driver selector.
Definition: silentstep2.h:344
SILENTSTEP2_TBL_CLOCKS_36
@ SILENTSTEP2_TBL_CLOCKS_36
Definition: silentstep2.h:512
silentstep2_t::i2c
i2c_master_t i2c
Definition: silentstep2.h:361
silentstep2_cfg_t::stp
pin_name_t stp
Definition: silentstep2.h:384
silentstep2_rotate_by_angle
err_t silentstep2_rotate_by_angle(silentstep2_t *ctx, uint8_t step_speed, float angle, uint16_t res_360)
Silent Step 2 rotates the shaft through a desired angle function.
silentstep2_drv_status_t::cs_actual
uint8_t cs_actual
Definition: silentstep2.h:463
silentstep2_gconf_t::diag0_error
uint8_t diag0_error
Definition: silentstep2.h:409
silentstep2_pwmconf_t::pwm_autoscale
uint8_t pwm_autoscale
Definition: silentstep2.h:449
silentstep2_gconf_t::enc_commutation
uint8_t enc_commutation
Definition: silentstep2.h:407
silentstep2_gconf_t::small_hysteresis
uint8_t small_hysteresis
Definition: silentstep2.h:418
silentstep2_set_h_end_strt
err_t silentstep2_set_h_end_strt(silentstep2_t *ctx, uint8_t chm, uint8_t h_end_offset, uint8_t hstrt_tfd)
Silent Step 2 sets the chopper mode config function.
SILENTSTEP2_MRES_2
@ SILENTSTEP2_MRES_2
Definition: silentstep2.h:499
silentstep2_set_direction
void silentstep2_set_direction(silentstep2_t *ctx, uint8_t dir)
Silent Step 2 sets the clockwise or counterclockwise direction movement function.
SILENTSTEP2_TBL_CLOCKS_24
@ SILENTSTEP2_TBL_CLOCKS_24
Definition: silentstep2.h:511
silentstep2_drv_status_t::stall_guard
uint8_t stall_guard
Definition: silentstep2.h:464
silentstep2_drv_status_t::s2ga
uint8_t s2ga
Definition: silentstep2.h:467
spi_specifics.h
This file contains SPI specific macros, functions, etc.
silentstep2_gconf_t::stop_enable
uint8_t stop_enable
Definition: silentstep2.h:419
silentstep2_cfg_t
Silent Step 2 Click configuration object.
Definition: silentstep2.h:376
silentstep2_set_mslut
err_t silentstep2_set_mslut(silentstep2_t *ctx, uint8_t mslut_sel, uint32_t mslut)
Silent Step 2 sets the microstep table entries function.
silentstep2_coolconf_t::seimin
uint8_t seimin
Definition: silentstep2.h:434
silentstep2_gconf_t::i_scale_analog
uint8_t i_scale_analog
Definition: silentstep2.h:404
silentstep2_mres_t
silentstep2_mres_t
Silent Step 2 Click reduced microstep resolution value data.
Definition: silentstep2.h:491
silentstep2_cfg_t::mosi
pin_name_t mosi
Definition: silentstep2.h:380
silentstep2_get_gstat
err_t silentstep2_get_gstat(silentstep2_t *ctx, uint32_t *gstat)
Silent Step 2 get global status function.
silentstep2_coolconf_t::seup
uint8_t seup
Definition: silentstep2.h:431
SILENTSTEP2_MRES_NATIVE
@ SILENTSTEP2_MRES_NATIVE
Definition: silentstep2.h:500
silentstep2_drv_status_t::stst
uint8_t stst
Definition: silentstep2.h:471
SILENTSTEP2_MRES_4
@ SILENTSTEP2_MRES_4
Definition: silentstep2.h:498
silentstep2_init
err_t silentstep2_init(silentstep2_t *ctx, silentstep2_cfg_t *cfg)
Silent Step 2 initialization function.
silentstep2_pwmconf_t
Silent Step 2 Click voltage mode pwm stealthChop object.
Definition: silentstep2.h:445
silentstep2_pwmconf_t::freewheel
uint8_t freewheel
Definition: silentstep2.h:451
silentstep2_cfg_t::step_delay
uint32_t step_delay
Definition: silentstep2.h:387
silentstep2_gconf_t::en_pwm_mode
uint8_t en_pwm_mode
Definition: silentstep2.h:406
silentstep2_t::spi
spi_master_t spi
Definition: silentstep2.h:362
silentstep2_get_drv_status
err_t silentstep2_get_drv_status(silentstep2_t *ctx, silentstep2_drv_status_t *drv_status)
Silent Step 2 get driver status error flags function.
silentstep2_gconf_t::diag1_index
uint8_t diag1_index
Definition: silentstep2.h:413
silentstep2_reg_read
err_t silentstep2_reg_read(silentstep2_t *ctx, uint8_t reg, uint32_t *data_in)
Silent Step 2 data reading function.
silentstep2_t
Silent Step 2 Click context object.
Definition: silentstep2.h:355
silentstep2_drv_status_t::ot
uint8_t ot
Definition: silentstep2.h:465
silentstep2_set_dedge
err_t silentstep2_set_dedge(silentstep2_t *ctx, uint8_t dedge_en)
Silent Step 2 sets the step impulsen function.
silentstep2_gconf_t::diag0_otpw
uint8_t diag0_otpw
Definition: silentstep2.h:410
silentstep2_t::int_pin
digital_in_t int_pin
Definition: silentstep2.h:359
silentstep2_gconf_t::diag1_onstate
uint8_t diag1_onstate
Definition: silentstep2.h:414
silentstep2_set_tbl_blank_time
err_t silentstep2_set_tbl_blank_time(silentstep2_t *ctx, silentstep2_tbl_t tbl)
Silent Step 2 enable the blank time select function.
SILENTSTEP2_MRES_8
@ SILENTSTEP2_MRES_8
Definition: silentstep2.h:497
silentstep2_gconf_t::diag1_steps_skipped
uint8_t diag1_steps_skipped
Definition: silentstep2.h:415
silentstep2_t::step_delay
uint32_t step_delay
Definition: silentstep2.h:367
silentstep2_cfg_t::cs_polarity
spi_master_chip_select_polarity_t cs_polarity
Definition: silentstep2.h:394
silentstep2_set_mstep_res
err_t silentstep2_set_mstep_res(silentstep2_t *ctx, silentstep2_mres_t step_width)
Silent Step 2 sets the micro step resolution function.
silentstep2_get_diag1
err_t silentstep2_get_diag1(silentstep2_t *ctx, uint8_t *diag1)
Silent Step 2 get the diagnostics output DIAG1 function.
SILENTSTEP2_TBL_CLOCKS_54
@ SILENTSTEP2_TBL_CLOCKS_54
Definition: silentstep2.h:513
silentstep2_reg_write
err_t silentstep2_reg_write(silentstep2_t *ctx, uint8_t reg, uint32_t data_in)
Silent Step 2 data writing function.
silentstep2_drv_status_t::ola
uint8_t ola
Definition: silentstep2.h:469
silentstep2_gconf_t::direct_mode
uint8_t direct_mode
Definition: silentstep2.h:420
silentstep2_cfg_t::sda
pin_name_t sda
Definition: silentstep2.h:378
SILENTSTEP2_MRES_32
@ SILENTSTEP2_MRES_32
Definition: silentstep2.h:495
silentstep2_default_cfg
err_t silentstep2_default_cfg(silentstep2_t *ctx)
Silent Step 2 default configuration function.
silentstep2_input_enable
err_t silentstep2_input_enable(silentstep2_t *ctx)
Silent Step 2 enable input function.
silentstep2_gconf_t::shaft
uint8_t shaft
Definition: silentstep2.h:408
silentstep2_t::chip_select
pin_name_t chip_select
Definition: silentstep2.h:365
SILENTSTEP2_OK
@ SILENTSTEP2_OK
Definition: silentstep2.h:481
silentstep2_t::slave_address
uint8_t slave_address
Definition: silentstep2.h:364
silentstep2_cfg_t::i2c_speed
uint32_t i2c_speed
Definition: silentstep2.h:389
silentstep2_return_value_t
silentstep2_return_value_t
Silent Step 2 Click return value data.
Definition: silentstep2.h:480
silentstep2_set_tcoolthrs
err_t silentstep2_set_tcoolthrs(silentstep2_t *ctx, uint32_t tcoolthrs)
Silent Step 2 sets lower threshold velocity for switching on smart energy function.
silentstep2_gconf_t::diag0_int_pushpull
uint8_t diag0_int_pushpull
Definition: silentstep2.h:416
silentstep2_cfg_t::int_pin
pin_name_t int_pin
Definition: silentstep2.h:385
silentstep2_coolconf_t
Silent Step 2 Click smart energy control coolStep and stallGuard2 object.
Definition: silentstep2.h:429
silentstep2_coolconf_t::semax
uint8_t semax
Definition: silentstep2.h:432
silentstep2_port_exp_write
err_t silentstep2_port_exp_write(silentstep2_t *ctx, uint8_t reg, uint8_t data_in)
Silent Step 2 port expander data writing function.
silentstep2_gconf_t::internal_rsense
uint8_t internal_rsense
Definition: silentstep2.h:405
silentstep2_make_one_step
err_t silentstep2_make_one_step(silentstep2_t *ctx, uint8_t step_speed)
Silent Step 2 make the one step function.
silentstep2_drv_status_t::otpw
uint8_t otpw
Definition: silentstep2.h:466
silentstep2_t::dir
digital_out_t dir
Definition: silentstep2.h:356
silentstep2_set_ihold_irun
err_t silentstep2_set_ihold_irun(silentstep2_t *ctx, uint8_t ihold, uint8_t irun, uint8_t ihold_delay)
Silent Step 2 sets driver current control function.
silentstep2_pwmconf_t::pwm_ampl
uint8_t pwm_ampl
Definition: silentstep2.h:446
silentstep2_coolconf_t::sgt
uint8_t sgt
Definition: silentstep2.h:435
silentstep2_get_interrupt
uint8_t silentstep2_get_interrupt(silentstep2_t *ctx)
Silent Step 2 get the interrupt function.
silentstep2_get_diag0
err_t silentstep2_get_diag0(silentstep2_t *ctx, uint8_t *diag0)
Silent Step 2 get the diagnostics output DIAG0 function.
silentstep2_cfg_t::dir
pin_name_t dir
Definition: silentstep2.h:383
silentstep2_cfg_t::i2c_address
uint8_t i2c_address
Definition: silentstep2.h:390
silentstep2_cfg_t::cs
pin_name_t cs
Definition: silentstep2.h:382
silentstep2_cfg_t::sck
pin_name_t sck
Definition: silentstep2.h:381
silentstep2_drv_status_t
Silent Step 2 Click stallGuard2 value and driver error flags object.
Definition: silentstep2.h:460
silentstep2_switch_off
err_t silentstep2_switch_off(silentstep2_t *ctx)
Silent Step 2 sets the power OFF function.
silentstep2_set_gconf
err_t silentstep2_set_gconf(silentstep2_t *ctx, silentstep2_gconf_t gconf)
Silent Step 2 sets global configuration function.
silentstep2_set_toff
err_t silentstep2_set_toff(silentstep2_t *ctx, uint8_t off_time)
Silent Step 2 sets the off time and driver enable function.
silentstep2_cfg_setup
void silentstep2_cfg_setup(silentstep2_cfg_t *cfg)
Silent Step 2 configuration object setup function.
silentstep2_drv_status_t::fsactive
uint8_t fsactive
Definition: silentstep2.h:462
SILENTSTEP2_MRES_256
@ SILENTSTEP2_MRES_256
Definition: silentstep2.h:492
silentstep2_gconf_t::diag1_pushpull
uint8_t diag1_pushpull
Definition: silentstep2.h:417
SILENTSTEP2_DRV_SEL_SPI
@ SILENTSTEP2_DRV_SEL_SPI
Definition: silentstep2.h:345
silentstep2_set_pwmconf
err_t silentstep2_set_pwmconf(silentstep2_t *ctx, silentstep2_pwmconf_t pwmconf)
Silent Step 2 sets the voltage PWM Mode stealthChop function.
silentstep2_pwmconf_t::pwm_symmetric
uint8_t pwm_symmetric
Definition: silentstep2.h:450
silentstep2_cfg_t::miso
pin_name_t miso
Definition: silentstep2.h:379
silentstep2_coolconf_t::semin
uint8_t semin
Definition: silentstep2.h:430
SILENTSTEP2_MRES_128
@ SILENTSTEP2_MRES_128
Definition: silentstep2.h:493
silentstep2_set_intpol
err_t silentstep2_set_intpol(silentstep2_t *ctx, uint8_t intpol_en)
Silent Step 2 enable the actual microstep resolution function.
silentstep2_gconf_t
Silent Step 2 Click global configuration object.
Definition: silentstep2.h:403
silentstep2_set_thigh
err_t silentstep2_set_thigh(silentstep2_t *ctx, uint32_t thigh)
Silent Step 2 sets the velocity setting function.
silentstep2_set_coolconf
err_t silentstep2_set_coolconf(silentstep2_t *ctx, silentstep2_coolconf_t coolconf)
Silent Step 2 sets the coolStep smart current control function.
silentstep2_gconf_t::diag0_stall
uint8_t diag0_stall
Definition: silentstep2.h:411
silentstep2_tbl_t
silentstep2_tbl_t
Silent Step 2 Click comparator blank time value data.
Definition: silentstep2.h:509
silentstep2_pwmconf_t::pwm_grad
uint8_t pwm_grad
Definition: silentstep2.h:447
SILENTSTEP2_TBL_CLOCKS_16
@ SILENTSTEP2_TBL_CLOCKS_16
Definition: silentstep2.h:510
SILENTSTEP2_DRV_SEL_I2C
@ SILENTSTEP2_DRV_SEL_I2C
Definition: silentstep2.h:346
silentstep2_coolconf_t::sedn
uint8_t sedn
Definition: silentstep2.h:433
silentstep2_cfg_t::spi_mode
spi_master_mode_t spi_mode
Definition: silentstep2.h:393
silentstep2_set_mslutsel
err_t silentstep2_set_mslutsel(silentstep2_t *ctx, uint32_t lut_seg_str, uint32_t lut_width_sel)
Silent Step 2 sets the microstep segments function.
silentstep2_port_exp_read
err_t silentstep2_port_exp_read(silentstep2_t *ctx, uint8_t reg, uint8_t *data_out)
Silent Step 2 port expander data reading function.
silentstep2_cfg_t::spi_speed
uint32_t spi_speed
Definition: silentstep2.h:392
SILENTSTEP2_MRES_64
@ SILENTSTEP2_MRES_64
Definition: silentstep2.h:494
silentstep2_gconf_t::diag1_stall
uint8_t diag1_stall
Definition: silentstep2.h:412
silentstep2_set_pins
err_t silentstep2_set_pins(silentstep2_t *ctx, uint8_t set_mask, uint8_t clr_mask)
Silent Step 2 sets the pin states function.
silentstep2_cfg_t::scl
pin_name_t scl
Definition: silentstep2.h:377
silentstep2_coolconf_t::sfilt
uint8_t sfilt
Definition: silentstep2.h:436
silentstep2_set_step
void silentstep2_set_step(silentstep2_t *ctx, uint8_t step)
Silent Step 2 set the step pin state function.
silentstep2_pwmconf_t::pwm_freq
uint8_t pwm_freq
Definition: silentstep2.h:448