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 )
void stspin820_switch_direction(stspin820_t *ctx)
STSPIN820 switch direction function.
void stspin820_set_direction(stspin820_t *ctx, uint8_t dir)
STSPIN820 set direction function.
void stspin820_cfg_setup(stspin820_cfg_t *cfg)
STSPIN820 configuration object setup function.
err_t stspin820_init(stspin820_t *ctx, stspin820_cfg_t *cfg)
STSPIN820 initialization function.
void stspin820_drive_motor(stspin820_t *ctx, uint32_t steps, uint8_t speed)
STSPIN820 drive motor function.
void stspin820_set_rst_pin(stspin820_t *ctx, uint8_t state)
STSPIN820 set rst pin function.
uint8_t stspin820_get_fault_pin(stspin820_t *ctx)
STSPIN820 get fault pin function.
void stspin820_reset_device(stspin820_t *ctx)
STSPIN820 reset device function.
void stspin820_enable_device(stspin820_t *ctx)
STSPIN820 enable device function.
void stspin820_disable_device(stspin820_t *ctx)
STSPIN820 disable device function.
void stspin820_set_step_pin(stspin820_t *ctx, uint8_t state)
STSPIN820 set step pin function.
void stspin820_default_cfg(stspin820_t *ctx)
STSPIN820 default configuration function.
STSPIN820 Click configuration object.
Definition stspin820.h:138
pin_name_t step
Definition stspin820.h:142
pin_name_t dir
Definition stspin820.h:139
pin_name_t en
Definition stspin820.h:141
pin_name_t rst
Definition stspin820.h:140
pin_name_t fault
Definition stspin820.h:143
STSPIN820 Click context object.
Definition stspin820.h:123
digital_out_t step
Definition stspin820.h:127
digital_out_t en
Definition stspin820.h:126
digital_out_t rst
Definition stspin820.h:125
digital_in_t fault
Definition stspin820.h:129
digital_out_t dir
Definition stspin820.h:124
stspin820_return_value_t
STSPIN820 Click return value data.
Definition stspin820.h:152
@ STSPIN820_ERROR
Definition stspin820.h:154
@ STSPIN820_OK
Definition stspin820.h:153