stepper3 2.1.0.0
|
API for configuring and manipulating Stepper 3 Click driver. More...
Topics | |
Stepper 3 Registers Settings | |
Settings for registers of Stepper 3 Click driver. | |
Stepper 3 MikroBUS Map | |
MikroBUS pin mapping of Stepper 3 Click driver. | |
Functions | |
void | stepper3_cfg_setup (stepper3_cfg_t *cfg) |
Stepper 3 configuration object setup function. | |
err_t | stepper3_init (stepper3_t *ctx, stepper3_cfg_t *cfg) |
Stepper 3 initialization function. | |
void | stepper3_set_ina_pin (stepper3_t *ctx, uint8_t state) |
Stepper 3 set ina pin function. | |
void | stepper3_set_inb_pin (stepper3_t *ctx, uint8_t state) |
Stepper 3 set inb pin function. | |
void | stepper3_set_inc_pin (stepper3_t *ctx, uint8_t state) |
Stepper 3 set inc pin function. | |
void | stepper3_set_ind_pin (stepper3_t *ctx, uint8_t state) |
Stepper 3 set ind pin function. | |
void | stepper3_set_step_mode (stepper3_t *ctx, uint8_t mode) |
Stepper 3 set step mode function. | |
void | stepper3_set_direction (stepper3_t *ctx, uint8_t dir) |
Stepper 3 set direction function. | |
void | stepper3_switch_direction (stepper3_t *ctx) |
Stepper 3 switch direction function. | |
void | stepper3_enable_device (stepper3_t *ctx) |
Stepper 3 enable device function. | |
void | stepper3_disable_device (stepper3_t *ctx) |
Stepper 3 disable device function. | |
void | stepper3_drive_motor (stepper3_t *ctx, uint32_t steps, uint8_t speed) |
Stepper 3 driver motor function. | |
API for configuring and manipulating Stepper 3 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void stepper3_cfg_setup | ( | stepper3_cfg_t * | cfg | ) |
Stepper 3 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See stepper3_cfg_t object definition for detailed explanation. |
void stepper3_disable_device | ( | stepper3_t * | ctx | ) |
Stepper 3 disable device function.
This function disables the device by setting all pins to high logic state.
[in] | ctx | : Click context object. See stepper3_t object definition for detailed explanation. |
void stepper3_drive_motor | ( | stepper3_t * | ctx, |
uint32_t | steps, | ||
uint8_t | speed ) |
Stepper 3 driver motor function.
This function drives the motor for the specific number of steps at the selected speed.
[in] | ctx | : Click context object. See stepper3_t object definition for detailed explanation. |
[in] | steps | : Number of steps to rotate motor. |
[in] | speed | : Motor rotation speed:
|
void stepper3_enable_device | ( | stepper3_t * | ctx | ) |
Stepper 3 enable device function.
This function enables the device by setting all pins to low logic state.
[in] | ctx | : Click context object. See stepper3_t object definition for detailed explanation. |
err_t stepper3_init | ( | stepper3_t * | ctx, |
stepper3_cfg_t * | cfg ) |
Stepper 3 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See stepper3_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See stepper3_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void stepper3_set_direction | ( | stepper3_t * | ctx, |
uint8_t | dir ) |
Stepper 3 set direction function.
This function sets the motor direction to clockwise or counter-clockwise in ctx->direction.
[in] | ctx | : Click context object. See stepper3_t object definition for detailed explanation. |
[in] | dir | :
|
void stepper3_set_ina_pin | ( | stepper3_t * | ctx, |
uint8_t | state ) |
Stepper 3 set ina pin function.
This function sets the INA pin logic state.
[in] | ctx | : Click context object. See stepper3_t object definition for detailed explanation. |
[in] | state | :
|
void stepper3_set_inb_pin | ( | stepper3_t * | ctx, |
uint8_t | state ) |
Stepper 3 set inb pin function.
This function sets the INB pin logic state.
[in] | ctx | : Click context object. See stepper3_t object definition for detailed explanation. |
[in] | state | :
|
void stepper3_set_inc_pin | ( | stepper3_t * | ctx, |
uint8_t | state ) |
Stepper 3 set inc pin function.
This function sets the INC pin logic state.
[in] | ctx | : Click context object. See stepper3_t object definition for detailed explanation. |
[in] | state | :
|
void stepper3_set_ind_pin | ( | stepper3_t * | ctx, |
uint8_t | state ) |
Stepper 3 set ind pin function.
This function sets the IND pin logic state.
[in] | ctx | : Click context object. See stepper3_t object definition for detailed explanation. |
[in] | state | :
|
void stepper3_set_step_mode | ( | stepper3_t * | ctx, |
uint8_t | mode ) |
Stepper 3 set step mode function.
This function sets the step mode resolution settings in ctx->step_mode.
[in] | ctx | : Click context object. See stepper3_t object definition for detailed explanation. |
[in] | mode | : Step mode resolution.
|
void stepper3_switch_direction | ( | stepper3_t * | ctx | ) |
Stepper 3 switch direction function.
This function switches the motor direction in ctx->direction.
[in] | ctx | : Click context object. See stepper3_t object definition for detailed explanation. |