72 #define LTC3880_I2C_ADDRESS 0x30 73 #define LTC2974_I2C_ADDRESS 0x32 74 #define LTC2977_I2C_ADDRESS 0x33 88 static bool pec =
false;
113 Serial.println(F(
"Please wait for programming EEPROM..."));
119 Serial.println(F(
"Programming Complete (RAM and EEPROM may not match until reset)"));
128 Serial.println(F(
"Please wait for verification of EEPROM..."));
133 Serial.println(F(
"Verification complete: Invalid EEPROM data"));
136 Serial.println(F(
"Verification complete: Valid EEPROM data"));
149 Serial.println(F(
"Restore User All"));
152 Serial.println(F(
"Restore Complete (EEPROM written to RAM)"));
159 Serial.println(F(
"Resseting all devices"));
172 Serial.println(F(
"All devices reset (RAM == EEPROM)"));
179 Serial.begin(115200);
207 uint8_t revision[10];
208 uint8_t *addresses = NULL;
210 if (Serial.available())
213 if (user_command !=
'm')
214 Serial.println(user_command);
216 switch (user_command)
253 addresses = smbus->
probe(0);
254 while (*addresses != 0)
256 Serial.print(F(
"ADDR 0x"));
257 Serial.println(*addresses++, HEX);
264 Serial.println(F(
"Incorrect Option"));
275 Serial.print(F(
"\n********************************************************************\n"));
276 Serial.print(F(
"* DC1962C In Flight Update Demonstration Program (MEGA 2560 Only) *\n"));
277 Serial.print(F(
"* *\n"));
278 Serial.print(F(
"* This program demonstrates how to program EEPROM from hex data. *\n"));
279 Serial.print(F(
"* *\n"));
280 Serial.print(F(
"* Set the baud rate to 115200 and select the newline terminator. *\n"));
281 Serial.print(F(
"* *\n"));
282 Serial.print(F(
"********************************************************************\n"));
289 Serial.print(F(
"\n 1-Program\n"));
290 Serial.print(F(
" 2-Verify\n"));
291 Serial.print(F(
" 3-Restore\n"));
292 Serial.print(F(
" 4-Program and Apply\n"));
293 Serial.print(F(
" 5-Clear Faults\n"));
294 Serial.print(F(
" 6-PEC On\n"));
295 Serial.print(F(
" 7-PEC Off\n"));
296 Serial.print(F(
" 8-Bus Probe\n"));
297 Serial.print(F(
" 9-Reset\n"));
298 Serial.print(F(
"\nEnter a command:"));
uint8_t waitForNvmDone(uint8_t address)
Read MFR_EEPROM_STATUS until done (LTC388X only)
static void program_nvm()
Program the nvm.
unsigned char user_command
static uint8_t ltc3880_i2c_address
static uint8_t ltc2974_i2c_address
static LT_SMBusPec * smbusPec
static uint8_t dc1613_addresses[]
void reset(uint8_t address)
Issue reset to one device.
void disableWriteProtectGlobal(void)
Disable the write protect.
static void print_title()
Prints the title block when program first starts.
Header File for Linduino Libraries and Demo Code.
void enablePec(uint8_t address)
Enable pec for all transactions.
static LT_SMBusNoPec * smbusNoPec
static void print_prompt()
Prints main menu.
void clearFaults(uint8_t address)
Clear the faults of the existing page.
void disablePec(uint8_t address)
Disable pec for all transactions.
bool programWithData(const unsigned char *)
Program with hex data.
Copyright 2018(c) Analog Devices, Inc.
uint8_t waitForNotBusy(uint8_t address)
Read MFR_COMMON until not Busy.
static uint8_t ltc2977_i2c_address
static void verify_nvm()
Verify the nvm.
static void wait_for_nvm()
Wait for nvm operation to complete.
void startGroupProtocol(void)
starts group protocol
virtual uint8_t waitForAck(uint8_t address, uint8_t command)=0
Read with the address and command in loop until ack, then issue stop.
#define LTC2974_I2C_ADDRESS
virtual void writeByte(uint8_t address, uint8_t command, uint8_t data)=0
SMBus write byte command.
bool verifyWithData(const unsigned char *)
Verifies board NVM with hex data.
static void loop()
Repeats Linduino loop.
virtual uint8_t * probe(uint8_t command)=0
SMBus bus probe.
static void restore_nvm()
Restore nvm to ram.
#define LTC3880_I2C_ADDRESS
void clearFaultsGlobal(void)
Clear all the faults for all pages of all devices.
void executeGroupProtocol(void)
ends group protocol
void restoreFromNvm(uint8_t address)
Restore device from NVM.
#define LTC2977_I2C_ADDRESS
#define MFR_EEPROM_STATUS
void restoreFromNvmGlobal(void)
Restore all devices from NVM.
static void setup()
Initialize Linduino.
static void reset_all_devices()
Reset all devices.