stepper 2.1.0.0
stepper.h File Reference

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

#include "drv_digital_out.h"
#include "drv_digital_in.h"

Go to the source code of this file.

Data Structures

struct  stepper_t
 Stepper Click context object. More...
 
struct  stepper_cfg_t
 Stepper Click configuration object. More...
 

Macros

#define STEPPER_PIN_STATE_LOW   0
 Stepper pin logic state setting.
 
#define STEPPER_PIN_STATE_HIGH   1
 
#define STEPPER_DIR_CW   0
 Stepper direction setting.
 
#define STEPPER_DIR_CCW   1
 
#define STEPPER_MODE_FULL_STEP   0
 Stepper step resolution setting.
 
#define STEPPER_MODE_HALF_STEP   1
 
#define STEPPER_MODE_QUARTER_STEP   2
 
#define STEPPER_MODE_1_OVER_8_STEP   3
 
#define STEPPER_MICROSTEP_NUM_PER_STEP   32
 Stepper microstep setting.
 
#define STEPPER_SPEED_VERY_SLOW   0
 Stepper device speed settings.
 
#define STEPPER_SPEED_SLOW   1
 
#define STEPPER_SPEED_MEDIUM   2
 
#define STEPPER_SPEED_FAST   3
 
#define STEPPER_SPEED_VERY_FAST   4
 
#define STEPPER_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  stepper_return_value_t { STEPPER_OK = 0 , STEPPER_ERROR = -1 }
 Stepper Click return value data. More...
 

Functions

void stepper_cfg_setup (stepper_cfg_t *cfg)
 Stepper configuration object setup function.
 
err_t stepper_init (stepper_t *ctx, stepper_cfg_t *cfg)
 Stepper initialization function.
 
void stepper_default_cfg (stepper_t *ctx)
 Stepper default configuration function.
 
void stepper_set_step_mode (stepper_t *ctx, uint8_t mode)
 Stepper set step mode function.
 
void stepper_drive_motor (stepper_t *ctx, uint32_t steps, uint8_t speed)
 Stepper driver motor function.
 
void stepper_enable_device (stepper_t *ctx)
 Stepper enable device function.
 
void stepper_disable_device (stepper_t *ctx)
 Stepper disable device function.
 
void stepper_set_direction (stepper_t *ctx, uint8_t dir)
 Stepper set direction function.
 
void stepper_switch_direction (stepper_t *ctx)
 Stepper switch direction function.
 
void stepper_set_step_pin (stepper_t *ctx, uint8_t state)
 Stepper set step pin function.
 

Detailed Description

This file contains API for Stepper Click Driver.

Enumeration Type Documentation

◆ stepper_return_value_t

Stepper Click return value data.

Predefined enum values for driver return values.

Enumerator
STEPPER_OK 
STEPPER_ERROR