67 railAddress_ = railAddress;
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;
86 free ((*rail)->pages);
114 while (*rail != NULL)
124 return (*railDef_)->multiphase;
129 return (*railDef_)->capabilities;
134 return ((*railDef_)->capabilities & capability) == capability;
145 pmbus_->
setVout(railAddress_, voltage);
158 return pmbus_->
readVin((*railDef_)->address, polling);
171 pmbus_->
setPage((*railDef_)->address, (*railDef_)->pages[0]);
172 return pmbus_->
readVout((*railDef_)->address, polling);
188 while (*rail != NULL)
190 for (
int j = 0; j < (*rail)->noOfPages; j++)
192 pmbus_->
setPage((*rail)->address, (*rail)->pages[j]);
193 current += pmbus_->
readIin((*rail)->address, polling);
213 while (*rail != NULL)
215 for (
int j = 0; j < (*rail)->noOfPages; j++)
217 pmbus_->
setPage((*rail)->address, (*rail)->pages[j]);
218 current += pmbus_->
readIout((*rail)->address, polling);
239 while (*rail != NULL)
241 power += pmbus_->
readPin((*rail)->address, polling);
260 while (*rail != NULL)
262 for (
int j = 0; j < (*rail)->noOfPages; j++)
264 pmbus_->
setPage((*rail)->address, (*rail)->pages[j]);
265 power += pmbus_->
readPout((*rail)->address, polling);
286 while (*rail != NULL)
288 pages += (float) ((*rail)->noOfPages);
289 for (
int j = 0; j < (*rail)->noOfPages; j++)
291 pmbus_->
setPage((*rail)->address, (*rail)->pages[j]);
313 while (*rail != NULL)
315 pages += (float) ((*rail)->noOfPages);
316 for (
int j = 0; j < (*rail)->noOfPages; j++)
318 pmbus_->
setPage((*rail)->address, (*rail)->pages[j]);
340 float val1, val2 = 0.0;
341 float efficiency = 0.0;
349 efficiency = 100.0 * val2/val1;
357 efficiency = 100.0 * val2/val1;
365 efficiency = 100.0 * val2/val1;
374 efficiency = 100.0 * val2/val1;
393 while (*rail != NULL)
395 for (
int j = 0; j < (*rail)->noOfPages; j++)
397 pmbus_->
setPage((*rail)->address, (*rail)->pages[j]);
414 float max = -10000.0;
421 while (*rail != NULL)
423 for (
int j = 0; j < (*rail)->noOfPages; j++)
425 pmbus_->
setPage((*rail)->address, (*rail)->pages[j]);
426 total += (current = pmbus_->
readIout((*rail)->address, polling));
428 if (current > max) max =
current;
429 if (current < min) min =
current;
434 return 100.0 * (max -
min)/total;
445 uint8_t vout_response;
453 while (*rail != NULL)
457 for (
int j = 0; j < (*rail)->noOfPages; j++)
466 if (pads & (1 << (14 + j)))
472 pmbus_->
setPage((*rail)->address, (*rail)->pages[j]);
475 vout = pmbus_->
getVout((*rail)->address, polling);
478 vout_uv = pmbus_->
getVoutUv((*rail)->address, polling);
501 for (v = 0.95 * vout; v < 1.05 *
vout; v = v + 0.001)
509 if (status & (1 << 4))
533 max = max(max, vout-v);
557 while (*rail != NULL)
559 for (
int j = 0; j < (*rail)->noOfPages; j++)
561 pmbus_->
setPage((*rail)->address, (*rail)->pages[j]);
580 while (*rail != NULL)
582 for (
int j = 0; j < (*rail)->noOfPages; j++)
584 pmbus_->
setPage((*rail)->address, (*rail)->pages[j]);
604 while (*rail != NULL)
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.
float readTransient(bool polling)
Read the transient.
void sequenceOn(uint8_t *addresses, uint8_t no_addresses)
Sequence on a list of devices.
float readPout(uint8_t address, bool polling)
Get the measured output power.
uint16_t readMfrSpecialId()
Read the special of a polyphase rail.
#define VOUT_UV_FAULT_RESPONSE
float readEfficiency(bool polling)
Read the efficiency (calculated)
void sequenceOn()
Sequence on a polyphase rail.
void marginOff(uint8_t address)
Margin rails off.
uint8_t getAddress()
Get ther rail address.
void changePMBus(LT_PMBus *pmbus)
Change the pmbus.
String status(void)
Returns a descriptive string based on status of pins.
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.
float readIout(uint8_t address, bool polling)
Get the measured output current.
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.
float readInternalTemperature(bool polling)
Read the internal temperature of a polyphase rail.
void marginHigh(uint8_t address)
Margin rail high.
void setVoutUvFaultLimit(uint8_t address, float voltage)
Set the under voltage fault limit.
uint8_t waitForNotBusy(uint8_t address)
Read MFR_COMMON until not Busy.
static LT_PMBusRail * rail
float readPin(uint8_t address, bool polling)
Get the measured input power.
void startGroupProtocol(void)
starts group protocol
void marginHigh()
Margin high polyphase rail.
float readVout(uint8_t address, bool polling)
Get the measured output voltage.
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.
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.
void setPage(uint8_t address, uint8_t page)
Set the page.
bool isMultiphase()
Ask if the rail is multiphase.
float readExternalTemperature(uint8_t address, bool polling)
Get the measured external temperature.
void clearAllFaults(uint8_t address)
Clear all the faults for all pages.
void marginLow(uint8_t address)
Margin rails low.
float getVoutUv(uint8_t address, bool polling)
Get the under voltage limit.
float readInternalTemperature(uint8_t address, bool polling)
Get the measured internal temperature.
float readIin(uint8_t address, bool polling)
Get the input current.
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.
Library Header File for LT_PMBusDevice.
void immediateOff()
Turn off a polyphase rail.
float readVin(uint8_t address, bool polling)
Get the input voltage.
void setVout(uint8_t address, float voltage)
Set output voltage.
void executeGroupProtocol(void)
ends group protocol
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.
void immediateOff(uint8_t *addresses, uint8_t no_addresses)
Turn off all devices immediately.
PsmDeviceType deviceType(uint8_t address)
Get the type of PSM device.
float getVout(uint8_t address, bool polling)
Get the set output voltage.
static uint16_t current
the current measurement from the LTC3335's counter test mode.
void marginLow()
Margin low polyphase rail.
float readIout(bool polling)
Read the output current of a polyphase rail.
PMBusRail communication. For Multiphase Rails.
float readVout(bool polling)
Read the output voltage of a polyphase rail.
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.
LT_PMBusRail(LT_PMBus *pmbus, uint8_t railAddress, tRailDef **railDef)
Construct a LT_PMBus.