28#ifndef MULTISTEPPERTB67S261_H
29#define MULTISTEPPERTB67S261_H
39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_i2c_master.h"
72#define MULTISTEPPERTB67S261_REG_INPUT 0x00
73#define MULTISTEPPERTB67S261_REG_OUTPUT 0x01
74#define MULTISTEPPERTB67S261_REG_POLARITY 0x02
75#define MULTISTEPPERTB67S261_REG_CONFIG 0x03
93#define MULTISTEPPERTB67S261_PHASEA_PIN 0x02
94#define MULTISTEPPERTB67S261_PHASEB_PIN 0x04
100#define MULTISTEPPERTB67S261_DEFAULT_CONFIG 0xF9
106#define MULTISTEPPERTB67S261_DIR_CW 0
107#define MULTISTEPPERTB67S261_DIR_CCW 1
113#define MULTISTEPPERTB67S261_PIN_LOW_LEVEL 0
114#define MULTISTEPPERTB67S261_PIN_HIGH_LEVEL 1
120#define MULTISTEPPERTB67S261_MODE_FULL_STEP 0x00
121#define MULTISTEPPERTB67S261_MODE_HALF_STEP 0x01
122#define MULTISTEPPERTB67S261_MODE_QUARTER_STEP 0x02
128#define MULTISTEPPERTB67S261_SPEED_VERY_SLOW 0
129#define MULTISTEPPERTB67S261_SPEED_SLOW 1
130#define MULTISTEPPERTB67S261_SPEED_MEDIUM 2
131#define MULTISTEPPERTB67S261_SPEED_FAST 3
132#define MULTISTEPPERTB67S261_SPEED_VERY_FAST 4
139#define MULTISTEPPERTB67S261_DEVICE_ADDRESS_A1A0_00 0x70
140#define MULTISTEPPERTB67S261_DEVICE_ADDRESS_A1A0_01 0x71
141#define MULTISTEPPERTB67S261_DEVICE_ADDRESS_A1A0_10 0x72
142#define MULTISTEPPERTB67S261_DEVICE_ADDRESS_A1A0_11 0x73
160#define MULTISTEPPERTB67S261_MAP_MIKROBUS( cfg, mikrobus ) \
161 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
162 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
163 cfg.en = MIKROBUS( mikrobus, MIKROBUS_CS ); \
164 cfg.an = MIKROBUS( mikrobus, MIKROBUS_AN ); \
165 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
166 cfg.clk = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
167 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
170 // multisteppertb67s261
err_t multisteppertb67s261_write_register(multisteppertb67s261_t *ctx, uint8_t reg, uint8_t data_in)
Multi Stepper TB67S261 write register function.
void multisteppertb67s261_cfg_setup(multisteppertb67s261_cfg_t *cfg)
Multi Stepper TB67S261 configuration object setup function.
void multisteppertb67s261_set_step_mode(multisteppertb67s261_t *ctx, uint8_t mode)
Multi Stepper TB67S261 set step mode function.
void multisteppertb67s261_switch_direction(multisteppertb67s261_t *ctx)
Multi Stepper TB67S261 switch direction function.
err_t multisteppertb67s261_drive_motor(multisteppertb67s261_t *ctx, uint32_t steps, uint8_t speed)
Multi Stepper TB67S261 driver motor function.
void multisteppertb67s261_set_ina1_pin(multisteppertb67s261_t *ctx, uint8_t state)
Multi Stepper TB67S261 set ina1 pin function.
void multisteppertb67s261_disable_device(multisteppertb67s261_t *ctx)
Multi Stepper TB67S261 disable device function.
void multisteppertb67s261_enable_device(multisteppertb67s261_t *ctx)
Multi Stepper TB67S261 enable device function.
err_t multisteppertb67s261_read_register(multisteppertb67s261_t *ctx, uint8_t reg, uint8_t *data_out)
Multi Stepper TB67S261 read register function.
err_t multisteppertb67s261_default_cfg(multisteppertb67s261_t *ctx)
Multi Stepper TB67S261 default configuration function.
void multisteppertb67s261_set_ina2_pin(multisteppertb67s261_t *ctx, uint8_t state)
Multi Stepper TB67S261 set ina2 pin function.
void multisteppertb67s261_set_inb1_pin(multisteppertb67s261_t *ctx, uint8_t state)
Multi Stepper TB67S261 set inb1 pin function.
void multisteppertb67s261_set_inb2_pin(multisteppertb67s261_t *ctx, uint8_t state)
Multi Stepper TB67S261 set inb2 pin function.
void multisteppertb67s261_set_direction(multisteppertb67s261_t *ctx, uint8_t dir)
Multi Stepper TB67S261 set direction function.
err_t multisteppertb67s261_init(multisteppertb67s261_t *ctx, multisteppertb67s261_cfg_t *cfg)
Multi Stepper TB67S261 initialization function.
multisteppertb67s261_return_value_t
Multi Stepper TB67S261 Click return value data.
Definition multisteppertb67s261.h:221
@ MULTISTEPPERTB67S261_ERROR
Definition multisteppertb67s261.h:223
@ MULTISTEPPERTB67S261_OK
Definition multisteppertb67s261.h:222
Multi Stepper TB67S261 Click configuration object.
Definition multisteppertb67s261.h:201
pin_name_t clk
Definition multisteppertb67s261.h:207
uint32_t i2c_speed
Definition multisteppertb67s261.h:211
pin_name_t scl
Definition multisteppertb67s261.h:202
pin_name_t en
Definition multisteppertb67s261.h:208
pin_name_t int_pin
Definition multisteppertb67s261.h:206
pin_name_t sda
Definition multisteppertb67s261.h:203
pin_name_t rst
Definition multisteppertb67s261.h:209
pin_name_t an
Definition multisteppertb67s261.h:205
uint8_t i2c_address
Definition multisteppertb67s261.h:212
Multi Stepper TB67S261 Click context object.
Definition multisteppertb67s261.h:177
uint8_t step_mode
Definition multisteppertb67s261.h:191
i2c_master_t i2c
Definition multisteppertb67s261.h:186
digital_out_t int_pin
Definition multisteppertb67s261.h:180
digital_out_t clk
Definition multisteppertb67s261.h:181
digital_out_t en
Definition multisteppertb67s261.h:182
digital_out_t rst
Definition multisteppertb67s261.h:183
uint8_t direction
Definition multisteppertb67s261.h:192
uint8_t slave_address
Definition multisteppertb67s261.h:189
digital_out_t an
Definition multisteppertb67s261.h:179