hbridge12 2.1.0.0
H-Bridge 12 Click Driver

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.
 

Detailed Description

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.

Function Documentation

◆ hbridge12_cfg_setup()

void hbridge12_cfg_setup ( hbridge12_cfg_t * cfg)

H-Bridge 12 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See hbridge12_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ hbridge12_default_cfg()

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.

Parameters
[in]ctx: Click context object. See hbridge12_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ hbridge12_freewheeling_on()

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.

Parameters
[in]cfg: Click configuration structure. See hbridge12_cfg_t object definition for detailed explanation.
[in]channel_sel: Selection between AB and CD channels.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ hbridge12_generate_strobe()

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.

Parameters
[out]cfg: Click configuration structure. See hbridge12_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ hbridge12_get_settings()

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.

Parameters
[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.
Returns
Nothing.
Note
None.

◆ hbridge12_init()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ hbridge12_set_current_scale()

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.

Parameters
[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.
Returns
Nothing.
Note
None.

◆ hbridge12_set_decay()

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.

Parameters
[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.
Returns
Nothing.
Note
None.

◆ hbridge12_set_rst()

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.

Parameters
[in]cfg: Click configuration structure. See hbridge12_cfg_t object definition for detailed explanation.
[in]pin_state: State of the RST pin.
Returns
Nothing.
Note
None.

◆ hbridge12_set_settings()

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.

Parameters
[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.
Returns
Nothing.
Note
None.

◆ hbridge12_set_slp()

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.

Parameters
[in]cfg: Click configuration structure. See hbridge12_cfg_t object definition for detailed explanation.
[in]pin_state: State of the SLP pin.
Returns
Nothing.
Note
None.

◆ hbridge12_set_strobe()

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.

Parameters
[in]cfg: Click configuration structure. See hbridge12_cfg_t object definition for detailed explanation.
[in]pin_state: State of the STB pin.
Returns
Nothing.
Note
None.

◆ hbridge12_turn_brake_on()

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.

Parameters
[in]cfg: Click configuration structure. See hbridge12_cfg_t object definition for detailed explanation.
[in]channel_sel: Selection between AB and CD channels.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ hbridge12_turn_clockwise()

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.

Parameters
[in]cfg: Click configuration structure. See hbridge12_cfg_t object definition for detailed explanation.
[in]channel_sel: Selection between AB and CD channels.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ hbridge12_turn_counterclockwise()

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.

Parameters
[in]cfg: Click configuration structure. See hbridge12_cfg_t object definition for detailed explanation.
[in]channel_sel: Selection between AB and CD channels.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ hbridge12_write_config()

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.

Parameters
[in]cfg: Click configuration structure. See hbridge12_cfg_t object definition for detailed explanation.
[in]config_data: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.