65 #define LTC3880_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"));
152 Serial.print(F(
"\n*****************************************************************\n"));
153 Serial.print(F(
"* DC1590B Demonstration Program *\n"));
154 Serial.print(F(
"* *\n"));
155 Serial.print(F(
"* This program demonstrates how to send and receive data from *\n"));
156 Serial.print(F(
"* the DC1590B demo board. *\n"));
157 Serial.print(F(
"* *\n"));
158 Serial.print(F(
"* Set the baud rate to 115200 and select the newline terminator.*\n"));
159 Serial.print(F(
"* *\n"));
160 Serial.print(F(
"*****************************************************************\n"));
166 Serial.print(F(
"\n 1-Basic Commands\n"));
167 Serial.print(F(
" 2-Model Number\n"));
168 Serial.print(F(
" 3-Revision Number\n"));
169 Serial.print(F(
" 4-PEC On\n"));
170 Serial.print(F(
" 5-PEC Off\n"));
171 Serial.print(F(
" 6-Bus Probe\n"));
172 Serial.print(F(
" 7-Reset\n"));
173 Serial.print(F(
"\nEnter a command:"));
179 Serial.println(F(
"\nWarning: Demo board not detected. Linduino will attempt to proceed."));
187 for (page = 0; page < 2; page++)
191 Serial.print(F(
"LTC3880 VOUT "));
192 Serial.println(voltage, DEC);
201 for (page = 0; page < 2; page++)
205 Serial.print(F(
"LTC3880 IOUT "));
206 Serial.println(current, DEC);
216 for (page = 0; page < 2; page++)
218 Serial.print(F(
"PAGE "));
219 Serial.println(page, DEC);
222 Serial.print(F(
"LTC3880 STATUS BYTE 0x"));
223 Serial.println(b, HEX);
225 Serial.print(F(
"LTC3880 STATUS WORD 0x"));
226 Serial.println(w, HEX);
259 Serial.print(F(
"\nRead/Write\n\n"));
260 Serial.print(F(
" 1-Read All Voltages\n"));
261 Serial.print(F(
" 2-Read All Currents\n"));
262 Serial.print(F(
" 3-Read All Status\n"));
263 Serial.print(F(
" 4-Sequence Off/On\n"));
264 Serial.print(F(
" 5-Margin High\n"));
265 Serial.print(F(
" 6-Margin Low\n"));
266 Serial.print(F(
" 7-Margin Off\n"));
267 Serial.print(F(
" 8-ClearFaults\n"));
268 Serial.print(F(
" m-Main Menu\n"));
269 Serial.print(F(
"\nEnter a command: "));
272 if (user_command ==
'm')
274 Serial.print(F(
"m\n"));
277 Serial.println(user_command);
279 switch (user_command)
305 if (user_command !=
'm')
306 Serial.println(F(
"Invalid Selection"));
310 while (user_command !=
'm');
unsigned char user_command
LTC SMBus Support: Implementation for a shared SMBus layer.
uint8_t readStatusByte(uint8_t address)
Get the status byte.
static void menu_1_basic_commands()
Header File for Linduino Libraries and Demo Code.
void enablePec(uint8_t address)
Enable pec for all transactions.
static void margin_high()
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 uint8_t ltc3880_i2c_address
void disablePec(uint8_t address)
Disable pec for all transactions.
static void loop()
Repeats Linduino loop.
static void print_prompt()
Prints main menu.
uint8_t readPmbusRevision(uint8_t address)
Get the pmbus revision.
static void print_warning_prompt()
Prints a warning if the demo board is not detected.
float readVout(uint8_t address, bool polling)
Get the measured output voltage.
#define LTC3880_I2C_ADDRESS
LT_I2CBus: Routines to communicate to I2C by Wire Library.
void resetGlobal(void)
Issue reset to all devices.
static void setup()
Initialize Linduino.
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.
static void print_title()
Prints the title block when program first starts.
LTC SMBus Support: Implementation for a shared SMBus layer.
static void sequence_off_on()
void sequenceOffGlobal(void)
Sequence off all rails.
static void print_all_status()
static uint16_t current
the current measurement from the LTC3335's counter test mode.
void marginHighGlobal(void)
Margin all rails high.
static void print_all_voltages()
static void print_all_currents()