Go to the documentation of this file.
35 #include "drv_digital_out.h"
36 #include "drv_digital_in.h"
37 #include "drv_i2c_master.h"
59 #define STEPPER11_REG_INPUT_PORT 0x00
60 #define STEPPER11_REG_OUTPUT_PORT 0x01
61 #define STEPPER11_REG_POLARITY 0x02
62 #define STEPPER11_REG_CONFIGURATION 0x03
80 #define STEPPER11_SPEED_SLOW 1
81 #define STEPPER11_SPEED_MEDIUM 2
82 #define STEPPER11_SPEED_FAST 3
88 #define STEPPER11_RESOLUTION_FULL 0x4
89 #define STEPPER11_RESOLUTION_HALF_A 0x2
90 #define STEPPER11_RESOLUTION_HALF_B 0x1
91 #define STEPPER11_RESOLUTION_QUARTER 0x6
92 #define STEPPER11_RESOLUTION_1div8 0x5
93 #define STEPPER11_RESOLUTION_1div16 0x3
94 #define STEPPER11_RESOLUTION_1div32 0x7
100 #define STEPPER11_TORQUE_100 0x0
101 #define STEPPER11_TORQUE_70 0x1
102 #define STEPPER11_TORQUE_50 0x2
103 #define STEPPER11_TORQUE_30 0x3
110 #define STEPPER11_SET_DEV_ADDR 0x70
128 #define STEPPER11_MAP_MIKROBUS( cfg, mikrobus ) \
129 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
130 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
131 cfg.en = MIKROBUS( mikrobus, MIKROBUS_CS ); \
132 cfg.dir = MIKROBUS( mikrobus, MIKROBUS_AN ); \
133 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
134 cfg.clk = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
135 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
153 digital_in_t int_pin;
159 uint8_t slave_address;
163 uint8_t step_resolution;
425 #endif // STEPPER11_H
uint8_t stepper11_get_mo(stepper11_t *ctx)
Get electrical angle monitoring signal.
Definition: stepper11.h:193
uint8_t stepper11_get_diag(stepper11_t *ctx)
Get anomaly detection flag.
void stepper11_cfg_setup(stepper11_cfg_t *cfg)
Stepper 11 configuration object setup function.
uint8_t stepper11_get_sd(stepper11_t *ctx)
Get stall detection flag.
void stepper11_set_reset(stepper11_t *ctx, uint8_t state)
Set restart.
err_t stepper11_set_step_resolution(stepper11_t *ctx, uint8_t step_res)
Set step resolution.
void stepper11_set_clock(stepper11_t *ctx, uint8_t state)
Set clock state.
void stepper11_move_motor_step(stepper11_t *ctx, uint16_t steps, uint8_t speed)
Move motor in step value.
err_t stepper11_init(stepper11_t *ctx, stepper11_cfg_t *cfg)
Stepper 11 initialization function.
Stepper 11 Click context object.
Definition: stepper11.h:143
stepper11_return_value_t
Stepper 11 Click return value data.
Definition: stepper11.h:190
err_t stepper11_generic_write(stepper11_t *ctx, uint8_t reg, uint8_t tx_data)
Stepper 11 I2C writing function.
err_t stepper11_default_cfg(stepper11_t *ctx)
Stepper 11 default configuration function.
err_t stepper11_set_torque(stepper11_t *ctx, uint8_t torque)
Set torque.
Stepper 11 Click configuration object.
Definition: stepper11.h:170
uint8_t stepper11_get_interrupt(stepper11_t *ctx)
Get interrupt.
Definition: stepper11.h:192
err_t stepper11_generic_read(stepper11_t *ctx, uint8_t reg, uint8_t *rx_data)
Stepper 11 I2C reading function.
void stepper11_set_enable(stepper11_t *ctx, uint8_t state)
Set enable.
void stepper11_move_motor_angle(stepper11_t *ctx, float degree, uint8_t speed)
Move motor in angle value.
void stepper11_set_direction(stepper11_t *ctx, uint8_t state)
Set direction.