| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

LT_2974FaultLog.cpp
Go to the documentation of this file.
1 /*!
2 LTC SMBus Support: API for a LTC2974 Fault Log
3
4 @verbatim
5
6 This API is shared with Linduino and RTOS code. End users should code to this
7 API to enable use of the PMBus code without modifications.
8
9 @endverbatim
10
11
12 Copyright 2018(c) Analog Devices, Inc.
13
14 All rights reserved.
15
16 Redistribution and use in source and binary forms, with or without
17 modification, are permitted provided that the following conditions are met:
18 - Redistributions of source code must retain the above copyright
19 notice, this list of conditions and the following disclaimer.
20 - Redistributions in binary form must reproduce the above copyright
21 notice, this list of conditions and the following disclaimer in
22 the documentation and/or other materials provided with the
23 distribution.
24 - Neither the name of Analog Devices, Inc. nor the names of its
25 contributors may be used to endorse or promote products derived
26 from this software without specific prior written permission.
27 - The use of this software may or may not infringe the patent rights
28 of one or more patent holders. This license does not release you
29 from the requirement that you obtain separate licenses from these
30 patent holders to use this software.
31 - Use of the software either in source or binary form, must be run
32 on or directly connected to an Analog Devices Inc. component.
33
34 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
35 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
36 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
37 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
38 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
39 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
40 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
41 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
42 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
43 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
44 */
45
46 //! @ingroup PMBus_SMBus
47 //! @{
48 //! @defgroup LT_2974FaultLog LT_2974FaultLog
49 //! @}
50
51 /*! @file
52 @ingroup LT_2974FaultLog
53 Library Header File for LT_2974FaultLog
54 */
55
56 #include <Arduino.h>
57 #include "LT_2974FaultLog.h"
58
59 #define RAW_EEPROM
60
61 void rotate(uint8_t *buf, int start, int len)
62 {
63
64 int count = 0;
65 int offset = 0;
66
67 while (count < len)
68 {
69
70 int index = offset;
71 char tmp = buf[index];
72 int index2 = (start + index) % len;
73
74 while (index2 != offset)
75 {
76
77 buf[index] = buf[index2];
78 count++;
79
80 index = index2;
81 index2 = (start + index) % len;
82 }
83
84 buf[index] = tmp;
85 count++;
86
87 offset++;
88 }
89 }
90
91 LT_2974FaultLog::LT_2974FaultLog(LT_PMBus *pmbus):LT_EEDataFaultLog(pmbus)
92 {
93 faultLog2974 = NULL;
94
95 buffer = NULL;
96 voutPeaks = NULL;
97 ioutPeaks = NULL;
98 tempPeaks = NULL;
99 chanStatuses = NULL;
100 voutDatas = NULL;
101 ioutDatas = NULL;
102 poutDatas = NULL;
103 tempDatas = NULL;
104 }
105
106
107 bool LT_2974FaultLog::FaultLogLtc2974::isValidData(void *pos, uint8_t size)
108 {
109 return (uint8_t *)pos >= (uint8_t *)this + firstValidByte && (uint8_t *)pos + (size - 1) <= (uint8_t *)this + lastValidByte;
110 }
111
112 /*
113 * Read LTC2974 fault log
114 *
115 * address: PMBUS address
116 */
117 void
118 LT_2974FaultLog::read(uint8_t address)
119 {
120 // Copy to RAM
121 pmbus_->smbus()->sendByte(address, MFR_FAULT_LOG_RESTORE);
122 // Monitor BUSY bit
123 while ((pmbus_->smbus()->readByte(address, MFR_COMMON) & (1 << 6)) == 0);
124
125 uint16_t size = sizeof(struct LT_2974FaultLog::FaultLogLtc2974);
126 uint8_t *data = (uint8_t *) malloc(size);
127 if (data == 0)
128 Serial.print(F("bad malloc."));
129 #ifdef RAW_EEPROM
130 // For MFR_EE_DATA, but would require reversing cyclic data
131 getNvmBlock(address, 384, 128, 0x00, data);
132 // Points to the beginning of the cyclic data
133 uint8_t block_address = data[0];
134 // Shift the last data to the top
135 rotate(&data[72], block_address - 71, 167);
136 // Drop the block address
137 memmove(data, data+1, size-1);
138 // Reverse the order of cyclic data
139 for (int i = 71; i < 71 + 83; i++)
140 {
141 uint8_t d = data[237-(i-71)];
142 data[237-(i-71)] = data[i];
143 data[i] = d;
144 }
145
146 #else
147 // Read block data with log
148 pmbus_->smbus()->readBlock(address, MFR_FAULT_LOG, data, 255);
149 #endif
150
151 struct LT_2974FaultLog::FaultLogLtc2974 *log = (struct LT_2974FaultLog::FaultLogLtc2974 *)data;
152
153 log->firstValidByte = 71;
154
155 log->lastValidByte = 237;
156
157 uint8_t cycle_start = log->preamble.position_last;
158
159 log->loops = (LT_2974FaultLog::FaultLogReadLoopLtc2974 *) (log->telemetryData - 53 + cycle_start);
160
161 faultLog2974 = log;
162 }
163
164
165 void LT_2974FaultLog::release()
166 {
167 free(faultLog2974);
168 faultLog2974 = 0;
169 }
170
171 uint8_t *LT_2974FaultLog::getBinary()
172 {
173 return (uint8_t *)faultLog2974;
174 }
175
176 uint16_t LT_2974FaultLog::getBinarySize()
177 {
178 return 255;
179 }
180
181 void LT_2974FaultLog::dumpBinary(Print *printer)
182 {
183 dumpBin(printer, (uint8_t *)faultLog2974, 255);
184 }
185
186 void LT_2974FaultLog::print(Print *printer)
187 {
188 if (printer == 0)
189 printer = &Serial;
190 buffer = new char[FILE_TEXT_LINE_MAX];
191
192 printTitle(printer);
193
194 printTime(printer);
195
196 printPeaks(printer);
197
198 printAllLoops(printer);
199
200
201 delete [] buffer;
202 }
203
204
205 void LT_2974FaultLog::printTitle(Print *printer)
206 {
207 printer->print(F("LTC2974 Log Data\n"));
208 }
209
210 void LT_2974FaultLog::printTime(Print *printer)
211 {
212 uint8_t *time = (uint8_t *)&faultLog2974->preamble.shared_time;
213 snprintf_P(buffer, FILE_TEXT_LINE_MAX, PSTR("Fault Time 0x%02x%02x%02x%02x%02x%02x\n"), time[5], time[4], time[3], time[2], time[1], time[0]);
214 printer->print(buffer);
215 printer->print((long) getSharedTime200us(faultLog2974->preamble.shared_time));
216 printer->println(F(" Ticks (200us each)"));
217 }
218
219 void LT_2974FaultLog::printPeaks(Print *printer)
220 {
221 voutPeaks = new Peak16Words*[4];
222 ioutPeaks = new Peak5_11Words*[4];
223 tempPeaks = new Peak5_11Words*[4];
224 chanStatuses = new ChanStatus*[4];
225
226 voutPeaks[0] = &faultLog2974->preamble.peaks.vout0_peaks;
227 voutPeaks[1] = &faultLog2974->preamble.peaks.vout1_peaks;
228 voutPeaks[2] = &faultLog2974->preamble.peaks.vout2_peaks;
229 voutPeaks[3] = &faultLog2974->preamble.peaks.vout3_peaks;
230
231 ioutPeaks[0] = &faultLog2974->preamble.peaks.iout0_peaks;
232 ioutPeaks[1] = &faultLog2974->preamble.peaks.iout1_peaks;
233 ioutPeaks[2] = &faultLog2974->preamble.peaks.iout2_peaks;
234 ioutPeaks[3] = &faultLog2974->preamble.peaks.iout3_peaks;
235
236 tempPeaks[0] = &faultLog2974->preamble.peaks.temp0_peaks;
237 tempPeaks[1] = &faultLog2974->preamble.peaks.temp1_peaks;
238 tempPeaks[2] = &faultLog2974->preamble.peaks.temp2_peaks;
239 tempPeaks[3] = &faultLog2974->preamble.peaks.temp3_peaks;
240
241 chanStatuses[0] = &faultLog2974->preamble.fault_log_status.chan_status0;
242 chanStatuses[1] = &faultLog2974->preamble.fault_log_status.chan_status1;
243 chanStatuses[2] = &faultLog2974->preamble.fault_log_status.chan_status2;
244 chanStatuses[3] = &faultLog2974->preamble.fault_log_status.chan_status3;
245
246
247 printer->println(F("\nPeak Values and Fast Status:"));
248 printer->println(F("--------"));
249
250 printFastChannel(0, printer);
251
252 float vin_max, vin_min;
253 vin_max = math_.lin11_to_float(getLin5_11WordVal(faultLog2974->preamble.peaks.vin_peaks.peak));
254 vin_min = math_.lin11_to_float(getLin5_11WordVal(faultLog2974->preamble.peaks.vin_peaks.min));
255 printer->print(F("Vin: Min: "));
256 printer->print(vin_min, 6);
257 printer->print(F(", Peak: "));
258 printer->println(vin_max, 6);
259 printer->println();
260
261 printFastChannel(1, printer);
262 printFastChannel(2, printer);
263 printFastChannel(3, printer);
264
265 delete [] voutPeaks;
266 delete [] ioutPeaks;
267 delete [] tempPeaks;
268 delete [] chanStatuses;
269 }
270
271 void LT_2974FaultLog::printFastChannel(uint8_t index, Print *printer)
272 {
273 float vout_peak, vout_min, iout_peak, iout_min, temp_peak, temp_min;
274 uint8_t status;
275 vout_peak = math_.lin16_to_float(getLin16WordVal(voutPeaks[index]->peak), 0x13);
276 vout_min = math_.lin16_to_float(getLin16WordVal(voutPeaks[index]->min), 0x13);
277 printer->print(F("Vout"));
278 printer->print(index);
279 printer->print(F(": Min: "));
280 printer->print(vout_min, 6);
281 printer->print(F(", Peak: "));
282 printer->println(vout_peak, 6);
283 temp_peak = math_.lin11_to_float(getLin5_11WordVal(tempPeaks[index]->peak));
284 temp_min = math_.lin11_to_float(getLin5_11WordVal(tempPeaks[index]->min));
285 printer->print(F("Temp"));
286 printer->print(index);
287 printer->print(F(": Min: "));
288 printer->print(temp_min, 6);
289 printer->print(F(", Peak: "));
290 printer->println(temp_peak, 6);
291 iout_peak = math_.lin11_to_float(getLin5_11WordVal(ioutPeaks[index]->peak));
292 iout_min = math_.lin11_to_float(getLin5_11WordVal(ioutPeaks[index]->min));
293 printer->print(F("Iout"));
294 printer->print(index);
295 printer->print(F(": Min: "));
296 printer->print(iout_min, 6);
297 printer->print(F(", Peak: "));
298 printer->println(iout_peak, 6);
299
300 printer->print(F("Fast Status"));
301 printer->println(index);
302 status = getRawByteVal(chanStatuses[index]->status_vout);
303 snprintf_P(buffer, FILE_TEXT_LINE_MAX, PSTR(" STATUS_VOUT%u: 0x%02x\n"), index, status);
304 printer->print(buffer);
305 status = getRawByteVal(chanStatuses[index]->status_iout);
306 snprintf_P(buffer, FILE_TEXT_LINE_MAX, PSTR(" STATUS_IOUT%u: 0x%02x\n"), index, status);
307 printer->print(buffer);
308 status = getRawByteVal(chanStatuses[index]->status_mfr_specific);
309 snprintf_P(buffer, FILE_TEXT_LINE_MAX, PSTR(" STATUS_MFR%u: 0x%02x\n"), index, status);
310 printer->println(buffer);
311 }
312
313 void LT_2974FaultLog::printAllLoops(Print *printer)
314 {
315 voutDatas = new VoutData*[4];
316 ioutDatas = new IoutData*[4];
317 poutDatas = new PoutData*[4];
318 tempDatas = new TempData*[4];
319
320 printer->println(F("Fault Log Loops Follow:"));
321 printer->println(F("(most recent data first)"));
322
323 for (int index = 0; index <= 4 && (index < 4 || faultLog2974->isValidData(&faultLog2974->loops[index])); index++)
324 {
325 printLoop(index, printer);
326 }
327
328 delete [] voutDatas;
329 delete [] ioutDatas;
330 delete [] poutDatas;
331 delete [] tempDatas;
332 }
333
334 void LT_2974FaultLog::printLoop(uint8_t index, Print *printer)
335 {
336 printer->println(F("-------"));
337 printer->print(F("Loop: "));
338 printer->println(index);
339 printer->println(F("-------"));
340
341 voutDatas[0] = &faultLog2974->loops[index].vout_data0;
342 voutDatas[1] = &faultLog2974->loops[index].vout_data1;
343 voutDatas[2] = &faultLog2974->loops[index].vout_data2;
344 voutDatas[3] = &faultLog2974->loops[index].vout_data3;
345
346 ioutDatas[0] = &faultLog2974->loops[index].iout_data0;
347 ioutDatas[1] = &faultLog2974->loops[index].iout_data1;
348 ioutDatas[2] = &faultLog2974->loops[index].iout_data2;
349 ioutDatas[3] = &faultLog2974->loops[index].iout_data3;
350
351 poutDatas[0] = &faultLog2974->loops[index].pout_data0;
352 poutDatas[1] = &faultLog2974->loops[index].pout_data1;
353 poutDatas[2] = &faultLog2974->loops[index].pout_data2;
354 poutDatas[3] = &faultLog2974->loops[index].pout_data3;
355
356 tempDatas[0] = &faultLog2974->loops[index].temp_data0;
357 tempDatas[1] = &faultLog2974->loops[index].temp_data1;
358 tempDatas[2] = &faultLog2974->loops[index].temp_data2;
359 tempDatas[3] = &faultLog2974->loops[index].temp_data3;
360
361 uint8_t stat;
362 float val;
363
364 printLoopChannel(3, printer);
365 printLoopChannel(2, printer);
366 printLoopChannel(1, printer);
367
368 if (faultLog2974->isValidData(&faultLog2974->loops[index].vin_data.status_vin, 1))
369 {
370 printer->println(F("VIN:"));
371 stat = getRawByteVal(faultLog2974->loops[index].vin_data.status_vin);
372 snprintf_P(buffer, FILE_TEXT_LINE_MAX, PSTR(" STATUS_INPUT: 0x%02x\n"), stat);
373 printer->print(buffer);
374 }
375 if (faultLog2974->isValidData(&faultLog2974->loops[index].vin_data.vin))
376 {
377 val = math_.lin11_to_float(getLin5_11WordReverseVal(faultLog2974->loops[index].vin_data.vin));
378 printer->print(F(" READ_VIN: "));
379 printer->print(val, 6);
380 printer->println(F(" V"));
381 }
382
383 printLoopChannel(0, printer);
384
385 if (faultLog2974->isValidData(&faultLog2974->loops[index].read_temp2))
386 {
387 printer->println(F("Chip Temp:"));
388 val = math_.lin11_to_float(getLin5_11WordReverseVal(faultLog2974->loops[index].read_temp2));
389 printer->print(F(" CHIP TEMP: "));
390 printer->print(val, 6);
391 printer->println(F(" C"));
392 }
393
394
395 }
396
397 void LT_2974FaultLog::printLoopChannel(uint8_t index, Print *printer)
398 {
399 uint8_t stat;
400 float val;
401
402 if (faultLog2974->isValidData(&poutDatas[index]->read_pout, 2))
403 {
404 printer->print(F("CHAN"));
405 printer->print(index);
406 printer->println(F(":"));
407 val = math_.lin11_to_float(getLin5_11WordReverseVal(poutDatas[index]->read_pout));
408 printer->print(F(" READ POUT: "));
409 printer->print(val, 6);
410 printer->println(F(" W "));
411 }
412 if (faultLog2974->isValidData(&ioutDatas[index]->read_iout, 2))
413 {
414 val = math_.lin11_to_float(getLin5_11WordReverseVal(ioutDatas[index]->read_iout));
415 printer->print(F(" READ IOUT: "));
416 printer->print(val, 6);
417 printer->println(F(" A "));
418 }
419 if (faultLog2974->isValidData(&ioutDatas[index]->status_iout, 1))
420 {
421 stat = getRawByteVal(ioutDatas[index]->status_iout);
422 snprintf_P(buffer, FILE_TEXT_LINE_MAX, PSTR(" STATUS IOUT: 0x%02x\n"), stat);
423 printer->print(buffer);
424 }
425 if (faultLog2974->isValidData(&tempDatas[index]->status_temp, 1))
426 {
427 stat = getRawByteVal(tempDatas[index]->status_temp);
428 snprintf_P(buffer, FILE_TEXT_LINE_MAX, PSTR(" STATUS TEMP: 0x%02x\n"), stat);
429 printer->print(buffer);
430 }
431 if (faultLog2974->isValidData(&tempDatas[index]->read_temp1, 2))
432 {
433 val = math_.lin11_to_float(getLin5_11WordReverseVal(tempDatas[index]->read_temp1));
434 printer->print(F(" READ TEMP: "));
435 printer->print(val, 6);
436 printer->println(F(" C"));
437 }
438 if (faultLog2974->isValidData(&voutDatas[index]->status_mfr, 1))
439 {
440 stat = getRawByteVal(voutDatas[index]->status_mfr);
441 snprintf_P(buffer, FILE_TEXT_LINE_MAX, PSTR(" STATUS_MFR: 0x%02x\n"), stat);
442 printer->print(buffer);
443 }
444 if (faultLog2974->isValidData(&voutDatas[index]->status_vout, 1))
445 {
446 stat = getRawByteVal(voutDatas[index]->status_vout);
447 snprintf_P(buffer, FILE_TEXT_LINE_MAX, PSTR(" STATUS_VOUT: 0x%02x\n"), stat);
448 printer->print(buffer);
449 }
450 if (faultLog2974->isValidData(&voutDatas[index]->read_vout))
451 {
452 val = math_.lin16_to_float(getLin16WordReverseVal(voutDatas[index]->read_vout), 0x13);
453 printer->print(F(" READ_VOUT: "));
454 printer->print(val, 6);
455 printer->println(F(" V"));
456 }
457 }
458
459
460
LT_2974FaultLog::FaultLogPeaksLtc2974::vout3_peaks
struct Peak16Words vout3_peaks
Definition: LT_2974FaultLog.h:152
LT_2974FaultLog::FaultLogPeaksLtc2974::iout1_peaks
struct Peak5_11Words iout1_peaks
Definition: LT_2974FaultLog.h:146
LT_2974FaultLog::FaultLogReadStatusLtc2974::chan_status1
struct ChanStatus chan_status1
Definition: LT_2974FaultLog.h:161
LT_2974FaultLog::Peak5_11Words::min
struct Lin5_11Word min
Definition: LT_2974FaultLog.h:132
LT_2974FaultLog::TempData
Definition: LT_2974FaultLog.h:101
LT_2974FaultLog::FaultLogReadStatusLtc2974::chan_status3
struct ChanStatus chan_status3
Definition: LT_2974FaultLog.h:163
LT_2974FaultLog::FaultLogReadLoopLtc2974::pout_data0
struct PoutData pout_data0
Definition: LT_2974FaultLog.h:195
LT_2974FaultLog::FaultLogPreambleLtc2974::shared_time
struct FaultLogTimeStamp shared_time
Definition: LT_2974FaultLog.h:170
LT_FaultLog::getLin5_11WordReverseVal
uint16_t getLin5_11WordReverseVal(Lin5_11WordReverse value)
Definition: LT_FaultLog.cpp:291
LT_2974FaultLog::getBinarySize
uint16_t getBinarySize()
Get size of binary data.
Definition: LT_2974FaultLog.cpp:176
LT_FaultLog::dumpBin
void dumpBin(Print *printer, uint8_t *log, uint8_t size)
Definition: LT_FaultLog.cpp:217
LT_2974FaultLog::VinData::status_vin
struct RawByte status_vin
Definition: LT_2974FaultLog.h:117
LT_2974FaultLog::FaultLogLtc2974
Definition: LT_2974FaultLog.h:203
LT_2974FaultLog::faultLog2974
FaultLogLtc2974 * faultLog2974
Definition: LT_2974FaultLog.h:218
LT_2974FaultLog::TempData::status_temp
struct RawByte status_temp
Definition: LT_2974FaultLog.h:104
LT_2974FaultLog::IoutData
Definition: LT_2974FaultLog.h:88
MFR_FAULT_LOG
#define MFR_FAULT_LOG
Definition: LT_PMBus.h:140
LT_2974FaultLog::FaultLogPeaksLtc2974::vout2_peaks
struct Peak16Words vout2_peaks
Definition: LT_2974FaultLog.h:148
LT_PMBusMath::lin16_to_float
float lin16_to_float(lin16_t lin16_mant, lin16m_t vout_mode)
Definition: LT_PMBusMath.cpp:435
status
String status(void)
Returns a descriptive string based on status of pins.
Definition: DC2364A.ino:217
LT_2974FaultLog::FaultLogReadLoopLtc2974::iout_data0
struct IoutData iout_data0
Definition: LT_2974FaultLog.h:196
LT_2974FaultLog::dumpBinary
void dumpBinary(Print *printer=0)
Dumps binary of the fault log to a Print inheriting object, or Serial if none specified.
Definition: LT_2974FaultLog.cpp:181
LT_2974FaultLog::FaultLogLtc2974::lastValidByte
uint8_t lastValidByte
Definition: LT_2974FaultLog.h:210
LT_2974FaultLog::FaultLogPreambleLtc2974::peaks
struct FaultLogPeaksLtc2974 peaks
Definition: LT_2974FaultLog.h:171
LT_SMBus::sendByte
virtual void sendByte(uint8_t address, uint8_t command)=0
SMBus send byte command.
LT_2974FaultLog::FaultLogReadLoopLtc2974::iout_data2
struct IoutData iout_data2
Definition: LT_2974FaultLog.h:183
LT_2974FaultLog::FaultLogReadLoopLtc2974::temp_data3
struct TempData temp_data3
Definition: LT_2974FaultLog.h:180
LT_2974FaultLog::IoutData::read_iout
struct Lin5_11WordReverse read_iout
Definition: LT_2974FaultLog.h:91
LT_2974FaultLog::ChanStatus
Definition: LT_2974FaultLog.h:72
LT_2974FaultLog::FaultLogReadLoopLtc2974::iout_data1
struct IoutData iout_data1
Definition: LT_2974FaultLog.h:187
LT_FaultLog::getLin5_11WordVal
uint16_t getLin5_11WordVal(Lin5_11Word value)
Definition: LT_FaultLog.cpp:285
LT_2974FaultLog::IoutData::status_iout
struct RawByte status_iout
Definition: LT_2974FaultLog.h:92
LT_2974FaultLog::FaultLogLtc2974::firstValidByte
uint8_t firstValidByte
Definition: LT_2974FaultLog.h:209
math_
LT_PMBusMath math_
Definition: LT_PMBusMath.cpp:460
pmbus
static LT_PMBus * pmbus
Definition: DC2875A.ino:82
LT_2974FaultLog::getBinary
uint8_t * getBinary()
Get binary of the fault log or NULL if no log.
Definition: LT_2974FaultLog.cpp:171
LT_PMBusMath::lin11_to_float
float lin11_to_float(lin11_t xin)
Definition: LT_PMBusMath.cpp:427
LT_2974FaultLog::FaultLogPeaksLtc2974::temp1_peaks
struct Peak5_11Words temp1_peaks
Definition: LT_2974FaultLog.h:145
LT_2974FaultLog::FaultLogPeaksLtc2974::vout0_peaks
struct Peak16Words vout0_peaks
Definition: LT_2974FaultLog.h:138
FILE_TEXT_LINE_MAX
#define FILE_TEXT_LINE_MAX
Definition: LT_FaultLog.h:60
LT_2974FaultLog::Peak16Words
Definition: LT_2974FaultLog.h:121
min
#define min(a, b)
Definition: Adafruit_GFX.cpp:66
LT_2974FaultLog::FaultLogLtc2974::telemetryData
uint8_t telemetryData[184]
Definition: LT_2974FaultLog.h:207
LT_2974FaultLog::VoutData::status_vout
struct RawByte status_vout
Definition: LT_2974FaultLog.h:84
LT_FaultLog::pmbus_
LT_PMBus * pmbus_
Definition: LT_FaultLog.h:129
LT_2974FaultLog::FaultLogReadStatusLtc2974::chan_status2
struct ChanStatus chan_status2
Definition: LT_2974FaultLog.h:162
LT_2974FaultLog::FaultLogReadLoopLtc2974::vout_data1
struct VoutData vout_data1
Definition: LT_2974FaultLog.h:189
LT_2974FaultLog::FaultLogReadLoopLtc2974
Definition: LT_2974FaultLog.h:175
address
static uint8_t address
Definition: DC2091A.ino:83
data
union LT_union_int32_4bytes data
Definition: DC2094A.ino:138
LT_2974FaultLog::FaultLogPeaksLtc2974::iout2_peaks
struct Peak5_11Words iout2_peaks
Definition: LT_2974FaultLog.h:150
pos
static int16_t pos
Definition: Precision_Voltage_Source.ino:73
LT_2974FaultLog::FaultLogReadLoopLtc2974::iout_data3
struct IoutData iout_data3
Definition: LT_2974FaultLog.h:179
LT_2974FaultLog::FaultLogPeaksLtc2974::temp2_peaks
struct Peak5_11Words temp2_peaks
Definition: LT_2974FaultLog.h:149
LT_FaultLog::getLin16WordVal
uint16_t getLin16WordVal(Lin16Word value)
Definition: LT_FaultLog.cpp:297
LT_2974FaultLog::FaultLogReadLoopLtc2974::vout_data3
struct VoutData vout_data3
Definition: LT_2974FaultLog.h:181
LT_2974FaultLog::FaultLogReadLoopLtc2974::vout_data2
struct VoutData vout_data2
Definition: LT_2974FaultLog.h:185
LT_2974FaultLog::FaultLogLtc2974::preamble
struct FaultLogPreambleLtc2974 preamble
Definition: LT_2974FaultLog.h:206
LT_2974FaultLog::FaultLogPeaksLtc2974::iout0_peaks
struct Peak5_11Words iout0_peaks
Definition: LT_2974FaultLog.h:140
LT_2974FaultLog::FaultLogReadLoopLtc2974::vin_data
struct VinData vin_data
Definition: LT_2974FaultLog.h:193
LT_EEDataFaultLog::getNvmBlock
void getNvmBlock(uint8_t address, uint16_t offset, uint16_t numWords, uint8_t command, uint8_t *data)
Definition: LT_EEDataFaultLog.h:65
LT_SMBus::readByte
virtual uint8_t readByte(uint8_t address, uint8_t command)=0
SMBus read byte command.
LT_2974FaultLog::FaultLogReadLoopLtc2974::pout_data3
struct PoutData pout_data3
Definition: LT_2974FaultLog.h:178
LT_2974FaultLog::release
void release()
Frees the memory reserved for the fault log.
Definition: LT_2974FaultLog.cpp:165
LT_2974FaultLog::VoutData::read_vout
struct Lin16WordReverse read_vout
Definition: LT_2974FaultLog.h:85
LT_2974FaultLog::read
void read(uint8_t address)
Reads the fault log from the specified address, reserves memory to hold the data. ...
Definition: LT_2974FaultLog.cpp:118
MFR_COMMON
#define MFR_COMMON
Definition: LT_PMBus.h:141
LT_PMBus::smbus
LT_SMBus * smbus()
Definition: LT_PMBus.h:401
LT_2974FaultLog::FaultLogLtc2974::isValidData
bool isValidData(void *pos, uint8_t size=2)
Definition: LT_2974FaultLog.cpp:107
LT_EEDataFaultLog
Definition: LT_EEDataFaultLog.h:56
LT_2974FaultLog::VoutData::status_mfr
struct RawByte status_mfr
Definition: LT_2974FaultLog.h:83
LT_FaultLog::getSharedTime200us
uint64_t getSharedTime200us(FaultLogTimeStamp time_stamp)
Definition: LT_FaultLog.cpp:247
LT_2974FaultLog::FaultLogReadLoopLtc2974::vout_data0
struct VoutData vout_data0
Definition: LT_2974FaultLog.h:198
LT_2974FaultLog::Peak5_11Words
Definition: LT_2974FaultLog.h:128
LT_2974FaultLog::print
void print(Print *printer=0)
Pretty prints this part&#39;s fault log to a Print inheriting object, or Serial if none specified...
Definition: LT_2974FaultLog.cpp:186
LT_2974FaultLog::FaultLogPreambleLtc2974::position_last
uint8_t position_last
Definition: LT_2974FaultLog.h:169
LT_2974FaultLog::FaultLogReadLoopLtc2974::temp_data0
struct TempData temp_data0
Definition: LT_2974FaultLog.h:197
LT_2974FaultLog::FaultLogReadLoopLtc2974::pout_data1
struct PoutData pout_data1
Definition: LT_2974FaultLog.h:186
index
static int index
Definition: device_logger.ino:91
LT_2974FaultLog::FaultLogPeaksLtc2974::vout1_peaks
struct Peak16Words vout1_peaks
Definition: LT_2974FaultLog.h:144
LT_2974FaultLog::VoutData
Definition: LT_2974FaultLog.h:80
LT_SMBus::readBlock
virtual uint8_t readBlock(uint8_t address, uint8_t command, uint8_t *block, uint16_t block_size)=0
SMBus read block command.
LT_2974FaultLog::FaultLogPeaksLtc2974::temp3_peaks
struct Peak5_11Words temp3_peaks
Definition: LT_2974FaultLog.h:153
LT_2974FaultLog::VinData::vin
struct Lin5_11WordReverse vin
Definition: LT_2974FaultLog.h:118
LT_2974FaultLog::FaultLogReadLoopLtc2974::read_temp2
struct Lin5_11WordReverse read_temp2
Definition: LT_2974FaultLog.h:200
start
static float start
Definition: Audio_Spectrum_Analyzer.ino:19
LT_2974FaultLog::PoutData::read_pout
struct Lin5_11WordReverse read_pout
Definition: LT_2974FaultLog.h:98
LT_2974FaultLog::FaultLogPreambleLtc2974::fault_log_status
struct FaultLogReadStatusLtc2974 fault_log_status
Definition: LT_2974FaultLog.h:172
LT_FaultLog::getRawByteVal
uint8_t getRawByteVal(RawByte value)
Definition: LT_FaultLog.cpp:267
LT_2974FaultLog::Peak5_11Words::peak
struct Lin5_11Word peak
Definition: LT_2974FaultLog.h:131
rotate
void rotate(uint8_t *buf, int start, int len)
Definition: LT_2974FaultLog.cpp:61
LT_2974FaultLog.h
LTC SMBus Support: Implementation for a LTC2974 Fault Log.
LT_2974FaultLog::PoutData
Definition: LT_2974FaultLog.h:95
LT_2974FaultLog::FaultLogPeaksLtc2974::iout3_peaks
struct Peak5_11Words iout3_peaks
Definition: LT_2974FaultLog.h:154
LT_FaultLog::getLin16WordReverseVal
uint16_t getLin16WordReverseVal(Lin16WordReverse value)
Definition: LT_FaultLog.cpp:303
i
static int i
Definition: DC2430A.ino:184
LT_2974FaultLog::FaultLogReadLoopLtc2974::pout_data2
struct PoutData pout_data2
Definition: LT_2974FaultLog.h:182
MFR_FAULT_LOG_RESTORE
#define MFR_FAULT_LOG_RESTORE
Definition: LT_PMBus.h:136
LT_2974FaultLog::FaultLogReadStatusLtc2974::chan_status0
struct ChanStatus chan_status0
Definition: LT_2974FaultLog.h:160
LT_2974FaultLog::FaultLogLtc2974::loops
struct FaultLogReadLoopLtc2974 * loops
Definition: LT_2974FaultLog.h:208
LT_2974FaultLog::LT_2974FaultLog
LT_2974FaultLog(LT_PMBus *pmbus)
Constructor.
Definition: LT_2974FaultLog.cpp:91
LT_2974FaultLog::FaultLogPeaksLtc2974::vin_peaks
struct Peak5_11Words vin_peaks
Definition: LT_2974FaultLog.h:142
LT_2974FaultLog::FaultLogReadLoopLtc2974::temp_data1
struct TempData temp_data1
Definition: LT_2974FaultLog.h:188
LT_2974FaultLog::FaultLogPeaksLtc2974::temp0_peaks
struct Peak5_11Words temp0_peaks
Definition: LT_2974FaultLog.h:139
LT_2974FaultLog::FaultLogReadLoopLtc2974::temp_data2
struct TempData temp_data2
Definition: LT_2974FaultLog.h:184
LT_2974FaultLog::TempData::read_temp1
struct Lin5_11WordReverse read_temp1
Definition: LT_2974FaultLog.h:105
LT_PMBus
PMBus communication.
Definition: LT_PMBus.h:370