no-OS
|
#include <stdint.h>
#include <stdlib.h>
#include <errno.h>
#include "no_os_util.h"
#include "no_os_delay.h"
#include "no_os_alloc.h"
#include "no_os_i2c.h"
#include "ltc4162l.h"
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 **device, 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_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_temp (struct ltc4162l_desc *dev, uint16_t *val) |
Get the die temperature. More... | |
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... | |
Variables | |
const struct ltc4162l_chip_info | ltc4162l_infos [] |
LTC4162x chip information. More... | |
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_temp | ( | struct ltc4162l_desc * | dev, |
uint16_t * | val | ||
) |
Get the die temperature.
dev | - The LTC4162L device structure. |
val | - The die temperature. |
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_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. |
const struct ltc4162l_chip_info ltc4162l_infos[] |
LTC4162x chip information.