stepper3 2.1.0.0
Stepper 3 Click Driver

API for configuring and manipulating Stepper 3 Click driver. More...

Topics

 Stepper 3 Registers Settings
 Settings for registers of Stepper 3 Click driver.
 
 Stepper 3 MikroBUS Map
 MikroBUS pin mapping of Stepper 3 Click driver.
 

Functions

void stepper3_cfg_setup (stepper3_cfg_t *cfg)
 Stepper 3 configuration object setup function.
 
err_t stepper3_init (stepper3_t *ctx, stepper3_cfg_t *cfg)
 Stepper 3 initialization function.
 
void stepper3_set_ina_pin (stepper3_t *ctx, uint8_t state)
 Stepper 3 set ina pin function.
 
void stepper3_set_inb_pin (stepper3_t *ctx, uint8_t state)
 Stepper 3 set inb pin function.
 
void stepper3_set_inc_pin (stepper3_t *ctx, uint8_t state)
 Stepper 3 set inc pin function.
 
void stepper3_set_ind_pin (stepper3_t *ctx, uint8_t state)
 Stepper 3 set ind pin function.
 
void stepper3_set_step_mode (stepper3_t *ctx, uint8_t mode)
 Stepper 3 set step mode function.
 
void stepper3_set_direction (stepper3_t *ctx, uint8_t dir)
 Stepper 3 set direction function.
 
void stepper3_switch_direction (stepper3_t *ctx)
 Stepper 3 switch direction function.
 
void stepper3_enable_device (stepper3_t *ctx)
 Stepper 3 enable device function.
 
void stepper3_disable_device (stepper3_t *ctx)
 Stepper 3 disable device function.
 
void stepper3_drive_motor (stepper3_t *ctx, uint32_t steps, uint8_t speed)
 Stepper 3 driver motor function.
 

Detailed Description

API for configuring and manipulating Stepper 3 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ stepper3_cfg_setup()

void stepper3_cfg_setup ( stepper3_cfg_t * cfg)

Stepper 3 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See stepper3_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ stepper3_disable_device()

void stepper3_disable_device ( stepper3_t * ctx)

Stepper 3 disable device function.

This function disables the device by setting all pins to high logic state.

Parameters
[in]ctx: Click context object. See stepper3_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ stepper3_drive_motor()

void stepper3_drive_motor ( stepper3_t * ctx,
uint32_t steps,
uint8_t speed )

Stepper 3 driver motor function.

This function drives the motor for the specific number of steps at the selected speed.

Parameters
[in]ctx: Click context object. See stepper3_t object definition for detailed explanation.
[in]steps: Number of steps to rotate motor.
[in]speed: Motor rotation speed:
  • 0 - Very slow,
  • 1 - Slow,
  • 2 - Medium,
  • 3 - Fast,
  • 4 - Very fast,
Returns
None.
Note
None.

◆ stepper3_enable_device()

void stepper3_enable_device ( stepper3_t * ctx)

Stepper 3 enable device function.

This function enables the device by setting all pins to low logic state.

Parameters
[in]ctx: Click context object. See stepper3_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ stepper3_init()

err_t stepper3_init ( stepper3_t * ctx,
stepper3_cfg_t * cfg )

Stepper 3 initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See stepper3_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See stepper3_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ stepper3_set_direction()

void stepper3_set_direction ( stepper3_t * ctx,
uint8_t dir )

Stepper 3 set direction function.

This function sets the motor direction to clockwise or counter-clockwise in ctx->direction.

Parameters
[in]ctx: Click context object. See stepper3_t object definition for detailed explanation.
[in]dir:
  • 0 - Clockwise,
  • 1 - Counter-Clockwise.
Returns
None.
Note
None.

◆ stepper3_set_ina_pin()

void stepper3_set_ina_pin ( stepper3_t * ctx,
uint8_t state )

Stepper 3 set ina pin function.

This function sets the INA pin logic state.

Parameters
[in]ctx: Click context object. See stepper3_t object definition for detailed explanation.
[in]state:
  • 0 - Low logic state,
  • 1 - High logic state.
Returns
None.
Note
None.

◆ stepper3_set_inb_pin()

void stepper3_set_inb_pin ( stepper3_t * ctx,
uint8_t state )

Stepper 3 set inb pin function.

This function sets the INB pin logic state.

Parameters
[in]ctx: Click context object. See stepper3_t object definition for detailed explanation.
[in]state:
  • 0 - Low logic state,
  • 1 - High logic state.
Returns
None.
Note
None.

◆ stepper3_set_inc_pin()

void stepper3_set_inc_pin ( stepper3_t * ctx,
uint8_t state )

Stepper 3 set inc pin function.

This function sets the INC pin logic state.

Parameters
[in]ctx: Click context object. See stepper3_t object definition for detailed explanation.
[in]state:
  • 0 - Low logic state,
  • 1 - High logic state.
Returns
None.
Note
None.

◆ stepper3_set_ind_pin()

void stepper3_set_ind_pin ( stepper3_t * ctx,
uint8_t state )

Stepper 3 set ind pin function.

This function sets the IND pin logic state.

Parameters
[in]ctx: Click context object. See stepper3_t object definition for detailed explanation.
[in]state:
  • 0 - Low logic state,
  • 1 - High logic state.
Returns
None.
Note
None.

◆ stepper3_set_step_mode()

void stepper3_set_step_mode ( stepper3_t * ctx,
uint8_t mode )

Stepper 3 set step mode function.

This function sets the step mode resolution settings in ctx->step_mode.

Parameters
[in]ctx: Click context object. See stepper3_t object definition for detailed explanation.
[in]mode: Step mode resolution.
  • 0 - Full step,
  • 1 - Half step.
Returns
None.
Note
None.

◆ stepper3_switch_direction()

void stepper3_switch_direction ( stepper3_t * ctx)

Stepper 3 switch direction function.

This function switches the motor direction in ctx->direction.

Parameters
[in]ctx: Click context object. See stepper3_t object definition for detailed explanation.
Returns
None.
Note
None.