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 STEPPER4_DIR_CW 0
73#define STEPPER4_DIR_CCW 1
79#define STEPPER4_PIN_LOW_LEVEL 0
80#define STEPPER4_PIN_HIGH_LEVEL 1
86#define STEPPER4_SPEED_VERY_SLOW 0
87#define STEPPER4_SPEED_SLOW 1
88#define STEPPER4_SPEED_MEDIUM 2
89#define STEPPER4_SPEED_FAST 3
90#define STEPPER4_SPEED_VERY_FAST 4
108#define STEPPER4_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.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
void stepper4_cfg_setup(stepper4_cfg_t *cfg)
Stepper 4 configuration object setup function.
void stepper4_reset_device(stepper4_t *ctx)
Stepper 4 reset device function.
void stepper4_set_step_pin(stepper4_t *ctx, uint8_t state)
Stepper 4 set step pin function.
void stepper4_drive_motor(stepper4_t *ctx, uint32_t steps, uint8_t speed)
Stepper 4 drive motor function.
void stepper4_disable_device(stepper4_t *ctx)
Stepper 4 disable device function.
uint8_t stepper4_get_int_pin(stepper4_t *ctx)
Stepper 4 get int pin function.
void stepper4_enable_device(stepper4_t *ctx)
Stepper 4 enable device function.
void stepper4_default_cfg(stepper4_t *ctx)
Stepper 4 default configuration function.
err_t stepper4_init(stepper4_t *ctx, stepper4_cfg_t *cfg)
Stepper 4 initialization function.
void stepper4_switch_direction(stepper4_t *ctx)
Stepper 4 switch direction function.
void stepper4_set_direction(stepper4_t *ctx, uint8_t dir)
Stepper 4 set direction function.
stepper4_return_value_t
Stepper 4 Click return value data.
Definition stepper4.h:152
@ STEPPER4_OK
Definition stepper4.h:153
@ STEPPER4_ERROR
Definition stepper4.h:154
Stepper 4 Click configuration object.
Definition stepper4.h:138
pin_name_t step
Definition stepper4.h:142
pin_name_t dir
Definition stepper4.h:139
pin_name_t en
Definition stepper4.h:141
pin_name_t int_pin
Definition stepper4.h:143
pin_name_t rst
Definition stepper4.h:140
Stepper 4 Click context object.
Definition stepper4.h:123
digital_in_t int_pin
Definition stepper4.h:129
digital_out_t step
Definition stepper4.h:127
digital_out_t en
Definition stepper4.h:126
digital_out_t rst
Definition stepper4.h:125
digital_out_t dir
Definition stepper4.h:124