multisteppertb62261 2.0.0.0
Multi Stepper TB62261 Click Driver

API for configuring and manipulating Multi Stepper TB62261 Click driver. More...

Topics

 Multi Stepper TB62261 Registers List
 List of registers of Multi Stepper TB62261 Click driver.
 
 Multi Stepper TB62261 Registers Settings
 Settings for registers of Multi Stepper TB62261 Click driver.
 
 Multi Stepper TB62261 MikroBUS Map
 MikroBUS pin mapping of Multi Stepper TB62261 Click driver.
 

Functions

void multisteppertb62261_cfg_setup (multisteppertb62261_cfg_t *cfg)
 Multi Stepper TB62261 configuration object setup function.
 
err_t multisteppertb62261_init (multisteppertb62261_t *ctx, multisteppertb62261_cfg_t *cfg)
 Multi Stepper TB62261 initialization function.
 
err_t multisteppertb62261_default_cfg (multisteppertb62261_t *ctx)
 Multi Stepper TB62261 default configuration function.
 
err_t multisteppertb62261_write_register (multisteppertb62261_t *ctx, uint8_t reg, uint8_t data_in)
 Multi Stepper TB62261 write register function.
 
err_t multisteppertb62261_read_register (multisteppertb62261_t *ctx, uint8_t reg, uint8_t *data_out)
 Multi Stepper TB62261 read register function.
 
err_t multisteppertb62261_drive_motor (multisteppertb62261_t *ctx, uint32_t steps, uint8_t speed)
 Multi Stepper TB62261 driver motor function.
 
void multisteppertb62261_enable_device (multisteppertb62261_t *ctx)
 Multi Stepper TB62261 enable device function.
 
void multisteppertb62261_disable_device (multisteppertb62261_t *ctx)
 Multi Stepper TB62261 disable device function.
 
void multisteppertb62261_set_ina1_pin (multisteppertb62261_t *ctx, uint8_t state)
 Multi Stepper TB62261 set ina1 pin function.
 
void multisteppertb62261_set_ina2_pin (multisteppertb62261_t *ctx, uint8_t state)
 Multi Stepper TB62261 set ina2 pin function.
 
void multisteppertb62261_set_inb1_pin (multisteppertb62261_t *ctx, uint8_t state)
 Multi Stepper TB62261 set inb1 pin function.
 
void multisteppertb62261_set_inb2_pin (multisteppertb62261_t *ctx, uint8_t state)
 Multi Stepper TB62261 set inb2 pin function.
 
void multisteppertb62261_set_step_mode (multisteppertb62261_t *ctx, uint8_t mode)
 Multi Stepper TB62261 set step mode function.
 
void multisteppertb62261_set_direction (multisteppertb62261_t *ctx, uint8_t dir)
 Multi Stepper TB62261 set direction function.
 
void multisteppertb62261_switch_direction (multisteppertb62261_t *ctx)
 Multi Stepper TB62261 switch direction function.
 

Detailed Description

API for configuring and manipulating Multi Stepper TB62261 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

◆ multisteppertb62261_cfg_setup()

void multisteppertb62261_cfg_setup ( multisteppertb62261_cfg_t * cfg)

Multi Stepper TB62261 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ multisteppertb62261_default_cfg()

err_t multisteppertb62261_default_cfg ( multisteppertb62261_t * ctx)

Multi Stepper TB62261 default configuration function.

This function executes a default configuration of Multi Stepper TB62261 click board.

Parameters
[in]ctx: Click context object. See multisteppertb62261_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ multisteppertb62261_disable_device()

void multisteppertb62261_disable_device ( multisteppertb62261_t * ctx)

Multi Stepper TB62261 disable device function.

This function disables the device by setting the STANDBY pin to low logic state.

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

◆ multisteppertb62261_drive_motor()

err_t multisteppertb62261_drive_motor ( multisteppertb62261_t * ctx,
uint32_t steps,
uint8_t speed )

Multi Stepper TB62261 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 multisteppertb62261_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
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ multisteppertb62261_enable_device()

void multisteppertb62261_enable_device ( multisteppertb62261_t * ctx)

Multi Stepper TB62261 enable device function.

This function enables the device by setting the STANDBY pin to high logic state.

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

◆ multisteppertb62261_init()

err_t multisteppertb62261_init ( multisteppertb62261_t * ctx,
multisteppertb62261_cfg_t * cfg )

Multi Stepper TB62261 initialization function.

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

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

◆ multisteppertb62261_read_register()

err_t multisteppertb62261_read_register ( multisteppertb62261_t * ctx,
uint8_t reg,
uint8_t * data_out )

Multi Stepper TB62261 read register function.

This function reads data from the selected PCA9538A register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See multisteppertb62261_t object definition for detailed explanation.
[in]reg: Register address.
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ multisteppertb62261_set_direction()

void multisteppertb62261_set_direction ( multisteppertb62261_t * ctx,
uint8_t dir )

Multi Stepper TB62261 set direction function.

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

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

◆ multisteppertb62261_set_ina1_pin()

void multisteppertb62261_set_ina1_pin ( multisteppertb62261_t * ctx,
uint8_t state )

Multi Stepper TB62261 set ina1 pin function.

This function sets the INA1 pin logic state.

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

◆ multisteppertb62261_set_ina2_pin()

void multisteppertb62261_set_ina2_pin ( multisteppertb62261_t * ctx,
uint8_t state )

Multi Stepper TB62261 set ina2 pin function.

This function sets the INA2 pin logic state.

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

◆ multisteppertb62261_set_inb1_pin()

void multisteppertb62261_set_inb1_pin ( multisteppertb62261_t * ctx,
uint8_t state )

Multi Stepper TB62261 set inb1 pin function.

This function sets the INB1 pin logic state.

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

◆ multisteppertb62261_set_inb2_pin()

void multisteppertb62261_set_inb2_pin ( multisteppertb62261_t * ctx,
uint8_t state )

Multi Stepper TB62261 set inb2 pin function.

This function sets the INB2 pin logic state.

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

◆ multisteppertb62261_set_step_mode()

void multisteppertb62261_set_step_mode ( multisteppertb62261_t * ctx,
uint8_t mode )

Multi Stepper TB62261 set step mode function.

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

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

◆ multisteppertb62261_switch_direction()

void multisteppertb62261_switch_direction ( multisteppertb62261_t * ctx)

Multi Stepper TB62261 switch direction function.

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

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

◆ multisteppertb62261_write_register()

err_t multisteppertb62261_write_register ( multisteppertb62261_t * ctx,
uint8_t reg,
uint8_t data_in )

Multi Stepper TB62261 write register function.

This function writes a desired data byte to the selected PCA9538A register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See multisteppertb62261_t object definition for detailed explanation.
[in]reg: Register address.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.