no-OS
Classes | Macros | Enumerations | Functions
ltc4162l.h File Reference
#include <stdint.h>
#include <string.h>
#include "no_os_util.h"
#include "no_os_i2c.h"
Include dependency graph for ltc4162l.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ltc4162l_desc
 LTC4162L descriptor. More...
 
struct  ltc4162l_init_param
 LTC4162L init param. More...
 
struct  ltc4162l_chip_info
 LTC4162L chip info. More...
 

Macros

#define LTC4162L_EN_LIMIT_ALERTS_REG   0x0D
 
#define LTC4162L_EN_CHARGER_STATE_ALERTS_REG   0x0E
 
#define LTC4162L_EN_CHARGE_STATUS_ALERTS_REG   0x0F
 
#define LTC4162L_CONFIG_BITS_REG   0x14
 
#define LTC4162L_IIN_LIMIT_TARGET   0x15
 
#define LTC4162L_ARM_SHIP_MODE   0x19
 
#define LTC4162L_CHARGE_CURRENT_SETTING   0X1A
 
#define LTC4162L_VCHARGE_SETTING   0X1B
 
#define LTC4162L_C_OVER_X_THRESHOLD   0x1C
 
#define LTC4162L_MAX_CV_TIME   0X1D
 
#define LTC4162L_MAX_CHARGE_TIME   0X1E
 
#define LTC4162L_CHARGER_CONFIG   0x29
 
#define LTC4162L_CHARGER_STATE   0x34
 
#define LTC4162L_CHARGE_STATUS   0x35
 
#define LTC4162L_LIMIT_ALERTS_REG   0x36
 
#define LTC4162L_CHARGER_STATE_ALERTS_REG   0x37
 
#define LTC4162L_CHARGE_STATUS_ALERTS_REG   0x38
 
#define LTC4162L_SYSTEM_STATUS_REG   0x39
 
#define LTC4162L_VBAT   0x3A
 
#define LTC4162L_VIN   0x3B
 
#define LTC4162L_VOUT   0x3C
 
#define LTC4162L_IBAT   0x3D
 
#define LTC4162L_IIN   0x3E
 
#define LTC4162L_DIE_TEMPERATURE   0x3F
 
#define LTC4162L_THERMISTOR_VOLTAGE   0x40
 
#define LTC4162L_BSR   0x41
 
#define LTC4162L_JEITA_REGION   0x42
 
#define LTC4162L_CHEM_CELLS_REG   0x43
 
#define LTC4162L_ICHARGE_DAC   0x44
 
#define LTC4162L_VCHARGE_DAC   0x45
 
#define LTC4162L_IIN_LIMIT_DAC   0x46
 
#define LTC4162L_VBAT_FILT   0x47
 
#define LTC4162L_INPUT_UNDERVOLTAGE_DAC   0x4B
 
#define LTC4162L_CELL_COUNT_MASK   NO_OS_GENMASK(3, 0)
 
#define LTC4162L_CHEM_TYPE_MASK   NO_OS_GENMASK(11, 8)
 
#define LTC4162L_CHEM_MASK   NO_OS_GENMASK(11, 8)
 
#define LTC4162L_ONLINE_STATUS_BIT   NO_OS_BIT(2)
 
#define LTC4162L_EN_C_OVER_X_TERM_BIT   NO_OS_BIT(2)
 
#define LTC4162L_IIN_LIMIT_DAC_MASK   NO_OS_GENMASK(6, 0)
 
#define LTC4162L_CHARGER_CONFIG_BIT   NO_OS_BIT(2)
 
#define LTC4162L_ICHARGE_DAC_MASK   NO_OS_GENMASK(4, 0)
 
#define LTC4162L_VIN_GT_VBAT_BIT   NO_OS_BIT(2)
 
#define LTC4162L_VCHARGE_SETTING_MASK   NO_OS_GENMASK(4, 0)
 
#define LTC4162L_RUN_BSR_BIT   NO_OS_BIT(4)
 
#define LTC4162L_FORCE_TELEMETRY_BIT   NO_OS_BIT(2)
 
#define LTC4162L_ARM_SHIP_MODE_MAGIC   21325
 
#define LTC4162L_MULTIPLIER   14660
 
#define LTC4015_MULTIPLIER   146487
 
#define LTC4162L_VCHARGE_RANGE   38125
 
#define LTC4015_VCHARGE_RANGE   34125
 
#define LTC4162L_BASE_VOLTAGE   3812500
 
#define LTC4162L_SCALE_FACTOR   12500
 
#define LTC4162L_RANGE   31
 
#define LTC4162F_BASE_VOLTAGE   3412500
 
#define LTC4162F_SCALE_FACTOR   12500
 
#define LTC4162F_RANGE   31
 
#define LTC4162S_BASE_VOLTAGE   6000000
 
#define LTC4162S_SCALE_FACTOR   28571
 
#define LTC4162S_RANGE   31
 
#define LTC4015_BASE_VOLTAGE_TYPE1   3812500
 
#define LTC4015_SCALE_FACTOR_TYPE1   12500
 
#define LTC4015_RANGE_TYPE1   31
 
#define LTC4015_BASE_VOLTAGE_TYPE2   3412500
 
#define LTC4015_SCALE_FACTOR_TYPE2   12500
 
#define LTC4015_RANGE_TYPE2   31
 
#define LTC4015_BASE_VOLTAGE_TYPE3   6000000
 
#define LTC4015_SCALE_FACTOR_TYPE3   28571
 
#define LTC4015_RANGE_TYPE3   35
 

Enumerations

enum  ltc4162l_id {
  ID_LTC4162L,
  ID_LTC4162F,
  ID_LTC4162S,
  ID_LTC4015
}
 LTC4162L device ID. More...
 
enum  ltc4162l_command {
  LTC4162L_CMD_GET_VBAT,
  LTC4162L_CMD_GET_VCHARGE,
  LTC4162L_CMD_GET_DIE_TEMP
}
 LTC4162L commands. More...
 

Functions

int ltc4162l_reg_write (struct ltc4162l_desc *dev, uint8_t addr, uint16_t val)
 Write to a register of the LTC4162L. More...
 
int ltc4162l_reg_read (struct ltc4162l_desc *dev, uint8_t addr, uint16_t *val)
 Read from a register of the LTC4162L. More...
 
int ltc4162l_reg_update (struct ltc4162l_desc *dev, uint8_t addr, uint16_t mask, uint16_t val)
 Update a register of the LTC4162L. More...
 
int ltc4162l_init (struct ltc4162l_desc **dev, struct ltc4162l_init_param *init_param)
 Initialize the LTC4162L device. More...
 
int ltc4162l_remove (struct ltc4162l_desc *dev)
 Free the resources allocated by ltc4162l_init() More...
 
int ltc4162l_get_cell_count (struct ltc4162l_desc *dev, uint16_t *val)
 Get the number of cells. More...
 
int ltc4162l_get_chem_type (struct ltc4162l_desc *dev, uint16_t *val)
 Get the chemistry type. More...
 
int ltc4162l_get_charger_state (struct ltc4162l_desc *dev, uint16_t *val)
 Get the charger state. More...
 
int ltc4162l_get_charge_status (struct ltc4162l_desc *dev, uint16_t *val)
 Get the charge status. More...
 
int ltc4162l_get_online_status (struct ltc4162l_desc *dev, uint16_t *val)
 Get the online status. More...
 
int ltc4162l_read_vbat (struct ltc4162l_desc *dev, uint16_t *val)
 Get the battery voltage. More...
 
int ltc4162l_read_avg_vbat (struct ltc4162l_desc *dev, uint16_t *val)
 Get the average battery voltage. More...
 
int ltc4162l_read_ibat (struct ltc4162l_desc *dev, uint16_t *val)
 Get the battery current. More...
 
int ltc4162l_read_input_voltage (struct ltc4162l_desc *dev, uint16_t *val)
 Get the input voltage. More...
 
int ltc4162l_read_input_current (struct ltc4162l_desc *dev, uint16_t *val)
 Get the input current. More...
 
int ltc4162l_get_icharge_setting (struct ltc4162l_desc *dev, uint16_t *val)
 Get icharge setting. More...
 
int ltc4162l_set_icharge_setting (struct ltc4162l_desc *dev, uint16_t val)
 Set icharge setting. More...
 
int ltc4162l_get_icharge (struct ltc4162l_desc *dev, uint16_t *val)
 Get icharge value. More...
 
int ltc4162l_get_vcharge_setting (struct ltc4162l_desc *dev, uint16_t *val)
 Get the vcharge setting. More...
 
int ltc4162l_set_vcharge_setting (struct ltc4162l_desc *dev, uint16_t val)
 Set the vcharge setting. More...
 
int ltc4162l_get_vcharge (struct ltc4162l_desc *dev, uint16_t *val)
 
int ltc4162l_get_iin_limit (struct ltc4162l_desc *dev, uint16_t *val)
 Get the iin limit. More...
 
int ltc4162l_set_iin_limit (struct ltc4162l_desc *dev, uint16_t val)
 Set the iin limit. More...
 
int ltc4162l_get_die_temperature (struct ltc4162l_desc *dev, uint16_t *val)
 
int ltc4162l_get_term_current (struct ltc4162l_desc *dev, uint16_t *val)
 Get the term current. More...
 
int ltc4162l_set_term_current (struct ltc4162l_desc *dev, uint16_t val)
 Set the term current. More...
 
int ltc4162l_get_telemetry (struct ltc4162l_desc *dev, uint16_t *val)
 Get the telemetry. More...
 
int ltc4162l_set_telemetry (struct ltc4162l_desc *dev, uint16_t val)
 Set the telemetry. More...
 

Macro Definition Documentation

◆ LTC4015_BASE_VOLTAGE_TYPE1

#define LTC4015_BASE_VOLTAGE_TYPE1   3812500

◆ LTC4015_BASE_VOLTAGE_TYPE2

#define LTC4015_BASE_VOLTAGE_TYPE2   3412500

◆ LTC4015_BASE_VOLTAGE_TYPE3

#define LTC4015_BASE_VOLTAGE_TYPE3   6000000

◆ LTC4015_MULTIPLIER

#define LTC4015_MULTIPLIER   146487

◆ LTC4015_RANGE_TYPE1

#define LTC4015_RANGE_TYPE1   31

◆ LTC4015_RANGE_TYPE2

#define LTC4015_RANGE_TYPE2   31

◆ LTC4015_RANGE_TYPE3

#define LTC4015_RANGE_TYPE3   35

◆ LTC4015_SCALE_FACTOR_TYPE1

#define LTC4015_SCALE_FACTOR_TYPE1   12500

◆ LTC4015_SCALE_FACTOR_TYPE2

#define LTC4015_SCALE_FACTOR_TYPE2   12500

◆ LTC4015_SCALE_FACTOR_TYPE3

#define LTC4015_SCALE_FACTOR_TYPE3   28571

◆ LTC4015_VCHARGE_RANGE

#define LTC4015_VCHARGE_RANGE   34125

◆ LTC4162F_BASE_VOLTAGE

#define LTC4162F_BASE_VOLTAGE   3412500

◆ LTC4162F_RANGE

#define LTC4162F_RANGE   31

◆ LTC4162F_SCALE_FACTOR

#define LTC4162F_SCALE_FACTOR   12500

◆ LTC4162L_ARM_SHIP_MODE

#define LTC4162L_ARM_SHIP_MODE   0x19

◆ LTC4162L_ARM_SHIP_MODE_MAGIC

#define LTC4162L_ARM_SHIP_MODE_MAGIC   21325

◆ LTC4162L_BASE_VOLTAGE

#define LTC4162L_BASE_VOLTAGE   3812500

◆ LTC4162L_BSR

#define LTC4162L_BSR   0x41

◆ LTC4162L_C_OVER_X_THRESHOLD

#define LTC4162L_C_OVER_X_THRESHOLD   0x1C

◆ LTC4162L_CELL_COUNT_MASK

#define LTC4162L_CELL_COUNT_MASK   NO_OS_GENMASK(3, 0)

◆ LTC4162L_CHARGE_CURRENT_SETTING

#define LTC4162L_CHARGE_CURRENT_SETTING   0X1A

◆ LTC4162L_CHARGE_STATUS

#define LTC4162L_CHARGE_STATUS   0x35

◆ LTC4162L_CHARGE_STATUS_ALERTS_REG

#define LTC4162L_CHARGE_STATUS_ALERTS_REG   0x38

◆ LTC4162L_CHARGER_CONFIG

#define LTC4162L_CHARGER_CONFIG   0x29

◆ LTC4162L_CHARGER_CONFIG_BIT

#define LTC4162L_CHARGER_CONFIG_BIT   NO_OS_BIT(2)

◆ LTC4162L_CHARGER_STATE

#define LTC4162L_CHARGER_STATE   0x34

◆ LTC4162L_CHARGER_STATE_ALERTS_REG

#define LTC4162L_CHARGER_STATE_ALERTS_REG   0x37

◆ LTC4162L_CHEM_CELLS_REG

#define LTC4162L_CHEM_CELLS_REG   0x43

◆ LTC4162L_CHEM_MASK

#define LTC4162L_CHEM_MASK   NO_OS_GENMASK(11, 8)

◆ LTC4162L_CHEM_TYPE_MASK

#define LTC4162L_CHEM_TYPE_MASK   NO_OS_GENMASK(11, 8)

◆ LTC4162L_CONFIG_BITS_REG

#define LTC4162L_CONFIG_BITS_REG   0x14

◆ LTC4162L_DIE_TEMPERATURE

#define LTC4162L_DIE_TEMPERATURE   0x3F

◆ LTC4162L_EN_C_OVER_X_TERM_BIT

#define LTC4162L_EN_C_OVER_X_TERM_BIT   NO_OS_BIT(2)

◆ LTC4162L_EN_CHARGE_STATUS_ALERTS_REG

#define LTC4162L_EN_CHARGE_STATUS_ALERTS_REG   0x0F

◆ LTC4162L_EN_CHARGER_STATE_ALERTS_REG

#define LTC4162L_EN_CHARGER_STATE_ALERTS_REG   0x0E

◆ LTC4162L_EN_LIMIT_ALERTS_REG

#define LTC4162L_EN_LIMIT_ALERTS_REG   0x0D

◆ LTC4162L_FORCE_TELEMETRY_BIT

#define LTC4162L_FORCE_TELEMETRY_BIT   NO_OS_BIT(2)

◆ LTC4162L_IBAT

#define LTC4162L_IBAT   0x3D

◆ LTC4162L_ICHARGE_DAC

#define LTC4162L_ICHARGE_DAC   0x44

◆ LTC4162L_ICHARGE_DAC_MASK

#define LTC4162L_ICHARGE_DAC_MASK   NO_OS_GENMASK(4, 0)

◆ LTC4162L_IIN

#define LTC4162L_IIN   0x3E

◆ LTC4162L_IIN_LIMIT_DAC

#define LTC4162L_IIN_LIMIT_DAC   0x46

◆ LTC4162L_IIN_LIMIT_DAC_MASK

#define LTC4162L_IIN_LIMIT_DAC_MASK   NO_OS_GENMASK(6, 0)

◆ LTC4162L_IIN_LIMIT_TARGET

#define LTC4162L_IIN_LIMIT_TARGET   0x15

◆ LTC4162L_INPUT_UNDERVOLTAGE_DAC

#define LTC4162L_INPUT_UNDERVOLTAGE_DAC   0x4B

◆ LTC4162L_JEITA_REGION

#define LTC4162L_JEITA_REGION   0x42

◆ LTC4162L_LIMIT_ALERTS_REG

#define LTC4162L_LIMIT_ALERTS_REG   0x36

◆ LTC4162L_MAX_CHARGE_TIME

#define LTC4162L_MAX_CHARGE_TIME   0X1E

◆ LTC4162L_MAX_CV_TIME

#define LTC4162L_MAX_CV_TIME   0X1D

◆ LTC4162L_MULTIPLIER

#define LTC4162L_MULTIPLIER   14660

◆ LTC4162L_ONLINE_STATUS_BIT

#define LTC4162L_ONLINE_STATUS_BIT   NO_OS_BIT(2)

◆ LTC4162L_RANGE

#define LTC4162L_RANGE   31

◆ LTC4162L_RUN_BSR_BIT

#define LTC4162L_RUN_BSR_BIT   NO_OS_BIT(4)

◆ LTC4162L_SCALE_FACTOR

#define LTC4162L_SCALE_FACTOR   12500

◆ LTC4162L_SYSTEM_STATUS_REG

#define LTC4162L_SYSTEM_STATUS_REG   0x39

◆ LTC4162L_THERMISTOR_VOLTAGE

#define LTC4162L_THERMISTOR_VOLTAGE   0x40

◆ LTC4162L_VBAT

#define LTC4162L_VBAT   0x3A

◆ LTC4162L_VBAT_FILT

#define LTC4162L_VBAT_FILT   0x47

◆ LTC4162L_VCHARGE_DAC

#define LTC4162L_VCHARGE_DAC   0x45

◆ LTC4162L_VCHARGE_RANGE

#define LTC4162L_VCHARGE_RANGE   38125

◆ LTC4162L_VCHARGE_SETTING

#define LTC4162L_VCHARGE_SETTING   0X1B

◆ LTC4162L_VCHARGE_SETTING_MASK

#define LTC4162L_VCHARGE_SETTING_MASK   NO_OS_GENMASK(4, 0)

◆ LTC4162L_VIN

#define LTC4162L_VIN   0x3B

◆ LTC4162L_VIN_GT_VBAT_BIT

#define LTC4162L_VIN_GT_VBAT_BIT   NO_OS_BIT(2)

◆ LTC4162L_VOUT

#define LTC4162L_VOUT   0x3C

◆ LTC4162S_BASE_VOLTAGE

#define LTC4162S_BASE_VOLTAGE   6000000

◆ LTC4162S_RANGE

#define LTC4162S_RANGE   31

◆ LTC4162S_SCALE_FACTOR

#define LTC4162S_SCALE_FACTOR   28571

Enumeration Type Documentation

◆ ltc4162l_command

LTC4162L commands.

Enumerator
LTC4162L_CMD_GET_VBAT 
LTC4162L_CMD_GET_VCHARGE 
LTC4162L_CMD_GET_DIE_TEMP 

◆ ltc4162l_id

LTC4162L device ID.

Enumerator
ID_LTC4162L 
ID_LTC4162F 
ID_LTC4162S 
ID_LTC4015 

Function Documentation

◆ ltc4162l_get_cell_count()

int ltc4162l_get_cell_count ( struct ltc4162l_desc dev,
uint16_t *  val 
)

Get the number of cells.

Parameters
dev- The LTC4162L device structure.
val- The number of cells.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ ltc4162l_get_charge_status()

int ltc4162l_get_charge_status ( struct ltc4162l_desc dev,
uint16_t *  val 
)

Get the charge status.

Parameters
dev- The LTC4162L device structure.
val- The charge status.
Returns
0 in case of success, negative error code otherwise.

◆ ltc4162l_get_charger_state()

int ltc4162l_get_charger_state ( struct ltc4162l_desc dev,
uint16_t *  val 
)

Get the charger state.

Parameters
dev- The LTC4162L device structure.
val- The charger state.
Returns
0 in case of success, negative error code otherwise.

◆ ltc4162l_get_chem_type()

int ltc4162l_get_chem_type ( struct ltc4162l_desc dev,
uint16_t *  val 
)

Get the chemistry type.

Parameters
dev- The LTC4162L device structure.
val- The chemistry type.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ ltc4162l_get_die_temperature()

int ltc4162l_get_die_temperature ( struct ltc4162l_desc dev,
uint16_t *  val 
)

◆ ltc4162l_get_icharge()

int ltc4162l_get_icharge ( struct ltc4162l_desc dev,
uint16_t *  val 
)

Get icharge value.

Parameters
dev- The LTC4162L device structure.
val- The icharge value.
Returns
0 in case of success, negative error code otherwise.

◆ ltc4162l_get_icharge_setting()

int ltc4162l_get_icharge_setting ( struct ltc4162l_desc dev,
uint16_t *  val 
)

Get icharge setting.

Parameters
dev- The LTC4162L device structure.
val- The icharge setting.
Returns
0 in case of success, negative error code otherwise.

◆ ltc4162l_get_iin_limit()

int ltc4162l_get_iin_limit ( struct ltc4162l_desc dev,
uint16_t *  val 
)

Get the iin limit.

Parameters
dev- The LTC4162L device structure.
val- The iin limit.
Returns
0 in case of success, negative error code otherwise.

◆ ltc4162l_get_online_status()

int ltc4162l_get_online_status ( struct ltc4162l_desc dev,
uint16_t *  val 
)

Get the online status.

Parameters
dev- The LTC4162L device structure.
val- The online status.
Returns
0 in case of success, negative error code otherwise.

◆ ltc4162l_get_telemetry()

int ltc4162l_get_telemetry ( struct ltc4162l_desc dev,
uint16_t *  val 
)

Get the telemetry.

Parameters
dev- The LTC4162L device structure.
val- The telemetry.
Returns
0 in case of success, negative error code otherwise.

◆ ltc4162l_get_term_current()

int ltc4162l_get_term_current ( struct ltc4162l_desc dev,
uint16_t *  val 
)

Get the term current.

Parameters
dev- The LTC4162L device structure.
val- The term current.
Returns
0 in case of success, negative error code otherwise.

◆ ltc4162l_get_vcharge()

int ltc4162l_get_vcharge ( struct ltc4162l_desc dev,
uint16_t *  val 
)

◆ ltc4162l_get_vcharge_setting()

int ltc4162l_get_vcharge_setting ( struct ltc4162l_desc dev,
uint16_t *  val 
)

Get the vcharge setting.

Parameters
dev- The LTC4162L device structure.
val- The vcharge setting.
Returns
0 in case of success, negative error code otherwise.

◆ ltc4162l_init()

int ltc4162l_init ( struct ltc4162l_desc **  device,
struct ltc4162l_init_param init_param 
)

Initialize the LTC4162L device.

Parameters
device- The LTC4162L device structure.
init_param- The LTC4162L initialization structure.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ ltc4162l_read_avg_vbat()

int ltc4162l_read_avg_vbat ( struct ltc4162l_desc dev,
uint16_t *  val 
)

Get the average battery voltage.

Parameters
dev- The LTC4162L device structure.
val- The average battery voltage.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ ltc4162l_read_ibat()

int ltc4162l_read_ibat ( struct ltc4162l_desc dev,
uint16_t *  val 
)

Get the battery current.

Parameters
dev- The LTC4162L device structure.
val- The battery current.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ ltc4162l_read_input_current()

int ltc4162l_read_input_current ( struct ltc4162l_desc dev,
uint16_t *  val 
)

Get the input current.

Parameters
dev- The LTC4162L device structure.
val- The input current.
Returns
0 in case of success, negative error code otherwise.

◆ ltc4162l_read_input_voltage()

int ltc4162l_read_input_voltage ( struct ltc4162l_desc dev,
uint16_t *  val 
)

Get the input voltage.

Parameters
dev- The LTC4162L device structure.
val- The input voltage.
Returns
0 in case of success, negative error code otherwise.

◆ ltc4162l_read_vbat()

int ltc4162l_read_vbat ( struct ltc4162l_desc dev,
uint16_t *  val 
)

Get the battery voltage.

Parameters
dev- The LTC4162L device structure.
val- The battery voltage.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ ltc4162l_reg_read()

int ltc4162l_reg_read ( struct ltc4162l_desc dev,
uint8_t  addr,
uint16_t *  val 
)

Read from a register of the LTC4162L.

Parameters
dev- The LTC4162L device structure.
addr- The address of the register to read from.
val- The value read from the register.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ ltc4162l_reg_update()

int ltc4162l_reg_update ( struct ltc4162l_desc dev,
uint8_t  addr,
uint16_t  mask,
uint16_t  val 
)

Update a register of the LTC4162L.

Parameters
dev- The LTC4162L device structure.
addr- The address of the register to update.
mask- The mask to apply to the register.
val- The value to write to the register.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ ltc4162l_reg_write()

int ltc4162l_reg_write ( struct ltc4162l_desc dev,
uint8_t  addr,
uint16_t  val 
)

Write to a register of the LTC4162L.

Parameters
dev- The LTC4162L device structure.
addr- The address of the register to write to.
val- The value to write to the register.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ ltc4162l_remove()

int ltc4162l_remove ( struct ltc4162l_desc dev)

Free the resources allocated by ltc4162l_init()

Parameters
dev- The LTC4162L device structure.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ ltc4162l_set_icharge_setting()

int ltc4162l_set_icharge_setting ( struct ltc4162l_desc dev,
uint16_t  val 
)

Set icharge setting.

Parameters
dev- The LTC4162L device structure.
val- The icharge setting.
Returns
0 in case of success, negative error code otherwise.

◆ ltc4162l_set_iin_limit()

int ltc4162l_set_iin_limit ( struct ltc4162l_desc dev,
uint16_t  val 
)

Set the iin limit.

Parameters
dev- The LTC4162L device structure.
val- The iin limit.
Returns
0 in case of success, negative error code otherwise.

◆ ltc4162l_set_telemetry()

int ltc4162l_set_telemetry ( struct ltc4162l_desc dev,
uint16_t  val 
)

Set the telemetry.

Parameters
dev- The LTC4162L device structure.
val- The telemetry.
Returns
0 in case of success, negative error code otherwise.

◆ ltc4162l_set_term_current()

int ltc4162l_set_term_current ( struct ltc4162l_desc dev,
uint16_t  val 
)

Set the term current.

Parameters
dev- The LTC4162L device structure.
val- The term current.
Returns
0 in case of success, negative error code otherwise.

◆ ltc4162l_set_vcharge_setting()

int ltc4162l_set_vcharge_setting ( struct ltc4162l_desc dev,
uint16_t  val 
)

Set the vcharge setting.

Parameters
dev- The LTC4162L device structure.
val- The vcharge setting.
Returns
0 in case of success, negative error code otherwise.