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 STEPPER3_DIR_CW 0
73#define STEPPER3_DIR_CCW 1
79#define STEPPER3_PIN_LOW_LEVEL 0
80#define STEPPER3_PIN_HIGH_LEVEL 1
86#define STEPPER3_MODE_FULL_STEP 0
87#define STEPPER3_MODE_HALF_STEP 1
93#define STEPPER3_MICROSTEP_NUM_PER_STEP 32
99#define STEPPER3_SPEED_VERY_SLOW 0
100#define STEPPER3_SPEED_SLOW 1
101#define STEPPER3_SPEED_MEDIUM 2
102#define STEPPER3_SPEED_FAST 3
103#define STEPPER3_SPEED_VERY_FAST 4
121#define STEPPER3_MAP_MIKROBUS( cfg, mikrobus ) \
122 cfg.ina = MIKROBUS( mikrobus, MIKROBUS_AN ); \
123 cfg.inb = MIKROBUS( mikrobus, MIKROBUS_RST ); \
124 cfg.inc = MIKROBUS( mikrobus, MIKROBUS_CS ); \
125 cfg.ind = MIKROBUS( mikrobus, MIKROBUS_PWM );
void stepper3_disable_device(stepper3_t *ctx)
Stepper 3 disable device function.
void stepper3_drive_motor(stepper3_t *ctx, uint32_t steps, uint8_t speed)
Stepper 3 driver motor function.
void stepper3_enable_device(stepper3_t *ctx)
Stepper 3 enable device function.
void stepper3_set_inc_pin(stepper3_t *ctx, uint8_t state)
Stepper 3 set inc pin function.
void stepper3_set_direction(stepper3_t *ctx, uint8_t dir)
Stepper 3 set direction function.
void stepper3_set_ind_pin(stepper3_t *ctx, uint8_t state)
Stepper 3 set ind pin function.
void stepper3_set_ina_pin(stepper3_t *ctx, uint8_t state)
Stepper 3 set ina pin function.
void stepper3_cfg_setup(stepper3_cfg_t *cfg)
Stepper 3 configuration object setup function.
void stepper3_set_step_mode(stepper3_t *ctx, uint8_t mode)
Stepper 3 set step mode function.
err_t stepper3_init(stepper3_t *ctx, stepper3_cfg_t *cfg)
Stepper 3 initialization function.
void stepper3_set_inb_pin(stepper3_t *ctx, uint8_t state)
Stepper 3 set inb pin function.
void stepper3_switch_direction(stepper3_t *ctx)
Stepper 3 switch direction function.
stepper3_return_value_t
Stepper 3 Click return value data.
Definition stepper3.h:164
@ STEPPER3_ERROR
Definition stepper3.h:166
@ STEPPER3_OK
Definition stepper3.h:165
Stepper 3 Click configuration object.
Definition stepper3.h:151
pin_name_t inc
Definition stepper3.h:154
pin_name_t ina
Definition stepper3.h:152
pin_name_t ind
Definition stepper3.h:155
pin_name_t inb
Definition stepper3.h:153
Stepper 3 Click context object.
Definition stepper3.h:135
digital_out_t inc
Definition stepper3.h:138
uint8_t step_mode
Definition stepper3.h:141
digital_out_t inb
Definition stepper3.h:137
digital_out_t ina
Definition stepper3.h:136
uint8_t direction
Definition stepper3.h:142
digital_out_t ind
Definition stepper3.h:139