stspin820 2.1.0.0
|
API for configuring and manipulating STSPIN820 Click driver. More...
Topics | |
STSPIN820 Settings | |
Settings of STSPIN820 Click driver. | |
STSPIN820 MikroBUS Map | |
MikroBUS pin mapping of STSPIN820 Click driver. | |
Functions | |
void | stspin820_cfg_setup (stspin820_cfg_t *cfg) |
STSPIN820 configuration object setup function. | |
err_t | stspin820_init (stspin820_t *ctx, stspin820_cfg_t *cfg) |
STSPIN820 initialization function. | |
void | stspin820_default_cfg (stspin820_t *ctx) |
STSPIN820 default configuration function. | |
void | stspin820_drive_motor (stspin820_t *ctx, uint32_t steps, uint8_t speed) |
STSPIN820 drive motor function. | |
void | stspin820_enable_device (stspin820_t *ctx) |
STSPIN820 enable device function. | |
void | stspin820_disable_device (stspin820_t *ctx) |
STSPIN820 disable device function. | |
void | stspin820_set_direction (stspin820_t *ctx, uint8_t dir) |
STSPIN820 set direction function. | |
void | stspin820_switch_direction (stspin820_t *ctx) |
STSPIN820 switch direction function. | |
void | stspin820_reset_device (stspin820_t *ctx) |
STSPIN820 reset device function. | |
void | stspin820_set_rst_pin (stspin820_t *ctx, uint8_t state) |
STSPIN820 set rst pin function. | |
uint8_t | stspin820_get_fault_pin (stspin820_t *ctx) |
STSPIN820 get fault pin function. | |
void | stspin820_set_step_pin (stspin820_t *ctx, uint8_t state) |
STSPIN820 set step pin function. | |
API for configuring and manipulating STSPIN820 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void stspin820_cfg_setup | ( | stspin820_cfg_t * | cfg | ) |
STSPIN820 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See stspin820_cfg_t object definition for detailed explanation. |
void stspin820_default_cfg | ( | stspin820_t * | ctx | ) |
STSPIN820 default configuration function.
This function executes a default configuration of STSPIN820 click board.
[in] | ctx | : Click context object. See stspin820_t object definition for detailed explanation. |
void stspin820_disable_device | ( | stspin820_t * | ctx | ) |
STSPIN820 disable device function.
This function disables the device by setting the EN pin to low logic state.
[in] | ctx | : Click context object. See stspin820_t object definition for detailed explanation. |
void stspin820_drive_motor | ( | stspin820_t * | ctx, |
uint32_t | steps, | ||
uint8_t | speed ) |
STSPIN820 drive motor function.
This function drives the motor for the specific number of steps at the selected speed.
[in] | ctx | : Click context object. See stspin820_t object definition for detailed explanation. |
[in] | steps | : Number of steps to rotate motor. |
[in] | speed | : Motor rotation speed:
|
void stspin820_enable_device | ( | stspin820_t * | ctx | ) |
STSPIN820 enable device function.
This function enables the device by setting the EN pin to high logic state.
[in] | ctx | : Click context object. See stspin820_t object definition for detailed explanation. |
uint8_t stspin820_get_fault_pin | ( | stspin820_t * | ctx | ) |
STSPIN820 get fault pin function.
This function returns the FAULT pin logic state.
[in] | ctx | : Click context object. See stspin820_t object definition for detailed explanation. |
err_t stspin820_init | ( | stspin820_t * | ctx, |
stspin820_cfg_t * | cfg ) |
STSPIN820 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See stspin820_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See stspin820_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void stspin820_reset_device | ( | stspin820_t * | ctx | ) |
STSPIN820 reset device function.
This function resets the device by toggling the RST pin.
[in] | ctx | : Click context object. See stspin820_t object definition for detailed explanation. |
void stspin820_set_direction | ( | stspin820_t * | ctx, |
uint8_t | dir ) |
STSPIN820 set direction function.
This function sets the motor direction by setting the DIR pin logic state.
[in] | ctx | : Click context object. See stspin820_t object definition for detailed explanation. |
[in] | dir | :
|
void stspin820_set_rst_pin | ( | stspin820_t * | ctx, |
uint8_t | state ) |
STSPIN820 set rst pin function.
This function sets the RST pin logic state.
[in] | ctx | : Click context object. See stspin820_t object definition for detailed explanation. |
[in] | state | :
|
void stspin820_set_step_pin | ( | stspin820_t * | ctx, |
uint8_t | state ) |
STSPIN820 set step pin function.
This function sets the STEP pin logic state.
[in] | ctx | : Click context object. See stspin820_t object definition for detailed explanation. |
[in] | state | :
|
void stspin820_switch_direction | ( | stspin820_t * | ctx | ) |
STSPIN820 switch direction function.
This function switches the motor direction by toggling the DIR pin.
[in] | ctx | : Click context object. See stspin820_t object definition for detailed explanation. |