hbridge8 2.0.0.0
H-Bridge 8 Click Driver

API for configuring and manipulating H-Bridge 8 Click driver. More...

Topics

 H-Bridge 8 PWM Settings
 Settings for configuration of H-Bridge 8 Click driver.
 
 H-Bridge 8 MikroBUS Map
 MikroBUS pin mapping of H-Bridge 8 Click driver.
 
 Mode
 
 Hbridge8_cfg
 

Functions

void hbridge8_cfg_setup (hbridge8_cfg_t *cfg)
 H-Bridge 8 configuration object setup function.
 
err_t hbridge8_init (hbridge8_t *ctx, hbridge8_cfg_t *cfg)
 H-Bridge 8 initialization function.
 
err_t hbridge8_default_cfg (hbridge8_t *ctx)
 H-Bridge 8 default configuration function.
 
err_t hbridge8_set_duty_cycle (hbridge8_t *ctx, float duty_cycle)
 H-Bridge 8 sets PWM duty cycle.
 
err_t hbridge8_pwm_stop (hbridge8_t *ctx)
 H-Bridge 8 stop PWM module.
 
err_t hbridge8_pwm_start (hbridge8_t *ctx)
 H-Bridge 8 start PWM module.
 
err_t hbridge8_set_mode (hbridge8_t *ctx, uint8_t mode)
 H-Bridge 8 set operating mode function.
 
err_t hbridge8_enable (hbridge8_t *ctx)
 H-Bridge 8 set IC enable function.
 
err_t hbridge8_disable (hbridge8_t *ctx)
 H-Bridge 8 set IC disable function.
 
uint8_t hbridge8_get_fault_indication (hbridge8_t *ctx)
 H-Bridge 8 get fault indication function.
 

Detailed Description

API for configuring and manipulating H-Bridge 8 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

◆ hbridge8_cfg_setup()

void hbridge8_cfg_setup ( hbridge8_cfg_t * cfg)

H-Bridge 8 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ hbridge8_default_cfg()

err_t hbridge8_default_cfg ( hbridge8_t * ctx)

H-Bridge 8 default configuration function.

This function executes a default configuration of H-Bridge 8 click board.

Parameters
[in]ctx: Click context object. See hbridge8_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.

◆ hbridge8_disable()

err_t hbridge8_disable ( hbridge8_t * ctx)

H-Bridge 8 set IC disable function.

This function sets the IC disable of the H-Bridge 8 click board™.

Parameters
[out]ctx: Click context object. See hbridge8_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ hbridge8_enable()

err_t hbridge8_enable ( hbridge8_t * ctx)

H-Bridge 8 set IC enable function.

This function sets the IC enable of the H-Bridge 8 click board™.

Parameters
[out]ctx: Click context object. See hbridge8_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ hbridge8_get_fault_indication()

uint8_t hbridge8_get_fault_indication ( hbridge8_t * ctx)

H-Bridge 8 get fault indication function.

This function get fault indication of the H-Bridge 8 click board™.

Parameters
[out]ctx: Click context object. See hbridge8_t object definition for detailed explanation.
Returns
  • 0 - Fault conditions,
  • 1 - Normal conditions.
See #err_t definition for detailed explanation.
Note
None.

◆ hbridge8_init()

err_t hbridge8_init ( hbridge8_t * ctx,
hbridge8_cfg_t * cfg )

H-Bridge 8 initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See hbridge8_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See hbridge8_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ hbridge8_pwm_start()

err_t hbridge8_pwm_start ( hbridge8_t * ctx)

H-Bridge 8 start PWM module.

This function starts the PWM moudle output.

Parameters
[out]ctx: Click context object. See hbridge8_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ hbridge8_pwm_stop()

err_t hbridge8_pwm_stop ( hbridge8_t * ctx)

H-Bridge 8 stop PWM module.

This function stops the PWM moudle output.

Parameters
[out]ctx: Click context object. See hbridge8_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ hbridge8_set_duty_cycle()

err_t hbridge8_set_duty_cycle ( hbridge8_t * ctx,
float duty_cycle )

H-Bridge 8 sets PWM duty cycle.

This function sets the PWM duty cycle in percentages ( Range[ 0..1 ] ).

Parameters
[out]ctx: Click context object. See hbridge8_t object definition for detailed explanation.
[in]duty_ratio: PWM duty_ratio.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ hbridge8_set_mode()

err_t hbridge8_set_mode ( hbridge8_t * ctx,
uint8_t mode )

H-Bridge 8 set operating mode function.

This function sets the desired operating mode of the H-Bridge 8 click board™.

Parameters
[out]ctx: Click context object. See hbridge8_t object definition for detailed explanation.
[in]mode: Operating mode.
  • 0 ( HBRIDGE8_MODE_REVERSE ) - Drive the motor reverse,
  • 1 ( HBRIDGE8_MODE_FORWARD ) - Drive the motor forward.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.