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 STSPIN820_DIR_CW 0
69 #define STSPIN820_DIR_CCW 1
75 #define STSPIN820_PIN_LOW_LEVEL 0
76 #define STSPIN820_PIN_HIGH_LEVEL 1
82 #define STSPIN820_SPEED_VERY_SLOW 0
83 #define STSPIN820_SPEED_SLOW 1
84 #define STSPIN820_SPEED_MEDIUM 2
85 #define STSPIN820_SPEED_FAST 3
86 #define STSPIN820_SPEED_VERY_FAST 4
104 #define STSPIN820_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 // STSPIN820_H
void stspin820_set_direction(stspin820_t *ctx, uint8_t dir)
STSPIN820 set direction function.
pin_name_t rst
Definition: stspin820.h:136
digital_out_t step
Definition: stspin820.h:123
@ STSPIN820_OK
Definition: stspin820.h:149
err_t stspin820_init(stspin820_t *ctx, stspin820_cfg_t *cfg)
STSPIN820 initialization function.
digital_out_t dir
Definition: stspin820.h:120
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:122
pin_name_t en
Definition: stspin820.h:137
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:125
STSPIN820 Click configuration object.
Definition: stspin820.h:134
pin_name_t step
Definition: stspin820.h:138
STSPIN820 Click context object.
Definition: stspin820.h:119
pin_name_t dir
Definition: stspin820.h:135
digital_out_t rst
Definition: stspin820.h:121
pin_name_t fault
Definition: stspin820.h:139
void stspin820_disable_device(stspin820_t *ctx)
STSPIN820 disable device function.
stspin820_return_value_t
STSPIN820 Click return value data.
Definition: stspin820.h:148
void stspin820_set_step_pin(stspin820_t *ctx, uint8_t state)
STSPIN820 set step pin function.
@ STSPIN820_ERROR
Definition: stspin820.h:150