silentstep3 2.1.0.0
|
API for configuring and manipulating Silent Step 3 Click driver. More...
Topics | |
Silent Step 3 Registers List | |
List of registers of Silent Step 3 Click driver. | |
Silent Step 3 Registers Settings | |
Settings for registers of Silent Step 3 Click driver. | |
Silent Step 3 MikroBUS Map | |
MikroBUS pin mapping of Silent Step 3 Click driver. | |
Functions | |
void | silentstep3_cfg_setup (silentstep3_cfg_t *cfg) |
Silent Step 3 configuration object setup function. | |
err_t | silentstep3_init (silentstep3_t *ctx, silentstep3_cfg_t *cfg) |
Silent Step 3 initialization function. | |
err_t | silentstep3_default_cfg (silentstep3_t *ctx) |
Silent Step 3 default configuration function. | |
err_t | silentstep3_write_register (silentstep3_t *ctx, uint8_t reg, uint32_t data_in, uint32_t *data_out) |
Silent Step 3 write command function. | |
err_t | silentstep3_set_step_mode (silentstep3_t *ctx, uint8_t mode) |
Silent Step 3 set step mode function. | |
void | silentstep3_enable_device (silentstep3_t *ctx) |
Silent Step 3 enable device function. | |
void | silentstep3_disable_device (silentstep3_t *ctx) |
Silent Step 3 disable device function. | |
void | silentstep3_set_direction (silentstep3_t *ctx, uint8_t dir) |
Silent Step 3 set direction function. | |
void | silentstep3_switch_direction (silentstep3_t *ctx) |
Silent Step 3 switch direction function. | |
void | silentstep3_set_step_pin (silentstep3_t *ctx, uint8_t state) |
Silent Step 3 set step pin function. | |
uint8_t | silentstep3_get_sg_pin (silentstep3_t *ctx) |
Silent Step 3 get sg pin function. | |
void | silentstep3_drive_motor (silentstep3_t *ctx, uint32_t steps, uint8_t speed) |
Silent Step 3 driver motor function. | |
API for configuring and manipulating Silent Step 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 silentstep3_cfg_setup | ( | silentstep3_cfg_t * | cfg | ) |
Silent Step 3 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See silentstep3_cfg_t object definition for detailed explanation. |
err_t silentstep3_default_cfg | ( | silentstep3_t * | ctx | ) |
Silent Step 3 default configuration function.
This function executes a default configuration of Silent Step 3 click board.
[in] | ctx | : Click context object. See silentstep3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void silentstep3_disable_device | ( | silentstep3_t * | ctx | ) |
Silent Step 3 disable device function.
This function disables the device by setting the ENABLE pin to high logic state.
[in] | ctx | : Click context object. See silentstep3_t object definition for detailed explanation. |
void silentstep3_drive_motor | ( | silentstep3_t * | ctx, |
uint32_t | steps, | ||
uint8_t | speed ) |
Silent Step 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 silentstep3_t object definition for detailed explanation. |
[in] | steps | : Number of steps to rotate motor. |
[in] | speed | : Motor rotation speed:
|
void silentstep3_enable_device | ( | silentstep3_t * | ctx | ) |
Silent Step 3 enable device function.
This function enables the device by setting the ENABLE pin to low logic state.
[in] | ctx | : Click context object. See silentstep3_t object definition for detailed explanation. |
uint8_t silentstep3_get_sg_pin | ( | silentstep3_t * | ctx | ) |
Silent Step 3 get sg pin function.
This function returns the SG pin logic state.
[in] | ctx | : Click context object. See silentstep3_t object definition for detailed explanation. |
err_t silentstep3_init | ( | silentstep3_t * | ctx, |
silentstep3_cfg_t * | cfg ) |
Silent Step 3 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See silentstep3_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See silentstep3_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void silentstep3_set_direction | ( | silentstep3_t * | ctx, |
uint8_t | dir ) |
Silent Step 3 set direction function.
This function sets the motor direction by setting the DIR pin logic state.
[in] | ctx | : Click context object. See silentstep3_t object definition for detailed explanation. |
[in] | dir | :
|
err_t silentstep3_set_step_mode | ( | silentstep3_t * | ctx, |
uint8_t | mode ) |
Silent Step 3 set step mode function.
This function sets the microstep resolution bits in DRVCTRL register.
[in] | ctx | : Click context object. See silentstep3_t object definition for detailed explanation. |
[in] | mode | : MODE bits setting:
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void silentstep3_set_step_pin | ( | silentstep3_t * | ctx, |
uint8_t | state ) |
Silent Step 3 set step pin function.
This function sets the STEP pin logic state.
[in] | ctx | : Click context object. See silentstep3_t object definition for detailed explanation. |
[in] | state | :
|
void silentstep3_switch_direction | ( | silentstep3_t * | ctx | ) |
Silent Step 3 switch direction function.
This function switches the motor direction by toggling the DIR pin.
[in] | ctx | : Click context object. See silentstep3_t object definition for detailed explanation. |
err_t silentstep3_write_register | ( | silentstep3_t * | ctx, |
uint8_t | reg, | ||
uint32_t | data_in, | ||
uint32_t * | data_out ) |
Silent Step 3 write command function.
This function writes data to the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See silentstep3_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : 18-bit data to be written. |
[out] | data_out | : 20-bit response data (Optional). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.