65 #define LTC3887_I2C_ADDRESS 0x4F 90 uint8_t *addresses = NULL;
92 if (Serial.available())
95 if (user_command !=
'm')
96 Serial.println(user_command);
105 Serial.print(F(
"MODEL "));
106 Serial.print((
char *)model);
111 Serial.println(res, HEX);
128 addresses = smbus->
probe(0);
129 while (*addresses != 0)
131 Serial.print(F(
"ADDR 0x"));
132 Serial.println(*addresses++, HEX);
139 Serial.println(F(
"Incorrect Option"));
153 Serial.print(F(
"\n*****************************************************************\n"));
154 Serial.print(F(
"* DC1590B 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 DC1590B 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-Model Number\n"));
170 Serial.print(F(
" 3-Revision Number\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 < 2; page++)
196 Serial.print(F(
"LTC3887 VOUT "));
197 Serial.println(voltage, DEC);
208 for (page = 0; page < 2; page++)
212 Serial.print(F(
"LTC3887 IOUT "));
213 Serial.println(current, DEC);
225 for (page = 0; page < 2; page++)
227 Serial.print(F(
"PAGE "));
228 Serial.println(page, DEC);
233 Serial.print(F(
"LTC3887 STATUS BYTE 0x"));
234 Serial.println(b, HEX);
237 Serial.print(F(
"LTC3887 STATUS WORD 0x"));
238 Serial.println(w, HEX);
281 Serial.print(F(
"\nRead/Write\n\n"));
282 Serial.print(F(
" 1-Read All Voltages\n"));
283 Serial.print(F(
" 2-Read All Currents\n"));
284 Serial.print(F(
" 3-Read All Status\n"));
285 Serial.print(F(
" 4-Sequence Off/On\n"));
286 Serial.print(F(
" 5-Margin High\n"));
287 Serial.print(F(
" 6-Margin Low\n"));
288 Serial.print(F(
" 7-Margin Off\n"));
289 Serial.print(F(
" 8-ClearFaults\n"));
290 Serial.print(F(
" m-Main Menu\n"));
291 Serial.print(F(
"\nEnter a command: "));
294 if (user_command ==
'm')
296 Serial.print(F(
"m\n"));
299 Serial.println(user_command);
301 switch (user_command)
327 if (user_command !=
'm')
328 Serial.println(F(
"Invalid Selection"));
332 while (user_command !=
'm');
static void menu_1_basic_commands()
Display menu 1.
static void print_prompt()
Prints main menu.
unsigned char user_command
static void print_all_status()
Print all status bytes and words.
static void margin_off()
Go to nominal.
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 uint8_t ltc3887_i2c_address
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.
void readModel(uint8_t address, uint8_t *model)
Get the model.
static void loop()
Repeats Linduino loop.
void disablePec(uint8_t address)
Disable pec for all transactions.
uint8_t readPmbusRevision(uint8_t address)
Get the pmbus revision.
static void setup()
Initialize Linduino.
float readVout(uint8_t address, bool polling)
Get the measured output voltage.
LT_I2CBus: Routines to communicate to I2C by Wire Library.
static void print_warning_prompt()
Prints a warning if the demo board is not detected.
void setPage(uint8_t address, uint8_t page)
Set the page.
void marginLowGlobal(void)
Margin all rails low.
void sequenceOnGlobal(void)
Sequence on all rails.
void clearAllFaults(uint8_t address)
Clear all the faults for all pages.
virtual uint8_t * probe(uint8_t command)=0
SMBus bus probe.
#define LTC3887_I2C_ADDRESS
LTC SMBus Support: Implementation for a shared SMBus layer.
static void margin_high()
Margin high.
static void print_all_currents()
Print all currents.
void sequenceOffGlobal(void)
Sequence off all rails.
static void print_all_voltages()
Print all voltages.
static void margin_low()
Margin low.
static uint16_t current
the current measurement from the LTC3335's counter test mode.
void marginHighGlobal(void)
Margin all rails high.
static void sequence_off_on()
Sequenc off and then on.
static void print_title()
Prints the title block when program first starts.