stepper8 2.1.0.0
stepper8.h File Reference

This file contains API for Stepper 8 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  stepper8_s
 Stepper 8 Click context object. More...
 
struct  stepper8_cfg_t
 Stepper 8 Click configuration object. More...
 

Macros

#define STEPPER8_PCA9538A_REG_INPUT   0x00
 Stepper 8 PCA9538A registers.
 
#define STEPPER8_PCA9538A_REG_OUTPUT   0x01
 
#define STEPPER8_PCA9538A_REG_POLARITY   0x02
 
#define STEPPER8_PCA9538A_REG_CONFIG   0x03
 
#define STEPPER8_PIN_STBY   0x01
 Stepper 8 PCA9538A pin mask.
 
#define STEPPER8_PIN_SELECT   0x02
 
#define STEPPER8_PIN_EN   0x04
 
#define STEPPER8_PCA9538A_DEFAULT_CONFIG   0xF8
 Stepper 8 PCA9538A pin direction config.
 
#define STEPPER8_DIR_CW   0
 Stepper 8 direction setting.
 
#define STEPPER8_DIR_CCW   1
 
#define STEPPER8_PIN_STATE_LOW   0
 Stepper 8 pin logic state setting.
 
#define STEPPER8_PIN_STATE_HIGH   1
 
#define STEPPER8_SPEED_VERY_SLOW   0
 Stepper 8 device speed settings.
 
#define STEPPER8_SPEED_SLOW   1
 
#define STEPPER8_SPEED_MEDIUM   2
 
#define STEPPER8_SPEED_FAST   3
 
#define STEPPER8_SPEED_VERY_FAST   4
 
#define STEPPER8_MODE_FULL_STEP   0
 Stepper 8 step resolution setting.
 
#define STEPPER8_MODE_HALF_STEP   1
 
#define STEPPER8_MODE_QUARTER_STEP   2
 
#define STEPPER8_MODE_1_OVER_8   3
 
#define STEPPER8_MODE_1_OVER_16   4
 
#define STEPPER8_MODE_1_OVER_32   5
 
#define STEPPER8_MODE_1_OVER_64   6
 
#define STEPPER8_MODE_1_OVER_128   7
 
#define STEPPER8_DEVICE_ADDRESS_A1A0_00   0x70
 Stepper 8 device address setting.
 
#define STEPPER8_DEVICE_ADDRESS_A1A0_01   0x71
 
#define STEPPER8_DEVICE_ADDRESS_A1A0_10   0x72
 
#define STEPPER8_DEVICE_ADDRESS_A1A0_11   0x73
 
#define STEPPER8_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define STEPPER8_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define STEPPER8_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Typedefs

typedef struct stepper8_s stepper8_t
 Stepper 8 Click context object.
 

Enumerations

enum  stepper8_return_value_t { STEPPER8_OK = 0 , STEPPER8_ERROR = -1 }
 Stepper 8 Click return value data. More...
 

Functions

void stepper8_cfg_setup (stepper8_cfg_t *cfg)
 Stepper 8 configuration object setup function.
 
err_t stepper8_init (stepper8_t *ctx, stepper8_cfg_t *cfg)
 Stepper 8 initialization function.
 
err_t stepper8_default_cfg (stepper8_t *ctx)
 Stepper 8 default configuration function.
 
err_t stepper8_write_spi (stepper8_t *ctx, uint32_t data_in)
 Stepper 8 write spi function.
 
err_t stepper8_pca_write_reg (stepper8_t *ctx, uint8_t reg, uint8_t data_in)
 Stepper 8 pca write reg function.
 
err_t stepper8_pca_read_reg (stepper8_t *ctx, uint8_t reg, uint8_t *data_out)
 Stepper 8 pca read reg function.
 
err_t stepper8_enable_standby (stepper8_t *ctx)
 Stepper 8 enable standby function.
 
err_t stepper8_disable_standby (stepper8_t *ctx)
 Stepper 8 disable standby function.
 
err_t stepper8_select_gpio (stepper8_t *ctx)
 Stepper 8 select GPIO function.
 
err_t stepper8_select_spi (stepper8_t *ctx)
 Stepper 8 select SPI function.
 
err_t stepper8_disable_device (stepper8_t *ctx)
 Stepper 8 disable device function.
 
err_t stepper8_enable_device (stepper8_t *ctx)
 Stepper 8 enable device function.
 
void stepper8_set_md0_pin (stepper8_t *ctx, uint8_t state)
 Stepper 8 set MD0 pin function.
 
void stepper8_set_md1_pin (stepper8_t *ctx, uint8_t state)
 Stepper 8 set MD1 pin function.
 
void stepper8_set_md2_pin (stepper8_t *ctx, uint8_t state)
 Stepper 8 set MD2 pin function.
 
void stepper8_set_md3_pin (stepper8_t *ctx, uint8_t state)
 Stepper 8 set MD3 pin function.
 
uint8_t stepper8_get_err_pin (stepper8_t *ctx)
 Stepper 8 get ERR pin function.
 
void stepper8_set_direction (stepper8_t *ctx, uint8_t dir)
 Stepper 8 set direction function.
 
void stepper8_set_rst_pin (stepper8_t *ctx, uint8_t state)
 Stepper 8 set rst pin function.
 
void stepper8_set_step_pin (stepper8_t *ctx, uint8_t state)
 Stepper 8 set step pin function.
 
err_t stepper8_set_step_mode (stepper8_t *ctx, uint8_t mode)
 Stepper 8 set step mode function.
 
err_t stepper8_drive_motor (stepper8_t *ctx, uint32_t steps, uint8_t speed)
 Stepper 8 driver motor function.
 

Detailed Description

This file contains API for Stepper 8 Click Driver.

Typedef Documentation

◆ stepper8_t

typedef struct stepper8_s stepper8_t

Stepper 8 Click context object.

Context object definition of Stepper 8 Click driver.

Enumeration Type Documentation

◆ stepper8_return_value_t

Stepper 8 Click return value data.

Predefined enum values for driver return values.

Enumerator
STEPPER8_OK 
STEPPER8_ERROR