| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

LT_PMBusRail.cpp
Go to the documentation of this file.
1 /*!
2 LTC PMBusRail Support
3
4 @verbatim
5
6 This PMBus code does not cover the entire PMBus command set. The intention
7 is to cover the common commands. It was written for LTC PMBus devices,
8 and may not perform properly with other PMBus devices.
9
10 @endverbatim
11
12
13 Copyright 2018(c) Analog Devices, Inc.
14
15 All rights reserved.
16
17 Redistribution and use in source and binary forms, with or without
18 modification, are permitted provided that the following conditions are met:
19 - Redistributions of source code must retain the above copyright
20 notice, this list of conditions and the following disclaimer.
21 - Redistributions in binary form must reproduce the above copyright
22 notice, this list of conditions and the following disclaimer in
23 the documentation and/or other materials provided with the
24 distribution.
25 - Neither the name of Analog Devices, Inc. nor the names of its
26 contributors may be used to endorse or promote products derived
27 from this software without specific prior written permission.
28 - The use of this software may or may not infringe the patent rights
29 of one or more patent holders. This license does not release you
30 from the requirement that you obtain separate licenses from these
31 patent holders to use this software.
32 - Use of the software either in source or binary form, must be run
33 on or directly connected to an Analog Devices Inc. component.
34
35 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
36 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
37 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
38 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
39 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
40 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
41 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
42 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
43 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
44 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
45 */
46
47 //! @ingroup PMBus_SMBus
48 //! @{
49 //! @defgroup LT_PMBusRail LT_PMBusRail: PMBus Rail commands
50 //! @}
51
52 /*! @file
53 @ingroup LT_PMBusRail
54 Library File for LT_PMBusRail
55 */
56
57 #include <Arduino.h>
58 #include <stdint.h>
59 #include <math.h>
60 #include "Linduino.h"
61 #include "LT_PMBusRail.h"
62 #include "LT_PMBusDevice.h"
63
64 LT_PMBusRail::LT_PMBusRail (LT_PMBus *pmbus, uint8_t railAddress, tRailDef **railDef)
65 {
66 pmbus_ = pmbus;
67 railAddress_ = railAddress;
68 railDef_ = railDef;
69 }
70
71 void LT_PMBusRail::merge(LT_PMBusRail *rail)
72 {
73 uint8_t i;
74
75 (*railDef_)->pages = (uint8_t *)realloc((*railDef_)->pages, (*railDef_)->noOfPages + (*(rail->railDef_))->noOfPages);
76 for (i = (*railDef_)->noOfPages; i < (*railDef_)->noOfPages + (*(rail->railDef_))->noOfPages; i++)
77 (*railDef_)->pages[i] = (*(rail->railDef_))->pages[i - (*railDef_)->noOfPages];
78 (*railDef_)->noOfPages += (*(rail->railDef_))->noOfPages;
79 }
80
81 LT_PMBusRail::~LT_PMBusRail()
82 {
83 tRailDef **rail = railDef_;
84 while (*rail != NULL)
85 {
86 free ((*rail)->pages);
87 delete *rail;
88 rail++;
89 }
90 free (railDef_);
91 }
92
93 void LT_PMBusRail::changePMBus(LT_PMBus *pmbus)
94 {
95 pmbus_ = pmbus;
96 }
97
98 uint8_t LT_PMBusRail::getAddress()
99 {
100 return railAddress_;
101 }
102
103 bool LT_PMBusRail::isController ()
104 {
105 tRailDef **rail = railDef_;
106 return (*rail)->controller;
107 }
108
109 uint8_t LT_PMBusRail::getNoPages()
110 {
111 tRailDef **rail = railDef_;
112 uint8_t noPages = 0;
113
114 while (*rail != NULL)
115 {
116 noPages += (*rail)->noOfPages;
117 rail++;
118 }
119 return noPages;
120 }
121
122 bool LT_PMBusRail::isMultiphase()
123 {
124 return (*railDef_)->multiphase;
125 }
126
127 uint32_t LT_PMBusRail::getCapabilities()
128 {
129 return (*railDef_)->capabilities;
130 }
131
132 uint32_t LT_PMBusRail::hasCapability(uint32_t capability)
133 {
134 return ((*railDef_)->capabilities & capability) == capability;
135 }
136
137 /*
138 * Set the output voltage of a polyphase rail
139 *
140 * voltage: the target voltage
141 */
142 void LT_PMBusRail::setVout(float voltage)
143 {
144 // Add phases will move via the rail address.
145 pmbus_->setVout(railAddress_, voltage);
146 }
147
148 /*
149 * Read the input voltage of a polyphase rail
150 *
151 * polling: poll if true
152 * return: the input voltage
153 */
154 float LT_PMBusRail::readVin(bool polling)
155 {
156 // This assumes that the VIN of all physical devices share
157 // the same VIN.
158 return pmbus_->readVin((*railDef_)->address, polling);
159 }
160
161 /*
162 * Read the output voltage of a polyphase rail
163 *
164 * polling: poll if true
165 * return: the output voltage
166 */
167 float LT_PMBusRail::readVout(bool polling)
168 {
169 // All VOUTs are connected, so any physical address and
170 // page will do.
171 pmbus_->setPage((*railDef_)->address, (*railDef_)->pages[0]);
172 return pmbus_->readVout((*railDef_)->address, polling);
173 }
174
175 /*
176 * Read the input current of a polyphase rail
177 *
178 * polling: poll if true
179 * return: the input current
180 */
181 float LT_PMBusRail::readIin(bool polling)
182 {
183 float current = 0.0;
184 tRailDef **rail = railDef_;
185
186 // Add up inputs from all physical devices. This
187 // may include rail/phases that are not part of the rail.
188 while (*rail != NULL)
189 {
190 for (int j = 0; j < (*rail)->noOfPages; j++)
191 {
192 pmbus_->setPage((*rail)->address, (*rail)->pages[j]);
193 current += pmbus_->readIin((*rail)->address, polling);
194 }
195 rail++;
196 }
197
198 return current;
199 }
200
201 /*
202 * Read the output current of a polyphase rail
203 *
204 * polling: poll if true
205 * return: the output current
206 */
207 float LT_PMBusRail::readIout(bool polling)
208 {
209 float current = 0.0;
210 tRailDef **rail = railDef_;
211
212 // Add up all phases. There will not be any unwanted phases.
213 while (*rail != NULL)
214 {
215 for (int j = 0; j < (*rail)->noOfPages; j++)
216 {
217 pmbus_->setPage((*rail)->address, (*rail)->pages[j]);
218 current += pmbus_->readIout((*rail)->address, polling);
219 }
220 rail++;
221 }
222
223 return current;
224 }
225
226 /*
227 * Read the input power of a polyphase rail
228 *
229 * polling: poll if true
230 * return: the output current
231 */
232 float LT_PMBusRail::readPin(bool polling)
233 {
234 float power = 0.0;
235 tRailDef **rail = railDef_;
236
237 // Add up inputs from all physical devices. This
238 // may include rail/phases that are not part of the rail.
239 while (*rail != NULL)
240 {
241 power += pmbus_->readPin((*rail)->address, polling);
242 rail++;
243 }
244
245 return power;
246 }
247
248 /*
249 * Read the output power of a polyphase rail
250 *
251 * polling: poll if true
252 * return: the output power
253 */
254 float LT_PMBusRail::readPout(bool polling)
255 {
256 float power = 0.0;
257 tRailDef **rail = railDef_;
258
259 // Add up all phases. There will not be any unwanted phases.
260 while (*rail != NULL)
261 {
262 for (int j = 0; j < (*rail)->noOfPages; j++)
263 {
264 pmbus_->setPage((*rail)->address, (*rail)->pages[j]);
265 power += pmbus_->readPout((*rail)->address, polling);
266 }
267 rail++;
268 }
269
270 return power;
271 }
272
273 /*
274 * Read the external temperature of a polyphase rail
275 *
276 * polling: poll if true
277 * return: the temperature
278 */
279 float LT_PMBusRail::readExternalTemperature(bool polling)
280 {
281 float temp = 0.0;
282 float pages = 0;
283 tRailDef **rail = railDef_;
284
285 // Add up all phases. There will not be any unwanted phases.
286 while (*rail != NULL)
287 {
288 pages += (float) ((*rail)->noOfPages);
289 for (int j = 0; j < (*rail)->noOfPages; j++)
290 {
291 pmbus_->setPage((*rail)->address, (*rail)->pages[j]);
292 temp += pmbus_->readExternalTemperature((*rail)->address, polling);
293 }
294 rail++;
295 }
296
297 return temp/pages;
298 }
299
300 /*
301 * Read the internal temperature of a polyphase rail
302 *
303 * polling: poll if true
304 * return: the temperature
305 */
306 float LT_PMBusRail::readInternalTemperature(bool polling)
307 {
308 float temp = 0.0;
309 float pages = 0;
310 tRailDef **rail = railDef_;
311
312 // Add up all phases. There will not be any unwanted phases.
313 while (*rail != NULL)
314 {
315 pages += (float) ((*rail)->noOfPages);
316 for (int j = 0; j < (*rail)->noOfPages; j++)
317 {
318 pmbus_->setPage((*rail)->address, (*rail)->pages[j]);
319 PsmDeviceType t = pmbus_->deviceType((*rail)->address);
320 if (t == LTC2977 || t == LTC2978)
321 temp += pmbus_->readExternalTemperature((*rail)->address, polling); // Really internal.
322 else
323 temp += pmbus_->readInternalTemperature((*rail)->address, polling);
324 }
325 rail++;
326 }
327
328 return temp/pages; // Account for multiple devices
329 }
330
331
332 /*
333 * Read the efficiency of a polyphase rail
334 *
335 * polling: poll if true
336 * return: the efficiency
337 */
338 float LT_PMBusRail::readEfficiency(bool polling)
339 {
340 float val1, val2 = 0.0;
341 float efficiency = 0.0;
342
343 // Serial.print("eff "); Serial.println(getCapabilities(), HEX);
344 if (hasCapability(HAS_POUT | HAS_PIN))
345 {
346 // Serial.println("1");
347 val1 = readPin(polling);
348 val2 += readPout(polling);
349 efficiency = 100.0 * val2/val1;
350 }
351 else if (hasCapability(HAS_POUT | HAS_IIN | HAS_VIN))
352 {
353 // Serial.println("2");
354 val1 = readVin(polling);
355 val1 *= readIin(polling);
356 val2 = readPout(polling);
357 efficiency = 100.0 * val2/val1;
358 }
359 else if (hasCapability(HAS_VOUT | HAS_IOUT | HAS_PIN))
360 {
361 // Serial.println("3");
362 val1 = readPin(polling);
363 val2 = readVout(polling);
364 val2 *= readIout(polling);
365 efficiency = 100.0 * val2/val1;
366 }
367 else if (hasCapability(HAS_VOUT | HAS_IOUT | HAS_VIN | HAS_IIN))
368 {
369 // Serial.println("4");
370 val1 = readVin(polling);
371 val1 *= readIin(polling);
372 val2 = readVout(polling);
373 val2 *= readIout(polling);
374 efficiency = 100.0 * val2/val1;
375 }
376 return efficiency;
377 }
378
379 /*
380 * Read the average duty cycle of a polyphase rail
381 *
382 * polling: poll if true
383 * return: the duty cycle
384 */
385 float LT_PMBusRail::readDutyCycle(bool polling)
386 {
387 float total = 0.0;
388 tRailDef **rail = railDef_;
389
390 if (hasCapability(HAS_DC))
391 {
392
393 while (*rail != NULL)
394 {
395 for (int j = 0; j < (*rail)->noOfPages; j++)
396 {
397 pmbus_->setPage((*rail)->address, (*rail)->pages[j]);
398 total += pmbus_->readDutyCycle((*rail)->address, polling);
399 // Serial.println(dc,DEC);
400 }
401 rail++;
402 }
403
404 return total/(*rail)->noOfPages;
405 }
406 else
407 return 0.0;
408 }
409
410 float LT_PMBusRail::readPhaseBalance(bool polling)
411 {
412 float current = 0.0;
413 float min = 10000.0;
414 float max = -10000.0;
415 float total = 0.0;
416 tRailDef **rail = railDef_;
417
418 if (hasCapability(HAS_IOUT))
419 {
420
421 while (*rail != NULL)
422 {
423 for (int j = 0; j < (*rail)->noOfPages; j++)
424 {
425 pmbus_->setPage((*rail)->address, (*rail)->pages[j]);
426 total += (current = pmbus_->readIout((*rail)->address, polling));
427 // Serial.println(current,DEC);
428 if (current > max) max = current;
429 if (current < min) min = current;
430 }
431 rail++;
432 }
433
434 return 100.0 * (max - min)/total;
435 }
436 else
437 return 0.0;
438 }
439
440 float LT_PMBusRail::readTransient(bool polling)
441 {
442 float max = 0.0;
443 float vout;
444 float vout_uv;
445 uint8_t vout_response;
446 uint8_t status;
447 tRailDef **rail = railDef_;
448 float v;
449 bool is_controller;
450 uint16_t pads;
451 PsmDeviceType t;
452
453 while (*rail != NULL)
454 {
455 is_controller = isController();
456 max = 0.0;
457 for (int j = 0; j < (*rail)->noOfPages; j++)
458 {
459 // Skip LTC3882 Slave phases
460 t = pmbus_->deviceType((*rail)->address);
461 if (is_controller && (t == LTC3882 || t == LTC3882_1))
462 {
463 // Serial.println(j, DEC);
464 pads = pmbus_->smbus()->readWord((*rail)->address, MFR_PADS);
465 // Serial.println(pads, HEX);
466 if (pads & (1 << (14 + j)))
467 continue;
468 }
469
470 if (polling) pmbus_->smbus()->waitForAck((*rail)->address, 0x00);
471 if (polling) pmbus_->waitForNotBusy((*rail)->address);
472 pmbus_->setPage((*rail)->address, (*rail)->pages[j]);
473 if (polling) pmbus_->smbus()->waitForAck((*rail)->address, 0x00);
474 if (polling) pmbus_->waitForNotBusy((*rail)->address);
475 vout = pmbus_->getVout((*rail)->address, polling);
476 if (polling) pmbus_->smbus()->waitForAck((*rail)->address, 0x00);
477 if (polling) pmbus_->waitForNotBusy((*rail)->address);
478 vout_uv = pmbus_->getVoutUv((*rail)->address, polling);
479 if (polling) pmbus_->smbus()->waitForAck((*rail)->address, 0x00);
480 if (polling) pmbus_->waitForNotBusy((*rail)->address);
481 vout_response = pmbus_->smbus()->readByte((*rail)->address, VOUT_UV_FAULT_RESPONSE);
482 if (polling) pmbus_->smbus()->waitForAck((*rail)->address, 0x00);
483 if (polling) pmbus_->waitForNotBusy((*rail)->address);
484 pmbus_->smbus()->writeByte((*rail)->address, VOUT_UV_FAULT_RESPONSE, 0);
485 if (polling) pmbus_->smbus()->waitForAck((*rail)->address, 0x00);
486 if (polling) pmbus_->waitForNotBusy((*rail)->address);
487
488 status = pmbus_->readVoutStatusByte((*rail)->address);
489 if (polling) pmbus_->smbus()->waitForAck((*rail)->address, 0x00);
490 if (polling) pmbus_->waitForNotBusy((*rail)->address);
491 if (is_controller)
492 pmbus_->smbus()->writeByte((*rail)->address, STATUS_VOUT, status | (1 << 4));
493 else
494 pmbus_->clearFaults((*rail)->address);
495 if (polling) pmbus_->smbus()->waitForAck((*rail)->address, 0x00);
496 if (polling) pmbus_->waitForNotBusy((*rail)->address);
497
498 // Serial.print("N "); Serial.println(vout, DEC);
499
500 // Generating a fault, even if ignored, can make things busy, so poll.
501 for (v = 0.95 * vout; v < 1.05 * vout; v = v + 0.001)
502 {
503 pmbus_->setVoutUvFaultLimit((*rail)->address, v);
504 if (polling) pmbus_->smbus()->waitForAck((*rail)->address, 0x00);
505 if (polling) pmbus_->waitForNotBusy((*rail)->address);
506 status = pmbus_->readVoutStatusByte((*rail)->address);
507 if (polling) pmbus_->smbus()->waitForAck((*rail)->address, 0x00);
508 if (polling) pmbus_->waitForNotBusy((*rail)->address);
509 if (status & (1 << 4))
510 {
511 // Serial.print("V "); Serial.print(v,DEC); Serial.print(" S "); Serial.println(status, HEX);
512 break;
513 }
514 delay(50);
515 }
516
517 pmbus_->setVoutUvFaultLimit((*rail)->address, vout_uv);
518 if (polling) pmbus_->smbus()->waitForAck((*rail)->address, 0x00);
519 if (polling) pmbus_->waitForNotBusy((*rail)->address);
520 pmbus_->smbus()->writeByte((*rail)->address, VOUT_UV_FAULT_RESPONSE, vout_response);
521 if (polling) pmbus_->smbus()->waitForAck((*rail)->address, 0x00);
522 if (polling) pmbus_->waitForNotBusy((*rail)->address);
523
524 if (is_controller)
525 pmbus_->smbus()->writeByte((*rail)->address, STATUS_VOUT, status | (1 << 4));
526 else
527 pmbus_->clearFaults((*rail)->address);
528
529 // Serial.println(vout, DEC);
530 // Serial.println(v, DEC);
531 // Serial.println();
532
533 max = max(max, vout-v);
534 // Serial.print("transient "); Serial.println(vout-v, DEC);
535 // Serial.print("uv "); Serial.println(vout_uv, DEC);
536 // Serial.print("resp "); Serial.println(vout_response, HEX);
537
538 }
539 rail++;
540 }
541
542 return max;
543 }
544
545 /*
546 * Read the status word of a polyphase rail
547 *
548 * return: status word
549 */
550 uint16_t LT_PMBusRail::readStatusWord()
551 {
552 uint16_t sw = 0;
553 tRailDef **rail = railDef_;
554
555 // Combine all words. Assumes 1 = notification, so that anything
556 // with a 1 is interesting.
557 while (*rail != NULL)
558 {
559 for (int j = 0; j < (*rail)->noOfPages; j++)
560 {
561 pmbus_->setPage((*rail)->address, (*rail)->pages[j]);
562 sw |= pmbus_->readStatusWord((*rail)->address);
563 }
564 rail++;
565 }
566
567 return sw;
568 }
569
570 /*
571 * Read the special id of a polyphase rail
572 *
573 * return: special id
574 */
575 uint16_t LT_PMBusRail::readMfrSpecialId()
576 {
577 uint16_t id = 0;
578 tRailDef **rail = railDef_;
579
580 while (*rail != NULL)
581 {
582 for (int j = 0; j < (*rail)->noOfPages; j++)
583 {
584 pmbus_->setPage((*rail)->address, (*rail)->pages[j]);
585 id = pmbus_->readMfrSpecialId((*rail)->address);
586 // Exist at first opportunity.
587 break;
588 }
589 rail++;
590 }
591
592 return id;
593 }
594
595 /*
596 * Clear faults of polyphase rail
597 */
598 void LT_PMBusRail::clearFaults()
599 {
600 tRailDef **rail = railDef_;
601
602 pmbus_->startGroupProtocol();
603
604 while (*rail != NULL)
605 {
606 pmbus_->clearAllFaults((*rail)->address);
607 rail++;
608 }
609
610 pmbus_->executeGroupProtocol();
611 }
612
613 /*
614 * Sequence on a polyphase rail
615 */
616 void LT_PMBusRail::sequenceOn()
617 {
618 pmbus_->sequenceOn(&railAddress_, 1);
619 }
620
621 /*
622 * Turn off a polyphase rail
623 */
624 void LT_PMBusRail::immediateOff()
625 {
626 pmbus_->immediateOff(&railAddress_, 1);
627 }
628
629 /*
630 * Sequence off a polyphase rail
631 *
632 */
633 void LT_PMBusRail::sequenceOff()
634 {
635 pmbus_->sequenceOff(&railAddress_, 1);
636 }
637
638 /*
639 * Margin high polyphase rail
640 */
641 void LT_PMBusRail::marginHigh()
642 {
643 pmbus_->marginHigh(railAddress_);
644 }
645
646 /*
647 * Margin low polyphase rail
648 *
649 */
650 void LT_PMBusRail::marginLow()
651 {
652 pmbus_->marginLow(railAddress_);
653 }
654
655 /*
656 * Margin off polyphase rail
657 *
658 */
659 void LT_PMBusRail::marginOff()
660 {
661 pmbus_->marginOff(railAddress_);
662 }
id
static int id
Definition: rail_logger.ino:99
LT_PMBusRail::readExternalTemperature
float readExternalTemperature(bool polling)
Read the external temperature of a polyphase rail.
Definition: LT_PMBusRail.cpp:279
LT_PMBus::sequenceOff
void sequenceOff(uint8_t *addresses, uint8_t no_addresses)
Sequence off a list of addresses.
Definition: LT_PMBus.cpp:2850
LT_PMBusRail::readTransient
float readTransient(bool polling)
Read the transient.
Definition: LT_PMBusRail.cpp:440
LT_PMBus::sequenceOn
void sequenceOn(uint8_t *addresses, uint8_t no_addresses)
Sequence on a list of devices.
Definition: LT_PMBus.cpp:2794
LT_PMBus::readPout
float readPout(uint8_t address, bool polling)
Get the measured output power.
Definition: LT_PMBus.cpp:1963
tRailDef::noOfPages
uint8_t noOfPages
Definition: LT_PMBusRail.h:65
LT_PMBusRail::readMfrSpecialId
uint16_t readMfrSpecialId()
Read the special of a polyphase rail.
Definition: LT_PMBusRail.cpp:575
HAS_VIN
#define HAS_VIN
Definition: LT_PMBusDevice.h:59
VOUT_UV_FAULT_RESPONSE
#define VOUT_UV_FAULT_RESPONSE
Definition: LT_PMBus.h:86
LT_PMBusRail::readEfficiency
float readEfficiency(bool polling)
Read the efficiency (calculated)
Definition: LT_PMBusRail.cpp:338
LT_PMBusRail::sequenceOn
void sequenceOn()
Sequence on a polyphase rail.
Definition: LT_PMBusRail.cpp:616
LT_PMBus::marginOff
void marginOff(uint8_t address)
Margin rails off.
Definition: LT_PMBus.cpp:3059
LT_PMBusRail::getAddress
uint8_t getAddress()
Get ther rail address.
Definition: LT_PMBusRail.cpp:98
LT_PMBusRail::changePMBus
void changePMBus(LT_PMBus *pmbus)
Change the pmbus.
Definition: LT_PMBusRail.cpp:93
tRailDef::controller
bool controller
Definition: LT_PMBusRail.h:66
status
String status(void)
Returns a descriptive string based on status of pins.
Definition: DC2364A.ino:217
LT_PMBusRail::readIin
float readIin(bool polling)
Read the input current of a polyphase rail.
Definition: LT_PMBusRail.cpp:181
Linduino.h
Header File for Linduino Libraries and Demo Code.
LT_PMBusRail::hasCapability
uint32_t hasCapability(uint32_t capability)
Ask if the rail has the given capability.
Definition: LT_PMBusRail.cpp:132
LT_PMBusRail::readPhaseBalance
float readPhaseBalance(bool polling)
Read the phase balance (calculated)
Definition: LT_PMBusRail.cpp:410
LT_PMBus::readStatusWord
uint16_t readStatusWord(uint8_t address)
Get the status word.
Definition: LT_PMBus.cpp:2470
LTC2977
Definition: LT_PMBus.h:360
LT_PMBus::readIout
float readIout(uint8_t address, bool polling)
Get the measured output current.
Definition: LT_PMBus.cpp:1898
STATUS_VOUT
#define STATUS_VOUT
Definition: LT_PMBus.h:107
LT_PMBusRail::merge
void merge(LT_PMBusRail *rail)
Merge a rail into this one. No delete of incomming rail.
Definition: LT_PMBusRail.cpp:71
LT_PMBus::clearFaults
void clearFaults(uint8_t address)
Clear the faults of the existing page.
Definition: LT_PMBus.cpp:2566
HAS_POUT
#define HAS_POUT
Definition: LT_PMBusDevice.h:62
pmbus
static LT_PMBus * pmbus
Definition: DC2875A.ino:82
HAS_DC
#define HAS_DC
Definition: LT_PMBusDevice.h:65
LT_PMBusRail.h
LTC PMBus Support.
LTC2978
Definition: LT_PMBus.h:361
min
#define min(a, b)
Definition: Adafruit_GFX.cpp:66
pages
static uint8_t pages[2]
Definition: DC1989A.ino:87
LT_PMBusRail::readInternalTemperature
float readInternalTemperature(bool polling)
Read the internal temperature of a polyphase rail.
Definition: LT_PMBusRail.cpp:306
LT_PMBus::marginHigh
void marginHigh(uint8_t address)
Margin rail high.
Definition: LT_PMBus.cpp:3041
LT_PMBus::setVoutUvFaultLimit
void setVoutUvFaultLimit(uint8_t address, float voltage)
Set the under voltage fault limit.
Definition: LT_PMBus.cpp:874
LT_PMBus::waitForNotBusy
uint8_t waitForNotBusy(uint8_t address)
Read MFR_COMMON until not Busy.
Definition: LT_PMBus.cpp:3254
rail
static LT_PMBusRail * rail
Definition: DC1989A.ino:92
LTC3882_1
Definition: LT_PMBus.h:349
LT_PMBusRail::railDef_
tRailDef ** railDef_
Definition: LT_PMBusRail.h:81
LT_PMBus::readPin
float readPin(uint8_t address, bool polling)
Get the measured input power.
Definition: LT_PMBus.cpp:2027
LT_PMBus::startGroupProtocol
void startGroupProtocol(void)
starts group protocol
Definition: LT_PMBus.cpp:3350
LT_PMBusRail::marginHigh
void marginHigh()
Margin high polyphase rail.
Definition: LT_PMBusRail.cpp:641
LT_PMBus::readVout
float readVout(uint8_t address, bool polling)
Get the measured output voltage.
Definition: LT_PMBus.cpp:1598
LT_SMBus::waitForAck
virtual uint8_t waitForAck(uint8_t address, uint8_t command)=0
Read with the address and command in loop until ack, then issue stop.
LT_PMBusRail::isController
bool isController()
Ask if devices is a PSM controller.
Definition: LT_PMBusRail.cpp:103
vout
static float vout
Definition: LT1054_voltage_mode_buck.ino:59
LT_PMBusRail::clearFaults
void clearFaults()
Clear faults of polyphase rail.
Definition: LT_PMBusRail.cpp:598
LT_PMBusRail::getNoPages
uint8_t getNoPages()
Get the number of pages in the rail.
Definition: LT_PMBusRail.cpp:109
LT_SMBus::writeByte
virtual void writeByte(uint8_t address, uint8_t command, uint8_t data)=0
SMBus write byte command.
LT_SMBus::readByte
virtual uint8_t readByte(uint8_t address, uint8_t command)=0
SMBus read byte command.
LT_PMBusRail::getCapabilities
uint32_t getCapabilities()
Get a list of capabilities.
Definition: LT_PMBusRail.cpp:127
LT_PMBusRail::sequenceOff
void sequenceOff()
Sequence off a polyphase rail.
Definition: LT_PMBusRail.cpp:633
LT_PMBusRail::readStatusWord
uint16_t readStatusWord()
Read the status word of a polyphase rail.
Definition: LT_PMBusRail.cpp:550
LT_PMBus::readVoutStatusByte
uint8_t readVoutStatusByte(uint8_t address)
Get the output voltage status byte.
Definition: LT_PMBus.cpp:2310
PsmDeviceType
PsmDeviceType
Definition: LT_PMBus.h:345
LT_PMBus::setPage
void setPage(uint8_t address, uint8_t page)
Set the page.
Definition: LT_PMBus.cpp:3156
LT_PMBusRail::isMultiphase
bool isMultiphase()
Ask if the rail is multiphase.
Definition: LT_PMBusRail.cpp:122
tRailDef
Definition: LT_PMBusRail.h:61
LT_PMBus::readExternalTemperature
float readExternalTemperature(uint8_t address, bool polling)
Get the measured external temperature.
Definition: LT_PMBus.cpp:2052
LT_PMBus::smbus
LT_SMBus * smbus()
Definition: LT_PMBus.h:401
LT_PMBus::clearAllFaults
void clearAllFaults(uint8_t address)
Clear all the faults for all pages.
Definition: LT_PMBus.cpp:2576
LT_PMBus::marginLow
void marginLow(uint8_t address)
Margin rails low.
Definition: LT_PMBus.cpp:3050
LT_PMBus::getVoutUv
float getVoutUv(uint8_t address, bool polling)
Get the under voltage limit.
Definition: LT_PMBus.cpp:1719
LT_PMBus::readInternalTemperature
float readInternalTemperature(uint8_t address, bool polling)
Get the measured internal temperature.
Definition: LT_PMBus.cpp:2077
LT_PMBus::readIin
float readIin(uint8_t address, bool polling)
Get the input current.
Definition: LT_PMBus.cpp:1805
LT_PMBusRail::marginOff
void marginOff()
Margin off polyphase rail.
Definition: LT_PMBusRail.cpp:659
LT_PMBusRail::readDutyCycle
float readDutyCycle(bool polling)
Read the average duty cycle.
Definition: LT_PMBusRail.cpp:385
LT_PMBusRail::readPin
float readPin(bool polling)
Read the input power of a polyphase rail.
Definition: LT_PMBusRail.cpp:232
LT_PMBusRail::readVin
float readVin(bool polling)
Read the input voltage of a polyphase rail.
Definition: LT_PMBusRail.cpp:154
LTC3882
Definition: LT_PMBus.h:348
HAS_IOUT
#define HAS_IOUT
Definition: LT_PMBusDevice.h:60
LT_PMBusDevice.h
Library Header File for LT_PMBusDevice.
LT_PMBusRail::immediateOff
void immediateOff()
Turn off a polyphase rail.
Definition: LT_PMBusRail.cpp:624
LT_PMBus::readVin
float readVin(uint8_t address, bool polling)
Get the input voltage.
Definition: LT_PMBus.cpp:1487
HAS_PIN
#define HAS_PIN
Definition: LT_PMBusDevice.h:63
LT_PMBus::setVout
void setVout(uint8_t address, float voltage)
Set output voltage.
Definition: LT_PMBus.cpp:239
LT_PMBus::executeGroupProtocol
void executeGroupProtocol(void)
ends group protocol
Definition: LT_PMBus.cpp:3356
LT_PMBusRail::setVout
void setVout(float voltage)
Set the output voltage of a polyphase rail.
Definition: LT_PMBusRail.cpp:142
LT_PMBusRail::readPout
float readPout(bool polling)
Read the output power of a polyphase rail.
Definition: LT_PMBusRail.cpp:254
LT_PMBus::readMfrSpecialId
uint16_t readMfrSpecialId(uint8_t address)
Get speical ID.
Definition: LT_PMBus.cpp:3361
HAS_IIN
#define HAS_IIN
Definition: LT_PMBusDevice.h:61
LT_PMBus::immediateOff
void immediateOff(uint8_t *addresses, uint8_t no_addresses)
Turn off all devices immediately.
Definition: LT_PMBus.cpp:2822
i
static int i
Definition: DC2430A.ino:184
LT_PMBus::deviceType
PsmDeviceType deviceType(uint8_t address)
Get the type of PSM device.
Definition: LT_PMBus.cpp:96
voltage
static float voltage
Definition: DC2289AA.ino:71
LT_PMBus::getVout
float getVout(uint8_t address, bool polling)
Get the set output voltage.
Definition: LT_PMBus.cpp:1634
current
static uint16_t current
the current measurement from the LTC3335&#39;s counter test mode.
Definition: DC2343A.ino:114
LT_PMBusRail::marginLow
void marginLow()
Margin low polyphase rail.
Definition: LT_PMBusRail.cpp:650
LT_PMBusRail::readIout
float readIout(bool polling)
Read the output current of a polyphase rail.
Definition: LT_PMBusRail.cpp:207
LT_PMBusRail::~LT_PMBusRail
~LT_PMBusRail()
Definition: LT_PMBusRail.cpp:81
LT_PMBusRail
PMBusRail communication. For Multiphase Rails.
Definition: LT_PMBusRail.h:72
MFR_PADS
#define MFR_PADS
Definition: LT_PMBus.h:132
LT_PMBusRail::readVout
float readVout(bool polling)
Read the output voltage of a polyphase rail.
Definition: LT_PMBusRail.cpp:167
HAS_VOUT
#define HAS_VOUT
Definition: LT_PMBusDevice.h:58
LT_SMBus::readWord
virtual uint16_t readWord(uint8_t address, uint8_t command)=0
SMBus read word command.
LT_PMBus::readDutyCycle
float readDutyCycle(uint8_t address, bool polling)
Get the duty cycle.
Definition: LT_PMBus.cpp:2102
LT_PMBusRail::LT_PMBusRail
LT_PMBusRail(LT_PMBus *pmbus, uint8_t railAddress, tRailDef **railDef)
Construct a LT_PMBus.
Definition: LT_PMBusRail.cpp:64
LT_PMBus
PMBus communication.
Definition: LT_PMBus.h:370