stepper20 2.1.0.0
|
API for configuring and manipulating Stepper 20 Click driver. More...
Topics | |
Stepper 20 Registers List | |
List of registers of Stepper 20 Click driver. | |
Stepper 20 Registers Settings | |
Settings for registers of Stepper 20 Click driver. | |
Stepper 20 MikroBUS Map | |
MikroBUS pin mapping of Stepper 20 Click driver. | |
Functions | |
void | stepper20_cfg_setup (stepper20_cfg_t *cfg) |
Stepper 20 configuration object setup function. | |
err_t | stepper20_init (stepper20_t *ctx, stepper20_cfg_t *cfg) |
Stepper 20 initialization function. | |
err_t | stepper20_default_cfg (stepper20_t *ctx) |
Stepper 20 default configuration function. | |
err_t | stepper20_write_register (stepper20_t *ctx, uint8_t reg, uint8_t data_in) |
Stepper 20 write register function. | |
err_t | stepper20_read_register (stepper20_t *ctx, uint8_t reg, uint8_t *data_out) |
Stepper 20 read register function. | |
err_t | stepper20_get_step_mode (stepper20_t *ctx, uint8_t *mode) |
Stepper 20 get step mode function. | |
err_t | stepper20_set_step_mode (stepper20_t *ctx, uint8_t mode) |
Stepper 20 set step mode function. | |
err_t | stepper20_get_sleep_x_pin (stepper20_t *ctx, uint8_t *state) |
Stepper 20 get sleep x pin function. | |
err_t | stepper20_set_sleep_x_pin (stepper20_t *ctx, uint8_t state) |
Stepper 20 set sleep x pin function. | |
err_t | stepper20_get_lo_pin (stepper20_t *ctx, uint8_t *state) |
Stepper 20 get lo pin function. | |
err_t | stepper20_get_mo_pin (stepper20_t *ctx, uint8_t *state) |
Stepper 20 get mo pin function. | |
void | stepper20_drive_motor (stepper20_t *ctx, uint32_t steps, uint8_t speed) |
Stepper 20 driver motor function. | |
void | stepper20_enable_device (stepper20_t *ctx) |
Stepper 20 enable device function. | |
void | stepper20_disable_device (stepper20_t *ctx) |
Stepper 20 disable device function. | |
void | stepper20_set_direction (stepper20_t *ctx, uint8_t dir) |
Stepper 20 set direction function. | |
void | stepper20_switch_direction (stepper20_t *ctx) |
Stepper 20 switch direction function. | |
void | stepper20_reset_device (stepper20_t *ctx) |
Stepper 20 reset device function. | |
uint8_t | stepper20_get_int_pin (stepper20_t *ctx) |
Stepper 20 get int pin function. | |
void | stepper20_set_clk_pin (stepper20_t *ctx, uint8_t state) |
Stepper 20 set clk pin function. | |
API for configuring and manipulating Stepper 20 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void stepper20_cfg_setup | ( | stepper20_cfg_t * | cfg | ) |
Stepper 20 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See stepper20_cfg_t object definition for detailed explanation. |
err_t stepper20_default_cfg | ( | stepper20_t * | ctx | ) |
Stepper 20 default configuration function.
This function executes a default configuration of Stepper 20 click board.
[in] | ctx | : Click context object. See stepper20_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void stepper20_disable_device | ( | stepper20_t * | ctx | ) |
Stepper 20 disable device function.
This function disables the device by setting the EN pin to high logic state.
[in] | ctx | : Click context object. See stepper20_t object definition for detailed explanation. |
void stepper20_drive_motor | ( | stepper20_t * | ctx, |
uint32_t | steps, | ||
uint8_t | speed ) |
Stepper 20 driver motor function.
This function drives the motor for the specific number of steps at the selected speed.
[in] | ctx | : Click context object. See stepper20_t object definition for detailed explanation. |
[in] | steps | : Number of steps to rotate motor. |
[in] | speed | : Motor rotation speed:
|
void stepper20_enable_device | ( | stepper20_t * | ctx | ) |
Stepper 20 enable device function.
This function enables the device by setting the EN pin to low logic state.
[in] | ctx | : Click context object. See stepper20_t object definition for detailed explanation. |
uint8_t stepper20_get_int_pin | ( | stepper20_t * | ctx | ) |
Stepper 20 get int pin function.
This function returns the INT pin logic state.
[in] | ctx | : Click context object. See stepper20_t object definition for detailed explanation. |
err_t stepper20_get_lo_pin | ( | stepper20_t * | ctx, |
uint8_t * | state ) |
Stepper 20 get lo pin function.
This function reads the lo pin logic state.
[in] | ctx | : Click context object. See stepper20_t object definition for detailed explanation. |
[out] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper20_get_mo_pin | ( | stepper20_t * | ctx, |
uint8_t * | state ) |
Stepper 20 get mo pin function.
This function reads the mo pin logic state.
[in] | ctx | : Click context object. See stepper20_t object definition for detailed explanation. |
[out] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper20_get_sleep_x_pin | ( | stepper20_t * | ctx, |
uint8_t * | state ) |
Stepper 20 get sleep x pin function.
This function reads the sleep x pin logic state.
[in] | ctx | : Click context object. See stepper20_t object definition for detailed explanation. |
[out] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper20_get_step_mode | ( | stepper20_t * | ctx, |
uint8_t * | mode ) |
Stepper 20 get step mode function.
This function reads the step mode resolution settings.
[in] | ctx | : Click context object. See stepper20_t object definition for detailed explanation. |
[out] | mode | : Step mode resolution. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper20_init | ( | stepper20_t * | ctx, |
stepper20_cfg_t * | cfg ) |
Stepper 20 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See stepper20_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See stepper20_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper20_read_register | ( | stepper20_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
Stepper 20 read register function.
This function reads data from the selected PCA9538A register by using I2C serial interface.
[in] | ctx | : Click context object. See stepper20_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 stepper20_reset_device | ( | stepper20_t * | ctx | ) |
Stepper 20 reset device function.
This function resets the device by toggling the RST pin.
[in] | ctx | : Click context object. See stepper20_t object definition for detailed explanation. |
void stepper20_set_clk_pin | ( | stepper20_t * | ctx, |
uint8_t | state ) |
Stepper 20 set clk pin function.
This function sets the CLK pin logic state.
[in] | ctx | : Click context object. See stepper20_t object definition for detailed explanation. |
[in] | state | :
|
void stepper20_set_direction | ( | stepper20_t * | ctx, |
uint8_t | dir ) |
Stepper 20 set direction function.
This function sets the motor direction by setting the DIR pin logic state.
[in] | ctx | : Click context object. See stepper20_t object definition for detailed explanation. |
[in] | dir | :
|
err_t stepper20_set_sleep_x_pin | ( | stepper20_t * | ctx, |
uint8_t | state ) |
Stepper 20 set sleep x pin function.
This function sets the sleep x pin logic state.
[in] | ctx | : Click context object. See stepper20_t object definition for detailed explanation. |
[in] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper20_set_step_mode | ( | stepper20_t * | ctx, |
uint8_t | mode ) |
Stepper 20 set step mode function.
This function sets the step mode resolution settings.
[in] | ctx | : Click context object. See stepper20_t object definition for detailed explanation. |
[in] | mode | : Step mode resolution. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void stepper20_switch_direction | ( | stepper20_t * | ctx | ) |
Stepper 20 switch direction function.
This function switches the motor direction by toggling the DIR pin.
[in] | ctx | : Click context object. See stepper20_t object definition for detailed explanation. |
err_t stepper20_write_register | ( | stepper20_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
Stepper 20 write register function.
This function writes a desired data byte to the selected PCA9538A register by using I2C serial interface.
[in] | ctx | : Click context object. See stepper20_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.