66 #define LTC2975_I2C_ADDRESS 0x5C 92 uint8_t *addresses = NULL;
94 if (Serial.available())
97 if (user_command !=
'm')
98 Serial.println(user_command);
100 switch (user_command)
126 addresses = smbus->
probe(0);
127 while (*addresses != 0)
129 Serial.print(F(
"ADDR 0x"));
130 Serial.println(*addresses++, HEX);
139 Serial.println(F(
"Incorrect Option"));
153 Serial.print(F(
"\n*****************************************************************\n"));
154 Serial.print(F(
"* DC2382C Hello World Demonstration Program *\n"));
155 Serial.print(F(
"* *\n"));
156 Serial.print(F(
"* This program demonstrates how to send and receive data from *\n"));
157 Serial.print(F(
"* the LTC2382 demo board. *\n"));
158 Serial.print(F(
"* *\n"));
159 Serial.print(F(
"* Set the baud rate to 115200 and select the newline terminator.*\n"));
160 Serial.print(F(
"* *\n"));
161 Serial.print(F(
"*****************************************************************\n"));
168 Serial.print(F(
"\n 1-Basic Commands\n"));
169 Serial.print(F(
" 2-VID Commands (L16)\n"));
170 Serial.print(F(
" 3-VID Commands (float) \n"));
171 Serial.print(F(
" 4-PEC On\n"));
172 Serial.print(F(
" 5-PEC Off\n"));
173 Serial.print(F(
" 6-Bus Probe\n"));
174 Serial.print(F(
" 7-Reset\n"));
175 Serial.print(F(
"\nEnter a command:"));
182 Serial.println(F(
"\nWarning: Demo board not detected. Linduino will attempt to proceed."));
192 for (page = 0; page < 4; page++)
196 Serial.print(F(
"LTC2975 VOUT "));
197 Serial.println(voltage, DEC);
208 for (page = 0; page < 4; page++)
212 Serial.print(F(
"LTC2975 IOUT "));
213 Serial.println(current, DEC);
225 for (page = 0; page < 4; page++)
227 Serial.print(F(
"PAGE "));
228 Serial.println(page, DEC);
231 Serial.print(F(
"LTC2975 STATUS BYTE 0x"));
232 Serial.println(b, HEX);
234 Serial.print(F(
"LTC2975 STATUS WORD 0x"));
235 Serial.println(w, HEX);
278 Serial.print(F(
" 1-Read All Voltages\n"));
279 Serial.print(F(
" 2-Read All Currents\n"));
280 Serial.print(F(
" 3-Read All Status\n"));
281 Serial.print(F(
" 4-Sequence Off/On\n"));
282 Serial.print(F(
" 5-Margin High\n"));
283 Serial.print(F(
" 6-Margin Low\n"));
284 Serial.print(F(
" 7-Margin Off\n"));
285 Serial.print(F(
" m-Main Menu\n"));
286 Serial.print(F(
"\nEnter a command: "));
289 if (user_command ==
'm')
291 Serial.print(F(
"m\n"));
294 Serial.println(user_command);
296 switch (user_command)
320 if (user_command !=
'm')
321 Serial.println(F(
"Invalid Selection"));
325 while (user_command !=
'm');
343 Serial.print(F(
" 1-VID UP 40 LSB\n"));
344 Serial.print(F(
" 2-VID DN 40 LSB\n"));
345 Serial.print(F(
" m-Main Menu\n"));
346 Serial.print(F(
"\nEnter a command: "));
349 if (user_command ==
'm')
351 Serial.print(F(
"m\n"));
354 Serial.println(user_command);
356 switch (user_command)
361 Serial.print(F(
"LTC2975 VOUT Code "));
362 Serial.println(vcode, HEX);
365 Serial.print(F(
"LTC2975 VOUT Telemetry "));
366 Serial.println(voltage, DEC);
371 Serial.print(F(
"LTC2975 VOUT Code "));
372 Serial.println(vcode, HEX);
375 Serial.print(F(
"LTC2975 VOUT Telemetry "));
376 Serial.println(voltage, DEC);
377 Serial.print(F(
"\n"));
380 if (user_command !=
'm')
381 Serial.println(F(
"Invalid Selection"));
385 while (user_command !=
'm');
403 Serial.print(F(
" 1-VID UP 4mV\n"));
404 Serial.print(F(
" 2-VID DN 4mV\n"));
405 Serial.print(F(
" m-Main Menu\n"));
406 Serial.print(F(
"\nEnter a command: "));
409 if (user_command ==
'm')
411 Serial.print(F(
"m\n"));
414 Serial.println(user_command);
416 switch (user_command)
421 Serial.print(F(
"LTC2975 VOUT "));
422 Serial.println(vid_value, DEC);
425 Serial.print(F(
"LTC2975 VOUT Telemetry "));
426 Serial.println(voltage, DEC);
431 Serial.print(F(
"LTC2975 VOUT "));
432 Serial.println(vid_value, DEC);
435 Serial.print(F(
"LTC2975 VOUT Telemetry "));
436 Serial.println(voltage, DEC);
437 Serial.print(F(
"\n"));
440 if (user_command !=
'm')
441 Serial.println(F(
"Invalid Selection"));
445 while (user_command !=
'm');
lin16_t float_to_lin16(float xin, lin16m_t vout_mode)
unsigned char user_command
static void margin_low()
Margin low.
LTC SMBus Support: Implementation for a shared SMBus layer.
uint8_t readStatusByte(uint8_t address)
Get the status byte.
static void margin_off()
Go to nominal.
static void loop()
Repeats Linduino loop.
Header File for Linduino Libraries and Demo Code.
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 menu_2_vid_commands()
Display menu 2.
static void print_all_status()
Print all status bytes and words.
static void print_warning_prompt()
Prints a warning if the demo board is not detected.
void disablePec(uint8_t address)
Disable pec for all transactions.
virtual void writeWord(uint8_t address, uint8_t command, uint16_t data)=0
SMBus write word command.
static void margin_high()
Margin high.
static LT_PMBusMath * math
static void print_all_currents()
Print all currents.
void startGroupProtocol(void)
starts group protocol
float readVout(uint8_t address, bool polling)
Get the measured output voltage.
static void print_all_voltages()
Print all voltages.
static void menu_3_vid_commands()
Display menu 3.
LT_I2CBus: Routines to communicate to I2C by Wire Library.
virtual void writeByte(uint8_t address, uint8_t command, uint8_t data)=0
SMBus write byte command.
#define LTC2975_I2C_ADDRESS
void setPage(uint8_t address, uint8_t page)
Set the page.
static void menu_1_basic_commands()
Display menu 1.
void marginLowGlobal(void)
Margin all rails low.
static void print_title()
Prints the title block when program first starts.
static void sequence_off_on()
Sequence off then on.
void sequenceOnGlobal(void)
Sequence on all rails.
virtual uint8_t * probe(uint8_t command)=0
SMBus bus probe.
LTC SMBus Support: Implementation for a shared SMBus layer.
static void print_prompt()
Prints main menu.
void sequenceOffGlobal(void)
Sequence off all rails.
void setVout(uint8_t address, float voltage)
Set output voltage.
void executeGroupProtocol(void)
ends group protocol
static void setup()
Initialize Linduino.
void restoreFromNvm(uint8_t address)
Restore device from NVM.
static uint16_t current
the current measurement from the LTC3335's counter test mode.
void marginHighGlobal(void)
Margin all rails high.
LTC PMBus Support: Math conversion routines.
static uint8_t ltc2975_i2c_address