65 #define LTC3882_I2C_ADDRESS 0x5C 87 uint8_t *addresses = NULL;
89 if (Serial.available())
92 if (user_command !=
'm')
93 Serial.println(user_command);
102 Serial.print(F(
"MODEL "));
103 Serial.print((
char *)model);
108 Serial.println(res, HEX);
125 addresses = smbus->
probe(0);
126 while (*addresses != 0)
128 Serial.print(F(
"ADDR 0x"));
129 Serial.println(*addresses++, HEX);
136 Serial.println(F(
"Incorrect Option"));
149 Serial.print(F(
"\n*****************************************************************\n"));
150 Serial.print(F(
"* DC1936A Demonstration Program *\n"));
151 Serial.print(F(
"* *\n"));
152 Serial.print(F(
"* This program demonstrates how to send and receive data from *\n"));
153 Serial.print(F(
"* the DC1936A demo board. *\n"));
154 Serial.print(F(
"* *\n"));
155 Serial.print(F(
"* Set the baud rate to 115200 and select the newline terminator.*\n"));
156 Serial.print(F(
"* *\n"));
157 Serial.print(F(
"*****************************************************************\n"));
163 Serial.print(F(
"\n 1-Basic Commands\n"));
164 Serial.print(F(
" 2-Model Number\n"));
165 Serial.print(F(
" 3-Revision Number\n"));
166 Serial.print(F(
" 4-PEC On\n"));
167 Serial.print(F(
" 5-PEC Off\n"));
168 Serial.print(F(
" 6-Bus Probe\n"));
169 Serial.print(F(
" 7-Reset\n"));
170 Serial.print(F(
"\nEnter a command:"));
176 Serial.println(F(
"\nWarning: Demo board not detected. Linduino will attempt to proceed."));
184 for (page = 0; page < 2; page++)
187 Serial.print(F(
"LTC3882 VOUT "));
188 Serial.println(voltage, DEC);
197 for (page = 0; page < 2; page++)
200 Serial.print(F(
"LTC3882 IOUT "));
201 Serial.println(current, DEC);
211 for (page = 0; page < 2; page++)
213 Serial.print(F(
"PAGE "));
214 Serial.println(page, DEC);
217 Serial.print(F(
"LTC3880 STATUS BYTE 0x"));
218 Serial.println(b, HEX);
220 Serial.print(F(
"LTC3882 STATUS WORD 0x"));
221 Serial.println(w, HEX);
254 Serial.print(F(
"\nRead/Write\n\n"));
255 Serial.print(F(
" 1-Read All Voltages\n"));
256 Serial.print(F(
" 2-Read All Currents\n"));
257 Serial.print(F(
" 3-Read All Status\n"));
258 Serial.print(F(
" 4-Sequence Off/On\n"));
259 Serial.print(F(
" 5-Margin High\n"));
260 Serial.print(F(
" 6-Margin Low\n"));
261 Serial.print(F(
" 7-Margin Off\n"));
262 Serial.print(F(
" m-Main Menu\n"));
263 Serial.print(F(
"\nEnter a command: "));
266 if (user_command ==
'm')
268 Serial.print(F(
"m\n"));
271 Serial.println(user_command);
273 switch (user_command)
297 if (user_command !=
'm')
298 Serial.println(F(
"Invalid Selection"));
302 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 print_title()
Prints the title block when program first starts.
Header File for Linduino Libraries and Demo Code.
void enablePec(uint8_t address)
Enable pec for all transactions.
static void print_all_currents()
uint16_t readStatusWord(uint8_t address)
Get the status word.
void readModel(uint8_t address, uint8_t *model)
Get the model.
void disablePec(uint8_t address)
Disable pec for all transactions.
uint8_t readPmbusRevision(uint8_t address)
Get the pmbus revision.
static void print_all_voltages()
static void print_prompt()
Prints main menu.
static void setup()
Initialize Linduino.
LT_I2CBus: Routines to communicate to I2C by Wire Library.
static void margin_high()
void resetGlobal(void)
Issue reset to all devices.
static void print_all_status()
static void print_warning_prompt()
Prints a warning if the demo board is not detected.
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 void menu_1_basic_commands()
LTC SMBus Support: Implementation for a shared SMBus layer.
#define LTC3882_I2C_ADDRESS
void sequenceOffGlobal(void)
Sequence off all rails.
static uint8_t ltc3882_i2c_address
static uint16_t current
the current measurement from the LTC3335's counter test mode.
void marginHighGlobal(void)
Margin all rails high.
float readVoutWithPage(uint8_t address, uint8_t page)
Get the measured output voltage.
static void sequence_off_on()
float readIoutWithPage(uint8_t address, uint8_t page)
Get the measured output current.