![]() |
Linduino
1.3.0
Linear Technology Arduino-Compatible Demonstration Board
|
QuikEval EEPROM Library. More...
QuikEval EEPROM Library.
Copyright 2018(c) Analog Devices, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Header file for QuikEval EEPROM library
Definition in file QuikEval_EEPROM_Wire.h.
Go to the source code of this file.
Data Structures | |
struct | demo_board_type |
Structure to hold parsed information from ID string - example: LTC2654-L16,Cls,D2636,01,01,DC,DC1678A-A,----—. More... | |
Functions | |
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 option from the id string into the global demo_board variable. More... | |
int8_t | discover_demo_board (char *demo_name) |
Read the ID string from the EEPROM and determine if the correct board is connected. More... | |
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 an acknowledge. More... | |
int8_t | eeprom_write_poll (uint8_t i2c_address) |
Wait for the eeprom write cycle to complete by executing the acknowledge polling loop. More... | |
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. More... | |
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. More... | |
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_SIZE bytes. More... | |
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. More... | |
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. More... | |
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. More... | |
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 read equals count. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
uint8_t | enable_calibration () |
Functions to set and clear the calibration key. More... | |
uint8_t | disable_calibration () |
Disable calibration key. More... | |
Macros | |
#define | QUIKEVAL_ID_SIZE 50 |
Historical length of the ID string. More... | |
#define | QUIKEVAL_ID_TERMINATOR 0x0A |
0x0A terminates the ID String More... | |
EEPROM constants | |
#define | EEPROM_CAL_STATUS_ADDRESS 0x40 |
#define | EEPROM_CAL_KEY 0x1234 |
#define | EEPROM_I2C_ADDRESS 0xA0 |
#define | EEPROM_PAGE_SIZE 16 |
#define | EEPROM_DATA_SIZE 256 |
#define | EEPROM_TIMEOUT 10 |
Variables | |
demo_board_type | demo_board |
Instantiate demo board structure. More... | |
uint8_t disable_calibration | ( | ) |
Disable calibration key.
Definition at line 502 of file QuikEval_EEPROM.cpp.
int8_t discover_demo_board | ( | char * | demo_name | ) |
Read the ID string from the EEPROM and determine if the correct board is connected.
Returns 1 if successful, 0 if not successful
Definition at line 141 of file QuikEval_EEPROM.cpp.
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 an acknowledge.
This is repeated every 1ms until an acknowledge occurs, or a timeout occurs. If a timeout occurs, an I2C stop is generated. Returns 0 if an acknowledge is generated and 1 if not.
Definition at line 180 of file QuikEval_EEPROM.cpp.
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.
A null terminator is added to the end of the buffer. Returns the number of bytes read.
Definition at line 317 of file QuikEval_EEPROM.cpp.
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 read equals count.
A null terminator is placed at the end of the buffer. Returns the number of bytes read.
Definition at line 347 of file QuikEval_EEPROM.cpp.
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.
Returns the number of bytes read.
Definition at line 282 of file QuikEval_EEPROM.cpp.
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.
Returns the number of bytes read.
Definition at line 304 of file QuikEval_EEPROM.cpp.
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.
Returns the total number of bytes written
Definition at line 435 of file QuikEval_EEPROM.cpp.
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.
Returns the total number of bytes read.
Definition at line 395 of file QuikEval_EEPROM.cpp.
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.
Returns the total number of bytes written
Definition at line 478 of file QuikEval_EEPROM.cpp.
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_SIZE bytes.
Returns the total number of byte written
Definition at line 246 of file QuikEval_EEPROM.cpp.
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.
Returns the total number of bytes written
Definition at line 214 of file QuikEval_EEPROM.cpp.
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.
! Returns the total number of bytes written
Definition at line 234 of file QuikEval_EEPROM.cpp.
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.
Use the eeprom_write_byte routine to avoid keeping track of page boundaries with the eeprom_write_buffer routine. Returns the total number of bytes written.
Definition at line 412 of file QuikEval_EEPROM.cpp.
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.
Use the eeprom_write_byte routine to avoid keeping track of page boundaries with the eeprom_write_buffer routine. Returns the total number of bytes written.
Definition at line 377 of file QuikEval_EEPROM.cpp.
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.
Use the eeprom_write_byte routine to avoid keeping track of page boundaries with the eeprom_write_buffer routine. Returns the total number of bytes written.
Definition at line 455 of file QuikEval_EEPROM.cpp.
int8_t eeprom_write_poll | ( | uint8_t | i2c_address | ) |
Wait for the eeprom write cycle to complete by executing the acknowledge polling loop.
Returns 0 if an acknowledge is generated and 1 if not.
Definition at line 206 of file QuikEval_EEPROM.cpp.
uint8_t enable_calibration | ( | ) |
Functions to set and clear the calibration key.
Useful for swtiching between calibrated operation and default operation, without actually clearing the stored calibration numbers. Enable calibration key
Definition at line 496 of file QuikEval_EEPROM.cpp.
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 option from the id string into the global demo_board variable.
Returns the number of characters read from the information string.
Definition at line 77 of file QuikEval_EEPROM.cpp.
#define EEPROM_CAL_KEY 0x1234 |
Definition at line 59 of file QuikEval_EEPROM_Wire.h.
#define EEPROM_CAL_STATUS_ADDRESS 0x40 |
Definition at line 58 of file QuikEval_EEPROM_Wire.h.
#define EEPROM_DATA_SIZE 256 |
Definition at line 62 of file QuikEval_EEPROM_Wire.h.
#define EEPROM_I2C_ADDRESS 0xA0 |
Definition at line 60 of file QuikEval_EEPROM_Wire.h.
#define EEPROM_PAGE_SIZE 16 |
Definition at line 61 of file QuikEval_EEPROM_Wire.h.
#define EEPROM_TIMEOUT 10 |
Definition at line 63 of file QuikEval_EEPROM_Wire.h.
#define QUIKEVAL_ID_SIZE 50 |
Historical length of the ID string.
There are 256 bytes in the 24LC024 EEPROM, the rest is free for user data.
Definition at line 51 of file QuikEval_EEPROM_Wire.h.
#define QUIKEVAL_ID_TERMINATOR 0x0A |
0x0A terminates the ID String
Definition at line 54 of file QuikEval_EEPROM_Wire.h.
demo_board_type demo_board |
Instantiate demo board structure.
Definition at line 71 of file QuikEval_EEPROM.cpp.