stepper7 2.1.0.0
|
API for configuring and manipulating Stepper 7 Click driver. More...
Topics | |
Stepper 7 Registers List | |
List of registers of Stepper 7 Click driver. | |
Stepper 7 Registers Settings | |
Settings for registers of Stepper 7 Click driver. | |
Stepper 7 MikroBUS Map | |
MikroBUS pin mapping of Stepper 7 Click driver. | |
Functions | |
void | stepper7_cfg_setup (stepper7_cfg_t *cfg) |
Stepper 7 configuration object setup function. | |
err_t | stepper7_init (stepper7_t *ctx, stepper7_cfg_t *cfg) |
Stepper 7 initialization function. | |
err_t | stepper7_default_cfg (stepper7_t *ctx) |
Stepper 7 default configuration function. | |
err_t | stepper7_write_reg (stepper7_t *ctx, uint8_t reg, uint8_t data_in) |
Stepper 7 write reg function. | |
err_t | stepper7_read_reg (stepper7_t *ctx, uint8_t reg, uint8_t *data_out) |
Stepper 7 read reg function. | |
void | stepper7_set_rst_pin (stepper7_t *ctx, uint8_t state) |
Stepper 7 set rst pin function. | |
void | stepper7_reset_device (stepper7_t *ctx) |
Stepper 7 reset device function. | |
err_t | stepper7_set_phase2_pin (stepper7_t *ctx, uint8_t state) |
Stepper 7 set PHASE2 pin function. | |
err_t | stepper7_set_phase1_pin (stepper7_t *ctx, uint8_t state) |
Stepper 7 set PHASE1 pin function. | |
err_t | stepper7_set_i12_pin (stepper7_t *ctx, uint8_t state) |
Stepper 7 set I12 pin function. | |
err_t | stepper7_set_i02_pin (stepper7_t *ctx, uint8_t state) |
Stepper 7 set I02 pin function. | |
err_t | stepper7_set_i11_pin (stepper7_t *ctx, uint8_t state) |
Stepper 7 set I11 pin function. | |
err_t | stepper7_set_i01_pin (stepper7_t *ctx, uint8_t state) |
Stepper 7 set I01 pin function. | |
err_t | stepper7_enable_device (stepper7_t *ctx) |
Stepper 7 enable device function. | |
err_t | stepper7_disable_device (stepper7_t *ctx) |
Stepper 7 disable device function. | |
void | stepper7_set_step_mode (stepper7_t *ctx, uint8_t mode) |
Stepper 7 set step mode function. | |
void | stepper7_set_direction (stepper7_t *ctx, uint8_t dir) |
Stepper 7 set direction function. | |
void | stepper7_switch_direction (stepper7_t *ctx) |
Stepper 7 switch direction function. | |
err_t | stepper7_drive_motor (stepper7_t *ctx, uint32_t steps, uint8_t speed) |
Stepper 7 driver motor function. | |
API for configuring and manipulating Stepper 7 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void stepper7_cfg_setup | ( | stepper7_cfg_t * | cfg | ) |
Stepper 7 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See stepper7_cfg_t object definition for detailed explanation. |
err_t stepper7_default_cfg | ( | stepper7_t * | ctx | ) |
Stepper 7 default configuration function.
This function executes a default configuration of Stepper 7 click board.
[in] | ctx | : Click context object. See stepper7_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper7_disable_device | ( | stepper7_t * | ctx | ) |
Stepper 7 disable device function.
This function disables the device by setting all pins to high logic state.
[in] | ctx | : Click context object. See stepper7_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper7_drive_motor | ( | stepper7_t * | ctx, |
uint32_t | steps, | ||
uint8_t | speed ) |
Stepper 7 driver motor function.
This function drives the motor for the specific number of steps at the selected speed.
[in] | ctx | : Click context object. See stepper7_t object definition for detailed explanation. |
[in] | steps | : Number of steps to rotate motor. |
[in] | speed | : Motor rotation speed:
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper7_enable_device | ( | stepper7_t * | ctx | ) |
Stepper 7 enable device function.
This function enables the device by setting all pins to low logic state.
[in] | ctx | : Click context object. See stepper7_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper7_init | ( | stepper7_t * | ctx, |
stepper7_cfg_t * | cfg ) |
Stepper 7 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See stepper7_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See stepper7_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper7_read_reg | ( | stepper7_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
Stepper 7 read reg function.
This function reads data from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See stepper7_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void stepper7_reset_device | ( | stepper7_t * | ctx | ) |
Stepper 7 reset device function.
This function resets the device by toggling the RST pin.
[in] | ctx | : Click context object. See stepper7_t object definition for detailed explanation. |
void stepper7_set_direction | ( | stepper7_t * | ctx, |
uint8_t | dir ) |
Stepper 7 set direction function.
This function sets the motor direction to clockwise or counter-clockwise in ctx->direction.
[in] | ctx | : Click context object. See stepper7_t object definition for detailed explanation. |
[in] | dir | :
|
err_t stepper7_set_i01_pin | ( | stepper7_t * | ctx, |
uint8_t | state ) |
Stepper 7 set I01 pin function.
This function sets the I01 pin logic state.
[in] | ctx | : Click context object. See stepper7_t object definition for detailed explanation. |
[in] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper7_set_i02_pin | ( | stepper7_t * | ctx, |
uint8_t | state ) |
Stepper 7 set I02 pin function.
This function sets the I02 pin logic state.
[in] | ctx | : Click context object. See stepper7_t object definition for detailed explanation. |
[in] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper7_set_i11_pin | ( | stepper7_t * | ctx, |
uint8_t | state ) |
Stepper 7 set I11 pin function.
This function sets the I11 pin logic state.
[in] | ctx | : Click context object. See stepper7_t object definition for detailed explanation. |
[in] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper7_set_i12_pin | ( | stepper7_t * | ctx, |
uint8_t | state ) |
Stepper 7 set I12 pin function.
This function sets the I12 pin logic state.
[in] | ctx | : Click context object. See stepper7_t object definition for detailed explanation. |
[in] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper7_set_phase1_pin | ( | stepper7_t * | ctx, |
uint8_t | state ) |
Stepper 7 set PHASE1 pin function.
This function sets the PHASE1 pin logic state.
[in] | ctx | : Click context object. See stepper7_t object definition for detailed explanation. |
[in] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper7_set_phase2_pin | ( | stepper7_t * | ctx, |
uint8_t | state ) |
Stepper 7 set PHASE2 pin function.
This function sets the PHASE2 pin logic state.
[in] | ctx | : Click context object. See stepper7_t object definition for detailed explanation. |
[in] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void stepper7_set_rst_pin | ( | stepper7_t * | ctx, |
uint8_t | state ) |
Stepper 7 set rst pin function.
This function sets the RST pin logic state.
[in] | ctx | : Click context object. See stepper7_t object definition for detailed explanation. |
[in] | state | :
|
void stepper7_set_step_mode | ( | stepper7_t * | ctx, |
uint8_t | mode ) |
Stepper 7 set step mode function.
This function sets the step mode resolution settings in ctx->step_mode.
[in] | ctx | : Click context object. See stepper7_t object definition for detailed explanation. |
[in] | mode | : Step mode resolution.
|
void stepper7_switch_direction | ( | stepper7_t * | ctx | ) |
Stepper 7 switch direction function.
This function switches the motor direction in ctx->direction.
[in] | ctx | : Click context object. See stepper7_t object definition for detailed explanation. |
err_t stepper7_write_reg | ( | stepper7_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
Stepper 7 write reg function.
This function writes data to the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See stepper7_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.