hbridge15 2.1.0.0
H-Bridge 15 Click Driver

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

Topics

 H-Bridge 15 Registers List
 List of registers of H-Bridge 15 Click driver.
 
 H-Bridge 15 Registers Settings
 Settings for registers of H-Bridge 15 Click driver.
 
 H-Bridge 15 MikroBUS Map
 MikroBUS pin mapping of H-Bridge 15 Click driver.
 

Functions

void hbridge15_cfg_setup (hbridge15_cfg_t *cfg)
 H-Bridge 15 configuration object setup function.
 
err_t hbridge15_init (hbridge15_t *ctx, hbridge15_cfg_t *cfg)
 H-Bridge 15 initialization function.
 
err_t hbridge15_default_cfg (hbridge15_t *ctx)
 H-Bridge 15 default configuration function.
 
err_t hbridge15_generic_write (hbridge15_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 H-Bridge 15 I2C writing function.
 
err_t hbridge15_generic_read (hbridge15_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 H-Bridge 15 I2C reading function.
 
void hbridge15_set_rst_pin (hbridge15_t *ctx, uint8_t pin_state)
 H-Bridge 15 set RST pin function.
 
void hbridge15_set_ena_pin (hbridge15_t *ctx, uint8_t pin_state)
 H-Bridge 15 set ENA pin function.
 
uint8_t hbridge15_get_int_state (hbridge15_t *ctx)
 H-Bridge 15 get INT pin state function.
 
void hbridge15_reset_port_exp (hbridge15_t *ctx)
 H-Bridge 15 reset port expander function.
 
err_t hbridge15_write_reg (hbridge15_t *ctx, uint8_t reg, uint8_t data_in)
 H-Bridge 15 write register function.
 
err_t hbridge15_read_reg (hbridge15_t *ctx, uint8_t reg, uint8_t *data_out)
 H-Bridge 15 read register function.
 
err_t hbridge15_set_pins (hbridge15_t *ctx, uint8_t set_mask, uint8_t clr_mask)
 H-Bridge 15 set pins function.
 
err_t hbridge15_set_sleep (hbridge15_t *ctx, uint8_t sleep_state)
 H-Bridge 15 set sleep function.
 
err_t hbridge15_set_out_state (hbridge15_t *ctx, uint8_t out_state)
 H-Bridge 15 set output function.
 

Detailed Description

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

◆ hbridge15_cfg_setup()

void hbridge15_cfg_setup ( hbridge15_cfg_t * cfg)

H-Bridge 15 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ hbridge15_default_cfg()

err_t hbridge15_default_cfg ( hbridge15_t * ctx)

H-Bridge 15 default configuration function.

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

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

◆ hbridge15_generic_read()

err_t hbridge15_generic_read ( hbridge15_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

H-Bridge 15 I2C reading function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See hbridge15_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ hbridge15_generic_write()

err_t hbridge15_generic_write ( hbridge15_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

H-Bridge 15 I2C writing function.

This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See hbridge15_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ hbridge15_get_int_state()

uint8_t hbridge15_get_int_state ( hbridge15_t * ctx)

H-Bridge 15 get INT pin state function.

This function is used to get INT pin state.

Parameters
[in]ctx: Click context object. See hbridge15_t object definition for detailed explanation.
Returns
Interrupt pin state.
Note
None.

◆ hbridge15_init()

err_t hbridge15_init ( hbridge15_t * ctx,
hbridge15_cfg_t * cfg )

H-Bridge 15 initialization function.

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

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

◆ hbridge15_read_reg()

err_t hbridge15_read_reg ( hbridge15_t * ctx,
uint8_t reg,
uint8_t * data_out )

H-Bridge 15 read register function.

This function reads data from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See hbridge15_t object definition for detailed explanation.
[in]reg: Register address.
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ hbridge15_reset_port_exp()

void hbridge15_reset_port_exp ( hbridge15_t * ctx)

H-Bridge 15 reset port expander function.

This function resets the port expander by toggling the RST pin.

Parameters
[in]ctx: Click context object. See hbridge15_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ hbridge15_set_ena_pin()

void hbridge15_set_ena_pin ( hbridge15_t * ctx,
uint8_t pin_state )

H-Bridge 15 set ENA pin function.

This function is used to set state of the ENA pin.

Parameters
[in]ctx: Click context object. See hbridge15_t object definition for detailed explanation.
[in]pin_state: Pin state.
Returns
None.
Note
None.

◆ hbridge15_set_out_state()

err_t hbridge15_set_out_state ( hbridge15_t * ctx,
uint8_t out_state )

H-Bridge 15 set output function.

This function is used to set output state of the H-Bridge 15 click board.

Parameters
[in]ctx: Click context object. See hbridge15_t object definition for detailed explanation.
[in]out_state: Output state.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ hbridge15_set_pins()

err_t hbridge15_set_pins ( hbridge15_t * ctx,
uint8_t set_mask,
uint8_t clr_mask )

H-Bridge 15 set pins function.

This function sets and clears the value of the selected pins of PCA9538A port expander.

Parameters
[in]ctx: Click context object. See hbridge15_t object definition for detailed explanation.
[in]clr_mask: Pin clear mask.
[in]set_mask: Pin set mask.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ hbridge15_set_rst_pin()

void hbridge15_set_rst_pin ( hbridge15_t * ctx,
uint8_t pin_state )

H-Bridge 15 set RST pin function.

This function is used to set state of the RST pin.

Parameters
[in]ctx: Click context object. See hbridge15_t object definition for detailed explanation.
[in]pin_state: Pin state.
Returns
None.
Note
None.

◆ hbridge15_set_sleep()

err_t hbridge15_set_sleep ( hbridge15_t * ctx,
uint8_t sleep_state )

H-Bridge 15 set sleep function.

This function is used to set sleep state of the H-Bridge 15 click board.

Parameters
[in]ctx: Click context object. See hbridge15_t object definition for detailed explanation.
[in]sleep_state: Sleep state.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ hbridge15_write_reg()

err_t hbridge15_write_reg ( hbridge15_t * ctx,
uint8_t reg,
uint8_t data_in )

H-Bridge 15 write register function.

This function writes a desired data byte to the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See hbridge15_t object definition for detailed explanation.
[in]reg: Register address.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.