| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

LT_3880FaultLog.h
Go to the documentation of this file.
1 /*!
2 LTC SMBus Support: Implementation for a LTC3880 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 /*! @file
47 @ingroup LT_3880FaultLog
48 Library Header File for LT_3880FaultLog
49 */
50
51 #ifndef LT_3880FaultLog_H_
52 #define LT_3880FaultLog_H_
53
54 #include "../LT_PMBUS/LT_PMBus.h"
55 #include "../LT_PMBUS/LT_PMBusMath.h"
56 #include "LT_EEDataFaultLog.h"
57
58
59 //! class that handles LTC3880 fault logs.
60 //! contains structs for interpreting the data read from the part.
61 class LT_3880FaultLog : public LT_EEDataFaultLog
62 {
63
64 public:
65 #pragma pack(push, 1)
66
67
68 /********************************************************************
69 * LTC3880 types
70 ********************************************************************/
71
72 struct FaultLogTelemetrySummaryLtc3880
73 {
74 public:
75 struct Lin16WordReverse mfr_vout_peak_p0;
76 struct Lin16WordReverse mfr_vout_peak_p1;
77
78 struct Lin5_11WordReverse mfr_iout_peak_p0;
79 struct Lin5_11WordReverse mfr_iout_peak_p1;
80
81 struct Lin5_11WordReverse mfr_vin_peak;
82 struct Lin5_11WordReverse read_temperature_1_p0;
83 struct Lin5_11WordReverse read_temperature_1_p1;
84 struct Lin5_11WordReverse read_temperature_2;
85 struct Lin5_11WordReverse mfr_temperature_1_peak_p0;
86 struct Lin5_11WordReverse mfr_temperature_1_peak_p1;
87 };
88
89 struct FaultLogPreambleLtc3880
90 {
91 public:
92 uint8_t position_fault;
93 struct FaultLogTimeStamp shared_time;
94 struct FaultLogTelemetrySummaryLtc3880 peaks;
95 };
96
97 struct FaultLogReadLoopLtc3880
98 {
99 public:
100 struct Lin16WordReverse read_vout_p0;
101 struct Lin16WordReverse read_vout_p1;
102
103 struct Lin5_11WordReverse read_iout_p0;
104 struct Lin5_11WordReverse read_iout_p1;
105
106 struct Lin5_11WordReverse read_vin ;
107 struct Lin5_11WordReverse read_iin;
108
109 struct RawByte status_vout_p0;
110 struct RawByte status_vout_p1;
111
112 struct RawWordReverse status_word_p0;
113 struct RawWordReverse status_word_p1;
114
115 struct RawByte status_mfr_specificP0;
116 struct RawByte status_mfr_specificP1;
117 };
118
119 struct FaultLogLtc3880
120 {
121 public:
122 struct FaultLogPreambleLtc3880 preamble;
123 struct FaultLogReadLoopLtc3880 fault_log_loop[6];
124 };
125
126 #pragma pack(pop)
127
128 protected:
129 FaultLogLtc3880 *faultLog3880;
130
131 public:
132 //! Constructor
133 LT_3880FaultLog(LT_PMBus *pmbus //!< pmbus object reference for this fault log handler to use.
134 );
135
136 //! Pretty prints this part's fault log to a Print inheriting object, or Serial if none specified.
137 void print(Print *printer = 0 //!< Print inheriting object to print the fault log to.
138 );
139
140 //! Get binary of the fault log or NULL if no log
141 uint8_t *getBinary();
142
143 //! Get size of binary data
144 uint16_t getBinarySize();
145
146 //! Dumps binary of the fault log to a Print inheriting object, or Serial if none specified.
147 void dumpBinary(Print *printer = 0 //!< Print inheriting object to print the binary to.
148 );
149
150 //! Reads the fault log from the specified address, reserves memory to hold the data.
151 //! @return a reference to the data read from the part.
152 void read(uint8_t address //!< the address to read the fault log from.
153 );
154
155 // ! Get the fault log data
156 struct FaultLogLtc3880 *get()
157 {
158 return faultLog3880;
159 }
160
161 //! Frees the memory reserved for the fault log.
162 void release();
163
164 private:
165 char *buffer;
166
167 void printTitle(Print *);
168 void printTime(Print *);
169 void printPeaks(Print *);
170 void printAllLoops(Print *);
171 void printLoop(uint8_t index, Print *);
172
173 };
174
175 #endif /* LT_FaultLog_H_ */
LT_3880FaultLog::FaultLogTelemetrySummaryLtc3880::read_temperature_2
struct Lin5_11WordReverse read_temperature_2
Definition: LT_3880FaultLog.h:84
LT_3880FaultLog::FaultLogTelemetrySummaryLtc3880::mfr_vout_peak_p0
struct Lin16WordReverse mfr_vout_peak_p0
Definition: LT_3880FaultLog.h:75
LT_3880FaultLog::FaultLogTelemetrySummaryLtc3880
Definition: LT_3880FaultLog.h:72
LT_3880FaultLog::FaultLogTelemetrySummaryLtc3880::mfr_iout_peak_p0
struct Lin5_11WordReverse mfr_iout_peak_p0
Definition: LT_3880FaultLog.h:78
LT_3880FaultLog
class that handles LTC3880 fault logs.
Definition: LT_3880FaultLog.h:61
LT_EEDataFaultLog.h
LTC PMBus Support: Implementation for a LTC Controller Fault Log.
pmbus
static LT_PMBus * pmbus
Definition: DC2875A.ino:82
LT_3880FaultLog::FaultLogReadLoopLtc3880
Definition: LT_3880FaultLog.h:97
LT_3880FaultLog::FaultLogTelemetrySummaryLtc3880::read_temperature_1_p0
struct Lin5_11WordReverse read_temperature_1_p0
Definition: LT_3880FaultLog.h:82
LT_3880FaultLog::getBinarySize
uint16_t getBinarySize()
Get size of binary data.
Definition: LT_3880FaultLog.cpp:103
LT_3880FaultLog::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_3880FaultLog.cpp:113
address
static uint8_t address
Definition: DC2091A.ino:83
LT_3880FaultLog::FaultLogTelemetrySummaryLtc3880::mfr_temperature_1_peak_p0
struct Lin5_11WordReverse mfr_temperature_1_peak_p0
Definition: LT_3880FaultLog.h:85
LT_3880FaultLog::dumpBinary
void dumpBinary(Print *printer=0)
Dumps binary of the fault log to a Print inheriting object, or Serial if none specified.
Definition: LT_3880FaultLog.cpp:108
LT_3880FaultLog::FaultLogTelemetrySummaryLtc3880::mfr_iout_peak_p1
struct Lin5_11WordReverse mfr_iout_peak_p1
Definition: LT_3880FaultLog.h:79
LT_3880FaultLog::FaultLogPreambleLtc3880::position_fault
uint8_t position_fault
Definition: LT_3880FaultLog.h:92
LT_3880FaultLog::FaultLogPreambleLtc3880
Definition: LT_3880FaultLog.h:89
LT_3880FaultLog::release
void release()
Frees the memory reserved for the fault log.
Definition: LT_3880FaultLog.cpp:92
LT_EEDataFaultLog
Definition: LT_EEDataFaultLog.h:56
LT_3880FaultLog::FaultLogTelemetrySummaryLtc3880::mfr_vout_peak_p1
struct Lin16WordReverse mfr_vout_peak_p1
Definition: LT_3880FaultLog.h:76
LT_3880FaultLog::FaultLogTelemetrySummaryLtc3880::mfr_vin_peak
struct Lin5_11WordReverse mfr_vin_peak
Definition: LT_3880FaultLog.h:81
LT_3880FaultLog::LT_3880FaultLog
LT_3880FaultLog(LT_PMBus *pmbus)
Constructor.
Definition: LT_3880FaultLog.cpp:61
index
static int index
Definition: device_logger.ino:91
LT_3880FaultLog::FaultLogTelemetrySummaryLtc3880::mfr_temperature_1_peak_p1
struct Lin5_11WordReverse mfr_temperature_1_peak_p1
Definition: LT_3880FaultLog.h:86
LT_3880FaultLog::read
void read(uint8_t address)
Reads the fault log from the specified address, reserves memory to hold the data. ...
Definition: LT_3880FaultLog.cpp:76
LT_3880FaultLog::getBinary
uint8_t * getBinary()
Get binary of the fault log or NULL if no log.
Definition: LT_3880FaultLog.cpp:98
LT_3880FaultLog::FaultLogTelemetrySummaryLtc3880::read_temperature_1_p1
struct Lin5_11WordReverse read_temperature_1_p1
Definition: LT_3880FaultLog.h:83
LT_3880FaultLog::FaultLogLtc3880
Definition: LT_3880FaultLog.h:119
LT_3880FaultLog::faultLog3880
FaultLogLtc3880 * faultLog3880
Definition: LT_3880FaultLog.h:129
LT_PMBus
PMBus communication.
Definition: LT_PMBus.h:370