65 #define LTM2987_I2C_ADDRESS_1 0x30 66 #define LTM2987_I2C_ADDRESS_2 0x32 92 uint8_t *addresses = NULL;
94 if (Serial.available())
97 if (user_command !=
'm')
98 Serial.println(user_command);
100 switch (user_command)
122 addresses = smbus->
probe(0);
123 while (*addresses != 0)
125 Serial.print(F(
"ADDR 0x"));
126 Serial.println(*addresses++, HEX);
134 Serial.println(F(
"Incorrect Option"));
148 Serial.print(F(
"\n*****************************************************************\n"));
149 Serial.print(F(
"* DC2023A Demonstration Program *\n"));
150 Serial.print(F(
"* *\n"));
151 Serial.print(F(
"* This program demonstrates how to send and receive data from *\n"));
152 Serial.print(F(
"* the DC2023A demo board. *\n"));
153 Serial.print(F(
"* *\n"));
154 Serial.print(F(
"* Set the baud rate to 115200 and select the newline terminator.*\n"));
155 Serial.print(F(
"* *\n"));
156 Serial.print(F(
"*****************************************************************\n"));
163 Serial.print(F(
"\n 1-Basic Commands\n"));
164 Serial.print(F(
" 2-PEC On\n"));
165 Serial.print(F(
" 3-PEC Off\n"));
166 Serial.print(F(
" 4-Bus Probe\n"));
167 Serial.print(F(
" 5-Clear Faults\n"));
168 Serial.print(F(
"\nEnter a command:"));
175 Serial.println(F(
"\nWarning: Demo board not detected. Linduino will attempt to proceed."));
185 for (page = 0; page < 8; page++)
189 Serial.print(F(
"LTM2987 #1 VOUT "));
190 Serial.println(voltage, DEC);
192 for (page = 0; page < 8; page++)
196 Serial.print(F(
"LTM2987 #2 VOUT "));
197 Serial.println(voltage, DEC);
209 for (page = 0; page < 8; page++)
211 Serial.print(F(
"PAGE "));
212 Serial.println(page, DEC);
215 Serial.print(F(
"LTM2987 #1 STATUS BYTE 0x"));
216 Serial.println(b, HEX);
218 Serial.print(F(
"LTM2987 #1 STATUS WORD 0x"));
219 Serial.println(w, HEX);
222 for (page = 0; page < 8; page++)
224 Serial.print(F(
"PAGE "));
225 Serial.println(page, DEC);
228 Serial.print(F(
"LTM2982 #2 STATUS BYTE 0x"));
229 Serial.println(b, HEX);
231 Serial.print(F(
"LTM2987 #2 STATUS WORD 0x"));
232 Serial.println(w, HEX);
275 Serial.print(F(
"\nRead/Write\n\n"));
276 Serial.print(F(
" 1-Read All Voltages\n"));
277 Serial.print(F(
" 2-Read All Status\n"));
278 Serial.print(F(
" 3-Sequence Off/On\n"));
279 Serial.print(F(
" 4-Margin High\n"));
280 Serial.print(F(
" 5-Margin Low\n"));
281 Serial.print(F(
" 6-Margin Off\n"));
282 Serial.print(F(
" m-Main Menu\n"));
283 Serial.print(F(
"\nEnter a command: "));
286 if (user_command ==
'm')
288 Serial.print(F(
"m\n"));
291 Serial.println(user_command);
293 switch (user_command)
314 if (user_command !=
'm')
315 Serial.println(F(
"Invalid Selection"));
319 while (user_command !=
'm');
static uint8_t ltm2987_i2c_address_2
static uint8_t ltm2987_i2c_address_1
unsigned char user_command
static void setup()
Initialize Linduino.
LTC SMBus Support: Implementation for a shared SMBus layer.
uint8_t readStatusByte(uint8_t address)
Get the status byte.
Header File for Linduino Libraries and Demo Code.
void enablePec(uint8_t address)
Enable pec for all transactions.
static void print_all_voltages()
Print all voltages.
uint16_t readStatusWord(uint8_t address)
Get the status word.
void disablePec(uint8_t address)
Disable pec for all transactions.
#define LTM2987_I2C_ADDRESS_1
static void print_all_status()
Print all status bytes and words.
static void loop()
Repeats Linduino loop.
static void margin_high()
Margin high.
float readVout(uint8_t address, bool polling)
Get the measured output voltage.
static void sequence_off_on()
Sequence off then on.
LT_I2CBus: Routines to communicate to I2C by Wire Library.
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.
LTC SMBus Support: Implementation for a shared SMBus layer.
static void menu_1_basic_commands()
Display menu 1.
void sequenceOffGlobal(void)
Sequence off all rails.
#define LTM2987_I2C_ADDRESS_2
static void print_warning_prompt()
Prints a warning if the demo board is not detected.
static void print_title()
Prints the title block when program first starts.
static void margin_off()
Go to nominal.
void marginHighGlobal(void)
Margin all rails high.
static void print_prompt()
Prints main menu.
static void margin_low()
Margin low.