stepper11 2.0.0.0
Stepper 11 Click Driver

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

Topics

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

Functions

void stepper11_cfg_setup (stepper11_cfg_t *cfg)
 Stepper 11 configuration object setup function.
 
err_t stepper11_init (stepper11_t *ctx, stepper11_cfg_t *cfg)
 Stepper 11 initialization function.
 
err_t stepper11_default_cfg (stepper11_t *ctx)
 Stepper 11 default configuration function.
 
err_t stepper11_generic_write (stepper11_t *ctx, uint8_t reg, uint8_t tx_data)
 Stepper 11 I2C writing function.
 
err_t stepper11_generic_read (stepper11_t *ctx, uint8_t reg, uint8_t *rx_data)
 Stepper 11 I2C reading function.
 
void stepper11_set_direction (stepper11_t *ctx, uint8_t state)
 Set direction.
 
void stepper11_set_enable (stepper11_t *ctx, uint8_t state)
 Set enable.
 
void stepper11_set_reset (stepper11_t *ctx, uint8_t state)
 Set restart.
 
void stepper11_set_clock (stepper11_t *ctx, uint8_t state)
 Set clock state.
 
uint8_t stepper11_get_interrupt (stepper11_t *ctx)
 Get interrupt.
 
uint8_t stepper11_get_diag (stepper11_t *ctx)
 Get anomaly detection flag.
 
uint8_t stepper11_get_mo (stepper11_t *ctx)
 Get electrical angle monitoring signal.
 
uint8_t stepper11_get_sd (stepper11_t *ctx)
 Get stall detection flag.
 
err_t stepper11_set_step_resolution (stepper11_t *ctx, uint8_t step_res)
 Set step resolution.
 
err_t stepper11_set_torque (stepper11_t *ctx, uint8_t torque)
 Set torque.
 
void stepper11_move_motor_angle (stepper11_t *ctx, float degree, uint8_t speed)
 Move motor in angle value.
 
void stepper11_move_motor_step (stepper11_t *ctx, uint16_t steps, uint8_t speed)
 Move motor in step value.
 

Detailed Description

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

◆ stepper11_cfg_setup()

void stepper11_cfg_setup ( stepper11_cfg_t * cfg)

Stepper 11 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ stepper11_default_cfg()

err_t stepper11_default_cfg ( stepper11_t * ctx)

Stepper 11 default configuration function.

This function executes a default configuration of Stepper 11 click board.

Parameters
[in]ctx: Click context object. See stepper11_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.

◆ stepper11_generic_read()

err_t stepper11_generic_read ( stepper11_t * ctx,
uint8_t reg,
uint8_t * rx_data )

Stepper 11 I2C reading function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.

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

◆ stepper11_generic_write()

err_t stepper11_generic_write ( stepper11_t * ctx,
uint8_t reg,
uint8_t tx_data )

Stepper 11 I2C writing function.

This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.

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

◆ stepper11_get_diag()

uint8_t stepper11_get_diag ( stepper11_t * ctx)

Get anomaly detection flag.

This function gets a diag pin state that signals for anomaly detection flag.

Parameters
[in]ctx: Click context object. See #stepper18_t object definition for detailed explanation.
Returns
Logic state of pin.

◆ stepper11_get_interrupt()

uint8_t stepper11_get_interrupt ( stepper11_t * ctx)

Get interrupt.

This function gets a int pin state.

Parameters
[in]ctx: Click context object. See #stepper18_t object definition for detailed explanation.
Returns
Logic state of pin.

◆ stepper11_get_mo()

uint8_t stepper11_get_mo ( stepper11_t * ctx)

Get electrical angle monitoring signal.

This function gets a mo pin state that signals electrical angle monitoring.

Parameters
[in]ctx: Click context object. See #stepper18_t object definition for detailed explanation.
Returns
Logic state of pin.

◆ stepper11_get_sd()

uint8_t stepper11_get_sd ( stepper11_t * ctx)

Get stall detection flag.

This function gets a sd pin state that signals for stall detection flag.

Parameters
[in]ctx: Click context object. See #stepper18_t object definition for detailed explanation.
Returns
Logic state of pin.

◆ stepper11_init()

err_t stepper11_init ( stepper11_t * ctx,
stepper11_cfg_t * cfg )

Stepper 11 initialization function.

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

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

◆ stepper11_move_motor_angle()

void stepper11_move_motor_angle ( stepper11_t * ctx,
float degree,
uint8_t speed )

Move motor in angle value.

This function moves motor for desired angle value.

Parameters
[in]ctx: Click context object. See stepper11_t object definition for detailed explanation.
[in]degree: Degrees to move.
[in]speed: Predefined speed macros:
  • 1 - Slow,
  • 2 - Normal,
  • 3 - Fast.
Returns
Nothing

◆ stepper11_move_motor_step()

void stepper11_move_motor_step ( stepper11_t * ctx,
uint16_t steps,
uint8_t speed )

Move motor in step value.

This function moves motor for desired step value.

Parameters
[in]ctx: Click context object. See stepper11_t object definition for detailed explanation.
[in]steps: Steps to move.
[in]speed: Predefined speed macros:
  • 1 - Slow,
  • 2 - Normal,
  • 3 - Fast.
Returns
Nothing

◆ stepper11_set_clock()

void stepper11_set_clock ( stepper11_t * ctx,
uint8_t state )

Set clock state.

This function sets a clk pin to change clock state.

Parameters
[in]ctx: Click context object. See #stepper18_t object definition for detailed explanation.
[in]state: Logic state to set.
Returns
Nothing.

◆ stepper11_set_direction()

void stepper11_set_direction ( stepper11_t * ctx,
uint8_t state )

Set direction.

This function sets a dir pin to change motor rotation direction.

Parameters
[in]ctx: Click context object. See #stepper18_t object definition for detailed explanation.
[in]state: Logic state to set.
Returns
Nothing.

◆ stepper11_set_enable()

void stepper11_set_enable ( stepper11_t * ctx,
uint8_t state )

Set enable.

This function sets a en pin to change enable state.

Parameters
[in]ctx: Click context object. See #stepper18_t object definition for detailed explanation.
[in]state: Logic state to set.
Returns
Nothing.

◆ stepper11_set_reset()

void stepper11_set_reset ( stepper11_t * ctx,
uint8_t state )

Set restart.

This function sets a rst pin to change start state.

Parameters
[in]ctx: Click context object. See #stepper18_t object definition for detailed explanation.
[in]state: Logic state to set.
Returns
Nothing.

◆ stepper11_set_step_resolution()

err_t stepper11_set_step_resolution ( stepper11_t * ctx,
uint8_t step_res )

Set step resolution.

This function sets step resolution for motor control.

Parameters
[in,out]ctx: Click context object. See stepper11_t object definition for detailed explanation.
[in]step_res: Step resolution:
  • 4 - Full step,
  • 2 - Half step A,
  • 1 - Half step B,
  • 6 - Quarter step,
  • 5 - 1/8 step,
  • 3 - 1/16 step,
  • 7 - 1/32 step.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ stepper11_set_torque()

err_t stepper11_set_torque ( stepper11_t * ctx,
uint8_t torque )

Set torque.

This function sets torque for motor control.

Parameters
[in]ctx: Click context object. See stepper11_t object definition for detailed explanation.
[in]torque: Torque:
  • 0 - 100%,
  • 1 - 70%,
  • 2 - 50%,
  • 3 - 30%.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.