stepper16
2.0.0.0
|
API for configuring and manipulating Stepper16 Click driver. More...
Modules | |
Stepper16 Registers List | |
List of registers of Stepper16 Click driver. | |
Stepper16 Registers Settings | |
Settings for registers of Stepper16 Click driver. | |
Stepper16 MikroBUS Map | |
MikroBUS pin mapping of Stepper16 Click driver. | |
Functions | |
void | stepper16_cfg_setup (stepper16_cfg_t *cfg) |
Stepper16 configuration object setup function. More... | |
err_t | stepper16_init (stepper16_t *ctx, stepper16_cfg_t *cfg) |
Stepper16 initialization function. More... | |
err_t | stepper16_default_cfg (stepper16_t *ctx) |
Stepper16 default configuration function. More... | |
err_t | stepper16_generic_write (stepper16_t *ctx, uint8_t reg, uint16_t data_in) |
Stepper16 data writing function. More... | |
err_t | stepper16_generic_read (stepper16_t *ctx, uint8_t reg, uint16_t *data_out) |
Stepper16 data reading function. More... | |
void | stepper16_set_next (stepper16_t *ctx, uint8_t value) |
Set next step state. More... | |
void | stepper16_set_dir (stepper16_t *ctx, uint8_t value) |
Set direction. More... | |
uint8_t | stepper16_get_error_flag (stepper16_t *ctx) |
Get error. More... | |
void | stepper16_hard_reset (stepper16_t *ctx) |
Resets device. More... | |
void | stepper16_wake_up (stepper16_t *ctx) |
Transimt wake up signal. More... | |
void | stepper16_set_step_resolution (stepper16_t *ctx, uint8_t step_res) |
Set step resolution. More... | |
void | stepper16_move_motor_angle (stepper16_t *ctx, float degree, uint8_t speed) |
Move motor in angle value. More... | |
void | stepper16_move_motor_step (stepper16_t *ctx, uint16_t steps, uint8_t speed) |
Move motor in step value. More... | |
void | stepper16_calculate_resolution (stepper16_t *ctx) |
Calculate step-degree resolution. More... | |
API for configuring and manipulating Stepper16 Click driver.
void stepper16_calculate_resolution | ( | stepper16_t * | ctx | ) |
Calculate step-degree resolution.
This function calculates resolution of selected motor steps.
[in] | ctx | : Click context object. See stepper16_t object definition for detailed explanation. |
void stepper16_cfg_setup | ( | stepper16_cfg_t * | cfg | ) |
Stepper16 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See stepper16_cfg_t object definition for detailed explanation. |
err_t stepper16_default_cfg | ( | stepper16_t * | ctx | ) |
Stepper16 default configuration function.
This function executes a default configuration of Stepper16 click board.
[in] | ctx | : Click context object. See stepper16_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t stepper16_generic_read | ( | stepper16_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | data_out | ||
) |
Stepper16 data reading function.
This function reads a data from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See stepper16_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error.err_t stepper16_generic_write | ( | stepper16_t * | ctx, |
uint8_t | reg, | ||
uint16_t | data_in | ||
) |
Stepper16 data writing function.
This function writes a data to the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See stepper16_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error.uint8_t stepper16_get_error_flag | ( | stepper16_t * | ctx | ) |
Get error.
This function gets a err pin.
[in] | ctx | : Click context object. See #stepper18_t object definition for detailed explanation. |
void stepper16_hard_reset | ( | stepper16_t * | ctx | ) |
Resets device.
This function resets device.
[in] | ctx | : Click context object. See #stepper18_t object definition for detailed explanation. |
err_t stepper16_init | ( | stepper16_t * | ctx, |
stepper16_cfg_t * | cfg | ||
) |
Stepper16 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See stepper16_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See stepper16_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.void stepper16_move_motor_angle | ( | stepper16_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 stepper16_t object definition for detailed explanation. |
[in] | degree | : Degrees to move. |
[in] | speed | : Predefined speed macros:
|
void stepper16_move_motor_step | ( | stepper16_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 stepper16_t object definition for detailed explanation. |
[in] | steps | : Steps to move. |
[in] | speed | : Predefined speed macros:
|
void stepper16_set_dir | ( | stepper16_t * | ctx, |
uint8_t | value | ||
) |
Set direction.
This function sets a dir pin to high/low state.
[in] | ctx | : Click context object. See #stepper18_t object definition for detailed explanation. |
[in] | value | : Logic state to set. |
void stepper16_set_next | ( | stepper16_t * | ctx, |
uint8_t | value | ||
) |
Set next step state.
This function sets a nxt pin to high/low state.
[in] | ctx | : Click context object. See #stepper18_t object definition for detailed explanation. |
[in] | value | : Logic state to set. |
void stepper16_set_step_resolution | ( | stepper16_t * | ctx, |
uint8_t | step_res | ||
) |
Set step resolution.
This function set step resolution fo motor control.
[in] | ctx | : Click context object. See #stepper18_t object definition for detailed explanation. |
[in] | step_res | : Step resolution:
|
void stepper16_wake_up | ( | stepper16_t * | ctx | ) |
Transimt wake up signal.
This function toggles cs pin to signal wake up.
[in] | ctx | : Click context object. See #stepper18_t object definition for detailed explanation. |