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 STSPIN820_DIR_CW 0
73 #define STSPIN820_DIR_CCW 1
79 #define STSPIN820_PIN_LOW_LEVEL 0
80 #define STSPIN820_PIN_HIGH_LEVEL 1
86 #define STSPIN820_SPEED_VERY_SLOW 0
87 #define STSPIN820_SPEED_SLOW 1
88 #define STSPIN820_SPEED_MEDIUM 2
89 #define STSPIN820_SPEED_FAST 3
90 #define STSPIN820_SPEED_VERY_FAST 4
108 #define STSPIN820_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 // STSPIN820_H
void stspin820_set_direction(stspin820_t *ctx, uint8_t dir)
STSPIN820 set direction function.
pin_name_t rst
Definition: stspin820.h:140
digital_out_t step
Definition: stspin820.h:127
@ STSPIN820_OK
Definition: stspin820.h:153
err_t stspin820_init(stspin820_t *ctx, stspin820_cfg_t *cfg)
STSPIN820 initialization function.
digital_out_t dir
Definition: stspin820.h:124
void stspin820_default_cfg(stspin820_t *ctx)
STSPIN820 default configuration function.
uint8_t stspin820_get_fault_pin(stspin820_t *ctx)
STSPIN820 get fault pin function.
digital_out_t en
Definition: stspin820.h:126
pin_name_t en
Definition: stspin820.h:141
void stspin820_set_rst_pin(stspin820_t *ctx, uint8_t state)
STSPIN820 set rst pin function.
void stspin820_switch_direction(stspin820_t *ctx)
STSPIN820 switch direction function.
void stspin820_enable_device(stspin820_t *ctx)
STSPIN820 enable device function.
void stspin820_reset_device(stspin820_t *ctx)
STSPIN820 reset device function.
void stspin820_cfg_setup(stspin820_cfg_t *cfg)
STSPIN820 configuration object setup function.
void stspin820_drive_motor(stspin820_t *ctx, uint32_t steps, uint8_t speed)
STSPIN820 drive motor function.
digital_in_t fault
Definition: stspin820.h:129
STSPIN820 Click configuration object.
Definition: stspin820.h:138
pin_name_t step
Definition: stspin820.h:142
STSPIN820 Click context object.
Definition: stspin820.h:123
pin_name_t dir
Definition: stspin820.h:139
digital_out_t rst
Definition: stspin820.h:125
pin_name_t fault
Definition: stspin820.h:143
void stspin820_disable_device(stspin820_t *ctx)
STSPIN820 disable device function.
stspin820_return_value_t
STSPIN820 Click return value data.
Definition: stspin820.h:152
void stspin820_set_step_pin(stspin820_t *ctx, uint8_t state)
STSPIN820 set step pin function.
@ STSPIN820_ERROR
Definition: stspin820.h:154