stepper2 2.1.0.0
|
API for configuring and manipulating Stepper 2 Click driver. More...
Topics | |
Stepper 2 Settings | |
Settings of Stepper 2 Click driver. | |
Stepper 2 MikroBUS Map | |
MikroBUS pin mapping of Stepper 2 Click driver. | |
Functions | |
void | stepper2_cfg_setup (stepper2_cfg_t *cfg) |
Stepper 2 configuration object setup function. | |
err_t | stepper2_init (stepper2_t *ctx, stepper2_cfg_t *cfg) |
Stepper 2 initialization function. | |
void | stepper2_default_cfg (stepper2_t *ctx) |
Stepper 2 default configuration function. | |
void | stepper2_drive_motor (stepper2_t *ctx, uint32_t steps, uint8_t speed) |
Stepper 2 driver motor function. | |
void | stepper2_enable_reset (stepper2_t *ctx) |
Stepper 2 enable reset function. | |
void | stepper2_disable_reset (stepper2_t *ctx) |
Stepper 2 disable reset function. | |
void | stepper2_enable_sleep (stepper2_t *ctx) |
Stepper 2 enable sleep function. | |
void | stepper2_disable_sleep (stepper2_t *ctx) |
Stepper 2 disable sleep function. | |
void | stepper2_enable_device (stepper2_t *ctx) |
Stepper 2 enable device function. | |
void | stepper2_disable_device (stepper2_t *ctx) |
Stepper 2 disable device function. | |
void | stepper2_set_direction (stepper2_t *ctx, uint8_t dir) |
Stepper 2 set direction function. | |
void | stepper2_switch_direction (stepper2_t *ctx) |
Stepper 2 switch direction function. | |
void | stepper2_set_step_pin (stepper2_t *ctx, uint8_t state) |
Stepper 2 set step pin function. | |
API for configuring and manipulating Stepper 2 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void stepper2_cfg_setup | ( | stepper2_cfg_t * | cfg | ) |
Stepper 2 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See stepper2_cfg_t object definition for detailed explanation. |
void stepper2_default_cfg | ( | stepper2_t * | ctx | ) |
Stepper 2 default configuration function.
This function executes a default configuration of Stepper 2 click board.
[in] | ctx | : Click context object. See stepper2_t object definition for detailed explanation. |
void stepper2_disable_device | ( | stepper2_t * | ctx | ) |
Stepper 2 disable device function.
This function disables the device by setting the ENABLE pin to high logic state.
[in] | ctx | : Click context object. See stepper2_t object definition for detailed explanation. |
void stepper2_disable_reset | ( | stepper2_t * | ctx | ) |
Stepper 2 disable reset function.
This function disables the reset by setting the RESET pin to high logic state.
[in] | ctx | : Click context object. See stepper2_t object definition for detailed explanation. |
void stepper2_disable_sleep | ( | stepper2_t * | ctx | ) |
Stepper 2 disable sleep function.
This function disables the sleep by setting the SLEEP pin to high logic state.
[in] | ctx | : Click context object. See stepper2_t object definition for detailed explanation. |
void stepper2_drive_motor | ( | stepper2_t * | ctx, |
uint32_t | steps, | ||
uint8_t | speed ) |
Stepper 2 driver motor function.
This function drives the motor for the specific number of steps at the selected speed.
[in] | ctx | : Click context object. See stepper2_t object definition for detailed explanation. |
[in] | steps | : Number of steps to rotate motor. |
[in] | speed | : Motor rotation speed:
|
void stepper2_enable_device | ( | stepper2_t * | ctx | ) |
Stepper 2 enable device function.
This function enables the device by setting the ENABLE pin to low logic state.
[in] | ctx | : Click context object. See stepper2_t object definition for detailed explanation. |
void stepper2_enable_reset | ( | stepper2_t * | ctx | ) |
Stepper 2 enable reset function.
This function enables the reset by setting the RESET pin to low logic state.
[in] | ctx | : Click context object. See stepper2_t object definition for detailed explanation. |
void stepper2_enable_sleep | ( | stepper2_t * | ctx | ) |
Stepper 2 enable sleep function.
This function enables the sleep by setting the SLEEP pin to low logic state.
[in] | ctx | : Click context object. See stepper2_t object definition for detailed explanation. |
err_t stepper2_init | ( | stepper2_t * | ctx, |
stepper2_cfg_t * | cfg ) |
Stepper 2 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See stepper2_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See stepper2_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void stepper2_set_direction | ( | stepper2_t * | ctx, |
uint8_t | dir ) |
Stepper 2 set direction function.
This function sets the motor direction by setting the DIR pin logic state.
[in] | ctx | : Click context object. See stepper2_t object definition for detailed explanation. |
[in] | dir | :
|
void stepper2_set_step_pin | ( | stepper2_t * | ctx, |
uint8_t | state ) |
Stepper 2 set step pin function.
This function sets the STEP pin logic state.
[in] | ctx | : Click context object. See stepper2_t object definition for detailed explanation. |
[in] | state | :
|
void stepper2_switch_direction | ( | stepper2_t * | ctx | ) |
Stepper 2 switch direction function.
This function switches the motor direction by toggling the DIR pin.
[in] | ctx | : Click context object. See stepper2_t object definition for detailed explanation. |