Go to the documentation of this file.
51 #define LT7182S_PAGE 0x00
52 #define LT7182S_OPERATION 0x01
53 #define LT7182S_ON_OFF_CONFIG 0x02
54 #define LT7182S_CLEAR_FAULTS 0x03
55 #define LT7182S_PAGE_PLUS_WRITE 0x05
56 #define LT7182S_PAGE_PLUS_READ 0x06
57 #define LT7182S_ZONE_CONFIG 0x07
58 #define LT7182S_ZONE_ACTIVE 0x08
60 #define LT7182S_WRITE_PROTECT 0x10
62 #define LT7182S_STORE_USER_ALL 0x15
63 #define LT7182S_RESTORE_USER_ALL 0x16
65 #define LT7182S_CAPABILITY 0x19
66 #define LT7182S_QUERY 0x1A
67 #define LT7182S_SMBALERT_MASK 0x1B
69 #define LT7182S_VOUT_MODE 0x20
70 #define LT7182S_VOUT_COMMAND 0x21
71 #define LT7182S_VOUT_MAX 0x24
72 #define LT7182S_VOUT_MARGIN_HIGH 0x25
73 #define LT7182S_VOUT_MARGIN_LOW 0x26
74 #define LT7182S_VOUT_TRANSITION_RATE 0x27
76 #define LT7182S_FREQUENCY_SWITCH 0x33
77 #define LT7182S_VIN_ON 0x35
78 #define LT7182S_VIN_OFF 0x36
80 #define LT7182S_VOUT_OV_FAULT_LIMIT 0x40
81 #define LT7182S_VOUT_OV_FAULT_RESPONSE 0x41
82 #define LT7182S_VOUT_OV_WARN_LIMIT 0x42
83 #define LT7182S_VOUT_UV_WARN_LIMIT 0x43
84 #define LT7182S_VOUT_UV_FAULT_LIMIT 0x44
85 #define LT7182S_VOUT_UV_FAULT_RESPONSE 0x45
86 #define LT7182S_IOUT_OC_FAULT_RESPONSE 0x47
87 #define LT7182S_IOUT_OC_WARN_LIMIT 0x4A
89 #define LT7182S_OT_FAULT_LIMIT 0x4F
90 #define LT7182S_OT_FAULT_RESPONSE 0x50
91 #define LT7182S_OT_WARN_LIMIT 0x51
93 #define LT7182S_VIN_OV_FAULT_RESPONSE 0x56
94 #define LT7182S_VIN_UV_WARN_LIMIT 0x58
95 #define LT7182S_IIN_OC_WARN_LIMIT 0x5D
97 #define LT7182S_TON_DELAY 0x60
98 #define LT7182S_TON_RISE 0x61
99 #define LT7182S_TON_MAX_FAULT_LIMIT 0x62
100 #define LT7182S_TON_MAX_FAULT_RESPONSE 0x63
101 #define LT7182S_TOFF_DELAY 0x64
102 #define LT7182S_TOFF_FALL 0x65
103 #define LT7182S_TOFF_MAX_WARN_LIMIT 0x66
105 #define LT7182S_STATUS_BYTE 0x78
106 #define LT7182S_STATUS_WORD 0x79
107 #define LT7182S_STATUS_VOUT 0x7A
108 #define LT7182S_STATUS_IOUT 0x7B
109 #define LT7182S_STATUS_INPUT 0x7C
110 #define LT7182S_STATUS_TEMPERATURE 0x7D
111 #define LT7182S_STATUS_CML 0x7E
112 #define LT7182S_STATUS_MFR_SPECIFIC 0x80
114 #define LT7182S_READ_VIN 0x88
115 #define LT7182S_READ_IIN 0x89
116 #define LT7182S_READ_VOUT 0x8B
117 #define LT7182S_READ_IOUT 0x8C
118 #define LT7182S_READ_TEMPERATURE_1 0x8D
119 #define LT7182S_READ_FREQUENCY 0x95
120 #define LT7182S_READ_POUT 0x96
122 #define LT7182S_REVISION 0x98
123 #define LT7182S_MFR_ID 0x99
124 #define LT7182S_MFR_MODEL 0x9A
125 #define LT7182S_MFR_REVISION 0x9B
126 #define LT7182S_MFR_SERIAL 0x9E
128 #define LT7182S_IC_DEVICE_ID 0xAD
129 #define LT7182S_IC_DEVICE_REV 0xAE
131 #define LT7182S_MFR_USER_DATA_00 0xC9
132 #define LT7182S_MFR_USER_DATA_01 0xCA
133 #define LT7182S_MFR_USER_DATA_02 0xCB
134 #define LT7182S_MFR_USER_DATA_03 0xCC
135 #define LT7182S_MFR_READ_EXTVCC 0xCD
136 #define LT7182S_MFR_READ_ITH 0xCE
137 #define LT7182S_MFR_CHAN_CONFIG 0xD0
138 #define LT7182S_MFR_CONFIG_ALL 0xD1
139 #define LT7182S_MFR_FAULT_PROPAGATE 0xD2
140 #define LT7182S_MFR_PWM_MODE 0xD4
141 #define LT7182S_MFR_FAULT_RESPONSE 0xD5
142 #define LT7182S_MFR_IOUT_PEAK 0xD7
143 #define LT7182S_MFR_ADC_CONTROL 0xD8
144 #define LT7182S_MFR_RETRY_DELAY 0xDB
145 #define LT7182S_MFR_RESTART_DELAY 0xDC
146 #define LT7182S_MFR_VOUT_PEAK 0xDD
147 #define LT7182S_MFR_VIN_PEAK 0xDE
148 #define LT7182S_MFR_TEMPERATURE_1_PEAK 0xDF
149 #define LT7182S_MFR_CLEAR_PEAKS 0xE3
150 #define LT7182S_MFR_DISCHARGE_THRESHOLD 0xE4
151 #define LT7182S_MFR_PADS 0xE5
152 #define LT7182S_MFR_ADDRESS 0xE6
153 #define LT7182S_MFR_SPECIAL_ID 0xE7
154 #define LT7182S_MFR_FAULT_LOG_TIMESTAMP_MSBS 0xE8
155 #define LT7182S_MFR_FAULT_LOG_TIMESTAMP_LSBS 0xE9
156 #define LT7182S_MFR_FAULT_LOG_STORE 0xEA
157 #define LT7182S_MFR_FAULT_LOG_CLEAR 0xEC
158 #define LT7182S_MFR_FAULT_LOG 0xEE
159 #define LT7182S_MFR_COMMON 0xEF
160 #define LT7182S_MFR_COMPARE_USER_ALL 0xF0
161 #define LT7182S_MFR_CHANNEL_STATE 0xF1
162 #define LT7182S_MFR_PGOOD_DELAY 0xF2
163 #define LT7182S_MFR_NOT_PGOOD_DELAY 0xF3
164 #define LT7182S_MFR_PWM_PHASE 0xF5
165 #define LT7182S_MFR_SYNC_CONFIG 0xF6
166 #define LT7182S_MFR_PIN_CONFIG 0xF7
167 #define LT7182S_MFR_RAIL_ADDRESS 0xFA
168 #define LT7182S_MFR_DISABLE_OUTPUT 0xFB
169 #define LT7182S_MFR_EE_USER_WP 0xFC
170 #define LT7182S_MFR_RESET 0xFD
173 #define LT7182S_CRC_POLYNOMIAL 0x7
174 #define LT7182S_VOUT_MODE_VAL_MSK NO_OS_GENMASK(4,0)
177 #define LT7182S_LIN11_MANTISSA_MAX 1023L
178 #define LT7182S_LIN11_MANTISSA_MIN 511L
179 #define LT7182S_LIN11_EXPONENT_MAX 15
180 #define LT7182S_LIN11_EXPONENT_MIN -15
181 #define LT7182S_LIN11_MANTISSA_MSK NO_OS_GENMASK(10,0)
182 #define LT7182S_LIN11_EXPONENT_MSK NO_OS_GENMASK(15,11)
183 #define LT7182S_LIN11_EXPONENT(x) (int16_t)(x) >> 11
184 #define LT7182S_LIN11_MANTISSA(x) ((int16_t)((x & 0x7FF) << 5)) >> 5
185 #define LT7182S_LIN16_EXPONENT -12
188 #define LT7182S_IEEE754_SIGN_BIT NO_OS_BIT(15)
189 #define LT7182S_IEEE754_EXPONENT_MSK NO_OS_GENMASK(14, 10)
190 #define LT7182S_IEEE754_MANTISSA_MSK NO_OS_GENMASK(9, 0)
191 #define LT7182S_IEEE754_MAX_MANTISSA 0x7ff
192 #define LT7182S_IEEE754_MIN_MANTISSA 0x400
195 #define LT7182S_FREQ_MIN 400000
196 #define LT7182S_FREQ_MAX 4000000
197 #define LT7182S_VIN_ON_MIN 1400
198 #define LT7182S_VIN_ON_MAX 20000
199 #define LT7182S_VIN_OFF_MIN 1350
200 #define LT7182S_VIN_OFF_MAX 20000
201 #define LT7182S_PHASE_FULL_MILLI 360000
204 #define LT7182S_STATUS_BYTE_TYPE_MSK 0x01
205 #define LT7182S_STATUS_VOUT_TYPE_MSK 0x02
206 #define LT7182S_STATUS_IOUT_TYPE_MSK 0x04
207 #define LT7182S_STATUS_INPUT_TYPE_MSK 0x08
208 #define LT7182S_STATUS_TEMP_TYPE_MSK 0x10
209 #define LT7182S_STATUS_CML_TYPE_MSK 0x20
210 #define LT7182S_STATUS_MFR_SPECIFIC_TYPE_MSK 0x40
211 #define LT7182S_STATUS_WORD_TYPE_MSK 0x80
212 #define LT7182S_STATUS_ALL_TYPE_MSK 0xFF
215 #define LT7182S_PWM_OP_MODE_BIT NO_OS_BIT(0)
216 #define LT7182S_SYNC_CLK_INPUT_BIT NO_OS_BIT(1)
217 #define LT7182S_SYNC_CLK_OUTPUT_BIT NO_OS_BIT(0)
218 #define LT7182S_ADC_CTRL_LOW_FREQ_BIT NO_OS_BIT(1)
219 #define LT7182S_ADC_CTRL_DEBUG_BIT NO_OS_BIT(0)
220 #define LT7182S_CONFIG_ALL_FORMAT_BIT NO_OS_BIT(8)
221 #define LT7182S_CONFIG_ALL_PEC_BIT NO_OS_BIT(2)
222 #define LT7182S_PADS_RUN0_BIT NO_OS_BIT(4)
223 #define LT7182S_PADS_RUN1_BIT NO_OS_BIT(5)
225 #define LT7182S_SPECIAL_ID_VALUE 0x1C1D
392 uint8_t cmd, uint8_t *data);
396 uint8_t cmd, uint8_t value);
400 uint8_t cmd, uint16_t *word);
404 uint8_t cmd, uint16_t word);
408 uint8_t cmd,
int *data);
412 uint8_t cmd,
int data);
416 uint8_t cmd, uint8_t *data,
size_t nbytes);
430 int vout_command,
int vout_max);
437 int margin_high,
int margin_low);
441 int vin_on,
int vin_off);
477 bool debug_telemetry);
@ LT7182S_POUT
Definition: lt7182s.h:263
int lt7182s_set_operation(struct lt7182s_dev *dev, int channel, enum lt7182s_operation_type operation)
Set channel operation.
Definition: lt7182s.c:1425
lt7182s_nvm_cmd_type
Definition: lt7182s.h:307
@ LT7182S_STATUS_ALL_TYPE
Definition: lt7182s.h:295
#define LT7182S_PAGE
Definition: lt7182s.h:51
#define LT7182S_READ_IOUT
Definition: lt7182s.h:117
int lt7182s_pwm_phase(struct lt7182s_dev *dev, int channel, int phase)
Set output PWM phase.
Definition: lt7182s.c:1381
@ LT7182S_VOUT_OV_WARN_LIMIT_TYPE
Definition: lt7182s.h:274
#define MILLI
Definition: no_os_units.h:48
int lt7182s_software_reset(struct lt7182s_dev *dev)
Perform a device software reset.
Definition: lt7182s.c:1559
@ LT7182S_EXTVCC
Definition: lt7182s.h:265
Definition: lt7182s.h:358
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
#define LT7182S_MFR_CONFIG_ALL
Definition: lt7182s.h:138
Structure containing the init parameters needed by the PWM generator.
Definition: no_os_pwm.h:66
#define LT7182S_VIN_ON_MAX
Definition: lt7182s.h:198
@ LT7182S_ITH
Definition: lt7182s.h:264
struct no_os_gpio_init_param * alert_param
Definition: lt7182s.h:344
uint8_t vout
Definition: lt7182s.h:365
@ LT7182S_COMPARE_USER
Definition: lt7182s.h:312
#define LT7182S_MFR_SPECIAL_ID
Definition: lt7182s.h:153
struct no_os_gpio_desc * run0_desc
Definition: lt7182s.h:324
int lt7182s_set_operation(struct lt7182s_dev *dev, int channel, enum lt7182s_operation_type operation)
Set channel operation.
Definition: lt7182s.c:1425
#define LT7182S_IIN_OC_WARN_LIMIT
Definition: lt7182s.h:95
#define LT7182S_STATUS_WORD
Definition: lt7182s.h:106
int32_t no_os_i2c_write(struct no_os_i2c_desc *desc, uint8_t *data, uint8_t bytes_number, uint8_t stop_bit)
I2C Write data to slave device.
Definition: no_os_i2c.c:159
struct no_os_gpio_init_param * fault0_param
Definition: lt7182s.h:345
#define LT7182S_VIN_OFF
Definition: lt7182s.h:78
#define dev_err(dev, format,...)
Definition: ad9361_util.h:63
int32_t no_os_i2c_init(struct no_os_i2c_desc **desc, const struct no_os_i2c_init_param *param)
Initialize the I2C communication peripheral.
Definition: no_os_i2c.c:52
#define LT7182S_READ_POUT
Definition: lt7182s.h:120
void no_os_put_unaligned_le16(uint16_t val, uint8_t *buf)
#define LT7182S_STATUS_TEMPERATURE
Definition: lt7182s.h:110
NO_OS_DECLARE_CRC8_TABLE(lt7182s_crc_table)
struct no_os_gpio_init_param * fault1_param
Definition: lt7182s.h:346
int lt7182s_sync_config(struct lt7182s_dev *dev, bool input_clk, bool output_clk)
Configure SYNC pin for clock synchronization.
Definition: lt7182s.c:1461
#define LT7182S_RESTORE_USER_ALL
Definition: lt7182s.h:63
#define LT7182S_SYNC_CLK_INPUT_BIT
Definition: lt7182s.h:216
int lt7182s_clear_faults(struct lt7182s_dev *dev)
Clear all asserted faults.
Definition: lt7182s.c:1548
int lt7182s_set_limit(struct lt7182s_dev *dev, int channel, enum lt7182s_limit_type limit, int limit_val)
Set overvalue and undervalue limits.
Definition: lt7182s.c:1406
@ LT7182S_IOUT_OC_WARN_LIMIT_TYPE
Definition: lt7182s.h:278
#define LT7182S_PHASE_FULL_MILLI
Definition: lt7182s.h:201
#define MICROWATT_PER_WATT
Definition: no_os_units.h:69
#define LT7182S_STATUS_BYTE_TYPE_MSK
Definition: lt7182s.h:204
@ LT7182S_IIN
Definition: lt7182s.h:258
#define LT7182S_LIN11_EXPONENT_MIN
Definition: lt7182s.h:180
lt7182s_timing_type
Definition: lt7182s.h:298
struct no_os_gpio_desc * alert_desc
Definition: lt7182s.h:326
int32_t no_os_pwm_remove(struct no_os_pwm_desc *desc)
Free the resources allocated by no_os_pwm_init().
Definition: no_os_pwm.c:79
#define LT7182S_MFR_ADC_CONTROL
Definition: lt7182s.h:143
@ LT7182S_CHAN_ALL
Definition: lt7182s.h:235
@ LT7182S_IOUT
Definition: lt7182s.h:260
#define LT7182S_TON_RISE
Definition: lt7182s.h:98
int32_t no_os_i2c_remove(struct no_os_i2c_desc *desc)
Free the resources allocated by no_os_i2c_init().
Definition: no_os_i2c.c:113
int lt7182s_set_limit(struct lt7182s_dev *dev, int channel, enum lt7182s_limit_type limit, int limit_val)
Set overvalue and undervalue limits.
Definition: lt7182s.c:1406
@ LT7182S_VOUT_UV_FAULT_LIMIT_TYPE
Definition: lt7182s.h:275
#define LT7182S_ADC_CTRL_DEBUG_BIT
Definition: lt7182s.h:219
uint8_t iout
Definition: lt7182s.h:366
#define LT7182S_MFR_CHANNEL_STATE
Definition: lt7182s.h:161
#define LT7182S_READ_FREQUENCY
Definition: lt7182s.h:119
#define LT7182S_STATUS_VOUT
Definition: lt7182s.h:107
int lt7182s_read_block_data(struct lt7182s_dev *dev, int page, uint8_t cmd, uint8_t *data, size_t nbytes)
Perform a PMBus read block operation.
Definition: lt7182s.c:1051
lt7182s_chip_id
Definition: lt7182s.h:227
#define LT7182S_VIN_UV_WARN_LIMIT
Definition: lt7182s.h:94
bool crc_en
Definition: lt7182s.h:355
#define LT7182S_MFR_FAULT_RESPONSE
Definition: lt7182s.h:141
Header file of Delay functions.
#define LT7182S_VOUT_MARGIN_HIGH
Definition: lt7182s.h:72
uint8_t input
Definition: lt7182s.h:367
@ LT7182S_FAULT_PIN_INPUT
Definition: lt7182s.h:239
#define LT7182S_IEEE754_EXPONENT_MSK
Definition: lt7182s.h:189
#define LT7182S_PWM_OP_MODE_BIT
Definition: lt7182s.h:215
int lin16_exp
Definition: lt7182s.h:334
int lt7182s_init(struct lt7182s_dev **device, struct lt7182s_init_param *init_param)
Initialize the device structure.
Definition: lt7182s.c:526
int lt7182s_write_byte(struct lt7182s_dev *dev, int page, uint8_t cmd, uint8_t value)
Perform a raw PMBus write byte operation.
Definition: lt7182s.c:904
@ LT7182S_OT_WARN_LIMIT_TYPE
Definition: lt7182s.h:280
#define LT7182S_STATUS_CML_TYPE_MSK
Definition: lt7182s.h:209
lt7182s_value_type
Definition: lt7182s.h:256
#define LT7182S_MFR_RAIL_ADDRESS
Definition: lt7182s.h:167
struct no_os_pwm_desc * sync_desc
Definition: lt7182s.h:329
#define NO_OS_DIV_ROUND_CLOSEST_ULL(x, y)
Definition: no_os_util.h:56
#define LT7182S_VOUT_TRANSITION_RATE
Definition: lt7182s.h:74
int lt7182s_write_word(struct lt7182s_dev *dev, int page, uint8_t cmd, uint16_t word)
Perform a raw PMBus write word operation.
Definition: lt7182s.c:976
@ LT7182S_IIN_OC_WARN_LIMIT_TYPE
Definition: lt7182s.h:277
#define LT7182S_TOFF_FALL
Definition: lt7182s.h:102
#define LT7182S_MFR_COMPARE_USER_ALL
Definition: lt7182s.h:160
#define LT7182S_MFR_RETRY_DELAY
Definition: lt7182s.h:144
Definition: lt7182s.h:320
#define LT7182S_STATUS_IOUT
Definition: lt7182s.h:108
Definition: ad9361_util.h:69
#define LT7182S_TOFF_DELAY
Definition: lt7182s.h:101
@ LT7182S_VOUT
Definition: lt7182s.h:259
int lt7182s_pwm_phase(struct lt7182s_dev *dev, int channel, int phase)
Set output PWM phase.
Definition: lt7182s.c:1381
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:117
@ LT7182S_STATUS_INPUT_TYPE
Definition: lt7182s.h:290
int lt7182s_nvm_cmd(struct lt7182s_dev *dev, enum lt7182s_nvm_cmd_type cmd)
Perform commands for non-volatile memory/EEPROM.
Definition: lt7182s.c:1512
#define LT7182S_LIN11_MANTISSA_MAX
Definition: lt7182s.h:177
int lt7182s_switch_freq(struct lt7182s_dev *dev, int freq)
Set switching frequency.
Definition: lt7182s.c:1320
int lt7182s_set_vin(struct lt7182s_dev *dev, int channel, int vin_on, int vin_off)
Set input voltage window at which power conversion will proceed.
Definition: lt7182s.c:1269
@ LT7182S_OT_FAULT_LIMIT_TYPE
Definition: lt7182s.h:279
struct no_os_gpio_init_param * run1_param
Definition: lt7182s.h:343
#define LT7182S_LIN11_EXPONENT_MSK
Definition: lt7182s.h:182
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
@ LT7182S_OPERATION_ON
Definition: lt7182s.h:250
#define LT7182S_VOUT_COMMAND
Definition: lt7182s.h:70
int32_t no_os_gpio_direction_input(struct no_os_gpio_desc *desc)
Enable the input direction of the specified GPIO.
Definition: no_os_gpio.c:124
uint8_t mfr_specific
Definition: lt7182s.h:370
#define LT7182S_MFR_READ_ITH
Definition: lt7182s.h:136
int lt7182s_read_block_data(struct lt7182s_dev *dev, int page, uint8_t cmd, uint8_t *data, size_t nbytes)
Perform a PMBus read block operation.
Definition: lt7182s.c:1051
int lt7182s_set_vin(struct lt7182s_dev *dev, int channel, int vin_on, int vin_off)
Set input voltage window at which power conversion will proceed.
Definition: lt7182s.c:1269
@ LT7182S_PWM_PULSE_SKIP_MODE
Definition: lt7182s.h:317
#define LT7182S_MFR_TEMPERATURE_1_PEAK
Definition: lt7182s.h:148
@ LT7182S_VIN_UV_WARN_LIMIT_TYPE
Definition: lt7182s.h:281
int lt7182s_write_byte(struct lt7182s_dev *dev, int page, uint8_t cmd, uint8_t value)
Perform a raw PMBus write byte operation.
Definition: lt7182s.c:904
int lt7182s_set_page(struct lt7182s_dev *dev, int page)
Set page of the device. Page 0x0 - Channel 0 Page 0x1 - Channel 1 Page 0xff - Both channels.
Definition: lt7182s.c:776
struct no_os_gpio_init_param * pg0_param
Definition: lt7182s.h:340
int page
Definition: lt7182s.h:333
struct no_os_gpio_desc * pg0_desc
Definition: lt7182s.h:322
#define LT7182S_MFR_PWM_MODE
Definition: lt7182s.h:140
int lt7182s_write_word(struct lt7182s_dev *dev, int page, uint8_t cmd, uint16_t word)
Perform a raw PMBus write word operation.
Definition: lt7182s.c:976
@ LT7182S_FREQUENCY
Definition: lt7182s.h:262
enum lt7182s_chip_id chip_id
Definition: lt7182s.h:331
#define LT7182S_TON_MAX_FAULT_RESPONSE
Definition: lt7182s.h:100
uint8_t slave_address
Definition: no_os_i2c.h:109
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
@ LT7182S_TON_MAX_FAULT_LIMIT_TYPE
Definition: lt7182s.h:282
#define LT7182S_TON_DELAY
Definition: lt7182s.h:97
#define LT7182S_VIN_OFF_MAX
Definition: lt7182s.h:200
@ LT7182S_TON_DELAY_TYPE
Definition: lt7182s.h:299
int lt7182s_nvm_cmd(struct lt7182s_dev *dev, enum lt7182s_nvm_cmd_type cmd)
Perform commands for non-volatile memory/EEPROM.
Definition: lt7182s.c:1512
@ LT7182S_TON_RISE_TYPE
Definition: lt7182s.h:300
#define LT7182S_CRC_POLYNOMIAL
Definition: lt7182s.h:173
bool crc_en
Definition: lt7182s.h:335
#define LT7182S_TOFF_MAX_WARN_LIMIT
Definition: lt7182s.h:103
int lt7182s_switch_freq(struct lt7182s_dev *dev, int freq)
Set switching frequency.
Definition: lt7182s.c:1320
#define LT7182S_MFR_SYNC_CONFIG
Definition: lt7182s.h:165
#define LT7182S_OPERATION
Definition: lt7182s.h:52
int lt7182s_pwm_mode(struct lt7182s_dev *dev, int channel, enum lt7182s_pwm_mode pwm_mode)
Set output PWM mode.
Definition: lt7182s.c:1337
#define LT7182S_SMBALERT_MASK
Definition: lt7182s.h:67
#define LT7182S_STATUS_IOUT_TYPE_MSK
Definition: lt7182s.h:206
@ LT7182S_FAULT_PIN_OUTPUT
Definition: lt7182s.h:240
int lt7182s_remove(struct lt7182s_dev *dev)
Free or remove device instance.
Definition: lt7182s.c:719
#define LT7182S_STATUS_INPUT_TYPE_MSK
Definition: lt7182s.h:207
char * name
Definition: lt7182s.h:359
void no_os_crc8_populate_msb(uint8_t *table, const uint8_t polynomial)
@ LT7182S_STATUS_MFR_SPECIFIC_TYPE
Definition: lt7182s.h:293
#define MILLIVOLT_PER_VOLT
Definition: no_os_units.h:58
@ LT7182S_OPERATION_MARGIN_HIGH
Definition: lt7182s.h:251
int lt7182s_read_status(struct lt7182s_dev *dev, int channel, enum lt7182s_status_type status_type, struct lt7182s_status *status)
Read statuses.
Definition: lt7182s.c:1130
#define LT7182S_SPECIAL_ID_VALUE
Definition: lt7182s.h:225
#define LT7182S_ON_OFF_CONFIG
Definition: lt7182s.h:53
#define LT7182S_STATUS_VOUT_TYPE_MSK
Definition: lt7182s.h:205
@ LT7182S_UNLOCK_USER
Definition: lt7182s.h:309
#define LT7182S_STATUS_CML
Definition: lt7182s.h:111
@ LT7182S_OPERATION_MARGIN_LOW
Definition: lt7182s.h:252
int lt7182s_adc_control(struct lt7182s_dev *dev, bool low_freq_telemetry, bool debug_telemetry)
Configure ADC control.
Definition: lt7182s.c:1489
#define LT7182S_IOUT_OC_FAULT_RESPONSE
Definition: lt7182s.h:86
#define LT7182S_VOUT_UV_WARN_LIMIT
Definition: lt7182s.h:83
@ ID_LT7184S
Definition: lt7182s.h:229
struct no_os_i2c_desc * i2c_desc
Definition: lt7182s.h:321
#define LT7182S_IOUT_OC_WARN_LIMIT
Definition: lt7182s.h:87
int lt7182s_set_page(struct lt7182s_dev *dev, int page)
Set page of the device. Page 0x0 - Channel 0 Page 0x1 - Channel 1 Page 0xff - Both channels.
Definition: lt7182s.c:776
uint16_t word
Definition: lt7182s.h:363
#define LT7182S_VIN_OV_FAULT_RESPONSE
Definition: lt7182s.h:93
int lt7182s_read_byte(struct lt7182s_dev *dev, int page, uint8_t cmd, uint8_t *data)
Perform a raw PMBus read byte operation.
Definition: lt7182s.c:865
#define LT7182S_VOUT_UV_FAULT_LIMIT
Definition: lt7182s.h:84
#define LT7182S_LIN11_MANTISSA(x)
Definition: lt7182s.h:184
int lt7182s_read_word(struct lt7182s_dev *dev, int page, uint8_t cmd, uint16_t *word)
Perform a raw PMBus read word operation.
Definition: lt7182s.c:934
@ LT7182S_VOUT_UV_WARN_LIMIT_TYPE
Definition: lt7182s.h:276
int lt7182s_vout_value(struct lt7182s_dev *dev, int channel, int vout_command, int vout_max)
Set output voltage and its upper limit.
Definition: lt7182s.c:1206
#define LT7182S_VOUT_OV_WARN_LIMIT
Definition: lt7182s.h:82
uint8_t cml
Definition: lt7182s.h:369
#define LT7182S_LIN11_MANTISSA_MIN
Definition: lt7182s.h:178
@ LT7182S_TOFF_MAX_WARN_LIMIT_TYPE
Definition: lt7182s.h:283
@ LT7182S_OPERATION_OFF
Definition: lt7182s.h:249
int32_t no_os_gpio_remove(struct no_os_gpio_desc *desc)
Free the resources allocated by no_os_gpio_get().
Definition: no_os_gpio.c:104
int lt7182s_remove(struct lt7182s_dev *dev)
Free or remove device instance.
Definition: lt7182s.c:719
@ LT7182S_IOUT_PEAK
Definition: lt7182s.h:266
#define LT7182S_FREQ_MAX
Definition: lt7182s.h:196
@ LT7182S_STATUS_TEMP_TYPE
Definition: lt7182s.h:291
#define LT7182S_STATUS_TEMP_TYPE_MSK
Definition: lt7182s.h:208
#define no_os_clamp(val, min_val, max_val)
Definition: no_os_util.h:69
@ LT7182S_STATUS_CML_TYPE
Definition: lt7182s.h:292
int lt7182s_read_word(struct lt7182s_dev *dev, int page, uint8_t cmd, uint16_t *word)
Perform a raw PMBus read word operation.
Definition: lt7182s.c:934
#define LT7182S_LIN11_EXPONENT_MAX
Definition: lt7182s.h:179
@ LT7182S_TEMP_PEAK
Definition: lt7182s.h:269
#define LT7182S_LIN16_EXPONENT
Definition: lt7182s.h:185
lt7182s_pwm_mode
Definition: lt7182s.h:315
@ LT7182S_STATUS_IOUT_TYPE
Definition: lt7182s.h:289
@ LT7182S_STORE_USER
Definition: lt7182s.h:310
#define LT7182S_MFR_PGOOD_DELAY
Definition: lt7182s.h:162
#define LT7182S_VOUT_MAX
Definition: lt7182s.h:71
int lt7182s_vout_tr(struct lt7182s_dev *dev, int channel, int tr)
Set output voltage transition rate.
Definition: lt7182s.c:1228
@ LT7182S_TOFF_FALL_TYPE
Definition: lt7182s.h:302
lt7182s_status_type
Definition: lt7182s.h:286
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
lt7182s_operation_type
Definition: lt7182s.h:248
struct no_os_gpio_init_param * run0_param
Definition: lt7182s.h:342
#define LT7182S_VOUT_MODE
Definition: lt7182s.h:69
int lt7182s_vout_margin(struct lt7182s_dev *dev, int channel, int margin_high, int margin_low)
Set output voltage margin.
Definition: lt7182s.c:1243
uint8_t temp
Definition: lt7182s.h:368
#define LT7182S_IEEE754_MIN_MANTISSA
Definition: lt7182s.h:192
int lt7182s_write_word_data(struct lt7182s_dev *dev, int page, uint8_t cmd, int data)
Converts value to register data and do PMBus write word operation.
Definition: lt7182s.c:1028
@ LT7182S_VOUT_OV_FAULT_LIMIT_TYPE
Definition: lt7182s.h:273
Structure representing an PWM generator device.
Definition: no_os_pwm.h:93
@ LT7182S_RESTORE_USER
Definition: lt7182s.h:311
#define LT7182S_MFR_VIN_PEAK
Definition: lt7182s.h:147
#define LT7182S_MFR_PWM_PHASE
Definition: lt7182s.h:164
#define LT7182S_OT_FAULT_LIMIT
Definition: lt7182s.h:89
#define LT7182S_VIN_ON
Definition: lt7182s.h:77
#define LT7182S_VOUT_OV_FAULT_LIMIT
Definition: lt7182s.h:80
int lt7182s_vout_tr(struct lt7182s_dev *dev, int channel, int tr)
Set output voltage transition rate.
Definition: lt7182s.c:1228
lt7182s_limit_type
Definition: lt7182s.h:272
#define LT7182S_READ_VIN
Definition: lt7182s.h:114
Structure holding I2C address descriptor.
Definition: no_os_i2c.h:101
int lt7182s_read_byte(struct lt7182s_dev *dev, int page, uint8_t cmd, uint8_t *data)
Perform a raw PMBus read byte operation.
Definition: lt7182s.c:865
int32_t no_os_pwm_init(struct no_os_pwm_desc **desc, const struct no_os_pwm_init_param *param)
Initialize the PWM peripheral.
Definition: no_os_pwm.c:51
bool external_clk_en
Definition: lt7182s.h:354
#define LT7182S_MFR_EE_USER_WP
Definition: lt7182s.h:169
int32_t no_os_i2c_read(struct no_os_i2c_desc *desc, uint8_t *data, uint8_t bytes_number, uint8_t stop_bit)
I2C Read data from slave device.
Definition: no_os_i2c.c:190
#define LT7182S_MFR_NOT_PGOOD_DELAY
Definition: lt7182s.h:163
int lt7182s_set_timing(struct lt7182s_dev *dev, int channel, enum lt7182s_timing_type timing_type, int time)
Set timing values.
Definition: lt7182s.c:1305
Header file of I2C Interface.
int lt7182s_vout_value(struct lt7182s_dev *dev, int channel, int vout_command, int vout_max)
Set output voltage and its upper limit.
Definition: lt7182s.c:1206
@ LT7182_RETRY_DELAY_TYPE
Definition: lt7182s.h:303
#define LT7182S_ADC_CTRL_LOW_FREQ_BIT
Definition: lt7182s.h:218
Header file of PWM Interface.
@ LT7182S_DATA_FORMAT_LINEAR
Definition: lt7182s.h:244
#define LT7182S_ZONE_CONFIG
Definition: lt7182s.h:57
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
#define LT7182S_VOUT_OV_FAULT_RESPONSE
Definition: lt7182s.h:81
#define LT7182S_CONFIG_ALL_FORMAT_BIT
Definition: lt7182s.h:220
#define LT7182S_STATUS_INPUT
Definition: lt7182s.h:109
uint8_t no_os_crc8(const uint8_t *table, const uint8_t *pdata, size_t nbytes, uint8_t crc)
struct no_os_i2c_init_param * i2c_init
Definition: lt7182s.h:339
struct no_os_gpio_init_param * pg1_param
Definition: lt7182s.h:341
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
uint16_t no_os_get_unaligned_le16(uint8_t *buf)
uint8_t byte
Definition: lt7182s.h:364
#define LT7182S_MFR_RESET
Definition: lt7182s.h:170
enum lt7182s_data_format format
Definition: lt7182s.h:332
#define LT7182S_IEEE754_MAX_MANTISSA
Definition: lt7182s.h:191
int lt7182s_read_word_data(struct lt7182s_dev *dev, int page, uint8_t cmd, int *data)
Perform a PMBus read word operation and converts to actual value.
Definition: lt7182s.c:1006
@ LT7182S_VIN_PEAK
Definition: lt7182s.h:268
int lt7182s_read_value(struct lt7182s_dev *dev, int channel, enum lt7182s_value_type value_type, int *value)
Read a value.
Definition: lt7182s.c:1107
enum lt7182s_fault_pin_config fault0_cfg
Definition: lt7182s.h:351
#define LT7182S_IEEE754_SIGN_BIT
Definition: lt7182s.h:188
int lt7182s_set_channel_state(struct lt7182s_dev *dev, int channel, bool state)
Set channel state using the RUN pin.
Definition: lt7182s.c:1440
Structure holding the parameters for I2C initialization.
Definition: no_os_i2c.h:64
#define NULL
Definition: wrapper.h:64
@ LT7182S_CHAN_1
Definition: lt7182s.h:234
#define LT7182S_MFR_RESTART_DELAY
Definition: lt7182s.h:145
#define LT7182S_STATUS_MFR_SPECIFIC
Definition: lt7182s.h:112
#define LT7182S_STATUS_BYTE
Definition: lt7182s.h:105
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
@ LT7182S_TOFF_DELAY_TYPE
Definition: lt7182s.h:301
#define LT7182S_STATUS_WORD_TYPE_MSK
Definition: lt7182s.h:211
enum lt7182s_fault_pin_config fault1_cfg
Definition: lt7182s.h:352
#define LT7182S_MFR_CHAN_CONFIG
Definition: lt7182s.h:137
int lt7182s_read_value(struct lt7182s_dev *dev, int channel, enum lt7182s_value_type value_type, int *value)
Read a value.
Definition: lt7182s.c:1107
lt7182s_data_format
Definition: lt7182s.h:243
Definition: lt7182s.h:362
int lt7182s_set_timing(struct lt7182s_dev *dev, int channel, enum lt7182s_timing_type timing_type, int time)
Set timing values.
Definition: lt7182s.c:1305
struct no_os_gpio_desc * run1_desc
Definition: lt7182s.h:325
#define LT7182S_STATUS_ALL_TYPE_MSK
Definition: lt7182s.h:212
#define LT7182S_CLEAR_FAULTS
Definition: lt7182s.h:54
@ ID_LT7182S
Definition: lt7182s.h:228
int lt7182s_init(struct lt7182s_dev **dev, struct lt7182s_init_param *init_param)
Initialize the device structure.
Definition: lt7182s.c:526
@ LT7182S_STATUS_VOUT_TYPE
Definition: lt7182s.h:288
#define LT7182S_LIN11_EXPONENT(x)
Definition: lt7182s.h:183
int lt7182s_vout_margin(struct lt7182s_dev *dev, int channel, int margin_high, int margin_low)
Set output voltage margin.
Definition: lt7182s.c:1243
@ LT7182S_OPERATION_SEQ_OFF
Definition: lt7182s.h:253
#define LT7182S_TON_MAX_FAULT_LIMIT
Definition: lt7182s.h:99
@ LT7182S_STATUS_BYTE_TYPE
Definition: lt7182s.h:287
int lt7182s_write_word_data(struct lt7182s_dev *dev, int page, uint8_t cmd, int data)
Converts value to register data and do PMBus write word operation.
Definition: lt7182s.c:1028
int lt7182s_send_byte(struct lt7182s_dev *dev, int page, uint8_t cmd)
Send a PMBus command to the device.
Definition: lt7182s.c:838
Header file of GPIO Interface.
#define LT7182S_FREQUENCY_SWITCH
Definition: lt7182s.h:76
#define LT7182S_IC_DEVICE_ID
Definition: lt7182s.h:128
@ LT7182S_CHAN_0
Definition: lt7182s.h:233
#define LT7182S_MFR_FAULT_PROPAGATE
Definition: lt7182s.h:139
lt7182s_fault_pin_config
Definition: lt7182s.h:238
int lt7182s_read_status(struct lt7182s_dev *dev, int channel, enum lt7182s_status_type status_type, struct lt7182s_status *status)
Read statuses.
Definition: lt7182s.c:1130
#define LT7182S_VOUT_UV_FAULT_RESPONSE
Definition: lt7182s.h:85
@ LT7182S_DATA_FORMAT_IEEE754
Definition: lt7182s.h:245
int lt7182s_sync_config(struct lt7182s_dev *dev, bool input_clk, bool output_clk)
Configure SYNC pin for clock synchronization.
Definition: lt7182s.c:1461
int lt7182s_read_word_data(struct lt7182s_dev *dev, int page, uint8_t cmd, int *data)
Perform a PMBus read word operation and converts to actual value.
Definition: lt7182s.c:1006
int lt7182s_adc_control(struct lt7182s_dev *dev, bool low_freq_telemetry, bool debug_telemetry)
Configure ADC control.
Definition: lt7182s.c:1489
@ LT7182S_PWM_FORCED_CONTINUOUS_MODE
Definition: lt7182s.h:316
#define LT7182S_OT_WARN_LIMIT
Definition: lt7182s.h:91
enum lt7182s_data_format format
Definition: lt7182s.h:350
@ LT7182S_STATUS_WORD_TYPE
Definition: lt7182s.h:294
int lt7182s_clear_faults(struct lt7182s_dev *dev)
Clear all asserted faults.
Definition: lt7182s.c:1548
#define LT7182S_READ_TEMPERATURE_1
Definition: lt7182s.h:118
#define LT7182S_SYNC_CLK_OUTPUT_BIT
Definition: lt7182s.h:217
#define LT7182S_READ_VOUT
Definition: lt7182s.h:116
#define LT7182S_LIN11_MANTISSA_MSK
Definition: lt7182s.h:181
int lt7182s_send_byte(struct lt7182s_dev *dev, int page, uint8_t cmd)
Send a PMBus command to the device.
Definition: lt7182s.c:838
@ LT7182S_RESTART_DELAY_TYPE
Definition: lt7182s.h:304
@ LT7182S_VOUT_PEAK
Definition: lt7182s.h:267
Header file of utility functions.
#define LT7182S_STATUS_MFR_SPECIFIC_TYPE_MSK
Definition: lt7182s.h:210
struct no_os_pwm_init_param * sync_param
Definition: lt7182s.h:347
struct no_os_gpio_desc * fault1_desc
Definition: lt7182s.h:328
#define LT7182S_MFR_VOUT_PEAK
Definition: lt7182s.h:146
struct no_os_gpio_desc * fault0_desc
Definition: lt7182s.h:327
#define LT7182S_MFR_READ_EXTVCC
Definition: lt7182s.h:135
int32_t no_os_gpio_direction_output(struct no_os_gpio_desc *desc, uint8_t value)
Enable the output direction of the specified GPIO.
Definition: no_os_gpio.c:147
@ LT7182S_VIN
Definition: lt7182s.h:257
#define LT7182S_CONFIG_ALL_PEC_BIT
Definition: lt7182s.h:221
enum lt7182s_chip_id chip_id
Definition: lt7182s.h:349
struct no_os_gpio_desc * pg1_desc
Definition: lt7182s.h:323
Header file of CRC-8 computation.
#define LT7182S_READ_IIN
Definition: lt7182s.h:115
Error macro definition for ARM Compiler.
lt7182s_output_channel
Definition: lt7182s.h:232
int lt7182s_set_channel_state(struct lt7182s_dev *dev, int channel, bool state)
Set channel state using the RUN pin.
Definition: lt7182s.c:1440
#define LT7182S_VOUT_MARGIN_LOW
Definition: lt7182s.h:73
Definition: lt7182s.h:338
int lt7182s_software_reset(struct lt7182s_dev *dev)
Perform a device software reset.
Definition: lt7182s.c:1559
#define LT7182S_IEEE754_MANTISSA_MSK
Definition: lt7182s.h:190
#define LT7182S_STORE_USER_ALL
Definition: lt7182s.h:62
@ LT7182S_LOCK_USER
Definition: lt7182s.h:308
@ LT7182S_TEMP
Definition: lt7182s.h:261
#define LT7182S_MFR_IOUT_PEAK
Definition: lt7182s.h:142
#define LT7182S_MFR_DISCHARGE_THRESHOLD
Definition: lt7182s.h:150
int32_t no_os_gpio_get_optional(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Get the value of an optional GPIO.
Definition: no_os_gpio.c:75