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