stepper18 2.0.0.0
|
API for configuring and manipulating Stepper 18 Click driver. More...
Functions | |
void | stepper18_cfg_setup (stepper18_cfg_t *cfg) |
Stepper 18 configuration object setup function. | |
err_t | stepper18_init (stepper18_t *ctx, stepper18_cfg_t *cfg) |
Stepper 18 initialization function. | |
err_t | stepper18_default_cfg (stepper18_t *ctx) |
Stepper 18 default configuration function. | |
err_t | stepper18_generic_write (stepper18_t *ctx, uint8_t *tx_buf, uint8_t tx_len) |
Writing function. | |
err_t | stepper18_set_out_voltage (stepper18_t *ctx, uint16_t voltage) |
Set voltage reference. | |
void | stepper18_set_dir (stepper18_t *ctx, uint8_t value) |
Set direction. | |
void | stepper18_set_slp (stepper18_t *ctx, uint8_t value) |
Set sleep. | |
void | stepper18_set_en (stepper18_t *ctx, uint8_t value) |
Set enable. | |
void | stepper18_set_stp (stepper18_t *ctx, uint8_t value) |
Set step state. | |
uint8_t | stepper18_get_flt (stepper18_t *ctx) |
Get fault. | |
void | stepper18_move_motor_angle (stepper18_t *ctx, float degree, uint8_t step_res, uint8_t speed) |
Move motor in angle value. | |
void | stepper18_move_motor_step (stepper18_t *ctx, uint16_t steps, uint8_t step_res, uint8_t speed) |
Move motor in step value. | |
void | stepper18_calculate_resolution (stepper18_t *ctx) |
Calculate step-degree resolution. | |
API for configuring and manipulating Stepper 18 Click driver.
void stepper18_calculate_resolution | ( | stepper18_t * | ctx | ) |
Calculate step-degree resolution.
This function calculates resolution of selected motor steps.
[in] | ctx | : Click context object. See stepper18_t object definition for detailed explanation. |
void stepper18_cfg_setup | ( | stepper18_cfg_t * | cfg | ) |
Stepper 18 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See stepper18_cfg_t object definition for detailed explanation. |
err_t stepper18_default_cfg | ( | stepper18_t * | ctx | ) |
Stepper 18 default configuration function.
This function executes a default configuration of Stepper 18 click board.
[in] | ctx | : Click context object. See stepper18_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t stepper18_generic_write | ( | stepper18_t * | ctx, |
uint8_t * | tx_buf, | ||
uint8_t | tx_len ) |
Writing function.
This function writes a desired number of data bytes by using I2C serial interface.
[in] | ctx | : Click context object. See stepper18_t object definition for detailed explanation. |
[in] | tx_buf | : Data to be written. |
[in] | tx_len | : Number of bytes to be written. |
0
- Success, -1
- Error.uint8_t stepper18_get_flt | ( | stepper18_t * | ctx | ) |
Get fault.
This function gets a flt pin.
[in] | ctx | : Click context object. See stepper18_t object definition for detailed explanation. |
err_t stepper18_init | ( | stepper18_t * | ctx, |
stepper18_cfg_t * | cfg ) |
Stepper 18 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See stepper18_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See stepper18_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.void stepper18_move_motor_angle | ( | stepper18_t * | ctx, |
float | degree, | ||
uint8_t | step_res, | ||
uint8_t | speed ) |
Move motor in angle value.
This function moves motor for desired angle value.
[in] | ctx | : Click context object. See stepper18_t object definition for detailed explanation. |
[in] | degree | : Degrees to move. |
[in] | step_res | : Step resolution refrence:
|
[in] | speed | : Predefined speed macros:
|
0
- Success, -1
- Error.void stepper18_move_motor_step | ( | stepper18_t * | ctx, |
uint16_t | steps, | ||
uint8_t | step_res, | ||
uint8_t | speed ) |
Move motor in step value.
This function moves motor for desired step value.
[in] | ctx | : Click context object. See stepper18_t object definition for detailed explanation. |
[in] | steps | : Steps to move. |
[in] | step_res | : Step resolution refrence:
|
[in] | speed | : Predefined speed macros:
|
0
- Success, -1
- Error.void stepper18_set_dir | ( | stepper18_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 stepper18_set_en | ( | stepper18_t * | ctx, |
uint8_t | value ) |
Set enable.
This function sets a en pin to high/low state.
[in] | ctx | : Click context object. See stepper18_t object definition for detailed explanation. |
[in] | value | : Logic state to set. |
err_t stepper18_set_out_voltage | ( | stepper18_t * | ctx, |
uint16_t | voltage ) |
Set voltage reference.
This function sets a desired reference voltage of device.
[in] | ctx | : Click context object. See stepper18_t object definition for detailed explanation. |
[in] | voltage | : Data to be written. |
0
- Success, -1
- Error.void stepper18_set_slp | ( | stepper18_t * | ctx, |
uint8_t | value ) |
Set sleep.
This function sets a slp 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 stepper18_set_stp | ( | stepper18_t * | ctx, |
uint8_t | value ) |
Set step state.
This function sets a stp pin to high/low state.
[in] | ctx | : Click context object. See stepper18_t object definition for detailed explanation. |
[in] | value | : Logic state to set. |