75 #define LTM4676_I2C_ADDRESS_0 0x45 76 #define LTM4676_I2C_ADDRESS_1 0x46 77 #define LTM4676_I2C_ADDRESS_2 0x47 78 #define LTM4676_I2C_ADDRESS_3 0x48 79 #define LTM4676_I2C_ADDRESS_R 0x31 117 uint8_t *addresses = NULL;
119 if (Serial.available())
122 if (user_command !=
'm')
123 Serial.println(user_command);
125 switch (user_command)
132 Serial.print(F(
"MODEL "));
133 Serial.print((
char *)model);
138 Serial.println(res, HEX);
165 addresses = smbus->
probe(0);
166 while (*addresses != 0)
168 Serial.print(F(
"ADDR 0x"));
169 Serial.println(*addresses++, HEX);
176 Serial.println(F(
"Incorrect Option"));
189 Serial.print(F(
"\n*****************************************************************\n"));
190 Serial.print(F(
"* DC1590B Demonstration Program *\n"));
191 Serial.print(F(
"* *\n"));
192 Serial.print(F(
"* This program demonstrates how to send and receive data from *\n"));
193 Serial.print(F(
"* the DC1590B demo board. *\n"));
194 Serial.print(F(
"* *\n"));
195 Serial.print(F(
"* Set the baud rate to 115200 and select the newline terminator.*\n"));
196 Serial.print(F(
"* *\n"));
197 Serial.print(F(
"*****************************************************************\n"));
203 Serial.print(F(
"\n 1-Basic Commands\n"));
204 Serial.print(F(
" 2-Model Number\n"));
205 Serial.print(F(
" 3-Revision Number\n"));
206 Serial.print(F(
" 4-PEC On\n"));
207 Serial.print(F(
" 5-PEC Off\n"));
208 Serial.print(F(
" 6-Bus Probe\n"));
209 Serial.print(F(
" 7-Reset\n"));
210 Serial.print(F(
"\nEnter a command:"));
216 Serial.println(F(
"\nWarning: Demo board not detected. Linduino will attempt to proceed."));
228 Serial.print(F(
"\nRead/Write\n\n"));
229 Serial.print(F(
" 1-Read Voltages\n"));
230 Serial.print(F(
" 2-Read Currents\n"));
231 Serial.print(F(
" 3-Read Power\n"));
232 Serial.print(F(
" 4-Read Status\n"));
233 Serial.print(F(
" 5-Sequence Off/On\n"));
234 Serial.print(F(
" 6-Margin High\n"));
235 Serial.print(F(
" 7-Margin Low\n"));
236 Serial.print(F(
" 8-Margin Off\n"));
237 Serial.print(F(
" 9-Clear Faults\n"));
238 Serial.print(F(
" m-Main Menu\n"));
239 Serial.print(F(
"\nEnter a command: "));
242 if (user_command ==
'm')
244 Serial.print(F(
"m\n"));
247 Serial.println(user_command);
249 switch (user_command)
253 Serial.print(F(
"LTM4676 VIN "));
254 Serial.println(result, DEC);
256 Serial.print(F(
"LTM4676 VOUT "));
257 Serial.println(result, DEC);
261 Serial.print(F(
"LTM4676 IIN "));
262 Serial.println(result, DEC);
264 Serial.print(F(
"LTM4676 IOUT "));
265 Serial.println(result, DEC);
269 Serial.print(F(
"LTM4676 POUT "));
270 Serial.println(result, DEC);
274 Serial.print(F(
"LTM4676 STATUS WORD 0x"));
275 Serial.println(status, HEX);
295 if (user_command !=
'm')
296 Serial.println(F(
"Invalid Selection"));
300 while (user_command !=
'm');
static uint8_t ltm4676_i2c_address_1
LT_PMBusRail ** getRails()
unsigned char user_command
LTC SMBus Support: API for a shared SMBus layer.
void sequenceOn()
Sequence on a polyphase rail.
LTC SMBus Support: Implementation for a shared SMBus layer.
LTC SMBus Support: Implementation for a shared SMBus layer.
String status(void)
Returns a descriptive string based on status of pins.
float readIin(bool polling)
Read the input current of a polyphase rail.
Header File for Linduino Libraries and Demo Code.
void enablePec(uint8_t address)
Enable pec for all transactions.
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.
TwoWire.h - TWI/I2C library for Arduino & Wiring Copyright (c) 2006 Nicholas Zambetti.
#define LTM4676_I2C_ADDRESS_2
static LT_PMBusRail * rail
LTC SMBus Support: Implementation for a LTC3880 Fault Log.
static uint8_t ltm4676_i2c_address_2
static void print_warning_prompt()
Prints a warning if the demo board is not detected.
#define LTM4676_I2C_ADDRESS_3
void marginHigh()
Margin high polyphase rail.
LT_I2CBus: Routines to communicate to I2C by Wire Library.
LTC PMBus Support: Implementation for a LTC Fault Log.
void clearFaults()
Clear faults of polyphase rail.
void resetGlobal(void)
Issue reset to all devices.
void sequenceOff()
Sequence off a polyphase rail.
uint16_t readStatusWord()
Read the status word of a polyphase rail.
static uint8_t ltm4676_i2c_address_3
virtual uint8_t * probe(uint8_t command)=0
SMBus bus probe.
static uint8_t ltm4676_i2c_address_r
LTC SMBus Support: Implementation for a shared SMBus layer.
void marginOff()
Margin off polyphase rail.
float readVin(bool polling)
Read the input voltage of a polyphase rail.
Library Header File for LT_PMBusDevice.
static LT_PMBusDetect * detector
#define LTM4676_I2C_ADDRESS_0
Linear Technology DC1989A Demonstration Board LTM4676: Dual Output PolyPhase Step-Down DC/DC Module w...
float readPout(bool polling)
Read the output power of a polyphase rail.
static void print_title()
Prints the title block when program first starts.
void detect()
Detect devices on bus.
static void menu_1_basic_commands()
static void loop()
Repeats Linduino loop.
static void setup()
Initialize Linduino.
#define LTM4676_I2C_ADDRESS_1
static uint8_t ltm4676_i2c_address_0
void marginLow()
Margin low polyphase rail.
float readIout(bool polling)
Read the output current of a polyphase rail.
LTC PMBus Support: Math conversion routines.
PMBusRail communication. For Multiphase Rails.
float readVout(bool polling)
Read the output voltage of a polyphase rail.
static void print_prompt()
Prints main menu.
LTC SMBus Support: Implementation for a shared SMBus layer.
#define LTM4676_I2C_ADDRESS_R