stepper10 2.1.0.0
stepper10.h File Reference

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

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

Go to the source code of this file.

Data Structures

struct  stepper10_s
 Stepper 10 Click context object. More...
 
struct  stepper10_cfg_t
 Stepper 10 Click configuration object. More...
 

Macros

#define STEPPER10_TCA9534A_REG_INPUT   0x00
 Stepper 10 TCA9534A registers.
 
#define STEPPER10_TCA9534A_REG_OUTPUT   0x01
 
#define STEPPER10_TCA9534A_REG_POLARITY   0x02
 
#define STEPPER10_TCA9534A_REG_CONFIG   0x03
 
#define STEPPER10_PIN0_MS0   0x01
 Stepper 10 TCA9534A pin mask.
 
#define STEPPER10_PIN0_MS1   0x02
 
#define STEPPER10_PIN0_MS2   0x04
 
#define STEPPER10_PIN0_MS_MASK   0x07
 
#define STEPPER10_PIN0_SLEEP   0x08
 
#define STEPPER10_PIN0_MDT0   0x10
 
#define STEPPER10_PIN0_MDT1   0x20
 
#define STEPPER10_PIN0_MDT_MASK   0x30
 
#define STEPPER10_PIN0_AGC   0x40
 
#define STEPPER10_PIN0_IF_SEL   0x80
 
#define STEPPER10_PIN1_TORQUE0   0x01
 
#define STEPPER10_PIN1_TORQUE1   0x02
 
#define STEPPER10_PIN1_TORQUE2   0x04
 
#define STEPPER10_PIN1_TORQUE_MASK   0x07
 
#define STEPPER10_PIN1_CLIM0   0x08
 
#define STEPPER10_PIN1_EDG_SEL   0x10
 
#define STEPPER10_PIN1_MO   0x20
 
#define STEPPER10_PIN1_LO0   0x40
 
#define STEPPER10_PIN1_LO1   0x80
 
#define STEPPER10_PIN1_LO_MASK   0xC0
 
#define STEPPER10_TCA9534A_0_DEFAULT_CONFIG   0x00
 Stepper 10 TCA9534A pin direction config.
 
#define STEPPER10_TCA9534A_1_DEFAULT_CONFIG   0xE0
 
#define STEPPER10_DIR_CW   0
 Stepper 10 direction setting.
 
#define STEPPER10_DIR_CCW   1
 
#define STEPPER10_PIN_STATE_LOW   0
 Stepper 10 pin logic state setting.
 
#define STEPPER10_PIN_STATE_HIGH   1
 
#define STEPPER10_SPEED_VERY_SLOW   0
 Stepper 10 device speed settings.
 
#define STEPPER10_SPEED_SLOW   1
 
#define STEPPER10_SPEED_MEDIUM   2
 
#define STEPPER10_SPEED_FAST   3
 
#define STEPPER10_SPEED_VERY_FAST   4
 
#define STEPPER10_MODE_FULL_STEP   0
 Stepper 10 step resolution setting.
 
#define STEPPER10_MODE_HALF_STEP   1
 
#define STEPPER10_MODE_QUARTER_STEP   2
 
#define STEPPER10_MODE_1_OVER_8   3
 
#define STEPPER10_MODE_1_OVER_16   4
 
#define STEPPER10_MODE_1_OVER_32   5
 
#define STEPPER10_MODE_1_OVER_64   6
 
#define STEPPER10_MODE_1_OVER_128   7
 
#define STEPPER10_MIXED_DECAY_FAST_37_5   0
 Stepper 10 mixed decay setting.
 
#define STEPPER10_MIXED_DECAY_FAST_50   1
 
#define STEPPER10_MIXED_DECAY_FAST_ONLY   2
 
#define STEPPER10_MIXED_DECAY_ADMD   3
 
#define STEPPER10_TORQUE_100   0
 Stepper 10 torque setting.
 
#define STEPPER10_TORQUE_85   1
 
#define STEPPER10_TORQUE_70   2
 
#define STEPPER10_TORQUE_60   3
 
#define STEPPER10_TORQUE_50   4
 
#define STEPPER10_TORQUE_40   5
 
#define STEPPER10_TORQUE_25   6
 
#define STEPPER10_TORQUE_10   7
 
#define STEPPER10_LO_THERMAL_SHUTDOWN   0
 Stepper 10 LO error detect flag setting.
 
#define STEPPER10_LO_MOTOR_LOAD_OPEN   1
 
#define STEPPER10_LO_OVER_CURRENT   2
 
#define STEPPER10_LO_NORMAL   3
 
#define STEPPER10_DEVICE0_ADDRESS_A2A1_00   0x38
 Stepper 10 device address setting.
 
#define STEPPER10_DEVICE0_ADDRESS_A2A1_01   0x3A
 
#define STEPPER10_DEVICE0_ADDRESS_A2A1_10   0x3C
 
#define STEPPER10_DEVICE0_ADDRESS_A2A1_11   0x3E
 
#define STEPPER10_DEVICE1_ADDRESS_A2A1_00   0x39
 
#define STEPPER10_DEVICE1_ADDRESS_A2A1_01   0x3B
 
#define STEPPER10_DEVICE1_ADDRESS_A2A1_10   0x3D
 
#define STEPPER10_DEVICE1_ADDRESS_A2A1_11   0x3F
 
#define STEPPER10_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define STEPPER10_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define STEPPER10_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Typedefs

typedef struct stepper10_s stepper10_t
 Stepper 10 Click context object.
 

Enumerations

enum  stepper10_return_value_t { STEPPER10_OK = 0 , STEPPER10_ERROR = -1 }
 Stepper 10 Click return value data. More...
 

Functions

void stepper10_cfg_setup (stepper10_cfg_t *cfg)
 Stepper 10 configuration object setup function.
 
err_t stepper10_init (stepper10_t *ctx, stepper10_cfg_t *cfg)
 Stepper 10 initialization function.
 
err_t stepper10_default_cfg (stepper10_t *ctx)
 Stepper 10 default configuration function.
 
err_t stepper10_write_spi_bank0 (stepper10_t *ctx, uint32_t data_in)
 Stepper 10 write spi bank0 function.
 
err_t stepper10_write_spi_bank1 (stepper10_t *ctx, uint32_t data_in)
 Stepper 10 write spi bank1 function.
 
err_t stepper10_tca_write_reg (stepper10_t *ctx, uint8_t reg, uint8_t data_in)
 Stepper 10 tca write reg function.
 
err_t stepper10_tca_read_reg (stepper10_t *ctx, uint8_t reg, uint8_t *data_out)
 Stepper 10 tca read reg function.
 
err_t stepper10_get_step_mode (stepper10_t *ctx, uint8_t *mode)
 Stepper 10 get step mode function.
 
err_t stepper10_set_step_mode (stepper10_t *ctx, uint8_t mode)
 Stepper 10 set step mode function.
 
err_t stepper10_get_sleep_pin (stepper10_t *ctx, uint8_t *state)
 Stepper 10 get sleep pin function.
 
err_t stepper10_set_sleep_pin (stepper10_t *ctx, uint8_t state)
 Stepper 10 set sleep pin function.
 
err_t stepper10_get_mixed_decay (stepper10_t *ctx, uint8_t *mode)
 Stepper 10 get mixed decay function.
 
err_t stepper10_set_mixed_decay (stepper10_t *ctx, uint8_t mode)
 Stepper 10 set mixed decay function.
 
err_t stepper10_get_agc_pin (stepper10_t *ctx, uint8_t *state)
 Stepper 10 get agc pin function.
 
err_t stepper10_set_agc_pin (stepper10_t *ctx, uint8_t state)
 Stepper 10 set agc pin function.
 
err_t stepper10_select_gpio (stepper10_t *ctx)
 Stepper 10 select GPIO function.
 
err_t stepper10_select_spi (stepper10_t *ctx)
 Stepper 10 select SPI function.
 
err_t stepper10_get_torque (stepper10_t *ctx, uint8_t *mode)
 Stepper 10 get torque function.
 
err_t stepper10_set_torque (stepper10_t *ctx, uint8_t mode)
 Stepper 10 set torque function.
 
err_t stepper10_get_clim0_pin (stepper10_t *ctx, uint8_t *state)
 Stepper 10 get clim0 pin function.
 
err_t stepper10_set_clim0_pin (stepper10_t *ctx, uint8_t state)
 Stepper 10 set clim0 pin function.
 
err_t stepper10_get_edg_sel_pin (stepper10_t *ctx, uint8_t *state)
 Stepper 10 get edg_sel pin function.
 
err_t stepper10_set_edg_sel_pin (stepper10_t *ctx, uint8_t state)
 Stepper 10 set edg_sel pin function.
 
err_t stepper10_get_mo_pin (stepper10_t *ctx, uint8_t *state)
 Stepper 10 get mo pin function.
 
err_t stepper10_get_lo_state (stepper10_t *ctx, uint8_t *state)
 Stepper 10 get LO function.
 
void stepper10_enable_device (stepper10_t *ctx)
 Stepper 10 enable device function.
 
void stepper10_disable_device (stepper10_t *ctx)
 Stepper 10 disable device function.
 
uint8_t stepper10_get_int_pin (stepper10_t *ctx)
 Stepper 10 get INT pin function.
 
void stepper10_set_direction (stepper10_t *ctx, uint8_t dir)
 Stepper 10 set direction function.
 
void stepper10_set_rst_pin (stepper10_t *ctx, uint8_t state)
 Stepper 10 set rst pin function.
 
void stepper10_reset_device (stepper10_t *ctx)
 Stepper 10 reset device function.
 
void stepper10_set_step_pin (stepper10_t *ctx, uint8_t state)
 Stepper 10 set step pin function.
 
err_t stepper10_drive_motor (stepper10_t *ctx, uint32_t steps, uint8_t speed)
 Stepper 10 driver motor function.
 

Detailed Description

This file contains API for Stepper 10 Click Driver.

Typedef Documentation

◆ stepper10_t

typedef struct stepper10_s stepper10_t

Stepper 10 Click context object.

Context object definition of Stepper 10 Click driver.

Enumeration Type Documentation

◆ stepper10_return_value_t

Stepper 10 Click return value data.

Predefined enum values for driver return values.

Enumerator
STEPPER10_OK 
STEPPER10_ERROR