72 #if defined(ARDUINO_AVR_UNO) 73 #include <util/delay.h> 74 #elif defined(ARDUINO_SAM_DUE) 75 #define _delay_us delayMicroseconds 78 #define _delay_us delayMicroseconds 92 uint8_t comma_position[8] = {0};
93 uint8_t comma_count = 0;
100 int8_t QUIKEVAL_MUX_MODE_PIN_state;
105 Serial.print(buffer);
107 if (buffer_count == 0)
return(0);
109 for (i = 0; i < buffer_count; i++)
111 if (buffer[i] ==
',') comma_position[comma_count++]=
i;
114 if (comma_position[6] < comma_position[5])
116 for (i = buffer_count - 2; i > comma_position[5]; i--)
118 if (buffer[i] !=
'-')
120 comma_position[6] = i+1;
129 for (i = 0; i < comma_position[0]; i++)
137 for (i = comma_position[5]+1; i < comma_position[6]; i++)
150 return(buffer_count);
166 Serial.print(
"Demo Board Name: ");
168 Serial.print(
"Product Name: ");
172 Serial.print(
"Demo Board Option: ");
178 Serial.print(
"Demo board ");
179 Serial.print(demo_name);
180 Serial.print(
" not found, \nfound ");
182 Serial.println(
" instead. \nConnect the correct demo board, then press the reset button.");
200 for (timer_count = 0; timer_count <
EEPROM_TIMEOUT; timer_count++)
202 Wire.beginTransmission(i2c_address >> 1);
203 ack = Wire.endTransmission(
false);
211 Wire.endTransmission();
231 uint8_t byte_count = 0;
236 Wire.beginTransmission(i2c_address >> 1);
238 Wire.write(byte(address>>8));
241 Wire.endTransmission();
253 for (i = 0; i < num_bytes; i++)
271 for (i = 0; i < page_count; i++)
275 Wire.beginTransmission(i2c_address);
277 Wire.write(byte(address>>8));
279 byte_count = strlen(buffer)-
index;
282 for (j = 0; j < byte_count; j++)
285 Wire.write(buffer[index++]);
288 Wire.endTransmission();
301 uint8_t byte_count = 0;
306 Wire.beginTransmission(i2c_address >> 1);
308 Wire.write(address>>8);
310 if (Wire.endTransmission(
false))
313 Wire.endTransmission();
316 Wire.requestFrom((uint8_t)(i2c_address >> 1), (uint8_t)1, (uint8_t)
true);
317 while (Wire.available())
322 Wire.endTransmission();
333 for (i = 0; i < num_bytes; i++)
350 Wire.beginTransmission(i2c_address >> 1);
352 Wire.write(byte(address>>8));
354 if (Wire.endTransmission(
false))
357 Wire.endTransmission();
361 Wire.requestFrom((uint8_t)(i2c_address >> 1), (uint8_t)count, (uint8_t)
true);
362 while (Wire.available())
373 Wire.endTransmission();
389 Wire.beginTransmission(i2c_address >> 1);
391 Wire.write(byte(address>>8));
393 if (Wire.endTransmission(
false))
396 Wire.endTransmission();
400 Wire.requestFrom((uint8_t)(i2c_address >> 1), (uint8_t)count, (uint8_t)
true);
401 while (Wire.available())
405 if ((data == terminator) || (i == (count-1)))
412 Wire.endTransmission();
446 uint8_t byte_count = 0;
486 uint8_t byte_count = 0;
529 uint8_t byte_count = 0;
char option
Demo Circuit option (A)
uint8_t eeprom_read_byte(uint8_t i2c_address, char *data, uint16_t address)
Read a data byte at address from the EEPROM with i2c_address.
uint8_t eeprom_read_buffer(uint8_t i2c_address, char *buffer, uint16_t address, uint8_t count)
Read data bytes from the EEPROM starting at address until number bytes read equals count...
#define EEPROM_I2C_ADDRESS
uint8_t eeprom_read_buffer_with_terminator(uint8_t i2c_address, char *buffer, uint16_t address, char terminator, uint8_t count)
Read data bytes from the EEPROM starting at address until the terminator is read or the number bytes ...
uint8_t eeprom_read_float(uint8_t i2c_address, float *read_data, uint16_t address)
Read the four byte float data from the EEPROM starting at address.
char name[15]
Demo Circuit number (DC1678)
Structure to hold parsed information from ID string - example: LTC2654-L16,Cls,D2636,01,01,DC,DC1678A-A,----—.
uint8_t eeprom_write_int32(uint8_t i2c_address, int32_t write_data, uint16_t address)
Write the 4 byte long data to the EEPROM starting at address.
Header File for Linduino Libraries and Demo Code.
uint8_t read_quikeval_id_string(char *buffer)
Read the id string from the EEPROM, then parse the product name, demo board name, and demo board opti...
struct demo_board_type demo_board
Instantiate demo board structure.
uint8_t eeprom_read_int32(uint8_t i2c_address, int32_t *read_data, uint16_t address)
Read the four byte long data from the EEPROM starting at address.
#define QUIKEVAL_MUX_MODE_PIN
QUIKEVAL_MUX_MODE_PIN defines the control pin for the QuikEval MUX.
uint8_t eeprom_write_byte_array(uint8_t i2c_address, char data[], uint16_t address, uint8_t num_bytes)
Write the data byte array to the EEPROM with i2c_address starting at EEPROM address.
int8_t discover_demo_board(char *demo_name)
Read the ID string from the EEPROM and determine if the correct board is connected.
int8_t eeprom_poll(uint8_t i2c_address)
Determine if the EEPROM is ready for communication by writing the address+!write byte and looking for...
union LT_union_int32_4bytes data
uint8_t enable_calibration()
Functions to set and clear the calibration key.
LT_I2C: Routines to communicate with ATmega328P's hardware I2C port.
uint8_t disable_calibration()
Disable calibration key.
#define EEPROM_CAL_STATUS_ADDRESS
int8_t eeprom_write_poll(uint8_t i2c_address)
Wait for the eeprom write cycle to complete by executing the acknowledge polling loop.
#define QUIKEVAL_ID_TERMINATOR
0x0A terminates the ID String
uint8_t eeprom_write_int16(uint8_t i2c_address, int16_t write_data, uint16_t address)
Write the 2 byte integer data to the EEPROM starting at address.
uint8_t eeprom_write_buffer(uint8_t i2c_address, char *buffer, uint16_t address)
Write the buffer to the EEPROM with i2c_address starting at EEPROM address in blocks of EEPROM_PAGE_S...
#define QUIKEVAL_ID_SIZE
Historical length of the ID string.
uint8_t eeprom_read_byte_array(uint8_t i2c_address, char *data, uint16_t address, uint8_t num_bytes)
Read a data byte at address from the EEPROM with i2c_address.
char demo_name[]
Demo Board Name stored in QuikEval EEPROM.
uint8_t eeprom_write_float(uint8_t i2c_address, float write_data, uint16_t address)
Write the 4 byte float data to the EEPROM starting at address.
uint8_t eeprom_read_int16(uint8_t i2c_address, int16_t *read_data, uint16_t address)
Read the two byte integer data from the EEPROM starting at address.
char product_name[15]
LTC Product (LTC2654-L16)
uint8_t eeprom_write_byte(uint8_t i2c_address, char data, uint16_t address)
Write the data byte to the EEPROM with i2c_address starting at EEPROM address.
char ui_buffer[UI_BUFFER_SIZE]