stepper15  2.0.0.0
Modules | Functions
Stepper 15 Click Driver

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

Modules

 Stepper 15 Registers List
 List of registers of Stepper 15 Click driver.
 
 Stepper 15 Registers Settings
 Settings for registers of Stepper 15 Click driver.
 
 Stepper 15 MikroBUS Map
 MikroBUS pin mapping of Stepper 15 Click driver.
 
 Direction
 
 Work_mode
 
 Output_mode
 
 Fault_condition
 

Functions

void stepper15_cfg_setup (stepper15_cfg_t *cfg)
 Stepper 15 configuration object setup function. More...
 
void stepper15_drv_interface_selection (stepper15_cfg_t *cfg, stepper15_drv_t drv_sel)
 Stepper 15 driver interface setup function. More...
 
err_t stepper15_init (stepper15_t *ctx, stepper15_cfg_t *cfg)
 Stepper 15 initialization function. More...
 
err_t stepper15_default_cfg (stepper15_t *ctx)
 Stepper 15 default configuration function. More...
 
err_t stepper15_generic_write (stepper15_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Stepper 15 data writing function. More...
 
void stepper15_reset (stepper15_t *ctx)
 Stepper 15 reset function. More...
 
void stepper15_motor_stop (stepper15_t *ctx)
 Stepper 15 motor stop function. More...
 
uint8_t stepper15_get_interrupt (stepper15_t *ctx)
 Stepper 15 get interrupt function. More...
 
err_t stepper15_make_one_step (stepper15_t *ctx, uint8_t step_speed)
 Stepper 15 make one step function. More...
 
err_t stepper15_set_direction (stepper15_t *ctx, uint8_t direction)
 Stepper 15 set direction function. More...
 
err_t stepper15_set_work_mode (stepper15_t *ctx, uint8_t work_mode)
 Stepper 15 set work mode function. More...
 
err_t stepper15_set_output_mode (stepper15_t *ctx, uint8_t output_mode)
 Stepper 15 set output mode function. More...
 
err_t stepper15_set_torque_dac (stepper15_t *ctx, uint8_t trq_data)
 Stepper 15 set torque DAC function. More...
 
err_t stepper15_set_counts (stepper15_t *ctx, uint8_t counts)
 Stepper 15 set counts function. More...
 
uint8_t stepper15_get_fault_condition (stepper15_t *ctx)
 Stepper 15 get fault condition function. More...
 
err_t stepper15_step_by_angle (stepper15_t *ctx, uint8_t step_speed, float angle, uint16_t step_360)
 Stepper 15 step by angle function. More...
 

Detailed Description

API for configuring and manipulating Stepper 15 Click driver.

Function Documentation

◆ stepper15_cfg_setup()

void stepper15_cfg_setup ( stepper15_cfg_t cfg)

Stepper 15 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ stepper15_default_cfg()

err_t stepper15_default_cfg ( stepper15_t ctx)

Stepper 15 default configuration function.

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

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

◆ stepper15_drv_interface_selection()

void stepper15_drv_interface_selection ( stepper15_cfg_t cfg,
stepper15_drv_t  drv_sel 
)

Stepper 15 driver interface setup function.

This function sets a serial driver interface which will be used further in the click driver.

Parameters
[out]cfg: Click configuration structure. See stepper15_cfg_t object definition for detailed explanation.
[in]drv_sel: Driver interface selection. See stepper15_drv_t object definition for detailed explanation.
Returns
Nothing.
Note
This driver selection should be call before init function to configure the driver to work with the serial interface which is consistent with the real state of the hardware. If this function is not called, the default driver interface will be set.

◆ stepper15_generic_write()

err_t stepper15_generic_write ( stepper15_t ctx,
uint8_t  reg,
uint8_t *  data_in,
uint8_t  len 
)

Stepper 15 data writing function.

This function writes a desired number of data bytes starting from the selected register.

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

◆ stepper15_get_fault_condition()

uint8_t stepper15_get_fault_condition ( stepper15_t ctx)

Stepper 15 get fault condition function.

This function get fault condition of the DRV8889A-Q1 Automotive Stepper Driver with Integrated Current Sense, 1/256 Micro-Stepping, and Stall Detection on the Stepper 15 click board™.

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

◆ stepper15_get_interrupt()

uint8_t stepper15_get_interrupt ( stepper15_t ctx)

Stepper 15 get interrupt function.

This function get interrupt flag state of the DRV8889A-Q1 Automotive Stepper Driver with Integrated Current Sense, 1/256 Micro-Stepping, and Stall Detection on the Stepper 15 click board™.

Parameters
[in]ctx: Click context object. See stepper15_t object definition for detailed explanation.
Returns
  • 0 - INT pin state low,
  • 1 - INT pin state high.
Note
None.

◆ stepper15_init()

err_t stepper15_init ( stepper15_t ctx,
stepper15_cfg_t cfg 
)

Stepper 15 initialization function.

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

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

◆ stepper15_make_one_step()

err_t stepper15_make_one_step ( stepper15_t ctx,
uint8_t  step_speed 
)

Stepper 15 make one step function.

This function performs make one step of the DRV8889A-Q1 Automotive Stepper Driver with Integrated Current Sense, 1/256 Micro-Stepping, and Stall Detection on the Stepper 15 click board™.

Parameters
[in]ctx: Click context object. See stepper15_t object definition for detailed explanation.
[in]step_speed: Step speed ( percent from 1 to 100 ( max speed ) ).
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ stepper15_motor_stop()

void stepper15_motor_stop ( stepper15_t ctx)

Stepper 15 motor stop function.

This function performs stop the stepper motor of the DRV8889A-Q1 Automotive Stepper Driver with Integrated Current Sense, 1/256 Micro-Stepping, and Stall Detection on the Stepper 15 click board™.

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

◆ stepper15_reset()

void stepper15_reset ( stepper15_t ctx)

Stepper 15 reset function.

This function performs hardware reset of the PCA9538A, Low-voltage 8-bit I2C-bus I/O port with interrupt and reset on the Stepper 15 click board™.

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

◆ stepper15_set_counts()

err_t stepper15_set_counts ( stepper15_t ctx,
uint8_t  counts 
)

Stepper 15 set counts function.

This function set the counts of the DRV8889A-Q1 Automotive Stepper Driver with Integrated Current Sense, 1/256 Micro-Stepping, and Stall Detection on the Stepper 15 click board™.

Parameters
[in]ctx: Click context object. See stepper15_t object definition for detailed explanation.
[in]counts: Counts 0 - 255.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ stepper15_set_direction()

err_t stepper15_set_direction ( stepper15_t ctx,
uint8_t  direction 
)

Stepper 15 set direction function.

This function selects the direction of movement of the DRV8889A-Q1 Automotive Stepper Driver with Integrated Current Sense, 1/256 Micro-Stepping, and Stall Detection on the Stepper 15 click board™.

Parameters
[in]ctx: Click context object. See stepper15_t object definition for detailed explanation.
[in]direction:
  • 0 ( STEPPER15_DIRECTION_COUNTERCLOCKWISE ) - Clockwise motion,
  • 1 ( STEPPER15_DIRECTION_CLOCKWISE ) - Counterclockwise motion.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ stepper15_set_output_mode()

err_t stepper15_set_output_mode ( stepper15_t ctx,
uint8_t  output_mode 
)

Stepper 15 set output mode function.

This function set the output mode of the DRV8889A-Q1 Automotive Stepper Driver with Integrated Current Sense, 1/256 Micro-Stepping, and Stall Detection on the Stepper 15 click board™.

Parameters
[in]ctx: Click context object. See stepper15_t object definition for detailed explanation.
[in]output_mode:
  • 0 ( STEPPER15_OUTPUT_MODE_OUTPUTS_DISABLE ) - Disable device outputs,
  • 1 ( STEPPER15_OUTPUT_MODE_OUTPUTS_ENABLE ) - Enable device outputs.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ stepper15_set_torque_dac()

err_t stepper15_set_torque_dac ( stepper15_t ctx,
uint8_t  trq_data 
)

Stepper 15 set torque DAC function.

This function set torque DAC to allows for the controller to scale the output current through SPI without needing to scale the Vref of the DRV8889A-Q1 Automotive Stepper Driver with Integrated Current Sense, 1/256 Micro-Stepping, and Stall Detection on the Stepper 15 click board™.

Parameters
[in]ctx: Click context object. See stepper15_t object definition for detailed explanation.
[in]trq_data:
  • 0x00 ( STEPPER15_SET_CTRL1_TRQ_100 ) - Current scalar ( TRQ ) of 100%,
  • 0x10 ( STEPPER15_SET_CTRL1_TRQ_93_75 ) - Current scalar ( TRQ ) of 93.75%,
  • 0x20 ( STEPPER15_SET_CTRL1_TRQ_87_5 ) - Current scalar ( TRQ ) of 87.5%,
  • 0x30 ( STEPPER15_SET_CTRL1_TRQ_81_25 ) - Current scalar ( TRQ ) of 81.25%,
  • 0x40 ( STEPPER15_SET_CTRL1_TRQ_75 ) - Current scalar ( TRQ ) of 75%,
  • 0x50 ( STEPPER15_SET_CTRL1_TRQ_68_75 ) - Current scalar ( TRQ ) of 68.75%,
  • 0x60 ( STEPPER15_SET_CTRL1_TRQ_62_5 ) - Current scalar ( TRQ ) of 62.5%,
  • 0x70 ( STEPPER15_SET_CTRL1_TRQ_56_25 ) - Current scalar ( TRQ ) of 56.25%,
  • 0x80 ( STEPPER15_SET_CTRL1_TRQ_50 ) - Current scalar ( TRQ ) of 50%,
  • 0x90 ( STEPPER15_SET_CTRL1_TRQ_43_75 ) - Current scalar ( TRQ ) of 43.75%,
  • 0xA0 ( STEPPER15_SET_CTRL1_TRQ_37_5 ) - Current scalar ( TRQ ) of 37.5%,
  • 0xB0 ( STEPPER15_SET_CTRL1_TRQ_31_25 ) - Current scalar ( TRQ ) of 31.25%,
  • 0xC0 ( STEPPER15_SET_CTRL1_TRQ_25 ) - Current scalar ( TRQ ) of 25%,
  • 0xD0 ( STEPPER15_SET_CTRL1_TRQ_18_75 ) - Current scalar ( TRQ ) of 18.75%,
  • 0xE0 ( STEPPER15_SET_CTRL1_TRQ_12_5 ) - Current scalar ( TRQ ) of 12.5%,
  • 0xF0 ( STEPPER15_SET_CTRL1_TRQ_6_25 ) - Current scalar ( TRQ ) of 6.25%.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ stepper15_set_work_mode()

err_t stepper15_set_work_mode ( stepper15_t ctx,
uint8_t  work_mode 
)

Stepper 15 set work mode function.

This function set the work mode of the DRV8889A-Q1 Automotive Stepper Driver with Integrated Current Sense, 1/256 Micro-Stepping, and Stall Detection on the Stepper 15 click board™.

Parameters
[in]ctx: Click context object. See stepper15_t object definition for detailed explanation.
[in]work_mode:
  • 0 ( STEPPER15_WORK_MODE_SLEEP ) - Sleep mode,
  • 1 ( STEPPER15_WORK_MODE_ENABLE_DEVICE ) - Enable device.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ stepper15_step_by_angle()

err_t stepper15_step_by_angle ( stepper15_t ctx,
uint8_t  step_speed,
float  angle,
uint16_t  step_360 
)

Stepper 15 step by angle function.

This function turn the stepper motor to the desired angle of the DRV8889A-Q1 Automotive Stepper Driver with Integrated Current Sense, 1/256 Micro-Stepping, and Stall Detection on the Stepper 15 click board™.

Parameters
[in]ctx: Click context object. See stepper15_t object definition for detailed explanation.
[in]step_speed: Step speed ( percent from 1 to 100 ( max speed ) ).
[in]angle: Angle of rotation.
[in]step_360: Number of steps per full circle.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.