hbridge 2.1.0.0
|
API for configuring and manipulating H-Bridge Click driver. More...
Topics | |
H-Bridge Registers Settings | |
Settings for registers of H-Bridge Click driver. | |
H-Bridge MikroBUS Map | |
MikroBUS pin mapping of H-Bridge Click driver. | |
Functions | |
void | hbridge_cfg_setup (hbridge_cfg_t *cfg) |
H-Bridge configuration object setup function. | |
err_t | hbridge_init (hbridge_t *ctx, hbridge_cfg_t *cfg) |
H-Bridge initialization function. | |
void | hbridge_set_in1a_pin (hbridge_t *ctx, uint8_t state) |
H-Bridge set in1a pin function. | |
void | hbridge_set_in2a_pin (hbridge_t *ctx, uint8_t state) |
H-Bridge set in2a pin function. | |
void | hbridge_set_in1b_pin (hbridge_t *ctx, uint8_t state) |
H-Bridge set in1b pin function. | |
void | hbridge_set_in2b_pin (hbridge_t *ctx, uint8_t state) |
H-Bridge set in2b pin function. | |
void | hbridge_set_step_mode (hbridge_t *ctx, uint8_t mode) |
H-Bridge set step mode function. | |
void | hbridge_set_direction (hbridge_t *ctx, uint8_t dir) |
H-Bridge set direction function. | |
void | hbridge_switch_direction (hbridge_t *ctx) |
H-Bridge switch direction function. | |
void | hbridge_enable_device (hbridge_t *ctx) |
H-Bridge enable device function. | |
void | hbridge_disable_device (hbridge_t *ctx) |
H-Bridge disable device function. | |
void | hbridge_drive_motor (hbridge_t *ctx, uint32_t steps, uint8_t speed) |
H-Bridge driver motor function. | |
API for configuring and manipulating H-Bridge Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void hbridge_cfg_setup | ( | hbridge_cfg_t * | cfg | ) |
H-Bridge configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See hbridge_cfg_t object definition for detailed explanation. |
void hbridge_disable_device | ( | hbridge_t * | ctx | ) |
H-Bridge disable device function.
This function disables the device by setting all pins to high logic state.
[in] | ctx | : Click context object. See hbridge_t object definition for detailed explanation. |
void hbridge_drive_motor | ( | hbridge_t * | ctx, |
uint32_t | steps, | ||
uint8_t | speed ) |
H-Bridge driver motor function.
This function drives the motor for the specific number of steps at the selected speed.
[in] | ctx | : Click context object. See hbridge_t object definition for detailed explanation. |
[in] | steps | : Number of steps to rotate motor. |
[in] | speed | : Motor rotation speed:
|
void hbridge_enable_device | ( | hbridge_t * | ctx | ) |
H-Bridge enable device function.
This function enables the device by setting all pins to low logic state.
[in] | ctx | : Click context object. See hbridge_t object definition for detailed explanation. |
err_t hbridge_init | ( | hbridge_t * | ctx, |
hbridge_cfg_t * | cfg ) |
H-Bridge initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See hbridge_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See hbridge_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void hbridge_set_direction | ( | hbridge_t * | ctx, |
uint8_t | dir ) |
H-Bridge set direction function.
This function sets the motor direction to clockwise or counter-clockwise in ctx->direction.
[in] | ctx | : Click context object. See hbridge_t object definition for detailed explanation. |
[in] | dir | :
|
void hbridge_set_in1a_pin | ( | hbridge_t * | ctx, |
uint8_t | state ) |
H-Bridge set in1a pin function.
This function sets the IN1A pin logic state.
[in] | ctx | : Click context object. See hbridge_t object definition for detailed explanation. |
[in] | state | :
|
void hbridge_set_in1b_pin | ( | hbridge_t * | ctx, |
uint8_t | state ) |
H-Bridge set in1b pin function.
This function sets the IN1B pin logic state.
[in] | ctx | : Click context object. See hbridge_t object definition for detailed explanation. |
[in] | state | :
|
void hbridge_set_in2a_pin | ( | hbridge_t * | ctx, |
uint8_t | state ) |
H-Bridge set in2a pin function.
This function sets the IN2A pin logic state.
[in] | ctx | : Click context object. See hbridge_t object definition for detailed explanation. |
[in] | state | :
|
void hbridge_set_in2b_pin | ( | hbridge_t * | ctx, |
uint8_t | state ) |
H-Bridge set in2b pin function.
This function sets the IN2B pin logic state.
[in] | ctx | : Click context object. See hbridge_t object definition for detailed explanation. |
[in] | state | :
|
void hbridge_set_step_mode | ( | hbridge_t * | ctx, |
uint8_t | mode ) |
H-Bridge set step mode function.
This function sets the step mode resolution settings in ctx->step_mode.
[in] | ctx | : Click context object. See hbridge_t object definition for detailed explanation. |
[in] | mode | : Step mode resolution.
|