#include <inttypes.h>
Go to the source code of this file.
Define Documentation
#define EEPROM_SIZE (4096 - 64) |
#define EEPROM_CMD_8_BIT_READ 0 |
#define EEPROM_CMD_16_BIT_READ 1 |
#define EEPROM_CMD_32_BIT_READ 2 |
#define EEPROM_CMD_8_BIT_WRITE 3 |
#define EEPROM_CMD_16_BIT_WRITE 4 |
#define EEPROM_CMD_32_BIT_WRITE 5 |
#define EEPROM_CMD_ERASE_PRG_PAGE 6 |
#define EEPROM_CMD_RDPREFETCH _BV(3) |
#define EEPROM_PAGE_SIZE 64 |
#define EEPROM_PAGE_NUM 64 |
#define EEPROM_PAGE_OFFSET_MASK 0x3F |
#define EEPROM_PAGE_NUM_MASK (0x3F << 6) |
#define EEPROM_PAGE_OFFSET |
( |
|
n | ) |
((n) & 0x3F) |
#define EEPROM_PAGE_ADRESS |
( |
|
n | ) |
(((n) & 0x3F) << 6) |
#define EEPROM_WDATA_8_BIT |
( |
|
n | ) |
((n) & 0x000000FF) |
#define EEPROM_WDATA_16_BIT |
( |
|
n | ) |
((n) & 0x0000FFFF) |
#define EEPROM_WDATA_32_BIT |
( |
|
n | ) |
((n) & 0xFFFFFFFF) |
#define EEPROM_RDATA_8_BIT |
( |
|
n | ) |
((n) & 0x000000FF) |
#define EEPROM_RDATA_16_BIT |
( |
|
n | ) |
((n) & 0x0000FFFF) |
#define EEPROM_RDATA_32_BIT |
( |
|
n | ) |
((n) & 0xFFFFFFFF) |
#define EEPROM_PWRDWN _BV(0) |
#define EEPROM_ENDOF_RW 26 |
#define EEPROM_ENDOF_PROG 28 |
Function Documentation
void Lpc177x_8x_EepromInit |
( |
void |
| ) |
|
int Lpc177x_8x_EepromRead |
( |
uint16_t |
addr, |
|
|
void * |
buff, |
|
|
size_t |
size |
|
) |
| |
Read data from EEPROM at specific address.
- Parameters:
-
address | EEPROM address that start to write data, it must be in range 0..0x1000 |
buff | buffer to place the read data in |
size | number of bytes to be read |
- Returns:
- none
References _BV, EEPROM_CMD_8_BIT_READ, EEPROM_CMD_RDPREFETCH, EEPROM_ENDOF_PROG, EEPROM_ENDOF_RW, EEPROM_PAGE_ADRESS, EEPROM_PAGE_NUM, EEPROM_PAGE_NUM_MASK, EEPROM_PAGE_OFFSET, EEPROM_PAGE_OFFSET_MASK, EEPROM_PAGE_SIZE, EEPROM_SIZE, Lpc177x_8x_EepromInit(), and LPC_EEPROM.
Referenced by NutNvMemLoad().
int Lpc177x_8x_EepromWrite |
( |
uint16_t |
addr, |
|
|
const void * |
buff, |
|
|
size_t |
size |
|
) |
| |
Write data to EEPROM at specific address.
- Parameters:
-
address | EEPROM address that start to write data, it must be in range 0..0x1000 |
buff | buffer that contain data that will be written to buffer |
size | number of bytes to be written |
- Returns:
- none
References _BV, EEPROM_CMD_8_BIT_WRITE, EEPROM_CMD_ERASE_PRG_PAGE, EEPROM_ENDOF_PROG, EEPROM_ENDOF_RW, EEPROM_PAGE_ADRESS, EEPROM_PAGE_NUM, EEPROM_PAGE_NUM_MASK, EEPROM_PAGE_OFFSET, EEPROM_PAGE_OFFSET_MASK, EEPROM_PAGE_SIZE, EEPROM_SIZE, Lpc177x_8x_EepromInit(), and LPC_EEPROM.
Referenced by NutNvMemSave().