65 #define LTC3883_I2C_ADDRESS 0x4F 89 uint8_t *addresses = NULL;
91 if (Serial.available())
94 if (user_command !=
'm')
95 Serial.println(user_command);
104 Serial.print(F(
"MODEL "));
105 Serial.print((
char *)model);
110 Serial.println(res, HEX);
127 addresses = smbus->
probe(0);
128 while (*addresses != 0)
130 Serial.print(F(
"ADDR 0x"));
131 Serial.println(*addresses++, HEX);
138 Serial.println(F(
"Incorrect Option"));
152 Serial.print(F(
"\n*****************************************************************\n"));
153 Serial.print(F(
"* DC1778A Demonstration Program *\n"));
154 Serial.print(F(
"* *\n"));
155 Serial.print(F(
"* This program demonstrates how to send and receive data from *\n"));
156 Serial.print(F(
"* the DC1778A demo board. *\n"));
157 Serial.print(F(
"* *\n"));
158 Serial.print(F(
"* Set the baud rate to 115200 and select the newline terminator.*\n"));
159 Serial.print(F(
"* *\n"));
160 Serial.print(F(
"*****************************************************************\n"));
167 Serial.print(F(
"\n 1-Basic Commands\n"));
168 Serial.print(F(
" 2-Model Number\n"));
169 Serial.print(F(
" 3-Revision Number\n"));
170 Serial.print(F(
" 4-PEC On\n"));
171 Serial.print(F(
" 5-PEC Off\n"));
172 Serial.print(F(
" 6-Bus Probe\n"));
173 Serial.print(F(
" 7-Reset\n"));
174 Serial.print(F(
"\nEnter a command:"));
181 Serial.println(F(
"\nWarning: Demo board not detected. Linduino will attempt to proceed."));
191 Serial.print(F(
"LTC3883 VOUT "));
192 Serial.println(voltage, DEC);
202 Serial.print(F(
"LTC3883 IOUT "));
203 Serial.println(current, DEC);
214 Serial.print(F(
"LTC3883 STATUS BYTE 0x"));
215 Serial.println(b, HEX);
217 Serial.print(F(
"LTC3883 STATUS WORD 0x"));
218 Serial.println(w, HEX);
260 Serial.print(F(
"\nRead/Write\n\n"));
261 Serial.print(F(
" 1-Read All Voltages\n"));
262 Serial.print(F(
" 2-Read All Currents\n"));
263 Serial.print(F(
" 3-Read All Status\n"));
264 Serial.print(F(
" 4-Sequence Off/On\n"));
265 Serial.print(F(
" 5-Margin High\n"));
266 Serial.print(F(
" 6-Margin Low\n"));
267 Serial.print(F(
" 7-Margin Off\n"));
268 Serial.print(F(
" m-Main Menu\n"));
269 Serial.print(F(
"\nEnter a command: "));
272 if (user_command ==
'm')
274 Serial.print(F(
"m\n"));
277 Serial.println(user_command);
279 switch (user_command)
303 if (user_command !=
'm')
304 Serial.println(F(
"Invalid Selection"));
308 while (user_command !=
'm');
unsigned char user_command
static void print_title()
Prints the title block when program first starts.
LTC SMBus Support: Implementation for a shared SMBus layer.
static void print_all_currents()
Print all curents.
uint8_t readStatusByte(uint8_t address)
Get the status byte.
static uint8_t ltc3883_i2c_address
Header File for Linduino Libraries and Demo Code.
void enablePec(uint8_t address)
Enable pec for all transactions.
uint16_t readStatusWord(uint8_t address)
Get the status word.
float readIout(uint8_t address, bool polling)
Get the measured output current.
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.
float readVout(uint8_t address, bool polling)
Get the measured output voltage.
LT_I2CBus: Routines to communicate to I2C by Wire Library.
void resetGlobal(void)
Issue reset to all devices.
static void print_all_voltages()
Print all voltages.
static void margin_off()
Go to nominal.
static void setup()
Initialize Linduino.
static void print_all_status()
Print all status bytes and words.
void marginLowGlobal(void)
Margin all rails low.
static void menu_1_basic_commands()
Display menu 1.
static void print_prompt()
Prints main menu.
void sequenceOnGlobal(void)
Sequence on all rails.
virtual uint8_t * probe(uint8_t command)=0
SMBus bus probe.
#define LTC3883_I2C_ADDRESS
LTC SMBus Support: Implementation for a shared SMBus layer.
static void loop()
Repeats Linduino loop.
static void print_warning_prompt()
Prints a warning if the demo board is not detected.
static void margin_high()
Margin high.
void sequenceOffGlobal(void)
Sequence off all rails.
static void sequence_off_on()
Sequence off then on.
static void margin_low()
Margin low.
static uint16_t current
the current measurement from the LTC3335's counter test mode.
void marginHighGlobal(void)
Margin all rails high.