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 
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 
82 {
84  while (*rail != NULL)
85  {
86  free ((*rail)->pages);
87  delete *rail;
88  rail++;
89  }
90  free (railDef_);
91 }
92 
94 {
95  pmbus_ = pmbus;
96 }
97 
99 {
100  return railAddress_;
101 }
102 
104 {
105  tRailDef **rail = railDef_;
106  return (*rail)->controller;
107 }
108 
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 
123 {
124  return (*railDef_)->multiphase;
125 }
126 
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  */
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  */
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  */
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);
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  }
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 
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  */
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  */
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  */
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  */
617 {
618  pmbus_->sequenceOn(&railAddress_, 1);
619 }
620 
621 /*
622  * Turn off a polyphase rail
623  */
625 {
626  pmbus_->immediateOff(&railAddress_, 1);
627 }
628 
629 /*
630  * Sequence off a polyphase rail
631  *
632  */
634 {
635  pmbus_->sequenceOff(&railAddress_, 1);
636 }
637 
638 /*
639  * Margin high polyphase rail
640  */
642 {
643  pmbus_->marginHigh(railAddress_);
644 }
645 
646 /*
647  * Margin low polyphase rail
648  *
649  */
651 {
652  pmbus_->marginLow(railAddress_);
653 }
654 
655 /*
656  * Margin off polyphase rail
657  *
658  */
660 {
661  pmbus_->marginOff(railAddress_);
662 }
static int id
Definition: rail_logger.ino:99
float readExternalTemperature(bool polling)
Read the external temperature of a polyphase rail.
void sequenceOff(uint8_t *addresses, uint8_t no_addresses)
Sequence off a list of addresses.
Definition: LT_PMBus.cpp:2850
float readTransient(bool polling)
Read the transient.
void sequenceOn(uint8_t *addresses, uint8_t no_addresses)
Sequence on a list of devices.
Definition: LT_PMBus.cpp:2794
float readPout(uint8_t address, bool polling)
Get the measured output power.
Definition: LT_PMBus.cpp:1963
uint8_t noOfPages
Definition: LT_PMBusRail.h:65
uint16_t readMfrSpecialId()
Read the special of a polyphase rail.
#define HAS_VIN
#define VOUT_UV_FAULT_RESPONSE
Definition: LT_PMBus.h:86
float readEfficiency(bool polling)
Read the efficiency (calculated)
void sequenceOn()
Sequence on a polyphase rail.
void marginOff(uint8_t address)
Margin rails off.
Definition: LT_PMBus.cpp:3059
uint8_t getAddress()
Get ther rail address.
void changePMBus(LT_PMBus *pmbus)
Change the pmbus.
bool controller
Definition: LT_PMBusRail.h:66
String status(void)
Returns a descriptive string based on status of pins.
Definition: DC2364A.ino:217
float readIin(bool polling)
Read the input current of a polyphase rail.
Header File for Linduino Libraries and Demo Code.
uint32_t hasCapability(uint32_t capability)
Ask if the rail has the given capability.
float readPhaseBalance(bool polling)
Read the phase balance (calculated)
uint16_t readStatusWord(uint8_t address)
Get the status word.
Definition: LT_PMBus.cpp:2470
float readIout(uint8_t address, bool polling)
Get the measured output current.
Definition: LT_PMBus.cpp:1898
#define STATUS_VOUT
Definition: LT_PMBus.h:107
void merge(LT_PMBusRail *rail)
Merge a rail into this one. No delete of incomming rail.
void clearFaults(uint8_t address)
Clear the faults of the existing page.
Definition: LT_PMBus.cpp:2566
#define HAS_POUT
static LT_PMBus * pmbus
Definition: DC2875A.ino:82
#define HAS_DC
LTC PMBus Support.
#define min(a, b)
static uint8_t pages[2]
Definition: DC1989A.ino:87
float readInternalTemperature(bool polling)
Read the internal temperature of a polyphase rail.
void marginHigh(uint8_t address)
Margin rail high.
Definition: LT_PMBus.cpp:3041
void setVoutUvFaultLimit(uint8_t address, float voltage)
Set the under voltage fault limit.
Definition: LT_PMBus.cpp:874
uint8_t waitForNotBusy(uint8_t address)
Read MFR_COMMON until not Busy.
Definition: LT_PMBus.cpp:3254
static LT_PMBusRail * rail
Definition: DC1989A.ino:92
tRailDef ** railDef_
Definition: LT_PMBusRail.h:81
float readPin(uint8_t address, bool polling)
Get the measured input power.
Definition: LT_PMBus.cpp:2027
void startGroupProtocol(void)
starts group protocol
Definition: LT_PMBus.cpp:3350
void marginHigh()
Margin high polyphase rail.
float readVout(uint8_t address, bool polling)
Get the measured output voltage.
Definition: LT_PMBus.cpp:1598
virtual uint8_t waitForAck(uint8_t address, uint8_t command)=0
Read with the address and command in loop until ack, then issue stop.
bool isController()
Ask if devices is a PSM controller.
static float vout
void clearFaults()
Clear faults of polyphase rail.
uint8_t getNoPages()
Get the number of pages in the rail.
virtual void writeByte(uint8_t address, uint8_t command, uint8_t data)=0
SMBus write byte command.
virtual uint8_t readByte(uint8_t address, uint8_t command)=0
SMBus read byte command.
uint32_t getCapabilities()
Get a list of capabilities.
void sequenceOff()
Sequence off a polyphase rail.
uint16_t readStatusWord()
Read the status word of a polyphase rail.
uint8_t readVoutStatusByte(uint8_t address)
Get the output voltage status byte.
Definition: LT_PMBus.cpp:2310
PsmDeviceType
Definition: LT_PMBus.h:345
void setPage(uint8_t address, uint8_t page)
Set the page.
Definition: LT_PMBus.cpp:3156
bool isMultiphase()
Ask if the rail is multiphase.
float readExternalTemperature(uint8_t address, bool polling)
Get the measured external temperature.
Definition: LT_PMBus.cpp:2052
LT_SMBus * smbus()
Definition: LT_PMBus.h:401
void clearAllFaults(uint8_t address)
Clear all the faults for all pages.
Definition: LT_PMBus.cpp:2576
void marginLow(uint8_t address)
Margin rails low.
Definition: LT_PMBus.cpp:3050
float getVoutUv(uint8_t address, bool polling)
Get the under voltage limit.
Definition: LT_PMBus.cpp:1719
float readInternalTemperature(uint8_t address, bool polling)
Get the measured internal temperature.
Definition: LT_PMBus.cpp:2077
float readIin(uint8_t address, bool polling)
Get the input current.
Definition: LT_PMBus.cpp:1805
void marginOff()
Margin off polyphase rail.
float readDutyCycle(bool polling)
Read the average duty cycle.
float readPin(bool polling)
Read the input power of a polyphase rail.
float readVin(bool polling)
Read the input voltage of a polyphase rail.
#define HAS_IOUT
Library Header File for LT_PMBusDevice.
void immediateOff()
Turn off a polyphase rail.
float readVin(uint8_t address, bool polling)
Get the input voltage.
Definition: LT_PMBus.cpp:1487
#define HAS_PIN
void setVout(uint8_t address, float voltage)
Set output voltage.
Definition: LT_PMBus.cpp:239
void executeGroupProtocol(void)
ends group protocol
Definition: LT_PMBus.cpp:3356
void setVout(float voltage)
Set the output voltage of a polyphase rail.
float readPout(bool polling)
Read the output power of a polyphase rail.
uint16_t readMfrSpecialId(uint8_t address)
Get speical ID.
Definition: LT_PMBus.cpp:3361
#define HAS_IIN
void immediateOff(uint8_t *addresses, uint8_t no_addresses)
Turn off all devices immediately.
Definition: LT_PMBus.cpp:2822
static int i
Definition: DC2430A.ino:184
PsmDeviceType deviceType(uint8_t address)
Get the type of PSM device.
Definition: LT_PMBus.cpp:96
static float voltage
Definition: DC2289AA.ino:71
float getVout(uint8_t address, bool polling)
Get the set output voltage.
Definition: LT_PMBus.cpp:1634
static uint16_t current
the current measurement from the LTC3335&#39;s counter test mode.
Definition: DC2343A.ino:114
void marginLow()
Margin low polyphase rail.
float readIout(bool polling)
Read the output current of a polyphase rail.
PMBusRail communication. For Multiphase Rails.
Definition: LT_PMBusRail.h:72
#define MFR_PADS
Definition: LT_PMBus.h:132
float readVout(bool polling)
Read the output voltage of a polyphase rail.
#define HAS_VOUT
virtual uint16_t readWord(uint8_t address, uint8_t command)=0
SMBus read word command.
float readDutyCycle(uint8_t address, bool polling)
Get the duty cycle.
Definition: LT_PMBus.cpp:2102
LT_PMBusRail(LT_PMBus *pmbus, uint8_t railAddress, tRailDef **railDef)
Construct a LT_PMBus.
PMBus communication.
Definition: LT_PMBus.h:370