65 #include <util/delay.h> 80 uint8_t comma_position[8] = {0};
81 uint8_t comma_count = 0;
88 int8_t QUIKEVAL_MUX_MODE_PIN_state;
93 if (buffer_count == 0)
return(0);
95 for (i = 0; i < buffer_count; i++)
97 if (buffer[i] ==
',') comma_position[comma_count++]=
i;
100 if (comma_position[6] < comma_position[5])
102 for (i = buffer_count - 2; i > comma_position[5]; i--)
104 if (buffer[i] !=
'-')
106 comma_position[6] = i+1;
115 for (i = 0; i < comma_position[0]; i++)
123 for (i = comma_position[5]+1; i < comma_position[6]; i++)
136 return(buffer_count);
152 Serial.print(
"Demo Board Name: ");
154 Serial.print(
"Product Name: ");
158 Serial.print(
"Demo Board Option: ");
164 Serial.print(
"Demo board ");
165 Serial.print(demo_name);
166 Serial.print(
" not found, \nfound ");
168 Serial.println(
" instead. \nConnect the correct demo board, then press the reset button.");
189 for (timer_count = 0; timer_count <
EEPROM_TIMEOUT; timer_count++)
216 uint8_t byte_count = 0;
237 for (i = 0; i < num_bytes; i++)
255 for (i = 0; i < page_count; i++)
262 byte_count = strlen(buffer)-
index;
265 for (j = 0; j < byte_count; j++)
284 uint8_t byte_count = 0;
307 for (i = 0; i < num_bytes; i++)
329 for (i = 0; i < count-1; i++)
359 for (i = 0; i < count-1; i++)
363 if (data == terminator)
break;
402 uint8_t byte_count = 0;
442 uint8_t byte_count = 0;
485 uint8_t byte_count = 0;
struct demo_board_type demo_board
Instantiate demo board structure.
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 option
Demo Circuit option (A)
uint8_t enable_calibration()
Functions to set and clear the calibration key.
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...
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.
#define EEPROM_I2C_ADDRESS
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 name[15]
Demo Circuit number (DC1678)
Structure to hold parsed information from ID string - example: LTC2654-L16,Cls,D2636,01,01,DC,DC1678A-A,----—.
Header File for Linduino Libraries and Demo Code.
int8_t eeprom_write_poll(uint8_t i2c_address)
Wait for the eeprom write cycle to complete by executing the acknowledge polling loop.
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.
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.
#define QUIKEVAL_MUX_MODE_PIN
QUIKEVAL_MUX_MODE_PIN defines the control pin for the QuikEval MUX.
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.
void i2c_stop()
Write stop bit to the hardware I2C port.
int8_t i2c_start()
Write start bit to the hardware I2C port.
union LT_union_int32_4bytes data
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 WITH_NACK
Use with i2c_read(WITH_NACK) to read without an acknowledge.
uint8_t disable_calibration()
Disable calibration key.
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_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.
int8_t i2c_write(uint8_t data)
Send a data byte to hardware I2C port.
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.
#define EEPROM_CAL_STATUS_ADDRESS
int8_t discover_demo_board(char *demo_name)
Read the ID string from the EEPROM and determine if the correct board is connected.
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 ...
#define QUIKEVAL_ID_TERMINATOR
0x0A terminates the ID String
#define QUIKEVAL_ID_SIZE
Historical length of the ID string.
LT_I2C: Routines to communicate with ATmega328P's hardware I2C port.
char demo_name[]
Demo Board Name stored in QuikEval EEPROM.
int8_t i2c_repeated_start()
Write a repeat start bit to the hardware I2C port.
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.
char product_name[15]
LTC Product (LTC2654-L16)
uint8_t i2c_read(int8_t ack)
Read a data byte from the hardware I2C port.
#define WITH_ACK
Use with i2c_read(WITH_ACK) to read with an acknowledge.
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...
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...
char ui_buffer[UI_BUFFER_SIZE]