battmon4 2.0.0.0
BATT-MON 4 Click Driver

API for configuring and manipulating BATT-MON 4 Click driver. More...

Topics

 BATT-MON 4 Registers List
 List of registers of BATT-MON 4 Click driver.
 
 BATT-MON 4 Registers Settings
 Settings for registers of BATT-MON 4 Click driver.
 
 BATT-MON 4 MikroBUS Map
 MikroBUS pin mapping of BATT-MON 4 Click driver.
 

Functions

void battmon4_cfg_setup (battmon4_cfg_t *cfg)
 BATT-MON 4 configuration object setup function.
 
err_t battmon4_init (battmon4_t *ctx, battmon4_cfg_t *cfg)
 BATT-MON 4 initialization function.
 
err_t battmon4_write_register (battmon4_t *ctx, uint8_t reg, uint16_t data_in)
 BATT-MON 4 write register function.
 
err_t battmon4_read_register (battmon4_t *ctx, uint8_t reg, uint16_t *data_out)
 BATT-MON 4 read register function.
 
err_t battmon4_get_die_temperature (battmon4_t *ctx, float *temperature)
 BATT-MON 4 get die temperature function.
 
err_t battmon4_get_batt_in_voltage (battmon4_t *ctx, float *v_ipeak_on, float *v_ipeak_off)
 BATT-MON 4 get batt in voltage function.
 
err_t battmon4_get_batt_out_voltage (battmon4_t *ctx, float *v_ipeak_on, float *v_ipeak_off)
 BATT-MON 4 get batt out voltage function.
 
uint8_t battmon4_get_bok_pin (battmon4_t *ctx)
 BATT-MON 4 get bok pin function.
 
uint8_t battmon4_get_int_pin (battmon4_t *ctx)
 BATT-MON 4 get int pin function.
 

Detailed Description

API for configuring and manipulating BATT-MON 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

◆ battmon4_cfg_setup()

void battmon4_cfg_setup ( battmon4_cfg_t * cfg)

BATT-MON 4 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ battmon4_get_batt_in_voltage()

err_t battmon4_get_batt_in_voltage ( battmon4_t * ctx,
float * v_ipeak_on,
float * v_ipeak_off )

BATT-MON 4 get batt in voltage function.

This function reads the voltage from BATT IN when Ipeak is ON and OFF.

Parameters
[in]ctx: Click context object. See battmon4_t object definition for detailed explanation.
[out]v_ipeak_on: BATT IN voltage in millivolts when Ipeak is ON.
[out]v_ipeak_off: BATT IN voltage in millivolts when Ipeak is OFF.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ battmon4_get_batt_out_voltage()

err_t battmon4_get_batt_out_voltage ( battmon4_t * ctx,
float * v_ipeak_on,
float * v_ipeak_off )

BATT-MON 4 get batt out voltage function.

This function reads the voltage from BATT OUT when Ipeak is ON and OFF.

Parameters
[in]ctx: Click context object. See battmon4_t object definition for detailed explanation.
[out]v_ipeak_on: BATT OUT voltage in millivolts when Ipeak is ON.
[out]v_ipeak_off: BATT OUT voltage in millivolts when Ipeak is OFF.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ battmon4_get_bok_pin()

uint8_t battmon4_get_bok_pin ( battmon4_t * ctx)

BATT-MON 4 get bok pin function.

This function returns the BOK (Battery OK) pin logic state.

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

◆ battmon4_get_die_temperature()

err_t battmon4_get_die_temperature ( battmon4_t * ctx,
float * temperature )

BATT-MON 4 get die temperature function.

This function reads the chip DIE temperature in Celsius.

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

◆ battmon4_get_int_pin()

uint8_t battmon4_get_int_pin ( battmon4_t * ctx)

BATT-MON 4 get int pin function.

This function returns the INT pin logic state.

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

◆ battmon4_init()

err_t battmon4_init ( battmon4_t * ctx,
battmon4_cfg_t * cfg )

BATT-MON 4 initialization function.

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

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

◆ battmon4_read_register()

err_t battmon4_read_register ( battmon4_t * ctx,
uint8_t reg,
uint16_t * data_out )

BATT-MON 4 read register function.

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

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

◆ battmon4_write_register()

err_t battmon4_write_register ( battmon4_t * ctx,
uint8_t reg,
uint16_t data_in )

BATT-MON 4 write register function.

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

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