no-OS
iio_ltm4686.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef IIO_LTM4686_H
34 #define IIO_LTM4686_H
35 
36 #include <stdbool.h>
37 #include "iio.h"
38 #include "ltm4686.h"
39 
46 };
47 
53 };
54 
58 
61 
62 #endif /* IIO_LTM4686_H */
LTM4686_READ_VIN
#define LTM4686_READ_VIN
Definition: ltm4686.h:106
LTM4686_STATUS_MFR_SPECIFIC
#define LTM4686_STATUS_MFR_SPECIFIC
Definition: ltm4686.h:104
MILLI
#define MILLI
Definition: no_os_units.h:48
LTM4686_CHAN_1
#define LTM4686_CHAN_1
Definition: ltm4686.h:206
no_os_alloc.h
END_ATTRIBUTES_ARRAY
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:116
ltm4686_iio_desc::iio_dev
struct iio_device * iio_dev
Definition: iio_ltm4686.h:45
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
ltm4686_write_byte
int ltm4686_write_byte(struct ltm4686_dev *dev, int page, uint8_t cmd, uint8_t value)
Perform a raw PMBus write byte operation.
Definition: ltm4686.c:743
LTM4686_MFR_FAULT_LOG_CLEAR
#define LTM4686_MFR_FAULT_LOG_CLEAR
Definition: ltm4686.h:152
LTM4673_MFR_FAULT_LOG_RESTORE
#define LTM4673_MFR_FAULT_LOG_RESTORE
Definition: ltm4686.h:181
ltm4686_iio_remove
int ltm4686_iio_remove(struct ltm4686_iio_desc *)
Free resources allocated by the init function.
Definition: iio_ltm4686.c:719
ltm4686_dev::id
enum ltm4686_chip_id id
Definition: ltm4686.h:318
ltm4686_send_byte
int ltm4686_send_byte(struct ltm4686_dev *dev, int page, uint8_t cmd)
Send a PMBus command to the device.
Definition: ltm4686.c:682
ltm4686_read_value
int ltm4686_read_value(struct ltm4686_dev *dev, uint8_t channel, enum ltm4686_value_type value_type, int *value)
Read a value.
Definition: ltm4686.c:946
LTM4686_MFR_VIN_PEAK
#define LTM4686_MFR_VIN_PEAK
Definition: ltm4686.h:144
ltm4686_read_word_data
int ltm4686_read_word_data(struct ltm4686_dev *dev, int page, uint8_t cmd, int *data)
Perform a PMBus read word operation and converts to actual value.
Definition: ltm4686.c:845
LTM4686_STATUS_VOUT
#define LTM4686_STATUS_VOUT
Definition: ltm4686.h:99
LTM4686_OT_FAULT_LIMIT
#define LTM4686_OT_FAULT_LIMIT
Definition: ltm4686.h:78
iio_desc
Definition: iio.c:204
iio_ch_info
Structure holding channel attributess.
Definition: iio_types.h:103
LTM4686_CHAN_0
#define LTM4686_CHAN_0
Definition: ltm4686.h:205
LTM4686_STATUS_IOUT
#define LTM4686_STATUS_IOUT
Definition: ltm4686.h:100
no_os_units.h
Header file of Units.
LTM4686_MFR_RESTART_DELAY
#define LTM4686_MFR_RESTART_DELAY
Definition: ltm4686.h:142
LTM4686_MFR_VOUT_PEAK
#define LTM4686_MFR_VOUT_PEAK
Definition: ltm4686.h:143
LTM4686_STORE_USER_ALL
#define LTM4686_STORE_USER_ALL
Definition: ltm4686.h:50
IIO_VAL_INT_PLUS_MICRO
@ IIO_VAL_INT_PLUS_MICRO
Definition: iio_types.h:51
LTM4686_VOUT_MARGIN_HIGH
#define LTM4686_VOUT_MARGIN_HIGH
Definition: ltm4686.h:59
LTM4686_READ_TEMPERATURE_2
#define LTM4686_READ_TEMPERATURE_2
Definition: ltm4686.h:111
LTM4686_MFR_USER_DATA_03
#define LTM4686_MFR_USER_DATA_03
Definition: ltm4686.h:124
LTM4686_IIO_LIM
#define LTM4686_IIO_LIM(_name, _reg, _chan)
Definition: iio_ltm4686.c:789
LTM4686_MFR_PWM_MODE
#define LTM4686_MFR_PWM_MODE
Definition: ltm4686.h:135
IIO_VAL_FRACTIONAL
@ IIO_VAL_FRACTIONAL
Definition: iio_types.h:55
LTM4686_IIO_VOUT_CHAN_GROUP
#define LTM4686_IIO_VOUT_CHAN_GROUP(inst)
Definition: iio_ltm4686.c:48
LTM4686_STATUS_TEMPERATURE
#define LTM4686_STATUS_TEMPERATURE
Definition: ltm4686.h:102
ltm4686_read_word
int ltm4686_read_word(struct ltm4686_dev *dev, int page, uint8_t cmd, uint16_t *word)
Perform a raw PMBus read word operation.
Definition: ltm4686.c:773
ltm4686_init_param
Definition: ltm4686.h:325
ltm4686_write_word
int ltm4686_write_word(struct ltm4686_dev *dev, int page, uint8_t cmd, uint16_t word)
Perform a raw PMBus write word operation.
Definition: ltm4686.c:815
LTM4686_MFR_FAULT_LOG_STORE
#define LTM4686_MFR_FAULT_LOG_STORE
Definition: ltm4686.h:151
LTM4686_TON_RISE
#define LTM4686_TON_RISE
Definition: ltm4686.h:90
LTM4686_MFR_PADS
#define LTM4686_MFR_PADS
Definition: ltm4686.h:147
LTM4686_READ_VOUT
#define LTM4686_READ_VOUT
Definition: ltm4686.h:108
ltm4686_iio_desc_init_param
Structure holding the LTM4686 IIO initialization parameter.
Definition: iio_ltm4686.h:51
LTM4686_SMBALERT_MASK
#define LTM4686_SMBALERT_MASK
Definition: ltm4686.h:54
LTM4686_CHAN_ALL
#define LTM4686_CHAN_ALL
Definition: ltm4686.h:209
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
LTM4686_MFR_CONFIG_ALL
#define LTM4686_MFR_CONFIG_ALL
Definition: ltm4686.h:133
LTM4686_TON_DELAY
#define LTM4686_TON_DELAY
Definition: ltm4686.h:89
LTM4686_MFR_MODEL
#define LTM4686_MFR_MODEL
Definition: ltm4686.h:117
MICRO
#define MICRO
Definition: no_os_units.h:49
LTM4686_STATUS_INPUT
#define LTM4686_STATUS_INPUT
Definition: ltm4686.h:101
IIO_SHARED_BY_ALL
@ IIO_SHARED_BY_ALL
Definition: iio_types.h:122
LTM4686_MFR_USER_DATA_00
#define LTM4686_MFR_USER_DATA_00
Definition: ltm4686.h:121
LTM4686_IOUT_OC_WARN_LIMIT
#define LTM4686_IOUT_OC_WARN_LIMIT
Definition: ltm4686.h:76
ltm4686_dev::num_channels
uint8_t num_channels
Definition: ltm4686.h:322
LTM4686_VIN_UV_WARN_LIMIT
#define LTM4686_VIN_UV_WARN_LIMIT
Definition: ltm4686.h:86
ltm4686_iio_desc_init_param::ltm4686_init_param
struct ltm4686_init_param * ltm4686_init_param
Definition: iio_ltm4686.h:52
LTM4686_TOFF_DELAY
#define LTM4686_TOFF_DELAY
Definition: ltm4686.h:93
iio.h
Header file of iio.
no_os_error.h
Error codes definition.
LTM4673_MFR_WATCHDOG_T
#define LTM4673_MFR_WATCHDOG_T
Definition: ltm4686.h:177
LTM4686_MFR_IOUT_PEAK
#define LTM4686_MFR_IOUT_PEAK
Definition: ltm4686.h:138
LTM4686_CHAN_3
#define LTM4686_CHAN_3
Definition: ltm4686.h:208
LTM4673_MFR_DAC
#define LTM4673_MFR_DAC
Definition: ltm4686.h:174
iio_attribute::name
const char * name
Definition: iio_types.h:131
LTM4686_VOUT_MARGIN_LOW
#define LTM4686_VOUT_MARGIN_LOW
Definition: ltm4686.h:60
LTM4686_CLEAR_FAULTS
#define LTM4686_CLEAR_FAULTS
Definition: ltm4686.h:45
LTM4686_MFR_IIN_OFFSET
#define LTM4686_MFR_IIN_OFFSET
Definition: ltm4686.h:150
LTM4686_READ_TEMPERATURE_1
#define LTM4686_READ_TEMPERATURE_1
Definition: ltm4686.h:110
iio_channel::name
const char * name
Definition: iio_types.h:170
LTM4686_MFR_RETRY_DELAY
#define LTM4686_MFR_RETRY_DELAY
Definition: ltm4686.h:141
LTM4686_MFR_ID
#define LTM4686_MFR_ID
Definition: ltm4686.h:116
LT7182S_IIO_OUTPUT_ENABLE
@ LT7182S_IIO_OUTPUT_ENABLE
Definition: iio_ltm4686.c:56
ltm4686_iio_init
int ltm4686_iio_init(struct ltm4686_iio_desc **iio_desc, struct ltm4686_iio_desc_init_param *init_param)
Initializes the LTM4686 IIO descriptor.
Definition: iio_ltm4686.c:681
ltm4686_read_block_data
int ltm4686_read_block_data(struct ltm4686_dev *dev, int page, uint8_t cmd, uint8_t *data, size_t nbytes)
Perform a PMBus read block operation.
Definition: ltm4686.c:890
iio_ltm4686.h
Header file for the LTM4686 IIO Driver.
iio_attribute
Structure holding pointers to show and store functions.
Definition: iio_types.h:129
LTM4686_MFR_ADDRESS
#define LTM4686_MFR_ADDRESS
Definition: ltm4686.h:148
LTM4686_RESTORE_USER_ALL
#define LTM4686_RESTORE_USER_ALL
Definition: ltm4686.h:51
LTM4686_IIO_TEMP_CHAN
@ LTM4686_IIO_TEMP_CHAN
Definition: iio_ltm4686.c:68
LT7182S_IIO_SYNC_ENABLE
@ LT7182S_IIO_SYNC_ENABLE
Definition: iio_ltm4686.c:58
LTM4686_CHAN_2
#define LTM4686_CHAN_2
Definition: ltm4686.h:207
LT7182S_IIO_PULSE_ENABLE
@ LT7182S_IIO_PULSE_ENABLE
Definition: iio_ltm4686.c:57
LTM4686_TOFF_MAX_WARN_LIMIT
#define LTM4686_TOFF_MAX_WARN_LIMIT
Definition: ltm4686.h:95
LTM4686_IIO_CHAN
#define LTM4686_IIO_CHAN(x)
Definition: iio_ltm4686.c:46
no_os_clamp
#define no_os_clamp(val, min_val, max_val)
Definition: no_os_util.h:69
IIO_CURRENT
@ IIO_CURRENT
Definition: iio_types.h:66
LTM4686_TON_MAX_FAULT_LIMIT
#define LTM4686_TON_MAX_FAULT_LIMIT
Definition: ltm4686.h:91
iio_parse_value
int32_t iio_parse_value(char *buf, enum iio_val fmt, int32_t *val, int32_t *val2)
Definition: iio.c:630
LTM4686_FREQUENCY_SWITCH
#define LTM4686_FREQUENCY_SWITCH
Definition: ltm4686.h:63
LTM4686_VOUT_OV_FAULT_LIMIT
#define LTM4686_VOUT_OV_FAULT_LIMIT
Definition: ltm4686.h:68
IIO_VOLTAGE
@ IIO_VOLTAGE
Definition: iio_types.h:65
ltm4686_iio_remove
int ltm4686_iio_remove(struct ltm4686_iio_desc *iio_desc)
Free resources allocated by the init function.
Definition: iio_ltm4686.c:719
LTM4686_MFR_TEMPERATURE_1_PEAK
#define LTM4686_MFR_TEMPERATURE_1_PEAK
Definition: ltm4686.h:145
LTM4686_MFR_SPECIAL_ID
#define LTM4686_MFR_SPECIAL_ID
Definition: ltm4686.h:149
LTM4686_MFR_CHAN_CONFIG
#define LTM4686_MFR_CHAN_CONFIG
Definition: ltm4686.h:132
ltm4686_iio_desc
Structure holding the LTM4686 IIO device descriptor.
Definition: iio_ltm4686.h:43
LTM4686_MFR_COMPARE_USER_ALL
#define LTM4686_MFR_COMPARE_USER_ALL
Definition: ltm4686.h:156
LTM4686_STATUS_CML
#define LTM4686_STATUS_CML
Definition: ltm4686.h:103
lt7182s_iio_enable_type
lt7182s_iio_enable_type
Definition: iio_lt7182s.c:52
ltm4686_read_byte
int ltm4686_read_byte(struct ltm4686_dev *dev, int page, uint8_t cmd, uint8_t *data)
Perform a raw PMBus read byte operation.
Definition: ltm4686.c:704
LTM4686_TOFF_FALL
#define LTM4686_TOFF_FALL
Definition: ltm4686.h:94
LTM4686_OT_WARN_LIMIT
#define LTM4686_OT_WARN_LIMIT
Definition: ltm4686.h:80
ltm4686_set_operation
int ltm4686_set_operation(struct ltm4686_dev *dev, uint8_t channel, enum ltm4686_operation_type operation)
Set channel operation.
Definition: ltm4686.c:1213
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
LTM4686_IIO_STATUS
#define LTM4686_IIO_STATUS(_name, _reg, _chan)
Definition: iio_ltm4686.c:828
iio_ch_info::address
uint32_t address
Definition: iio_types.h:113
LTM4686_IOUT_OC_FAULT_LIMIT
#define LTM4686_IOUT_OC_FAULT_LIMIT
Definition: ltm4686.h:74
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
LTM4686_READ_IIN
#define LTM4686_READ_IIN
Definition: ltm4686.h:107
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
LTM4686_MFR_USER_DATA_01
#define LTM4686_MFR_USER_DATA_01
Definition: ltm4686.h:122
LTM4686_IIO_REG
#define LTM4686_IIO_REG(x)
Definition: iio_ltm4686.c:45
LTM4686_VOUT_TRANSITION_RATE
#define LTM4686_VOUT_TRANSITION_RATE
Definition: ltm4686.h:61
LTM4686_VOUT_MAX
#define LTM4686_VOUT_MAX
Definition: ltm4686.h:58
ltm4686_iio_desc::ltm4686_dev
struct ltm4686_dev * ltm4686_dev
Definition: iio_ltm4686.h:44
IIO_TEMP
@ IIO_TEMP
Definition: iio_types.h:69
LTM4686_OPERATION_ON
@ LTM4686_OPERATION_ON
Definition: ltm4686.h:246
LTM4673_MFR_IIN_CAL_GAIN
#define LTM4673_MFR_IIN_CAL_GAIN
Definition: ltm4686.h:179
LTM4673_MFR_PGD_ASSERTION_DELAY
#define LTM4673_MFR_PGD_ASSERTION_DELAY
Definition: ltm4686.h:175
no_os_get_unaligned_be32
uint32_t no_os_get_unaligned_be32(uint8_t *buf)
LTM4686_VOUT_COMMAND
#define LTM4686_VOUT_COMMAND
Definition: ltm4686.h:57
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
LTM4686_READ_IOUT
#define LTM4686_READ_IOUT
Definition: ltm4686.h:109
iio_device
Structure holding channels and attributes of a device.
Definition: iio_types.h:247
LTM4686_IIO_VIN_CHAN
@ LTM4686_IIO_VIN_CHAN
Definition: iio_ltm4686.c:66
LTM4686_IIO_IIN_CHAN
@ LTM4686_IIO_IIN_CHAN
Definition: iio_ltm4686.c:67
LTM4686_VIN_OFF
#define LTM4686_VIN_OFF
Definition: ltm4686.h:65
LTM4686_VIN_ON
#define LTM4686_VIN_ON
Definition: ltm4686.h:64
LTM4686_MFR_GPIO_PROPAGATE
#define LTM4686_MFR_GPIO_PROPAGATE
Definition: ltm4686.h:134
LTM4686_VOUT_UV_FAULT_LIMIT
#define LTM4686_VOUT_UV_FAULT_LIMIT
Definition: ltm4686.h:72
LTM4686_IIN_OC_WARN_LIMIT
#define LTM4686_IIN_OC_WARN_LIMIT
Definition: ltm4686.h:87
ltm4686.h
Header file of the LTM4686 driver.
LTM4686_MFR_USER_DATA_02
#define LTM4686_MFR_USER_DATA_02
Definition: ltm4686.h:123
ltm4686_dev
Definition: ltm4686.h:311
LTM4686_OPERATION_OFF
@ LTM4686_OPERATION_OFF
Definition: ltm4686.h:245
ltm4686_iio_chan_type
ltm4686_iio_chan_type
Definition: iio_ltm4686.c:61
LTM4686_VIN_OV_FAULT_LIMIT
#define LTM4686_VIN_OV_FAULT_LIMIT
Definition: ltm4686.h:84
LTM4686_MFR_SERIAL
#define LTM4686_MFR_SERIAL
Definition: ltm4686.h:118
ltm4686_write_word_data
int ltm4686_write_word_data(struct ltm4686_dev *dev, int page, uint8_t cmd, int data)
Converts value to register data and do PMBus write word operation.
Definition: ltm4686.c:867
ltm4686_iio_init
int ltm4686_iio_init(struct ltm4686_iio_desc **, struct ltm4686_iio_desc_init_param *)
Initializes the LTM4686 IIO descriptor.
Definition: iio_ltm4686.c:681
LTM4673_MFR_WATCHDOG_T_FIRST
#define LTM4673_MFR_WATCHDOG_T_FIRST
Definition: ltm4686.h:176
no_os_util.h
Header file of utility functions.
LTM4686_MFR_RESET
#define LTM4686_MFR_RESET
Definition: ltm4686.h:163
LTM4686_OPERATION
#define LTM4686_OPERATION
Definition: ltm4686.h:43
LTM4686_MFR_CLEAR_PEAKS
#define LTM4686_MFR_CLEAR_PEAKS
Definition: ltm4686.h:146
LTM4686_VOUT_UV_WARN_LIMIT
#define LTM4686_VOUT_UV_WARN_LIMIT
Definition: ltm4686.h:71
LTM4686_READ_POUT
#define LTM4686_READ_POUT
Definition: ltm4686.h:113
ID_LTM4673
@ ID_LTM4673
Definition: ltm4686.h:236
LTM4686_STATUS_WORD
#define LTM4686_STATUS_WORD
Definition: ltm4686.h:98
ltm4686_dev::page
int page
Definition: ltm4686.h:319
LTM4686_MFR_ADC_CONTROL
#define LTM4686_MFR_ADC_CONTROL
Definition: ltm4686.h:139
LTM4686_VOUT_OV_WARN_LIMIT
#define LTM4686_VOUT_OV_WARN_LIMIT
Definition: ltm4686.h:70
LTM4686_PAGE_PLUS_READ
#define LTM4686_PAGE_PLUS_READ
Definition: ltm4686.h:47
ltm4686_init
int ltm4686_init(struct ltm4686_dev **device, struct ltm4686_init_param *init_param)
Initialize the device structure.
Definition: ltm4686.c:460
ltm4686_remove
int ltm4686_remove(struct ltm4686_dev *dev)
Free or remove device instance.
Definition: ltm4686.c:592