Go to the documentation of this file.
34 #ifndef __IIO_LTC4162L_H__
35 #define __IIO_LTC4162L_H__
@ LTC4162L_AVG_VBAT_VAL
Definition: iio_ltc4162l.c:95
struct ltc4162l_init_param * init_param
Definition: iio_ltc4162l.h:53
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:116
int ltc4162l_set_icharge_setting(struct ltc4162l_desc *dev, uint16_t val)
Set icharge setting.
Definition: ltc4162l.c:558
@ IIO_VAL_INT
Definition: iio_types.h:50
Struct describing the scan type.
Definition: iio_types.h:168
char sign
Definition: iio_types.h:153
#define LTC4162L_IIO_CH_ATTR_RW(_name, _priv)
Definition: iio_ltc4162l.c:48
int ltc4162l_get_icharge_setting(struct ltc4162l_desc *dev, uint16_t *val)
Get icharge setting.
Definition: ltc4162l.c:533
@ LTC4162L_CHARGER_STATUS
Definition: iio_ltc4162l.c:91
struct iio_channel ltc4162l_channels[]
Definition: iio_ltc4162l.c:415
@ LTC4162L_ICHARGE_SET
Definition: iio_ltc4162l.c:99
int ltc4162l_get_iin_limit(struct ltc4162l_desc *dev, uint16_t *val)
Get the iin limit.
Definition: ltc4162l.c:696
Structure holding channel attributess.
Definition: iio_types.h:103
int ltc4162l_init(struct ltc4162l_desc **device, struct ltc4162l_init_param *init_param)
Initialize the LTC4162L device.
Definition: ltc4162l.c:254
int ltc4162l_get_charge_status(struct ltc4162l_desc *dev, uint16_t *val)
Get the charge status.
Definition: ltc4162l.c:368
@ LTC4162L_ONLINE_STATUS
Definition: iio_ltc4162l.c:93
int ltc4162l_iio_init(struct ltc4162l_iio_device **iio_device, struct ltc4162l_iio_init_param *iio_init_param)
Definition: iio_ltc4162l.c:481
#define LTC4162L_IIO_CH_ATTR_READ_RAW(_name, _priv)
Definition: iio_ltc4162l.c:72
int ltc4162l_get_vcharge_setting(struct ltc4162l_desc *dev, uint16_t *val)
Get the vcharge setting.
Definition: ltc4162l.c:606
@ LTC4162L_IIN_LIMIT_SET
Definition: iio_ltc4162l.c:101
int ltc4162l_read_input_current(struct ltc4162l_desc *dev, uint16_t *val)
Get the input current.
Definition: ltc4162l.c:510
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:54
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:49
@ LTC4162L_BATTERY_COUNT
Definition: iio_ltc4162l.c:89
uint32_t active_channels
Definition: iio_ltc4162l.h:45
@ LTC4162L_IIN_VAL
Definition: iio_ltc4162l.c:98
ltc4162l_attr_priv
Definition: iio_ltc4162l.c:88
int ltc4162l_reg_read(struct ltc4162l_desc *dev, uint8_t addr, uint16_t *val)
Read from a register of the LTC4162L.
Definition: ltc4162l.c:206
int ltc4162l_get_telemetry(struct ltc4162l_desc *dev, uint16_t *val)
Get the telemetry.
Definition: ltc4162l.c:818
int ltc4162l_set_telemetry(struct ltc4162l_desc *dev, uint16_t val)
Set the telemetry.
Definition: ltc4162l.c:841
Structure holding the LTC4162L IIO device descriptor.
Definition: iio_ltc4162l.h:42
intptr_t priv
Definition: iio_types.h:133
@ LTC4162L_TERM_CURRENT
Definition: iio_ltc4162l.c:103
int ltc4162l_get_chem_type(struct ltc4162l_desc *dev, uint16_t *val)
Get the chemistry type.
Definition: ltc4162l.c:328
int ltc4162l_read_ibat(struct ltc4162l_desc *dev, uint16_t *val)
Get the battery current.
Definition: ltc4162l.c:464
#define LTC4162L_IIO_CH_ATTR_RO(_name, _priv)
Definition: iio_ltc4162l.c:56
int ltc4162l_get_term_current(struct ltc4162l_desc *dev, uint16_t *val)
Get the term current.
Definition: ltc4162l.c:760
int ltc4162l_iio_init(struct ltc4162l_iio_device **iio_device, struct ltc4162l_iio_init_param *iio_init_param)
Definition: iio_ltc4162l.c:481
const char * name
Definition: iio_types.h:131
int ltc4162l_set_vcharge_setting(struct ltc4162l_desc *dev, uint16_t val)
Set the vcharge setting.
Definition: ltc4162l.c:636
const char * name
Definition: iio_types.h:170
int ltc4162l_set_iin_limit(struct ltc4162l_desc *dev, uint16_t val)
Set the iin limit.
Definition: ltc4162l.c:721
#define LTC4162L_IIO_CH_ATTR_READ_SCALE(_name, _priv)
Definition: iio_ltc4162l.c:80
int ltc4162l_set_term_current(struct ltc4162l_desc *dev, uint16_t val)
Set the term current.
Definition: ltc4162l.c:791
Structure holding pointers to show and store functions.
Definition: iio_types.h:129
struct iio_device * iio_dev
Definition: iio_ltc4162l.h:44
LTC4162L descriptor.
Definition: ltc4162l.h:139
@ LTC4162L_VIN_VAL
Definition: iio_ltc4162l.c:97
struct ltc4162l_desc * dev
Definition: iio_ltc4162l.h:43
@ LTC4162L_VBAT_VAL
Definition: iio_ltc4162l.c:94
@ LTC4162L_CHEM_TYPE
Definition: iio_ltc4162l.c:90
@ IIO_CURRENT
Definition: iio_types.h:66
int32_t iio_parse_value(char *buf, enum iio_val fmt, int32_t *val, int32_t *val2)
Definition: iio.c:630
int ltc4162l_read_avg_vbat(struct ltc4162l_desc *dev, uint16_t *val)
Get the average battery voltage.
Definition: ltc4162l.c:436
uint8_t no_active_channels
Definition: iio_ltc4162l.h:46
@ LTC4162L_IBAT_VAL
Definition: iio_ltc4162l.c:96
@ IIO_VOLTAGE
Definition: iio_types.h:65
int ltc4162l_read_input_voltage(struct ltc4162l_desc *dev, uint16_t *val)
Get the input voltage.
Definition: ltc4162l.c:487
@ LTC4162L_TELEMETRY
Definition: iio_ltc4162l.c:104
int iio_format_value(char *buf, uint32_t len, enum iio_val fmt, int32_t size, int32_t *vals)
Definition: iio.c:686
@ LTC4162L_DIE_TEMP
Definition: iio_ltc4162l.c:102
uint16_t num_ch
Definition: iio_types.h:252
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
int ltc4162l_get_online_status(struct ltc4162l_desc *dev, uint16_t *val)
Get the online status.
Definition: ltc4162l.c:388
@ IIO_TEMP
Definition: iio_types.h:69
int ltc4162l_get_charger_state(struct ltc4162l_desc *dev, uint16_t *val)
Get the charger state.
Definition: ltc4162l.c:348
#define NULL
Definition: wrapper.h:64
@ LTC4162L_CHARGE_STATE
Definition: iio_ltc4162l.c:92
Structure holding channels and attributes of a device.
Definition: iio_types.h:247
Definition: iio_types.h:151
Implementation of IIO LTC4162L Driver.
int ltc4162l_iio_remove(struct ltc4162l_iio_device *iio_device)
Free resources allocated by the init function.
Definition: iio_ltc4162l.c:515
LTC4162L init param.
Definition: ltc4162l.h:151
@ LTC4162L_VCHARGE_SET
Definition: iio_ltc4162l.c:100
Structure holding the LTC4162L IIO initialization parameter.
Definition: iio_ltc4162l.h:52
int ltc4162l_read_vbat(struct ltc4162l_desc *dev, uint16_t *val)
Get the battery voltage.
Definition: ltc4162l.c:408
int ltc4162l_iio_remove(struct ltc4162l_iio_device *iio_device)
Free resources allocated by the init function.
Definition: iio_ltc4162l.c:515
int ltc4162l_reg_write(struct ltc4162l_desc *dev, uint8_t addr, uint16_t val)
Write to a register of the LTC4162L.
Definition: ltc4162l.c:192
int ltc4162l_get_cell_count(struct ltc4162l_desc *dev, uint16_t *val)
Get the number of cells.
Definition: ltc4162l.c:307
Error macro definition for ARM Compiler.
int ltc4162l_remove(struct ltc4162l_desc *dev)
Free the resources allocated by ltc4162l_init()
Definition: ltc4162l.c:288