no-OS
ltp8800.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * @file ltp8800.h
3  * @brief Header file of the LTP8800 Driver
4  * @authors Cedric Justine Encarnacion (cedricjustine.encarnacion@analog.com)
5 ********************************************************************************
6  * Copyright 2024(c) Analog Devices, Inc.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright notice,
12  * this list of conditions and the following disclaimer.
13  *
14  * 2. Redistributions in binary form must reproduce the above copyright notice,
15  * this list of conditions and the following disclaimer in the documentation
16  * and/or other materials provided with the distribution.
17  *
18  * 3. Neither the name of Analog Devices, Inc. nor the names of its
19  * contributors may be used to endorse or promote products derived from this
20  * software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR
23  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
24  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
25  * EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *******************************************************************************/
33 #ifndef __LTP8800_H__
34 #define __LTP8800_H__
35 
36 /******************************************************************************/
37 /***************************** Include Files **********************************/
38 /******************************************************************************/
39 
40 #include <stdint.h>
41 #include <string.h>
42 #include "no_os_util.h"
43 #include "no_os_i2c.h"
44 
45 /******************************************************************************/
46 /********************** Macros and Constants Definitions **********************/
47 /******************************************************************************/
48 
49 /* PMBus commands */
50 #define LTP8800_PAGE 0x00
51 #define LTP8800_OPERATION 0x01
52 #define LTP8800_WRITE_PROTECT 0x10
53 #define LTP8800_STORE_USER_ALL 0x15
54 #define LTP8800_RESTORE_USER_ALL 0x16
55 #define LTP8800_VOUT_MODE 0x20
56 
57 #define LTP8800_VOUT_COMMAND 0x21
58 #define LTP8800_VOUT_SCALE_LOOP 0x29
59 #define LTP8800_VOUT_SCALE_MONITOR 0x2A
60 
61 #define LTP8800_FREQUENCY_SWITCH 0x33
62 #define LTP8800_VIN_ON 0x35
63 #define LTP8800_VIN_OFF 0x36
64 #define LTP8800_INTERLEAVE 0x37
65 
66 #define LTP8800_VIN_OV_FAULT_LIMIT 0x55
67 #define LTP8800_VIN_UV_FAULT_LIMIT 0x59
68 #define LTP8800_IIN_OC_FAULT_LIMIT 0x5B
69 #define LTP8800_POUT_OP_FAULT_LIMIT 0x68
70 
71 #define LTP8800_STATUS_BYTE 0x78
72 #define LTP8800_STATUS_WORD 0x79
73 #define LTP8800_STATUS_VOUT 0x7A
74 #define LTP8800_STATUS_IOUT 0x7B
75 #define LTP8800_STATUS_INPUT 0x7C
76 #define LTP8800_STATUS_TEMPERATURE 0x7D
77 #define LTP8800_STATUS_CML 0x7E
78 #define LTP8800_STATUS_OTHER 0x7F
79 #define LTP8800_STATUS_MFR_SPECIFIC 0x80
80 
81 #define LTP8800_READ_VIN 0x88
82 #define LTP8800_READ_IIN 0x89
83 #define LTP8800_READ_VOUT 0x8B
84 #define LTP8800_READ_IOUT 0x8C
85 #define LTP8800_READ_TEMPERATURE_2 0x8E
86 #define LTP8800_READ_TEMPERATURE_3 0x8F
87 #define LTP8800_READ_DUTY_CYCLE 0x94
88 #define LTP8800_READ_FREQUENCY 0x95
89 #define LTP8800_READ_POUT 0x96
90 
91 #define LTP8800_REVISION 0x98
92 #define LTP8800_MFR_ID 0x99
93 #define LTP8800_MFR_MODEL 0x9A
94 #define LTP8800_MFR_REVISION 0x9B
95 #define LTP8800_MFR_SERIAL 0x9E
96 #define LTP8800_IC_DEVICE_ID 0xAD
97 #define LTP8800_IC_DEVICE_REV 0xAE
98 
99 #define LTP8800_EEPROM_PASSWORD 0xD5
100 
101 #define LTP8800_GO_CMD 0xFE00
102 #define LTP8800_NM_DIGFILT_LF_GAIN 0xFE01
103 #define LTP8800_NM_DIGFILT_ZERO 0xFE02
104 #define LTP8800_NM_DIGFILT_POLE 0xFE03
105 #define LTP8800_NM_DIGFILT_HF_GAIN 0xFE04
106 #define LTP8800_SYNC 0xFE55
107 
108 /* PMBus-specific parameters */
109 #define LTP8800_CRC_POLYNOMIAL 0x7
110 #define LTP8800_VOUT_MODE_VAL_MSK NO_OS_GENMASK(4,0)
111 
112 /* LINEAR data format params */
113 #define LTP8800_LIN11_MANTISSA_MAX 1023L
114 #define LTP8800_LIN11_MANTISSA_MIN 511L
115 #define LTP8800_LIN11_EXPONENT_MAX 15
116 #define LTP8800_LIN11_EXPONENT_MIN -15
117 #define LTP8800_LIN11_MANTISSA_MSK NO_OS_GENMASK(10,0)
118 #define LTP8800_LIN11_EXPONENT_MSK NO_OS_GENMASK(15,11)
119 #define LTP8800_LIN11_EXPONENT(x) ((int16_t)(x) >> 11)
120 #define LTP8800_LIN11_MANTISSA(x) (((int16_t)((x & 0x7FF) << 5)) >> 5)
121 #define LTP8800_LIN16_EXPONENT -14
122 
123 /* Extended commands constants */
124 #define LTP8800_EXTENDED_COMMAND_PREFIX 0xFE
125 #define LTP8800_EXTENDED_COMMAND_BEGIN 0xFE00
126 #define LTP8800_COMMAND_LSB_MSK NO_OS_GENMASK(7, 0)
127 #define LTP8800_COMMAND_MSB_MSK NO_OS_GENMASK(15, 8)
128 
129 /* Status types masks */
130 #define LTP8800_STATUS_BYTE_TYPE_MSK 0x01
131 #define LTP8800_STATUS_VOUT_TYPE_MSK 0x02
132 #define LTP8800_STATUS_IOUT_TYPE_MSK 0x04
133 #define LTP8800_STATUS_INPUT_TYPE_MSK 0x08
134 #define LTP8800_STATUS_TEMP_TYPE_MSK 0x10
135 #define LTP8800_STATUS_CML_TYPE_MSK 0x20
136 #define LTP8800_STATUS_MFR_SPECIFIC_TYPE_MSK 0x40
137 #define LTP8800_STATUS_WORD_TYPE_MSK 0x80
138 #define LTP8800_STATUS_ALL_TYPE_MSK 0xFF
139 
140 /* LTP8800 configurable bits and masks */
141 #define LTP8800_SYNC_ENABLE_BIT NO_OS_BIT(6)
142 #define LTP8800_SYNC_LATCH_BIT NO_OS_BIT(6)
143 #define LTP8800_WRITE_PROTECT_1_BIT NO_OS_BIT(7)
144 #define LTP8800_WRITE_PROTECT_2_BIT NO_OS_BIT(6)
145 #define LTP8800_WRITE_PROTECT_3_BIT NO_OS_BIT(5)
146 #define LTP8800_INTERLEAVE_ORDER_MSK NO_OS_GENMASK(3, 0)
147 
148 /* LTP8800 device constants */
149 #define LTP8800_IC_DEVICE_ID_VALUE {0x41, 0x55}
150 #define LTP8800_MAX_INTERLEAVE_ORDER 0xF
151 #define LTP8800_VOUT_COMMAND_MAX 1100
152 #define LTP8800_VOUT_COMMAND_MIN 500
153 #define LTP8800_VOUT_COMMAND_DEFAULT 0x3000
154 #define LTP8800_EEPROM_PASSWORD_VALUE 0xFF
155 #define LTP8800_EEPROM_LOCK_VALUE 0xAB
156 
157 /* LTP8800 device settings */
158 #define LTP8800_STATE_ON 1
159 #define LTP8800_STATE_OFF 0
160 
171 };
172 
178 };
179 
190 };
191 
195 };
196 
197 struct ltp8800_dev {
202 
205  bool crc_en;
207 };
208 
214 
217  bool sync_en;
218  bool crc_en;
220 };
221 
223  uint16_t word;
224  uint8_t byte;
225  uint8_t vout;
226  uint8_t iout;
227  uint8_t input;
228  uint8_t temp;
229  uint8_t cml;
230  uint8_t mfr_specific;
231 };
232 
233 /******************************************************************************/
234 /************************ Functions Declarations ******************************/
235 /******************************************************************************/
236 
237 /* Initialize the device structure */
238 int ltp8800_init(struct ltp8800_dev **device,
240 
241 /* Free or remove device instance */
242 int ltp8800_remove(struct ltp8800_dev *dev);
243 
244 /* Send a PMBus command to the device */
245 int ltp8800_send_byte(struct ltp8800_dev *dev, uint16_t cmd);
246 
247 /* Perform a PMBus read_byte operation */
248 int ltp8800_read_byte(struct ltp8800_dev *dev, uint16_t cmd, uint8_t *data);
249 
250 /* Perform a PMBus write_byte operation */
251 int ltp8800_write_byte(struct ltp8800_dev *dev, uint16_t cmd, uint8_t value);
252 
253 /* Perform a PMBus read_word operation */
254 int ltp8800_read_word(struct ltp8800_dev *dev, uint16_t cmd, uint16_t *word);
255 
256 /* Perform a PMBus write_word operation */
257 int ltp8800_write_word(struct ltp8800_dev *dev, uint16_t cmd, uint16_t word);
258 
259 /* Perform a PMBus read_word operation then perform conversion*/
260 int ltp8800_read_word_data(struct ltp8800_dev *dev, uint16_t cmd, int *data);
261 
262 /* Perform conversion then perform a PMBus write_word operation */
263 int ltp8800_write_word_data(struct ltp8800_dev *dev, uint16_t cmd, int data);
264 
265 /* Read a block of bytes */
266 int ltp8800_read_block_data(struct ltp8800_dev *dev, uint16_t cmd,
267  uint8_t *data, size_t nbytes);
268 
269 /* Read specific value type */
270 int ltp8800_read_value(struct ltp8800_dev *dev,
271  enum ltp8800_value_type value_type,
272  int *value);
273 
274 /* Read status */
275 int ltp8800_read_status(struct ltp8800_dev *dev,
276  enum ltp8800_status_type status_type,
277  struct ltp8800_status *status);
278 
279 /* Set VOUT command */
280 int ltp8800_vout_value(struct ltp8800_dev *dev, int vout_command);
281 
282 /* Set gain settings */
283 int ltp8800_vout_settings(struct ltp8800_dev *dev,
284  enum ltp8800_vout_settings settings);
285 
286 /* Set VIN threshold when to start power conversion */
287 int ltp8800_set_vin(struct ltp8800_dev *dev, int vin_on, int vin_off);
288 
289 /* Set fault/warning limit values */
290 int ltp8800_set_fault_limit(struct ltp8800_dev *dev,
291  enum ltp8800_limit_type limit,
292  int limit_val);
293 
294 /* Enable/Disable multi-device synchronization */
295 int ltp8800_sync_config(struct ltp8800_dev *dev, bool enable);
296 
297 /* Set PolyPhase order */
298 int ltp8800_interleave_order(struct ltp8800_dev *dev, uint8_t order);
299 
300 /* Program loop compensation */
301 int ltp8800_loop_compensation(struct ltp8800_dev *dev,
302  uint8_t pole,
303  uint8_t zero,
304  uint8_t hf_gain,
305  uint8_t lf_gain);
306 
307 /* Set device state */
308 int ltp8800_set_device_state(struct ltp8800_dev *dev, bool state);
309 
310 /* Store user settings to EEPROM */
312 
313 /* Restore user settings from EEPROM */
315 
316 #endif /* __LTP8800_H__ */
ltp8800.h
MILLI
#define MILLI
Definition: no_os_units.h:48
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_value_type
ltp8800_value_type
Definition: ltp8800.h:161
no_os_put_unaligned_be16
void no_os_put_unaligned_be16(uint16_t val, uint8_t *buf)
no_os_alloc.h
no_os_gpio_init_param
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
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_init
int ltp8800_init(struct ltp8800_dev **device, struct ltp8800_init_param *init_param)
Initialize the device structure.
Definition: ltp8800.c:289
no_os_pwm_init_param
Structure containing the init parameters needed by the PWM generator.
Definition: no_os_pwm.h:66
LTP8800_VOUT_COMMAND
#define LTP8800_VOUT_COMMAND
Definition: ltp8800.h:57
LTP8800_POUT
@ LTP8800_POUT
Definition: ltp8800.h:170
LTP8800_NM_DIGFILT_LF_GAIN
#define LTP8800_NM_DIGFILT_LF_GAIN
Definition: ltp8800.h:102
LTP8800_VOUT_SETTING_UNITY
@ LTP8800_VOUT_SETTING_UNITY
Definition: ltp8800.h:194
no_os_i2c_write
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
dev_err
#define dev_err(dev, format,...)
Definition: ad9361_util.h:63
no_os_i2c_init
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
no_os_put_unaligned_le16
void no_os_put_unaligned_le16(uint16_t val, uint8_t *buf)
ltp8800_vout_settings
ltp8800_vout_settings
Definition: ltp8800.h:192
ltp8800_init_param::crc_en
bool crc_en
Definition: ltp8800.h:218
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_SYNC_LATCH_BIT
#define LTP8800_SYNC_LATCH_BIT
Definition: ltp8800.h:142
LTP8800_STORE_USER_ALL
#define LTP8800_STORE_USER_ALL
Definition: ltp8800.h:53
LTP8800_EEPROM_LOCK_VALUE
#define LTP8800_EEPROM_LOCK_VALUE
Definition: ltp8800.h:155
LTP8800_STATUS_VOUT
#define LTP8800_STATUS_VOUT
Definition: ltp8800.h:73
ltp8800_status::byte
uint8_t byte
Definition: ltp8800.h:224
LTP8800_NM_DIGFILT_POLE
#define LTP8800_NM_DIGFILT_POLE
Definition: ltp8800.h:104
MICROWATT_PER_WATT
#define MICROWATT_PER_WATT
Definition: no_os_units.h:69
ltp8800_limit_type
ltp8800_limit_type
Definition: ltp8800.h:173
ltp8800_vout_settings
int ltp8800_vout_settings(struct ltp8800_dev *dev, enum ltp8800_vout_settings settings)
Set output voltage and its upper limit.
Definition: ltp8800.c:819
no_os_pwm_remove
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
ltp8800_loop_compensation
int ltp8800_loop_compensation(struct ltp8800_dev *dev, uint8_t pole, uint8_t zero, uint8_t hf_gain, uint8_t lf_gain)
Program loop compensation for regulator transient response.
Definition: ltp8800.c:948
ltp8800_init_param::write_protect_en
bool write_protect_en
Definition: ltp8800.h:215
ltp8800_sync_config
int ltp8800_sync_config(struct ltp8800_dev *dev, bool enable)
Enable or disable sync pin.
Definition: ltp8800.c:887
no_os_i2c_remove
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
no_os_units.h
Header file of Units.
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_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_STATUS_MFR_SPECIFIC_TYPE_MSK
#define LTP8800_STATUS_MFR_SPECIFIC_TYPE_MSK
Definition: ltp8800.h:136
no_os_delay.h
Header file of Delay functions.
LTP8800_EEPROM_PASSWORD_VALUE
#define LTP8800_EEPROM_PASSWORD_VALUE
Definition: ltp8800.h:154
LTP8800_STATUS_CML_TYPE
@ LTP8800_STATUS_CML_TYPE
Definition: ltp8800.h:186
ltp8800_set_device_state
int ltp8800_set_device_state(struct ltp8800_dev *dev, bool state)
Set device state.
Definition: ltp8800.c:978
LTP8800_LIN11_MANTISSA
#define LTP8800_LIN11_MANTISSA(x)
Definition: ltp8800.h:120
ltp8800_store_user_settings
int ltp8800_store_user_settings(struct ltp8800_dev *dev)
Store user settings to EEPROM.
Definition: ltp8800.c:989
ltp8800_read_status
int ltp8800_read_status(struct ltp8800_dev *dev, enum ltp8800_status_type status_type, struct ltp8800_status *status)
Read statuses.
Definition: ltp8800.c:730
LTP8800_READ_VOUT
#define LTP8800_READ_VOUT
Definition: ltp8800.h:83
NO_OS_DIV_ROUND_CLOSEST_ULL
#define NO_OS_DIV_ROUND_CLOSEST_ULL(x, y)
Definition: no_os_util.h:56
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_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
device
Definition: ad9361_util.h:69
NO_OS_GPIO_HIGH
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:117
ltp8800_dev::ctrl_desc
struct no_os_gpio_desc * ctrl_desc
Definition: ltp8800.h:200
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_init
int ltp8800_init(struct ltp8800_dev **device, struct ltp8800_init_param *init_param)
Initialize the device structure.
Definition: ltp8800.c:289
ltp8800_status::vout
uint8_t vout
Definition: ltp8800.h:225
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_gpio_direction_input
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
ltp8800_dev::ext_clk_desc
struct no_os_pwm_desc * ext_clk_desc
Definition: ltp8800.h:201
ltp8800_set_vin
int ltp8800_set_vin(struct ltp8800_dev *dev, int vin_on, int vin_off)
Set input voltage window at which power conversion will proceed.
Definition: ltp8800.c:846
LTP8800_STATUS_CML
#define LTP8800_STATUS_CML
Definition: ltp8800.h:77
LTP8800_STATUS_WORD_TYPE
@ LTP8800_STATUS_WORD_TYPE
Definition: ltp8800.h:188
LTP8800_DUTY_CYCLE
@ LTP8800_DUTY_CYCLE
Definition: ltp8800.h:168
LTP8800_STATUS_ALL_TYPE
@ LTP8800_STATUS_ALL_TYPE
Definition: ltp8800.h:189
ltp8800_status::cml
uint8_t cml
Definition: ltp8800.h:229
ltp8800_status::word
uint16_t word
Definition: ltp8800.h:223
LTP8800_NM_DIGFILT_ZERO
#define LTP8800_NM_DIGFILT_ZERO
Definition: ltp8800.h:103
LTP8800_LIN11_MANTISSA_MIN
#define LTP8800_LIN11_MANTISSA_MIN
Definition: ltp8800.h:114
LTP8800_LIN11_EXPONENT_MIN
#define LTP8800_LIN11_EXPONENT_MIN
Definition: ltp8800.h:116
no_os_i2c_desc::slave_address
uint8_t slave_address
Definition: no_os_i2c.h:109
LTP8800_IIN_OC_FAULT_LIMIT_TYPE
@ LTP8800_IIN_OC_FAULT_LIMIT_TYPE
Definition: ltp8800.h:176
LTP8800_STATUS_INPUT
#define LTP8800_STATUS_INPUT
Definition: ltp8800.h:75
no_os_field_prep
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
LTP8800_NM_DIGFILT_HF_GAIN
#define LTP8800_NM_DIGFILT_HF_GAIN
Definition: ltp8800.h:105
ltp8800_dev::polyphase_order
uint8_t polyphase_order
Definition: ltp8800.h:206
LTP8800_INTERLEAVE_ORDER_MSK
#define LTP8800_INTERLEAVE_ORDER_MSK
Definition: ltp8800.h:146
LTP8800_RESTORE_USER_ALL
#define LTP8800_RESTORE_USER_ALL
Definition: ltp8800.h:54
LTP8800_LIN11_EXPONENT_MAX
#define LTP8800_LIN11_EXPONENT_MAX
Definition: ltp8800.h:115
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_dev::crc_en
bool crc_en
Definition: ltp8800.h:205
LTP8800_POUT_OP_FAULT_LIMIT_TYPE
@ LTP8800_POUT_OP_FAULT_LIMIT_TYPE
Definition: ltp8800.h:177
LTP8800_FREQUENCY
@ LTP8800_FREQUENCY
Definition: ltp8800.h:169
ltp8800_remove
int ltp8800_remove(struct ltp8800_dev *dev)
Free or remove device instance.
Definition: ltp8800.c:404
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
LTP8800_INTERLEAVE
#define LTP8800_INTERLEAVE
Definition: ltp8800.h:64
LTP8800_STATUS_INPUT_TYPE
@ LTP8800_STATUS_INPUT_TYPE
Definition: ltp8800.h:184
ltp8800_init_param::polyphase_order
uint8_t polyphase_order
Definition: ltp8800.h:219
ltp8800_set_device_state
int ltp8800_set_device_state(struct ltp8800_dev *dev, bool state)
Set device state.
Definition: ltp8800.c:978
LTP8800_STATUS_TEMPERATURE
#define LTP8800_STATUS_TEMPERATURE
Definition: ltp8800.h:76
no_os_crc8_populate_msb
void no_os_crc8_populate_msb(uint8_t *table, const uint8_t polynomial)
ltp8800_store_user_settings
int ltp8800_store_user_settings(struct ltp8800_dev *dev)
Store user settings to EEPROM.
Definition: ltp8800.c:989
MILLIVOLT_PER_VOLT
#define MILLIVOLT_PER_VOLT
Definition: no_os_units.h:58
LTP8800_STATUS_IOUT_TYPE
@ LTP8800_STATUS_IOUT_TYPE
Definition: ltp8800.h:183
ltp8800_read_status
int ltp8800_read_status(struct ltp8800_dev *dev, enum ltp8800_status_type status_type, struct ltp8800_status *status)
Read statuses.
Definition: ltp8800.c:730
LTP8800_WRITE_PROTECT_1_BIT
#define LTP8800_WRITE_PROTECT_1_BIT
Definition: ltp8800.h:143
LTP8800_IOUT
@ LTP8800_IOUT
Definition: ltp8800.h:165
ltp8800_status::iout
uint8_t iout
Definition: ltp8800.h:226
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_LIN11_EXPONENT_MSK
#define LTP8800_LIN11_EXPONENT_MSK
Definition: ltp8800.h:118
no_os_gpio_remove
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
LTP8800_READ_FREQUENCY
#define LTP8800_READ_FREQUENCY
Definition: ltp8800.h:88
ltp8800_sync_config
int ltp8800_sync_config(struct ltp8800_dev *dev, bool enable)
Enable or disable sync pin.
Definition: ltp8800.c:887
LTP8800_FREQUENCY_SWITCH
#define LTP8800_FREQUENCY_SWITCH
Definition: ltp8800.h:61
no_os_clamp
#define no_os_clamp(val, min_val, max_val)
Definition: no_os_util.h:69
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_status::mfr_specific
uint8_t mfr_specific
Definition: ltp8800.h:230
LTP8800_EEPROM_PASSWORD
#define LTP8800_EEPROM_PASSWORD
Definition: ltp8800.h:99
LTP8800_STATUS_WORD_TYPE_MSK
#define LTP8800_STATUS_WORD_TYPE_MSK
Definition: ltp8800.h:137
LTP8800_FORWARD_DIODE_TEMP
@ LTP8800_FORWARD_DIODE_TEMP
Definition: ltp8800.h:166
LTP8800_STATUS_BYTE_TYPE
@ LTP8800_STATUS_BYTE_TYPE
Definition: ltp8800.h:181
no_os_gpio_desc
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
ltp8800_dev::lin16_exp
int lin16_exp
Definition: ltp8800.h:203
ltp8800_init_param::ctrl_param
struct no_os_gpio_init_param * ctrl_param
Definition: ltp8800.h:212
LTP8800_IC_DEVICE_ID
#define LTP8800_IC_DEVICE_ID
Definition: ltp8800.h:96
LTP8800_EXTENDED_COMMAND_BEGIN
#define LTP8800_EXTENDED_COMMAND_BEGIN
Definition: ltp8800.h:125
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
no_os_pwm_desc
Structure representing an PWM generator device.
Definition: no_os_pwm.h:93
ltp8800_status::input
uint8_t input
Definition: ltp8800.h:227
LTP8800_VOUT_MODE
#define LTP8800_VOUT_MODE
Definition: ltp8800.h:55
LTP8800_EXTENDED_COMMAND_PREFIX
#define LTP8800_EXTENDED_COMMAND_PREFIX
Definition: ltp8800.h:124
no_os_i2c_desc
Structure holding I2C address descriptor.
Definition: no_os_i2c.h:101
no_os_pwm_init
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
LTP8800_STATUS_MFR_SPECIFIC_TYPE
@ LTP8800_STATUS_MFR_SPECIFIC_TYPE
Definition: ltp8800.h:187
no_os_i2c_read
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
no_os_i2c.h
Header file of I2C Interface.
LTP8800_VIN
@ LTP8800_VIN
Definition: ltp8800.h:162
LTP8800_VIN_ON
#define LTP8800_VIN_ON
Definition: ltp8800.h:62
ltp8800_status_type
ltp8800_status_type
Definition: ltp8800.h:180
no_os_pwm.h
Header file of PWM Interface.
LTP8800_STATUS_IOUT
#define LTP8800_STATUS_IOUT
Definition: ltp8800.h:74
no_os_field_get
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
ltp8800_dev::smbalert_desc
struct no_os_gpio_desc * smbalert_desc
Definition: ltp8800.h:199
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
NO_OS_DECLARE_CRC8_TABLE
NO_OS_DECLARE_CRC8_TABLE(ltp8800_crc_table)
LTP8800_LIN11_MANTISSA_MSK
#define LTP8800_LIN11_MANTISSA_MSK
Definition: ltp8800.h:117
LTP8800_STATUS_TEMP_TYPE_MSK
#define LTP8800_STATUS_TEMP_TYPE_MSK
Definition: ltp8800.h:134
no_os_crc8
uint8_t no_os_crc8(const uint8_t *table, const uint8_t *pdata, size_t nbytes, uint8_t crc)
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_set_vin
int ltp8800_set_vin(struct ltp8800_dev *dev, int vin_on, int vin_off)
Set input voltage window at which power conversion will proceed.
Definition: ltp8800.c:846
LTP8800_READ_IOUT
#define LTP8800_READ_IOUT
Definition: ltp8800.h:84
no_os_get_unaligned_le16
uint16_t no_os_get_unaligned_le16(uint8_t *buf)
LTP8800_COMMAND_MSB_MSK
#define LTP8800_COMMAND_MSB_MSK
Definition: ltp8800.h:127
LTP8800_LIN11_EXPONENT
#define LTP8800_LIN11_EXPONENT(x)
Definition: ltp8800.h:119
ltp8800_vout_value
int ltp8800_vout_value(struct ltp8800_dev *dev, int vout_command)
Set output voltage command.
Definition: ltp8800.c:802
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_SYNC_ENABLE_BIT
#define LTP8800_SYNC_ENABLE_BIT
Definition: ltp8800.h:141
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_READ_TEMPERATURE_3
#define LTP8800_READ_TEMPERATURE_3
Definition: ltp8800.h:86
ltp8800_init_param
Definition: ltp8800.h:209
no_os_i2c_init_param
Structure holding the parameters for I2C initialization.
Definition: no_os_i2c.h:64
NULL
#define NULL
Definition: wrapper.h:64
ltp8800_init_param::smbalert_param
struct no_os_gpio_init_param * smbalert_param
Definition: ltp8800.h:211
LTP8800_READ_VIN
#define LTP8800_READ_VIN
Definition: ltp8800.h:81
LTP8800_CRC_POLYNOMIAL
#define LTP8800_CRC_POLYNOMIAL
Definition: ltp8800.h:109
ltp8800_dev::i2c_desc
struct no_os_i2c_desc * i2c_desc
Definition: ltp8800.h:198
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
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_STATUS_VOUT_TYPE_MSK
#define LTP8800_STATUS_VOUT_TYPE_MSK
Definition: ltp8800.h:131
LTP8800_STATUS_INPUT_TYPE_MSK
#define LTP8800_STATUS_INPUT_TYPE_MSK
Definition: ltp8800.h:133
LTP8800_VOUT_COMMAND_MIN
#define LTP8800_VOUT_COMMAND_MIN
Definition: ltp8800.h:152
ltp8800_remove
int ltp8800_remove(struct ltp8800_dev *dev)
Free or remove device instance.
Definition: ltp8800.c:404
LTP8800_STATUS_TEMP_TYPE
@ LTP8800_STATUS_TEMP_TYPE
Definition: ltp8800.h:185
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_VIN_UV_FAULT_LIMIT_TYPE
@ LTP8800_VIN_UV_FAULT_LIMIT_TYPE
Definition: ltp8800.h:175
ltp8800_dev::write_protect_en
bool write_protect_en
Definition: ltp8800.h:204
LTP8800_GO_CMD
#define LTP8800_GO_CMD
Definition: ltp8800.h:101
LTP8800_REVERSE_DIODE_TEMP
@ LTP8800_REVERSE_DIODE_TEMP
Definition: ltp8800.h:167
LTP8800_VOUT
@ LTP8800_VOUT
Definition: ltp8800.h:164
LTP8800_STATUS_BYTE_TYPE_MSK
#define LTP8800_STATUS_BYTE_TYPE_MSK
Definition: ltp8800.h:130
no_os_gpio.h
Header file of GPIO Interface.
ltp8800_init_param::i2c_init
struct no_os_i2c_init_param * i2c_init
Definition: ltp8800.h:210
LTP8800_VOUT_SCALE_LOOP
#define LTP8800_VOUT_SCALE_LOOP
Definition: ltp8800.h:58
LTP8800_LIN11_MANTISSA_MAX
#define LTP8800_LIN11_MANTISSA_MAX
Definition: ltp8800.h:113
ltp8800_init_param::external_clk_en
bool external_clk_en
Definition: ltp8800.h:216
LTP8800_SYNC
#define LTP8800_SYNC
Definition: ltp8800.h:106
LTP8800_VOUT_COMMAND_DEFAULT
#define LTP8800_VOUT_COMMAND_DEFAULT
Definition: ltp8800.h:153
LTP8800_POUT_OP_FAULT_LIMIT
#define LTP8800_POUT_OP_FAULT_LIMIT
Definition: ltp8800.h:69
ltp8800_status::temp
uint8_t temp
Definition: ltp8800.h:228
LTP8800_VIN_OFF
#define LTP8800_VIN_OFF
Definition: ltp8800.h:63
LTP8800_STATUS_IOUT_TYPE_MSK
#define LTP8800_STATUS_IOUT_TYPE_MSK
Definition: ltp8800.h:132
LTP8800_VIN_OV_FAULT_LIMIT_TYPE
@ LTP8800_VIN_OV_FAULT_LIMIT_TYPE
Definition: ltp8800.h:174
no_os_util.h
Header file of utility functions.
no_os_sign_extend32
int32_t no_os_sign_extend32(uint32_t value, int index)
ltp8800_init_param::ext_clk_param
struct no_os_pwm_init_param * ext_clk_param
Definition: ltp8800.h:213
LTP8800_VOUT_COMMAND_MAX
#define LTP8800_VOUT_COMMAND_MAX
Definition: ltp8800.h:151
ltp8800_loop_compensation
int ltp8800_loop_compensation(struct ltp8800_dev *dev, uint8_t pole, uint8_t zero, uint8_t hf_gain, uint8_t lf_gain)
Program loop compensation for regulator transient response.
Definition: ltp8800.c:948
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_STATUS_VOUT_TYPE
@ LTP8800_STATUS_VOUT_TYPE
Definition: ltp8800.h:182
LTP8800_COMMAND_LSB_MSK
#define LTP8800_COMMAND_LSB_MSK
Definition: ltp8800.h:126
no_os_gpio_direction_output
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
LTP8800_VOUT_SETTING_ADI_FACTORY
@ LTP8800_VOUT_SETTING_ADI_FACTORY
Definition: ltp8800.h:193
LTP8800_WRITE_PROTECT
#define LTP8800_WRITE_PROTECT
Definition: ltp8800.h:52
LTP8800_STATUS_CML_TYPE_MSK
#define LTP8800_STATUS_CML_TYPE_MSK
Definition: ltp8800.h:135
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_vout_value
int ltp8800_vout_value(struct ltp8800_dev *dev, int vout_command)
Set output voltage command.
Definition: ltp8800.c:802
ltp8800_interleave_order
int ltp8800_interleave_order(struct ltp8800_dev *dev, uint8_t order)
Set phase order for polyphase application.
Definition: ltp8800.c:914
no_os_crc8.h
Header file of CRC-8 computation.
LTP8800_IIN
@ LTP8800_IIN
Definition: ltp8800.h:163
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
errno.h
Error macro definition for ARM Compiler.
LTP8800_STATUS_ALL_TYPE_MSK
#define LTP8800_STATUS_ALL_TYPE_MSK
Definition: ltp8800.h:138
LTP8800_READ_DUTY_CYCLE
#define LTP8800_READ_DUTY_CYCLE
Definition: ltp8800.h:87
LTP8800_MAX_INTERLEAVE_ORDER
#define LTP8800_MAX_INTERLEAVE_ORDER
Definition: ltp8800.h:150
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_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_IC_DEVICE_ID_VALUE
#define LTP8800_IC_DEVICE_ID_VALUE
Definition: ltp8800.h:149
ltp8800_restore_user_settings
int ltp8800_restore_user_settings(struct ltp8800_dev *dev)
Restore user settings.
Definition: ltp8800.c:1015
ltp8800_init_param::sync_en
bool sync_en
Definition: ltp8800.h:217
ltp8800_status
Definition: ltp8800.h:222
no_os_gpio_get_optional
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