Go to the documentation of this file.
39 #ifdef PREINIT_SUPPORTED
43 #ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49 #include "drv_digital_out.h"
50 #include "drv_digital_in.h"
72 #define STSPIN220_DIR_CW 0
73 #define STSPIN220_DIR_CCW 1
79 #define STSPIN220_PIN_LOW_LEVEL 0
80 #define STSPIN220_PIN_HIGH_LEVEL 1
86 #define STSPIN220_SPEED_VERY_SLOW 0
87 #define STSPIN220_SPEED_SLOW 1
88 #define STSPIN220_SPEED_MEDIUM 2
89 #define STSPIN220_SPEED_FAST 3
90 #define STSPIN220_SPEED_VERY_FAST 4
108 #define STSPIN220_MAP_MIKROBUS( cfg, mikrobus ) \
109 cfg.dir = MIKROBUS( mikrobus, MIKROBUS_AN ); \
110 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
111 cfg.en = MIKROBUS( mikrobus, MIKROBUS_CS ); \
112 cfg.step = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
113 cfg.fault = MIKROBUS( mikrobus, MIKROBUS_INT )
308 #endif // STSPIN220_H
pin_name_t rst
Definition: stspin220.h:140
@ STSPIN220_ERROR
Definition: stspin220.h:154
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:124
pin_name_t en
Definition: stspin220.h:141
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:129
void stspin220_default_cfg(stspin220_t *ctx)
STSPIN220 default configuration function.
pin_name_t step
Definition: stspin220.h:142
digital_out_t step
Definition: stspin220.h:127
pin_name_t dir
Definition: stspin220.h:139
pin_name_t fault
Definition: stspin220.h:143
STSPIN220 Click configuration object.
Definition: stspin220.h:138
digital_out_t en
Definition: stspin220.h:126
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:125
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:153
STSPIN220 Click context object.
Definition: stspin220.h:123
stspin220_return_value_t
STSPIN220 Click return value data.
Definition: stspin220.h:152