stepper22  2.1.0.0
stepper22.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 STEPPER22_H
29 #define STEPPER22_H
30 
31 #ifdef __cplusplus
32 extern "C"{
33 #endif
34 
39 #ifdef PREINIT_SUPPORTED
40 #include "preinit.h"
41 #endif
42 
43 #ifdef MikroCCoreVersion
44  #if MikroCCoreVersion >= 1
45  #include "delays.h"
46  #endif
47 #endif
48 
49 #include "drv_digital_out.h"
50 #include "drv_digital_in.h"
51 #include "drv_i2c_master.h"
52 #include "drv_spi_master.h"
53 #include "spi_specifics.h"
54 #include "drv_analog_in.h"
55 
76 #define STEPPER22_REG_CTRL 0x00
77 #define STEPPER22_REG_TORQUE 0x01
78 #define STEPPER22_REG_OFF 0x02
79 #define STEPPER22_REG_BLANK 0x03
80 #define STEPPER22_REG_DECAY 0x04
81 #define STEPPER22_REG_STALL 0x05
82 #define STEPPER22_REG_DRIVE 0x06
83 #define STEPPER22_REG_STATUS 0x07
84 
89 #define STEPPER22_PCA9538A_REG_INPUT 0x00
90 #define STEPPER22_PCA9538A_REG_OUTPUT 0x01
91 #define STEPPER22_PCA9538A_REG_POLARITY 0x02
92 #define STEPPER22_PCA9538A_REG_CONFIG 0x03
93  // stepper22_reg
95 
110 #define STEPPER22_CTRL_DTIME_400_NS 0x0000
111 #define STEPPER22_CTRL_DTIME_450_NS 0x0400
112 #define STEPPER22_CTRL_DTIME_650_NS 0x0800
113 #define STEPPER22_CTRL_DTIME_850_NS 0x0C00
114 #define STEPPER22_CTRL_DTIME_MASK 0x0C00
115 #define STEPPER22_CTRL_ISGAIN_5 0x0000
116 #define STEPPER22_CTRL_ISGAIN_10 0x0100
117 #define STEPPER22_CTRL_ISGAIN_20 0x0200
118 #define STEPPER22_CTRL_ISGAIN_40 0x0300
119 #define STEPPER22_CTRL_ISGAIN_MASK 0x0300
120 #define STEPPER22_CTRL_EXSTALL_INT_STALL 0x0000
121 #define STEPPER22_CTRL_EXSTALL_EXT_STALL 0x0080
122 #define STEPPER22_CTRL_EXSTALL_MASK 0x0080
123 #define STEPPER22_CTRL_MODE_FULL_STEP 0x0000
124 #define STEPPER22_CTRL_MODE_HALF_STEP 0x0008
125 #define STEPPER22_CTRL_MODE_QUARTER_STEP 0x0010
126 #define STEPPER22_CTRL_MODE_1_OVER_8 0x0018
127 #define STEPPER22_CTRL_MODE_1_OVER_16 0x0020
128 #define STEPPER22_CTRL_MODE_1_OVER_32 0x0028
129 #define STEPPER22_CTRL_MODE_1_OVER_64 0x0030
130 #define STEPPER22_CTRL_MODE_1_OVER_128 0x0038
131 #define STEPPER22_CTRL_MODE_1_OVER_256 0x0040
132 #define STEPPER22_CTRL_MODE_MASK 0x0078
133 #define STEPPER22_CTRL_RSTEP_NO_ACTION 0x0000
134 #define STEPPER22_CTRL_RSTEP_ADV_1_STEP 0x0004
135 #define STEPPER22_CTRL_RSTEP_MASK 0x0004
136 #define STEPPER22_CTRL_RDIR_DIR_PIN 0x0000
137 #define STEPPER22_CTRL_RDIR_INV_DIR_PIN 0x0002
138 #define STEPPER22_CTRL_RDIR_MASK 0x0002
139 #define STEPPER22_CTRL_ENBL_MOTOR_DISABLE 0x0000
140 #define STEPPER22_CTRL_ENBL_MOTOR_ENABLE 0x0001
141 #define STEPPER22_CTRL_ENBL_MASK 0x0001
142 
147 #define STEPPER22_TORQUE_SMPLTH_50_US 0x0000
148 #define STEPPER22_TORQUE_SMPLTH_100_US 0x0100
149 #define STEPPER22_TORQUE_SMPLTH_200_US 0x0200
150 #define STEPPER22_TORQUE_SMPLTH_300_US 0x0300
151 #define STEPPER22_TORQUE_SMPLTH_400_US 0x0400
152 #define STEPPER22_TORQUE_SMPLTH_600_US 0x0500
153 #define STEPPER22_TORQUE_SMPLTH_800_US 0x0600
154 #define STEPPER22_TORQUE_SMPLTH_1000_US 0x0700
155 #define STEPPER22_TORQUE_SMPLTH_MASK 0x0700
156 #define STEPPER22_TORQUE_TORQUE_DEFAULT 0x0000
157 #define STEPPER22_TORQUE_TORQUE_MASK 0x00FF
158 
163 #define STEPPER22_OFF_PWMMODE_USE_INDEXER 0x0000
164 #define STEPPER22_OFF_PWMMODE_BYPASS_INDEXER 0x0100
165 #define STEPPER22_OFF_PWMMODE_MASK 0x0100
166 #define STEPPER22_OFF_TOFF_24_5_US 0x0030
167 #define STEPPER22_OFF_TOFF_MASK 0x00FF
168 
173 #define STEPPER22_BLANK_ABT_DISABLE 0x0000
174 #define STEPPER22_BLANK_ABT_ENABLE 0x0100
175 #define STEPPER22_BLANK_ABT_MASK 0x0100
176 #define STEPPER22_BLANK_TBLANK_2_58_US 0x0080
177 #define STEPPER22_BLANK_TBLANK_MASK 0x00FF
178 
183 #define STEPPER22_DECAY_DECMOD_FORCE_SLOW 0x0000
184 #define STEPPER22_DECAY_DECMOD_SLOW_MIXED 0x0100
185 #define STEPPER22_DECAY_DECMOD_FORCE_FAST 0x0200
186 #define STEPPER22_DECAY_DECMOD_MIXED 0x0300
187 #define STEPPER22_DECAY_DECMOD_SLOW_AUTO_MIXED 0x0400
188 #define STEPPER22_DECAY_DECMOD_AUTO_MIXED 0x0500
189 #define STEPPER22_DECAY_DECMOD_MASK 0x0700
190 #define STEPPER22_DECAY_TDECAY_8_5_US 0x0010
191 #define STEPPER22_DECAY_TDECAY_MASK 0x00FF
192 
197 #define STEPPER22_STALL_VDIV_DIV_32 0x0000
198 #define STEPPER22_STALL_VDIV_DIV_16 0x0400
199 #define STEPPER22_STALL_VDIV_DIV_8 0x0800
200 #define STEPPER22_STALL_VDIV_DIV_4 0x0C00
201 #define STEPPER22_STALL_VDIV_MASK 0x0C00
202 #define STEPPER22_STALL_SDCNT_1_STEP 0x0000
203 #define STEPPER22_STALL_SDCNT_2_STEPS 0x0100
204 #define STEPPER22_STALL_SDCNT_4_STEPS 0x0200
205 #define STEPPER22_STALL_SDCNT_8_STEPS 0x0300
206 #define STEPPER22_STALL_SDCNT_MASK 0x0300
207 #define STEPPER22_STALL_SDTHR_DEFAULT 0x0040
208 #define STEPPER22_STALL_SDTHR_MASK 0x00FF
209 
214 #define STEPPER22_DRIVE_IDRIVEP_50_MA 0x0000
215 #define STEPPER22_DRIVE_IDRIVEP_100_MA 0x0400
216 #define STEPPER22_DRIVE_IDRIVEP_150_MA 0x0800
217 #define STEPPER22_DRIVE_IDRIVEP_200_MA 0x0C00
218 #define STEPPER22_DRIVE_IDRIVEP_MASK 0x0C00
219 #define STEPPER22_DRIVE_IDRIVEN_100_MA 0x0000
220 #define STEPPER22_DRIVE_IDRIVEN_200_MA 0x0100
221 #define STEPPER22_DRIVE_IDRIVEN_300_MA 0x0200
222 #define STEPPER22_DRIVE_IDRIVEN_400_MA 0x0300
223 #define STEPPER22_DRIVE_IDRIVEN_MASK 0x0300
224 #define STEPPER22_DRIVE_TDRIVEP_250_NS 0x0000
225 #define STEPPER22_DRIVE_TDRIVEP_500_NS 0x0040
226 #define STEPPER22_DRIVE_TDRIVEP_1_US 0x0080
227 #define STEPPER22_DRIVE_TDRIVEP_2_US 0x00C0
228 #define STEPPER22_DRIVE_TDRIVEP_MASK 0x00C0
229 #define STEPPER22_DRIVE_TDRIVEN_250_NS 0x0000
230 #define STEPPER22_DRIVE_TDRIVEN_500_NS 0x0010
231 #define STEPPER22_DRIVE_TDRIVEN_1_US 0x0020
232 #define STEPPER22_DRIVE_TDRIVEN_2_US 0x0030
233 #define STEPPER22_DRIVE_TDRIVEN_MASK 0x0030
234 #define STEPPER22_DRIVE_OCPDEG_1_US 0x0000
235 #define STEPPER22_DRIVE_OCPDEG_2_US 0x0004
236 #define STEPPER22_DRIVE_OCPDEG_4_US 0x0008
237 #define STEPPER22_DRIVE_OCPDEG_8_US 0x000C
238 #define STEPPER22_DRIVE_OCPDEG_MASK 0x000C
239 #define STEPPER22_DRIVE_OCPTH_250_MV 0x0000
240 #define STEPPER22_DRIVE_OCPTH_500_MV 0x0001
241 #define STEPPER22_DRIVE_OCPTH_750_MV 0x0002
242 #define STEPPER22_DRIVE_OCPTH_1000_MV 0x0003
243 #define STEPPER22_DRIVE_OCPTH_MASK 0x0003
244 
249 #define STEPPER22_STATUS_STDLAT 0x0080
250 #define STEPPER22_STATUS_STD 0x0040
251 #define STEPPER22_STATUS_UVLO 0x0020
252 #define STEPPER22_STATUS_BPDF 0x0010
253 #define STEPPER22_STATUS_APDF 0x0008
254 #define STEPPER22_STATUS_BOCP 0x0004
255 #define STEPPER22_STATUS_AOCP 0x0002
256 #define STEPPER22_STATUS_OTS 0x0001
257 #define STEPPER22_STATUS_CLEAR_ALL 0x0000
258 
263 #define STEPPER22_PIN_STALL 0x02
264 #define STEPPER22_PIN_FAULT 0x04
265 #define STEPPER22_PIN_BIN2 0x08
266 #define STEPPER22_PIN_BIN1 0x10
267 #define STEPPER22_PIN_DIR 0x20
268 #define STEPPER22_PIN_RESET 0x40
269 #define STEPPER22_PIN_SLEEP 0x80
270 
275 #define STEPPER22_PCA9538A_DEFAULT_CONFIG 0x07
276 
281 #define STEPPER22_DIR_CW 0
282 #define STEPPER22_DIR_CCW 1
283 
288 #define STEPPER22_PIN_STATE_LOW 0
289 #define STEPPER22_PIN_STATE_HIGH 1
290 
295 #define STEPPER22_SPEED_VERY_SLOW 0
296 #define STEPPER22_SPEED_SLOW 1
297 #define STEPPER22_SPEED_MEDIUM 2
298 #define STEPPER22_SPEED_FAST 3
299 #define STEPPER22_SPEED_VERY_FAST 4
300 
305 #define STEPPER22_MODE_FULL_STEP 0
306 #define STEPPER22_MODE_HALF_STEP 1
307 #define STEPPER22_MODE_QUARTER_STEP 2
308 #define STEPPER22_MODE_1_OVER_8 3
309 #define STEPPER22_MODE_1_OVER_16 4
310 #define STEPPER22_MODE_1_OVER_32 5
311 #define STEPPER22_MODE_1_OVER_64 6
312 #define STEPPER22_MODE_1_OVER_128 7
313 #define STEPPER22_MODE_1_OVER_256 8
314 
320 #define STEPPER22_DEVICE_ADDRESS_A1A0_00 0x70
321 #define STEPPER22_DEVICE_ADDRESS_A1A0_01 0x71
322 #define STEPPER22_DEVICE_ADDRESS_A1A0_10 0x72
323 #define STEPPER22_DEVICE_ADDRESS_A1A0_11 0x73
324 
333 #define STEPPER22_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
334 #define STEPPER22_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
335  // stepper22_set
337 
352 #define STEPPER22_MAP_MIKROBUS( cfg, mikrobus ) \
353  cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
354  cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
355  cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
356  cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
357  cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
358  cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
359  cfg.bemf = MIKROBUS( mikrobus, MIKROBUS_AN ); \
360  cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
361  cfg.step = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
362  cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
363  // stepper22_map // stepper22
366 
371 typedef struct stepper22_s
372 {
373  digital_out_t rst;
374  digital_out_t step;
376  digital_in_t int_pin;
378  i2c_master_t i2c;
379  spi_master_t spi;
381  uint8_t slave_address;
382  pin_name_t chip_select;
384  analog_in_t adc;
387 
392 typedef struct
393 {
394  pin_name_t scl;
395  pin_name_t sda;
396  pin_name_t miso;
397  pin_name_t mosi;
398  pin_name_t sck;
399  pin_name_t cs;
400  pin_name_t bemf;
401  pin_name_t rst;
402  pin_name_t step;
403  pin_name_t int_pin;
405  uint32_t i2c_speed;
406  uint8_t i2c_address;
408  uint32_t spi_speed;
409  spi_master_mode_t spi_mode;
410  spi_master_chip_select_polarity_t cs_polarity;
412  analog_in_resolution_t resolution;
413  float vref;
416 
421 typedef enum
422 {
424  STEPPER22_ERROR = -1
425 
427 
444 
459 
473 
487 err_t stepper22_write_reg ( stepper22_t *ctx, uint8_t reg, uint16_t data_in );
488 
501 err_t stepper22_read_reg ( stepper22_t *ctx, uint8_t reg, uint16_t *data_out );
502 
516 err_t stepper22_pca_write_reg ( stepper22_t *ctx, uint8_t reg, uint8_t data_in );
517 
530 err_t stepper22_pca_read_reg ( stepper22_t *ctx, uint8_t reg, uint8_t *data_out );
531 
545 err_t stepper22_read_bemf_voltage ( stepper22_t *ctx, float *data_out );
546 
559 err_t stepper22_get_stall_pin ( stepper22_t *ctx, uint8_t *state );
560 
573 err_t stepper22_get_fault_pin ( stepper22_t *ctx, uint8_t *state );
574 
587 err_t stepper22_get_bin2_pin ( stepper22_t *ctx, uint8_t *state );
588 
601 err_t stepper22_set_bin2_pin ( stepper22_t *ctx, uint8_t state );
602 
615 err_t stepper22_get_bin1_pin ( stepper22_t *ctx, uint8_t *state );
616 
629 err_t stepper22_set_bin1_pin ( stepper22_t *ctx, uint8_t state );
630 
643 err_t stepper22_get_dir_pin ( stepper22_t *ctx, uint8_t *state );
644 
657 err_t stepper22_set_dir_pin ( stepper22_t *ctx, uint8_t state );
658 
671 err_t stepper22_get_reset_pin ( stepper22_t *ctx, uint8_t *state );
672 
685 err_t stepper22_set_reset_pin ( stepper22_t *ctx, uint8_t state );
686 
699 err_t stepper22_get_sleep_pin ( stepper22_t *ctx, uint8_t *state );
700 
713 err_t stepper22_set_sleep_pin ( stepper22_t *ctx, uint8_t state );
714 
726 
738 
751 err_t stepper22_set_direction ( stepper22_t *ctx, uint8_t dir );
752 
764 
774 
785 void stepper22_set_rst_pin ( stepper22_t *ctx, uint8_t state );
786 
797 void stepper22_set_step_pin ( stepper22_t *ctx, uint8_t state );
798 
808 
829 err_t stepper22_get_step_mode ( stepper22_t *ctx, uint8_t *mode );
830 
851 err_t stepper22_set_step_mode ( stepper22_t *ctx, uint8_t mode );
852 
870 err_t stepper22_drive_motor ( stepper22_t *ctx, uint32_t steps, uint8_t speed );
871 
872 #ifdef __cplusplus
873 }
874 #endif
875 #endif // STEPPER22_H
876  // stepper22
878 
879 // ------------------------------------------------------------------------ END
stepper22_cfg_t::vref
float vref
Definition: stepper22.h:413
stepper22_default_cfg
err_t stepper22_default_cfg(stepper22_t *ctx)
Stepper 22 default configuration function.
stepper22_cfg_t::cs_polarity
spi_master_chip_select_polarity_t cs_polarity
Definition: stepper22.h:410
stepper22_s::i2c
i2c_master_t i2c
Definition: stepper22.h:378
stepper22_set_dir_pin
err_t stepper22_set_dir_pin(stepper22_t *ctx, uint8_t state)
Stepper 22 set DIR pin function.
stepper22_get_dir_pin
err_t stepper22_get_dir_pin(stepper22_t *ctx, uint8_t *state)
Stepper 22 get DIR pin function.
stepper22_cfg_t::int_pin
pin_name_t int_pin
Definition: stepper22.h:403
stepper22_cfg_t::scl
pin_name_t scl
Definition: stepper22.h:394
STEPPER22_OK
@ STEPPER22_OK
Definition: stepper22.h:423
stepper22_set_bin1_pin
err_t stepper22_set_bin1_pin(stepper22_t *ctx, uint8_t state)
Stepper 22 set BIN1 pin function.
stepper22_s::slave_address
uint8_t slave_address
Definition: stepper22.h:381
stepper22_set_direction
err_t stepper22_set_direction(stepper22_t *ctx, uint8_t dir)
Stepper 22 set direction function.
stepper22_s::chip_select
pin_name_t chip_select
Definition: stepper22.h:382
stepper22_set_rst_pin
void stepper22_set_rst_pin(stepper22_t *ctx, uint8_t state)
Stepper 22 set RST pin function.
stepper22_cfg_t::spi_mode
spi_master_mode_t spi_mode
Definition: stepper22.h:409
stepper22_cfg_t::miso
pin_name_t miso
Definition: stepper22.h:396
stepper22_enable_device
err_t stepper22_enable_device(stepper22_t *ctx)
Stepper 22 enable device function.
spi_specifics.h
This file contains SPI specific macros, functions, etc.
stepper22_reset_pca
void stepper22_reset_pca(stepper22_t *ctx)
Stepper 22 reset device function.
stepper22_switch_direction
err_t stepper22_switch_direction(stepper22_t *ctx)
Stepper 22 switch direction function.
stepper22_s::int_pin
digital_in_t int_pin
Definition: stepper22.h:376
stepper22_pca_read_reg
err_t stepper22_pca_read_reg(stepper22_t *ctx, uint8_t reg, uint8_t *data_out)
Stepper 22 pca read reg function.
stepper22_cfg_t::bemf
pin_name_t bemf
Definition: stepper22.h:400
stepper22_get_int_pin
uint8_t stepper22_get_int_pin(stepper22_t *ctx)
Stepper 22 get INT pin function.
stepper22_get_bin2_pin
err_t stepper22_get_bin2_pin(stepper22_t *ctx, uint8_t *state)
Stepper 22 get BIN2 pin function.
stepper22_s::spi
spi_master_t spi
Definition: stepper22.h:379
stepper22_cfg_t::i2c_address
uint8_t i2c_address
Definition: stepper22.h:406
stepper22_cfg_t::step
pin_name_t step
Definition: stepper22.h:402
stepper22_cfg_t::mosi
pin_name_t mosi
Definition: stepper22.h:397
stepper22_set_step_pin
void stepper22_set_step_pin(stepper22_t *ctx, uint8_t state)
Stepper 22 set STEP pin function.
stepper22_cfg_setup
void stepper22_cfg_setup(stepper22_cfg_t *cfg)
Stepper 22 configuration object setup function.
stepper22_read_bemf_voltage
err_t stepper22_read_bemf_voltage(stepper22_t *ctx, float *data_out)
Stepper 22 read BEMF pin voltage level function.
stepper22_set_reset_pin
err_t stepper22_set_reset_pin(stepper22_t *ctx, uint8_t state)
Stepper 22 set RESET pin function.
stepper22_cfg_t::cs
pin_name_t cs
Definition: stepper22.h:399
stepper22_get_stall_pin
err_t stepper22_get_stall_pin(stepper22_t *ctx, uint8_t *state)
Stepper 22 get STALL pin function.
stepper22_cfg_t::sda
pin_name_t sda
Definition: stepper22.h:395
stepper22_s::step
digital_out_t step
Definition: stepper22.h:374
STEPPER22_ERROR
@ STEPPER22_ERROR
Definition: stepper22.h:424
stepper22_cfg_t::i2c_speed
uint32_t i2c_speed
Definition: stepper22.h:405
stepper22_s
Stepper 22 Click context object.
Definition: stepper22.h:372
stepper22_get_bin1_pin
err_t stepper22_get_bin1_pin(stepper22_t *ctx, uint8_t *state)
Stepper 22 get BIN1 pin function.
stepper22_write_reg
err_t stepper22_write_reg(stepper22_t *ctx, uint8_t reg, uint16_t data_in)
Stepper 22 write reg function.
stepper22_set_sleep_pin
err_t stepper22_set_sleep_pin(stepper22_t *ctx, uint8_t state)
Stepper 22 set SLEEP pin function.
stepper22_cfg_t::sck
pin_name_t sck
Definition: stepper22.h:398
stepper22_cfg_t::spi_speed
uint32_t spi_speed
Definition: stepper22.h:408
stepper22_s::rst
digital_out_t rst
Definition: stepper22.h:373
stepper22_read_reg
err_t stepper22_read_reg(stepper22_t *ctx, uint8_t reg, uint16_t *data_out)
Stepper 22 read reg function.
stepper22_get_fault_pin
err_t stepper22_get_fault_pin(stepper22_t *ctx, uint8_t *state)
Stepper 22 get FAULT pin function.
stepper22_cfg_t::rst
pin_name_t rst
Definition: stepper22.h:401
stepper22_t
struct stepper22_s stepper22_t
Stepper 22 Click context object.
stepper22_get_sleep_pin
err_t stepper22_get_sleep_pin(stepper22_t *ctx, uint8_t *state)
Stepper 22 get SLEEP pin function.
stepper22_return_value_t
stepper22_return_value_t
Stepper 22 Click return value data.
Definition: stepper22.h:422
stepper22_cfg_t::resolution
analog_in_resolution_t resolution
Definition: stepper22.h:412
stepper22_init
err_t stepper22_init(stepper22_t *ctx, stepper22_cfg_t *cfg)
Stepper 22 initialization function.
stepper22_get_step_mode
err_t stepper22_get_step_mode(stepper22_t *ctx, uint8_t *mode)
Stepper 22 get step mode function.
stepper22_s::adc
analog_in_t adc
Definition: stepper22.h:384
stepper22_set_bin2_pin
err_t stepper22_set_bin2_pin(stepper22_t *ctx, uint8_t state)
Stepper 22 set BIN2 pin function.
stepper22_drive_motor
err_t stepper22_drive_motor(stepper22_t *ctx, uint32_t steps, uint8_t speed)
Stepper 22 driver motor function.
stepper22_set_step_mode
err_t stepper22_set_step_mode(stepper22_t *ctx, uint8_t mode)
Stepper 22 set step mode function.
stepper22_get_reset_pin
err_t stepper22_get_reset_pin(stepper22_t *ctx, uint8_t *state)
Stepper 22 get RESET pin function.
stepper22_cfg_t
Stepper 22 Click configuration object.
Definition: stepper22.h:393
stepper22_disable_device
err_t stepper22_disable_device(stepper22_t *ctx)
Stepper 22 disable device function.
stepper22_pca_write_reg
err_t stepper22_pca_write_reg(stepper22_t *ctx, uint8_t reg, uint8_t data_in)
Stepper 22 pca write reg function.