stepper19 2.1.0.0
stepper19.h File Reference

This file contains API for Stepper 19 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  stepper19_t
 Stepper 19 Click context object. More...
 
struct  stepper19_cfg_t
 Stepper 19 Click configuration object. More...
 

Macros

#define STEPPER19_REG_IN_PORT   0x00
 Stepper 19 description register.
 
#define STEPPER19_REG_OUT_PORT   0x01
 
#define STEPPER19_REG_POL_INV   0x02
 
#define STEPPER19_REG_CONFIG   0x03
 
#define STEPPER19_PIN_STATE_LOW   0
 Stepper 19 pin logic state setting.
 
#define STEPPER19_PIN_STATE_HIGH   1
 
#define STEPPER19_DIR_CLOCKWISE   0
 Stepper 19 step/direction driver mode.
 
#define STEPPER19_DIR_COUNTERCLOCKWISE   1
 
#define STEPPER19_PIN_NONE   0x00
 Stepper 19 GPIO expander pin setting.
 
#define STEPPER19_PIN_M0   0x01
 
#define STEPPER19_PIN_M1   0x02
 
#define STEPPER19_PIN_DEC0   0x04
 
#define STEPPER19_PIN_DEC1   0x08
 
#define STEPPER19_PIN_TOFF   0x10
 
#define STEPPER19_PIN_STP   0x20
 
#define STEPPER19_PIN_DIR   0x40
 
#define STEPPER19_CTRL_STEP_DIR_GPIO   0
 Stepper 19 GPIO expander pin setting.
 
#define STEPPER19_CTRL_STEP_DIR_PORT_EXP   1
 
#define STEPPER19_PORT_EXP_DEFAULT_CFG   0x03
 Stepper 19 port expander pin direction config.
 
#define STEPPER19_MSTEP_MODE_FULL   1
 Stepper 19 microstepping indexer settings.
 
#define STEPPER19_MSTEP_MODE_HALF   2
 
#define STEPPER19_MSTEP_MODE_1_4   4
 
#define STEPPER19_MSTEP_MODE_1_8   8
 
#define STEPPER19_MSTEP_MODE_1_16   16
 
#define STEPPER19_MSTEP_MODE_1_32   32
 
#define STEPPER19_MSTEP_MODE_1_64   64
 
#define STEPPER19_MSTEP_MODE_1_128   128
 
#define STEPPER19_MSTEP_MODE_1_256   256
 
#define STEPPER19_DECAY_MODE_DYN   0
 Stepper 19 decay mode settings.
 
#define STEPPER19_DECAY_MODE_XRP   1
 
#define STEPPER19_DECAY_MODE_F_30   2
 
#define STEPPER19_DECAY_MODE_SLW   3
 
#define STEPPER19_TOFF_7US   0
 Stepper 19 TOFF settings.
 
#define STEPPER19_TOFF_16US   1
 
#define STEPPER19_STEP_DELAY_DEF_100US   2ul
 Stepper 19 step delay default value.
 
#define STEPPER19_FULL_STEP   1.0f
 Stepper 19 step speed and angle data values.
 
#define STEPPER19_STEP_SPEED_MIN   1
 
#define STEPPER19_STEP_SPEED_MAX   100
 
#define STEPPER19_ANGLE_360_DEGREES   360.0f
 
#define STEPPER19_FULL_CIRCLE   360.0
 Stepper 19 calculation data values.
 
#define STEPPER19_RESOLUTION   4096.0
 
#define STEPPER19_VREF   3330.0
 
#define STEPPER19_DEVICE_ADDRESS_0   0x70
 Stepper 19 device address setting.
 
#define STEPPER19_DEVICE_ADDRESS_1   0x72
 
#define STEPPER19_DEVICE_ADDRESS_2   0x74
 
#define STEPPER19_DEVICE_ADDRESS_3   0x76
 
#define STEPPER19_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  stepper19_return_value_t { STEPPER19_OK = 0 , STEPPER19_ERROR = -1 }
 Stepper 19 Click return value data. More...
 

Functions

void stepper19_cfg_setup (stepper19_cfg_t *cfg)
 Stepper 19 configuration object setup function.
 
err_t stepper19_init (stepper19_t *ctx, stepper19_cfg_t *cfg)
 Stepper 19 initialization function.
 
err_t stepper19_default_cfg (stepper19_t *ctx)
 Stepper 19 default configuration function.
 
err_t stepper19_generic_write (stepper19_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Stepper 19 I2C writing function.
 
err_t stepper19_generic_read (stepper19_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Stepper 19 I2C reading function.
 
err_t stepper19_port_exp_write (stepper19_t *ctx, uint8_t reg, uint8_t data_in)
 Stepper 19 port expander data writing function.
 
err_t stepper19_port_exp_read (stepper19_t *ctx, uint8_t reg, uint8_t *data_out)
 Stepper 19 port expander data reading function.
 
err_t stepper19_set_pins (stepper19_t *ctx, uint8_t set_mask, uint8_t clr_mask)
 Stepper 19 sets the pin states function.
 
err_t stepper19_set_microstep_mode (stepper19_t *ctx, uint8_t ms_mode)
 Stepper 19 sets the microstepping mode function.
 
err_t stepper19_set_decay_mode (stepper19_t *ctx, uint8_t decay_mode)
 Stepper 19 sets the decay mode function.
 
err_t stepper19_set_toff (stepper19_t *ctx, uint8_t toff)
 Stepper 19 set toff function.
 
void stepper19_enable_device (stepper19_t *ctx)
 Stepper 19 enable device function.
 
void stepper19_disable_device (stepper19_t *ctx)
 Stepper 19 disable device function.
 
err_t stepper19_set_direction (stepper19_t *ctx, uint8_t dir)
 Stepper 19 sets the direction function.
 
err_t stepper19_set_step (stepper19_t *ctx, uint8_t step)
 Stepper 19 sets the step function.
 
err_t stepper19_make_one_step (stepper19_t *ctx, uint8_t step_speed)
 Stepper 19 make the one step function.
 
err_t stepper19_rotate_by_angle (stepper19_t *ctx, uint8_t step_speed, float angle, uint16_t res_360)
 Stepper 19 rotates the shaft through a desired angle function.
 
err_t stepper19_rotate_by_step (stepper19_t *ctx, uint8_t step_speed, uint16_t steps)
 Stepper 19 rotates the shaft through a desired step function.
 
uint8_t stepper19_fault_indication (stepper19_t *ctx)
 Stepper 19 fault indication function.
 

Detailed Description

This file contains API for Stepper 19 Click Driver.

Enumeration Type Documentation

◆ stepper19_return_value_t

Stepper 19 Click return value data.

Predefined enum values for driver return values.

Enumerator
STEPPER19_OK 
STEPPER19_ERROR