no-OS
iio_ltp8800.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef IIO_LTP8800_H
34 #define IIO_LTP8800_H
35 
36 #include <stdbool.h>
37 #include "iio.h"
38 #include "ltp8800.h"
39 
46 };
47 
53 };
54 
58 
61 
62 #endif /* IIO_LTP8800_H */
ltp8800.h
MILLI
#define MILLI
Definition: no_os_units.h:48
no_os_alloc.h
END_ATTRIBUTES_ARRAY
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:116
ltp8800_read_byte
int ltp8800_read_byte(struct ltp8800_dev *dev, uint16_t cmd, uint8_t *data)
Perform a raw PMBus read byte operation.
Definition: ltp8800.c:466
ltp8800_iio_init
int ltp8800_iio_init(struct ltp8800_iio_desc **, struct ltp8800_iio_desc_init_param *)
Initializes the LTP8800 IIO descriptor.
Definition: iio_ltp8800.c:765
LTP8800_VOUT_COMMAND
#define LTP8800_VOUT_COMMAND
Definition: ltp8800.h:57
LTP8800_NM_DIGFILT_LF_GAIN
#define LTP8800_NM_DIGFILT_LF_GAIN
Definition: ltp8800.h:102
IIO_VAL_INT
@ IIO_VAL_INT
Definition: iio_types.h:50
iio_channel
Struct describing the scan type.
Definition: iio_types.h:168
dev_err
#define dev_err(dev, format,...)
Definition: ad9361_util.h:63
LTP8800_IIO_VOUT_CHAN
@ LTP8800_IIO_VOUT_CHAN
Definition: iio_ltp8800.c:53
ltp8800_iio_desc::iio_dev
struct iio_device * iio_dev
Definition: iio_ltp8800.h:45
LTP8800_STATUS_MFR_SPECIFIC
#define LTP8800_STATUS_MFR_SPECIFIC
Definition: ltp8800.h:79
ltp8800_write_byte
int ltp8800_write_byte(struct ltp8800_dev *dev, uint16_t cmd, uint8_t value)
Perform a raw PMBus write byte operation.
Definition: ltp8800.c:507
ltp8800_dev
Definition: ltp8800.h:197
LTP8800_IIN_OC_FAULT_LIMIT
#define LTP8800_IIN_OC_FAULT_LIMIT
Definition: ltp8800.h:68
LTP8800_STORE_USER_ALL
#define LTP8800_STORE_USER_ALL
Definition: ltp8800.h:53
LTP8800_STATUS_VOUT
#define LTP8800_STATUS_VOUT
Definition: ltp8800.h:73
LTP8800_NM_DIGFILT_POLE
#define LTP8800_NM_DIGFILT_POLE
Definition: ltp8800.h:104
LTP8800_MFR_REVISION
#define LTP8800_MFR_REVISION
Definition: ltp8800.h:94
LTP8800_IIO_IOUT_CHAN
@ LTP8800_IIO_IOUT_CHAN
Definition: iio_ltp8800.c:55
ltp8800_limit_type
ltp8800_limit_type
Definition: ltp8800.h:173
iio_desc
Definition: iio.c:204
iio_ch_info
Structure holding channel attributess.
Definition: iio_types.h:103
ltp8800_sync_config
int ltp8800_sync_config(struct ltp8800_dev *dev, bool enable)
Enable or disable sync pin.
Definition: ltp8800.c:887
no_os_units.h
Header file of Units.
IIO_VAL_INT_PLUS_MICRO
@ IIO_VAL_INT_PLUS_MICRO
Definition: iio_types.h:51
ltp8800_iio_desc_init_param
Structure holding the LTP8800 IIO initialization parameter.
Definition: iio_ltp8800.h:51
IIO_VAL_FRACTIONAL
@ IIO_VAL_FRACTIONAL
Definition: iio_types.h:55
LTP8800_IIO_RESTORE_USER_ALL
@ LTP8800_IIO_RESTORE_USER_ALL
Definition: iio_ltp8800.c:62
ltp8800_store_user_settings
int ltp8800_store_user_settings(struct ltp8800_dev *dev)
Store user settings to EEPROM.
Definition: ltp8800.c:989
LTP8800_READ_VOUT
#define LTP8800_READ_VOUT
Definition: ltp8800.h:83
LTP8800_STATUS_OTHER
#define LTP8800_STATUS_OTHER
Definition: ltp8800.h:78
LTP8800_VIN_UV_FAULT_LIMIT
#define LTP8800_VIN_UV_FAULT_LIMIT
Definition: ltp8800.h:67
LTP8800_STATUS_WORD
#define LTP8800_STATUS_WORD
Definition: ltp8800.h:72
ltp8800_iio_init
int ltp8800_iio_init(struct ltp8800_iio_desc **iio_desc, struct ltp8800_iio_desc_init_param *init_param)
Initializes the LTP8800 IIO descriptor.
Definition: iio_ltp8800.c:765
LTP8800_VOUT_SCALE_MONITOR
#define LTP8800_VOUT_SCALE_MONITOR
Definition: ltp8800.h:59
LTP8800_READ_TEMPERATURE_2
#define LTP8800_READ_TEMPERATURE_2
Definition: ltp8800.h:85
ltp8800_init
int ltp8800_init(struct ltp8800_dev **device, struct ltp8800_init_param *init_param)
Initialize the device structure.
Definition: ltp8800.c:289
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
ltp8800_iio_remove
int ltp8800_iio_remove(struct ltp8800_iio_desc *iio_desc)
Free resources allocated by the init function.
Definition: iio_ltp8800.c:800
LTP8800_OPERATION
#define LTP8800_OPERATION
Definition: ltp8800.h:51
LTP8800_STATUS_CML
#define LTP8800_STATUS_CML
Definition: ltp8800.h:77
LTP8800_IIO_TEMP_CHAN
@ LTP8800_IIO_TEMP_CHAN
Definition: iio_ltp8800.c:57
MICRO
#define MICRO
Definition: no_os_units.h:49
LTP8800_NM_DIGFILT_ZERO
#define LTP8800_NM_DIGFILT_ZERO
Definition: ltp8800.h:103
IIO_SHARED_BY_ALL
@ IIO_SHARED_BY_ALL
Definition: iio_types.h:122
LTP8800_STATUS_INPUT
#define LTP8800_STATUS_INPUT
Definition: ltp8800.h:75
LTP8800_NM_DIGFILT_HF_GAIN
#define LTP8800_NM_DIGFILT_HF_GAIN
Definition: ltp8800.h:105
LTP8800_INTERLEAVE_ORDER_MSK
#define LTP8800_INTERLEAVE_ORDER_MSK
Definition: ltp8800.h:146
LTP8800_IIO_STORE_USER_ALL
@ LTP8800_IIO_STORE_USER_ALL
Definition: iio_ltp8800.c:61
LTP8800_RESTORE_USER_ALL
#define LTP8800_RESTORE_USER_ALL
Definition: ltp8800.h:54
ltp8800_write_word_data
int ltp8800_write_word_data(struct ltp8800_dev *dev, uint16_t cmd, int data)
Converts value to register data and do PMBus write word operation.
Definition: ltp8800.c:630
LTP8800_MFR_ID
#define LTP8800_MFR_ID
Definition: ltp8800.h:92
iio.h
Header file of iio.
LTP8800_IC_DEVICE_REV
#define LTP8800_IC_DEVICE_REV
Definition: ltp8800.h:97
no_os_error.h
Error codes definition.
LTP8800_IIO_IIN_CHAN
@ LTP8800_IIO_IIN_CHAN
Definition: iio_ltp8800.c:56
iio_attribute::name
const char * name
Definition: iio_types.h:131
LTP8800_INTERLEAVE
#define LTP8800_INTERLEAVE
Definition: ltp8800.h:64
ltp8800_iio_chan_type
ltp8800_iio_chan_type
Definition: iio_ltp8800.c:52
LTP8800_STATUS_TEMPERATURE
#define LTP8800_STATUS_TEMPERATURE
Definition: ltp8800.h:76
ltp8800_iio_remove
int ltp8800_iio_remove(struct ltp8800_iio_desc *)
Free resources allocated by the init function.
Definition: iio_ltp8800.c:800
iio_channel::name
const char * name
Definition: iio_types.h:170
LTP8800_IOUT
@ LTP8800_IOUT
Definition: ltp8800.h:165
LTP8800_REVISION
#define LTP8800_REVISION
Definition: ltp8800.h:91
iio_attribute
Structure holding pointers to show and store functions.
Definition: iio_types.h:129
ltp8800_set_fault_limit
int ltp8800_set_fault_limit(struct ltp8800_dev *dev, enum ltp8800_limit_type limit, int limit_val)
Set overvalue and undervalue limits.
Definition: ltp8800.c:873
ltp8800_write_word
int ltp8800_write_word(struct ltp8800_dev *dev, uint16_t cmd, uint16_t word)
Perform a raw PMBus write word operation.
Definition: ltp8800.c:580
LTP8800_READ_POUT
#define LTP8800_READ_POUT
Definition: ltp8800.h:89
LTP8800_READ_IIN
#define LTP8800_READ_IIN
Definition: ltp8800.h:82
LTP8800_READ_FREQUENCY
#define LTP8800_READ_FREQUENCY
Definition: ltp8800.h:88
LTP8800_FREQUENCY_SWITCH
#define LTP8800_FREQUENCY_SWITCH
Definition: ltp8800.h:61
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
LTP8800_EEPROM_PASSWORD
#define LTP8800_EEPROM_PASSWORD
Definition: ltp8800.h:99
LTP8800_FORWARD_DIODE_TEMP
@ LTP8800_FORWARD_DIODE_TEMP
Definition: ltp8800.h:166
IIO_VOLTAGE
@ IIO_VOLTAGE
Definition: iio_types.h:65
LTP8800_IC_DEVICE_ID
#define LTP8800_IC_DEVICE_ID
Definition: ltp8800.h:96
ltp8800_iio_user_settings
ltp8800_iio_user_settings
Definition: iio_ltp8800.c:60
ltp8800_send_byte
int ltp8800_send_byte(struct ltp8800_dev *dev, uint16_t cmd)
Send a PMBus command to the device.
Definition: ltp8800.c:439
LTP8800_VOUT_MODE
#define LTP8800_VOUT_MODE
Definition: ltp8800.h:55
LTP8800_IIO_VIN_CHAN
@ LTP8800_IIO_VIN_CHAN
Definition: iio_ltp8800.c:54
LTP8800_VIN
@ LTP8800_VIN
Definition: ltp8800.h:162
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
LTP8800_VIN_ON
#define LTP8800_VIN_ON
Definition: ltp8800.h:62
LTP8800_STATUS_IOUT
#define LTP8800_STATUS_IOUT
Definition: ltp8800.h:74
iio_ch_info::address
uint32_t address
Definition: iio_types.h:113
no_os_field_get
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
iio_channel::attributes
struct iio_attribute * attributes
Definition: iio_types.h:186
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
LTP8800_READ_IOUT
#define LTP8800_READ_IOUT
Definition: ltp8800.h:84
IIO_TEMP
@ IIO_TEMP
Definition: iio_types.h:69
LTP8800_MFR_MODEL
#define LTP8800_MFR_MODEL
Definition: ltp8800.h:93
LTP8800_SYNC_ENABLE_BIT
#define LTP8800_SYNC_ENABLE_BIT
Definition: ltp8800.h:141
LTP8800_READ_TEMPERATURE_3
#define LTP8800_READ_TEMPERATURE_3
Definition: ltp8800.h:86
ltp8800_init_param
Definition: ltp8800.h:209
NULL
#define NULL
Definition: wrapper.h:64
iio_ltp8800.h
Header file for the LTP8800 IIO Driver.
LTP8800_READ_VIN
#define LTP8800_READ_VIN
Definition: ltp8800.h:81
no_os_get_unaligned_be32
uint32_t no_os_get_unaligned_be32(uint8_t *buf)
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
ltp8800_iio_desc
Structure holding the LTP8800 IIO device descriptor.
Definition: iio_ltp8800.h:43
iio_device
Structure holding channels and attributes of a device.
Definition: iio_types.h:247
ltp8800_read_word
int ltp8800_read_word(struct ltp8800_dev *dev, uint16_t cmd, uint16_t *word)
Perform a raw PMBus read word operation.
Definition: ltp8800.c:536
ltp8800_iio_desc::ltp8800_dev
struct ltp8800_dev * ltp8800_dev
Definition: iio_ltp8800.h:44
ltp8800_remove
int ltp8800_remove(struct ltp8800_dev *dev)
Free or remove device instance.
Definition: ltp8800.c:404
LTP8800_VIN_OV_FAULT_LIMIT
#define LTP8800_VIN_OV_FAULT_LIMIT
Definition: ltp8800.h:66
LTP8800_STATUS_BYTE
#define LTP8800_STATUS_BYTE
Definition: ltp8800.h:71
LTP8800_GO_CMD
#define LTP8800_GO_CMD
Definition: ltp8800.h:101
LTP8800_VOUT
@ LTP8800_VOUT
Definition: ltp8800.h:164
LTP8800_VOUT_SCALE_LOOP
#define LTP8800_VOUT_SCALE_LOOP
Definition: ltp8800.h:58
LTP8800_SYNC
#define LTP8800_SYNC
Definition: ltp8800.h:106
LTP8800_POUT_OP_FAULT_LIMIT
#define LTP8800_POUT_OP_FAULT_LIMIT
Definition: ltp8800.h:69
LTP8800_VIN_OFF
#define LTP8800_VIN_OFF
Definition: ltp8800.h:63
no_os_util.h
Header file of utility functions.
LTP8800_PAGE
#define LTP8800_PAGE
Definition: ltp8800.h:50
LTP8800_WRITE_PROTECT
#define LTP8800_WRITE_PROTECT
Definition: ltp8800.h:52
ltp8800_read_block_data
int ltp8800_read_block_data(struct ltp8800_dev *dev, uint16_t cmd, uint8_t *data, size_t nbytes)
Perform a PMBus read block operation.
Definition: ltp8800.c:651
ltp8800_interleave_order
int ltp8800_interleave_order(struct ltp8800_dev *dev, uint8_t order)
Set phase order for polyphase application.
Definition: ltp8800.c:914
LTP8800_IIN
@ LTP8800_IIN
Definition: ltp8800.h:163
LTP8800_READ_DUTY_CYCLE
#define LTP8800_READ_DUTY_CYCLE
Definition: ltp8800.h:87
ltp8800_read_word_data
int ltp8800_read_word_data(struct ltp8800_dev *dev, uint16_t cmd, int *data)
Perform a PMBus read word operation and converts to actual value.
Definition: ltp8800.c:610
ltp8800_iio_desc_init_param::ltp8800_init_param
struct ltp8800_init_param * ltp8800_init_param
Definition: iio_ltp8800.h:52
LTP8800_MFR_SERIAL
#define LTP8800_MFR_SERIAL
Definition: ltp8800.h:95
ltp8800_read_value
int ltp8800_read_value(struct ltp8800_dev *dev, enum ltp8800_value_type value_type, int *value)
Read a value.
Definition: ltp8800.c:710
ltp8800_restore_user_settings
int ltp8800_restore_user_settings(struct ltp8800_dev *dev)
Restore user settings.
Definition: ltp8800.c:1015