71 #define LTC2977_I2C_ADDRESS 0x33 95 uint8_t *addresses = NULL;
97 if (Serial.available())
100 if (user_command !=
'm')
101 Serial.println(user_command);
103 switch (user_command)
123 addresses = smbus->
probe(0);
124 while (*addresses != 0)
126 Serial.print(F(
"ADDR 0x"));
127 Serial.println(*addresses++, HEX);
135 Serial.println(F(
"Incorrect Option"));
148 Serial.print(F(
"\n*****************************************************************\n"));
149 Serial.print(F(
"* DC2028A Hello World 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 LTC2028A 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"));
162 Serial.print(F(
"\n 1-Basic Commands\n"));
163 Serial.print(F(
" 2-PEC On\n"));
164 Serial.print(F(
" 3-PEC Off\n"));
165 Serial.print(F(
" 4-Bus Probe\n"));
166 Serial.print(F(
" 5-Reset\n"));
167 Serial.print(F(
"\nEnter a command:"));
173 Serial.println(F(
"\nWarning: Demo board not detected. Linduino will attempt to proceed."));
181 for (page = 0; page < 8; page++)
185 Serial.print(F(
"LTC2977 VOUT "));
186 Serial.println(voltage, DEC);
199 for (page = 0; page < 8; page++)
201 Serial.print(F(
"PAGE "));
202 Serial.println(page, DEC);
205 Serial.print(F(
"LTC2977 STATUS BYTE 0x"));
206 Serial.println(b, DEC);
208 Serial.print(F(
"LTC2977 STATUS WORD 0x"));
209 Serial.println(w, HEX);
242 Serial.print(F(
" 1-Read All Voltages\n"));
243 Serial.print(F(
" 2-Read All Status\n"));
244 Serial.print(F(
" 3-Sequence Off/On\n"));
245 Serial.print(F(
" 4-Margin High\n"));
246 Serial.print(F(
" 5-Margin Low\n"));
247 Serial.print(F(
" 6-Margin Off\n"));
248 Serial.print(F(
" m-Main Menu\n"));
249 Serial.print(F(
"\nEnter a command: "));
252 if (user_command ==
'm')
254 Serial.print(F(
"m\n"));
257 Serial.println(user_command);
259 switch (user_command)
280 if (user_command !=
'm')
281 Serial.println(F(
"Invalid Selection"));
285 while (user_command !=
'm');
static void print_warning_prompt()
Prints a warning if the demo board is not detected.
static void setup()
Initialize Linduino.
unsigned char user_command
LTC SMBus Support: API for a shared SMBus layer.
#define LTC2977_I2C_ADDRESS
LTC SMBus Support: Implementation for a shared SMBus layer.
static void print_all_status()
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.
static void margin_high()
void enablePec(uint8_t address)
Enable pec for all transactions.
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()
TwoWire.h - TWI/I2C library for Arduino & Wiring Copyright (c) 2006 Nicholas Zambetti.
void startGroupProtocol(void)
starts group protocol
float readVout(uint8_t address, bool polling)
Get the measured output voltage.
LT_I2CBus: Routines to communicate to I2C by Wire Library.
static void menu_1_basic_commands()
LTC PMBus Support: Implementation for a LTC Fault Log.
static void sequence_off_on()
void setPage(uint8_t address, uint8_t page)
Set the page.
void marginLowGlobal(void)
Margin all rails low.
static void loop()
Repeats Linduino loop.
void sequenceOnGlobal(void)
Sequence on all rails.
virtual uint8_t * probe(uint8_t command)=0
SMBus bus probe.
static uint8_t ltc2977_i2c_address
LTC SMBus Support: Implementation for a shared SMBus layer.
void sequenceOffGlobal(void)
Sequence off all rails.
static void print_title()
Prints the title block when program first starts.
void executeGroupProtocol(void)
ends group protocol
void restoreFromNvm(uint8_t address)
Restore device from NVM.
void marginHighGlobal(void)
Margin all rails high.
LTC PMBus Support: Math conversion routines.
LTC SMBus Support: Implementation for a shared SMBus layer.
static void print_prompt()
Prints main menu.