no-OS
|
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... | |
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... | |
#define LTC4015_BASE_VOLTAGE_TYPE1 3812500 |
#define LTC4015_BASE_VOLTAGE_TYPE2 3412500 |
#define LTC4015_BASE_VOLTAGE_TYPE3 6000000 |
#define LTC4015_MULTIPLIER 146487 |
#define LTC4015_RANGE_TYPE1 31 |
#define LTC4015_RANGE_TYPE2 31 |
#define LTC4015_RANGE_TYPE3 35 |
#define LTC4015_SCALE_FACTOR_TYPE1 12500 |
#define LTC4015_SCALE_FACTOR_TYPE2 12500 |
#define LTC4015_SCALE_FACTOR_TYPE3 28571 |
#define LTC4015_VCHARGE_RANGE 34125 |
#define LTC4162F_BASE_VOLTAGE 3412500 |
#define LTC4162F_RANGE 31 |
#define LTC4162F_SCALE_FACTOR 12500 |
#define LTC4162L_ARM_SHIP_MODE 0x19 |
#define LTC4162L_ARM_SHIP_MODE_MAGIC 21325 |
#define LTC4162L_BASE_VOLTAGE 3812500 |
#define LTC4162L_BSR 0x41 |
#define LTC4162L_C_OVER_X_THRESHOLD 0x1C |
#define LTC4162L_CELL_COUNT_MASK NO_OS_GENMASK(3, 0) |
#define LTC4162L_CHARGE_CURRENT_SETTING 0X1A |
#define LTC4162L_CHARGE_STATUS 0x35 |
#define LTC4162L_CHARGE_STATUS_ALERTS_REG 0x38 |
#define LTC4162L_CHARGER_CONFIG 0x29 |
#define LTC4162L_CHARGER_CONFIG_BIT NO_OS_BIT(2) |
#define LTC4162L_CHARGER_STATE 0x34 |
#define LTC4162L_CHARGER_STATE_ALERTS_REG 0x37 |
#define LTC4162L_CHEM_CELLS_REG 0x43 |
#define LTC4162L_CHEM_MASK NO_OS_GENMASK(11, 8) |
#define LTC4162L_CHEM_TYPE_MASK NO_OS_GENMASK(11, 8) |
#define LTC4162L_CONFIG_BITS_REG 0x14 |
#define LTC4162L_DIE_TEMPERATURE 0x3F |
#define LTC4162L_EN_C_OVER_X_TERM_BIT NO_OS_BIT(2) |
#define LTC4162L_EN_CHARGE_STATUS_ALERTS_REG 0x0F |
#define LTC4162L_EN_CHARGER_STATE_ALERTS_REG 0x0E |
#define LTC4162L_EN_LIMIT_ALERTS_REG 0x0D |
#define LTC4162L_FORCE_TELEMETRY_BIT NO_OS_BIT(2) |
#define LTC4162L_IBAT 0x3D |
#define LTC4162L_ICHARGE_DAC 0x44 |
#define LTC4162L_ICHARGE_DAC_MASK NO_OS_GENMASK(4, 0) |
#define LTC4162L_IIN 0x3E |
#define LTC4162L_IIN_LIMIT_DAC 0x46 |
#define LTC4162L_IIN_LIMIT_DAC_MASK NO_OS_GENMASK(6, 0) |
#define LTC4162L_IIN_LIMIT_TARGET 0x15 |
#define LTC4162L_INPUT_UNDERVOLTAGE_DAC 0x4B |
#define LTC4162L_JEITA_REGION 0x42 |
#define LTC4162L_LIMIT_ALERTS_REG 0x36 |
#define LTC4162L_MAX_CHARGE_TIME 0X1E |
#define LTC4162L_MAX_CV_TIME 0X1D |
#define LTC4162L_MULTIPLIER 14660 |
#define LTC4162L_ONLINE_STATUS_BIT NO_OS_BIT(2) |
#define LTC4162L_RANGE 31 |
#define LTC4162L_RUN_BSR_BIT NO_OS_BIT(4) |
#define LTC4162L_SCALE_FACTOR 12500 |
#define LTC4162L_SYSTEM_STATUS_REG 0x39 |
#define LTC4162L_THERMISTOR_VOLTAGE 0x40 |
#define LTC4162L_VBAT 0x3A |
#define LTC4162L_VBAT_FILT 0x47 |
#define LTC4162L_VCHARGE_DAC 0x45 |
#define LTC4162L_VCHARGE_RANGE 38125 |
#define LTC4162L_VCHARGE_SETTING 0X1B |
#define LTC4162L_VCHARGE_SETTING_MASK NO_OS_GENMASK(4, 0) |
#define LTC4162L_VIN 0x3B |
#define LTC4162L_VIN_GT_VBAT_BIT NO_OS_BIT(2) |
#define LTC4162L_VOUT 0x3C |
#define LTC4162S_BASE_VOLTAGE 6000000 |
#define LTC4162S_RANGE 31 |
#define LTC4162S_SCALE_FACTOR 28571 |
enum ltc4162l_command |
enum ltc4162l_id |
int ltc4162l_get_cell_count | ( | struct ltc4162l_desc * | dev, |
uint16_t * | val | ||
) |
Get the number of cells.
dev | - The LTC4162L device structure. |
val | - The number of cells. |
int ltc4162l_get_charge_status | ( | struct ltc4162l_desc * | dev, |
uint16_t * | val | ||
) |
Get the charge status.
dev | - The LTC4162L device structure. |
val | - The charge status. |
int ltc4162l_get_charger_state | ( | struct ltc4162l_desc * | dev, |
uint16_t * | val | ||
) |
Get the charger state.
dev | - The LTC4162L device structure. |
val | - The charger state. |
int ltc4162l_get_chem_type | ( | struct ltc4162l_desc * | dev, |
uint16_t * | val | ||
) |
Get the chemistry type.
dev | - The LTC4162L device structure. |
val | - The chemistry type. |
int ltc4162l_get_die_temperature | ( | struct ltc4162l_desc * | dev, |
uint16_t * | val | ||
) |
int ltc4162l_get_icharge | ( | struct ltc4162l_desc * | dev, |
uint16_t * | val | ||
) |
Get icharge value.
dev | - The LTC4162L device structure. |
val | - The icharge value. |
int ltc4162l_get_icharge_setting | ( | struct ltc4162l_desc * | dev, |
uint16_t * | val | ||
) |
Get icharge setting.
dev | - The LTC4162L device structure. |
val | - The icharge setting. |
int ltc4162l_get_iin_limit | ( | struct ltc4162l_desc * | dev, |
uint16_t * | val | ||
) |
Get the iin limit.
dev | - The LTC4162L device structure. |
val | - The iin limit. |
int ltc4162l_get_online_status | ( | struct ltc4162l_desc * | dev, |
uint16_t * | val | ||
) |
Get the online status.
dev | - The LTC4162L device structure. |
val | - The online status. |
int ltc4162l_get_telemetry | ( | struct ltc4162l_desc * | dev, |
uint16_t * | val | ||
) |
Get the telemetry.
dev | - The LTC4162L device structure. |
val | - The telemetry. |
int ltc4162l_get_term_current | ( | struct ltc4162l_desc * | dev, |
uint16_t * | val | ||
) |
Get the term current.
dev | - The LTC4162L device structure. |
val | - The term current. |
int ltc4162l_get_vcharge | ( | struct ltc4162l_desc * | dev, |
uint16_t * | val | ||
) |
int ltc4162l_get_vcharge_setting | ( | struct ltc4162l_desc * | dev, |
uint16_t * | val | ||
) |
Get the vcharge setting.
dev | - The LTC4162L device structure. |
val | - The vcharge setting. |
int ltc4162l_init | ( | struct ltc4162l_desc ** | device, |
struct ltc4162l_init_param * | init_param | ||
) |
Initialize the LTC4162L device.
device | - The LTC4162L device structure. |
init_param | - The LTC4162L initialization structure. |
int ltc4162l_read_avg_vbat | ( | struct ltc4162l_desc * | dev, |
uint16_t * | val | ||
) |
Get the average battery voltage.
dev | - The LTC4162L device structure. |
val | - The average battery voltage. |
int ltc4162l_read_ibat | ( | struct ltc4162l_desc * | dev, |
uint16_t * | val | ||
) |
Get the battery current.
dev | - The LTC4162L device structure. |
val | - The battery current. |
int ltc4162l_read_input_current | ( | struct ltc4162l_desc * | dev, |
uint16_t * | val | ||
) |
Get the input current.
dev | - The LTC4162L device structure. |
val | - The input current. |
int ltc4162l_read_input_voltage | ( | struct ltc4162l_desc * | dev, |
uint16_t * | val | ||
) |
Get the input voltage.
dev | - The LTC4162L device structure. |
val | - The input voltage. |
int ltc4162l_read_vbat | ( | struct ltc4162l_desc * | dev, |
uint16_t * | val | ||
) |
Get the battery voltage.
dev | - The LTC4162L device structure. |
val | - The battery voltage. |
int ltc4162l_reg_read | ( | struct ltc4162l_desc * | dev, |
uint8_t | addr, | ||
uint16_t * | val | ||
) |
Read from a register of the LTC4162L.
dev | - The LTC4162L device structure. |
addr | - The address of the register to read from. |
val | - The value read from the register. |
int ltc4162l_reg_update | ( | struct ltc4162l_desc * | dev, |
uint8_t | addr, | ||
uint16_t | mask, | ||
uint16_t | val | ||
) |
Update a register of the LTC4162L.
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. |
int ltc4162l_reg_write | ( | struct ltc4162l_desc * | dev, |
uint8_t | addr, | ||
uint16_t | val | ||
) |
Write to a register of the LTC4162L.
dev | - The LTC4162L device structure. |
addr | - The address of the register to write to. |
val | - The value to write to the register. |
int ltc4162l_remove | ( | struct ltc4162l_desc * | dev | ) |
Free the resources allocated by ltc4162l_init()
dev | - The LTC4162L device structure. |
int ltc4162l_set_icharge_setting | ( | struct ltc4162l_desc * | dev, |
uint16_t | val | ||
) |
Set icharge setting.
dev | - The LTC4162L device structure. |
val | - The icharge setting. |
int ltc4162l_set_iin_limit | ( | struct ltc4162l_desc * | dev, |
uint16_t | val | ||
) |
Set the iin limit.
dev | - The LTC4162L device structure. |
val | - The iin limit. |
int ltc4162l_set_telemetry | ( | struct ltc4162l_desc * | dev, |
uint16_t | val | ||
) |
Set the telemetry.
dev | - The LTC4162L device structure. |
val | - The telemetry. |
int ltc4162l_set_term_current | ( | struct ltc4162l_desc * | dev, |
uint16_t | val | ||
) |
Set the term current.
dev | - The LTC4162L device structure. |
val | - The term current. |
int ltc4162l_set_vcharge_setting | ( | struct ltc4162l_desc * | dev, |
uint16_t | val | ||
) |
Set the vcharge setting.
dev | - The LTC4162L device structure. |
val | - The vcharge setting. |