stepper13 2.1.0.0
stepper13.h File Reference

This file contains API for Stepper 13 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  stepper13_t
 Stepper 13 Click context object. More...
 
struct  stepper13_cfg_t
 Stepper 13 Click configuration object. More...
 

Macros

#define STEPPER13_PCA9538A_REG_INPUT   0x00
 Stepper 13 PCA9538A registers.
 
#define STEPPER13_PCA9538A_REG_OUTPUT   0x01
 
#define STEPPER13_PCA9538A_REG_POLARITY   0x02
 
#define STEPPER13_PCA9538A_REG_CONFIG   0x03
 
#define STEPPER13_PIN_MS1   0x01
 Stepper 13 PCA9538A pin mask.
 
#define STEPPER13_PIN_MS2   0x02
 
#define STEPPER13_PIN_MS_MASK   0x03
 
#define STEPPER13_PIN_FAULT   0x04
 
#define STEPPER13_PIN_DIR   0x08
 
#define STEPPER13_PIN_SLEEP   0x10
 
#define STEPPER13_PIN_ENABLE   0x20
 
#define STEPPER13_PCA9538A_DEFAULT_CONFIG   0xC4
 Stepper 13 PCA9538A pin direction config.
 
#define STEPPER13_DIR_CW   0
 Stepper 13 direction setting.
 
#define STEPPER13_DIR_CCW   1
 
#define STEPPER13_PIN_STATE_LOW   0
 Stepper 13 pin logic state setting.
 
#define STEPPER13_PIN_STATE_HIGH   1
 
#define STEPPER13_SPEED_VERY_SLOW   0
 Stepper 13 device speed settings.
 
#define STEPPER13_SPEED_SLOW   1
 
#define STEPPER13_SPEED_MEDIUM   2
 
#define STEPPER13_SPEED_FAST   3
 
#define STEPPER13_SPEED_VERY_FAST   4
 
#define STEPPER13_MODE_FULL_STEP   0
 Stepper 13 step resolution setting.
 
#define STEPPER13_MODE_HALF_STEP   1
 
#define STEPPER13_MODE_QUARTER_STEP   2
 
#define STEPPER13_MODE_1_OVER_8   3
 
#define STEPPER13_DEVICE_ADDRESS_A1A0_00   0x70
 Stepper 13 device address setting.
 
#define STEPPER13_DEVICE_ADDRESS_A1A0_01   0x71
 
#define STEPPER13_DEVICE_ADDRESS_A1A0_10   0x72
 
#define STEPPER13_DEVICE_ADDRESS_A1A0_11   0x73
 
#define STEPPER13_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  stepper13_return_value_t { STEPPER13_OK = 0 , STEPPER13_ERROR = -1 }
 Stepper 13 Click return value data. More...
 

Functions

void stepper13_cfg_setup (stepper13_cfg_t *cfg)
 Stepper 13 configuration object setup function.
 
err_t stepper13_init (stepper13_t *ctx, stepper13_cfg_t *cfg)
 Stepper 13 initialization function.
 
err_t stepper13_default_cfg (stepper13_t *ctx)
 Stepper 13 default configuration function.
 
err_t stepper13_pca_write_reg (stepper13_t *ctx, uint8_t reg, uint8_t data_in)
 Stepper 13 pca write reg function.
 
err_t stepper13_pca_read_reg (stepper13_t *ctx, uint8_t reg, uint8_t *data_out)
 Stepper 13 pca read reg function.
 
err_t stepper13_get_fault_pin (stepper13_t *ctx, uint8_t *state)
 Stepper 13 get fault pin function.
 
err_t stepper13_enable_device (stepper13_t *ctx)
 Stepper 13 enable device function.
 
err_t stepper13_disable_device (stepper13_t *ctx)
 Stepper 13 disable device function.
 
err_t stepper13_enable_sleep (stepper13_t *ctx)
 Stepper 13 enable sleep function.
 
err_t stepper13_disable_sleep (stepper13_t *ctx)
 Stepper 13 disable sleep function.
 
err_t stepper13_set_direction (stepper13_t *ctx, uint8_t dir)
 Stepper 13 set direction function.
 
err_t stepper13_switch_direction (stepper13_t *ctx)
 Stepper 13 switch direction function.
 
void stepper13_set_rst_pin (stepper13_t *ctx, uint8_t state)
 Stepper 13 set rst pin function.
 
void stepper13_reset_pca (stepper13_t *ctx)
 Stepper 13 reset device function.
 
uint8_t stepper13_get_int_pin (stepper13_t *ctx)
 Stepper 13 get INT pin function.
 
void stepper13_set_step_pin (stepper13_t *ctx, uint8_t state)
 Stepper 13 set step pin function.
 
err_t stepper13_get_step_mode (stepper13_t *ctx, uint8_t *mode)
 Stepper 13 get step mode function.
 
err_t stepper13_set_step_mode (stepper13_t *ctx, uint8_t mode)
 Stepper 13 set step mode function.
 
err_t stepper13_drive_motor (stepper13_t *ctx, uint32_t steps, uint8_t speed)
 Stepper 13 driver motor function.
 

Detailed Description

This file contains API for Stepper 13 Click Driver.

Enumeration Type Documentation

◆ stepper13_return_value_t

Stepper 13 Click return value data.

Predefined enum values for driver return values.

Enumerator
STEPPER13_OK 
STEPPER13_ERROR