| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

Functions | Variables
QuikEval_EEPROM.cpp File Reference
Linduino: Linear Technology Arduino-Compatible Demonstration Board Support Libraries » QuikEval EEPROM library

Library for reading from and writing to the EEPROM on QuikEval-compatible demo boards. More...

## Detailed Description

Library for reading from and writing to the EEPROM on QuikEval-compatible demo boards.

Definition in file QuikEval_EEPROM.cpp.

Go to the source code of this file.

## 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...

## Variables
struct demo_board_type | demo_board
| Instantiate demo board structure. More...

## Function Documentation

## ◆ disable_calibration()

uint8_t disable_calibration | ( |  | ) |

Disable calibration key.

Definition at line 502 of file QuikEval_EEPROM.cpp.

## ◆ discover_demo_board()

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.

## ◆ eeprom_poll()

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.

## ◆ eeprom_read_buffer()

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.

## ◆ eeprom_read_buffer_with_terminator()

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.

## ◆ eeprom_read_byte()

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.

## ◆ eeprom_read_byte_array()

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.

## ◆ eeprom_read_float()

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.

## ◆ eeprom_read_int16()

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.

## ◆ eeprom_read_int32()

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.

## ◆ eeprom_write_buffer()

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.

## ◆ eeprom_write_byte()

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.

## ◆ eeprom_write_byte_array()

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.

## ◆ eeprom_write_float()

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.

## ◆ eeprom_write_int16()

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.

## ◆ eeprom_write_int32()

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.

## ◆ eeprom_write_poll()

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.

## ◆ enable_calibration()

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.

## ◆ read_quikeval_id_string()

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.

## Variable Documentation

## ◆ demo_board

struct demo_board_type demo_board

Instantiate demo board structure.

Definition at line 71 of file QuikEval_EEPROM.cpp.