stepper 2.1.0.0
|
API for configuring and manipulating Stepper Click driver. More...
Topics | |
Stepper Settings | |
Settings of Stepper Click driver. | |
Stepper MikroBUS Map | |
MikroBUS pin mapping of Stepper Click driver. | |
Functions | |
void | stepper_cfg_setup (stepper_cfg_t *cfg) |
Stepper configuration object setup function. | |
err_t | stepper_init (stepper_t *ctx, stepper_cfg_t *cfg) |
Stepper initialization function. | |
void | stepper_default_cfg (stepper_t *ctx) |
Stepper default configuration function. | |
void | stepper_set_step_mode (stepper_t *ctx, uint8_t mode) |
Stepper set step mode function. | |
void | stepper_drive_motor (stepper_t *ctx, uint32_t steps, uint8_t speed) |
Stepper driver motor function. | |
void | stepper_enable_device (stepper_t *ctx) |
Stepper enable device function. | |
void | stepper_disable_device (stepper_t *ctx) |
Stepper disable device function. | |
void | stepper_set_direction (stepper_t *ctx, uint8_t dir) |
Stepper set direction function. | |
void | stepper_switch_direction (stepper_t *ctx) |
Stepper switch direction function. | |
void | stepper_set_step_pin (stepper_t *ctx, uint8_t state) |
Stepper set step pin function. | |
API for configuring and manipulating Stepper Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void stepper_cfg_setup | ( | stepper_cfg_t * | cfg | ) |
Stepper configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See stepper_cfg_t object definition for detailed explanation. |
void stepper_default_cfg | ( | stepper_t * | ctx | ) |
Stepper default configuration function.
This function executes a default configuration of Stepper click board.
[in] | ctx | : Click context object. See stepper_t object definition for detailed explanation. |
void stepper_disable_device | ( | stepper_t * | ctx | ) |
Stepper disable device function.
This function disables the device by setting the ENABLE pin to high logic state.
[in] | ctx | : Click context object. See stepper_t object definition for detailed explanation. |
void stepper_drive_motor | ( | stepper_t * | ctx, |
uint32_t | steps, | ||
uint8_t | speed ) |
Stepper driver motor function.
This function drives the motor for the specific number of steps at the selected speed.
[in] | ctx | : Click context object. See stepper_t object definition for detailed explanation. |
[in] | steps | : Number of steps to rotate motor. |
[in] | speed | : Motor rotation speed:
|
void stepper_enable_device | ( | stepper_t * | ctx | ) |
Stepper enable device function.
This function enables the device by setting the ENABLE pin to low logic state.
[in] | ctx | : Click context object. See stepper_t object definition for detailed explanation. |
err_t stepper_init | ( | stepper_t * | ctx, |
stepper_cfg_t * | cfg ) |
Stepper initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See stepper_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See stepper_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void stepper_set_direction | ( | stepper_t * | ctx, |
uint8_t | dir ) |
Stepper set direction function.
This function sets the motor direction by setting the DIR pin logic state.
[in] | ctx | : Click context object. See stepper_t object definition for detailed explanation. |
[in] | dir | :
|
void stepper_set_step_mode | ( | stepper_t * | ctx, |
uint8_t | mode ) |
Stepper set step mode function.
This function sets the step mode resolution settings.
[in] | ctx | : Click context object. See stepper_t object definition for detailed explanation. |
[in] | mode | : Step mode resolution. |
void stepper_set_step_pin | ( | stepper_t * | ctx, |
uint8_t | state ) |
Stepper set step pin function.
This function sets the STEP pin logic state.
[in] | ctx | : Click context object. See stepper_t object definition for detailed explanation. |
[in] | state | :
|