no-OS
ltc4296.h
Go to the documentation of this file.
1 /***************************************************************************/
34 #ifndef __LTC4296_H__
35 #define __LTC4296_H__
36 
37 /******************************************************************************/
38 /***************************** Include Files **********************************/
39 /******************************************************************************/
40 #include <stdint.h>
41 #include "no_os_util.h"
42 #include "no_os_spi.h"
43 #include "no_os_gpio.h"
44 
45 /******************************************************************************/
46 /********************** Macros and Constants Definitions **********************/
47 /******************************************************************************/
48 #define LTC4296_REG_GFLTEV 0x02
49 #define LTC4296_REG_GFLTMSK 0x03
50 #define LTC4296_REG_GCAP 0x06
51 #define LTC4296_REG_GIOST 0x07
52 #define LTC4296_REG_GCMD 0x08
53 #define LTC4296_REG_GCFG 0x09
54 #define LTC4296_REG_GADCCFG 0x0A
55 #define LTC4296_REG_GADCDAT 0x0B
56 #define LTC4296_REG_P0EV 0x10
57 #define LTC4296_REG_P0ST 0x12
58 #define LTC4296_REG_P0CFG0 0x13
59 #define LTC4296_REG_P0CFG1 0x14
60 #define LTC4296_REG_P0ADCCFG 0x15
61 #define LTC4296_REG_P0ADCDAT 0x16
62 #define LTC4296_REG_P0SELFTEST 0x17
63 #define LTC4296_REG_P1EV 0x20
64 #define LTC4296_REG_P1ST 0x22
65 #define LTC4296_REG_P1CFG0 0x23
66 #define LTC4296_REG_P1CFG1 0x24
67 #define LTC4296_REG_P1ADCCFG 0x25
68 #define LTC4296_REG_P1ADCDAT 0x26
69 #define LTC4296_REG_P1SELFTEST 0x27
70 #define LTC4296_REG_P2EV 0x30
71 #define LTC4296_REG_P2ST 0x32
72 #define LTC4296_REG_P2CFG0 0x33
73 #define LTC4296_REG_P2CFG1 0x34
74 #define LTC4296_REG_P2ADCCFG 0x35
75 #define LTC4296_REG_P2ADCDAT 0x36
76 #define LTC4296_REG_P2SELFTEST 0x37
77 #define LTC4296_REG_P3EV 0x40
78 #define LTC4296_REG_P3ST 0x42
79 #define LTC4296_REG_P3CFG0 0x43
80 #define LTC4296_REG_P3CFG1 0x44
81 #define LTC4296_REG_P3ADCCFG 0x45
82 #define LTC4296_REG_P3ADCDAT 0x46
83 #define LTC4296_REG_P3SELFTEST 0x47
84 #define LTC4296_REG_P4EV 0x50
85 #define LTC4296_REG_P4ST 0x52
86 #define LTC4296_REG_P4CFG0 0x53
87 #define LTC4296_REG_P4CFG1 0x54
88 #define LTC4296_REG_P4ADCCFG 0x55
89 #define LTC4296_REG_P4ADCDAT 0x56
90 #define LTC4296_REG_P4SELFTEST 0x57
91 
92 /* LTC4296_REG_GFLTEV */
93 #define LTC4296_UVLO_DIGITAL_MSK NO_OS_BIT(4)
94 #define LTC4296_COMMAND_FAULT_MSK NO_OS_BIT(3)
95 #define LTC4296_PEC_FAULT_MSK NO_OS_BIT(2)
96 #define LTC4296_MEMORY_FAULT_MSK NO_OS_BIT(1)
97 #define LTC4296_LOW_CKT_BRK_FAULT_MSK NO_OS_BIT(0)
98 
99 /* LTC4296_REG_GCAP */
100 #define LTC4296_SCCP_SUPPORT_MSK NO_OS_BIT(6)
101 #define LTC4296_WAKE_FWD_SUPPORT_MSK NO_OS_BIT(5)
102 #define LTC4296_NUMPORTS_MSK NO_OS_GENMASK(4, 0)
103 
104 /* LTC4296_REG_GIOST */
105 #define LTC4296_PG_OUT4_MSK NO_OS_BIT(8)
106 #define LTC4296_PG_OUT3_MSK NO_OS_BIT(7)
107 #define LTC4296_PG_OUT2_MSK NO_OS_BIT(6)
108 #define LTC4296_PG_OUT1_MSK NO_OS_BIT(5)
109 #define LTC4296_PG_OUT0_MSK NO_OS_BIT(4)
110 #define LTC4296_PAD_AUTO_MSK NO_OS_BIT(3)
111 #define LTC4296_PAD_WAKEUP_MSK NO_OS_BIT(2)
112 #define LTC4296_PAD_WAKEUP_DRIVE_MSK NO_OS_BIT(1)
113 
114 /* LTC4296_REG_GCMD */
115 #define LTC4296_SW_RESET_MSK NO_OS_GENMASK(15, 8)
116 #define LTC4296_WRITE_PROTECT_MSK NO_OS_GENMASK(7, 0)
117 
118 /* LTC4296_REG_GCFG */
119 #define LTC4296_MASK_LOWFAULT_MSK NO_OS_BIT(5)
120 #define LTC4296_TLIM_DISABLE_MSK NO_OS_BIT(4)
121 #define LTC4296_TLIM_TIMER_SLEEP_MSK NO_OS_GENMASK(3, 2)
122 #define LTC4296_REFRESH_MSK NO_OS_BIT(1)
123 #define LTC4296_SW_VIN_PGOOD_MSK NO_OS_BIT(0)
124 
125 /* LTC4296_REG_GADCCFG */
126 #define LTC4296_GADC_SAMPLE_MODE_MSK NO_OS_GENMASK(6, 5)
127 #define LTC4296_GADC_SEL_MSK NO_OS_GENMASK(4, 0)
128 
129 /* LTC4296_REG_GADCDAT */
130 #define LTC4296_GADC_MISSED_MSK NO_OS_BIT(13)
131 #define LTC4296_GADC_NEW_MSK NO_OS_BIT(12)
132 #define LTC4296_GADC_MSK NO_OS_GENMASK(11, 0)
133 
134 /* LTC4296_REG_PXEV */
135 #define LTC4296_VALID_SIGNATURE_MSK NO_OS_BIT(9)
136 #define LTC4296_INVALID_SIGNATURE_MSK NO_OS_BIT(8)
137 #define LTC4296_TOFF_TIMER_DONE_MSK NO_OS_BIT(7)
138 #define LTC4296_OVERLOAD_DETECTED_ISLEEP_MSK NO_OS_BIT(6)
139 #define LTC4296_OVERLOAD_DETECTED_IPOWERED_MSK NO_OS_BIT(5)
140 #define LTC4296_MFVS_TIMEOUT_MSK NO_OS_BIT(4)
141 #define LTC4296_TINRUSH_TIMER_DONE_MSK NO_OS_BIT(3)
142 #define LTC4296_PD_WAKEUP_MSK NO_OS_BIT(2)
143 #define LTC4296_LSNS_FORWARD_FAULT_MSK NO_OS_BIT(1)
144 #define LTC4296_LSNS_REVERSE_FAULT_MSK NO_OS_BIT(0)
145 
146 /* LTC4296_REG_PXST */
147 #define LTC4296_DET_VHIGH_MSK NO_OS_BIT(13)
148 #define LTC4296_DET_VLOW_MSK NO_OS_BIT(12)
149 #define LTC4296_POWER_STABLE_HI_MSK NO_OS_BIT(11)
150 #define LTC4296_POWER_STABLE_LO_MSK NO_OS_BIT(10)
151 #define LTC4296_POWER_STABLE_MSK NO_OS_BIT(9)
152 #define LTC4296_OVERLOAD_HELD_MSK NO_OS_BIT(8)
153 #define LTC4296_PI_SLEEPING_MSK NO_OS_BIT(7)
154 #define LTC4296_PI_PREBIASED_MSK NO_OS_BIT(6)
155 #define LTC4296_PI_DETECTING_MSK NO_OS_BIT(5)
156 #define LTC4296_PI_POWERED_MSK NO_OS_BIT(4)
157 #define LTC4296_PI_DISCHARGE_EN_MSK NO_OS_BIT(3)
158 #define LTC4296_PSE_STATUS_MSK NO_OS_GENMASK(2, 0)
159 
160 /* LTC4296_REG_PXCFG0 */
161 #define LTC4296_SW_INRUSH_MSK NO_OS_BIT(15)
162 #define LTC4296_END_CLASSIFICATION_MSK NO_OS_BIT(14)
163 #define LTC4296_SET_CLASSIFICATION_MODE_MSK NO_OS_BIT(13)
164 #define LTC4296_DISABLE_DETECTION_PULLUP_MSK NO_OS_BIT(12)
165 #define LTC4296_TDET_DISABLE_MSK NO_OS_BIT(11)
166 #define LTC4296_FOLDBACK_DISABLE_MSK NO_OS_BIT(10)
167 #define LTC4296_SOFT_START_DISABLE_MSK NO_OS_BIT(9)
168 #define LTC4296_TOFF_TIMER_DISABLE_MSK NO_OS_BIT(8)
169 #define LTC4296_TMFVDO_TIMER_DISABLE_MSK NO_OS_BIT(7)
170 #define LTC4296_SW_PSE_READY_MSK NO_OS_BIT(6)
171 #define LTC4296_SW_POWER_AVAILABLE_MSK NO_OS_BIT(5)
172 #define LTC4296_UPSTREAM_WAKEUP_DISABLE_MSK NO_OS_BIT(4)
173 #define LTC4296_DOWNSTREAM_WAKEUP_DISABLE_MSK NO_OS_BIT(3)
174 #define LTC4296_SW_PSE_WAKEUP_MSK NO_OS_BIT(2)
175 #define LTC4296_HW_EN_MASK_MSK NO_OS_BIT(1)
176 #define LTC4296_SW_EN_MSK NO_OS_BIT(0)
177 
178 /* LTC4296_REG_PXCFG1 */
179 #define LTC4296_PREBIAS_OVERRIDE_GOOD_MSK NO_OS_BIT(8)
180 #define LTC4296_TLIM_TIMER_TOP_MSK NO_OS_GENMASK(7, 6)
181 #define LTC4296_TOD_TRESTART_TIMER_MSK NO_OS_GENMASK(5, 4)
182 #define LTC4296_TINRUSH_TIMER_MSK NO_OS_GENMASK(3, 2)
183 #define LTC4296_SIG_OVERRIDE_BAD_MSK NO_OS_BIT(1)
184 #define LTC4296_SIG_OVERRIDE_GOOD_MSK NO_OS_BIT(0)
185 
186 /* LTC4296_REG_PXADCCFG */
187 #define LTC4296_MFVS_THRESHOLD_MSK NO_OS_GENMASK(7, 0)
188 
189 /* LTC4296_REG_PXADCDAT */
190 #define LTC4296_MISSED_MSK NO_OS_BIT(13)
191 #define LTC4296_NEW_MSK NO_OS_BIT(12)
192 #define LTC4296_SOURCE_CURRENT_MSK NO_OS_GENMASK(11, 0)
193 
194 /* Miscellaneous Definitions*/
195 #define LTC4296_SPI_READ 0x01
196 #define LTC4296_SPI_WRITE 0x00
197 
198 #define LTC4296_RESET_CODE 0x73
199 #define LTC4296_UNLOCK_KEY 0x05
200 #define LTC4296_LOCK_KEY 0xA0
201 
202 #define LTC4296_ADC_OFFSET 2049
203 
204 #define LTC4296_VGAIN 35230 / 1000
205 #define LTC4296_IGAIN 1 / 10
206 
207 #define LTC4296_VMAX 1
208 #define LTC4296_VMIN 0
209 
210 #define LTC4296_MAX_PORTS 5
211 
212 #define RTESTLOAD 200 /*(ohm)*/
213 
214 /******************************************************************************/
215 /*************************** Types Declarations *******************************/
216 /******************************************************************************/
217 
221 struct ltc4296_dev {
223 };
224 
230 };
231 
238 };
239 
250 };
251 
258 };
259 
264  LTC_PSE_STATUS_DISABLED = 0, /* 000b Port is disabled */
265  LTC_PSE_STATUS_SLEEPING, /* 001b Port is in sleeping */
266  LTC_PSE_STATUS_DELIVERING, /* 010b Port is delivering power */
267  LTC_PSE_STATUS_SEARCHING, /* 011b Port is searching */
268  LTC_PSE_STATUS_ERROR, /* 100b Port is in error */
269  LTC_PSE_STATUS_IDLE, /* 101b Port is idle */
270  LTC_PSE_STATUS_PREPDET, /* 110b Port is preparing for detection */
271  LTC_PSE_STATUS_UNKNOWN /* 111b Port is in an unknown state */
272 };
273 
294 };
295 
303 };
304 
316 };
317 
343 };
344 
345 /******************************************************************************/
346 /************************ Functions Declarations ******************************/
347 /******************************************************************************/
348 
350 int ltc4296_reg_write(struct ltc4296_dev *dev, uint8_t reg, uint16_t data);
351 
353 int ltc4296_reg_read(struct ltc4296_dev *dev, uint8_t reg, uint16_t *data);
354 
356 int ltc4296_reset(struct ltc4296_dev *dev);
357 
359 int ltc4296_get_port_addr(enum ltc4296_port port_no,
360  enum ltc4296_port_reg_offset_e port_offset,
361  uint8_t *port_addr);
362 
365 
367 int ltc4296_clear_ckt_breaker(struct ltc4296_dev *dev);
368 
370 int ltc4296_read_global_faults(struct ltc4296_dev *dev, uint16_t *g_events);
371 
373 int ltc4296_unlock(struct ltc4296_dev *dev);
374 
376 int ltc4296_is_locked(struct ltc4296_dev *dev, enum ltc4296_state *state);
377 
379 int ltc4296_read_gadc(struct ltc4296_dev *dev, int *port_voltage_mv);
380 
382 int ltc4296_set_gadc_vin(struct ltc4296_dev *dev);
383 
385 int ltc4296_is_vin_valid(struct ltc4296_dev *dev, int port_vin_mv,
386  enum ltc4296_board_class ltcboard_class, bool *vin_valid);
387 
389 int ltc4296_is_vout_valid(struct ltc4296_dev *dev, int port_vout_mv,
390  enum ltc4296_board_class ltcboard_class, bool *vout_valid);
391 
393 int ltc4296_disable_gadc(struct ltc4296_dev *dev);
394 
396 int ltc4296_read_port_events(struct ltc4296_dev *dev, enum ltc4296_port port_no,
397  uint16_t *port_events);
398 
400 int ltc4296_clear_port_events(struct ltc4296_dev *dev,
401  enum ltc4296_port port_no);
402 
404 int ltc4296_read_port_status(struct ltc4296_dev *dev, enum ltc4296_port port_no,
405  uint16_t *port_status);
406 
408 int ltc4296_is_port_disabled(struct ltc4296_dev *dev, enum ltc4296_port port_no,
409  enum ltc4296_port_status *port_chk);
410 
412 int ltc4296_port_disable(struct ltc4296_dev *dev, enum ltc4296_port port_no);
413 
416  enum ltc4296_port port_no,
417  enum ltc4296_pse_status *pwr_status);
418 
421  enum ltc4296_port port_no, bool *pwr_status);
422 
424 int ltc4296_read_port_adc(struct ltc4296_dev *dev, enum ltc4296_port port_no,
425  int *port_i_out_ma);
426 
428 int ltc4296_port_prebias(struct ltc4296_dev *dev, enum ltc4296_port port_no,
429  enum ltc4296_config mode);
430 
432 int ltc4296_port_en(struct ltc4296_dev *dev, enum ltc4296_port port_no);
433 
436  enum ltc4296_port port_no);
437 
439 int ltc4296_set_port_mfvs(struct ltc4296_dev *dev, enum ltc4296_port port_no);
440 
442 int ltc4296_set_port_pwr(struct ltc4296_dev *dev, enum ltc4296_port port_no);
443 
445 int ltc4296_force_port_pwr(struct ltc4296_dev *dev, enum ltc4296_port port_no);
446 
449  enum ltc4296_port port_no);
450 
452 int ltc4296_set_gadc_vout(struct ltc4296_dev *dev, enum ltc4296_port port_no);
453 
455 int ltc4296_print_global_faults(uint16_t g_events);
456 
458 int ltc4296_print_port_events(enum ltc4296_port port_no, uint16_t port_events);
459 
461 int ltc4296_chk_global_events(struct ltc4296_dev *dev);
462 
464 int ltc4296_chk_port_events(struct ltc4296_dev *dev,
466 
468 int ltc4296_init(struct ltc4296_dev** device,
470 
472 int ltc4296_remove(struct ltc4296_dev* dev);
473 
474 #endif
ltc4296_remove
int ltc4296_remove(struct ltc4296_dev *dev)
Free allocated resources.
Definition: ltc4296.c:1080
LTC4296_OVERLOAD_DETECTED_IPOWERED_MSK
#define LTC4296_OVERLOAD_DETECTED_IPOWERED_MSK
Definition: ltc4296.h:139
ltc4296_port
ltc4296_port
Device Port Numbers.
Definition: ltc4296.h:243
LTC_PSE_STATUS_SEARCHING
@ LTC_PSE_STATUS_SEARCHING
Definition: ltc4296.h:267
ltc4296_print_port_events
int ltc4296_print_port_events(enum ltc4296_port port_no, uint16_t port_events)
Print port events.
Definition: ltc4296.c:877
no_os_put_unaligned_be16
void no_os_put_unaligned_be16(uint16_t val, uint8_t *buf)
LTC_UNLOCKED
@ LTC_UNLOCKED
Definition: ltc4296.h:236
LTC4296_POWER_STABLE_MSK
#define LTC4296_POWER_STABLE_MSK
Definition: ltc4296.h:151
LTC4296_REG_GFLTEV
#define LTC4296_REG_GFLTEV
Definition: ltc4296.h:48
no_os_alloc.h
LTC4296_REG_GCMD
#define LTC4296_REG_GCMD
Definition: ltc4296.h:52
ltc4296_init_param::spi_init
struct no_os_spi_init_param * spi_init
Definition: ltc4296.h:229
LTC_PSE_STATUS_UNKNOWN
@ LTC_PSE_STATUS_UNKNOWN
Definition: ltc4296.h:271
ltc4296_clear_ckt_breaker
int ltc4296_clear_ckt_breaker(struct ltc4296_dev *dev)
Clear circuit break faults.
Definition: ltc4296.c:227
ltc4296_disable_gadc
int ltc4296_disable_gadc(struct ltc4296_dev *dev)
Disable the global ADC.
Definition: ltc4296.c:406
ADI_LTC_SCCP_PD_PRESENT
@ ADI_LTC_SCCP_PD_PRESENT
Definition: ltc4296.h:328
PRODUCTION_POWER_TEST
@ PRODUCTION_POWER_TEST
Definition: ltc4296.h:288
ltc4296_class_str
char * ltc4296_class_str[12][25]
Definition: ltc4296.c:71
LTC4296_REG_GADCDAT
#define LTC4296_REG_GADCDAT
Definition: ltc4296.h:55
LTC4296_MEMORY_FAULT_MSK
#define LTC4296_MEMORY_FAULT_MSK
Definition: ltc4296.h:96
LTC4296_RESET_CODE
#define LTC4296_RESET_CODE
Definition: ltc4296.h:198
ltc4296_force_port_pwr
int ltc4296_force_port_pwr(struct ltc4296_dev *dev, enum ltc4296_port port_no)
Force port to power mode.
Definition: ltc4296.c:785
ltc4296_is_port_disabled
int ltc4296_is_port_disabled(struct ltc4296_dev *dev, enum ltc4296_port port_no, enum ltc4296_port_status *port_chk)
Check if port is enabled/disabled.
Definition: ltc4296.c:497
ltc4296_reg_read
int ltc4296_reg_read(struct ltc4296_dev *dev, uint8_t reg, uint16_t *data)
Register Read.
Definition: ltc4296.c:122
no_os_spi_write_and_read
int32_t no_os_spi_write_and_read(struct no_os_spi_desc *desc, uint8_t *data, uint16_t bytes_number)
Write and read data to/from SPI.
Definition: no_os_spi.c:159
LTC4296_SW_RESET_MSK
#define LTC4296_SW_RESET_MSK
Definition: ltc4296.h:115
PRODUCTION_DATA_TEST
@ PRODUCTION_DATA_TEST
Definition: ltc4296.h:291
ADI_LTC_SCCP_PD_CRC_FAILED
@ ADI_LTC_SCCP_PD_CRC_FAILED
Definition: ltc4296.h:334
no_os_spi.h
Header file of SPI Interface.
ltc4296_read_port_events
int ltc4296_read_port_events(struct ltc4296_dev *dev, enum ltc4296_port port_no, uint16_t *port_events)
Read Port Events.
Definition: ltc4296.c:429
ltc4296_get_port_addr
int ltc4296_get_port_addr(enum ltc4296_port port_no, enum ltc4296_port_reg_offset_e port_offset, uint8_t *port_addr)
Get port address.
Definition: ltc4296.c:194
ltc4296_chk_port_events
int ltc4296_chk_port_events(struct ltc4296_dev *dev, enum ltc4296_port ltc4296_port)
ltc4296_state
ltc4296_state
Device State.
Definition: ltc4296.h:235
ltc4296_is_locked
int ltc4296_is_locked(struct ltc4296_dev *dev, enum ltc4296_state *state)
Check device state.
Definition: ltc4296.c:282
LTC4296_MFVS_TIMEOUT_MSK
#define LTC4296_MFVS_TIMEOUT_MSK
Definition: ltc4296.h:140
LTC_PSE_STATUS_DISABLED
@ LTC_PSE_STATUS_DISABLED
Definition: ltc4296.h:264
pr_err
#define pr_err(fmt, args...)
Definition: no_os_print_log.h:88
ltc4296_read_port_status
int ltc4296_read_port_status(struct ltc4296_dev *dev, enum ltc4296_port port_no, uint16_t *port_status)
Read Port Status.
Definition: ltc4296.c:474
ADI_LTC_SCCP_PD_LINE_NOT_HIGH
@ ADI_LTC_SCCP_PD_LINE_NOT_HIGH
Definition: ltc4296.h:332
ltc4296_is_vin_valid
int ltc4296_is_vin_valid(struct ltc4296_dev *dev, int port_vin_mv, enum ltc4296_board_class ltcboard_class, bool *vin_valid)
Check if input voltage is valid.
Definition: ltc4296.c:360
ltc4296_clear_ckt_breaker
int ltc4296_clear_ckt_breaker(struct ltc4296_dev *dev)
Clear circuit break faults.
Definition: ltc4296.c:227
ltc4296_disable_gadc
int ltc4296_disable_gadc(struct ltc4296_dev *dev)
Disable the global ADC.
Definition: ltc4296.c:406
no_os_delay.h
Header file of Delay functions.
ltc4296_dev::spi_desc
struct no_os_spi_desc * spi_desc
Definition: ltc4296.h:222
ltc4296_set_port_mfvs
int ltc4296_set_port_mfvs(struct ltc4296_dev *dev, enum ltc4296_port port_no)
Set port to maintain full voltage signature.
Definition: ltc4296.c:732
pr_info
#define pr_info(fmt, args...)
Definition: no_os_print_log.h:115
RESERVED
@ RESERVED
Definition: ltc4296.h:292
ltc4296_clear_global_faults
int ltc4296_clear_global_faults(struct ltc4296_dev *dev)
Clear global faults.
Definition: ltc4296.c:211
ADI_LTC_SUCCESS
@ ADI_LTC_SUCCESS
Definition: ltc4296.h:322
ltc4296_is_port_pwr_stable
int ltc4296_is_port_pwr_stable(struct ltc4296_dev *dev, enum ltc4296_port port_no, bool *pwr_status)
Check if port has stable power.
Definition: ltc4296.c:587
no_os_spi_init_param::mode
enum no_os_spi_mode mode
Definition: no_os_spi.h:148
APL_CLASS3
@ APL_CLASS3
Definition: ltc4296.h:287
ltc4296_set_gadc_vout
int ltc4296_set_gadc_vout(struct ltc4296_dev *dev, enum ltc4296_port port_no)
Configure Global ADC to read output voltage.
Definition: ltc4296.c:833
ltc4296_reset
int ltc4296_reset(struct ltc4296_dev *dev)
Software reset.
Definition: ltc4296.c:169
device
Definition: ad9361_util.h:69
ltc4296_chk_global_events
int ltc4296_chk_global_events(struct ltc4296_dev *dev)
Check global events.
Definition: ltc4296.c:922
LTC_PORT_ADCDAT
@ LTC_PORT_ADCDAT
Definition: ltc4296.h:314
no_os_print_log.h
Print messages helpers.
ltc4296_unlock
int ltc4296_unlock(struct ltc4296_dev *dev)
Device unlock.
Definition: ltc4296.c:267
ltc4296_port_disable
int ltc4296_port_disable(struct ltc4296_dev *dev, enum ltc4296_port port_no)
Check if port is disabled.
Definition: ltc4296.c:530
ADI_LTC_TEST_FAILED
@ ADI_LTC_TEST_FAILED
Definition: ltc4296.h:341
ltc4296_print_global_faults
int ltc4296_print_global_faults(uint16_t g_events)
Print global faults.
Definition: ltc4296.c:855
LTC_CFG_RESET
@ LTC_CFG_RESET
Definition: ltc4296.h:302
ltc4296_config
ltc4296_config
Device Configuration Modes.
Definition: ltc4296.h:299
LTC_PORT_ENABLED
@ LTC_PORT_ENABLED
Definition: ltc4296.h:257
APL_CLASSC
@ APL_CLASSC
Definition: ltc4296.h:286
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
ADI_LTC_INVALID_ADC_PORT_CURRENT
@ ADI_LTC_INVALID_ADC_PORT_CURRENT
Definition: ltc4296.h:338
ADI_LTC_SCCP_COMPLETE
@ ADI_LTC_SCCP_COMPLETE
Definition: ltc4296.h:324
ltc4296_init_param
Initialization Structure.
Definition: ltc4296.h:228
LTC4296_OVERLOAD_DETECTED_ISLEEP_MSK
#define LTC4296_OVERLOAD_DETECTED_ISLEEP_MSK
Definition: ltc4296.h:138
SPOE_CLASS10
@ SPOE_CLASS10
Definition: ltc4296.h:278
LTC4296_VGAIN
#define LTC4296_VGAIN
Definition: ltc4296.h:204
LTC_PORT0
@ LTC_PORT0
Definition: ltc4296.h:244
LTC_PORT_DISABLED
@ LTC_PORT_DISABLED
Definition: ltc4296.h:256
ltc4296_port_en
int ltc4296_port_en(struct ltc4296_dev *dev, enum ltc4296_port port_no)
Enable specific port.
Definition: ltc4296.c:684
ltc4296_port_pwr_available
int ltc4296_port_pwr_available(struct ltc4296_dev *dev, enum ltc4296_port port_no)
Set port is able to source power.
Definition: ltc4296.c:808
ltc4296_is_vin_valid
int ltc4296_is_vin_valid(struct ltc4296_dev *dev, int port_vin_mv, enum ltc4296_board_class ltcboard_class, bool *vin_valid)
Check if input voltage is valid.
Definition: ltc4296.c:360
ltc4296_read_port_status
int ltc4296_read_port_status(struct ltc4296_dev *dev, enum ltc4296_port port_no, uint16_t *port_status)
Read Port Status.
Definition: ltc4296.c:474
LTC4296_UVLO_DIGITAL_MSK
#define LTC4296_UVLO_DIGITAL_MSK
Definition: ltc4296.h:93
ltc4296_is_port_deliver_pwr
int ltc4296_is_port_deliver_pwr(struct ltc4296_dev *dev, enum ltc4296_port port_no, enum ltc4296_pse_status *pwr_status)
Check if port delivers power.
Definition: ltc4296.c:552
ltc4296_port_en
int ltc4296_port_en(struct ltc4296_dev *dev, enum ltc4296_port port_no)
Enable specific port.
Definition: ltc4296.c:684
ltc4296_read_port_adc
int ltc4296_read_port_adc(struct ltc4296_dev *dev, enum ltc4296_port port_no, int *port_i_out_ma)
Read port ADC.
Definition: ltc4296.c:621
LTC_PORT_ADCCFG
@ LTC_PORT_ADCCFG
Definition: ltc4296.h:313
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
LTC_PSE_STATUS_DELIVERING
@ LTC_PSE_STATUS_DELIVERING
Definition: ltc4296.h:266
LTC4296_LOW_CKT_BRK_FAULT_MSK
#define LTC4296_LOW_CKT_BRK_FAULT_MSK
Definition: ltc4296.h:97
no_os_field_prep
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
ltc4296_chk_port_events
int ltc4296_chk_port_events(struct ltc4296_dev *dev, enum ltc4296_port ltc4296_port)
Check port events.
Definition: ltc4296.c:999
ltc4296_spoe_vol_range_mv
int ltc4296_spoe_vol_range_mv[12][2]
Definition: ltc4296.c:56
LTC_PORT_SELFTEST
@ LTC_PORT_SELFTEST
Definition: ltc4296.h:315
ADI_LTC_DISCONTINUE_TEST
@ ADI_LTC_DISCONTINUE_TEST
Definition: ltc4296.h:340
LTC4296_END_CLASSIFICATION_MSK
#define LTC4296_END_CLASSIFICATION_MSK
Definition: ltc4296.h:162
ltc4296_port_prebias
int ltc4296_port_prebias(struct ltc4296_dev *dev, enum ltc4296_port port_no, enum ltc4296_config mode)
Stimulate valid wake-up signature for a port.
Definition: ltc4296.c:657
LTC4296_VMAX
#define LTC4296_VMAX
Definition: ltc4296.h:207
ltc4296_unlock
int ltc4296_unlock(struct ltc4296_dev *dev)
Device unlock.
Definition: ltc4296.c:267
ltc4296_remove
int ltc4296_remove(struct ltc4296_dev *dev)
Free allocated resources.
Definition: ltc4296.c:1080
LTC4296_SW_PSE_READY_MSK
#define LTC4296_SW_PSE_READY_MSK
Definition: ltc4296.h:170
LTC_PORT1
@ LTC_PORT1
Definition: ltc4296.h:245
LTC_PORT_STATUS
@ LTC_PORT_STATUS
Definition: ltc4296.h:310
LTC4296_PD_WAKEUP_MSK
#define LTC4296_PD_WAKEUP_MSK
Definition: ltc4296.h:142
ltc4296_reg_read
int ltc4296_reg_read(struct ltc4296_dev *dev, uint8_t reg, uint16_t *data)
Register Read.
Definition: ltc4296.c:122
ltc4296_is_port_pwr_stable
int ltc4296_is_port_pwr_stable(struct ltc4296_dev *dev, enum ltc4296_port port_no, bool *pwr_status)
Check if port has stable power.
Definition: ltc4296.c:587
LTC4296_PEC_FAULT_MSK
#define LTC4296_PEC_FAULT_MSK
Definition: ltc4296.h:95
LTC4296_TOFF_TIMER_DONE_MSK
#define LTC4296_TOFF_TIMER_DONE_MSK
Definition: ltc4296.h:137
ltc4296_set_port_pwr
int ltc4296_set_port_pwr(struct ltc4296_dev *dev, enum ltc4296_port port_no)
Set port to power mode.
Definition: ltc4296.c:761
LTC4296_TMFVDO_TIMER_DISABLE_MSK
#define LTC4296_TMFVDO_TIMER_DISABLE_MSK
Definition: ltc4296.h:169
APL_CLASSA_NOAUTONEG
@ APL_CLASSA_NOAUTONEG
Definition: ltc4296.h:285
DEBUGMODE
@ DEBUGMODE
Definition: ltc4296.h:293
ltc4296_is_vout_valid
int ltc4296_is_vout_valid(struct ltc4296_dev *dev, int port_vout_mv, enum ltc4296_board_class ltcboard_class, bool *vout_valid)
Check if output voltage is valid.
Definition: ltc4296.c:384
ltc4296_reset
int ltc4296_reset(struct ltc4296_dev *dev)
Software reset.
Definition: ltc4296.c:169
ltc4296_read_global_faults
int ltc4296_read_global_faults(struct ltc4296_dev *dev, uint16_t *g_events)
Read global faults.
Definition: ltc4296.c:251
ADI_LTC_APL_COMPLETE
@ ADI_LTC_APL_COMPLETE
Definition: ltc4296.h:335
ltc4296_force_port_pwr
int ltc4296_force_port_pwr(struct ltc4296_dev *dev, enum ltc4296_port port_no)
Force port to power mode.
Definition: ltc4296.c:785
SPOE_CLASS13
@ SPOE_CLASS13
Definition: ltc4296.h:281
LTC4296_SPI_READ
#define LTC4296_SPI_READ
Definition: ltc4296.h:195
LTC_PORT4
@ LTC_PORT4
Definition: ltc4296.h:248
ltc4296_init
int ltc4296_init(struct ltc4296_dev **device, struct ltc4296_init_param *init_param)
Device initialization.
Definition: ltc4296.c:1027
ltc4296_port_reg_offset_e
ltc4296_port_reg_offset_e
Device Port Register offsets.
Definition: ltc4296.h:308
ADI_LTC_SCCP_PD_CLASS_NOT_SUPPORTED
@ ADI_LTC_SCCP_PD_CLASS_NOT_SUPPORTED
Definition: ltc4296.h:330
ltc4296_read_global_faults
int ltc4296_read_global_faults(struct ltc4296_dev *dev, uint16_t *g_events)
Read global faults.
Definition: ltc4296.c:251
ADI_LTC_INVALID_ADC_VOLTAGE
@ ADI_LTC_INVALID_ADC_VOLTAGE
Definition: ltc4296.h:337
LTC4296_SW_EN_MSK
#define LTC4296_SW_EN_MSK
Definition: ltc4296.h:176
LTC4296_REG_GADCCFG
#define LTC4296_REG_GADCCFG
Definition: ltc4296.h:54
LTC4296_TINRUSH_TIMER_DONE_MSK
#define LTC4296_TINRUSH_TIMER_DONE_MSK
Definition: ltc4296.h:141
ADI_LTC_DISCONTINUE_APL
@ ADI_LTC_DISCONTINUE_APL
Definition: ltc4296.h:336
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
ltc4296_is_locked
int ltc4296_is_locked(struct ltc4296_dev *dev, enum ltc4296_state *state)
Check device state.
Definition: ltc4296.c:282
adi_ltc_result
adi_ltc_result
Device Result Codes.
Definition: ltc4296.h:321
ltc4296_is_port_disabled
int ltc4296_is_port_disabled(struct ltc4296_dev *dev, enum ltc4296_port port_no, enum ltc4296_port_status *port_chk)
Check if port is enabled/disabled.
Definition: ltc4296.c:497
ltc4296_clear_port_events
int ltc4296_clear_port_events(struct ltc4296_dev *dev, enum ltc4296_port port_no)
Clear Port Events.
Definition: ltc4296.c:451
ltc4296_print_global_faults
int ltc4296_print_global_faults(uint16_t g_events)
Print global faults.
Definition: ltc4296.c:855
SPOE_CLASS12
@ SPOE_CLASS12
Definition: ltc4296.h:280
ltc4296_port_prebias
int ltc4296_port_prebias(struct ltc4296_dev *dev, enum ltc4296_port port_no, enum ltc4296_config mode)
Stimulate valid wake-up signature for a port.
Definition: ltc4296.c:657
ltc4296_is_vout_valid
int ltc4296_is_vout_valid(struct ltc4296_dev *dev, int port_vout_mv, enum ltc4296_board_class ltcboard_class, bool *vout_valid)
Check if output voltage is valid.
Definition: ltc4296.c:384
ltc4296_read_port_events
int ltc4296_read_port_events(struct ltc4296_dev *dev, enum ltc4296_port port_no, uint16_t *port_events)
Read Port Events.
Definition: ltc4296.c:429
ltc4296_clear_global_faults
int ltc4296_clear_global_faults(struct ltc4296_dev *dev)
Clear global faults.
Definition: ltc4296.c:211
ADI_LTC_SCCP_PD_DETECTION_FAILED
@ ADI_LTC_SCCP_PD_DETECTION_FAILED
Definition: ltc4296.h:325
ltc4296_clear_port_events
int ltc4296_clear_port_events(struct ltc4296_dev *dev, enum ltc4296_port port_no)
Clear Port Events.
Definition: ltc4296.c:451
LTC4296_COMMAND_FAULT_MSK
#define LTC4296_COMMAND_FAULT_MSK
Definition: ltc4296.h:94
LTC4296_ADC_OFFSET
#define LTC4296_ADC_OFFSET
Definition: ltc4296.h:202
LTC4296_GADC_MSK
#define LTC4296_GADC_MSK
Definition: ltc4296.h:132
ADI_LTC_DISCONTINUE_SCCP
@ ADI_LTC_DISCONTINUE_SCCP
Definition: ltc4296.h:323
ltc4296_read_gadc
int ltc4296_read_gadc(struct ltc4296_dev *dev, int *port_voltage_mv)
Read global ADC.
Definition: ltc4296.c:308
ltc4296_dev
Device Structure.
Definition: ltc4296.h:221
SPOE_CLASS14
@ SPOE_CLASS14
Definition: ltc4296.h:282
ADI_LTC_INVALID_VIN
@ ADI_LTC_INVALID_VIN
Definition: ltc4296.h:342
LTC4296_UNLOCK_KEY
#define LTC4296_UNLOCK_KEY
Definition: ltc4296.h:199
ADI_LTC_SCCP_PD_NOT_PRESENT
@ ADI_LTC_SCCP_PD_NOT_PRESENT
Definition: ltc4296.h:326
SPOE_CLASS11
@ SPOE_CLASS11
Definition: ltc4296.h:279
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
SPOE_OFF
@ SPOE_OFF
Definition: ltc4296.h:290
LTC4296_PSE_STATUS_MSK
#define LTC4296_PSE_STATUS_MSK
Definition: ltc4296.h:158
LTC4296_LSNS_FORWARD_FAULT_MSK
#define LTC4296_LSNS_FORWARD_FAULT_MSK
Definition: ltc4296.h:143
LTC4296_SW_POWER_AVAILABLE_MSK
#define LTC4296_SW_POWER_AVAILABLE_MSK
Definition: ltc4296.h:171
LTC4296_VMIN
#define LTC4296_VMIN
Definition: ltc4296.h:208
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
ADI_LTC_SCCP_PD_CLASS_NOT_COMPATIBLE
@ ADI_LTC_SCCP_PD_CLASS_NOT_COMPATIBLE
Definition: ltc4296.h:331
LTC4296_NEW_MSK
#define LTC4296_NEW_MSK
Definition: ltc4296.h:191
LTC_PORT_CFG0
@ LTC_PORT_CFG0
Definition: ltc4296.h:311
APL_CLASSA_OLD_DEMO
@ APL_CLASSA_OLD_DEMO
Definition: ltc4296.h:289
LTC_CFG_SCCP_MODE
@ LTC_CFG_SCCP_MODE
Definition: ltc4296.h:300
ltc4296_board_class
ltc4296_board_class
Board Classes.
Definition: ltc4296.h:277
ADI_LTC_TEST_COMPLETE
@ ADI_LTC_TEST_COMPLETE
Definition: ltc4296.h:339
ltc4296_port_status
ltc4296_port_status
Device Port Status.
Definition: ltc4296.h:255
ltc4296_read_gadc
int ltc4296_read_gadc(struct ltc4296_dev *dev, int *port_voltage_mv)
Read global ADC.
Definition: ltc4296.c:308
no_os_spi_remove
int32_t no_os_spi_remove(struct no_os_spi_desc *desc)
Free the resources allocated by no_os_spi_init().
Definition: no_os_spi.c:116
LTC4296_SET_CLASSIFICATION_MODE_MSK
#define LTC4296_SET_CLASSIFICATION_MODE_MSK
Definition: ltc4296.h:163
LTC_CFG_APL_MODE
@ LTC_CFG_APL_MODE
Definition: ltc4296.h:301
ltc4296_is_port_deliver_pwr
int ltc4296_is_port_deliver_pwr(struct ltc4296_dev *dev, enum ltc4296_port port_no, enum ltc4296_pse_status *pwr_status)
Check if port delivers power.
Definition: ltc4296.c:552
ltc4296_set_gadc_vout
int ltc4296_set_gadc_vout(struct ltc4296_dev *dev, enum ltc4296_port port_no)
Configure Global ADC to read output voltage.
Definition: ltc4296.c:833
no_os_gpio.h
Header file of GPIO Interface.
LTC_PORT2
@ LTC_PORT2
Definition: ltc4296.h:246
LTC_PSE_STATUS_IDLE
@ LTC_PSE_STATUS_IDLE
Definition: ltc4296.h:269
ltc4296_reg_write
int ltc4296_reg_write(struct ltc4296_dev *dev, uint8_t reg, uint16_t data)
Register Write.
Definition: ltc4296.c:149
LTC_LOCKED
@ LTC_LOCKED
Definition: ltc4296.h:237
ADI_LTC_SCCP_PD_LINE_NOT_LOW
@ ADI_LTC_SCCP_PD_LINE_NOT_LOW
Definition: ltc4296.h:333
ltc4296_port_disable
int ltc4296_port_disable(struct ltc4296_dev *dev, enum ltc4296_port port_no)
Check if port is disabled.
Definition: ltc4296.c:530
LTC4296_SPI_WRITE
#define LTC4296_SPI_WRITE
Definition: ltc4296.h:196
ltc4296_port_en_and_classification
int ltc4296_port_en_and_classification(struct ltc4296_dev *dev, enum ltc4296_port port_no)
Enable specific port and classify.
Definition: ltc4296.c:708
LTC4296_MAX_PORTS
#define LTC4296_MAX_PORTS
Definition: ltc4296.h:210
no_os_spi_init
int32_t no_os_spi_init(struct no_os_spi_desc **desc, const struct no_os_spi_init_param *param)
Initialize the SPI communication peripheral.
Definition: no_os_spi.c:52
ltc4296_print_port_events
int ltc4296_print_port_events(enum ltc4296_port port_no, uint16_t port_events)
Print port events.
Definition: ltc4296.c:877
no_os_get_unaligned_be16
uint16_t no_os_get_unaligned_be16(uint8_t *buf)
LTC_PSE_STATUS_SLEEPING
@ LTC_PSE_STATUS_SLEEPING
Definition: ltc4296.h:265
ADI_LTC_SCCP_PD_CLASS_COMPATIBLE
@ ADI_LTC_SCCP_PD_CLASS_COMPATIBLE
Definition: ltc4296.h:329
ltc4296_pse_status
ltc4296_pse_status
Device PSE Status.
Definition: ltc4296.h:263
ltc4296_set_port_mfvs
int ltc4296_set_port_mfvs(struct ltc4296_dev *dev, enum ltc4296_port port_no)
Set port to maintain full voltage signature.
Definition: ltc4296.c:732
LTC_PSE_STATUS_PREPDET
@ LTC_PSE_STATUS_PREPDET
Definition: ltc4296.h:270
no_os_util.h
Header file of utility functions.
ltc4296_reg_write
int ltc4296_reg_write(struct ltc4296_dev *dev, uint8_t reg, uint16_t data)
Register Write.
Definition: ltc4296.c:149
ltc4296_get_port_addr
int ltc4296_get_port_addr(enum ltc4296_port port_no, enum ltc4296_port_reg_offset_e port_offset, uint8_t *port_addr)
Get port address.
Definition: ltc4296.c:194
ltc4296_port_pwr_available
int ltc4296_port_pwr_available(struct ltc4296_dev *dev, enum ltc4296_port port_no)
Set port is able to source power.
Definition: ltc4296.c:808
ltc4296_chk_global_events
int ltc4296_chk_global_events(struct ltc4296_dev *dev)
Check global events.
Definition: ltc4296.c:922
LTC_PORT3
@ LTC_PORT3
Definition: ltc4296.h:247
SPOE_CLASS15
@ SPOE_CLASS15
Definition: ltc4296.h:283
ltc4296_port_en_and_classification
int ltc4296_port_en_and_classification(struct ltc4296_dev *dev, enum ltc4296_port port_no)
Enable specific port and classify.
Definition: ltc4296.c:708
ltc4296_set_gadc_vin
int ltc4296_set_gadc_vin(struct ltc4296_dev *dev)
Set the global ADC to measure voltage.
Definition: ltc4296.c:334
ltc4296.h
Header file for the LTC4296 Driver.
ltc4296_init
int ltc4296_init(struct ltc4296_dev **device, struct ltc4296_init_param *init_param)
Device initialization.
Definition: ltc4296.c:1027
LTC_PSE_STATUS_ERROR
@ LTC_PSE_STATUS_ERROR
Definition: ltc4296.h:268
ltc4296_read_port_adc
int ltc4296_read_port_adc(struct ltc4296_dev *dev, enum ltc4296_port port_no, int *port_i_out_ma)
Read port ADC.
Definition: ltc4296.c:621
ltc4296_set_port_pwr
int ltc4296_set_port_pwr(struct ltc4296_dev *dev, enum ltc4296_port port_no)
Set port to power mode.
Definition: ltc4296.c:761
LTC4296_LSNS_REVERSE_FAULT_MSK
#define LTC4296_LSNS_REVERSE_FAULT_MSK
Definition: ltc4296.h:144
LTC_PORT_EVENTS
@ LTC_PORT_EVENTS
Definition: ltc4296.h:309
LTC4296_GADC_NEW_MSK
#define LTC4296_GADC_NEW_MSK
Definition: ltc4296.h:131
ADI_LTC_SCCP_PD_RES_INVALID
@ ADI_LTC_SCCP_PD_RES_INVALID
Definition: ltc4296.h:327
ltc4296_set_gadc_vin
int ltc4296_set_gadc_vin(struct ltc4296_dev *dev)
Set the global ADC to measure voltage.
Definition: ltc4296.c:334
LTC_NO_PORT
@ LTC_NO_PORT
Definition: ltc4296.h:249
errno.h
Error macro definition for ARM Compiler.
NO_OS_DIV_ROUND_CLOSEST
#define NO_OS_DIV_ROUND_CLOSEST(x, y)
Definition: no_os_util.h:54
LTC_PORT_CFG1
@ LTC_PORT_CFG1
Definition: ltc4296.h:312
APL_CLASSA
@ APL_CLASSA
Definition: ltc4296.h:284
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140