stepper11 2.0.0.0
|
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. | |
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.
void stepper11_cfg_setup | ( | stepper11_cfg_t * | cfg | ) |
Stepper 11 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See stepper11_cfg_t object definition for detailed explanation. |
err_t stepper11_default_cfg | ( | stepper11_t * | ctx | ) |
Stepper 11 default configuration function.
This function executes a default configuration of Stepper 11 click board.
[in] | ctx | : Click context object. See stepper11_t object definition for detailed explanation. |
0
- Success, -1
- Error.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.
[in] | ctx | : Click context object. See stepper11_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | rx_data | : Output read data. |
0
- Success, -1
- Error.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.
[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. |
0
- Success, -1
- Error.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.
[in] | ctx | : Click context object. See #stepper18_t object definition for detailed explanation. |
uint8_t stepper11_get_interrupt | ( | stepper11_t * | ctx | ) |
Get interrupt.
This function gets a int pin state.
[in] | ctx | : Click context object. See #stepper18_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See #stepper18_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See #stepper18_t object definition for detailed explanation. |
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.
[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. |
0
- Success, -1
- Error.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.
[in] | ctx | : Click context object. See stepper11_t object definition for detailed explanation. |
[in] | degree | : Degrees to move. |
[in] | speed | : Predefined speed macros:
|
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.
[in] | ctx | : Click context object. See stepper11_t object definition for detailed explanation. |
[in] | steps | : Steps to move. |
[in] | speed | : Predefined speed macros:
|
void stepper11_set_clock | ( | stepper11_t * | ctx, |
uint8_t | state ) |
Set clock state.
This function sets a clk pin to change clock state.
[in] | ctx | : Click context object. See #stepper18_t object definition for detailed explanation. |
[in] | state | : Logic state to set. |
void stepper11_set_direction | ( | stepper11_t * | ctx, |
uint8_t | state ) |
Set direction.
This function sets a dir pin to change motor rotation direction.
[in] | ctx | : Click context object. See #stepper18_t object definition for detailed explanation. |
[in] | state | : Logic state to set. |
void stepper11_set_enable | ( | stepper11_t * | ctx, |
uint8_t | state ) |
Set enable.
This function sets a en pin to change enable state.
[in] | ctx | : Click context object. See #stepper18_t object definition for detailed explanation. |
[in] | state | : Logic state to set. |
void stepper11_set_reset | ( | stepper11_t * | ctx, |
uint8_t | state ) |
Set restart.
This function sets a rst pin to change start state.
[in] | ctx | : Click context object. See #stepper18_t object definition for detailed explanation. |
[in] | state | : Logic state to set. |
err_t stepper11_set_step_resolution | ( | stepper11_t * | ctx, |
uint8_t | step_res ) |
Set step resolution.
This function sets step resolution for motor control.
[in,out] | ctx | : Click context object. See stepper11_t object definition for detailed explanation. |
[in] | step_res | : Step resolution:
|
0
- Success, -1
- Error.err_t stepper11_set_torque | ( | stepper11_t * | ctx, |
uint8_t | torque ) |
Set torque.
This function sets torque for motor control.
[in] | ctx | : Click context object. See stepper11_t object definition for detailed explanation. |
[in] | torque | : Torque:
|
0
- Success, -1
- Error.