stepper15 2.0.0.0
|
API for configuring and manipulating Stepper 15 Click driver. More...
Topics | |
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. | |
err_t | stepper15_init (stepper15_t *ctx, stepper15_cfg_t *cfg) |
Stepper 15 initialization function. | |
err_t | stepper15_default_cfg (stepper15_t *ctx) |
Stepper 15 default configuration function. | |
err_t | stepper15_i2c_write (stepper15_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Stepper 15 I2C writing function. | |
err_t | stepper15_i2c_read (stepper15_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Stepper 15 I2C reading function. | |
err_t | stepper15_spi_write (stepper15_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Stepper 15 SPI writing function. | |
err_t | stepper15_spi_read (stepper15_t *ctx, uint8_t reg, uint8_t *data_out) |
Stepper 15 SPI reading function. | |
void | stepper15_reset (stepper15_t *ctx) |
Stepper 15 reset function. | |
void | stepper15_motor_stop (stepper15_t *ctx) |
Stepper 15 motor stop function. | |
uint8_t | stepper15_get_interrupt (stepper15_t *ctx) |
Stepper 15 get interrupt function. | |
err_t | stepper15_make_one_step (stepper15_t *ctx, uint8_t step_speed) |
Stepper 15 make one step function. | |
err_t | stepper15_set_direction (stepper15_t *ctx, uint8_t direction) |
Stepper 15 set direction function. | |
err_t | stepper15_set_work_mode (stepper15_t *ctx, uint8_t work_mode) |
Stepper 15 set work mode function. | |
err_t | stepper15_set_output_mode (stepper15_t *ctx, uint8_t output_mode) |
Stepper 15 set output mode function. | |
err_t | stepper15_set_torque_dac (stepper15_t *ctx, uint8_t trq_data) |
Stepper 15 set torque DAC function. | |
err_t | stepper15_set_counts (stepper15_t *ctx, uint8_t counts) |
Stepper 15 set counts function. | |
uint8_t | stepper15_get_fault_condition (stepper15_t *ctx) |
Stepper 15 get fault condition function. | |
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. | |
API for configuring and manipulating Stepper 15 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void stepper15_cfg_setup | ( | stepper15_cfg_t * | cfg | ) |
Stepper 15 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See stepper15_cfg_t object definition for detailed explanation. |
err_t stepper15_default_cfg | ( | stepper15_t * | ctx | ) |
Stepper 15 default configuration function.
This function executes a default configuration of Stepper 15 click board.
[in] | ctx | : Click context object. See stepper15_t object definition for detailed explanation. |
0
- Success, -1
- Error.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™.
[in] | ctx | : Click context object. See stepper15_t object definition for detailed explanation. |
0
- Fault condition, 1
- Correct condition.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™.
[in] | ctx | : Click context object. See stepper15_t object definition for detailed explanation. |
0
- INT pin state low, 1
- INT pin state high.err_t stepper15_i2c_read | ( | stepper15_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Stepper 15 I2C reading function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See stepper15_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. |
0
- Success, -1
- Error.err_t stepper15_i2c_write | ( | stepper15_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Stepper 15 I2C writing function.
This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.
[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. |
0
- Success, -1
- Error.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.
[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. |
0
- Success, -1
- Error.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™.
[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 ) ). |
0
- Success, -1
- Error.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™.
[in] | ctx | : Click context object. See stepper15_t object definition for detailed explanation. |
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™.
[in] | ctx | : Click context object. See stepper15_t object definition for detailed explanation. |
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™.
[in] | ctx | : Click context object. See stepper15_t object definition for detailed explanation. |
[in] | counts | : Counts 0 - 255. |
0
- Success, -1
- Error.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™.
[in] | ctx | : Click context object. See stepper15_t object definition for detailed explanation. |
[in] | direction | :
|
0
- Success, -1
- Error.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™.
[in] | ctx | : Click context object. See stepper15_t object definition for detailed explanation. |
[in] | output_mode | :
|
0
- Success, -1
- Error.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™.
[in] | ctx | : Click context object. See stepper15_t object definition for detailed explanation. |
[in] | trq_data | :
|
0
- Success, -1
- Error.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™.
[in] | ctx | : Click context object. See stepper15_t object definition for detailed explanation. |
[in] | work_mode | :
|
0
- Success, -1
- Error.err_t stepper15_spi_read | ( | stepper15_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
Stepper 15 SPI reading function.
This function reads a desired number of data bytes starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See stepper15_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error.err_t stepper15_spi_write | ( | stepper15_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Stepper 15 SPI writing function.
This function writes a desired number of data bytes starting from the selected register by using SPI serial interface.
[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. |
0
- Success, -1
- Error.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™.
[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. |
0
- Success, -1
- Error.