stepper7 2.1.0.0
stepper7.h File Reference

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

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

Go to the source code of this file.

Data Structures

struct  stepper7_t
 Stepper 7 Click context object. More...
 
struct  stepper7_cfg_t
 Stepper 7 Click configuration object. More...
 

Macros

#define STEPPER7_REG_IODIR   0x00
 Stepper 7 register list.
 
#define STEPPER7_REG_IPOL   0x01
 
#define STEPPER7_REG_GPINTEN   0x02
 
#define STEPPER7_REG_DEFVAL   0x03
 
#define STEPPER7_REG_INTCON   0x04
 
#define STEPPER7_REG_IOCON   0x05
 
#define STEPPER7_REG_GPPU   0x06
 
#define STEPPER7_REG_INTF   0x07
 
#define STEPPER7_REG_INTCAP   0x08
 
#define STEPPER7_REG_GPIO   0x09
 
#define STEPPER7_REG_OLAT   0x0A
 
#define STEPPER7_PIN_PHASE2   0x80
 Stepper 7 MCP23S08T pin mask setting.
 
#define STEPPER7_PIN_PHASE1   0x40
 
#define STEPPER7_PIN_I12   0x20
 
#define STEPPER7_PIN_I02   0x10
 
#define STEPPER7_PIN_I11   0x08
 
#define STEPPER7_PIN_I01   0x04
 
#define STEPPER7_IODIR_DEFAULT   0x03
 Stepper 7 MCP23S08T settings.
 
#define STEPPER7_IOCON_DEFAULT   0x38
 
#define STEPPER7_GPIO_CLEAR   0x00
 
#define STEPPER7_DIR_CW   0
 Stepper 7 direction setting.
 
#define STEPPER7_DIR_CCW   1
 
#define STEPPER7_PIN_LOW_LEVEL   0
 Stepper 7 pin logic level setting.
 
#define STEPPER7_PIN_HIGH_LEVEL   1
 
#define STEPPER7_MODE_FULL_STEP   0
 Stepper 7 step resolution setting.
 
#define STEPPER7_MODE_HALF_STEP   1
 
#define STEPPER7_MODE_1_OVER_8_STEP   2
 
#define STEPPER7_SPEED_VERY_SLOW   0
 Stepper 7 device speed settings.
 
#define STEPPER7_SPEED_SLOW   1
 
#define STEPPER7_SPEED_MEDIUM   2
 
#define STEPPER7_SPEED_FAST   3
 
#define STEPPER7_SPEED_VERY_FAST   4
 
#define STEPPER7_SPI_READ_OPCODE   0x41
 Stepper 7 SPI setting.
 
#define STEPPER7_SPI_WRITE_OPCODE   0x40
 
#define STEPPER7_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define STEPPER7_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define STEPPER7_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  stepper7_return_value_t { STEPPER7_OK = 0 , STEPPER7_ERROR = -1 }
 Stepper 7 Click return value data. More...
 

Functions

void stepper7_cfg_setup (stepper7_cfg_t *cfg)
 Stepper 7 configuration object setup function.
 
err_t stepper7_init (stepper7_t *ctx, stepper7_cfg_t *cfg)
 Stepper 7 initialization function.
 
err_t stepper7_default_cfg (stepper7_t *ctx)
 Stepper 7 default configuration function.
 
err_t stepper7_write_reg (stepper7_t *ctx, uint8_t reg, uint8_t data_in)
 Stepper 7 write reg function.
 
err_t stepper7_read_reg (stepper7_t *ctx, uint8_t reg, uint8_t *data_out)
 Stepper 7 read reg function.
 
void stepper7_set_rst_pin (stepper7_t *ctx, uint8_t state)
 Stepper 7 set rst pin function.
 
void stepper7_reset_device (stepper7_t *ctx)
 Stepper 7 reset device function.
 
err_t stepper7_set_phase2_pin (stepper7_t *ctx, uint8_t state)
 Stepper 7 set PHASE2 pin function.
 
err_t stepper7_set_phase1_pin (stepper7_t *ctx, uint8_t state)
 Stepper 7 set PHASE1 pin function.
 
err_t stepper7_set_i12_pin (stepper7_t *ctx, uint8_t state)
 Stepper 7 set I12 pin function.
 
err_t stepper7_set_i02_pin (stepper7_t *ctx, uint8_t state)
 Stepper 7 set I02 pin function.
 
err_t stepper7_set_i11_pin (stepper7_t *ctx, uint8_t state)
 Stepper 7 set I11 pin function.
 
err_t stepper7_set_i01_pin (stepper7_t *ctx, uint8_t state)
 Stepper 7 set I01 pin function.
 
err_t stepper7_enable_device (stepper7_t *ctx)
 Stepper 7 enable device function.
 
err_t stepper7_disable_device (stepper7_t *ctx)
 Stepper 7 disable device function.
 
void stepper7_set_step_mode (stepper7_t *ctx, uint8_t mode)
 Stepper 7 set step mode function.
 
void stepper7_set_direction (stepper7_t *ctx, uint8_t dir)
 Stepper 7 set direction function.
 
void stepper7_switch_direction (stepper7_t *ctx)
 Stepper 7 switch direction function.
 
err_t stepper7_drive_motor (stepper7_t *ctx, uint32_t steps, uint8_t speed)
 Stepper 7 driver motor function.
 

Detailed Description

This file contains API for Stepper 7 Click Driver.

Enumeration Type Documentation

◆ stepper7_return_value_t

Stepper 7 Click return value data.

Predefined enum values for driver return values.

Enumerator
STEPPER7_OK 
STEPPER7_ERROR