charger2  2.0.0.0
Data Structures | Macros | Functions
charger2.h File Reference

This file contains API for Charger 2 Click driver. More...

#include "mikrosdk_version.h"
#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  charger2_t
 Click ctx object definition. More...
 
struct  charger2_cfg_t
 Click configuration structure definition. More...
 

Macros

#define CHARGER2_MAP_MIKROBUS(cfg, mikrobus)
 
#define CHARGER2_RETVAL   uint8_t
 
#define CHARGER2_OK   0x00
 
#define CHARGER2_INIT_ERROR   0xFF
 
#define R_SHUNT   0.05
 
#define CHARGER2_REG_MODE   0x00
 
#define CHARGER2_REG_CONTROL   0x01
 
#define CHARGER2_REG_CHARGE_LOW   0x02
 
#define CHARGER2_REG_CHARGE_HIGH   0x03
 
#define CHARGER2_REG_COUNTER_LOW   0x04
 
#define CHARGER2_REG_COUNTER_HIGH   0x05
 
#define CHARGER2_REG_CURRENT_LOW   0x06
 
#define CHARGER2_REG_CURRENT_HIGH   0x07
 
#define CHARGER2_REG_VOLTAGE_LOW   0x08
 
#define CHARGER2_REG_VOLTAGE_HIGH   0x09
 
#define CHARGER2_REG_TEMPERATURE_LOW   0x0A
 
#define CHARGER2_REG_TEMPERATURE_HIGH   0x0B
 
#define CHARGER2_REG_ID0   0x18
 
#define CHARGER2_REG_ID1   0x19
 
#define CHARGER2_REG_ID2   0x1A
 
#define CHARGER2_REG_ID3   0x1B
 
#define CHARGER2_REG_ID4   0x1C
 
#define CHARGER2_REG_ID5   0x1D
 
#define CHARGER2_REG_ID6   0x1E
 
#define CHARGER2_REG_ID7   0x1F
 
#define CHARGER2_REG_RAM0   0x20
 
#define CHARGER2_REG_RAM1   0x21
 
#define CHARGER2_REG_RAM2   0x22
 
#define CHARGER2_REG_RAM3   0x23
 
#define CHARGER2_REG_RAM4   0x24
 
#define CHARGER2_REG_RAM5   0x25
 
#define CHARGER2_REG_RAM6   0x26
 
#define CHARGER2_REG_RAM7   0x27
 
#define CHARGER2_REG_RAM8   0x28
 
#define CHARGER2_REG_RAM9   0x29
 
#define CHARGER2_REG_RAM10   0x2A
 
#define CHARGER2_REG_RAM11   0x2B
 
#define CHARGER2_REG_RAM12   0x2C
 
#define CHARGER2_REG_RAM13   0x2D
 
#define CHARGER2_REG_RAM14   0x2E
 
#define CHARGER2_REG_RAM15   0x2F
 
#define CHARGER2_REG_RAM16   0x30
 
#define CHARGER2_REG_RAM17   0x31
 
#define CHARGER2_REG_RAM18   0x32
 
#define CHARGER2_REG_RAM19   0x33
 
#define CHARGER2_REG_RAM20   0x34
 
#define CHARGER2_REG_RAM21   0x35
 
#define CHARGER2_REG_RAM22   0x36
 
#define CHARGER2_REG_RAM23   0x37
 
#define CHARGER2_REG_RAM24   0x38
 
#define CHARGER2_REG_RAM25   0x39
 
#define CHARGER2_REG_RAM26   0x3A
 
#define CHARGER2_REG_RAM27   0x3B
 
#define CHARGER2_REG_RAM28   0x3C
 
#define CHARGER2_REG_RAM29   0x3D
 
#define CHARGER2_REG_RAM30   0x3E
 
#define CHARGER2_REG_RAM31   0x3F
 
#define CHARGER2_AUTO_DETECT   0x00
 
#define CHARGER2_EXTERNAL_CLOCK   0x01
 
#define CHARGER2_14_BITS_RESOLUTION   0x00
 
#define CHARGER2_13_BITS_RESOLUTION   0x02
 
#define CHARGER2_12_BITS_RESOLUTION   0x04
 
#define CHARGER2_CALIBRATE_ADC   0x08
 
#define CHARGER2_STANDBY_MODE   0x00
 
#define CHARGER2_OPERATING_MODE   0x10
 
#define CHARGER2_IO0_OUTPUT_LOW   0x00
 
#define CHARGER2_IO0_OUTPUT_OPEN   0x01
 
#define CHARGER2_RESET_CHARGE_ACCUM_AND_COUNTER   0x02
 
#define CHARGER2_RELEASE_SOFT_RESET   0x00
 
#define CHARGER2_ASSERT_SOFT_RESET   0x10
 
#define CHARGER2_RESET_COUNTER_MODE   0x00
 
#define CHARGER2_SOFT_RESET_MODE   0x01
 
#define CHARGER2_CURRENT_CYCLE_CHECK   0x00
 
#define CHARGER2_VOLTAGE_TEMP_CYCLE_CHECK   0x01
 
#define CHARGER2_GAS_GAUGE_CHARGE_DATA   0x00
 
#define CHARGER2_CONV_NUMBER   0x01
 
#define CHARGER2_SHUNT_VOLTAGE   0x02
 
#define CHARGER2_BATTERY_VOLTAGE   0x03
 
#define CHARGER2_TEMPERATURE   0x04
 
#define CHARGER2_BATTERY_CURRENT   0x05
 

Functions

void charger2_cfg_setup (charger2_cfg_t *cfg)
 Config Object Initialization function. More...
 
CHARGER2_RETVAL charger2_init (charger2_t *ctx, charger2_cfg_t *cfg)
 Initialization function. More...
 
void charger2_generic_write (charger2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function. More...
 
void charger2_generic_read (charger2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function. More...
 
uint8_t charger2_write_reg (charger2_t *ctx, uint8_t register_address, uint8_t transfer_data)
 Write reg function. More...
 
uint8_t charger2_read_reg (charger2_t *ctx, uint8_t register_address, uint8_t *value_out, uint8_t n_bytes)
 Read reg function. More...
 
uint8_t charger2_read_data (charger2_t *ctx, uint8_t data_mode, uint32_t *data_out)
 Data Read function. More...
 
uint8_t charger2_reset (charger2_t *ctx, uint8_t reset_mode)
 Reset function. More...
 
uint8_t charger2_check_conv_cycle (charger2_t *ctx, uint8_t conv_mode)
 Conversion Cycle Check function. More...
 

Detailed Description

This file contains API for Charger 2 Click driver.