stepper10 2.1.0.0
|
API for configuring and manipulating Stepper 10 Click driver. More...
Topics | |
Stepper 10 Registers List | |
List of registers of Stepper 10 Click driver. | |
Stepper 10 Registers Settings | |
Settings for registers of Stepper 10 Click driver. | |
Stepper 10 MikroBUS Map | |
MikroBUS pin mapping of Stepper 10 Click driver. | |
Functions | |
void | stepper10_cfg_setup (stepper10_cfg_t *cfg) |
Stepper 10 configuration object setup function. | |
err_t | stepper10_init (stepper10_t *ctx, stepper10_cfg_t *cfg) |
Stepper 10 initialization function. | |
err_t | stepper10_default_cfg (stepper10_t *ctx) |
Stepper 10 default configuration function. | |
err_t | stepper10_write_spi_bank0 (stepper10_t *ctx, uint32_t data_in) |
Stepper 10 write spi bank0 function. | |
err_t | stepper10_write_spi_bank1 (stepper10_t *ctx, uint32_t data_in) |
Stepper 10 write spi bank1 function. | |
err_t | stepper10_tca_write_reg (stepper10_t *ctx, uint8_t reg, uint8_t data_in) |
Stepper 10 tca write reg function. | |
err_t | stepper10_tca_read_reg (stepper10_t *ctx, uint8_t reg, uint8_t *data_out) |
Stepper 10 tca read reg function. | |
err_t | stepper10_get_step_mode (stepper10_t *ctx, uint8_t *mode) |
Stepper 10 get step mode function. | |
err_t | stepper10_set_step_mode (stepper10_t *ctx, uint8_t mode) |
Stepper 10 set step mode function. | |
err_t | stepper10_get_sleep_pin (stepper10_t *ctx, uint8_t *state) |
Stepper 10 get sleep pin function. | |
err_t | stepper10_set_sleep_pin (stepper10_t *ctx, uint8_t state) |
Stepper 10 set sleep pin function. | |
err_t | stepper10_get_mixed_decay (stepper10_t *ctx, uint8_t *mode) |
Stepper 10 get mixed decay function. | |
err_t | stepper10_set_mixed_decay (stepper10_t *ctx, uint8_t mode) |
Stepper 10 set mixed decay function. | |
err_t | stepper10_get_agc_pin (stepper10_t *ctx, uint8_t *state) |
Stepper 10 get agc pin function. | |
err_t | stepper10_set_agc_pin (stepper10_t *ctx, uint8_t state) |
Stepper 10 set agc pin function. | |
err_t | stepper10_select_gpio (stepper10_t *ctx) |
Stepper 10 select GPIO function. | |
err_t | stepper10_select_spi (stepper10_t *ctx) |
Stepper 10 select SPI function. | |
err_t | stepper10_get_torque (stepper10_t *ctx, uint8_t *mode) |
Stepper 10 get torque function. | |
err_t | stepper10_set_torque (stepper10_t *ctx, uint8_t mode) |
Stepper 10 set torque function. | |
err_t | stepper10_get_clim0_pin (stepper10_t *ctx, uint8_t *state) |
Stepper 10 get clim0 pin function. | |
err_t | stepper10_set_clim0_pin (stepper10_t *ctx, uint8_t state) |
Stepper 10 set clim0 pin function. | |
err_t | stepper10_get_edg_sel_pin (stepper10_t *ctx, uint8_t *state) |
Stepper 10 get edg_sel pin function. | |
err_t | stepper10_set_edg_sel_pin (stepper10_t *ctx, uint8_t state) |
Stepper 10 set edg_sel pin function. | |
err_t | stepper10_get_mo_pin (stepper10_t *ctx, uint8_t *state) |
Stepper 10 get mo pin function. | |
err_t | stepper10_get_lo_state (stepper10_t *ctx, uint8_t *state) |
Stepper 10 get LO function. | |
void | stepper10_enable_device (stepper10_t *ctx) |
Stepper 10 enable device function. | |
void | stepper10_disable_device (stepper10_t *ctx) |
Stepper 10 disable device function. | |
uint8_t | stepper10_get_int_pin (stepper10_t *ctx) |
Stepper 10 get INT pin function. | |
void | stepper10_set_direction (stepper10_t *ctx, uint8_t dir) |
Stepper 10 set direction function. | |
void | stepper10_set_rst_pin (stepper10_t *ctx, uint8_t state) |
Stepper 10 set rst pin function. | |
void | stepper10_reset_device (stepper10_t *ctx) |
Stepper 10 reset device function. | |
void | stepper10_set_step_pin (stepper10_t *ctx, uint8_t state) |
Stepper 10 set step pin function. | |
err_t | stepper10_drive_motor (stepper10_t *ctx, uint32_t steps, uint8_t speed) |
Stepper 10 driver motor function. | |
API for configuring and manipulating Stepper 10 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void stepper10_cfg_setup | ( | stepper10_cfg_t * | cfg | ) |
Stepper 10 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See stepper10_cfg_t object definition for detailed explanation. |
err_t stepper10_default_cfg | ( | stepper10_t * | ctx | ) |
Stepper 10 default configuration function.
This function executes a default configuration of Stepper 10 click board.
[in] | ctx | : Click context object. See stepper10_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void stepper10_disable_device | ( | stepper10_t * | ctx | ) |
Stepper 10 disable device function.
This function disables the device by setting the EN pin to low logic state.
[in] | ctx | : Click context object. See stepper10_t object definition for detailed explanation. |
err_t stepper10_drive_motor | ( | stepper10_t * | ctx, |
uint32_t | steps, | ||
uint8_t | speed ) |
Stepper 10 driver motor function.
This function drives the motor for the specific number of steps at the selected speed.
[in] | ctx | : Click context object. See stepper10_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. void stepper10_enable_device | ( | stepper10_t * | ctx | ) |
Stepper 10 enable device function.
This function enables the device by setting the EN pin to high logic state.
[in] | ctx | : Click context object. See stepper10_t object definition for detailed explanation. |
err_t stepper10_get_agc_pin | ( | stepper10_t * | ctx, |
uint8_t * | state ) |
Stepper 10 get agc pin function.
This function reads the agc pin logic state.
[in] | ctx | : Click context object. See stepper10_t object definition for detailed explanation. |
[out] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper10_get_clim0_pin | ( | stepper10_t * | ctx, |
uint8_t * | state ) |
Stepper 10 get clim0 pin function.
This function reads the CLIM0 pin logic state.
[in] | ctx | : Click context object. See stepper10_t object definition for detailed explanation. |
[out] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper10_get_edg_sel_pin | ( | stepper10_t * | ctx, |
uint8_t * | state ) |
Stepper 10 get edg_sel pin function.
This function reads the EDG_SEL pin logic state.
[in] | ctx | : Click context object. See stepper10_t object definition for detailed explanation. |
[out] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t stepper10_get_int_pin | ( | stepper10_t * | ctx | ) |
Stepper 10 get INT pin function.
This function returns the INT pin logic state.
[in] | ctx | : Click context object. See stepper10_t object definition for detailed explanation. |
err_t stepper10_get_lo_state | ( | stepper10_t * | ctx, |
uint8_t * | state ) |
Stepper 10 get LO function.
This function reads the LO error detect flag state.
[in] | ctx | : Click context object. See stepper10_t object definition for detailed explanation. |
[out] | state | : LO error detect flag:
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper10_get_mixed_decay | ( | stepper10_t * | ctx, |
uint8_t * | mode ) |
Stepper 10 get mixed decay function.
This function reads the mixed decay settings.
[in] | ctx | : Click context object. See stepper10_t object definition for detailed explanation. |
[out] | mode | : Mixed decay mode:
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper10_get_mo_pin | ( | stepper10_t * | ctx, |
uint8_t * | state ) |
Stepper 10 get mo pin function.
This function reads the MO pin logic state.
[in] | ctx | : Click context object. See stepper10_t object definition for detailed explanation. |
[out] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper10_get_sleep_pin | ( | stepper10_t * | ctx, |
uint8_t * | state ) |
Stepper 10 get sleep pin function.
This function reads the sleep pin logic state.
[in] | ctx | : Click context object. See stepper10_t object definition for detailed explanation. |
[out] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper10_get_step_mode | ( | stepper10_t * | ctx, |
uint8_t * | mode ) |
Stepper 10 get step mode function.
This function reads the step mode resolution settings.
[in] | ctx | : Click context object. See stepper10_t object definition for detailed explanation. |
[out] | mode | : Step mode resolution:
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper10_get_torque | ( | stepper10_t * | ctx, |
uint8_t * | mode ) |
Stepper 10 get torque function.
This function reads the torque mode settings.
[in] | ctx | : Click context object. See stepper10_t object definition for detailed explanation. |
[out] | mode | : Torque settings:
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper10_init | ( | stepper10_t * | ctx, |
stepper10_cfg_t * | cfg ) |
Stepper 10 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See stepper10_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See stepper10_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void stepper10_reset_device | ( | stepper10_t * | ctx | ) |
Stepper 10 reset device function.
This function resets the device by toggling the RST pin.
[in] | ctx | : Click context object. See stepper10_t object definition for detailed explanation. |
err_t stepper10_select_gpio | ( | stepper10_t * | ctx | ) |
Stepper 10 select GPIO function.
This function selects GPIO communication by setting the IF_SEL pin to low logic state.
[in] | ctx | : Click context object. See stepper10_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper10_select_spi | ( | stepper10_t * | ctx | ) |
Stepper 10 select SPI function.
This function selects SPI communication by setting the IF_SEL pin to high logic state.
[in] | ctx | : Click context object. See stepper10_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper10_set_agc_pin | ( | stepper10_t * | ctx, |
uint8_t | state ) |
Stepper 10 set agc pin function.
This function sets the agc pin logic state.
[in] | ctx | : Click context object. See stepper10_t object definition for detailed explanation. |
[in] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper10_set_clim0_pin | ( | stepper10_t * | ctx, |
uint8_t | state ) |
Stepper 10 set clim0 pin function.
This function sets the CLIM0 pin logic state.
[in] | ctx | : Click context object. See stepper10_t object definition for detailed explanation. |
[in] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void stepper10_set_direction | ( | stepper10_t * | ctx, |
uint8_t | dir ) |
Stepper 10 set direction function.
This function sets the motor direction by setting the DIR pin logic state.
[in] | ctx | : Click context object. See stepper10_t object definition for detailed explanation. |
[in] | dir | :
|
err_t stepper10_set_edg_sel_pin | ( | stepper10_t * | ctx, |
uint8_t | state ) |
Stepper 10 set edg_sel pin function.
This function sets the EDG_SEL pin logic state.
[in] | ctx | : Click context object. See stepper10_t object definition for detailed explanation. |
[in] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper10_set_mixed_decay | ( | stepper10_t * | ctx, |
uint8_t | mode ) |
Stepper 10 set mixed decay function.
This function sets the mixed decay settings.
[in] | ctx | : Click context object. See stepper10_t object definition for detailed explanation. |
[in] | mode | : Mixed decay mode:
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void stepper10_set_rst_pin | ( | stepper10_t * | ctx, |
uint8_t | state ) |
Stepper 10 set rst pin function.
This function sets the RST pin logic state.
[in] | ctx | : Click context object. See stepper10_t object definition for detailed explanation. |
[in] | state | :
|
err_t stepper10_set_sleep_pin | ( | stepper10_t * | ctx, |
uint8_t | state ) |
Stepper 10 set sleep pin function.
This function sets the sleep pin logic state.
[in] | ctx | : Click context object. See stepper10_t object definition for detailed explanation. |
[in] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper10_set_step_mode | ( | stepper10_t * | ctx, |
uint8_t | mode ) |
Stepper 10 set step mode function.
This function sets the step mode resolution settings.
[in] | ctx | : Click context object. See stepper10_t object definition for detailed explanation. |
[in] | mode | : Step mode resolution:
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void stepper10_set_step_pin | ( | stepper10_t * | ctx, |
uint8_t | state ) |
Stepper 10 set step pin function.
This function sets the STEP pin logic state.
[in] | ctx | : Click context object. See stepper10_t object definition for detailed explanation. |
[in] | state | :
|
err_t stepper10_set_torque | ( | stepper10_t * | ctx, |
uint8_t | mode ) |
Stepper 10 set torque function.
This function sets the torque mode settings.
[in] | ctx | : Click context object. See stepper10_t object definition for detailed explanation. |
[in] | mode | : Torque settings:
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper10_tca_read_reg | ( | stepper10_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
Stepper 10 tca read reg function.
This function reads data from the selected TCA9534A register by using I2C serial interface.
[in] | ctx | : Click context object. See stepper10_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. err_t stepper10_tca_write_reg | ( | stepper10_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
Stepper 10 tca write reg function.
This function writes a desired data byte to the selected TCA9534A register by using I2C serial interface.
[in] | ctx | : Click context object. See stepper10_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. err_t stepper10_write_spi_bank0 | ( | stepper10_t * | ctx, |
uint32_t | data_in ) |
Stepper 10 write spi bank0 function.
This function writes a 32-bit command to BANK0 by using SPI serial interface.
[in] | ctx | : Click context object. See stepper10_t object definition for detailed explanation. |
[in] | data_in | : 32-bit SPI data command, D0-D31, where D0 is a MSB. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper10_write_spi_bank1 | ( | stepper10_t * | ctx, |
uint32_t | data_in ) |
Stepper 10 write spi bank1 function.
This function writes a 32-bit command to BANK1 by using SPI serial interface.
[in] | ctx | : Click context object. See stepper10_t object definition for detailed explanation. |
[in] | data_in | : 32-bit SPI data command, D0-D31, where D0 is a MSB. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.