stepper14 2.1.0.0
stepper14.h File Reference

This file contains API for Stepper 14 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  stepper14_t
 Stepper 14 Click context object. More...
 
struct  stepper14_cfg_t
 Stepper 14 Click configuration object. More...
 

Macros

#define STEPPER14_PCA9538A_REG_INPUT   0x00
 Stepper 14 PCA9538A registers.
 
#define STEPPER14_PCA9538A_REG_OUTPUT   0x01
 
#define STEPPER14_PCA9538A_REG_POLARITY   0x02
 
#define STEPPER14_PCA9538A_REG_CONFIG   0x03
 
#define STEPPER14_PIN_IN1   0x01
 Stepper 14 PCA9538A pin mask.
 
#define STEPPER14_PIN_IN2   0x02
 
#define STEPPER14_PIN_MODE   0x04
 
#define STEPPER14_PIN_IN3   0x08
 
#define STEPPER14_PIN_IN4   0x10
 
#define STEPPER14_PIN_TRQ   0x20
 
#define STEPPER14_PCA9538A_DEFAULT_CONFIG   0xC0
 Stepper 14 PCA9538A pin direction config.
 
#define STEPPER14_DIR_CW   0
 Stepper 14 direction setting.
 
#define STEPPER14_DIR_CCW   1
 
#define STEPPER14_PIN_STATE_LOW   0
 Stepper 14 pin logic state setting.
 
#define STEPPER14_PIN_STATE_HIGH   1
 
#define STEPPER14_INTERFACE_4_PIN   0
 Stepper 14 pin interface setting.
 
#define STEPPER14_INTERFACE_2_PIN   1
 
#define STEPPER14_SPEED_VERY_SLOW   0
 Stepper 14 device speed settings.
 
#define STEPPER14_SPEED_SLOW   1
 
#define STEPPER14_SPEED_MEDIUM   2
 
#define STEPPER14_SPEED_FAST   3
 
#define STEPPER14_SPEED_VERY_FAST   4
 
#define STEPPER14_MODE_FULL_STEP   0
 Stepper 14 step resolution setting.
 
#define STEPPER14_MODE_HALF_STEP   1
 
#define STEPPER14_DEVICE_ADDRESS_A1A0_00   0x70
 Stepper 14 device address setting.
 
#define STEPPER14_DEVICE_ADDRESS_A1A0_01   0x71
 
#define STEPPER14_DEVICE_ADDRESS_A1A0_10   0x72
 
#define STEPPER14_DEVICE_ADDRESS_A1A0_11   0x73
 
#define STEPPER14_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  stepper14_return_value_t { STEPPER14_OK = 0 , STEPPER14_ERROR = -1 }
 Stepper 14 Click return value data. More...
 

Functions

void stepper14_cfg_setup (stepper14_cfg_t *cfg)
 Stepper 14 configuration object setup function.
 
err_t stepper14_init (stepper14_t *ctx, stepper14_cfg_t *cfg)
 Stepper 14 initialization function.
 
err_t stepper14_default_cfg (stepper14_t *ctx)
 Stepper 14 default configuration function.
 
err_t stepper14_pca_write_reg (stepper14_t *ctx, uint8_t reg, uint8_t data_in)
 Stepper 14 pca write reg function.
 
err_t stepper14_pca_read_reg (stepper14_t *ctx, uint8_t reg, uint8_t *data_out)
 Stepper 14 pca read reg function.
 
void stepper14_set_rst_pin (stepper14_t *ctx, uint8_t state)
 Stepper 14 set rst pin function.
 
void stepper14_reset_pca (stepper14_t *ctx)
 Stepper 14 reset device function.
 
uint8_t stepper14_get_fault_pin (stepper14_t *ctx)
 Stepper 14 get FAULT pin function.
 
void stepper14_enable_device (stepper14_t *ctx)
 Stepper 14 enable device function.
 
void stepper14_disable_device (stepper14_t *ctx)
 Stepper 14 disable device function.
 
err_t stepper14_set_in1_pin (stepper14_t *ctx, uint8_t state)
 Stepper 14 set IN1 pin function.
 
err_t stepper14_set_in2_pin (stepper14_t *ctx, uint8_t state)
 Stepper 14 set IN2 pin function.
 
err_t stepper14_set_in3_pin (stepper14_t *ctx, uint8_t state)
 Stepper 14 set IN3 pin function.
 
err_t stepper14_set_in4_pin (stepper14_t *ctx, uint8_t state)
 Stepper 14 set IN4 pin function.
 
err_t stepper14_set_mode_pin (stepper14_t *ctx, uint8_t state)
 Stepper 14 set MODE pin function.
 
err_t stepper14_set_trq_pin (stepper14_t *ctx, uint8_t state)
 Stepper 14 set TRQ pin function.
 
err_t stepper14_set_interface_mode (stepper14_t *ctx, uint8_t mode)
 Stepper 14 set interface mode function.
 
void stepper14_set_step_mode (stepper14_t *ctx, uint8_t mode)
 Stepper 14 set step mode function.
 
void stepper14_set_direction (stepper14_t *ctx, uint8_t dir)
 Stepper 14 set direction function.
 
void stepper14_switch_direction (stepper14_t *ctx)
 Stepper 14 switch direction function.
 
err_t stepper14_drive_motor (stepper14_t *ctx, uint32_t steps, uint8_t speed)
 Stepper 14 driver motor function.
 

Detailed Description

This file contains API for Stepper 14 Click Driver.

Enumeration Type Documentation

◆ stepper14_return_value_t

Stepper 14 Click return value data.

Predefined enum values for driver return values.

Enumerator
STEPPER14_OK 
STEPPER14_ERROR