55 #include <avr/pgmspace.h> 64 #define FILE_TEXT_LINE_MAX 132 66 #define LTC3880_I2C_ADDRESS 0x4F 89 uint8_t *addresses = NULL;
93 if (Serial.available())
95 while ((user_command =
read_int()) == 0);
96 if (user_command !=
'm')
97 Serial.println(user_command);
101 switch (user_command)
111 faultLog3880->
print(&Serial);
116 Serial.println(F(
"No LTC3880 Fault Log"));
146 addresses = smbus->
probe(0);
147 while (*addresses != 0)
149 Serial.print(F(
"ADDR 0x"));
150 Serial.println(*addresses++, HEX);
162 Serial.println(F(
"Incorrect Option"));
174 Serial.print(F(
"\n***************************************************************\n"));
175 Serial.print(F(
"* LTC3880 Fault Log Program *\n"));
176 Serial.print(F(
"* *\n"));
177 Serial.print(F(
"* This program dumps fault logs *\n"));
178 Serial.print(F(
"* *\n"));
179 Serial.print(F(
"* Set the baud rate to 115200 and select the newline terminator.*\n"));
180 Serial.print(F(
"* *\n"));
181 Serial.print(F(
"*****************************************************************\n"));
187 Serial.print(F(
"\n 1-Dump Fault Logs\n"));
188 Serial.print(F(
" 2-Clear Fault Logs\n"));
189 Serial.print(F(
" 3-Clear Faults\n"));
190 Serial.print(F(
" 4-PEC On\n"));
191 Serial.print(F(
" 5-PEC Off\n"));
192 Serial.print(F(
" 6-Bus Probe\n"));
193 Serial.print(F(
" 7-Reset\n"));
194 Serial.print(F(
" 8-Store Fault Log\n"));
195 Serial.print(F(
"\nEnter a command:"));
static void loop()
Repeats Linduino loop.
#define LTC3880_I2C_ADDRESS
unsigned char user_command
static void print_prompt()
Prints main menu.
class that handles LTC3880 fault logs.
LTC SMBus Support: Implementation for a shared SMBus layer.
String status(void)
Returns a descriptive string based on status of pins.
Header File for Linduino Libraries and Demo Code.
virtual void sendByte(uint8_t address, uint8_t command)=0
SMBus send byte command.
void enablePec(uint8_t address)
Enable pec for all transactions.
static LT_3880FaultLog * faultLog3880
void disablePec(uint8_t address)
Disable pec for all transactions.
static void setup()
Initialize Linduino.
void print(Print *printer=0)
Pretty prints this part's fault log to a Print inheriting object, or Serial if none specified...
TwoWire.h - TWI/I2C library for Arduino & Wiring Copyright (c) 2006 Nicholas Zambetti.
LTC SMBus Support: Implementation for a LTC3880 Fault Log.
uint8_t readMfrStatusByte(uint8_t address)
Get the MFR status byte.
void dumpBinary(Print *printer=0)
Dumps binary of the fault log to a Print inheriting object, or Serial if none specified.
void resetGlobal(void)
Issue reset to all devices.
#define MFR_FAULT_LOG_STORE
#define LTC3880_SMFR_FAULT_LOG
void release()
Frees the memory reserved for the fault log.
void clearAllFaults(uint8_t address)
Clear all the faults for all pages.
virtual uint8_t * probe(uint8_t command)=0
SMBus bus probe.
LT_3880FaultLog(LT_PMBus *pmbus)
Constructor.
LTC SMBus Support: Implementation for a shared SMBus layer.
static void print_title()
Prints the title block when program first starts.
void read(uint8_t address)
Reads the fault log from the specified address, reserves memory to hold the data. ...
void clearFaultLog(uint8_t address)
void restoreFromNvmGlobal(void)
Restore all devices from NVM.
static uint8_t ltc3880_i2c_address