battmon4 2.0.0.0
battmon4.h File Reference

This file contains API for BATT-MON 4 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  battmon4_t
 BATT-MON 4 Click context object. More...
 
struct  battmon4_cfg_t
 BATT-MON 4 Click configuration object. More...
 

Macros

#define BATTMON4_REG_A   0x01
 BATT-MON 4 Register Map.
 
#define BATTMON4_REG_B   0x02
 
#define BATTMON4_REG_C   0x03
 
#define BATTMON4_REG_D   0x04
 
#define BATTMON4_REG_E   0x05
 
#define BATTMON4_REG_F   0x06
 
#define BATTMON4_REG_G   0x07
 
#define BATTMON4_REG_H   0x08
 
#define BATTMON4_TEMPERATURE_LSB   0.784
 BATT-MON 4 calculation values.
 
#define BATTMON4_TEMPERATURE_OFFSET   41.0
 
#define BATTMON4_TEMPERATURE_RESOLUTION   0x00FF
 
#define BATTMON4_VOLTAGE_LSB   1.465
 
#define BATTMON4_VOLTAGE_RESOLUTION   0x0FFF
 
#define BATTMON4_DEVICE_ADDRESS   0x64
 BATT-MON 4 device address setting.
 
#define BATTMON4_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  battmon4_return_value_t { BATTMON4_OK = 0 , BATTMON4_ERROR = -1 }
 BATT-MON 4 Click return value data. More...
 

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

This file contains API for BATT-MON 4 Click Driver.

Enumeration Type Documentation

◆ battmon4_return_value_t

BATT-MON 4 Click return value data.

Predefined enum values for driver return values.

Enumerator
BATTMON4_OK 
BATTMON4_ERROR