balancer4 2.0.0.0
Balancer 4 Click Driver

API for configuring and manipulating Balancer 4 Click driver. More...

Topics

 Balancer 4 Registers List
 List of registers of Balancer 4 Click driver.
 
 Balancer 4 Registers Settings
 Settings for registers of Balancer 4 Click driver.
 
 Balancer 4 MikroBUS Map
 MikroBUS pin mapping of Balancer 4 Click driver.
 

Functions

void balancer4_cfg_setup (balancer4_cfg_t *cfg)
 Balancer 4 configuration object setup function.
 
err_t balancer4_init (balancer4_t *ctx, balancer4_cfg_t *cfg)
 Balancer 4 initialization function.
 
err_t balancer4_default_cfg (balancer4_t *ctx)
 Balancer 4 default configuration function.
 
err_t balancer4_write_register (balancer4_t *ctx, uint8_t reg, uint8_t data_in)
 Balancer 4 write register function.
 
err_t balancer4_write_and_verify_register (balancer4_t *ctx, uint8_t reg, uint8_t data_in)
 Balancer 4 write and verify register function.
 
err_t balancer4_read_register (balancer4_t *ctx, uint8_t reg, uint8_t *data_out)
 Balancer 4 read register function.
 

Detailed Description

API for configuring and manipulating Balancer 4 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

◆ balancer4_cfg_setup()

void balancer4_cfg_setup ( balancer4_cfg_t * cfg)

Balancer 4 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ balancer4_default_cfg()

err_t balancer4_default_cfg ( balancer4_t * ctx)

Balancer 4 default configuration function.

This function executes a default configuration of Balancer 4 click board.

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

◆ balancer4_init()

err_t balancer4_init ( balancer4_t * ctx,
balancer4_cfg_t * cfg )

Balancer 4 initialization function.

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

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

◆ balancer4_read_register()

err_t balancer4_read_register ( balancer4_t * ctx,
uint8_t reg,
uint8_t * data_out )

Balancer 4 read register function.

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

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

◆ balancer4_write_and_verify_register()

err_t balancer4_write_and_verify_register ( balancer4_t * ctx,
uint8_t reg,
uint8_t data_in )

Balancer 4 write and verify register function.

This function writes a desired data byte to the selected register and verifies if is is written correctly by reading it.

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

◆ balancer4_write_register()

err_t balancer4_write_register ( balancer4_t * ctx,
uint8_t reg,
uint8_t data_in )

Balancer 4 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 balancer4_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.