Go to the documentation of this file.
35 #include "mikrosdk_version.h"
38 #if mikroSDK_GET_VERSION < 20800ul
39 #include "rcu_delays.h"
45 #include "drv_digital_out.h"
46 #include "drv_digital_in.h"
68 #define STSPIN220_DIR_CW 0
69 #define STSPIN220_DIR_CCW 1
75 #define STSPIN220_PIN_LOW_LEVEL 0
76 #define STSPIN220_PIN_HIGH_LEVEL 1
82 #define STSPIN220_SPEED_VERY_SLOW 0
83 #define STSPIN220_SPEED_SLOW 1
84 #define STSPIN220_SPEED_MEDIUM 2
85 #define STSPIN220_SPEED_FAST 3
86 #define STSPIN220_SPEED_VERY_FAST 4
104 #define STSPIN220_MAP_MIKROBUS( cfg, mikrobus ) \
105 cfg.dir = MIKROBUS( mikrobus, MIKROBUS_AN ); \
106 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
107 cfg.en = MIKROBUS( mikrobus, MIKROBUS_CS ); \
108 cfg.step = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
109 cfg.fault = MIKROBUS( mikrobus, MIKROBUS_INT )
304 #endif // STSPIN220_H
pin_name_t rst
Definition: stspin220.h:136
@ STSPIN220_ERROR
Definition: stspin220.h:150
void stspin220_cfg_setup(stspin220_cfg_t *cfg)
STSPIN220 configuration object setup function.
void stspin220_enable_device(stspin220_t *ctx)
STSPIN220 enable device function.
uint8_t stspin220_get_fault_pin(stspin220_t *ctx)
STSPIN220 get fault pin function.
void stspin220_switch_direction(stspin220_t *ctx)
STSPIN220 switch direction function.
digital_out_t dir
Definition: stspin220.h:120
pin_name_t en
Definition: stspin220.h:137
void stspin220_set_step_pin(stspin220_t *ctx, uint8_t state)
STSPIN220 set step pin function.
void stspin220_disable_device(stspin220_t *ctx)
STSPIN220 disable device function.
digital_in_t fault
Definition: stspin220.h:125
void stspin220_default_cfg(stspin220_t *ctx)
STSPIN220 default configuration function.
pin_name_t step
Definition: stspin220.h:138
digital_out_t step
Definition: stspin220.h:123
pin_name_t dir
Definition: stspin220.h:135
pin_name_t fault
Definition: stspin220.h:139
STSPIN220 Click configuration object.
Definition: stspin220.h:134
digital_out_t en
Definition: stspin220.h:122
void stspin220_reset_device(stspin220_t *ctx)
STSPIN220 reset device function.
err_t stspin220_init(stspin220_t *ctx, stspin220_cfg_t *cfg)
STSPIN220 initialization function.
void stspin220_set_direction(stspin220_t *ctx, uint8_t dir)
STSPIN220 set direction function.
digital_out_t rst
Definition: stspin220.h:121
void stspin220_set_rst_pin(stspin220_t *ctx, uint8_t state)
STSPIN220 set rst pin function.
void stspin220_drive_motor(stspin220_t *ctx, uint32_t steps, uint8_t speed)
STSPIN220 drive motor function.
@ STSPIN220_OK
Definition: stspin220.h:149
STSPIN220 Click context object.
Definition: stspin220.h:119
stspin220_return_value_t
STSPIN220 Click return value data.
Definition: stspin220.h:148