28#ifndef MULTISTEPPERTB67S101_H
29#define MULTISTEPPERTB67S101_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 MULTISTEPPERTB67S101_REG_INPUT 0x00
73#define MULTISTEPPERTB67S101_REG_OUTPUT 0x01
74#define MULTISTEPPERTB67S101_REG_POLARITY 0x02
75#define MULTISTEPPERTB67S101_REG_CONFIG 0x03
93#define MULTISTEPPERTB67S101_PHASEA_PIN 0x02
94#define MULTISTEPPERTB67S101_PHASEB_PIN 0x04
100#define MULTISTEPPERTB67S101_DEFAULT_CONFIG 0xF9
106#define MULTISTEPPERTB67S101_DIR_CW 0
107#define MULTISTEPPERTB67S101_DIR_CCW 1
113#define MULTISTEPPERTB67S101_PIN_LOW_LEVEL 0
114#define MULTISTEPPERTB67S101_PIN_HIGH_LEVEL 1
120#define MULTISTEPPERTB67S101_MODE_FULL_STEP 0x00
121#define MULTISTEPPERTB67S101_MODE_HALF_STEP 0x01
122#define MULTISTEPPERTB67S101_MODE_QUARTER_STEP 0x02
128#define MULTISTEPPERTB67S101_SPEED_VERY_SLOW 0
129#define MULTISTEPPERTB67S101_SPEED_SLOW 1
130#define MULTISTEPPERTB67S101_SPEED_MEDIUM 2
131#define MULTISTEPPERTB67S101_SPEED_FAST 3
132#define MULTISTEPPERTB67S101_SPEED_VERY_FAST 4
139#define MULTISTEPPERTB67S101_DEVICE_ADDRESS_A1A0_00 0x70
140#define MULTISTEPPERTB67S101_DEVICE_ADDRESS_A1A0_01 0x71
141#define MULTISTEPPERTB67S101_DEVICE_ADDRESS_A1A0_10 0x72
142#define MULTISTEPPERTB67S101_DEVICE_ADDRESS_A1A0_11 0x73
160#define MULTISTEPPERTB67S101_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 // multisteppertb67s101
void multisteppertb67s101_cfg_setup(multisteppertb67s101_cfg_t *cfg)
Multi Stepper TB67S101 configuration object setup function.
void multisteppertb67s101_switch_direction(multisteppertb67s101_t *ctx)
Multi Stepper TB67S101 switch direction function.
void multisteppertb67s101_disable_device(multisteppertb67s101_t *ctx)
Multi Stepper TB67S101 disable device function.
err_t multisteppertb67s101_default_cfg(multisteppertb67s101_t *ctx)
Multi Stepper TB67S101 default configuration function.
err_t multisteppertb67s101_write_register(multisteppertb67s101_t *ctx, uint8_t reg, uint8_t data_in)
Multi Stepper TB67S101 write register function.
err_t multisteppertb67s101_read_register(multisteppertb67s101_t *ctx, uint8_t reg, uint8_t *data_out)
Multi Stepper TB67S101 read register function.
void multisteppertb67s101_set_step_mode(multisteppertb67s101_t *ctx, uint8_t mode)
Multi Stepper TB67S101 set step mode function.
void multisteppertb67s101_set_inb1_pin(multisteppertb67s101_t *ctx, uint8_t state)
Multi Stepper TB67S101 set inb1 pin function.
void multisteppertb67s101_set_direction(multisteppertb67s101_t *ctx, uint8_t dir)
Multi Stepper TB67S101 set direction function.
err_t multisteppertb67s101_init(multisteppertb67s101_t *ctx, multisteppertb67s101_cfg_t *cfg)
Multi Stepper TB67S101 initialization function.
err_t multisteppertb67s101_drive_motor(multisteppertb67s101_t *ctx, uint32_t steps, uint8_t speed)
Multi Stepper TB67S101 driver motor function.
void multisteppertb67s101_enable_device(multisteppertb67s101_t *ctx)
Multi Stepper TB67S101 enable device function.
void multisteppertb67s101_set_ina2_pin(multisteppertb67s101_t *ctx, uint8_t state)
Multi Stepper TB67S101 set ina2 pin function.
void multisteppertb67s101_set_ina1_pin(multisteppertb67s101_t *ctx, uint8_t state)
Multi Stepper TB67S101 set ina1 pin function.
void multisteppertb67s101_set_inb2_pin(multisteppertb67s101_t *ctx, uint8_t state)
Multi Stepper TB67S101 set inb2 pin function.
multisteppertb67s101_return_value_t
Multi Stepper TB67S101 Click return value data.
Definition multisteppertb67s101.h:221
@ MULTISTEPPERTB67S101_ERROR
Definition multisteppertb67s101.h:223
@ MULTISTEPPERTB67S101_OK
Definition multisteppertb67s101.h:222
Multi Stepper TB67S101 Click configuration object.
Definition multisteppertb67s101.h:201
pin_name_t clk
Definition multisteppertb67s101.h:207
uint32_t i2c_speed
Definition multisteppertb67s101.h:211
pin_name_t scl
Definition multisteppertb67s101.h:202
pin_name_t en
Definition multisteppertb67s101.h:208
pin_name_t int_pin
Definition multisteppertb67s101.h:206
pin_name_t sda
Definition multisteppertb67s101.h:203
pin_name_t rst
Definition multisteppertb67s101.h:209
pin_name_t an
Definition multisteppertb67s101.h:205
uint8_t i2c_address
Definition multisteppertb67s101.h:212
Multi Stepper TB67S101 Click context object.
Definition multisteppertb67s101.h:177
uint8_t step_mode
Definition multisteppertb67s101.h:191
i2c_master_t i2c
Definition multisteppertb67s101.h:186
digital_out_t int_pin
Definition multisteppertb67s101.h:180
digital_out_t clk
Definition multisteppertb67s101.h:181
digital_out_t en
Definition multisteppertb67s101.h:182
digital_out_t rst
Definition multisteppertb67s101.h:183
uint8_t direction
Definition multisteppertb67s101.h:192
uint8_t slave_address
Definition multisteppertb67s101.h:189
digital_out_t an
Definition multisteppertb67s101.h:179