hbridge12 2.1.0.0
|
API for configuring and manipulating H-Bridge 12 Click driver. More...
Topics | |
H-Bridge 12 Registers List | |
List of registers of H-Bridge 12 Click driver. | |
H-Bridge 12 Registers Settings | |
Settings for registers of H-Bridge 12 Click driver. | |
H-Bridge 12 MikroBUS Map | |
MikroBUS pin mapping of H-Bridge 12 Click driver. | |
Functions | |
void | hbridge12_cfg_setup (hbridge12_cfg_t *cfg) |
H-Bridge 12 configuration object setup function. | |
err_t | hbridge12_init (hbridge12_t *ctx, hbridge12_cfg_t *cfg) |
H-Bridge 12 initialization function. | |
err_t | hbridge12_default_cfg (hbridge12_t *ctx) |
H-Bridge 12 default configuration function. | |
void | hbridge12_set_rst (hbridge12_t *ctx, uint8_t pin_state) |
H-Bridge 12 set RST pin state function. | |
void | hbridge12_set_slp (hbridge12_t *ctx, uint8_t pin_state) |
H-Bridge 12 set SLP pin state function. | |
void | hbridge12_set_strobe (hbridge12_t *ctx, uint8_t pin_state) |
H-Bridge 12 set STB pin state function. | |
void | hbridge12_generate_strobe (hbridge12_t *ctx) |
H-Bridge 12 generate strobe signal function. | |
void | hbridge12_get_settings (hbridge12_t *ctx, uint8_t channel_sel, hbridge12_config_t *config_data) |
H-Bridge 12 get settings function. | |
void | hbridge12_set_settings (hbridge12_t *ctx, uint8_t channel_sel, hbridge12_config_t config_data) |
H-Bridge 12 set settings function. | |
err_t | hbridge12_write_config (hbridge12_t *ctx, hbridge12_config_t config_data) |
H-Bridge 12 write settings function. | |
void | hbridge12_set_current_scale (hbridge12_t *ctx, uint8_t channel_sel, uint8_t out1_curr_scale, uint8_t out2_curr_scale) |
H-Bridge 12 set current scale function. | |
void | hbridge12_set_decay (hbridge12_t *ctx, uint8_t channel_sel, uint8_t out1_decay, uint8_t out2_decay) |
H-Bridge 12 set decay function. | |
err_t | hbridge12_turn_clockwise (hbridge12_t *ctx, uint8_t channel_sel) |
H-Bridge 12 turn motor clockwise function. | |
err_t | hbridge12_turn_counterclockwise (hbridge12_t *ctx, uint8_t channel_sel) |
H-Bridge 12 turn motor counterclockwise function. | |
err_t | hbridge12_turn_brake_on (hbridge12_t *ctx, uint8_t channel_sel) |
H-Bridge 12 turn motor brake on function. | |
err_t | hbridge12_freewheeling_on (hbridge12_t *ctx, uint8_t channel_sel) |
H-Bridge 12 set motor into freewheeling mode function. | |
API for configuring and manipulating H-Bridge 12 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void hbridge12_cfg_setup | ( | hbridge12_cfg_t * | cfg | ) |
H-Bridge 12 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See hbridge12_cfg_t object definition for detailed explanation. |
err_t hbridge12_default_cfg | ( | hbridge12_t * | ctx | ) |
H-Bridge 12 default configuration function.
This function executes a default configuration of H-Bridge 12 click board.
[in] | ctx | : Click context object. See hbridge12_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hbridge12_freewheeling_on | ( | hbridge12_t * | ctx, |
uint8_t | channel_sel ) |
H-Bridge 12 set motor into freewheeling mode function.
This function writes the configuration to turn on freewheeling mode.
[in] | cfg | : Click configuration structure. See hbridge12_cfg_t object definition for detailed explanation. |
[in] | channel_sel | : Selection between AB and CD channels. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void hbridge12_generate_strobe | ( | hbridge12_t * | ctx | ) |
H-Bridge 12 generate strobe signal function.
This function is used to generate strobe signal to latch data into motor driver.
[out] | cfg | : Click configuration structure. See hbridge12_cfg_t object definition for detailed explanation. |
void hbridge12_get_settings | ( | hbridge12_t * | ctx, |
uint8_t | channel_sel, | ||
hbridge12_config_t * | config_data ) |
H-Bridge 12 get settings function.
This function reads settings that are written into a register.
[in] | cfg | : Click configuration structure. See hbridge12_cfg_t object definition for detailed explanation. |
[in] | channel_sel | : Selection between AB and CD channels. |
[out] | config_data | : Written configuration data. |
err_t hbridge12_init | ( | hbridge12_t * | ctx, |
hbridge12_cfg_t * | cfg ) |
H-Bridge 12 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See hbridge12_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See hbridge12_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void hbridge12_set_current_scale | ( | hbridge12_t * | ctx, |
uint8_t | channel_sel, | ||
uint8_t | out1_curr_scale, | ||
uint8_t | out2_curr_scale ) |
H-Bridge 12 set current scale function.
This function writes the current scale configuration of the selected channel H-Bridge 12 click board.
[in] | cfg | : Click configuration structure. See hbridge12_cfg_t object definition for detailed explanation. |
[in] | channel_sel | : Selection between AB and CD channels. |
[in] | out1_curr_scale | : Output 1 current scale. |
[in] | out2_curr_scale | : Output 2 current scale. |
void hbridge12_set_decay | ( | hbridge12_t * | ctx, |
uint8_t | channel_sel, | ||
uint8_t | out1_decay, | ||
uint8_t | out2_decay ) |
H-Bridge 12 set decay function.
This function writes the decay configuration of the selected channel H-Bridge 12 click board.
[in] | cfg | : Click configuration structure. See hbridge12_cfg_t object definition for detailed explanation. |
[in] | channel_sel | : Selection between AB and CD channels. |
[in] | out1_curr_scale | : Output 1 decay. |
[in] | out2_curr_scale | : Output 2 decay. |
void hbridge12_set_rst | ( | hbridge12_t * | ctx, |
uint8_t | pin_state ) |
H-Bridge 12 set RST pin state function.
This function sets the seleccted state of the RST pin.
[in] | cfg | : Click configuration structure. See hbridge12_cfg_t object definition for detailed explanation. |
[in] | pin_state | : State of the RST pin. |
void hbridge12_set_settings | ( | hbridge12_t * | ctx, |
uint8_t | channel_sel, | ||
hbridge12_config_t | config_data ) |
H-Bridge 12 set settings function.
This function writes settings for configuration of H-Bridge 12 click board into structure.
[in] | cfg | : Click configuration structure. See hbridge12_cfg_t object definition for detailed explanation. |
[in] | channel_sel | : Selection between AB and CD channels. |
[in] | config_data | : Written configuration data. |
void hbridge12_set_slp | ( | hbridge12_t * | ctx, |
uint8_t | pin_state ) |
H-Bridge 12 set SLP pin state function.
This function sets the seleccted state of the SLP pin.
[in] | cfg | : Click configuration structure. See hbridge12_cfg_t object definition for detailed explanation. |
[in] | pin_state | : State of the SLP pin. |
void hbridge12_set_strobe | ( | hbridge12_t * | ctx, |
uint8_t | pin_state ) |
H-Bridge 12 set STB pin state function.
This function sets the seleccted state of the STB pin.
[in] | cfg | : Click configuration structure. See hbridge12_cfg_t object definition for detailed explanation. |
[in] | pin_state | : State of the STB pin. |
err_t hbridge12_turn_brake_on | ( | hbridge12_t * | ctx, |
uint8_t | channel_sel ) |
H-Bridge 12 turn motor brake on function.
This function writes the configuration to turn the motor brake on.
[in] | cfg | : Click configuration structure. See hbridge12_cfg_t object definition for detailed explanation. |
[in] | channel_sel | : Selection between AB and CD channels. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hbridge12_turn_clockwise | ( | hbridge12_t * | ctx, |
uint8_t | channel_sel ) |
H-Bridge 12 turn motor clockwise function.
This function writes the configuration to turn the motor in clockwise direction.
[in] | cfg | : Click configuration structure. See hbridge12_cfg_t object definition for detailed explanation. |
[in] | channel_sel | : Selection between AB and CD channels. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hbridge12_turn_counterclockwise | ( | hbridge12_t * | ctx, |
uint8_t | channel_sel ) |
H-Bridge 12 turn motor counterclockwise function.
This function writes the configuration to turn the motor in counterclockwise direction.
[in] | cfg | : Click configuration structure. See hbridge12_cfg_t object definition for detailed explanation. |
[in] | channel_sel | : Selection between AB and CD channels. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hbridge12_write_config | ( | hbridge12_t * | ctx, |
hbridge12_config_t | config_data ) |
H-Bridge 12 write settings function.
This function writes settings for configuration of H-Bridge 12 click board.
[in] | cfg | : Click configuration structure. See hbridge12_cfg_t object definition for detailed explanation. |
[in] | config_data | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.