stepper14 2.1.0.0
|
API for configuring and manipulating Stepper 14 Click driver. More...
Topics | |
Stepper 14 Registers List | |
List of registers of Stepper 14 Click driver. | |
Stepper 14 Registers Settings | |
Settings for registers of Stepper 14 Click driver. | |
Stepper 14 MikroBUS Map | |
MikroBUS pin mapping of Stepper 14 Click driver. | |
Functions | |
void | stepper14_cfg_setup (stepper14_cfg_t *cfg) |
Stepper 14 configuration object setup function. | |
err_t | stepper14_init (stepper14_t *ctx, stepper14_cfg_t *cfg) |
Stepper 14 initialization function. | |
err_t | stepper14_default_cfg (stepper14_t *ctx) |
Stepper 14 default configuration function. | |
err_t | stepper14_pca_write_reg (stepper14_t *ctx, uint8_t reg, uint8_t data_in) |
Stepper 14 pca write reg function. | |
err_t | stepper14_pca_read_reg (stepper14_t *ctx, uint8_t reg, uint8_t *data_out) |
Stepper 14 pca read reg function. | |
void | stepper14_set_rst_pin (stepper14_t *ctx, uint8_t state) |
Stepper 14 set rst pin function. | |
void | stepper14_reset_pca (stepper14_t *ctx) |
Stepper 14 reset device function. | |
uint8_t | stepper14_get_fault_pin (stepper14_t *ctx) |
Stepper 14 get FAULT pin function. | |
void | stepper14_enable_device (stepper14_t *ctx) |
Stepper 14 enable device function. | |
void | stepper14_disable_device (stepper14_t *ctx) |
Stepper 14 disable device function. | |
err_t | stepper14_set_in1_pin (stepper14_t *ctx, uint8_t state) |
Stepper 14 set IN1 pin function. | |
err_t | stepper14_set_in2_pin (stepper14_t *ctx, uint8_t state) |
Stepper 14 set IN2 pin function. | |
err_t | stepper14_set_in3_pin (stepper14_t *ctx, uint8_t state) |
Stepper 14 set IN3 pin function. | |
err_t | stepper14_set_in4_pin (stepper14_t *ctx, uint8_t state) |
Stepper 14 set IN4 pin function. | |
err_t | stepper14_set_mode_pin (stepper14_t *ctx, uint8_t state) |
Stepper 14 set MODE pin function. | |
err_t | stepper14_set_trq_pin (stepper14_t *ctx, uint8_t state) |
Stepper 14 set TRQ pin function. | |
err_t | stepper14_set_interface_mode (stepper14_t *ctx, uint8_t mode) |
Stepper 14 set interface mode function. | |
void | stepper14_set_step_mode (stepper14_t *ctx, uint8_t mode) |
Stepper 14 set step mode function. | |
void | stepper14_set_direction (stepper14_t *ctx, uint8_t dir) |
Stepper 14 set direction function. | |
void | stepper14_switch_direction (stepper14_t *ctx) |
Stepper 14 switch direction function. | |
err_t | stepper14_drive_motor (stepper14_t *ctx, uint32_t steps, uint8_t speed) |
Stepper 14 driver motor function. | |
API for configuring and manipulating Stepper 14 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void stepper14_cfg_setup | ( | stepper14_cfg_t * | cfg | ) |
Stepper 14 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See stepper14_cfg_t object definition for detailed explanation. |
err_t stepper14_default_cfg | ( | stepper14_t * | ctx | ) |
Stepper 14 default configuration function.
This function executes a default configuration of Stepper 14 click board.
[in] | ctx | : Click context object. See stepper14_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void stepper14_disable_device | ( | stepper14_t * | ctx | ) |
Stepper 14 disable device function.
This function disables the device by setting the ENABLE pin to low logic state.
[in] | ctx | : Click context object. See stepper14_t object definition for detailed explanation. |
err_t stepper14_drive_motor | ( | stepper14_t * | ctx, |
uint32_t | steps, | ||
uint8_t | speed ) |
Stepper 14 driver motor function.
This function drives the motor for the specific number of steps at the selected speed.
[in] | ctx | : Click context object. See stepper14_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 stepper14_enable_device | ( | stepper14_t * | ctx | ) |
Stepper 14 enable device function.
This function enables the device by setting the ENABLE pin to high logic state.
[in] | ctx | : Click context object. See stepper14_t object definition for detailed explanation. |
uint8_t stepper14_get_fault_pin | ( | stepper14_t * | ctx | ) |
Stepper 14 get FAULT pin function.
This function returns the FAULT pin logic state.
[in] | ctx | : Click context object. See stepper14_t object definition for detailed explanation. |
err_t stepper14_init | ( | stepper14_t * | ctx, |
stepper14_cfg_t * | cfg ) |
Stepper 14 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See stepper14_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See stepper14_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper14_pca_read_reg | ( | stepper14_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
Stepper 14 pca read reg function.
This function reads data from the selected PCA9538A register by using I2C serial interface.
[in] | ctx | : Click context object. See stepper14_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 stepper14_pca_write_reg | ( | stepper14_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
Stepper 14 pca write reg function.
This function writes a desired data byte to the selected PCA9538A register by using I2C serial interface.
[in] | ctx | : Click context object. See stepper14_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. void stepper14_reset_pca | ( | stepper14_t * | ctx | ) |
Stepper 14 reset device function.
This function resets the PCA9538A device by toggling the RST pin.
[in] | ctx | : Click context object. See stepper14_t object definition for detailed explanation. |
void stepper14_set_direction | ( | stepper14_t * | ctx, |
uint8_t | dir ) |
Stepper 14 set direction function.
This function sets the motor direction to clockwise or counter-clockwise in ctx->direction.
[in] | ctx | : Click context object. See stepper14_t object definition for detailed explanation. |
[in] | dir | :
|
err_t stepper14_set_in1_pin | ( | stepper14_t * | ctx, |
uint8_t | state ) |
Stepper 14 set IN1 pin function.
This function sets the IN1 pin logic state.
[in] | ctx | : Click context object. See stepper14_t object definition for detailed explanation. |
[in] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper14_set_in2_pin | ( | stepper14_t * | ctx, |
uint8_t | state ) |
Stepper 14 set IN2 pin function.
This function sets the IN2 pin logic state.
[in] | ctx | : Click context object. See stepper14_t object definition for detailed explanation. |
[in] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper14_set_in3_pin | ( | stepper14_t * | ctx, |
uint8_t | state ) |
Stepper 14 set IN3 pin function.
This function sets the IN3 pin logic state.
[in] | ctx | : Click context object. See stepper14_t object definition for detailed explanation. |
[in] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper14_set_in4_pin | ( | stepper14_t * | ctx, |
uint8_t | state ) |
Stepper 14 set IN4 pin function.
This function sets the IN4 pin logic state.
[in] | ctx | : Click context object. See stepper14_t object definition for detailed explanation. |
[in] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper14_set_interface_mode | ( | stepper14_t * | ctx, |
uint8_t | mode ) |
Stepper 14 set interface mode function.
This function sets the interface mode settings in ctx->pin_mode.
[in] | ctx | : Click context object. See stepper14_t object definition for detailed explanation. |
[in] | mode | : Interface mode settings.
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepper14_set_mode_pin | ( | stepper14_t * | ctx, |
uint8_t | state ) |
Stepper 14 set MODE pin function.
This function sets the MODE pin logic state.
[in] | ctx | : Click context object. See stepper14_t object definition for detailed explanation. |
[in] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void stepper14_set_rst_pin | ( | stepper14_t * | ctx, |
uint8_t | state ) |
Stepper 14 set rst pin function.
This function sets the RST pin logic state.
[in] | ctx | : Click context object. See stepper14_t object definition for detailed explanation. |
[in] | state | :
|
void stepper14_set_step_mode | ( | stepper14_t * | ctx, |
uint8_t | mode ) |
Stepper 14 set step mode function.
This function sets the step mode resolution settings in ctx->step_mode.
[in] | ctx | : Click context object. See stepper14_t object definition for detailed explanation. |
[in] | mode | : Step mode resolution.
|
err_t stepper14_set_trq_pin | ( | stepper14_t * | ctx, |
uint8_t | state ) |
Stepper 14 set TRQ pin function.
This function sets the TRQ pin logic state.
[in] | ctx | : Click context object. See stepper14_t object definition for detailed explanation. |
[in] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void stepper14_switch_direction | ( | stepper14_t * | ctx | ) |
Stepper 14 switch direction function.
This function switches the motor direction in ctx->direction.
[in] | ctx | : Click context object. See stepper14_t object definition for detailed explanation. |