no-OS
iio_lt8491.h
Go to the documentation of this file.
1 /***************************************************************************/
34 #ifndef __IIO_LT8491_H__
35 #define __IIO_LT8491_H__
36 
37 /******************************************************************************/
38 /***************************** Include Files **********************************/
39 /******************************************************************************/
40 
41 #include "iio.h"
42 
43 /******************************************************************************/
44 /*************************** Types Declarations *******************************/
45 /******************************************************************************/
46 
48  struct lt8491_desc *dev;
50  uint32_t active_channels;
52 };
53 
56 };
57 
58 /******************************************************************************/
59 /************************ Functions Declarations ******************************/
60 /******************************************************************************/
61 
64 
66 
67 #endif /* __IIO_LT8491_H__ */
lt8491_reg_read
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
lt8491_iio_init
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_iio_init_param
Definition: iio_lt8491.h:54
no_os_alloc.h
END_ATTRIBUTES_ARRAY
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:116
lt8491_read_iout
int lt8491_read_iout(struct lt8491_desc *dev, uint32_t *val)
Read the telemetry battery output current.
Definition: lt8491.c:320
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
LT8491_RESTART
@ LT8491_RESTART
Definition: iio_lt8491.c:92
lt8491_read_vin
int lt8491_read_vin(struct lt8491_desc *dev, uint32_t *val)
Read the telemetry input voltage.
Definition: lt8491.c:392
LT8491_CHARGING_STATUS
@ LT8491_CHARGING_STATUS
Definition: iio_lt8491.c:90
lt8491_read_scratch
int lt8491_read_scratch(struct lt8491_desc *dev, uint32_t *val)
Read the scratch register.
Definition: lt8491.c:510
iio_ch_info
Structure holding channel attributess.
Definition: iio_types.h:103
lt8491_write_scratch
int lt8491_write_scratch(struct lt8491_desc *dev, uint32_t val)
Write the scratch register.
Definition: lt8491.c:530
lt8491_iio_remove
int lt8491_iio_remove(struct lt8491_iio_device *iio_device)
Free resources allocated by the init function.
Definition: iio_lt8491.c:500
lt8491_iio_device
Definition: iio_lt8491.h:47
LT8491_SERIAL_ID
@ LT8491_SERIAL_ID
Definition: iio_lt8491.c:94
iio_init_param
Definition: iio.h:104
LT8491_VBAT
@ LT8491_VBAT
Definition: iio_lt8491.c:87
lt8491_iio_device::iio_dev
struct iio_device * iio_dev
Definition: iio_lt8491.h:49
lt8491_desc
LT8491 descriptor.
Definition: lt8491.h:94
lt8491_init
int lt8491_init(struct lt8491_desc **dev, struct lt8491_init_param *init_param)
Device and comm init function.
Definition: lt8491.c:109
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
LT8491_CHARGING_STAGE
@ LT8491_CHARGING_STAGE
Definition: iio_lt8491.c:89
lt8491_reg_write
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
lt8491_configure_telemetry
int lt8491_configure_telemetry(struct lt8491_desc *dev, struct lt8491_init_param *init_param)
Device and comm init function.
Definition: lt8491.c:160
iio_attribute::priv
intptr_t priv
Definition: iio_types.h:133
lt8491_iio_device::no_active_channels
uint8_t no_active_channels
Definition: iio_lt8491.h:51
lt8491_iio_device::dev
struct lt8491_desc * dev
Definition: iio_lt8491.h:48
iio.h
Header file of iio.
no_os_error.h
Error codes definition.
iio_attribute::name
const char * name
Definition: iio_types.h:131
lt8491_iio_init_param::init_param
struct lt8491_init_param * init_param
Definition: iio_lt8491.h:55
lt8491_iio_device::active_channels
uint32_t active_channels
Definition: iio_lt8491.h:50
iio_channel::name
const char * name
Definition: iio_types.h:170
lt8491_restart_chip
int lt8491_restart_chip(struct lt8491_desc *dev)
Restart the chip.
Definition: lt8491.c:493
lt8491_read_charging_stage
int lt8491_read_charging_stage(struct lt8491_desc *dev, uint32_t *uval)
Read the telemetry battery charging stage.
Definition: lt8491.c:423
lt8491_read_iin
int lt8491_read_iin(struct lt8491_desc *dev, uint32_t *val)
Read the telemetry battery input current.
Definition: lt8491.c:344
iio_attribute
Structure holding pointers to show and store functions.
Definition: iio_types.h:129
LT8491_IIO_CH_ATTR_READ_RAW
#define LT8491_IIO_CH_ATTR_READ_RAW(_name, _priv)
Definition: iio_lt8491.c:64
LT8491_TBAT
@ LT8491_TBAT
Definition: iio_lt8491.c:81
lt8491_attr_priv
lt8491_attr_priv
Definition: iio_lt8491.c:80
lt8491_iio_remove
int lt8491_iio_remove(struct lt8491_iio_device *iio_device)
Free resources allocated by the init function.
Definition: iio_lt8491.c:500
lt8491_read_vbat
int lt8491_read_vbat(struct lt8491_desc *dev, uint32_t *val)
Read the telemetry battery voltage.
Definition: lt8491.c:368
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
IIO_VOLTAGE
@ IIO_VOLTAGE
Definition: iio_types.h:65
lt8491_iio_init
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
@ LT8491_SCRATCH
Definition: iio_lt8491.c:93
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
LT8491_IIO_CH_ATTR_READ_SCALE
#define LT8491_IIO_CH_ATTR_READ_SCALE(_name, _priv)
Definition: iio_lt8491.c:72
LT8491_ENABLE
@ LT8491_ENABLE
Definition: iio_lt8491.c:91
lt8491_remove
int lt8491_remove(struct lt8491_desc *dev)
Free resources allocated by the init function.
Definition: lt8491.c:138
iio_device::num_ch
uint16_t num_ch
Definition: iio_types.h:252
LT8491_IIO_CH_ATTR_WO
#define LT8491_IIO_CH_ATTR_WO(_name, _priv)
Definition: iio_lt8491.c:56
LT8491_IIN
@ LT8491_IIN
Definition: iio_lt8491.c:86
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
IIO_TEMP
@ IIO_TEMP
Definition: iio_types.h:69
LT8491_POUT
@ LT8491_POUT
Definition: iio_lt8491.c:82
LT8491_IOUT
@ LT8491_IOUT
Definition: iio_lt8491.c:85
lt8491.h
Implementation of LT8491 Driver.
lt8491_read_tbat
int lt8491_read_tbat(struct lt8491_desc *dev, int32_t *val)
Read the telemetry battery temperature.
Definition: lt8491.c:224
NULL
#define NULL
Definition: wrapper.h:64
lt8491_read_efficiency
int lt8491_read_efficiency(struct lt8491_desc *dev, uint32_t *val)
Read the telemetry battery efficiency.
Definition: lt8491.c:296
lt8491_write_enable
int lt8491_write_enable(struct lt8491_desc *dev, uint32_t enable)
Write the telemetry battery charging enable.
Definition: lt8491.c:483
iio_device
Structure holding channels and attributes of a device.
Definition: iio_types.h:247
LT8491_EFF
@ LT8491_EFF
Definition: iio_lt8491.c:84
LT8491_PIN
@ LT8491_PIN
Definition: iio_lt8491.c:83
lt8491_read_enable
int lt8491_read_enable(struct lt8491_desc *dev, uint32_t *enable)
Read the telemetry battery charging enable.
Definition: lt8491.c:463
scan_type
Definition: iio_types.h:151
lt8491_read_pout
int lt8491_read_pout(struct lt8491_desc *dev, uint32_t *val)
Read the telemetry battery output power.
Definition: lt8491.c:248
LT8491_VIN
@ LT8491_VIN
Definition: iio_lt8491.c:88
lt8491_read_serial_id
int lt8491_read_serial_id(struct lt8491_desc *dev, uint32_t *val)
Read the serial ID.
Definition: lt8491.c:543
LT8491_IIO_CH_ATTR_RO
#define LT8491_IIO_CH_ATTR_RO(_name, _priv)
Definition: iio_lt8491.c:48
lt8491_read_pin
int lt8491_read_pin(struct lt8491_desc *dev, uint32_t *val)
Read the telemetry battery input power.
Definition: lt8491.c:272
lt8491_init_param
LT8491 init param.
Definition: lt8491.h:102
errno.h
Error macro definition for ARM Compiler.
lt8491_read_charging_status
int lt8491_read_charging_status(struct lt8491_desc *dev, uint32_t *charging)
Read the telemetry battery charging status.
Definition: lt8491.c:443
LT8491_IIO_CH_ATTR_RW
#define LT8491_IIO_CH_ATTR_RW(_name, _priv)
Definition: iio_lt8491.c:40
IIO_VAL_INT_MULTIPLE
@ IIO_VAL_INT_MULTIPLE
Definition: iio_types.h:54
iio_lt8491.h
Implementation of IIO LT8491 Driver.