stepper12 2.1.0.0
stepper12.h File Reference

This file contains API for Stepper 12 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  stepper12_t
 Stepper 12 Click context object. More...
 
struct  stepper12_cfg_t
 Stepper 12 Click configuration object. More...
 

Macros

#define STEPPER12_REG_INPUT_0   0x00
 Stepper 12 PCA9555A registers.
 
#define STEPPER12_REG_INPUT_1   0x01
 
#define STEPPER12_REG_OUTPUT_0   0x02
 
#define STEPPER12_REG_OUTPUT_1   0x03
 
#define STEPPER12_REG_POLARITY_0   0x04
 
#define STEPPER12_REG_POLARITY_1   0x05
 
#define STEPPER12_REG_CONFIG_0   0x06
 
#define STEPPER12_REG_CONFIG_1   0x07
 
#define STEPPER12_P0_DMODE0_PIN   0x01
 Stepper 12 PCA9555A pin mask.
 
#define STEPPER12_P0_DMODE1_PIN   0x02
 
#define STEPPER12_P0_DMODE2_PIN   0x04
 
#define STEPPER12_P0_DECAY_PIN   0x08
 
#define STEPPER12_P0_TRQ0_PIN   0x20
 
#define STEPPER12_P0_TRQ1_PIN   0x40
 
#define STEPPER12_P0_SLEEP_X_PIN   0x80
 
#define STEPPER12_P1_LO_PIN   0x01
 
#define STEPPER12_P1_MO_PIN   0x04
 
#define STEPPER12_P0_DEFAULT_CONFIG   0x10
 Stepper 12 PCA9555A pin direction config.
 
#define STEPPER12_P1_DEFAULT_CONFIG   0xFF
 
#define STEPPER12_DIR_CW   1
 Stepper 12 direction setting.
 
#define STEPPER12_DIR_CCW   0
 
#define STEPPER12_PIN_LOW_LEVEL   0
 Stepper 12 pin logic level setting.
 
#define STEPPER12_PIN_HIGH_LEVEL   1
 
#define STEPPER12_MODE_FULL_STEP   0x00
 Stepper 12 step resolution setting.
 
#define STEPPER12_MODE_1_OVER_8   0x01
 
#define STEPPER12_MODE_HALF_STEP_TYPE_B   0x02
 
#define STEPPER12_MODE_1_OVER_32   0x03
 
#define STEPPER12_MODE_HALF_STEP_TYPE_A   0x04
 
#define STEPPER12_MODE_1_OVER_16   0x05
 
#define STEPPER12_MODE_QUARTER_STEP   0x06
 
#define STEPPER12_MODE_MASK   0x07
 
#define STEPPER12_TORQUE_100_PCT   0x00
 Stepper 12 torque setting.
 
#define STEPPER12_TORQUE_75_PCT   0x01
 
#define STEPPER12_TORQUE_50_PCT   0x02
 
#define STEPPER12_TORQUE_25_PCT   0x03
 
#define STEPPER12_TORQUE_MASK   0x03
 
#define STEPPER12_SPEED_VERY_SLOW   0
 Stepper 12 device speed settings.
 
#define STEPPER12_SPEED_SLOW   1
 
#define STEPPER12_SPEED_MEDIUM   2
 
#define STEPPER12_SPEED_FAST   3
 
#define STEPPER12_SPEED_VERY_FAST   4
 
#define STEPPER12_DEVICE_ADDRESS_A2A1A0_000   0x20
 Stepper 12 device address setting.
 
#define STEPPER12_DEVICE_ADDRESS_A2A1A0_001   0x21
 
#define STEPPER12_DEVICE_ADDRESS_A2A1A0_010   0x22
 
#define STEPPER12_DEVICE_ADDRESS_A2A1A0_011   0x23
 
#define STEPPER12_DEVICE_ADDRESS_A2A1A0_100   0x24
 
#define STEPPER12_DEVICE_ADDRESS_A2A1A0_101   0x25
 
#define STEPPER12_DEVICE_ADDRESS_A2A1A0_110   0x26
 
#define STEPPER12_DEVICE_ADDRESS_A2A1A0_111   0x27
 
#define STEPPER12_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  stepper12_return_value_t { STEPPER12_OK = 0 , STEPPER12_ERROR = -1 }
 Stepper 12 Click return value data. More...
 

Functions

void stepper12_cfg_setup (stepper12_cfg_t *cfg)
 Stepper 12 configuration object setup function.
 
err_t stepper12_init (stepper12_t *ctx, stepper12_cfg_t *cfg)
 Stepper 12 initialization function.
 
err_t stepper12_default_cfg (stepper12_t *ctx)
 Stepper 12 default configuration function.
 
err_t stepper12_write_register (stepper12_t *ctx, uint8_t reg, uint8_t data_in)
 Stepper 12 write register function.
 
err_t stepper12_read_register (stepper12_t *ctx, uint8_t reg, uint8_t *data_out)
 Stepper 12 read register function.
 
err_t stepper12_get_step_mode (stepper12_t *ctx, uint8_t *mode)
 Stepper 12 get step mode function.
 
err_t stepper12_set_step_mode (stepper12_t *ctx, uint8_t mode)
 Stepper 12 set step mode function.
 
err_t stepper12_get_torque (stepper12_t *ctx, uint8_t *torque)
 Stepper 12 get torque function.
 
err_t stepper12_set_torque (stepper12_t *ctx, uint8_t torque)
 Stepper 12 set torque function.
 
err_t stepper12_get_decay_pin (stepper12_t *ctx, uint8_t *state)
 Stepper 12 get decay pin function.
 
err_t stepper12_set_decay_pin (stepper12_t *ctx, uint8_t state)
 Stepper 12 set decay pin function.
 
err_t stepper12_get_sleep_x_pin (stepper12_t *ctx, uint8_t *state)
 Stepper 12 get sleep x pin function.
 
err_t stepper12_set_sleep_x_pin (stepper12_t *ctx, uint8_t state)
 Stepper 12 set sleep x pin function.
 
err_t stepper12_get_lo_pin (stepper12_t *ctx, uint8_t *state)
 Stepper 12 get lo pin function.
 
err_t stepper12_get_mo_pin (stepper12_t *ctx, uint8_t *state)
 Stepper 12 get mo pin function.
 
void stepper12_drive_motor (stepper12_t *ctx, uint32_t steps, uint8_t speed)
 Stepper 12 driver motor function.
 
void stepper12_enable_device (stepper12_t *ctx)
 Stepper 12 enable device function.
 
void stepper12_disable_device (stepper12_t *ctx)
 Stepper 12 disable device function.
 
void stepper12_set_direction (stepper12_t *ctx, uint8_t dir)
 Stepper 12 set direction function.
 
void stepper12_switch_direction (stepper12_t *ctx)
 Stepper 12 switch direction function.
 
void stepper12_reset_device (stepper12_t *ctx)
 Stepper 12 reset device function.
 
uint8_t stepper12_get_int_pin (stepper12_t *ctx)
 Stepper 12 get int pin function.
 
void stepper12_set_clk_pin (stepper12_t *ctx, uint8_t state)
 Stepper 12 set clk pin function.
 

Detailed Description

This file contains API for Stepper 12 Click Driver.

Enumeration Type Documentation

◆ stepper12_return_value_t

Stepper 12 Click return value data.

Predefined enum values for driver return values.

Enumerator
STEPPER12_OK 
STEPPER12_ERROR