stepper19 2.1.0.0
Stepper 19 Click Driver

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

Topics

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

Functions

void stepper19_cfg_setup (stepper19_cfg_t *cfg)
 Stepper 19 configuration object setup function.
 
err_t stepper19_init (stepper19_t *ctx, stepper19_cfg_t *cfg)
 Stepper 19 initialization function.
 
err_t stepper19_default_cfg (stepper19_t *ctx)
 Stepper 19 default configuration function.
 
err_t stepper19_generic_write (stepper19_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Stepper 19 I2C writing function.
 
err_t stepper19_generic_read (stepper19_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Stepper 19 I2C reading function.
 
err_t stepper19_port_exp_write (stepper19_t *ctx, uint8_t reg, uint8_t data_in)
 Stepper 19 port expander data writing function.
 
err_t stepper19_port_exp_read (stepper19_t *ctx, uint8_t reg, uint8_t *data_out)
 Stepper 19 port expander data reading function.
 
err_t stepper19_set_pins (stepper19_t *ctx, uint8_t set_mask, uint8_t clr_mask)
 Stepper 19 sets the pin states function.
 
err_t stepper19_set_microstep_mode (stepper19_t *ctx, uint8_t ms_mode)
 Stepper 19 sets the microstepping mode function.
 
err_t stepper19_set_decay_mode (stepper19_t *ctx, uint8_t decay_mode)
 Stepper 19 sets the decay mode function.
 
err_t stepper19_set_toff (stepper19_t *ctx, uint8_t toff)
 Stepper 19 set toff function.
 
void stepper19_enable_device (stepper19_t *ctx)
 Stepper 19 enable device function.
 
void stepper19_disable_device (stepper19_t *ctx)
 Stepper 19 disable device function.
 
err_t stepper19_set_direction (stepper19_t *ctx, uint8_t dir)
 Stepper 19 sets the direction function.
 
err_t stepper19_set_step (stepper19_t *ctx, uint8_t step)
 Stepper 19 sets the step function.
 
err_t stepper19_make_one_step (stepper19_t *ctx, uint8_t step_speed)
 Stepper 19 make the one step function.
 
err_t stepper19_rotate_by_angle (stepper19_t *ctx, uint8_t step_speed, float angle, uint16_t res_360)
 Stepper 19 rotates the shaft through a desired angle function.
 
err_t stepper19_rotate_by_step (stepper19_t *ctx, uint8_t step_speed, uint16_t steps)
 Stepper 19 rotates the shaft through a desired step function.
 
uint8_t stepper19_fault_indication (stepper19_t *ctx)
 Stepper 19 fault indication function.
 

Detailed Description

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

◆ stepper19_cfg_setup()

void stepper19_cfg_setup ( stepper19_cfg_t * cfg)

Stepper 19 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ stepper19_default_cfg()

err_t stepper19_default_cfg ( stepper19_t * ctx)

Stepper 19 default configuration function.

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

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

◆ stepper19_disable_device()

void stepper19_disable_device ( stepper19_t * ctx)

Stepper 19 disable device function.

This function disables the device outputs of the DRV8424EPWPR, Stepper Drivers With Integrated Current Sense, 1/256 Microstepping, STEP/DIR Interface and smart tune Technology on the Stepper 19 Click board.

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

◆ stepper19_enable_device()

void stepper19_enable_device ( stepper19_t * ctx)

Stepper 19 enable device function.

This function enables the device outputs of the DRV8424EPWPR, Stepper Drivers With Integrated Current Sense, 1/256 Microstepping, STEP/DIR Interface and smart tune Technology on the Stepper 19 Click board.

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

◆ stepper19_fault_indication()

uint8_t stepper19_fault_indication ( stepper19_t * ctx)

Stepper 19 fault indication function.

This function reads state of the interrupt (FLT) pin of the DRV8424EPWPR, Stepper Drivers With Integrated Current Sense, 1/256 Microstepping, STEP/DIR Interface and smart tune Technology on the Stepper 19 Click board.

Parameters
[in]ctx: Click context object. See stepper19_t object definition for detailed explanation.
Returns
  • 0 - Fault condition,
  • 1 - Ok. See #err_t definition for detailed explanation.
Note
None.

◆ stepper19_generic_read()

err_t stepper19_generic_read ( stepper19_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

Stepper 19 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 stepper19_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ stepper19_generic_write()

err_t stepper19_generic_write ( stepper19_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

Stepper 19 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 stepper19_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ stepper19_init()

err_t stepper19_init ( stepper19_t * ctx,
stepper19_cfg_t * cfg )

Stepper 19 initialization function.

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

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

◆ stepper19_make_one_step()

err_t stepper19_make_one_step ( stepper19_t * ctx,
uint8_t step_speed )

Stepper 19 make the one step function.

This function is used to make the one step of the desired speed of the DRV8424EPWPR, Stepper Drivers With Integrated Current Sense, 1/256 Microstepping, STEP/DIR Interface and smart tune Technology on the Stepper 19 Click board.

Parameters
[in]ctx: Click context object. See stepper19_t object definition for detailed explanation.
[in]step_speed: Step speed percent.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ stepper19_port_exp_read()

err_t stepper19_port_exp_read ( stepper19_t * ctx,
uint8_t reg,
uint8_t * data_out )

Stepper 19 port expander data reading function.

This function reads a desired data byte from the selected register of the PCA9538A, Low-voltage 8-bit I2C-bus I/O port with interrupt and reset on the Stepper 19 Click board.

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

◆ stepper19_port_exp_write()

err_t stepper19_port_exp_write ( stepper19_t * ctx,
uint8_t reg,
uint8_t data_in )

Stepper 19 port expander data writing function.

This function writes a desired data byte to the selected register of the PCA9538A, Low-voltage 8-bit I2C-bus I/O port with interrupt and reset on the Stepper 19 Click board.

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

◆ stepper19_rotate_by_angle()

err_t stepper19_rotate_by_angle ( stepper19_t * ctx,
uint8_t step_speed,
float angle,
uint16_t res_360 )

Stepper 19 rotates the shaft through a desired angle function.

This function rotates the shaft through a desired step speed and angle of the DRV8424EPWPR, Stepper Drivers With Integrated Current Sense, 1/256 Microstepping, STEP/DIR Interface and smart tune Technology on the Stepper 19 Click board.

Parameters
[in]ctx: Click context object. See stepper19_t object definition for detailed explanation.
[in]step_speed: Step speed percent.
[in]angle: Angle of rotation.
[in]res_360: Resolution of steps per revolution.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ stepper19_rotate_by_step()

err_t stepper19_rotate_by_step ( stepper19_t * ctx,
uint8_t step_speed,
uint16_t steps )

Stepper 19 rotates the shaft through a desired step function.

This function rotates the shaft through for the specific number of steps at the selected speed of the DRV8424EPWPR, Stepper Drivers With Integrated Current Sense, 1/256 Microstepping, STEP/DIR Interface and smart tune Technology on the Stepper 19 Click board.

Parameters
[in]ctx: Click context object. See stepper19_t object definition for detailed explanation.
[in]step_speed: Step speed percent.
[in]steps: Number of steps to rotate motor.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ stepper19_set_decay_mode()

err_t stepper19_set_decay_mode ( stepper19_t * ctx,
uint8_t decay_mode )

Stepper 19 sets the decay mode function.

This function sets the decay mode settings of the PCA9538A, Low-voltage 8-bit I2C-bus I/O port with interrupt and reset on the Stepper 19 Click board.

Parameters
[in]ctx: Click context object. See stepper19_t object definition for detailed explanation.
[in]decay_mode: Decay mode settings.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ stepper19_set_direction()

err_t stepper19_set_direction ( stepper19_t * ctx,
uint8_t dir )

Stepper 19 sets the direction function.

This function sets the desired direction of motor movement: clockwise or counterclockwise of the DRV8424EPWPR, Stepper Drivers With Integrated Current Sense, 1/256 Microstepping, STEP/DIR Interface and smart tune Technology on the Stepper 19 Click board.

Parameters
[in]ctx: Click context object. See stepper19_t object definition for detailed explanation.
[in]dir: Direction of movement.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ stepper19_set_microstep_mode()

err_t stepper19_set_microstep_mode ( stepper19_t * ctx,
uint8_t ms_mode )

Stepper 19 sets the microstepping mode function.

This function sets the microstepping mode settings of the PCA9538A, Low-voltage 8-bit I2C-bus I/O port with interrupt and reset on the Stepper 19 Click board.

Parameters
[in]ctx: Click context object. See stepper19_t object definition for detailed explanation.
[in]ms_mode: Microstepping mode selection.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ stepper19_set_pins()

err_t stepper19_set_pins ( stepper19_t * ctx,
uint8_t set_mask,
uint8_t clr_mask )

Stepper 19 sets the pin states function.

This function sets and clears the value of the selected pins of the PCA9538A, Low-voltage 8-bit I2C-bus I/O port with interrupt and reset on the Stepper 19 Click board.

Parameters
[in]ctx: Click context object. See stepper19_t object definition for detailed explanation.
[in]set_mask: Pin set mask.
[in]clr_mask: Pin clear mask.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ stepper19_set_step()

err_t stepper19_set_step ( stepper19_t * ctx,
uint8_t step )

Stepper 19 sets the step function.

This function sets the step (STP) pin state of the DRV8424EPWPR, Stepper Drivers With Integrated Current Sense, 1/256 Microstepping, STEP/DIR Interface and smart tune Technology on the Stepper 19 Click board.

Parameters
[in]ctx: Click context object. See stepper19_t object definition for detailed explanation.
[in]step: Step (STP) pin state.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ stepper19_set_toff()

err_t stepper19_set_toff ( stepper19_t * ctx,
uint8_t toff )

Stepper 19 set toff function.

This function sets the desired off time value of the PCA9538A, Low-voltage 8-bit I2C-bus I/O port with interrupt and reset on the Stepper 19 Click board.

Parameters
[in]ctx: Click context object. See stepper19_t object definition for detailed explanation.
[in]toff: TOFF settings.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.