66 #define LTC2975_I2C_ADDRESS 0x30 92 uint8_t *addresses = NULL;
94 if (Serial.available())
97 if (user_command !=
'm')
98 Serial.println(user_command);
100 switch (user_command)
120 addresses = smbus->
probe(0);
121 while (*addresses != 0)
123 Serial.print(F(
"ADDR 0x"));
124 Serial.println(*addresses++, HEX);
133 Serial.println(F(
"Incorrect Option"));
147 Serial.print(F(
"\n*****************************************************************\n"));
148 Serial.print(F(
"* DC2022AC Hello World Demonstration Program *\n"));
149 Serial.print(F(
"* *\n"));
150 Serial.print(F(
"* This program demonstrates how to send and receive data from *\n"));
151 Serial.print(F(
"* the LTC2022A demo board. *\n"));
152 Serial.print(F(
"* *\n"));
153 Serial.print(F(
"* Set the baud rate to 115200 and select the newline terminator.*\n"));
154 Serial.print(F(
"* *\n"));
155 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:"));
174 Serial.println(F(
"\nWarning: Demo board not detected. Linduino will attempt to proceed."));
183 for (page = 0; page < 4; page++)
187 Serial.print(F(
"LTC2975 VOUT "));
188 Serial.println(voltage, DEC);
198 for (page = 0; page < 4; page++)
202 Serial.print(F(
"LTC2975 IOUT "));
203 Serial.println(current, DEC);
215 for (page = 0; page < 4; page++)
217 Serial.print(F(
"PAGE "));
218 Serial.println(page, DEC);
221 Serial.print(F(
"LTC2975 STATUS BYTE 0x"));
222 Serial.println(b, HEX);
224 Serial.print(F(
"LTC2975 STATUS WORD 0x"));
225 Serial.println(w, HEX);
267 Serial.print(F(
" 1-Read All Voltages\n"));
268 Serial.print(F(
" 2-Read All Currents\n"));
269 Serial.print(F(
" 3-Read All Status\n"));
270 Serial.print(F(
" 4-Sequence Off/On\n"));
271 Serial.print(F(
" 5-Margin High\n"));
272 Serial.print(F(
" 6-Margin Low\n"));
273 Serial.print(F(
" 7-Margin Off\n"));
274 Serial.print(F(
" m-Main Menu\n"));
275 Serial.print(F(
"\nEnter a command: "));
278 if (user_command ==
'm')
280 Serial.print(F(
"m\n"));
283 Serial.println(user_command);
285 switch (user_command)
309 if (user_command !=
'm')
310 Serial.println(F(
"Invalid Selection"));
314 while (user_command !=
'm');
static void margin_low()
Margin low.
unsigned char user_command
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_currents()
Print all currents.
uint16_t readStatusWord(uint8_t address)
Get the status word.
float readIout(uint8_t address, bool polling)
Get the measured output current.
void disablePec(uint8_t address)
Disable pec for all transactions.
static void margin_high()
Margin high.
static void print_title()
Prints the title block when program first starts.
static void print_all_voltages()
Print all voltages.
static uint8_t ltc2975_i2c_address
void startGroupProtocol(void)
starts group protocol
static LT_PMBusMath * math
static void margin_off()
Go to nominal.
float readVout(uint8_t address, bool polling)
Get the measured output voltage.
LT_I2CBus: Routines to communicate to I2C by Wire Library.
static void loop()
Repeats Linduino loop.
void setPage(uint8_t address, uint8_t page)
Set the page.
static void setup()
Initialize Linduino.
static void menu_1_basic_commands()
Display menu 1.
void marginLowGlobal(void)
Margin all rails low.
static void sequence_off_on()
Sequence off then on.
void sequenceOnGlobal(void)
Sequence on all rails.
virtual uint8_t * probe(uint8_t command)=0
SMBus bus probe.
static void print_all_status()
Print all status bytes and words.
LTC SMBus Support: Implementation for a shared SMBus layer.
void sequenceOffGlobal(void)
Sequence off all rails.
#define LTC2975_I2C_ADDRESS
void executeGroupProtocol(void)
ends group protocol
void restoreFromNvm(uint8_t address)
Restore device from NVM.
static uint16_t current
the current measurement from the LTC3335's counter test mode.
void marginHighGlobal(void)
Margin all rails high.
LTC PMBus Support: Math conversion routines.
static void print_prompt()
Prints main menu.
static void print_warning_prompt()
Prints a warning if the demo board is not detected.