no-OS
iio_lt7170.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef IIO_LT7170_H
40 #define IIO_LT7170_H
41 
42 #include <stdbool.h>
43 #include "iio.h"
44 #include "lt7170.h"
45 
52 };
53 
59 };
60 
62 int lt7170_iio_init(struct lt7170_iio_desc **,
64 
67 
68 #endif /* IIO_LT7170_H */
lt7170_iio_desc_init_param
Structure holding the LT7170 IIO initialization parameter.
Definition: iio_lt7170.h:57
LT7170_VIN_OV_FAULT_RESPONSE
#define LT7170_VIN_OV_FAULT_RESPONSE
Definition: lt7170.h:100
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
LT7170_IOUT_CAL_OFFSET
#define LT7170_IOUT_CAL_OFFSET
Definition: lt7170.h:86
lt7170_iio_pwm_params
lt7170_iio_pwm_params
Definition: iio_lt7170.c:60
LT7170_IIO_VOUT_CHAN
@ LT7170_IIO_VOUT_CHAN
Definition: iio_lt7170.c:66
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
LT7170_CLEAR_FAULTS
#define LT7170_CLEAR_FAULTS
Definition: lt7170.h:60
LT7170_VOUT_MARGIN_LOW
#define LT7170_VOUT_MARGIN_LOW
Definition: lt7170.h:79
LT7170_VOUT_UV_WARN_LIMIT
#define LT7170_VOUT_UV_WARN_LIMIT
Definition: lt7170.h:90
LT7170_MFR_FAULT_RESPONSE
#define LT7170_MFR_FAULT_RESPONSE
Definition: lt7170.h:145
lt7170.h
LT7170_ZONE_CONFIG
#define LT7170_ZONE_CONFIG
Definition: lt7170.h:63
LT7170_PAGE_PLUS_READ
#define LT7170_PAGE_PLUS_READ
Definition: lt7170.h:62
LT7170_VOUT_OV_FAULT_RESPONSE
#define LT7170_VOUT_OV_FAULT_RESPONSE
Definition: lt7170.h:88
iio_desc
Definition: iio.c:204
iio_ch_info
Structure holding channel attributess.
Definition: iio_types.h:103
LT7170_VOUT_MARGIN_HIGH
#define LT7170_VOUT_MARGIN_HIGH
Definition: lt7170.h:78
no_os_units.h
Header file of Units.
IIO_VAL_INT_PLUS_MICRO
@ IIO_VAL_INT_PLUS_MICRO
Definition: iio_types.h:51
IIO_VAL_FRACTIONAL
@ IIO_VAL_FRACTIONAL
Definition: iio_types.h:55
LT7170_IIO_PWM_FREQUENCY
@ LT7170_IIO_PWM_FREQUENCY
Definition: iio_lt7170.c:61
LT7170_TON_RISE
#define LT7170_TON_RISE
Definition: lt7170.h:104
LT7170_STORE_USER_ALL
#define LT7170_STORE_USER_ALL
Definition: lt7170.h:68
lt7170_write_word_data
int lt7170_write_word_data(struct lt7170_dev *dev, uint8_t cmd, int data)
Converts value to register data and do PMBus write word operation.
Definition: lt7170.c:613
LT7170_MFR_DISCHARGE_THRESHOLD
#define LT7170_MFR_DISCHARGE_THRESHOLD
Definition: lt7170.h:155
LT7170_MFR_PGOOD_DELAY
#define LT7170_MFR_PGOOD_DELAY
Definition: lt7170.h:162
LT7170_READ_FREQUENCY
#define LT7170_READ_FREQUENCY
Definition: lt7170.h:124
lt7170_iio_desc
Structure holding the LT7170 IIO device descriptor.
Definition: iio_lt7170.h:49
lt7170_dev
Definition: lt7170.h:294
LT7170_IC_DEVICE_REV
#define LT7170_IC_DEVICE_REV
Definition: lt7170.h:131
LT7170_MFR_USER_DATA_01
#define LT7170_MFR_USER_DATA_01
Definition: lt7170.h:137
LT7170_MFR_CHANNEL_STATE
#define LT7170_MFR_CHANNEL_STATE
Definition: lt7170.h:161
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
LT7170_VOUT_OV_WARN_LIMIT
#define LT7170_VOUT_OV_WARN_LIMIT
Definition: lt7170.h:89
LT7170_MFR_NOT_PGOOD_DELAY
#define LT7170_MFR_NOT_PGOOD_DELAY
Definition: lt7170.h:163
LT7170_TOFF_DELAY
#define LT7170_TOFF_DELAY
Definition: lt7170.h:107
lt7170_init_param
Definition: lt7170.h:306
lt7170_iio_desc::lt7170_dev
struct lt7170_dev * lt7170_dev
Definition: iio_lt7170.h:50
lt7170_sync_config
int lt7170_sync_config(struct lt7170_dev *dev, bool input_clk, bool output_clk)
Configure SYNC pin for clock synchronization.
Definition: lt7170.c:966
lt7170_iio_remove
int lt7170_iio_remove(struct lt7170_iio_desc *iio_desc)
Free resources allocated by the init function.
Definition: iio_lt7170.c:798
LT7170_VIN_OFF
#define LT7170_VIN_OFF
Definition: lt7170.h:84
MICRO
#define MICRO
Definition: no_os_units.h:49
LT7170_IC_DEVICE_ID
#define LT7170_IC_DEVICE_ID
Definition: lt7170.h:130
LT7170_OPERATION
#define LT7170_OPERATION
Definition: lt7170.h:58
lt7170_read_value
int lt7170_read_value(struct lt7170_dev *dev, enum lt7170_value_type value_type, int *value)
Read a value.
Definition: lt7170.c:680
LT7170_VOUT_TRANSITION_RATE
#define LT7170_VOUT_TRANSITION_RATE
Definition: lt7170.h:80
LT7170_VIN_UV_WARN_LIMIT
#define LT7170_VIN_UV_WARN_LIMIT
Definition: lt7170.h:101
LT7170_MFR_RESET
#define LT7170_MFR_RESET
Definition: lt7170.h:170
LT7170_MFR_COMPARE_USER_ALL
#define LT7170_MFR_COMPARE_USER_ALL
Definition: lt7170.h:160
LT7170_IIO_VIN_CHAN
@ LT7170_IIO_VIN_CHAN
Definition: iio_lt7170.c:67
lt7170_write_byte
int lt7170_write_byte(struct lt7170_dev *dev, uint8_t cmd, uint8_t value)
Perform a raw PMBus write byte operation.
Definition: lt7170.c:519
IIO_SHARED_BY_ALL
@ IIO_SHARED_BY_ALL
Definition: iio_types.h:122
LT7170_IIO_TEMP_CHAN
@ LT7170_IIO_TEMP_CHAN
Definition: iio_lt7170.c:69
LT7170_MFR_VOUT_PEAK
#define LT7170_MFR_VOUT_PEAK
Definition: lt7170.h:149
lt7170_pwm_phase
int lt7170_pwm_phase(struct lt7170_dev *dev, int phase)
Set output PWM phase.
Definition: lt7170.c:904
LT7170_OT_FAULT_RESPONSE
#define LT7170_OT_FAULT_RESPONSE
Definition: lt7170.h:97
lt7170_read_block_data
int lt7170_read_block_data(struct lt7170_dev *dev, uint8_t cmd, uint8_t *data, size_t nbytes)
Perform a PMBus read block operation.
Definition: lt7170.c:633
LT7170_PADS_RUN_BIT
#define LT7170_PADS_RUN_BIT
Definition: lt7170.h:210
LT7170_OT_WARN_LIMIT
#define LT7170_OT_WARN_LIMIT
Definition: lt7170.h:98
iio.h
Header file of iio.
no_os_error.h
Error codes definition.
LT7170_STATUS_INPUT
#define LT7170_STATUS_INPUT
Definition: lt7170.h:115
iio_attribute::name
const char * name
Definition: iio_types.h:131
LT7170_OT_FAULT_LIMIT
#define LT7170_OT_FAULT_LIMIT
Definition: lt7170.h:96
LT7170_MFR_PADS
#define LT7170_MFR_PADS
Definition: lt7170.h:156
LT7170_WRITE_PROTECT
#define LT7170_WRITE_PROTECT
Definition: lt7170.h:66
lt7170_pwm_mode
lt7170_pwm_mode
Definition: lt7170.h:289
LT7170_STATUS_TEMPERATURE
#define LT7170_STATUS_TEMPERATURE
Definition: lt7170.h:116
iio_channel::name
const char * name
Definition: iio_types.h:170
LT7170_MFR_IOUT_PEAK
#define LT7170_MFR_IOUT_PEAK
Definition: lt7170.h:146
lt7170_remove
int lt7170_remove(struct lt7170_dev *dev)
Free or remove device instance.
Definition: lt7170.c:428
LT7170_STATUS_IOUT
#define LT7170_STATUS_IOUT
Definition: lt7170.h:114
LT7170_FREQUENCY_SWITCH
#define LT7170_FREQUENCY_SWITCH
Definition: lt7170.h:82
LT7170_READ_VOUT
#define LT7170_READ_VOUT
Definition: lt7170.h:121
lt7170_switch_freq
int lt7170_switch_freq(struct lt7170_dev *dev, int freq)
Set switching frequency.
Definition: lt7170.c:866
lt7170_iio_desc::iio_dev
struct iio_device * iio_dev
Definition: iio_lt7170.h:51
LT7170_MFR_READ_ITH
#define LT7170_MFR_READ_ITH
Definition: lt7170.h:139
iio_attribute
Structure holding pointers to show and store functions.
Definition: iio_types.h:129
LT7170_MFR_COMMON
#define LT7170_MFR_COMMON
Definition: lt7170.h:159
LT7170_VIN_ON
#define LT7170_VIN_ON
Definition: lt7170.h:83
LT7170_MFR_FAULT_PROPAGATE
#define LT7170_MFR_FAULT_PROPAGATE
Definition: lt7170.h:142
LT7170_REVISION
#define LT7170_REVISION
Definition: lt7170.h:126
LT7170_VOUT_UV_FAULT_RESPONSE
#define LT7170_VOUT_UV_FAULT_RESPONSE
Definition: lt7170.h:92
LT7170_MFR_DISABLE_OUTPUT
#define LT7170_MFR_DISABLE_OUTPUT
Definition: lt7170.h:168
LT7170_MFR_CLEAR_PEAKS
#define LT7170_MFR_CLEAR_PEAKS
Definition: lt7170.h:154
LT7170_STATUS_MFR_SPECIFIC
#define LT7170_STATUS_MFR_SPECIFIC
Definition: lt7170.h:118
LT7170_MFR_ADC_CONTROL
#define LT7170_MFR_ADC_CONTROL
Definition: lt7170.h:147
lt7170_iio_remove
int lt7170_iio_remove(struct lt7170_iio_desc *)
Free resources allocated by the init function.
Definition: iio_lt7170.c:798
no_os_clamp
#define no_os_clamp(val, min_val, max_val)
Definition: no_os_util.h:69
LT7170_IOUT_OC_WARN_LIMIT
#define LT7170_IOUT_OC_WARN_LIMIT
Definition: lt7170.h:94
IIO_CURRENT
@ IIO_CURRENT
Definition: iio_types.h:66
LT7170_TOFF_MAX_WARN_LIMIT
#define LT7170_TOFF_MAX_WARN_LIMIT
Definition: lt7170.h:109
iio_parse_value
int32_t iio_parse_value(char *buf, enum iio_val fmt, int32_t *val, int32_t *val2)
Definition: iio.c:630
LT7170_MFR_PWM_PHASE
#define LT7170_MFR_PWM_PHASE
Definition: lt7170.h:164
LT7170_SMBALERT_MASK
#define LT7170_SMBALERT_MASK
Definition: lt7170.h:73
IIO_VOLTAGE
@ IIO_VOLTAGE
Definition: iio_types.h:65
LT7170_RESTORE_USER_ALL
#define LT7170_RESTORE_USER_ALL
Definition: lt7170.h:69
LT7170_ON_OFF_CONFIG
#define LT7170_ON_OFF_CONFIG
Definition: lt7170.h:59
LT7170_MFR_READ_ASEL
#define LT7170_MFR_READ_ASEL
Definition: lt7170.h:143
lt7170_send_byte
int lt7170_send_byte(struct lt7170_dev *dev, uint8_t cmd)
Send a PMBus command to the device.
Definition: lt7170.c:469
LT7170_ZONE_ACTIVE
#define LT7170_ZONE_ACTIVE
Definition: lt7170.h:64
lt7170_iio_init
int lt7170_iio_init(struct lt7170_iio_desc **, struct lt7170_iio_desc_init_param *)
Initializes the LT7170 IIO descriptor.
Definition: iio_lt7170.c:763
LT7170_MFR_TEMPERATURE_1_PEAK
#define LT7170_MFR_TEMPERATURE_1_PEAK
Definition: lt7170.h:151
LT7170_VOUT_OV_FAULT_LIMIT
#define LT7170_VOUT_OV_FAULT_LIMIT
Definition: lt7170.h:87
LT7170_MFR_ID
#define LT7170_MFR_ID
Definition: lt7170.h:127
LT7170_TOFF_FALL
#define LT7170_TOFF_FALL
Definition: lt7170.h:108
iio_lt7170.h
Header file for the LT7170 IIO Driver.
LT7170_IIO_SYNC_ENABLE
@ LT7170_IIO_SYNC_ENABLE
Definition: iio_lt7170.c:57
lt7170_iio_chan_type
lt7170_iio_chan_type
Definition: iio_lt7170.c:65
lt7170_limit_type
lt7170_limit_type
Definition: lt7170.h:248
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
lt7170_read_byte
int lt7170_read_byte(struct lt7170_dev *dev, uint8_t cmd, uint8_t *data)
Perform a raw PMBus read byte operation.
Definition: lt7170.c:488
iio_ch_info::address
uint32_t address
Definition: iio_types.h:113
LT7170_STATUS_BYTE
#define LT7170_STATUS_BYTE
Definition: lt7170.h:111
LT7170_IIO_PULSE_ENABLE
@ LT7170_IIO_PULSE_ENABLE
Definition: iio_lt7170.c:56
LT7170_MFR_SERIAL
#define LT7170_MFR_SERIAL
Definition: lt7170.h:128
no_os_field_get
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
LT7170_VOUT_MODE
#define LT7170_VOUT_MODE
Definition: lt7170.h:75
lt7170_set_limit
int lt7170_set_limit(struct lt7170_dev *dev, enum lt7170_limit_type limit, int limit_val)
Set overvalue and undervalue limits.
Definition: lt7170.c:925
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
LT7170_STATUS_CML
#define LT7170_STATUS_CML
Definition: lt7170.h:117
LT7170_CAPABILITY
#define LT7170_CAPABILITY
Definition: lt7170.h:71
IIO_TEMP
@ IIO_TEMP
Definition: iio_types.h:69
lt7170_read_word_data
int lt7170_read_word_data(struct lt7170_dev *dev, uint8_t cmd, int *data)
Perform a PMBus read word operation and converts to actual value.
Definition: lt7170.c:594
lt7170_iio_enable_type
lt7170_iio_enable_type
Definition: iio_lt7170.c:54
LT7170_MFR_RETRY_DELAY
#define LT7170_MFR_RETRY_DELAY
Definition: lt7170.h:148
LT7170_PAGE
#define LT7170_PAGE
Definition: lt7170.h:57
lt7170_init
int lt7170_init(struct lt7170_dev **device, struct lt7170_init_param *init_param)
Initialize the device structure.
Definition: lt7170.c:304
LT7170_IIO_PWM_PHASE
@ LT7170_IIO_PWM_PHASE
Definition: iio_lt7170.c:62
lt7170_iio_desc_init_param::lt7170_init_param
struct lt7170_init_param * lt7170_init_param
Definition: iio_lt7170.h:58
LT7170_MFR_PWM_MODE
#define LT7170_MFR_PWM_MODE
Definition: lt7170.h:144
LT7170_PWM_OP_MODE_BIT
#define LT7170_PWM_OP_MODE_BIT
Definition: lt7170.h:204
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
LT7170_SYNC_CLK_OUTPUT_BIT
#define LT7170_SYNC_CLK_OUTPUT_BIT
Definition: lt7170.h:206
lt7170_set_channel_state
int lt7170_set_channel_state(struct lt7170_dev *dev, bool state)
Set channel state using the RUN pin.
Definition: lt7170.c:954
iio_device
Structure holding channels and attributes of a device.
Definition: iio_types.h:247
LT7170_IOUT_OC_FAULT_RESPONSE
#define LT7170_IOUT_OC_FAULT_RESPONSE
Definition: lt7170.h:93
LT7170_VOUT_MAX
#define LT7170_VOUT_MAX
Definition: lt7170.h:77
LT7170_IIO_OUTPUT_ENABLE
@ LT7170_IIO_OUTPUT_ENABLE
Definition: iio_lt7170.c:55
LT7170_STATUS_VOUT
#define LT7170_STATUS_VOUT
Definition: lt7170.h:113
LT7170_VOUT_COMMAND
#define LT7170_VOUT_COMMAND
Definition: lt7170.h:76
lt7170_iio_init
int lt7170_iio_init(struct lt7170_iio_desc **iio_desc, struct lt7170_iio_desc_init_param *init_param)
Initializes the LT7170 IIO descriptor.
Definition: iio_lt7170.c:763
LT7170_STATUS_WORD
#define LT7170_STATUS_WORD
Definition: lt7170.h:112
LT7170_TON_MAX_FAULT_RESPONSE
#define LT7170_TON_MAX_FAULT_RESPONSE
Definition: lt7170.h:106
LT7170_MFR_CHAN_CONFIG
#define LT7170_MFR_CHAN_CONFIG
Definition: lt7170.h:140
LT7170_TON_DELAY
#define LT7170_TON_DELAY
Definition: lt7170.h:103
LT7170_FREQUENCY
@ LT7170_FREQUENCY
Definition: lt7170.h:239
LT7170_READ_TEMPERATURE_1
#define LT7170_READ_TEMPERATURE_1
Definition: lt7170.h:123
LT7170_READ_VIN
#define LT7170_READ_VIN
Definition: lt7170.h:120
LT7170_MFR_SYNC_CONFIG
#define LT7170_MFR_SYNC_CONFIG
Definition: lt7170.h:165
LT7170_VOUT_UV_FAULT_LIMIT
#define LT7170_VOUT_UV_FAULT_LIMIT
Definition: lt7170.h:91
LT7170_IIO_VCC_CHAN
@ LT7170_IIO_VCC_CHAN
Definition: iio_lt7170.c:70
LT7170_MFR_SPECIAL_ID
#define LT7170_MFR_SPECIAL_ID
Definition: lt7170.h:158
LT7170_QUERY
#define LT7170_QUERY
Definition: lt7170.h:72
LT7170_READ_IOUT
#define LT7170_READ_IOUT
Definition: lt7170.h:122
LT7170_MFR_USER_DATA_00
#define LT7170_MFR_USER_DATA_00
Definition: lt7170.h:136
no_os_util.h
Header file of utility functions.
LT7170_IIO_IOUT_CHAN
@ LT7170_IIO_IOUT_CHAN
Definition: iio_lt7170.c:68
lt7170_read_word
int lt7170_read_word(struct lt7170_dev *dev, uint8_t cmd, uint16_t *word)
Perform a raw PMBus read word operation.
Definition: lt7170.c:540
LT7170_MFR_RAIL_ADDRESS
#define LT7170_MFR_RAIL_ADDRESS
Definition: lt7170.h:167
LT7170_MFR_CONFIG_ALL
#define LT7170_MFR_CONFIG_ALL
Definition: lt7170.h:141
lt7170_write_word
int lt7170_write_word(struct lt7170_dev *dev, uint8_t cmd, uint16_t word)
Perform a raw PMBus write word operation.
Definition: lt7170.c:573
LT7170_TON_MAX_FAULT_LIMIT
#define LT7170_TON_MAX_FAULT_LIMIT
Definition: lt7170.h:105
LT7170_MFR_READ_EXTVCC
#define LT7170_MFR_READ_EXTVCC
Definition: lt7170.h:138
LT7170_MFR_VIN_PEAK
#define LT7170_MFR_VIN_PEAK
Definition: lt7170.h:150