75 #define LTC3880_I2C_ADDRESS 0x30 76 #define LTC2974_I2C_ADDRESS 0x32 77 #define LTC2977_I2C_ADDRESS 0x33 105 uint8_t revision[10];
106 uint8_t *addresses = NULL;
108 if (Serial.available())
111 if (user_command !=
'm')
112 Serial.println(user_command);
114 switch (user_command)
138 addresses = smbus->
probe(0);
139 while (*addresses != 0)
141 Serial.print(F(
"ADDR 0x"));
142 Serial.println(*addresses++, HEX);
152 Serial.println(F(
"Incorrect Option"));
166 Serial.print(F(
"\n*****************************************************************\n"));
167 Serial.print(F(
"* DC1962C Hello World Demonstration Program *\n"));
168 Serial.print(F(
"* *\n"));
169 Serial.print(F(
"* This program demonstrates how to send and receive data from *\n"));
170 Serial.print(F(
"* the LTC1962C demo board. *\n"));
171 Serial.print(F(
"* *\n"));
172 Serial.print(F(
"* Set the baud rate to 115200 and select the newline terminator.*\n"));
173 Serial.print(F(
"* *\n"));
174 Serial.print(F(
"*****************************************************************\n"));
181 Serial.print(F(
"\n 1-Basic Commands\n"));
182 Serial.print(F(
" 2-PEC On\n"));
183 Serial.print(F(
" 3-PEC Off\n"));
184 Serial.print(F(
" 4-Bus Probe\n"));
185 Serial.print(F(
" 5-Reset\n"));
186 Serial.print(F(
"\nEnter a command:"));
193 Serial.println(F(
"\nWarning: Demo board not detected. Linduino will attempt to proceed."));
203 for (page = 0; page < 2; page++)
207 Serial.print(F(
"LTC3880 VOUT "));
208 Serial.println(voltage, DEC);
211 for (page = 0; page < 4; page++)
215 Serial.print(F(
"LTC2974 VOUT "));
216 Serial.println(voltage, DEC);
219 for (page = 0; page < 8; page++)
223 Serial.print(F(
"LTC2977 VOUT "));
224 Serial.println(voltage, DEC);
236 for (page = 0; page < 2; page++)
240 Serial.print(F(
"LTC3880 IOUT "));
241 Serial.println(current, DEC);
244 for (page = 0; page < 4; page++)
248 Serial.print(F(
"LTC2974 IOUT "));
249 Serial.println(current, DEC);
264 for (page = 0; page < 2; page++)
266 Serial.print(F(
"PAGE "));
267 Serial.println(page, DEC);
270 Serial.print(F(
"LTC3880 STATUS BYTE 0x"));
271 Serial.println(b, HEX);
273 Serial.print(F(
"LTC3880 STATUS WORD 0x"));
274 Serial.println(w, HEX);
277 for (page = 0; page < 4; page++)
279 Serial.print(F(
"PAGE "));
280 Serial.println(page, DEC);
283 Serial.print(F(
"LTC2974 STATUS BYTE 0x"));
284 Serial.println(b, HEX);
286 Serial.print(F(
"LTC2974 STATUS WORD 0x"));
287 Serial.println(w, HEX);
290 for (page = 0; page < 8; page++)
292 Serial.print(F(
"PAGE "));
293 Serial.println(page, DEC);
296 Serial.print(F(
"LTC2977 STATUS BYTE 0x"));
297 Serial.println(b, DEC);
299 Serial.print(F(
"LTC2977 STATUS WORD 0x"));
300 Serial.println(w, HEX);
342 Serial.print(F(
" 1-Read All Voltages\n"));
343 Serial.print(F(
" 2-Read All Currents\n"));
344 Serial.print(F(
" 3-Read All Status\n"));
345 Serial.print(F(
" 4-Sequence Off/On\n"));
346 Serial.print(F(
" 5-Margin High\n"));
347 Serial.print(F(
" 6-Margin Low\n"));
348 Serial.print(F(
" 7-Margin Off\n"));
349 Serial.print(F(
" 8-Set LTC3880 PAGE 0 to 0.87V\n"));
350 Serial.print(F(
" 9-Set LTC3880 PAGE 0 to 0.78V\n"));
351 Serial.print(F(
" m-Main Menu\n"));
352 Serial.print(F(
"\nEnter a command: "));
355 if (user_command ==
'm')
357 Serial.print(F(
"m\n"));
360 Serial.println(user_command);
362 switch (user_command)
394 if (user_command !=
'm')
395 Serial.println(F(
"Invalid Selection"));
399 while (user_command !=
'm');
static void margin_high()
Margin high.
static uint8_t ltc3880_i2c_address
unsigned char user_command
LTC SMBus Support: API for a shared SMBus layer.
#define LTC3880_I2C_ADDRESS
LTC SMBus Support: Implementation for a shared SMBus layer.
static void print_all_voltages()
Print all voltages.
LTC SMBus Support: Implementation for a shared SMBus layer.
void reset(uint8_t address)
Issue reset to one device.
uint8_t readStatusByte(uint8_t address)
Get the status byte.
Header File for Linduino Libraries and Demo Code.
static void menu_1_basic_commands()
Display menu 1.
void enablePec(uint8_t address)
Enable pec for all transactions.
uint16_t readStatusWord(uint8_t address)
Get the status word.
float readIout(uint8_t address, bool polling)
Get the measured output current.
static void print_all_currents()
Print all currents.
void disablePec(uint8_t address)
Disable pec for all transactions.
static void loop()
Repeats Linduino loop.
static void margin_low()
Margin low.
static void setup()
Initialize Linduino.
TwoWire.h - TWI/I2C library for Arduino & Wiring Copyright (c) 2006 Nicholas Zambetti.
void startGroupProtocol(void)
starts group protocol
float readVout(uint8_t address, bool polling)
Get the measured output voltage.
#define LTC2977_I2C_ADDRESS
LT_I2CBus: Routines to communicate to I2C by Wire Library.
LTC PMBus Support: Implementation for a LTC Fault Log.
static void print_all_status()
Print all status bytes and words.
static void margin_off()
Go to nominal.
void setPage(uint8_t address, uint8_t page)
Set the page.
#define LTC2974_I2C_ADDRESS
void marginLowGlobal(void)
Margin all rails low.
void sequenceOnGlobal(void)
Sequence on all rails.
virtual uint8_t * probe(uint8_t command)=0
SMBus bus probe.
static void print_warning_prompt()
Prints a warning if the demo board is not detected.
LTC SMBus Support: Implementation for a shared SMBus layer.
static void print_title()
Prints the title block when program first starts.
void sequenceOffGlobal(void)
Sequence off all rails.
void setVout(uint8_t address, float voltage)
Set output voltage.
void executeGroupProtocol(void)
ends group protocol
void restoreFromNvm(uint8_t address)
Restore device from NVM.
static uint8_t ltc2974_i2c_address
static uint16_t current
the current measurement from the LTC3335's counter test mode.
static uint8_t ltc2977_i2c_address
static void print_prompt()
Prints main menu.
void marginHighGlobal(void)
Margin all rails high.
LTC PMBus Support: Math conversion routines.
static void sequence_off_on()
Sequence off then on.
LTC SMBus Support: Implementation for a shared SMBus layer.