stepper6 2.1.0.0
stepper6.h File Reference

This file contains API for Stepper 6 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  stepper6_s
 Stepper 6 Click context object. More...
 
struct  stepper6_cfg_t
 Stepper 6 Click configuration object. More...
 

Macros

#define STEPPER6_PCA9538A_REG_INPUT   0x00
 Stepper 6 PCA9538A registers.
 
#define STEPPER6_PCA9538A_REG_OUTPUT   0x01
 
#define STEPPER6_PCA9538A_REG_POLARITY   0x02
 
#define STEPPER6_PCA9538A_REG_CONFIG   0x03
 
#define STEPPER6_PIN_TRQ   0x01
 Stepper 6 PCA9538A pin mask.
 
#define STEPPER6_PIN_M1   0x02
 
#define STEPPER6_PIN_M0   0x04
 
#define STEPPER6_PIN_SLEEP   0x08
 
#define STEPPER6_PIN_FAULT   0x10
 
#define STEPPER6_PCA9538A_DEFAULT_CONFIG   0xF0
 Stepper 6 PCA9538A pin direction config.
 
#define STEPPER6_DIR_CW   0
 Stepper 6 direction setting.
 
#define STEPPER6_DIR_CCW   1
 
#define STEPPER6_PIN_STATE_LOW   0
 Stepper 6 pin logic state setting.
 
#define STEPPER6_PIN_STATE_HIGH   1
 
#define STEPPER6_PIN_STATE_OPEN   2
 
#define STEPPER6_SPEED_VERY_SLOW   0
 Stepper 6 device speed settings.
 
#define STEPPER6_SPEED_SLOW   1
 
#define STEPPER6_SPEED_MEDIUM   2
 
#define STEPPER6_SPEED_FAST   3
 
#define STEPPER6_SPEED_VERY_FAST   4
 
#define STEPPER6_MODE_FULL_STEP   0
 Stepper 6 step resolution setting.
 
#define STEPPER6_MODE_1_OVER_16   1
 
#define STEPPER6_MODE_HALF_STEP   2
 
#define STEPPER6_MODE_QUARTER_STEP   3
 
#define STEPPER6_MODE_1_OVER_8   4
 
#define STEPPER6_MODE_HALF_NON_CIRC_STEP   5
 
#define STEPPER6_DAC_DEFAULT_CONFIG   0x7FFFu
 Stepper 6 DAC default setting.
 
#define STEPPER6_DEVICE_ADDRESS_A1A0_00   0x70
 Stepper 6 device address setting.
 
#define STEPPER6_DEVICE_ADDRESS_A1A0_01   0x71
 
#define STEPPER6_DEVICE_ADDRESS_A1A0_10   0x72
 
#define STEPPER6_DEVICE_ADDRESS_A1A0_11   0x73
 
#define STEPPER6_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define STEPPER6_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define STEPPER6_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Typedefs

typedef struct stepper6_s stepper6_t
 Stepper 6 Click context object.
 

Enumerations

enum  stepper6_return_value_t { STEPPER6_OK = 0 , STEPPER6_ERROR = -1 }
 Stepper 6 Click return value data. More...
 

Functions

void stepper6_cfg_setup (stepper6_cfg_t *cfg)
 Stepper 6 configuration object setup function.
 
err_t stepper6_init (stepper6_t *ctx, stepper6_cfg_t *cfg)
 Stepper 6 initialization function.
 
err_t stepper6_default_cfg (stepper6_t *ctx)
 Stepper 6 default configuration function.
 
err_t stepper6_set_dac (stepper6_t *ctx, uint16_t dac_cmd)
 Stepper 6 set dac function.
 
err_t stepper6_pca_write_reg (stepper6_t *ctx, uint8_t reg, uint8_t data_in)
 Stepper 6 pca write reg function.
 
err_t stepper6_pca_read_reg (stepper6_t *ctx, uint8_t reg, uint8_t *data_out)
 Stepper 6 pca read reg function.
 
err_t stepper6_get_trq_pin (stepper6_t *ctx, uint8_t *state)
 Stepper 6 get trq pin function.
 
err_t stepper6_set_trq_pin (stepper6_t *ctx, uint8_t state)
 Stepper 6 set trq pin function.
 
err_t stepper6_get_m1_pin (stepper6_t *ctx, uint8_t *state)
 Stepper 6 get M1 pin function.
 
err_t stepper6_set_m1_pin (stepper6_t *ctx, uint8_t state)
 Stepper 6 set M1 pin function.
 
err_t stepper6_get_m0_pin (stepper6_t *ctx, uint8_t *state)
 Stepper 6 get M0 pin function.
 
err_t stepper6_set_m0_pin (stepper6_t *ctx, uint8_t state)
 Stepper 6 set M0 pin function.
 
err_t stepper6_get_sleep_pin (stepper6_t *ctx, uint8_t *state)
 Stepper 6 get sleep pin function.
 
err_t stepper6_set_sleep_pin (stepper6_t *ctx, uint8_t state)
 Stepper 6 set sleep pin function.
 
err_t stepper6_get_fault_pin (stepper6_t *ctx, uint8_t *state)
 Stepper 6 get fault pin function.
 
void stepper6_enable_device (stepper6_t *ctx)
 Stepper 6 enable device function.
 
void stepper6_disable_device (stepper6_t *ctx)
 Stepper 6 disable device function.
 
void stepper6_set_direction (stepper6_t *ctx, uint8_t dir)
 Stepper 6 set direction function.
 
void stepper6_switch_direction (stepper6_t *ctx)
 Stepper 6 switch direction function.
 
void stepper6_reset_pca (stepper6_t *ctx)
 Stepper 6 reset device function.
 
void stepper6_set_rst_pin (stepper6_t *ctx, uint8_t state)
 Stepper 6 set rst pin function.
 
void stepper6_set_step_pin (stepper6_t *ctx, uint8_t state)
 Stepper 6 set step pin function.
 
err_t stepper6_get_step_mode (stepper6_t *ctx, uint8_t *mode)
 Stepper 6 get step mode function.
 
err_t stepper6_set_step_mode (stepper6_t *ctx, uint8_t mode)
 Stepper 6 set step mode function.
 
void stepper6_drive_motor (stepper6_t *ctx, uint32_t steps, uint8_t speed)
 Stepper 6 driver motor function.
 

Detailed Description

This file contains API for Stepper 6 Click Driver.

Typedef Documentation

◆ stepper6_t

typedef struct stepper6_s stepper6_t

Stepper 6 Click context object.

Context object definition of Stepper 6 Click driver.

Enumeration Type Documentation

◆ stepper6_return_value_t

Stepper 6 Click return value data.

Predefined enum values for driver return values.

Enumerator
STEPPER6_OK 
STEPPER6_ERROR