Go to the documentation of this file.
34 #ifndef __IIO_LT8491_H__
35 #define __IIO_LT8491_H__
int lt8491_reg_read(struct lt8491_desc *dev, uint8_t addr, uint16_t *val, bool is_word)
Read a register value.
Definition: lt8491.c:50
int lt8491_iio_init(struct lt8491_iio_device **iio_device, struct lt8491_iio_init_param *iio_init_param)
Initializes the LT8491 IIO driver.
Definition: iio_lt8491.c:451
Definition: iio_lt8491.h:54
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:116
int lt8491_read_iout(struct lt8491_desc *dev, uint32_t *val)
Read the telemetry battery output current.
Definition: lt8491.c:320
@ 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
@ LT8491_RESTART
Definition: iio_lt8491.c:92
int lt8491_read_vin(struct lt8491_desc *dev, uint32_t *val)
Read the telemetry input voltage.
Definition: lt8491.c:392
@ LT8491_CHARGING_STATUS
Definition: iio_lt8491.c:90
int lt8491_read_scratch(struct lt8491_desc *dev, uint32_t *val)
Read the scratch register.
Definition: lt8491.c:510
Structure holding channel attributess.
Definition: iio_types.h:103
int lt8491_write_scratch(struct lt8491_desc *dev, uint32_t val)
Write the scratch register.
Definition: lt8491.c:530
int lt8491_iio_remove(struct lt8491_iio_device *iio_device)
Free resources allocated by the init function.
Definition: iio_lt8491.c:500
Definition: iio_lt8491.h:47
@ LT8491_SERIAL_ID
Definition: iio_lt8491.c:94
@ LT8491_VBAT
Definition: iio_lt8491.c:87
struct iio_device * iio_dev
Definition: iio_lt8491.h:49
LT8491 descriptor.
Definition: lt8491.h:94
int lt8491_init(struct lt8491_desc **dev, struct lt8491_init_param *init_param)
Device and comm init function.
Definition: lt8491.c:109
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
@ LT8491_CHARGING_STAGE
Definition: iio_lt8491.c:89
int lt8491_reg_write(struct lt8491_desc *dev, uint8_t addr, uint16_t val, bool is_word)
Write a register value.
Definition: lt8491.c:85
int lt8491_configure_telemetry(struct lt8491_desc *dev, struct lt8491_init_param *init_param)
Device and comm init function.
Definition: lt8491.c:160
intptr_t priv
Definition: iio_types.h:133
uint8_t no_active_channels
Definition: iio_lt8491.h:51
struct lt8491_desc * dev
Definition: iio_lt8491.h:48
const char * name
Definition: iio_types.h:131
struct lt8491_init_param * init_param
Definition: iio_lt8491.h:55
uint32_t active_channels
Definition: iio_lt8491.h:50
const char * name
Definition: iio_types.h:170
int lt8491_restart_chip(struct lt8491_desc *dev)
Restart the chip.
Definition: lt8491.c:493
int lt8491_read_charging_stage(struct lt8491_desc *dev, uint32_t *uval)
Read the telemetry battery charging stage.
Definition: lt8491.c:423
int lt8491_read_iin(struct lt8491_desc *dev, uint32_t *val)
Read the telemetry battery input current.
Definition: lt8491.c:344
Structure holding pointers to show and store functions.
Definition: iio_types.h:129
#define LT8491_IIO_CH_ATTR_READ_RAW(_name, _priv)
Definition: iio_lt8491.c:64
@ LT8491_TBAT
Definition: iio_lt8491.c:81
lt8491_attr_priv
Definition: iio_lt8491.c:80
int lt8491_iio_remove(struct lt8491_iio_device *iio_device)
Free resources allocated by the init function.
Definition: iio_lt8491.c:500
int lt8491_read_vbat(struct lt8491_desc *dev, uint32_t *val)
Read the telemetry battery voltage.
Definition: lt8491.c:368
@ 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
@ IIO_VOLTAGE
Definition: iio_types.h:65
int lt8491_iio_init(struct lt8491_iio_device **iio_device, struct lt8491_iio_init_param *iio_init_param)
Initializes the LT8491 IIO driver.
Definition: iio_lt8491.c:451
@ LT8491_SCRATCH
Definition: iio_lt8491.c:93
int iio_format_value(char *buf, uint32_t len, enum iio_val fmt, int32_t size, int32_t *vals)
Definition: iio.c:686
#define LT8491_IIO_CH_ATTR_READ_SCALE(_name, _priv)
Definition: iio_lt8491.c:72
@ LT8491_ENABLE
Definition: iio_lt8491.c:91
int lt8491_remove(struct lt8491_desc *dev)
Free resources allocated by the init function.
Definition: lt8491.c:138
uint16_t num_ch
Definition: iio_types.h:252
#define LT8491_IIO_CH_ATTR_WO(_name, _priv)
Definition: iio_lt8491.c:56
@ LT8491_IIN
Definition: iio_lt8491.c:86
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
@ IIO_TEMP
Definition: iio_types.h:69
@ LT8491_POUT
Definition: iio_lt8491.c:82
@ LT8491_IOUT
Definition: iio_lt8491.c:85
Implementation of LT8491 Driver.
int lt8491_read_tbat(struct lt8491_desc *dev, int32_t *val)
Read the telemetry battery temperature.
Definition: lt8491.c:224
#define NULL
Definition: wrapper.h:64
int lt8491_read_efficiency(struct lt8491_desc *dev, uint32_t *val)
Read the telemetry battery efficiency.
Definition: lt8491.c:296
int lt8491_write_enable(struct lt8491_desc *dev, uint32_t enable)
Write the telemetry battery charging enable.
Definition: lt8491.c:483
Structure holding channels and attributes of a device.
Definition: iio_types.h:247
@ LT8491_EFF
Definition: iio_lt8491.c:84
@ LT8491_PIN
Definition: iio_lt8491.c:83
int lt8491_read_enable(struct lt8491_desc *dev, uint32_t *enable)
Read the telemetry battery charging enable.
Definition: lt8491.c:463
Definition: iio_types.h:151
int lt8491_read_pout(struct lt8491_desc *dev, uint32_t *val)
Read the telemetry battery output power.
Definition: lt8491.c:248
@ LT8491_VIN
Definition: iio_lt8491.c:88
int lt8491_read_serial_id(struct lt8491_desc *dev, uint32_t *val)
Read the serial ID.
Definition: lt8491.c:543
#define LT8491_IIO_CH_ATTR_RO(_name, _priv)
Definition: iio_lt8491.c:48
int lt8491_read_pin(struct lt8491_desc *dev, uint32_t *val)
Read the telemetry battery input power.
Definition: lt8491.c:272
LT8491 init param.
Definition: lt8491.h:102
Error macro definition for ARM Compiler.
int lt8491_read_charging_status(struct lt8491_desc *dev, uint32_t *charging)
Read the telemetry battery charging status.
Definition: lt8491.c:443
#define LT8491_IIO_CH_ATTR_RW(_name, _priv)
Definition: iio_lt8491.c:40
@ IIO_VAL_INT_MULTIPLE
Definition: iio_types.h:54
Implementation of IIO LT8491 Driver.