71 #define LTC2980_I2C_ADDRESS_A 0x30 72 #define LTC2980_I2C_ADDRESS_B 0x32 100 uint8_t *addresses = NULL;
102 if (Serial.available())
105 if (user_command !=
'm')
106 Serial.println(user_command);
108 switch (user_command)
130 addresses = smbus->
probe(0);
131 while (*addresses != 0)
133 Serial.print(F(
"ADDR 0x"));
134 Serial.println(*addresses++, HEX);
143 Serial.println(F(
"Incorrect Option"));
157 Serial.print(F(
"\n*****************************************************************\n"));
158 Serial.print(F(
"* DC2198A Hello World Demonstration Program *\n"));
159 Serial.print(F(
"* *\n"));
160 Serial.print(F(
"* This program demonstrates how to send and receive data from *\n"));
161 Serial.print(F(
"* the LTC2198A demo board. *\n"));
162 Serial.print(F(
"* *\n"));
163 Serial.print(F(
"* Set the baud rate to 115200 and select the newline terminator.*\n"));
164 Serial.print(F(
"* *\n"));
165 Serial.print(F(
"*****************************************************************\n"));
172 Serial.print(F(
"\n 1-Basic Commands\n"));
173 Serial.print(F(
" 2-PEC On\n"));
174 Serial.print(F(
" 3-PEC Off\n"));
175 Serial.print(F(
" 4-Bus Probe\n"));
176 Serial.print(F(
" 5-Reset\n"));
177 Serial.print(F(
"\nEnter a command:"));
184 Serial.println(F(
"\nWarning: Demo board not detected. Linduino will attempt to proceed."));
194 for (page = 0; page < 8; page++)
198 Serial.print(F(
"LTC2980_A VOUT "));
199 Serial.println(voltage, DEC);
202 for (page = 0; page < 8; page++)
206 Serial.print(F(
"LTC2980_B VOUT "));
207 Serial.println(voltage, DEC);
222 for (page = 0; page < 8; page++)
224 Serial.print(F(
"PAGE "));
225 Serial.println(page, DEC);
228 Serial.print(F(
"LTC2980_A STATUS BYTE 0x"));
229 Serial.println(b, DEC);
231 Serial.print(F(
"LTC2980_A STATUS WORD 0x"));
232 Serial.println(w, HEX);
235 for (page = 0; page < 8; page++)
237 Serial.print(F(
"PAGE "));
238 Serial.println(page, DEC);
241 Serial.print(F(
"LTC2980_B STATUS BYTE 0x"));
242 Serial.println(b, DEC);
244 Serial.print(F(
"LTC2980_B STATUS WORD 0x"));
245 Serial.println(w, HEX);
289 Serial.print(F(
" 1-Read All Voltages\n"));
290 Serial.print(F(
" 2-Read All Status\n"));
291 Serial.print(F(
" 3-Sequence Off/On\n"));
292 Serial.print(F(
" 4-Margin High\n"));
293 Serial.print(F(
" 5-Margin Low\n"));
294 Serial.print(F(
" 6-Margin Off\n"));
295 Serial.print(F(
" m-Main Menu\n"));
296 Serial.print(F(
"\nEnter a command: "));
299 if (user_command ==
'm')
301 Serial.print(F(
"m\n"));
304 Serial.println(user_command);
306 switch (user_command)
327 if (user_command !=
'm')
328 Serial.println(F(
"Invalid Selection"));
332 while (user_command !=
'm');
static void margin_off()
Go to nominal.
unsigned char user_command
LTC SMBus Support: API for a shared SMBus layer.
static void menu_1_basic_commands()
Display menu 1.
LTC SMBus Support: Implementation for a shared SMBus layer.
LTC SMBus Support: Implementation for a shared SMBus layer.
uint8_t readStatusByte(uint8_t address)
Get the status byte.
static void print_all_status()
Prints all status bytes and words.
Header File for Linduino Libraries and Demo Code.
void enablePec(uint8_t address)
Enable pec for all transactions.
static uint8_t ltc2980_i2c_address_a
uint16_t readStatusWord(uint8_t address)
Get the status word.
void disablePec(uint8_t address)
Disable pec for all transactions.
static void print_all_voltages()
static void print_warning_prompt()
Prints a warning if the demo board is not detected.
#define LTC2980_I2C_ADDRESS_B
static void print_prompt()
Prints main menu.
TwoWire.h - TWI/I2C library for Arduino & Wiring Copyright (c) 2006 Nicholas Zambetti.
static void margin_high()
Margin high.
static void print_title()
Prints the title block when program first starts.
void startGroupProtocol(void)
starts group protocol
float readVout(uint8_t address, bool polling)
Get the measured output voltage.
static void margin_low()
Margin low.
LT_I2CBus: Routines to communicate to I2C by Wire Library.
LTC PMBus Support: Implementation for a LTC Fault Log.
#define LTC2980_I2C_ADDRESS_A
void setPage(uint8_t address, uint8_t page)
Set the page.
void marginLowGlobal(void)
Margin all rails low.
static uint8_t ltc2980_i2c_address_b
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.
void sequenceOffGlobal(void)
Sequence off all rails.
void executeGroupProtocol(void)
ends group protocol
void restoreFromNvm(uint8_t address)
Restore device from NVM.
void marginHighGlobal(void)
Margin all rails high.
static void sequence_off_on()
Sequence off then on.
static void setup()
Initialize Linduino.
LTC PMBus Support: Math conversion routines.
static void loop()
Repeats Linduino loop.
LTC SMBus Support: Implementation for a shared SMBus layer.